From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796420184; b=u3Cyn+vFLm9NbbC6iYpG3hfbO1WrrVDULJDx0etwSeBv5J3CJvR1Y32sh3ZhHWuJac+N pj9X1kQ2HrSj3nit8Japa6ABDHKwa6hKq70se9gi3hRguRHL+z/eh9DXGYTMcjPq4Jz+S Me4Y2krM/tFKQJFnZ0e8XpvqI57ntTqvQ9a4zoEx2KCtB2nzgHtBjOmyveYD0UAhx4fpu qGJeXjLJcVCjfQJrWoPbb1TsbSrfm0fmY0K2Nh5g+TT38mN5c078kdcGoCKaSo7jwePSk l0kximrsbRoYgjMvXOgizuolIVDl8zMrfUkyyboZOubpeGUQIgTTxwVxjfhldJC/CGw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796420184; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=tHFfTN6/Az+JWlFncnrIxGUFPmydCd18EDewIR2WRm8=; b=uM7dwdkZxAoWZpyjn7NHuNKzAURkVkt99tgWEgsfISweC1i6DazvTXc9b9CEWXwI+4ZG ho9IwdAbGDaPQY0a9krdk1x9v6hA3OjQxJHsV8WVleI3y9VGj1RKtltGP86kQyLQ76k0H I0ydTNKNF/6b1Oizu7cf/sbDFle9P1LYyM/TQ8FgyemeXusJ8f5V3cp736zjQNaRTlCR8 0OaBYoK7AiXhmBv4JTig3k73tWvPwYH6jmizm16/AlUMwHZ6F/43VPBtlhqtfiqTrW49m VKvmzbipASb/zcXmfWn3pBddmDttLPcD9XfXTsIqnDO+qbnDUhcBvQDJkInOUGIrSow== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=odXNWc6M; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C42E606A322 for ; Fri, 4 Dec 2026 21:36:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=odXNWc6M Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FA3B1F00A06; Fri, 4 Dec 2026 21:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796420183; bh=tHFfTN6/Az+JWlFncnrIxGUFPmydCd18EDewIR2WRm8=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=odXNWc6M/eqDQc+wCS2ea51QAsjvWSiJa/iGghUTHU3d9+XjJruB3m+dTQaYLkqcj RsDoPjbWT19p2rr0qz3ssj05l/ZkF4iL4/fkyyFEWk0t+weTpgMfnc0OlMXgtDNAMH vzQ8Kl+/EQo8HDVppukZUhyTMFDZ/pi/Qwt/fb5NXxbFzTkmb2c1jjbSpOz1G1CjLQ BPxpB/k+s8L9UB+5Te9ZO45QnTWl+QHc8fZjFSmf6bAoQkiUfQDtVBCulaYptXq+d2 nHRiYjTxcMAa8JKWisYkrs1ZrxdC4shUqo52OzXAr7tb5mky1ORMLDZzcpezVWBcWK KhBnRXmaqAVuA== Subject: Re: [PATCH net] macsec: reject lower device type changes From: netdev-bot+sashiko@kernel.org To: kyuwon.cho@skku.edu Cc: sd@queasysnail.net, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, radu-nicolae.pirea@oss.nxp.com, netdev@vger.kernel.org Date: Fri, 04 Dec 2026 21:36:22 +0000 Message-ID: <179642018292.3146.12819606039816109021@kernel.org> In-Reply-To: <179633073717.3973710.645966213375260560@skku.edu> References: <179633073717.3973710.645966213375260560@skku.edu> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 1 · Low: 0 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] The Fixes: tag and the commit message point at the wrong origin and understate what the change does. -- macsec: reject lower device type changes This patch makes macsec_notify() return NOTIFY_BAD for NETDEV_PRE_TYPE_CHANGE on a macsec lower device, which matches what macvlan and ipvlan already do. It fixes a KASAN stack out-of-bounds read in macsec_set_mac_address(). That read happens after the lower device changes to a type with a longer address. > Fixes: 25a00d0cd691 ("net: macsec: revert the MAC address if mdo_upd_secy fails") [Severity: Medium] Does this Fixes: tag point at the right commit? The Ethernet-only rule for macsec lower devices comes from commit b06d072ccc4b ("macsec: restrict to ethernet devices"). That commit added this check to macsec_newlink(): if (real_dev->type != ARPHRD_ETHER) return -EINVAL; The check only runs when the macsec device is created. Before this patch, nothing stopped the lower device from changing type afterwards. Bond, team, tun (TUNSETLINK), qmi_wwan and hdlc all send NETDEV_PRE_TYPE_CHANGE, and macsec_notify() did not veto it. Commit 25a00d0cd691 only added the six-byte old_addr[ETH_ALEN] stack buffer in macsec_set_mac_address(). The KASAN read shows up there, in dev_uc_del(real_dev, old_addr). That is where the symptom appears, not where the bug came from. Stable trees older than v6.8 do not have 25a00d0cd691, but they still let the lower device change type. With only this tag, would those trees miss the fix? On those kernels macsec_handle_frame() can again receive non-Ethernet frames. That is the problem b06d072ccc4b was written to fix (a syzbot KMSAN report with a phonet lower device). Here is one way to hit it before this patch: 1. Create a bond with no slaves, so its type is ARPHRD_ETHER. 2. Add a macsec device on top of the bond. 3. Enslave a non-Ethernet device to the bond. bond_enslave() sends NETDEV_PRE_TYPE_CHANGE, macsec_notify() lets it through, and the bond's type changes under the macsec device. Would it make sense to use this tag instead: Fixes: b06d072ccc4b ("macsec: restrict to ethernet devices") 25a00d0cd691 could stay as a second Fixes: tag. The commit message only describes the MAC address path. Could it also say that the patch makes the Ethernet-only rule hold for the whole lifetime of the macsec device? > diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c > index 240ba0ae07d1e..5dd6f18cd1860 100644 > --- a/drivers/net/macsec.c > +++ b/drivers/net/macsec.c > @@ -4508,6 +4508,8 @@ static int macsec_notify(struct notifier_block *this, unsigned long event, > rxd = macsec_data_rtnl(real_dev); > > switch (event) { > + case NETDEV_PRE_TYPE_CHANGE: > + return NOTIFY_BAD; > case NETDEV_DOWN: > case NETDEV_UP: > case NETDEV_CHANGE: -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/179633073717.3973710.645966213375260560%40skku.edu