Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 6.6.y 00/10] bpf: fix precision backtracking instruction iteration
@ 2026-05-11 16:21 Paul Chaignon
  2026-05-11 16:22 ` [PATCH 6.6.y 01/10] bpf: support non-r10 register spill/fill to/from stack in precision tracking Paul Chaignon
                   ` (11 more replies)
  0 siblings, 12 replies; 14+ messages in thread
From: Paul Chaignon @ 2026-05-11 16:21 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, Shung-Hsi Yu, Daniel Borkmann,
	Alexei Starovoitov, Eduard Zingerman, Andrii Nakryiko, Tao Lyu,
	Levi Zim

The first patch in this patchset was already backported before, as
commit ecc2aeeaa08a, to address CVE-2023-52920 [1]. That backport was
however later reverted in commit 199f04528737 because it reduced the
efficiency of the BPF verifier, to the point that it rejected some
previously-accepted programs.

This patchset backports commit 41f6f64e6999 ("bpf: support non-r10
register spill/fill to/from stack in precision tracking") again, but
this time with the subsequent commits that improved the efficiency of
the verifier. In addition, the last two commits fix and test a
regression that was later found in commit 41f6f64e6999.

It took us a while with Shung-Hsi to come back to this because we felt
we didn't have enough test coverage to backport this. That changed with
the stable BPF CI Shung-Hsi built for v6.6, which successfully
validated this patchset [2]. In addition, I tested the impact of this
patchset on the verifier's efficiency with Cilium's BPF programs [3]:
it significantly improves, reducing the number of instructions the
verifier has to analyze by up to 87% in some cases!

1: https://lore.kernel.org/linux-cve-announce/2024110518-CVE-2023-52920-17f6@gregkh/
2: https://github.com/pchaigno/stable-bpf-ci/actions/runs/25671397661/job/75357317078
3: https://pchaigno.github.io/test-verifier-complexity.html

Andrii Nakryiko (10):
  bpf: support non-r10 register spill/fill to/from stack in precision
    tracking
  selftests/bpf: add stack access precision test
  bpf: preserve STACK_ZERO slots on partial reg spills
  selftests/bpf: validate STACK_ZERO is preserved on subreg spill
  bpf: preserve constant zero when doing partial register restore
  selftests/bpf: validate zero preservation for sub-slot loads
  bpf: track aligned STACK_ZERO cases as imprecise spilled registers
  selftests/bpf: validate precision logic in
    partial_stack_load_preserves_zeros
  bpf: handle fake register spill to stack with BPF_ST_MEM instruction
  selftests/bpf: validate fake register spill/fill precision
    backtracking logic

 include/linux/bpf_verifier.h                  |  31 +-
 kernel/bpf/verifier.c                         | 233 +++++++++------
 .../selftests/bpf/progs/verifier_spill_fill.c | 281 ++++++++++++++++++
 .../bpf/progs/verifier_subprog_precision.c    |  87 +++++-
 .../testing/selftests/bpf/verifier/precise.c  |  38 ++-
 5 files changed, 557 insertions(+), 113 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-05-12 12:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 16:21 [PATCH 6.6.y 00/10] bpf: fix precision backtracking instruction iteration Paul Chaignon
2026-05-11 16:22 ` [PATCH 6.6.y 01/10] bpf: support non-r10 register spill/fill to/from stack in precision tracking Paul Chaignon
2026-05-11 16:23 ` [PATCH 6.6.y 02/10] selftests/bpf: add stack access precision test Paul Chaignon
2026-05-11 16:23 ` [PATCH 6.6.y 03/10] bpf: preserve STACK_ZERO slots on partial reg spills Paul Chaignon
2026-05-11 16:24 ` [PATCH 6.6.y 04/10] selftests/bpf: validate STACK_ZERO is preserved on subreg spill Paul Chaignon
2026-05-11 16:24 ` [PATCH 6.6.y 05/10] bpf: preserve constant zero when doing partial register restore Paul Chaignon
2026-05-11 16:24 ` [PATCH 6.6.y 06/10] selftests/bpf: validate zero preservation for sub-slot loads Paul Chaignon
2026-05-11 16:24 ` [PATCH 6.6.y 07/10] bpf: track aligned STACK_ZERO cases as imprecise spilled registers Paul Chaignon
2026-05-11 16:24 ` [PATCH 6.6.y 08/10] selftests/bpf: validate precision logic in partial_stack_load_preserves_zeros Paul Chaignon
2026-05-11 16:25 ` [PATCH 6.6.y 09/10] bpf: handle fake register spill to stack with BPF_ST_MEM instruction Paul Chaignon
2026-05-11 16:25 ` [PATCH 6.6.y 10/10] selftests/bpf: validate fake register spill/fill precision backtracking logic Paul Chaignon
2026-05-12  0:17 ` [PATCH 6.6.y 00/10] bpf: fix precision backtracking instruction iteration Sasha Levin
2026-05-12 12:01   ` Paul Chaignon
2026-05-12  6:51 ` Levi Zim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox