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=1796270381; b=LeHi/4VssuGWIPL5tLjP/FK/nTsv3adKQhNLVa1tZnRzi56FM0gtnEEOiz5uV6OVLIEZ r4zQr0lEp3cdtr2AnI3h5HIBt52RHw/mTl2XuWqcSozAfjxf1km9+hpAYtzJ2+2E6aobR avKLxFPtQm8YwedPseH9gulMCIt7exbK7csFuivXnEJ5uQPAzXtf5yzQvZfxDlt1oh3Hp EATwoAnHb6Q8ICeJRIkRU98lg4ZxdvDfL1lpl+pHXINodJwVQ51fnkYCbLmxEkRVUgbnQ w0TWbIdNwaJ5pGwCdpBg/KSPmRgvA5JNj0WDVkAaKgbtpUlFWGoXHDSLXVBiKt2FXCQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796270381; 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=yxyurfhNplXDYNzEX/ejfJMkAVWGC6OvjxA8Trm0AMw=; b=rUwaRJRwUs4NE0SImhLY+OgKpD/XhgiOjIxOP+1Q+twvwnFmoHDlgoWj/p4oISrWIcqV o0tTsf3DLnJmwqhSGX6In9UQhbDq+byB1jJ7mjke9HxJpanrnkjfW2s+pEJP1f2LG490I o6pwUlU5Gp6cbH6rbNZTfr5U2IbTFZLNXR+Ajt8LzEOUVE/PTdf/6vKCJKCaqK8Cocjkv 9/9nMvmpznNDQrWEcWUt5f3Qml7LKpBHgkSNBJumTolavU3v4qMbPge1lzENNgZ47ImnX weSrhdyb49hBinKUuoNNUEYRl/f6jk50HUsHh4BiiCmOFxshisjWEN60F3xRzWJHdPw== 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=NomIh3rz; 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 19E8E606A322; Thu, 3 Dec 2026 03:59:40 +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=NomIh3rz Received: by smtp.kernel.org (Postfix) with ESMTPSA id B56EC1F00893; Thu, 3 Dec 2026 03:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796270380; bh=yxyurfhNplXDYNzEX/ejfJMkAVWGC6OvjxA8Trm0AMw=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=NomIh3rzrbZklG93D3eGUmijOzLSRNN+nm12Y7CMzggswzBS3TCA9qQKGVomOFThI 3KKMolsCtsTHRd3ZRz3WbSlALk1xJO/MWTRTqfo81jMPAxUcm49Ava4oFmG+tBvgnA OzVKQZywbZSegzfgP5E8fSzNy59cGoujExkfF6m5xCoukExkDmuutDFzrukET2r0W2 tyWsSj5CaKqjrU5Sdbnh7wQBqMw2b/m7lGBTdpMLuXQIa5r5/inH8KpgxXKmbS3IG8 70LCLqbebayp/REnRQjzPwV+BcXsznG8Jzlj1wvuiVOznYG3kiFAijxGpFvWpJt3Cc 6SkgCEgC3nkmg== Subject: Re: [PATCH net-next v7 2/5] erspan: take the COS from the mirrored frame, not from the tunnel family From: netdev-bot+sashiko@kernel.org To: littlesmilingcloud@gmail.com Cc: netdev@vger.kernel.org, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net, horms@kernel.org, dsahern@kernel.org, willemb@google.com, idosch@nvidia.com, fw@strlen.de, u9012063@gmail.com, mvohra@vmware.com, matthias.may@westermo.com, mazin@getstate.dev, shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 03 Dec 2026 03:59:39 +0000 Message-ID: <179627037924.3146.7104138756725327763@kernel.org> In-Reply-To: <20261201005941.1536429-3-littlesmilingcloud@gmail.com> References: <20261201005941.1536429-3-littlesmilingcloud@gmail.com> X-sashiko-severity: Low 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 more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] The commit "erspan: take the COS from the mirrored frame, not from the tunnel family" fixes two old bugs in erspan_build_header()… -- erspan: take the COS from the mirrored frame, not from the tunnel family The patch adds a helper, erspan_frame_tos(). erspan_build_header() and erspan_build_header_v2() now use it to read the TOS for the ERSPAN COS field from the mirrored frame, not from the tunnel family. The helper reads the two bytes with skb_header_pointer(), and the patch drops the is_ipv4 argument and the stale forward declaration in ip_gre.c. > erspan: take the COS from the mirrored frame, not from the tunnel family > > erspan_build_header() and erspan_build_header_v2() take the TOS for > the COS field from ip_hdr(skb)->tos when the tunnel is IPv4 and from > the IPv6 traffic class when the tunnel is IPv6. But is_ipv4 describes > the tunnel, not the mirrored frame, so [ ... ] > - a frame that is neither gets its COS from whatever lies at the > network header offset, which for a short frame is past its end. [ ... ] > - a 14 byte non-IP frame gives a KMSAN report when the packet is > received on the other side; with the patch it does not. > > Signed-off-by: Anton Danilov [Severity: Low] Should this patch have Fixes: tags? It fixes two old problems in erspan_build_header() and erspan_build_header_v2() in include/net/erspan.h: - For short non-IP frames, the ip_hdr(skb)->tos / ipv6_hdr(skb) read at the network header is unbounded, and KMSAN reports it. - The COS is wrong when the mirrored frame's family differs from the tunnel's. The previous patch in the series, "erspan: bound the VLAN tag read in erspan_build_header{,_v2}()", has these tags: Fixes: 84e54fe0a5ea ("gre: introduce native tunnel support for ERSPAN") Fixes: f551c91de262 ("net: erspan: introduce erspan v2 for ip_gre") Reported-by: syzbot+9e27778c0edc62cb97d8@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=9e27778c0edc62cb97d8 Its message also says it depends on this patch: With this patch and the next one, which bounds the remaining read of this kind, the same frames give no report on erspan. Without Fixes: tags here, stable selection could take only the first patch. Stable kernels would then keep the uninitialized TOS read and the wrong COS. The old read can be reached on existing kernels. erspan_xmit() checks the length only through pskb_inet_may_pull_reason(), and that pulls nothing for a non-IP skb->protocol: include/net/ip_tunnels.h:pskb_inet_may_pull_reason() { ... default: nhlen = 0; } return pskb_network_may_pull_reason(skb, nhlen); } Blame on the baseline shows where the two reads came from: - the one in erspan_build_header() with a3222dc95ca7 - the one in erspan_build_header_v2() with f551c91de262 Would it work to use the same two Fixes: tags as the previous patch, plus the commit that added the ip6erspan callers that pass is_ipv4 as false? A note saying that this patch completes the syzbot fix could also help. -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201005941.1536429-1-littlesmilingcloud%40gmail.com