Repository navigation
Commit b027095
Alexei Starovoitov
bpf: Fix propagation of 32-bit signed bounds from 64-bit bounds.
The 64-bit signed bounds should not affect 32-bit signed bounds unless the
verifier knows that upper 32-bits are either all 1s or all 0s. For example the
register with smin_value==1 doesn't mean that s32_min_value is also equal to 1,
since smax_value could be larger than 32-bit subregister can hold.
The verifier refines the smax/s32_max return value from certain helpers in
do_refine_retval_range(). Teach the verifier to recognize that smin/s32_min
value is also bounded. When both smin and smax bounds fit into 32-bit
subregister the verifier can propagate those bounds.
Fixes: 3f50f13 ("bpf: Verifier, do explicit ALU32 bounds tracking")
Reported-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent 4e083fd commit b027095
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1298 | 1298 | | |
1299 | 1299 | | |
1300 | 1300 | | |
1301 | | - | |
1302 | | - | |
1303 | | - | |
| 1301 | + | |
1304 | 1302 | | |
1305 | 1303 | | |
1306 | 1304 | | |
| |||
1314 | 1312 | | |
1315 | 1313 | | |
1316 | 1314 | | |
1317 | | - | |
| 1315 | + | |
1318 | 1316 | | |
1319 | | - | |
1320 | 1317 | | |
| 1318 | + | |
1321 | 1319 | | |
1322 | 1320 | | |
1323 | 1321 | | |
| |||
4895 | 4893 | | |
4896 | 4894 | | |
4897 | 4895 | | |
| 4896 | + | |
| 4897 | + | |
4898 | 4898 | | |
4899 | 4899 | | |
4900 | 4900 | | |
| |||
0 commit comments