netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next/net v2 0/5] Fix bpf qdisc bugs and clean up
@ 2025-05-02 20:16 Amery Hung
  2025-05-02 20:16 ` [PATCH bpf-next/net v2 1/5] bpf: net_sched: Fix bpf qdisc init prologue when set as default qdisc Amery Hung
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Amery Hung @ 2025-05-02 20:16 UTC (permalink / raw)
  To: bpf
  Cc: netdev, alexei.starovoitov, andrii, daniel, martin.lau,
	xiyou.wangcong, kernel-team

This patchset fixes the following bugs in bpf qdisc and clean up the
selftest.

- A null-pointer dereference can happen in qdisc_watchdog_cancel() if
  the timer is not initialized when 1) .init is not defined by user so
  init prologue is not generated. 2) .init fails and qdisc_create()
  calls .destroy

- bpf qdisc fails to attach to mq/mqprio when being set as the default
  qdisc due to failed qdisc_lookup() in init prologue

v2
- Rebase to bpf-next/net
- Fix erroneous commit messages
- Fix and simplify selftests cleanup
  v1: https://lore.kernel.org/bpf/20250501223025.569020-1-ameryhung@gmail.com/

Amery Hung (5):
  bpf: net_sched: Fix bpf qdisc init prologue when set as default qdisc
  selftests/bpf: Test setting and creating bpf qdisc as default qdisc
  bpf: net_sched: Make some Qdisc_ops ops mandatory
  selftests/bpf: Test attaching a bpf qdisc with incomplete operators
  selftests/bpf: Cleanup bpf qdisc selftests

 net/sched/bpf_qdisc.c                         |  24 +++-
 .../selftests/bpf/prog_tests/bpf_qdisc.c      | 120 +++++++++++++-----
 .../selftests/bpf/progs/bpf_qdisc_common.h    |   6 -
 .../bpf/progs/bpf_qdisc_fail__incompl_ops.c   |  41 ++++++
 .../selftests/bpf/progs/bpf_qdisc_fifo.c      |   9 ++
 .../selftests/bpf/progs/bpf_qdisc_fq.c        |   6 +
 6 files changed, 161 insertions(+), 45 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/bpf_qdisc_fail__incompl_ops.c

-- 
2.47.1


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

end of thread, other threads:[~2025-05-02 23:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-02 20:16 [PATCH bpf-next/net v2 0/5] Fix bpf qdisc bugs and clean up Amery Hung
2025-05-02 20:16 ` [PATCH bpf-next/net v2 1/5] bpf: net_sched: Fix bpf qdisc init prologue when set as default qdisc Amery Hung
2025-05-02 20:16 ` [PATCH bpf-next/net v2 2/5] selftests/bpf: Test setting and creating bpf qdisc " Amery Hung
2025-05-02 20:16 ` [PATCH bpf-next/net v2 3/5] bpf: net_sched: Make some Qdisc_ops ops mandatory Amery Hung
2025-05-02 20:16 ` [PATCH bpf-next/net v2 4/5] selftests/bpf: Test attaching a bpf qdisc with incomplete operators Amery Hung
2025-05-02 23:54   ` Martin KaFai Lau
2025-05-02 20:16 ` [PATCH bpf-next/net v2 5/5] selftests/bpf: Cleanup bpf qdisc selftests Amery Hung
2025-05-02 23:50 ` [PATCH bpf-next/net v2 0/5] Fix bpf qdisc bugs and clean up patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).