Skip to content

Commit 41d2e3b

Browse files
Antonio Pastorgregkh
authored andcommitted
net: 802: LLC+SNAP OID:PID lookup on start of skb data
[ Upstream commit 1e9b0e1 ] 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() (a024e37) 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: fda55ec ("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>
1 parent 45ae076 commit 41d2e3b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/802/psnap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ static int snap_rcv(struct sk_buff *skb, struct net_device *dev,
5555
goto drop;
5656

5757
rcu_read_lock();
58-
proto = find_snap_client(skb_transport_header(skb));
58+
proto = find_snap_client(skb->data);
5959
if (proto) {
6060
/* Pass the frame on. */
61-
skb->transport_header += 5;
6261
skb_pull_rcsum(skb, 5);
62+
skb_reset_transport_header(skb);
6363
rc = proto->rcvfunc(skb, dev, &snap_packet_type, orig_dev);
6464
}
6565
rcu_read_unlock();

0 commit comments

Comments
 (0)