Repository navigation
Commit d3bd741
bpf: fix sanitation of alu op with pointer / scalar type from different paths
While 979d63d ("bpf: prevent out of bounds speculation on pointer
arithmetic") took care of rejecting alu op on pointer when e.g. pointer
came from two different map values with different map properties such as
value size, Jann reported that a case was not covered yet when a given
alu op is used in both "ptr_reg += reg" and "numeric_reg += reg" from
different branches where we would incorrectly try to sanitize based
on the pointer's limit. Catch this corner case and reject the program
instead.
Fixes: 979d63d ("bpf: prevent out of bounds speculation on pointer arithmetic")
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent 466f89e commit d3bd741
2 files changed
Lines changed: 49 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3103 | 3103 | | |
3104 | 3104 | | |
3105 | 3105 | | |
| 3106 | + | |
| 3107 | + | |
| 3108 | + | |
| 3109 | + | |
| 3110 | + | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
| 3116 | + | |
| 3117 | + | |
| 3118 | + | |
| 3119 | + | |
| 3120 | + | |
| 3121 | + | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
| 3127 | + | |
| 3128 | + | |
| 3129 | + | |
| 3130 | + | |
| 3131 | + | |
| 3132 | + | |
| 3133 | + | |
| 3134 | + | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
3106 | 3140 | | |
3107 | 3141 | | |
3108 | 3142 | | |
| |||
3117 | 3151 | | |
3118 | 3152 | | |
3119 | 3153 | | |
3120 | | - | |
| 3154 | + | |
3121 | 3155 | | |
3122 | 3156 | | |
3123 | 3157 | | |
| |||
3133 | 3167 | | |
3134 | 3168 | | |
3135 | 3169 | | |
3136 | | - | |
3137 | | - | |
3138 | | - | |
3139 | | - | |
3140 | | - | |
3141 | | - | |
3142 | | - | |
| 3170 | + | |
3143 | 3171 | | |
3144 | | - | |
3145 | | - | |
3146 | | - | |
3147 | | - | |
3148 | | - | |
3149 | 3172 | | |
3150 | 3173 | | |
3151 | 3174 | | |
| |||
3418 | 3441 | | |
3419 | 3442 | | |
3420 | 3443 | | |
| 3444 | + | |
| 3445 | + | |
3421 | 3446 | | |
3422 | 3447 | | |
3423 | 3448 | | |
| |||
3452 | 3477 | | |
3453 | 3478 | | |
3454 | 3479 | | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
| 3484 | + | |
3455 | 3485 | | |
3456 | 3486 | | |
3457 | 3487 | | |
| |||
3471 | 3501 | | |
3472 | 3502 | | |
3473 | 3503 | | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
3474 | 3509 | | |
3475 | 3510 | | |
3476 | 3511 | | |
| |||
0 commit comments