]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: 802: LLC+SNAP OID:PID lookup on start of skb data
authorAntonio Pastor <antonio.pastor@gmail.com>
Fri, 3 Jan 2025 01:23:00 +0000 (20:23 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2025 12:34:38 +0000 (13:34 +0100)
commit0a5026be1a5652f519c9bbe2737b44b07eb403be
tree40af4691b0e8dfe0137dfafde1a38f2ad8aafa4b
parent4589abf8c4b2c039bdd7fdd29214c9d2a4eed3d5
net: 802: LLC+SNAP OID:PID lookup on start of skb data

[ Upstream commit 1e9b0e1c550c42c13c111d1a31e822057232abc4 ]

802.2+LLC+SNAP frames received by napi_complete_done() with GRO and DSA
have skb->transport_header set two bytes short, or pointing 2 bytes
before network_header & skb->data. This was an issue as snap_rcv()
expected offset to point to SNAP header (OID:PID), causing packet to
be dropped.

A fix at llc_fixup_skb() (a024e377efed) resets transport_header for any
LLC consumers that may care about it, and stops SNAP packets from being
dropped, but doesn't fix the problem which is that LLC and SNAP should
not use transport_header offset.

Ths patch eliminates the use of transport_header offset for SNAP lookup
of OID:PID so that SNAP does not rely on the offset at all.
The offset is reset after pull for any SNAP packet consumers that may
(but shouldn't) use it.

Fixes: fda55eca5a33 ("net: introduce skb_transport_header_was_set()")
Signed-off-by: Antonio Pastor <antonio.pastor@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250103012303.746521-1-antonio.pastor@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/802/psnap.c