bpf: Fix unsound scalar forking for BPF_OR
Status from this message: This series was applied to bpf/bpf.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest2 patches 0 repliesApplied 2/2
- v32 patches 5 repliesSuperseded
- v22 patches 2 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 2 patches | 4 replies | Superseded |
Patches in v4 All 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_ORkernel/ | +1 | 0 replies | Applied |
| 2/2 | selftests/bpf: Add tests for maybe_fork_scalars() OR vs AND handlingtools/ | +94 | 0 replies | Applied |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Amery Hung | Eduard Zingerman |
|---|---|---|
| 1/2 | R-b | A-b |
| 2/2 | R-b | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf v4 0/2] bpf: Fix unsound scalar forking for BPF_OR
maybe_fork_scalars() unconditionally sets the pushed path dst register to 0 for both BPF_AND and BPF_OR. For AND this is correct (0 & K == 0), but for OR it is wrong (0 | K == K, not 0). This causes the verifier to track an incorrect value on the pushed path, leading to a verifier/runtime divergence that allows out-of-bounds map value access.
v4: Use block comment style for multi-line comments in selftests (Amery Hung)
Add Reviewed-by/Acked-by tags
v3: Use single-line comment style in selftests (Alexei Starovoitov)
v2: Use push_stack(env, env->insn_idx, ...) to re-execute the insn
on the pushed path (Eduard Zingerman)
Daniel Wade (2):
bpf: Fix unsound scalar forking in maybe_fork_scalars() for BPF_OR selftests/bpf: Add tests for maybe_fork_scalars() OR vs AND handling
kernel/bpf/verifier.c | 2 +- .../selftests/bpf/progs/verifier_bounds.c | 94 +++++++++++++++++++ 2 files changed, 95 insertions(+), 1 deletion(-)
Signature · 1 line
2.43.0