FAILED: patch "[PATCH] ixgbe: fix crash in build_skb Rx code path" failed to apply to 4.4-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
Quoted 1 line
From
0c5661ecc5dd7ce296870a3eb7b62b1b280a5e89Mon Sep 17 00:00:00 2001
From: Emil Tantilov <[email protected]>
Date: Fri, 23 Feb 2018 12:39:41 -0800
Subject: [PATCH] ixgbe: fix crash in build_skb Rx code path
Add check for build_skb enabled ring in ixgbe_dma_sync_frag(). In that case &skb_shinfo(skb)->frags[0] may not always be set which can lead to a crash. Instead we derive the page offset from skb->data.
("ixgbe: Have the CPU take ownership of the buffers sooner")
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +8 -0
@@ -1888,6 +1888,14 @@ static void ixgbe_dma_sync_frag(struct ixgbe_ring *rx_ring,ixgbe_rx_pg_size (rx_ring),DMA_FROM_DEVICE , IXGBE_RX_DMA_ATTR); + }else if (ring_uses_build_skb (rx_ring)) { +unsigned long offset = (unsigned long )(skb->data) & ~PAGE_MASK ; + +dma_sync_single_range_for_cpu (rx_ring->dev, +IXGBE_CB (skb)->dma, + offset, +skb_headlen (skb), +DMA_FROM_DEVICE ); }else {struct skb_frag_struct *frag = &skb_shinfo (skb)->frags[0 ];