-
Notifications
You must be signed in to change notification settings - Fork 5
bpf: verifier improvement in 32bit shift sign extension pattern #6451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: bpf-next_base
Are you sure you want to change the base?
bpf: verifier improvement in 32bit shift sign extension pattern #6451
Conversation
|
Upstream branch: ff34657 |
52f5a27 to
037d2fc
Compare
|
Upstream branch: ff34657 |
b3cc3d9 to
fdfbe76
Compare
037d2fc to
8f722b4
Compare
|
Upstream branch: 8f7aa3d |
fdfbe76 to
296fdb9
Compare
8f722b4 to
03e2ed2
Compare
|
Upstream branch: 835a507 |
296fdb9 to
5228a56
Compare
03e2ed2 to
3ea267d
Compare
|
Upstream branch: 835a507 |
5228a56 to
e331915
Compare
3ea267d to
6d4eb64
Compare
|
Upstream branch: 835a507 |
e331915 to
bdbe9f9
Compare
6d4eb64 to
af4bac7
Compare
|
Upstream branch: 81f88f6 |
bdbe9f9 to
d146b5b
Compare
af4bac7 to
6ba2fc1
Compare
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]>
This commit adds 3 tests to verify a common compiler generated pattern for sign extension (r1 <<= 32; r1 s>>= 32). The tests make sure the register bounds are correctly computed both for positive and negative register values. 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]>
|
Upstream branch: 5d9fb42 |
d146b5b to
ab59880
Compare
Pull request for series with
subject: bpf: verifier improvement in 32bit shift sign extension pattern
version: 3
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1029813