-
Notifications
You must be signed in to change notification settings - Fork 152
bpf: verifier improvement in 32bit shift sign extension pattern #10411
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
Conversation
|
Upstream branch: ff34657 |
886a6a6 to
4eeea58
Compare
|
Upstream branch: ff34657 |
2516da2 to
0296e9c
Compare
4eeea58 to
a9395d7
Compare
|
Upstream branch: 8f7aa3d |
0296e9c to
c99e2b0
Compare
a9395d7 to
c320ac6
Compare
|
Upstream branch: 835a507 |
c99e2b0 to
c08ae02
Compare
c320ac6 to
d24fc80
Compare
|
Upstream branch: 835a507 |
c08ae02 to
6babdee
Compare
d24fc80 to
155b58a
Compare
|
Upstream branch: 835a507 |
6babdee to
b789d50
Compare
155b58a to
942f7c3
Compare
|
Upstream branch: 81f88f6 |
b789d50 to
3a65a3f
Compare
942f7c3 to
caaaee4
Compare
|
Upstream branch: 5d9fb42 |
3a65a3f to
ae23451
Compare
caaaee4 to
0f1145d
Compare
|
Upstream branch: 5d9fb42 |
ae23451 to
ec1d4a5
Compare
0f1145d to
fabb672
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 <cupertino.miranda@oracle.com> Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Cc: David Faust <david.faust@oracle.com> Cc: Jose Marchesi <jose.marchesi@oracle.com> Cc: Elena Zannoni <elena.zannoni@oracle.com>
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 <cupertino.miranda@oracle.com> Signed-off-by: Andrew Pinski <andrew.pinski@oss.qualcomm.com> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Cc: David Faust <david.faust@oracle.com> Cc: Jose Marchesi <jose.marchesi@oracle.com> Cc: Elena Zannoni <elena.zannoni@oracle.com>
|
Upstream branch: c93c124 |
ec1d4a5 to
1402d63
Compare
fabb672 to
3119ae5
Compare
|
At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1029813 irrelevant now. Closing PR. |
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