Article View: linux.kernel.netdev
Article #15626Re: [PATCH] bonding: reject IEEE 802.15.4 and 6LoWPAN devices in bond_enslave
From: Hangbin Liu
Date: Fri, 13 Nov 2026 02:44
Date: Fri, 13 Nov 2026 02:44
66 lines
10980 bytes
10980 bytes
On Thu, Nov 12, 2026 at 06:38:33PM +0530, Kalpesh Solanki wrote:
> When the first non-Ethernet slave is enslaved to a bond,
> bond_setup_by_slave() copies slave_dev->type to the bond device.
> However, the bonding driver does not set up subsystem-specific
> mid-layer contexts or private structures:
>
> 1. IEEE 802.15.4 routines (such as ieee802154_llsec_dump_table(),
> nl-phy.c, and socket callbacks) identify WPAN devices by dev->type
> alone and unconditionally dereference dev->ieee802154_ptr and
> dev->ml_priv (ieee802154_mlme_ops). Because bonding never allocates
> these, this results in a NULL pointer dereference.
>
> 2. The 6LoWPAN netdevice notifier (lowpan_event()) identifies devices
> by dev->type == ARPHRD_6LOWPAN and treats netdev_priv(dev) as
> struct lowpan_dev. On a bond master, netdev_priv() is struct bonding,
> so writes to lowpan_dev(dev)->ctx.table flags on events like
> NETDEV_DOWN corrupt the bonding driver's private state.
>
> The team driver closed an identical gap in commit 9043be310c6a ("team:
> reject CAN, IEEE 802.15.4 and 6LoWPAN devices in team_port_add"). Bonding
> previously only blocked CAN devices in commit 8ba68464e478 ("bonding:
> refuse to enslave CAN devices").
>
> Reject ARPHRD_IEEE802154, ARPHRD_IEEE802154_MONITOR, and ARPHRD_6LOWPAN
> devices in bond_enslave().
>
> Fixes: 8ba68464e478 ("bonding: refuse to enslave CAN devices")
Nit: Iām a bit wondering whether we should use this fix tag.
The issue exists both before and after this commit.
On the positive side, the tag can notify users to backport this
patch if they also carry 8ba68464e478.
Since this is not a regression, it should probably target net-next.
> Signed-off-by: Kalpesh Solanki <skalpesh942@gmail.com>
> ---
> drivers/net/bonding/bond_main.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
> index 7019e5d8fdc..b3b003e39b2 100644
> --- a/drivers/net/bonding/bond_main.c
> +++ b/drivers/net/bonding/bond_main.c
> @@ -1894,9 +1894,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev,
> struct sockaddr_storage ss;
> int res = 0, i;
>
> - if (slave_dev->type == ARPHRD_CAN) {
> + if (slave_dev->type == ARPHRD_CAN ||
> + slave_dev->type == ARPHRD_IEEE802154 ||
> + slave_dev->type == ARPHRD_IEEE802154_MONITOR ||
> + slave_dev->type == ARPHRD_6LOWPAN) {
> BOND_NL_ERR(bond_dev, extack,
> - "CAN devices cannot be enslaved");
> + "CAN, IEEE 802.15.4 and 6LoWPAN devices cannot be enslaved");
> return -EPERM;
> }
>
> --
> 2.53.0
>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Technical Details
Message-ID:
<avZ5eZLRKVgdc_7D@fedora>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362379-linux-kernel-netdev=dewy.ruReferences:
<20261112130833.233208-1-skalpesh942@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-362379-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH] bonding: reject IEEE 802.15.4 and 6LoWPAN devices in bond_enslave Date: Fri, 13 Nov 2026 10:44:09 +0800 Organization: Usenet Network Message-ID: <avZ5eZLRKVgdc_7D@fedora> References: <20261112130833.233208-1-skalpesh942@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1291293"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:N05H3CM5LR2PeTqepI0URvCzrpU= sha256:qXLQGfZc3JCQ9pkiktcOVoMOrf8hux3TjRBYnY++R9c= sha1:feLiHjb7no5jYAus0x+7qeFyiq8= sha256:O2jZvEmCueubbi74ZN6jImqhwChbW4cc1fjsUqtyAOI= 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 56F1F1144B7; Fri, 13 Nov 2026 10:50:01 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 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.249, 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 Mz3yGtoJDZfj; Fri, 13 Nov 2026 10:49:58 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-362379-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id E1E8C114382; Fri, 13 Nov 2026 10:49:49 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 12BD116B150; Fri, 13 Nov 2026 02:44:53 +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=1794537869; b=Pv7v0s2yjX7nn0Oh9Az6qKBOYHtunXl7XrRJwMVYLeqpID/yfj+X9x2PyZDd6Kvq6iyn JJWD/ni4zKmj7C6yazRGVoOUy8S7Txt3gtHe2/qjfb4G0zJIfQVFT6/OdpHKZQMFEb+/7 qAJ7T1zQF3ZHnZnfjVc9MkWNKpHXk+iYrkErKq/puL8kEBkNyCtmqlWcw48aw5y31OLse N2maNo2LO3+BE1bwAjoLleRtFIA534X2YwUffz1cjxcPqW1CoUJDflRaqEjkm4ZN5GHZU 9LzeuYIHHhRil7LGFXU3rI/Hk7XTzSJ/oIiI9LIU/WZZl6dDDZEsQsuDmyXOd+b1V7g== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794537869; 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: Content-Transfer-Encoding:In-Reply-To; bh=4TRHs1DfBlKdmDJbWxzloimLXw9ZeFotvX38yZ1XhRg=; b=CgWPrRdtSWvaDi5nSw07yTJphQtaDYym2Srj1eAm0GYq7UtdMwmO1hCRCFERUclGS05D WuNUDVYMpF4mJB0ic+BJpGYFcWj47BhQCa9akaPhaSqw09rMGD/X/9iQmLvXm++QNeawC ickcBEiOe4zmNync+82dOTmJhD4PWCnVYe2hC/BRJAbAR+TSccBbfGN3U64EJDHrExmiL 5e0kxTb03whcHpzna/d+4ZpRlxaJnS6eMxKvHHRF/DAKDqlno6clZqrXOZAHA3BK7Ps3d VqvGOQWKanI0LX7CAjeFh9W+cB2CIFG7sS89RXStibWykpKtphqsYyntThMr2HmGVxA== 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=NUA+44mg; 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 8E834606A337; Fri, 13 Nov 2026 02:44:29 +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=NUA+44mg X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.1 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794537863; b=kSaSAN0LBUVR1MZqB+fSAqZs09kldlsNOIHB3bp7OdGQqFazJ3fcuhONDnXuIv+jSVlu 8RHJtsWN/I5lPZMvA8f0tMASaPaU3PgIUhYgTFB+qsEttRPvq4HnYnY0hr9P7o31Wvt9R U2WMYK6i/vEM/IFmJzPnJ5eiUWYTmuemYCLzvMN3c6dutrE57so0yU3KmEbzltS5P9uy/ UdnW+TOAe189Kf74PUGbOWLW1xs3OH+9+Zm1eamW0vdo0mzwtX8MvxTA1m8IHoyIvEXbr ZJwk5Tyyv+p4ZuiRf/7V0XpFZhMPQi5s04z9lyGQFyLbAgmoqvIDrtCw0DZTUSOlOpA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794537863; 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: Content-Transfer-Encoding:In-Reply-To; bh=4TRHs1DfBlKdmDJbWxzloimLXw9ZeFotvX38yZ1XhRg=; b=DsFQ6QC2cU27lv+KGHGsxBtgRfdXQFFHHODokjRyp6SjhUokWIN4Jp5JUoohbfQiVuIq mlk9i0k1x4gy4sa3p2wJ44PurZMaAKi68oAa40NQ8An49wCX75eHoAt7QTgPJ+c1H8/55 zO8l/6bIuFfunvp+lQzTP0S6QqsDAKyoIXhNCL88MA9I3i7/kkHtvq9yzNaDaeQWWmtxl 1g/H+krG/p5c7o+Hzf45HEgYJwPseZL3pNRSje1nkazJvItMchd8LrG8+PN7G7LLGEsLx 41XhORSFoXU3H6r0Jx1PXdW8iZ2bSADeHNKuOnFyZNcl6lB+RaxytOQ12UceGQAk/Og== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=NUA+44mg; arc=none smtp.remote-ip=95.215.58.1 X-Received: from mta1.migadu.com (out-1.mta1.migadu.com [95.215.58.1]) (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 84187606A334 for <netdev@vger.kernel.org>; Fri, 13 Nov 2026 02:44:22 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 84187606A334 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=uM/mtAX4nI/KfIYibTQw8PdMaeavSpiAqFsZsivtIZI=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1794537860; v=1; x=1795142660; b=NUA+44mg64uewSieqnzAL2rKJ+0elhQ10PV6OrkLhHAC+F2SNGJhQL0HSNtQGSzMOuBLoV/G Jb5Pm0GhIMyA7fQz5j/+cSxIip+TfDjaJS1YIvhg2SOA6vOEgX35T2t4ISpLjs71Ssu4f2XgyV5 ArgOKOqhTl8HRYGEmboS0dak= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta12.migadu.com with ESMTPS id 7cb7555790e61df8; Fri, 13 Nov 2026 02:44:20 +0000 X-Mizu-Trace-ID: 7cb7555790e61df8 X-Migadu-Flow: FLOW_OUT X-Cc: Jay Vosburgh <jv@jvosburgh.net>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Oliver Hartkopp <socketcan@hartkopp.net>, 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: <20261112130833.233208-1-skalpesh942@gmail.com>