Commit ae19ae5
committed
bpf: Replace PTR_TO_XXX_OR_NULL with PTR_TO_XXX | PTR_MAYBE_NULL
jira VULN-132
cve CVE-2022-0500
commit-author Hao Luo <[email protected]>
commit c25b2ae
upstream-diff A merge confict arised because bfc6bb7 ("bpf:
Implement verifier support for validation of async callbacks.") and
3e8ce29 ("bpf: Prevent pointer mismatch in bpf_timer_init.")
do not exist in our tree.
We have introduced a new type to make bpf_reg composable, by
allocating bits in the type to represent flags.
One of the flags is PTR_MAYBE_NULL which indicates a pointer
may be NULL. This patch switches the qualified reg_types to
use this flag. The reg_types changed in this patch include:
1. PTR_TO_MAP_VALUE_OR_NULL
2. PTR_TO_SOCKET_OR_NULL
3. PTR_TO_SOCK_COMMON_OR_NULL
4. PTR_TO_TCP_SOCK_OR_NULL
5. PTR_TO_BTF_ID_OR_NULL
6. PTR_TO_MEM_OR_NULL
7. PTR_TO_RDONLY_BUF_OR_NULL
8. PTR_TO_RDWR_BUF_OR_NULL
Signed-off-by: Hao Luo <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
(cherry picked from commit c25b2ae)
Signed-off-by: Pratham Patel <[email protected]>1 parent e3b6894 commit ae19ae5
File tree
7 files changed
+145
-186
lines changed- include/linux
- kernel/bpf
- net/core
7 files changed
+145
-186
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
| 447 | + | |
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
455 | 454 | | |
456 | | - | |
457 | 455 | | |
458 | | - | |
459 | 456 | | |
460 | 457 | | |
461 | 458 | | |
| |||
473 | 470 | | |
474 | 471 | | |
475 | 472 | | |
476 | | - | |
477 | 473 | | |
478 | | - | |
479 | 474 | | |
480 | | - | |
481 | 475 | | |
482 | | - | |
483 | 476 | | |
484 | 477 | | |
485 | | - | |
486 | 478 | | |
487 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
451 | 453 | | |
452 | 454 | | |
453 | 455 | | |
| 456 | + | |
| 457 | + | |
454 | 458 | | |
455 | 459 | | |
456 | 460 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4753 | 4753 | | |
4754 | 4754 | | |
4755 | 4755 | | |
| 4756 | + | |
4756 | 4757 | | |
| 4758 | + | |
| 4759 | + | |
4757 | 4760 | | |
4758 | | - | |
4759 | | - | |
| 4761 | + | |
| 4762 | + | |
4760 | 4763 | | |
4761 | 4764 | | |
4762 | 4765 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
0 commit comments