BPF List
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Ratheesh Kannoth <rkannoth@marvell.com>
Cc: netdev-bot+sashiko@kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	andrew+netdev@lunn.ch, ast@kernel.org, daniel@iogearbox.net,
	davem@davemloft.net, edumazet@kernel.org, hawk@kernel.org,
	john.fastabend@gmail.com, kuba@kernel.org, pabeni@redhat.com,
	sdf@fomichev.me, sgoutham@marvell.com
Subject: Re: [PATCH v19 net-next 2/2] octeontx2: add mqprio bandwidth offload for NIX TX schedulers
Date: Tue, 13 Oct 2026 11:56:04 +0100	[thread overview]
Message-ID: <20261013105604.GB83879@horms.kernel.org> (raw)
In-Reply-To: <asxY6cs5os_q3mAA@rkannoth-OptiPlex-7090>

On Mon, Oct 12, 2026 at 09:20:01AM +0530, Ratheesh Kannoth wrote:
> On 2026-10-10 at 15:31:10, netdev-bot+sashiko@kernel.org (netdev-bot+sashiko@kernel.org) wrote:
> > Thank you for your contribution! Sashiko AI review found 12 potential
> > issue(s) to consider.
> >
> > Critical: 0 · High: 1 · Medium: 9 (1) · Low: 2 (1)
> >
> > If you believe none of the issues are legitimate, please reply to each
> > issue of Medium severity or higher and explain why the AI is wrong.
> > If any of them are legitimate and you plan to respin, please let patchwork
> > know by including "pw-bot: cr" as a separate line at the end of your reply
> > (one such reply per series is enough).
> >
> > - [High] There is a use-after-free race on the deferred netdev_tc_work
> >   during device removal.
> 
> Not addressing this one; the window is theoretical and the impact is nil in practice.
> 1. It needs a failing "tc qdisc replace" (validation failure on an existing
>    offload) to run on CPU A at the exact moment the PCI remove runs on CPU B,
>    with A reading defer_tc_work just before B sets it. The netdev is already
>    being torn down, so this is not a realistic configuration path.
> 2. Even if the work is queued in that window, it is a no-op: the handler
>    checks defer_tc_work (set by remove) and returns before taking RTNL or
>    touching any other state. The only access is that single flag read.
> 3. A use-after-free would also need system_wq to leave the item undispatched
>    for the whole remainder of remove (unregister_netdev, destroy_workqueue,
>    mbox teardown, AF detach, ...) until free_netdev(). That is not a
>    realistic scheduling delay.
> The flag is accessed with READ_ONCE()/WRITE_ONCE() and ordered by smp_wmb()
> before cancel_work_sync(), so any tc command that starts after shutdown
> begins will see it and not queue the work.
> 
> > - [Medium] Offload state is leaked when qdisc teardown fails.
> 
> Not addressing this one; the trigger is very rare and the failure is reported.
> The path only runs if the AF mailbox request that clears the per-queue
> shapers (otx2_nix_tm_clear_queue_shaper()) fails during "tc qdisc del". That
> means the AF/mailbox is already in a fault state, which is not a normal
> runtime condition.
> In that case the driver prints error message.
> Keeping the state is deliberate. The shapers are still programmed in
> hardware, so the cached rates and rate_limit continue to describe what the
> hardware is doing, and they are reapplied consistently on the next open.
> Dropping the software state while the hardware shapers are still active would
> leave the two out of sync.
> The core cannot veto qdisc teardown (mqprio_disable_offload() is void), so the
> driver can only report the error, which it does.

...

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2026-10-13 10:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06  9:43 [PATCH v19 net-next 0/2] octeontx2: mqprio bandwidth offload for NIX TX schedulers Ratheesh Kannoth
2026-10-06  9:43 ` [PATCH v19 net-next 1/2] octeontx2: use atomic bitops for PF/VF and rep flags Ratheesh Kannoth
2026-10-07  9:44   ` sashiko-bot
2026-10-10 10:01   ` netdev-bot+sashiko
2026-10-12  3:20     ` Ratheesh Kannoth
2026-10-13 10:55       ` Simon Horman
2026-10-06  9:43 ` [PATCH v19 net-next 2/2] octeontx2: add mqprio bandwidth offload for NIX TX schedulers Ratheesh Kannoth
2026-10-07  9:45   ` sashiko-bot
2026-10-10 10:01   ` netdev-bot+sashiko
2026-10-12  3:50     ` Ratheesh Kannoth
2026-10-13 10:56       ` Simon Horman [this message]
2026-10-13 14:05       ` Paolo Abeni

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=20261013105604.GB83879@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hawk@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rkannoth@marvell.com \
    --cc=sdf@fomichev.me \
    --cc=sgoutham@marvell.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