1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-22 16:06:04 -05:00
linux/net/llc
Antonio Pastor a024e377ef net: llc: reset skb->transport_header
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. As snap_rcv expects transport_header
to point to SNAP header (OID:PID) after LLC processing advances offset
over LLC header (llc_rcv & llc_fixup_skb), code doesn't find a match
and packet is dropped.

Between napi_complete_done and snap_rcv, transport_header is not used
until __netif_receive_skb_core, where originally it was being reset.
Commit fda55eca5a ("net: introduce skb_transport_header_was_set()")
only does so if not set, on the assumption the value was set correctly
by GRO (and also on assumption that "network stacks usually reset the
transport header anyway"). Afterwards it is moved forward by
llc_fixup_skb.

Locally generated traffic shows up at __netif_receive_skb_core with no
transport_header set and is processed without issue. On a setup with
GRO but no DSA, transport_header and network_header are both set to
point to skb->data which is also correct.

As issue is LLC specific, to avoid impacting non-LLC traffic, and to
follow up on original assumption made on previous code change,
llc_fixup_skb to reset the offset after skb pull. llc_fixup_skb
assumes the LLC header is at skb->data, and by definition SNAP header
immediately follows.

Fixes: fda55eca5a ("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/20241225010723.2830290-1-antonio.pastor@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-12-27 11:23:37 -08:00
..
af_llc.c llc: Improve setsockopt() handling of malformed user input 2024-11-28 08:57:42 +01:00
Kconfig
llc_c_ac.c
llc_c_ev.c
llc_c_st.c llc: Constify struct llc_conn_state_trans 2024-07-15 08:51:01 -07:00
llc_conn.c llc: Constify struct llc_conn_state_trans 2024-07-15 08:51:01 -07:00
llc_core.c llc: Drop support for ETH_P_TR_802_2. 2024-01-19 21:30:09 -08:00
llc_if.c
llc_input.c net: llc: reset skb->transport_header 2024-12-27 11:23:37 -08:00
llc_output.c
llc_pdu.c
llc_proc.c
llc_s_ac.c
llc_s_ev.c
llc_s_st.c llc: Constify struct llc_sap_state_trans 2024-07-15 08:51:19 -07:00
llc_sap.c llc: Constify struct llc_sap_state_trans 2024-07-15 08:51:19 -07:00
llc_station.c
Makefile
sysctl_net_llc.c net: Remove ctl_table sentinel elements from several networking subsystems 2024-05-03 13:29:42 +01:00