From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6438A3B19BA for ; Wed, 29 Jul 2026 09:15:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785316514; cv=none; b=rvpTEdi6ehlVT7smMwxKQJip0TmyuubIdWUjQBBHrm672AZWuIwmzFdXNNtP08TnFDfbiuk5HLbV0WjBg7AwxcHqmm3R1PirPVj4Mv4AJuQcGNkVr+LcTtS2ntd2O89p+9lRDGatHdrDMLEB38bSUNsHgtTvldU5wRTyFA35Bj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785316514; c=relaxed/simple; bh=5HbFxxRqzh75HEuLo5PVE1LSDA+Cqa9OYNV2U129l+k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JS1J2JHeq9kZCO3Fvva/aWNYL3b2WNjPUB3g4wq7SxWlO5iH1qcnyP0E5BsG8c/BDTqC0J6mYkvuuU/Rz68Zk2Ye4uSMlq7DHzRNrZPjh/tLeD7Vv3xKcNOpDnAPaykdcMAmCBkTq4OCFRz6Pj1yaAnTZuKZjqCP5usMRFLFZKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us; spf=none smtp.mailfrom=resnulli.us; dkim=pass (2048-bit key) header.d=resnulli-us.20251104.gappssmtp.com header.i=@resnulli-us.20251104.gappssmtp.com header.b=c+qjVi7g; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=resnulli.us Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=resnulli.us Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20251104.gappssmtp.com header.i=@resnulli-us.20251104.gappssmtp.com header.b="c+qjVi7g" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-49554ebb87dso6101425e9.3 for ; Wed, 29 Jul 2026 02:15:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20251104.gappssmtp.com; s=20251104; t=1785316511; x=1785921311; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=oNpiwhcss09c4/Xotm6inwoCx6Njgo/xmgKicXGYy+Y=; b=c+qjVi7g/+cUyMvOuTi2eCXcb/TTy+VUNim8Le88yMtB06i9CHIXnl6iDiEAqKDRd/ CR0cIDZ84FNUTVHC6QJFF6j6nq/BA6/TQusOesMz7g+jVmB3PwAVb66y98OeEeGzdABQ M/axHzsY3LohwZac79uhCR86AVBwOG4VBhx369bZJpjzapNdmmiUj8gQxAnoRni+5Nj3 1U5rbwQpfYEiYq2qo6JBsG61Rz03CUCzPy/JdJefaX1ulVGdNfjNktzBfSgRNfsDy7Tu Jwkdw/5JETIPwhMyh4oO2Q6/A+ax+qXzFIY7sKhMunZBKxlYPj0TQHAA+FqPVQSwqOsB wx/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785316511; x=1785921311; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=oNpiwhcss09c4/Xotm6inwoCx6Njgo/xmgKicXGYy+Y=; b=brqr1G/rSgl4YvZGPaJ4q2ROwGysaR6dZ+sbeODBmkonpEY4nXvuHB4ye61XrCmmCU JtJMmUFErEGngpJAB1pcLPhiz9bUC8N7Vzjc5Tk8UvjlLBbapGcsjIxFOwyq4+2EK7aB rWSuTrU1P9yqOmSoh+eM4EDT+irg25mAkrpnY3g9vwAgCH14rjyl2ejjEzothj7PanuL nyGXCzGFlgF1k5E4RbcSTcHG5fGGYFL+29cjUmw8JmYWYjH0jbcGGZDpdUFzYhNgPEpk 9qP+pBIUlvmHyw0SkFPf8ituIzvxkIEih6u0MkfxE5ZEYGDUnTQQqJA26P0ZITv9F15x 3Wjw== X-Forwarded-Encrypted: i=1; AHgh+RqX0o1eCGAfzWaJ4BM1BeaJqLYBFm18mRRhReZ6sHWW6ACRuIH7wiSadBbKzhlVyd6vx3rJn0/bArS0chs=@vger.kernel.org X-Gm-Message-State: AOJu0YyonhicTs2XD5BTdsSJjQJ2NfnUEz24NX+/5OnBjpOQST/L/0US VsatjHNlz5V3toa/z4TLpqxfXwzsxgKobn09m0frXaAtoQ9xjUxgq57vFzeoe+THVe8= X-Gm-Gg: AR+sD12OezSyIg+E87YYNYXBKJXKlAxg2mYA5NZM7Jd7frPY1/46GcU0tmdsFlLOHR4 +qdcxDywTum7KcBhub5m7jT1RFZbFQG9ifGRt4xcLZNOiBtQciym57LwZyhJj+WqYBPdnBof9BI Vp6h4eDJ5r88iGTxz5Do7g53nMt2H6De1tsyYtMq7zzQ0xZdb7MFWzzhkdV2cyq414GBgMEZqpB ppsPVbzYSScLXTVn0Kh3UNeJbCX15v1VrL/BSh5VmkLsKB5HvYiHR6cySIrGgboU3bIvewVblP+ yCYgFwSyiBVC/22G+zZ34nvYBYJh4O4IbEcvD36qjD3cyN8Q5hcNk9m77Ptmg2qrscnu3VovKur iTdALHxNtVkiGUx/s2f0DaeZqoOS8oq1rxOLQ/STc09gOKLDLSsQPAYImtW6bwVsnqbYXjAcnsm Sk3auQiK0FsS8QFTNX0SKCsENX7g7OdHGHj6K8tVr6xDKIvismzmO53/wxBWSFSlNiUUkteA== X-Received: by 2002:a05:600c:a42:b0:493:b4cf:d37f with SMTP id 5b1f17b1804b1-496c655ae85mr65209915e9.16.1785316510535; Wed, 29 Jul 2026 02:15:10 -0700 (PDT) Received: from localhost ([140.209.217.211]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49764d72d9asm44869235e9.3.2026.07.29.02.15.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jul 2026 02:15:10 -0700 (PDT) Date: Wed, 29 Jul 2026 11:15:06 +0200 From: Jiri Pirko To: Jiale Yao Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] team: reject CAN and IEEE 802.15.4 devices in team_port_add Message-ID: References: <20260728151240.89434-1-yaojiale02@163.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260728151240.89434-1-yaojiale02@163.com> Tue, Jul 28, 2026 at 05:12:40PM +0200, yaojiale02@163.com wrote: >Enslaving a CAN or IEEE 802.15.4 device (e.g. vxcan, wpan0) to a >team master triggers a NULL pointer dereference because these >device types use different Layer 2 architectures from Ethernet and >the team driver never initializes their private mid-layer data >structures. > >Reject ARPHRD_CAN, ARPHRD_IEEE802154, and ARPHRD_IEEE802154_MONITOR >devices in team_port_add(), mirroring the existing CAN check already >present in the bonding driver since commit 8ba68464e478 ("bonding: >refuse to enslave CAN devices"). Can we perhaps have a unified helper for the check? > >Link: https://lore.kernel.org/all/b58d98e0-8fe3-4e4e-b8a5-c1c7e647ccca@hartkopp.net/ >Fixes: 1d76efe1577b ("team: add support for non-ethernet devices") >Assisted-by: Claude:deepseek-v4-pro Looks your ai gone a bit wild here... >Signed-off-by: Jiale Yao >--- >V1 -> V2: Extended check to also reject ARPHRD_IEEE802154 and > ARPHRD_IEEE802154_MONITOR devices per review feedback >--- > 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 >index feaa75fbf8fc..d8c46105fc8b 100644 >--- a/drivers/net/team/team_core.c >+++ b/drivers/net/team/team_core.c >@@ -1224,6 +1224,17 @@ static int team_port_add(struct team *team, struct net_device *port_dev, > return -EINVAL; > } > >+ if (port_dev->type == ARPHRD_CAN || >+ port_dev->type == ARPHRD_IEEE802154 || >+ port_dev->type == ARPHRD_IEEE802154_MONITOR) { >+ NL_SET_ERR_MSG(extack, >+ "CAN and IEEE 802.15.4 devices can't be added as a team port"); >+ netdev_err(dev, "Device %s is CAN or IEEE 802.15.4. 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 " >-- >2.34.1 >