public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH stable 6.12 0/8] bpf: track changes_pkt_data property for global functions
@ 2025-04-23  5:53 Shung-Hsi Yu
  2025-04-23  5:53 ` [PATCH stable 6.12 1/8] bpf: add find_containing_subprog() utility function Shung-Hsi Yu
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Shung-Hsi Yu @ 2025-04-23  5:53 UTC (permalink / raw)
  To: stable
  Cc: Alexei Starovoitov, Dan Carpenter, Eduard Zingerman,
	Nick Zavaritsky, Shung-Hsi Yu

While stable 6.12 has commit 1a4607ffba35 ("bpf: consider that tail
calls invalidate packet pointers") backported, that alone is not enough
to fix the issue reported by Nick Zavaritsky[1]. This is evident when
running the verifier_sock/invalidate_pkt_pointers_from_global_func and
verifier_sock/invalidate_pkt_pointers_by_tail_call BPF selftests[2].

  Error: #529 verifier_sock
  Error: #529/57 verifier_sock/invalidate_pkt_pointers_from_global_func
  run_subtest:PASS:obj_open_mem 0 nsec
  run_subtest:FAIL:unexpected_load_success unexpected success: 0
  Error: #529/58 verifier_sock/invalidate_pkt_pointers_by_tail_call
  run_subtest:PASS:obj_open_mem 0 nsec
  run_subtest:FAIL:unexpected_load_success unexpected success: 0

Fix the issue by backporting the entire "bpf: track changes_pkt_data property
for global functions" series[3], along with the follow up, "bpf: fix NPE when
computing changes_pkt_data of program w/o subprograms" series[4]; both from
Eduard. With this series applied the test above no longer fails[5].

1: https://lore.kernel.org/bpf/0498CA22-5779-4767-9C0C-A9515CEA711F@gmail.com/
2: https://github.com/shunghsiyu/libbpf/actions/runs/14591085098/job/40926303169
3: https://lore.kernel.org/all/20241210041100.1898468-1-eddyz87@gmail.com/
4: https://lore.kernel.org/all/20241212070711.427443-1-eddyz87@gmail.com/
5: https://github.com/shunghsiyu/libbpf/actions/runs/14609494070/job/40984756980

Eduard Zingerman (8):
  bpf: add find_containing_subprog() utility function
  bpf: track changes_pkt_data property for global functions
  selftests/bpf: test for changing packet data from global functions
  bpf: check changes_pkt_data property for extension programs
  selftests/bpf: freplace tests for tracking of changes_packet_data
  selftests/bpf: validate that tail call invalidates packet pointers
  bpf: fix null dereference when computing changes_pkt_data of prog w/o
    subprogs
  selftests/bpf: extend changes_pkt_data with cases w/o subprograms

 include/linux/bpf.h                           |   1 +
 include/linux/bpf_verifier.h                  |   1 +
 kernel/bpf/verifier.c                         |  79 +++++++++++--
 .../bpf/prog_tests/changes_pkt_data.c         | 107 ++++++++++++++++++
 .../selftests/bpf/progs/changes_pkt_data.c    |  39 +++++++
 .../bpf/progs/changes_pkt_data_freplace.c     |  18 +++
 .../selftests/bpf/progs/verifier_sock.c       |  56 +++++++++
 7 files changed, 292 insertions(+), 9 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/changes_pkt_data.c
 create mode 100644 tools/testing/selftests/bpf/progs/changes_pkt_data.c
 create mode 100644 tools/testing/selftests/bpf/progs/changes_pkt_data_freplace.c

-- 
2.49.0


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

end of thread, other threads:[~2025-04-23 12:17 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-23  5:53 [PATCH stable 6.12 0/8] bpf: track changes_pkt_data property for global functions Shung-Hsi Yu
2025-04-23  5:53 ` [PATCH stable 6.12 1/8] bpf: add find_containing_subprog() utility function Shung-Hsi Yu
2025-04-23 12:17   ` Sasha Levin
2025-04-23  5:53 ` [PATCH stable 6.12 2/8] bpf: track changes_pkt_data property for global functions Shung-Hsi Yu
2025-04-23 12:17   ` Sasha Levin
2025-04-23  5:53 ` [PATCH stable 6.12 3/8] selftests/bpf: test for changing packet data from " Shung-Hsi Yu
2025-04-23 12:16   ` Sasha Levin
2025-04-23  5:53 ` [PATCH stable 6.12 4/8] bpf: check changes_pkt_data property for extension programs Shung-Hsi Yu
2025-04-23 12:16   ` Sasha Levin
2025-04-23  5:53 ` [PATCH stable 6.12 5/8] selftests/bpf: freplace tests for tracking of changes_packet_data Shung-Hsi Yu
2025-04-23 12:16   ` Sasha Levin
2025-04-23  5:53 ` [PATCH stable 6.12 6/8] selftests/bpf: validate that tail call invalidates packet pointers Shung-Hsi Yu
2025-04-23 12:16   ` Sasha Levin
2025-04-23  5:53 ` [PATCH stable 6.12 7/8] bpf: fix null dereference when computing changes_pkt_data of prog w/o subprogs Shung-Hsi Yu
2025-04-23 12:17   ` Sasha Levin
2025-04-23  5:53 ` [PATCH stable 6.12 8/8] selftests/bpf: extend changes_pkt_data with cases w/o subprograms Shung-Hsi Yu
2025-04-23 12:16   ` Sasha Levin

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