]> git.ipfire.org Git - thirdparty/linux.git/commit
Merge branch 'bpf-recognize-special-arithmetic-shift-in-the-verifier'
authorAlexei Starovoitov <ast@kernel.org>
Tue, 13 Jan 2026 17:33:38 +0000 (09:33 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 13 Jan 2026 17:33:39 +0000 (09:33 -0800)
commitda4ab5dcc975d5221611f36467eadc5e32b5a1ad
tree6357e2f47ee6e2cea79d41f8ed0bbc100f248427
parent1fffe1f4b9763b5f8093493056e31783b646b36c
parent9160335317cb404f54ad2f509546c666ddd4d0eb
Merge branch 'bpf-recognize-special-arithmetic-shift-in-the-verifier'

Puranjay Mohan says:

====================
bpf: Recognize special arithmetic shift in the verifier

v3: https://lore.kernel.org/all/20260103022310.935686-1-puranjay@kernel.org/
Changes in v3->v4:
- Fork verifier state while processing BPF_OR when src_reg has [-1,0]
  range and 2nd operand is a constant. This is to detect the following pattern:
i32 X > -1 ? C1 : -1 --> (X >>s 31) | C1
- Add selftests for above.
- Remove __description("s>>=63") (Eduard in another patchset)

v2: https://lore.kernel.org/bpf/20251115022611.64898-1-alexei.starovoitov@gmail.com/
Changes in v2->v3:
- fork verifier state while processing BPF_AND when src_reg has [-1,0]
  range and 2nd operand is a constant.

v1->v2:
Use __mark_reg32_known() or __mark_reg_known() for zero too.
Add comment to selftest.

v1:
https://lore.kernel.org/bpf/20251114031039.63852-1-alexei.starovoitov@gmail.com/
====================

Link: https://patch.msgid.link/20260112201424.816836-1-puranjay@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>