Skip to content

bpf/verifier: factor BPF_F_TEST_RND_HI32 flag check out of opt_subreg_zext_lo32_rnd_hi32 #5589

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

Open
wants to merge 1 commit into
base: bpf-next_base
Choose a base branch
from

Conversation

kernel-patches-daemon-bpf-rc[bot]
Copy link

Pull request for series with
subject: bpf/verifier: factor BPF_F_TEST_RND_HI32 flag check out of opt_subreg_zext_lo32_rnd_hi32
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=981641

…_zext_lo32_rnd_hi32

BPF programs can be loaded with the BPF_F_TEST_RND_HI32 flag to instruct
the verifier to randomize the high 32 bits of a register being used as a
subregister. This is done in the opt_subreg_zext_lo32_rnd_hi32 pass that
scans the BPF program instruction by instruction, regardless of whether
the flag is set or not, and testing the flag on every iteration. However,
the flag is not modified at verification time, and the function is a no-op
if it is unset.

Gate the randomization pass behind a single flag check instead of
testing the flag in the main loop of the pass.

Signed-off-by: Emil Tsalapatis <[email protected]>
@kernel-patches-daemon-bpf-rc
Copy link
Author

Upstream branch: ea2aecd
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=981641
version: 1

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.

1 participant