Commit 35be2f8
committed
bpf: Make per_cpu_ptr return rdonly PTR_TO_MEM.
jira VULN-132
cve CVE-2022-0500
commit-author Hao Luo <[email protected]>
commit 34d3a78
Tag the return type of {per, this}_cpu_ptr with RDONLY_MEM. The
returned value of this pair of helpers is kernel object, which
can not be updated by bpf programs. Previously these two helpers
return PTR_OT_MEM for kernel objects of scalar type, which allows
one to directly modify the memory. Now with RDONLY_MEM tagging,
the verifier will reject programs that write into RDONLY_MEM.
Fixes: 63d9b80 ("bpf: Introducte bpf_this_cpu_ptr()")
Fixes: eaa6bcb ("bpf: Introduce bpf_per_cpu_ptr()")
Fixes: 4976b71 ("bpf: Introduce pseudo_btf_id")
Signed-off-by: Hao Luo <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
(cherry picked from commit 34d3a78)
Signed-off-by: Pratham Patel <[email protected]>1 parent 37a7d6d commit 35be2f8
2 files changed
+28
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
663 | | - | |
| 663 | + | |
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| |||
673 | 673 | | |
674 | 674 | | |
675 | 675 | | |
676 | | - | |
| 676 | + | |
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4076 | 4076 | | |
4077 | 4077 | | |
4078 | 4078 | | |
4079 | | - | |
| 4079 | + | |
| 4080 | + | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
| 4091 | + | |
| 4092 | + | |
| 4093 | + | |
4080 | 4094 | | |
4081 | 4095 | | |
4082 | 4096 | | |
4083 | 4097 | | |
4084 | 4098 | | |
| 4099 | + | |
4085 | 4100 | | |
4086 | 4101 | | |
4087 | | - | |
| 4102 | + | |
4088 | 4103 | | |
4089 | 4104 | | |
4090 | 4105 | | |
| |||
6092 | 6107 | | |
6093 | 6108 | | |
6094 | 6109 | | |
| 6110 | + | |
| 6111 | + | |
| 6112 | + | |
| 6113 | + | |
| 6114 | + | |
| 6115 | + | |
| 6116 | + | |
6095 | 6117 | | |
6096 | 6118 | | |
6097 | 6119 | | |
| |||
8877 | 8899 | | |
8878 | 8900 | | |
8879 | 8901 | | |
8880 | | - | |
| 8902 | + | |
8881 | 8903 | | |
8882 | 8904 | | |
8883 | 8905 | | |
| |||
10969 | 10991 | | |
10970 | 10992 | | |
10971 | 10993 | | |
10972 | | - | |
| 10994 | + | |
10973 | 10995 | | |
10974 | 10996 | | |
10975 | 10997 | | |
| |||
0 commit comments