Article View: linux.kernel.netdev
Article #5231Re: [PATCH net v5] team: reject CAN, IEEE 802.15.4 and 6LoWPAN devices in team_port_add
From: Hangbin Liu
Date: Tue, 20 Oct 2026 01:38
Date: Tue, 20 Oct 2026 01:38
72 lines
11379 bytes
11379 bytes
On Mon, Oct 19, 2026 at 05:54:07PM +0200, Oliver Hartkopp wrote:
> From: Jiale Yao <yaojiale02@163.com>
>
> When the first port has a non-Ethernet type, team_setup_by_port()
> copies port_dev->type to the team device while netdev_priv() of the
> team device still holds a struct team. Several L2 stacks identify their
> devices by dev->type alone and then access type specific data that the
> team driver never sets up:
>
> - CAN protocols rely on the CAN mid-layer private data (ml_priv)
> - IEEE 802.15.4 code dereferences ieee802154_ptr and the mlme ops in
> ml_priv
> - the 6LoWPAN netdev notifier writes through lowpan_dev(dev) on
> NETDEV_DOWN and reads it on NETDEV_UP/NETDEV_CHANGE
>
> Enslaving such a device (e.g. vxcan, wpan0, lowpan0) therefore leads to
> NULL pointer dereferences or to writes into struct team.
>
> This is the same problem that syzbot reported for the bonding driver
> with a vxcan device enslaved to a bond master, which crashed in
> can_rx_unregister() and was fixed by commit 8ba68464e478 ("bonding:
> refuse to enslave CAN devices"). The team driver has the same gap.
>
> Reject ARPHRD_CAN, ARPHRD_IEEE802154, ARPHRD_IEEE802154_MONITOR and
> ARPHRD_6LOWPAN devices in team_port_add().
>
> Link: https://lore.kernel.org/all/b58d98e0-8fe3-4e4e-b8a5-c1c7e647ccca@hartkopp.net/
> Link: https://syzkaller.appspot.com/bug?extid=8ed98cbd0161632bce95 # bonding splat
> Fixes: 1d76efe1577b ("team: add support for non-ethernet devices")
> Assisted-by: Claude:deepseek-v4-pro
> Signed-off-by: Jiale Yao <yaojiale02@163.com>
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
> ---
> v5: [Hartkopp] reference the syzbot report of the identical bonding problem
> v4: [Hartkopp] also reject ARPHRD_6LOWPAN as reported by Sashiko AI
> review, reworded commit message (bonding only rejects CAN)
> v3: [Hartkopp] fixed indention and compilation as reported by kernel test robot
> ---
> drivers/net/team/team_core.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/team/team_core.c b/drivers/net/team/team_core.c
> --- a/drivers/net/team/team_core.c
> +++ b/drivers/net/team/team_core.c
> @@ -1223,10 +1223,21 @@ static int team_port_add(struct team *team, struct net_device *port_dev,
> netdev_err(dev, "Device %s is loopback device. Loopback devices can't be added as a team port\n",
> portname);
> return -EINVAL;
> }
>
> + if (port_dev->type == ARPHRD_CAN ||
> + port_dev->type == ARPHRD_IEEE802154 ||
> + port_dev->type == ARPHRD_IEEE802154_MONITOR ||
> + port_dev->type == ARPHRD_6LOWPAN) {
> + NL_SET_ERR_MSG(extack,
> + "CAN, IEEE 802.15.4 and 6LoWPAN devices can't be added as a team port");
> + netdev_err(dev, "Device %s is CAN, IEEE 802.15.4 or 6LoWPAN. These device types can't be added as a team port\n",
> + portname);
> + return -EINVAL;
> + }
> +
> if (netif_is_team_port(port_dev)) {
> NL_SET_ERR_MSG(extack, "Device is already a port of a team device");
> netdev_err(dev, "Device %s is already a port "
> "of a team device\n", portname);
> return -EBUSY;
> --
> 2.53.0
>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Technical Details
Message-ID:
<atbF_LBIJYIynlq3@fedora>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348957-linux-kernel-netdev=dewy.ruReferences:
<20261019155407.61487-1-socketcan@hartkopp.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348957-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v5] team: reject CAN, IEEE 802.15.4 and 6LoWPAN devices in team_port_add Date: Tue, 20 Oct 2026 09:38:04 +0800 Organization: Usenet Network Message-ID: <atbF_LBIJYIynlq3@fedora> References: <20261019155407.61487-1-socketcan@hartkopp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="3759234"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:dt54VDwOXKWzoyECodxZM/CIVVk= sha256:nCO9TrUi6v7cgThZC7Rh8911O8CdkNRk5INQjLv/bJ0= sha1:mi1NN2LSXWBC02ufw5wg/Hy+lqs= sha256:kFrL1ma88AVSoYHKU53gvBX8MPlCcLurXRgztjZG7m4= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 93101110BAD; Tue, 20 Oct 2026 04:41:29 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.049 X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=linux.dev X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zvV7vRDyPK1G; Tue, 20 Oct 2026 04:41:25 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-348957-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mail.dewy.ru (Postfix) with ESMTPS id 3570F110BAB; Tue, 20 Oct 2026 04:41:16 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sin.lore.kernel.org (Postfix) with ESMTP id 7F3902A8E5; Tue, 20 Oct 2026 01:38:29 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792460306; b=IwT59quWqiiHI5VTqDXAe6gzXUy3ivSP2wKGodwFMC5KnV3ONNJCUS8bfkkaJrwd7sW4 fsEOA83scY9jjIf9VdZDTIoAKNjdAVhiSkFbcouALNr5sSppnjb+XEQ9KpZAMr9iTr59n +Jhm56jmf9ML8jBkoDjnTeFld/amL+q7CSGfsjNHLXDK/QRxpxJEFIXiXp45etBy54ZQO nTMORoYKTSdAvRBgaq64hT2pMvC3bWmA900Lf1mJmBMoECup7TXFJeqCIIiAFE3xfb0/x A48j5BUwNiV+AbhbjnVrgjqOaE+VnUfcsvgCD1+LplW8oKVs7k6+WT5dlozGc6mdVBA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792460306; h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature: X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=usNYCTGOXfbAT1C1//piOShSVVfXVlsx9LA+HpO8xUI=; b=mv6BvFaRuD1u1hHEz5iOJ8L8HkAxf/uiaCLunD7NyjieiTSoAZknl/GWylYVyUda9aug 5BtXtwOfaMzsGtDLv5a5OoU55fCXxiHd6xvjejbZccYuL4btniHKGh3wemOL4gWIR8a8+ Cn1smysPUKd2rVOeQ55l+8RF4Qk8W2wcIEzjIJ3BBcEUN8KAFokN0tuKYHoLRi1j2W3wp TvImvbWfvRuSKXZeQpm+CQZrL4Iuc8YiyjzAAx1aFwZVjjVW+CkU4zSaVxmnwPoJt6JQT +uek3qep4STPKzGFAdTk1VbTAh/ZactV2pj3su4q+SOxo4L7JxyyJZD0P0/A3UA4rGQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=NxtzGOTy; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 12166606A334; Tue, 20 Oct 2026 01:38:26 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=NxtzGOTy X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.110 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792460305; b=vwvfaRc7QgtvTiUcc4tuHnC9GOGc3LsCTOPIHbrD9xaMl/vRS+Wkx/0tpXMHPFyShoar 58u+FxkFuZk5Cy2u4czJE4xUxgF6QAmD40R+HAE6LHSp97yDtXfUJ/yilPzHfTelEU6If D2W1DodNBkR04GoU8sGw0OYjYTP0OFherJvQ6mdbmOZAadrqyzUAOM+zq2CBZ/IgvYpbT ooylElVwP5/O2ZfnALqJZV55wUr2vugxcG0mi+ogj63svP3oCTBBbFciiu7gEtht9IVC6 lpUZBSfjRTgaRtTvw++uDEhSq/d0DXOyCZpYATArBwdYB/YPU90pFJY0c8ydO0phUgw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792460305; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=usNYCTGOXfbAT1C1//piOShSVVfXVlsx9LA+HpO8xUI=; b=FCHTjiB3xixHuB0boChenY4ERhN16wMshMLzvoAjDVYpMS/xBGdAktc5FVBAm9q8o+gn V5DEFVy/Kte7KTzRM6m6Et7wSd7IRjWfr+FZFYlx2QqJp25p4+j2qZnOGPmcSpuXyWrNA cfHSkN4IfFxF17rfBvi8fuGCcj6nruiNxHICaAFF7oSDwgSrxOo0IUany2j653b+T4Wuo vTDUcUZp78iz2nXmU4InKC2pRQDwbOVHTy+CLgqPoVQAwOq6xirhq9/x0zgf6SzQlJHsl 7moR7ZFwMhcG9fvTpTgL8LidASpaRHyBOJyjxzLFTQt89PEVKST+ERZg0OFOY0L9zzw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; arc=none smtp.remote-ip=91.218.175.110 X-Received: from mta0.migadu.com (out-110.mta0.migadu.com [91.218.175.110]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65AD3606A31C for <netdev@vger.kernel.org>; Tue, 20 Oct 2026 01:38:22 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 65AD3606A31C X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: netdev@vger.kernel.org X-DKIM-Signature: a=rsa-sha256; bh=SvymMiE1h9eGO72NOBmTXmWopdT7YaAz+Ajx0/HkoVg=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1792460301; v=1; x=1793065101; b=NxtzGOTyu5QdhuKmNmyEE9601ys6bN9dXLPKY4KYOvQvcA+hay9qrc5F1kdSo1ukQAdytcH3 I8fHnc+Oq0T3n9QSd500rOe1CVqaXTXnCmi9v1tHha206lhUnHymEHdvpvrvPolOwHatlc9ut+0 Ix6FgAd8K6OqBqGvXX8GdBfE= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta10.migadu.com with ESMTPS id 41f018b724df8ac4; Tue, 20 Oct 2026 01:38:21 +0000 X-Mizu-Trace-ID: 41f018b724df8ac4 X-Migadu-Flow: FLOW_OUT X-Cc: Jiri Pirko <jiri@resnulli.us>, netdev@vger.kernel.org, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Jiale Yao <yaojiale02@163.com> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261019155407.61487-1-socketcan@hartkopp.net>