All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH stable 6.6 00/10] bpf: track changes_pkt_data property for global functions
@ 2025-04-30  8:19 Shung-Hsi Yu
  2025-04-30  8:19 ` [PATCH stable 6.6 01/10] bpf: add find_containing_subprog() utility function Shung-Hsi Yu
                   ` (9 more replies)
  0 siblings, 10 replies; 21+ messages in thread
From: Shung-Hsi Yu @ 2025-04-30  8:19 UTC (permalink / raw)
  To: stable
  Cc: Alexei Starovoitov, Eduard Zingerman, Nick Zavaritsky,
	Dan Carpenter, Shung-Hsi Yu

Fix the bypassing of invalid packet pointer check in 6.6 by backporting
the entire "bpf: track changes_pkt_data property for global functions"
series[1], along with the follow up, "bpf: fix NPE when computing
changes_pkt_data of program w/o subprograms" series[2]; both from
Eduard.

I had ran the BPF selftests after backporting, confirmed that newly
added BPF selftests passes, and that no new failure observed in BPF
selftests (dummy_st_ops, ns_current_pid_tgid, test_bpf_ma, and
test_bpffs are failing even without this patchset applied). See [3] for
the full log.

  #50/1    changes_pkt_data_freplace/changes_pkt_data_with_changes_pkt_data:OK
  #50/2    changes_pkt_data_freplace/changes_pkt_data_with_does_not_change_pkt_data:OK
  #50/3    changes_pkt_data_freplace/does_not_change_pkt_data_with_changes_pkt_data:OK
  #50/4    changes_pkt_data_freplace/does_not_change_pkt_data_with_does_not_change_pkt_data:OK
  #50/5    changes_pkt_data_freplace/main_changes_with_changes_pkt_data:OK
  #50/6    changes_pkt_data_freplace/main_changes_with_does_not_change_pkt_data:OK
  #50/7    changes_pkt_data_freplace/main_does_not_change_with_changes_pkt_data:OK
  #50/8    changes_pkt_data_freplace/main_does_not_change_with_does_not_change_pkt_data:OK
  #395/57  verifier_sock/invalidate_pkt_pointers_from_global_func:OK
  #395/58  verifier_sock/invalidate_pkt_pointers_by_tail_call:OK

1: https://lore.kernel.org/all/20241210041100.1898468-1-eddyz87@gmail.com/
2: https://lore.kernel.org/all/20241212070711.427443-1-eddyz87@gmail.com/
3: https://github.com/shunghsiyu/libbpf/actions/runs/14747347842/job/41397104180

Eduard Zingerman (10):
  bpf: add find_containing_subprog() utility function
  bpf: refactor bpf_helper_changes_pkt_data to use helper number
  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
  bpf: consider that tail calls invalidate packet pointers
  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 +
 include/linux/filter.h                        |   2 +-
 kernel/bpf/core.c                             |   2 +-
 kernel/bpf/verifier.c                         |  81 +++++++++++--
 net/core/filter.c                             |  63 +++++------
 .../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 +++++++++
 10 files changed, 324 insertions(+), 46 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] 21+ messages in thread

end of thread, other threads:[~2025-05-01 19:11 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-30  8:19 [PATCH stable 6.6 00/10] bpf: track changes_pkt_data property for global functions Shung-Hsi Yu
2025-04-30  8:19 ` [PATCH stable 6.6 01/10] bpf: add find_containing_subprog() utility function Shung-Hsi Yu
2025-05-01 19:09   ` Sasha Levin
2025-04-30  8:19 ` [PATCH stable 6.6 02/10] bpf: refactor bpf_helper_changes_pkt_data to use helper number Shung-Hsi Yu
2025-05-01 18:51   ` Sasha Levin
2025-04-30  8:19 ` [PATCH stable 6.6 03/10] bpf: track changes_pkt_data property for global functions Shung-Hsi Yu
2025-05-01 18:51   ` Sasha Levin
2025-04-30  8:19 ` [PATCH stable 6.6 04/10] selftests/bpf: test for changing packet data from " Shung-Hsi Yu
2025-05-01 19:11   ` Sasha Levin
2025-04-30  8:19 ` [PATCH stable 6.6 05/10] bpf: check changes_pkt_data property for extension programs Shung-Hsi Yu
2025-05-01 18:50   ` Sasha Levin
2025-04-30  8:19 ` [PATCH stable 6.6 06/10] selftests/bpf: freplace tests for tracking of changes_packet_data Shung-Hsi Yu
2025-05-01 18:51   ` Sasha Levin
2025-04-30  8:19 ` [PATCH stable 6.6 07/10] bpf: consider that tail calls invalidate packet pointers Shung-Hsi Yu
2025-05-01 19:10   ` Sasha Levin
2025-04-30  8:19 ` [PATCH stable 6.6 08/10] selftests/bpf: validate that tail call invalidates " Shung-Hsi Yu
2025-05-01 19:10   ` Sasha Levin
2025-04-30  8:19 ` [PATCH stable 6.6 09/10] bpf: fix null dereference when computing changes_pkt_data of prog w/o subprogs Shung-Hsi Yu
2025-05-01 18:52   ` Sasha Levin
2025-04-30  8:19 ` [PATCH stable 6.6 10/10] selftests/bpf: extend changes_pkt_data with cases w/o subprograms Shung-Hsi Yu
2025-05-01 19:10   ` Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.