Netdev List
 help / color / mirror / Atom feed
From: Hangbin Liu <hangbin.liu@linux.dev>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	netdev@vger.kernel.org, Jiri Pirko <jiri@resnulli.us>,
	Jay Vosburgh <jv@jvosburgh.net>, Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Jiale Yao <yaojiale02@163.com>,
	Alexandra Winter <wintera@linux.ibm.com>,
	Aswin Karuvally <aswin@linux.ibm.com>
Subject: Re: [PATCH net] net: do not bond/team netdevices which use ml_priv
Date: Wed, 19 Aug 2026 17:12:08 +0800	[thread overview]
Message-ID: <aoVzaHfKWG-_OJOY@fedora> (raw)
In-Reply-To: <072004e8-d5a8-4f01-9dd5-da2d3aeaa447@hartkopp.net>

Hi Oliver,
On Tue, Aug 18, 2026 at 03:25:36PM +0200, Oliver Hartkopp wrote:
> Hi Hangbin,
> > Hi Oliver,
> > 
> > Sashiko gives some feed back[1], would you please check it?
> > 
> > [1] https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260815153938.187073-1-socketcan%40hartkopp.net
> > 
> 
> Unfortunately the AI bot review did not create a proper answer, so that I
> would be able to answer in-line.

Thanks for your reply.

> 
> Sashiko says:
> 
> "Is this test too broad for plain Ethernet slaves?
> netdev_has_ml_priv() only looks at dev->ml_priv, not at dev->ml_priv_type,
> so it matches any driver that stashes a private pointer there, including
> ARPHRD_ETHER NICs that were never involved in the CAN crash."
> 
> and later also points out potential problems that could arise with tun.
> 
> Today only the CAN subsystem properly sets dev->ml_priv_type. Other users
> simply grab dev->ml_priv for their needs (inkognito).

Yes

> 
> To me the question is whether bonding/teaming and now also tunneling code
> takes care about the mid-layer private pointer dev->ml_priv?!?

AFAIK, no.

> 
> The fact that the issues have been found by syzbot for CAN devices might be
> through to the fact that the virtual CAN interface (vcan) can be created by
> netlink commands and can be easily used in test setups.
> 
> So what would happen, if the same tests with bonding/teaming/tunneling would
> be done with real hardware drivers as the mentioned "direct ml_priv writers
> still in tree at this revision:
> 
>   drivers/s390/net/qeth_core_main.c:qeth_alloc_netdev()
>       dev->ml_priv = card;
>   drivers/net/ethernet/chelsio/cxgb/cxgb2.c:init_one()
>       netdev->ml_priv = adapter;
>   drivers/net/wan/hdlc_fr.c:fr_add_pvc()
>       dev->ml_priv = pvc;
> 
> plus drivers/net/ethernet/i825xx/82596.c, drivers/s390/net/ctcm_main.c,
> the libertas main.c/mesh.c paths and
> drivers/net/wireless/microchip/wilc1000/netdev.c."
> 
> ??

I'm not worry about cxgb2 or 82596, which are too old. But s390 qeth is
still actively maintained (Cc the maintainers). Can we block them directly?

> 
> If bonding/teaming/tunneling might accidentally overwrite dev->ml_priv we
> have to block all those devices. No matter if it is CAN or whatever ethernet
> device.

How would bonding modify dev->ml_priv?

> 
> And this it what this patch aims for.
> 
> So either the users were lucky so far or they never used
> bonding/teaming/tunneling on these devices? I don't know.
> 
> But it definitely looks like we should make a safe move to block all ml_priv
> using devices.
> 
> Most of the referenced drivers are 20+ years old! Only
> drivers/net/wireless/microchip/wilc1000/netdev.c is about 11 years old and
> moved from staging into mainline in 2020. The use of ml_priv is a left-over
> from the former out out tree development. The wilc1000 drivers does not use
> the existing infrastructure in the correct way. In all cases this wifi
> driver and all the ancient ethernet drivers should (and can) be implemented
> without using the ml_priv pointer today.
> 
> When there are (unlikely) real users of those (ancient) drivers together
> with bonding/teaming/tunneling those drivers should be changed in a way that
> they do not need dev->ml_priv anymore.

No need to fix the ancient driver at present.

Thanks
Hangbin

      reply	other threads:[~2026-08-19  9:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-15 15:39 [PATCH net] net: do not bond/team netdevices which use ml_priv Oliver Hartkopp
2026-08-15 16:00 ` Stephen Hemminger
2026-08-15 17:23   ` Oliver Hartkopp
2026-08-18 10:12     ` Hangbin Liu
2026-08-18 13:25       ` Oliver Hartkopp
2026-08-19  9:12         ` Hangbin Liu [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=aoVzaHfKWG-_OJOY@fedora \
    --to=hangbin.liu@linux.dev \
    --cc=aswin@linux.ibm.com \
    --cc=jiri@resnulli.us \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=socketcan@hartkopp.net \
    --cc=stephen@networkplumber.org \
    --cc=wintera@linux.ibm.com \
    --cc=yaojiale02@163.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