Commit 1a4b1a6
bpf: verifier improvement in 32bit shift sign extension pattern
This patch improves the verifier to correctly compute bounds for
sign extension compiler pattern composed of left shift by 32bits
followed by a sign right shift by 32bits. Pattern in the verifier was
limitted to positive value bounds and would reset bound computation for
negative values. New code allows both positive and negative values for
sign extension without compromising bound computation and verifier to
pass.
This change is required by GCC which generate such pattern, and was
detected in the context of systemd, as described in the following GCC
bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119731
Three new tests were added in verifier_subreg.c.
Signed-off-by: Cupertino Miranda <[email protected]>
Signed-off-by: Andrew Pinski <[email protected]>
Acked-by: Eduard Zingerman <[email protected]>
Cc: David Faust <[email protected]>
Cc: Jose Marchesi <[email protected]>
Cc: Elena Zannoni <[email protected]>1 parent 3bd2c43 commit 1a4b1a6
1 file changed
+7
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15301 | 15301 | | |
15302 | 15302 | | |
15303 | 15303 | | |
15304 | | - | |
15305 | | - | |
15306 | | - | |
15307 | | - | |
15308 | | - | |
| 15304 | + | |
| 15305 | + | |
| 15306 | + | |
15309 | 15307 | | |
15310 | | - | |
| 15308 | + | |
15311 | 15309 | | |
15312 | | - | |
15313 | | - | |
15314 | | - | |
15315 | | - | |
15316 | 15310 | | |
15317 | | - | |
| 15311 | + | |
| 15312 | + | |
15318 | 15313 | | |
| 15314 | + | |
15319 | 15315 | | |
15320 | 15316 | | |
15321 | 15317 | | |
| |||
0 commit comments