From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 1450D2FFF90 for ; Mon, 13 Jul 2026 20:04:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783973065; cv=none; b=o7OllLurtNfiVPLAM4weUMp4s35css+jutnIPo8mJPVeS9UqHwi27IIwWXW3i+VBl4hrmnnN4iyHX2dMaQN1PNohWCsqvPij/JbHN+RVMls4Za/bK3boGutx9hF/nzpFB/iZ0PNnoefmXDFjmc+CYvP64xJBxMCJogRwQGVNgx4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783973065; c=relaxed/simple; bh=YF+KOotGzZmW5OzmRDV//DtHveaZ5nJeRsKupPRkt7Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dxCOPiCI43pj2vJKGw6JqS3yTCwoGicIOB+R/t5udwjlZVpgaabkm1cXHcBTiVapRPxuIQNvP14nLlodUm1tRxI0yP8Q0Bup8G6yxmZ6m9qiV81POki23n7WZxj8Jq6YrnleFO5nfLg3cn8Qidp4e+4mjdp4JNERv75r8/SGiCc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HgkFk3n1; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HgkFk3n1" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-472c021a608so356378f8f.3 for ; Mon, 13 Jul 2026 13:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783973061; x=1784577861; 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=JTj575AcHAom2fz7OwDDRttEo4AE92OOBeJUOqyrws8=; b=HgkFk3n111Uu2CWlsOwuDk71tx53WKuPJM4XSbnq8Ii8Al8FgRS7/TN9Ooc0SzS8Ih 0z/155WlWBOAq8NfjKLt3MkWhLffWp4QKiOrJ1R+AWFtFmg6CofXbl8wSUQeCCfu7Bao rWKrDmeloj9iIvvyP4b5W1CuS+URN+R5CwHxvAuTgAygpTLENCSBV52PH7hi9PZ9H3Ac JG2QsBOeFw+RtnTSsWOselL9mWGqKryCSshJEjD38J0WcGBHAtSaFFpfgWceDYroEJWN I8OiG7NNZA6OsENsVIQ4PWzKDF1zXnjayvMoIVtbZv6QiyCcb67sCUbP5bkbMNXs6UcP Z7BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783973061; x=1784577861; 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=JTj575AcHAom2fz7OwDDRttEo4AE92OOBeJUOqyrws8=; b=ir02vyZgB+SZcYorygQU22D7UHGhRoT2I6qrvCoo+vB4lHhqG+Uv43Jby3nKcvahE7 mI9reV3WTuZM1pvTz0SLJercwbdWUn9DdUu2P9FRpLNQoB6jLolgn+BL7tO8lCc13d4a +/kHKqUxBRCW9J/35p9WgaXAhBlZibadfRyHjusiRjHQwRJ/1D6Brv1i4bYwY4earao2 jeM5L0Tm2XNFTcNg/1Kj5ZCRg8E3R6GBDKaEptlbo7giQegfIb2NNZ2JxW4o1AmB1Yhk epK8KViGN4n6+LWcb1vIRLwECgyOs8BtvV90o8zXeTgzWuTyA2PbVOAqmaySzjBqeuDw 5Daw== X-Forwarded-Encrypted: i=1; AHgh+Rqgqoo5cmpQeb1n0c+yh9xZkeTj7sxuVAq8o3wk5dfJssa64kjbK0DRpOqopgVhrUTpedea3Nbv5J3FqEU=@vger.kernel.org X-Gm-Message-State: AOJu0Yz7v8E74Gq1ur90QVC0zutYT2KIwJfgghD/h7qX/Y+Hp4jgVFmQ mTS5yOkMEhwGzx8eI2W/GGP3p3pVBVx78mdELfNWJZxdhuFwLZlOvkhn X-Gm-Gg: AfdE7ckouEl3cD8JndWib/BRe30jPFFU7/q8I1C3rvPD7X7Y7USBJ549vqZpToHsvpf 93WH+mO0eZrfoV1BC5CMI/qe4Whgu7zCM9D0uYO6dhR0HziEF3uLMofFHltaxmM8egHvJqHRfL+ cxq8OrdMBJ+4fKo7/nYiuG/d6dsBhyh8xCG+f/cMDfzv9vuUHEyissCphynmxAq/vsq4sIwRIF/ iLiSOEQx2bT1PtLke+i1ujDYu2nH/RwtOQGYnEiXfWvqj2GY4qt6WsGU0BxftKksYQFWutxSB4y FMYfnhq2As0xEAR2mixXrIaSbpNa+BzYL5QQ9WvbYI9Z4JC0i7r/hwJbdJttCOT28tZ9AuJzyeB iDwCi239hODBmn4b8xD9cc7ySvjqwsfCF7reILPpHGTGef/T76OeH6B6B/YtbRWjpNfDFU2ShIL hVNjjV X-Received: by 2002:a05:600c:4f94:b0:492:1e4d:d44b with SMTP id 5b1f17b1804b1-493f8835228mr59867925e9.8.1783973061275; Mon, 13 Jul 2026 13:04:21 -0700 (PDT) Received: from skbuf ([2a02:2f04:d40e:d500:d8f0:7a38:1703:914b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4950a322c86sm17366115e9.11.2026.07.13.13.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 13:04:20 -0700 (PDT) Date: Mon, 13 Jul 2026 23:04:17 +0300 From: Vladimir Oltean To: Doruk Tan Ozturk Cc: Andrew Lunn , Florian Fainelli , Woojung Huh , Nick Child , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Sabrina Dubroca , Arun Ramadoss , UNGLinuxDriver@microchip.com, Michael Ellerman , stable@vger.kernel.org Subject: Re: [PATCH net 1/3] net: dsa: tag_ocelot_8021q: don't read an unset MAC header on transmit Message-ID: <20260713200417.dghlrj4ca27b6nd4@skbuf> References: <20260713194010.54642-1-doruk@0sec.ai> <20260713194010.54642-2-doruk@0sec.ai> 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: <20260713194010.54642-2-doruk@0sec.ai> On Mon, Jul 13, 2026 at 09:40:08PM +0200, Doruk Tan Ozturk wrote: > ocelot_xmit() reads the Ethernet header via eth_hdr(skb) to test the > destination address against the link-local range. > > On the AF_PACKET SOCK_RAW + PACKET_QDISC_BYPASS transmit path the skb > reaches ndo_start_xmit() with the MAC header unset, so eth_hdr(skb) > resolves to skb->head + (u16)~0 and the read is out of bounds. > > On the TX path the L2 header is at skb->data, so use skb_eth_hdr(), as > done for the same class by > commit f5089008f90c ("macsec: don't read an unset MAC header in macsec_encrypt()") > and commit 96cc4b69581d ("macvlan: do not assume mac_header is set in macvlan_broadcast()"). > > Fixes: 43ba33b4f143 ("net: dsa: tag_ocelot_8021q: fix inability to inject STP BPDUs into BLOCKING ports") > Cc: stable@vger.kernel.org > Found by 0sec automated security-research tooling (https://0sec.ai). > Assisted-by: 0sec:claude-opus-4-8 > Signed-off-by: Doruk Tan Ozturk > --- Reviewed-by: Vladimir Oltean I was not aware of the bug introduced by commit d346a3fae3ff ("packet: introduce PACKET_QDISC_BYPASS socket option"). Commits eabb1494c9f2 ("net: dsa: tag_ocelot: do not rely on skb_mac_header() for VLAN xmit") 499b2491d550 ("net: dsa: tag_ksz: do not rely on skb_mac_header() in TX paths") f9346f00b5af ("net: dsa: tag_sja1105: don't rely on skb_mac_header() in TX paths") 0bcf2e4aca6c ("net: dsa: tag_ocelot: call only the relevant portion of __skb_vlan_pop() on TX") were made assuming that the bug to avoid would be exclusively a future one (the revert of commit 6d1ccff62780 ("net: reset mac header in dev_start_xmit()")) and thus they were not marked as bug fixes. Are they true bug fixes, as in "can we reproduce these [using CONFIG_NET_DSA_LOOP=y on virtually any network adapter]"? If so, should all the commits above also be backported to stable?