From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (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 371123382C9 for ; Mon, 13 Jul 2026 21:37:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783978629; cv=none; b=E8+jGyc9g7Sv//oDXPHBvnmhqpocaOoDL8uPyessjt91XQVSoHD66UahCP8EDWqMhny9J/HuRvrgG2FuMUVEwGbl3Je4TxOxg+2M15WL5W81nOUWSbgW9TwX2fPk81DsrJ8DFr+UaVNpbh5zEcTc0mOLrhKbuT9Y/nt8RZvVn4s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783978629; c=relaxed/simple; bh=pkkipRXB4vj3yiwDAjdxncf0VuKYLA3vSbGWEP/PV2Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VNGhnwvtBXvwQIPMMvFH7MvxucYgdXYPfpLYx6ANyhBO/mUSGBz5s+pY+j3NOZGhA7TfcVtPIb/SiwJuav6uGPp4e6B6GKS4TBbzZpf95eGSMu9qqZsDD6L+muVjtkJAyKrsU6IHO5IpxRHb62/MJCI72xo1ghs1FzP8w2WiXPg= 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=MAxdTrOn; arc=none smtp.client-ip=209.85.221.53 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="MAxdTrOn" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-4765eec32e1so215244f8f.1 for ; Mon, 13 Jul 2026 14:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783978627; x=1784583427; 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=KFg02OlTkf2Yn/CkP+xFl6ERBV7PQVQSfXTqSOnpsLE=; b=MAxdTrOnTxSjniqa0rD5zSi4thLPyLfudkS4W/w7KvMDm7F3ga+cgyVMfoXZQbeHL2 TiGhTVjs+nh64brMeCulIosK4UpMNHRfIfjGizJss6eRL5twOUYy7u9rvYX8q6QrKMF6 hrPb8IYIwT17TX9c5GOojdFg/j4xCBuuo5OzM8QfmDBXa3k5mEXsJo7JVVqYl3poVHmX /e3PJzgI1EN35nhV4/eii1E2SUzl8S9hUyXpnTkdtV07T9ulSlS/sQYFEMwcqzlizOOp 3gbqIksItik3o3fC8AFdLG/o2gRV7kAuc4hySXZYWCv7yiEoICWdN7EjLodmTnFnnFrW hLPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783978627; x=1784583427; 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=KFg02OlTkf2Yn/CkP+xFl6ERBV7PQVQSfXTqSOnpsLE=; b=dIFYr998Gdj1NrrJ2Jhp2uxNRvnetF+7MaStcnFXIlm+9EUXtfp2vNNhXr5uVxIimP srrJQKGoJ5b8eSjm7DLvqyv2KXYg4HrkCShXY3fof8LXOVoK4ubvF2xcR8r5lZjkYejf oDOJ1zGkFDfCGaKB/SadQDmugE1W9bzX+Fa4ua9P7fFYbF9MHIPHakarzEVvND8V5W4q vSMDNFwtbHe1YIX9o6iFFxXa/Fj8xdd8HFT+SM89YqosEaiyM0mOGpnMsqNkq+WlZhiX O8suEGM1B5AQwGzYSm0906JWbnlw7f2BZ/0ueI/0o086fio/He4pD3bes6mCk/XBEeDU o2Ug== X-Forwarded-Encrypted: i=1; AHgh+Rrgss/Y+7B/CAujUR5SQCvpcx6EKa8O3EfjPGb6vOT12gBWJtFTtJL6cEBfOIQSEc8a/5lwJXkP1B/qcC4=@vger.kernel.org X-Gm-Message-State: AOJu0YzT7zMmL4SVZN6f6nnGmMROjo6bCXvDXAEG1G6U7sU3Fkaz+WS9 Pc9zuFBosxCuI3PFOfP/YUN6SRmfe17ntAuzy1Gx0GyE82RaIjnHCI8KlDwaTxuq X-Gm-Gg: AfdE7cmnmTMO1R017TbLTL+zhg4vXaAVk32qTIWjfNdsceU+iRaWa684lIvbNDPl+dh d99GwqAOI54OxFtFV050ppsy52BriRMA7M3nOkD/PFSHy+PrFyT4jUX9n4UgTaUD9JyuL/Nhfln cZ6xuqLNunbxIrxCixbLPaIyUpjcWj1W7ZQGzs5ofbvDk3MuC3SHyEgBO9lix5uJSmB224lFhn1 esEtV16JMKaxSnRQjUhKGB1T/Z9ebXChZhgy7j5U+8QZNsFiWhzZ+W4BL4OHGYmG6NTvsNkgJxj b3E7piXS7madefXicijIQ7V3QD/iXfPxQmpFJjwSYarsxChz0tJGSk1kmFnsU36QnZrmh95TiTu Uxfzkz3Z7AzUKlRq0s+33+MuTPUcTMRHdh7aaNasXryzHn6+6hHwcrRUSkXuC4e0E/QT9oe1Cbw qnbRn3 X-Received: by 2002:a05:6000:1843:b0:47d:ed40:a913 with SMTP id ffacd0b85a97d-47f2dd21ae8mr7457545f8f.7.1783978626485; Mon, 13 Jul 2026 14:37:06 -0700 (PDT) Received: from skbuf ([2a02:2f04:d40e:d500:d8f0:7a38:1703:914b]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47f464c25b2sm2173077f8f.30.2026.07.13.14.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2026 14:37:05 -0700 (PDT) Date: Tue, 14 Jul 2026 00:37:02 +0300 From: Vladimir Oltean To: "Doruk (0sec)" 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: <20260713213702.3kjamxnto2bciqak@skbuf> References: <20260713194010.54642-1-doruk@0sec.ai> <20260713194010.54642-2-doruk@0sec.ai> <20260713200417.dghlrj4ca27b6nd4@skbuf> 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: On Mon, Jul 13, 2026 at 04:12:20PM -0500, Doruk (0sec) wrote: > Hi Vladimir, > > Thanks for the review. > > I checked the DSA cases with CONFIG_NET_DSA_LOOP=y. Since dsa_loop > normally uses DSA_TAG_PROTO_NONE, I used a local repro-only override > of dsa_loop_get_protocol() to select the relevant tagger, then sent an > AF_PACKET/SOCK_RAW frame with PACKET_QDISC_BYPASS and > sll_protocol=ETH_P_IP through lan1. > > That leaves skb->mac_header unset (65535) on the direct-xmit path. > > For tag_ocelot_8021q, the eth_hdr(skb) version reproduces as: > > BUG: KASAN: slab-out-of-bounds in ocelot_xmit() > > Switching that site to skb_eth_hdr(skb) makes the same reproducer run clean. > > I also checked the LAN937X path the same way by forcing > DSA_TAG_PROTO_LAN937X. The eth_hdr(skb) version reproduces as: > > BUG: KASAN: slab-out-of-bounds in lan937x_xmit() > > and the skb_eth_hdr(skb) version runs clean with the same packet sender. > > So yes, for these DSA TX paths this is a real bug on the > PACKET_QDISC_BYPASS path, not just a future-proofing cleanup. I have > not yet checked ibmveth with a pseries/ibmveth setup. Thanks for clarifying your testing procedure (and please do not top-post replies). Yes, manually editing dsa_loop_get_protocol() is the current state of the art technology. > For the older DSA commits you listed, I think they should be treated > as stable candidates if they remove eth_hdr()/skb_mac_header() use > from the same TX path. I can go through those individually and send a > follow-up with the exact stable list if that would be useful. Since skb_mac_header() in TX paths is the real problem, I now think those commits should need backporting too. I only reworked the first-order callers of skb_mac_header(), not realizing that eth_hdr() needs rework too - and not having a clear testing procedure at the time. I think it would be great if you could prepare an email to the stable mailing list and to the maintainers.