[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250502093239.GD3339421@horms.kernel.org>
Date: Fri, 2 May 2025 10:32:39 +0100
From: Simon Horman <horms@...nel.org>
To: Amery Hung <ameryhung@...il.com>
Cc: bpf@...r.kernel.org, netdev@...r.kernel.org,
alexei.starovoitov@...il.com, andrii@...nel.org,
daniel@...earbox.net, martin.lau@...nel.org,
xiyou.wangcong@...il.com, kernel-team@...a.com
Subject: Re: [PATCH bpf-next/net v1 1/5] bpf: net_sched: Fix bpf qdisc init
prologue when set as default qdisc
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@...il.com>
...
Powered by blists - more mailing lists