From: Simon Horman <horms@kernel.org>
To: Amery Hung <ameryhung@gmail.com>
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org,
alexei.starovoitov@gmail.com, andrii@kernel.org,
daniel@iogearbox.net, martin.lau@kernel.org,
xiyou.wangcong@gmail.com, kernel-team@meta.com
Subject: Re: [PATCH bpf-next/net v1 1/5] bpf: net_sched: Fix bpf qdisc init prologue when set as default qdisc
Date: Fri, 2 May 2025 10:32:39 +0100 [thread overview]
Message-ID: <20250502093239.GD3339421@horms.kernel.org> (raw)
In-Reply-To: <20250501223025.569020-2-ameryhung@gmail.com>
On Thu, May 01, 2025 at 03:30:21PM -0700, Amery Hung wrote:
> Allow .init to proceed if qdisc_lookup() returns NULL as it only happens
> when called by qdisc_create_dflt() in mq/mqprio_init and the parent qdisc
> has not been added to qdisc_hash yet. In qdisc_create(), the caller,
> __tc_modify_qdisc(), would have made sure the parent qdisc already exist.
>
> In addition, call qdisc_watchdog_init() whether .init succeeds or not to
> prevent null-pointer dereference. In qdisc_create() and
> qdisc_create_dflt(), if .init fails, .destroy will be called. As a
> result, the destroy epilogue could call qdisc_watchdog_cancel() with an
> uninitialized timer, causing null-pointer deference in hrtimer_cancel().
>
> Fixes: Fixes: c8240344956e ("bpf: net_sched: Support implementation of Qdisc_ops in bpf")
nit: One "Fixes: " is enough.
> Signed-off-by: Amery Hung <ameryhung@gmail.com>
...
next prev parent reply other threads:[~2025-05-02 9:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-01 22:30 [PATCH bpf-next/net v1 0/5] Fix bpf qdisc bugs and cleanup Amery Hung
2025-05-01 22:30 ` [PATCH bpf-next/net v1 1/5] bpf: net_sched: Fix bpf qdisc init prologue when set as default qdisc Amery Hung
2025-05-02 9:32 ` Simon Horman [this message]
2025-05-01 22:30 ` [PATCH bpf-next/net v1 2/5] selftests/bpf: Test setting and creating bpf qdisc " Amery Hung
2025-05-01 23:58 ` Martin KaFai Lau
2025-05-02 17:52 ` Amery Hung
2025-05-02 19:27 ` Martin KaFai Lau
2025-05-02 19:33 ` Amery Hung
2025-05-01 22:30 ` [PATCH bpf-next/net v1 3/5] bpf: net_sched: Make some Qdisc_ops ops mandatory Amery Hung
2025-05-02 0:13 ` Martin KaFai Lau
2025-05-01 22:30 ` [PATCH bpf-next/net v1 4/5] selftests/bpf: selftests/bpf: Test attaching a bpf qdisc with incomplete operators Amery Hung
2025-05-01 22:30 ` [PATCH bpf-next/net v1 5/5] selftests/bpf: Cleanup bpf qdisc selftests Amery Hung
2025-05-02 0:22 ` Martin KaFai Lau
2025-05-02 17:53 ` Amery Hung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250502093239.GD3339421@horms.kernel.org \
--to=horms@kernel.org \
--cc=alexei.starovoitov@gmail.com \
--cc=ameryhung@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@meta.com \
--cc=martin.lau@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).