Skip to content

Conversation

@kernel-patches-daemon-bpf-rc
Copy link

Pull request for series with
subject: bpf: verifier improvement in 32bit shift sign extension pattern
version: 2
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1027055

@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: acf8726
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1027055
version: 2

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]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: 4617b30
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=1027055
version: 2

@kernel-patches-daemon-bpf-rc
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=1027055 expired. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants