All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH] ice: add missing reset of the mac header
@ 2026-03-20  5:05 ` Aleksandr Loktionov
  0 siblings, 0 replies; 11+ messages in thread
From: Aleksandr Loktionov @ 2026-03-20  5:05 UTC (permalink / raw)
  To: intel-wired-lan, anthony.l.nguyen, aleksandr.loktionov
  Cc: netdev, Katarzyna Wieczerzycka

From: Katarzyna Wieczerzycka <katarzyna.wieczerzycka@intel.com>

By default skb->mac_header is not set, so reset prevents access to an
invalid pointer.

Call skb_reset_mac_header() before accessing the mac header from skb.

Signed-off-by: Katarzyna Wieczerzycka <katarzyna.wieczerzycka@intel.com>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_txrx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index a2cd4cf..374b17f 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -2211,6 +2211,8 @@ ice_xmit_frame_ring(struct sk_buff *skb, struct ice_tx_ring *tx_ring)
 		goto out_drop;
 
 	/* allow CONTROL frames egress from main VSI if FW LLDP disabled */
+	if (likely(!skb_mac_header_was_set(skb)))
+		skb_reset_mac_header(skb);
 	eth = (struct ethhdr *)skb_mac_header(skb);
 
 	if ((ice_is_switchdev_running(vsi->back) ||
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-03-26 14:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20  5:05 [Intel-wired-lan] [PATCH] ice: add missing reset of the mac header Aleksandr Loktionov
2026-03-20  5:05 ` Aleksandr Loktionov
2026-03-20 18:04 ` [Intel-wired-lan] " Simon Horman
2026-03-20 18:04   ` Simon Horman
2026-03-20 19:53   ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-03-20 19:53     ` Loktionov, Aleksandr
2026-03-21  9:14     ` [Intel-wired-lan] " Simon Horman
2026-03-21  9:14       ` Simon Horman
2026-03-26 14:14   ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-03-26 14:14     ` Loktionov, Aleksandr
2026-03-24 18:02 ` [Intel-wired-lan] " Alexander Lobakin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.