Netdev List
 help / color / mirror / Atom feed
From: Kory Maincent <kory.maincent@bootlin.com>
To: Zhao Gongyi <zhaogongyi@bytedance.com>,
	netdev@vger.kernel.org, Andrew Lunn <andrew@lunn.ch>,
	Jakub Kicinski <kuba@kernel.org>
Cc: "David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Willem de Bruijn <willemb@google.com>,
	Simon Horman <horms@kernel.org>, Hui Peng <benquike@gmail.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH net] ethtool: tsinfo: avoid holding a netdev reference across dumps
Date: Fri, 4 Dec 2026 10:59:07 +0100	[thread overview]
Message-ID: <d6552070-3d02-40db-ae3e-a2637d8bc44b@bootlin.com> (raw)
In-Reply-To: <20261130101120.71070-1-zhaogongyi@bytedance.com>



On 11/30/26 11:11, Zhao Gongyi wrote:
> A syzkaller workload issuing filtered TSINFO dumps reproduced a device
> unregister stall on arm64. A reduced six-call syzkaller program also
> reproduced the stall. With CONFIG_NET_DEV_REFCNT_TRACKER enabled, the
> remaining tracked reference was attributed to ethnl_tsinfo_start():
> 
>    unregister_netdevice: waiting for syz_tun to become free. Usage count = 2
>    ref_tracker: netdev@0000000068a552dd has 1/1 users at
>         netdev_get_by_index+0x54/0x98
>         ethnl_parse_header_dev_get+0xb0/0x2d4
>         ethnl_tsinfo_start+0x7c/0x164
>         genl_start+0x124/0x1a8
>         __netlink_dump_start+0x17c/0x2bc
> 
> Filtered dumps retain this reference from .start() until .done(), making
> device removal depend on dump completion or socket teardown. This does
> not require a multi-skb reply: the initial netlink_dump() can fail its
> allocation or receive-buffer checks before calling .dumpit(), leaving
> the dump active for a later recvmsg() or socket release.
> 
> Save the requested ifindex and release the parsed reference in .start().
> Look up the device under the ops compat lock for each dump callback,
> validating registration and namespace state before accessing it. Return
> -ENODEV if the device is no longer available.
> 
> On the older arm64 test kernel, replays of the reduced syzkaller
> program with this fix reported no crash in a 30-second run and a
> six-minute run.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Thank you!
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com


      reply	other threads:[~2026-12-04  9:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 10:11 [PATCH net] ethtool: tsinfo: avoid holding a netdev reference across dumps Zhao Gongyi
2026-12-04  9:59 ` Kory Maincent [this message]

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=d6552070-3d02-40db-ae3e-a2637d8bc44b@bootlin.com \
    --to=kory.maincent@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=benquike@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=willemb@google.com \
    --cc=zhaogongyi@bytedance.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