From: Greg Kroah-Hartman Date: Mon, 18 Feb 2019 12:48:10 +0000 (+0100) Subject: 3.18-stable patches X-Git-Tag: v3.18.135~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=961e3c1b23161db7d7ee6788fddfdf66f50a47bd;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: kaweth-use-skb_cow_head-to-deal-with-cloned-skbs.patch smsc95xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch usb-dwc2-remove-unnecessary-kfree.patch --- diff --git a/queue-3.18/kaweth-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/queue-3.18/kaweth-use-skb_cow_head-to-deal-with-cloned-skbs.patch new file mode 100644 index 00000000000..3e05edbc7a2 --- /dev/null +++ b/queue-3.18/kaweth-use-skb_cow_head-to-deal-with-cloned-skbs.patch @@ -0,0 +1,50 @@ +From 39fba7835aacda65284a86e611774cbba71dac20 Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Wed, 19 Apr 2017 09:59:26 -0700 +Subject: kaweth: use skb_cow_head() to deal with cloned skbs + +From: Eric Dumazet + +commit 39fba7835aacda65284a86e611774cbba71dac20 upstream. + +We can use skb_cow_head() to properly deal with clones, +especially the ones coming from TCP stack that allow their head being +modified. This avoids a copy. + +Signed-off-by: Eric Dumazet +Cc: James Hughes +Signed-off-by: David S. Miller +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/usb/kaweth.c | 18 ++++++------------ + 1 file changed, 6 insertions(+), 12 deletions(-) + +--- a/drivers/net/usb/kaweth.c ++++ b/drivers/net/usb/kaweth.c +@@ -812,18 +812,12 @@ static netdev_tx_t kaweth_start_xmit(str + } + + /* We now decide whether we can put our special header into the sk_buff */ +- if (skb_cloned(skb) || skb_headroom(skb) < 2) { +- /* no such luck - we make our own */ +- struct sk_buff *copied_skb; +- copied_skb = skb_copy_expand(skb, 2, 0, GFP_ATOMIC); +- dev_kfree_skb_irq(skb); +- skb = copied_skb; +- if (!copied_skb) { +- kaweth->stats.tx_errors++; +- netif_start_queue(net); +- spin_unlock_irq(&kaweth->device_lock); +- return NETDEV_TX_OK; +- } ++ if (skb_cow_head(skb, 2)) { ++ kaweth->stats.tx_errors++; ++ netif_start_queue(net); ++ spin_unlock_irq(&kaweth->device_lock); ++ dev_kfree_skb_any(skb); ++ return NETDEV_TX_OK; + } + + private_header = (__le16 *)__skb_push(skb, 2); diff --git a/queue-3.18/series b/queue-3.18/series index a72228070c9..2566885d437 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -102,3 +102,6 @@ alpha-fix-eiger-nr_irqs-to-128.patch tracing-uprobes-fix-output-for-multiple-string-arguments.patch signal-restore-the-stop-ptrace_event_exit.patch x86-a.out-clear-the-dump-structure-initially.patch +smsc95xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch +kaweth-use-skb_cow_head-to-deal-with-cloned-skbs.patch +usb-dwc2-remove-unnecessary-kfree.patch diff --git a/queue-3.18/smsc95xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch b/queue-3.18/smsc95xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch new file mode 100644 index 00000000000..16ab431f5eb --- /dev/null +++ b/queue-3.18/smsc95xx-use-skb_cow_head-to-deal-with-cloned-skbs.patch @@ -0,0 +1,47 @@ +From e9156cd26a495a18706e796f02a81fee41ec14f4 Mon Sep 17 00:00:00 2001 +From: James Hughes +Date: Wed, 19 Apr 2017 11:13:40 +0100 +Subject: smsc95xx: Use skb_cow_head to deal with cloned skbs + +From: James Hughes + +commit e9156cd26a495a18706e796f02a81fee41ec14f4 upstream. + +The driver was failing to check that the SKB wasn't cloned +before adding checksum data. +Replace existing handling to extend/copy the header buffer +with skb_cow_head. + +Signed-off-by: James Hughes +Acked-by: Eric Dumazet +Acked-by: Woojung Huh +Signed-off-by: David S. Miller +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/usb/smsc95xx.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -1841,13 +1841,13 @@ static struct sk_buff *smsc95xx_tx_fixup + /* We do not advertise SG, so skbs should be already linearized */ + BUG_ON(skb_shinfo(skb)->nr_frags); + +- if (skb_headroom(skb) < overhead) { +- struct sk_buff *skb2 = skb_copy_expand(skb, +- overhead, 0, flags); ++ /* Make writable and expand header space by overhead if required */ ++ if (skb_cow_head(skb, overhead)) { ++ /* Must deallocate here as returning NULL to indicate error ++ * means the skb won't be deallocated in the caller. ++ */ + dev_kfree_skb_any(skb); +- skb = skb2; +- if (!skb) +- return NULL; ++ return NULL; + } + + if (csum) { diff --git a/queue-3.18/usb-dwc2-remove-unnecessary-kfree.patch b/queue-3.18/usb-dwc2-remove-unnecessary-kfree.patch new file mode 100644 index 00000000000..988d6e645b0 --- /dev/null +++ b/queue-3.18/usb-dwc2-remove-unnecessary-kfree.patch @@ -0,0 +1,31 @@ +From cd4b1e34655d46950c065d9284b596cd8d7b28cd Mon Sep 17 00:00:00 2001 +From: John Youn +Date: Thu, 3 Nov 2016 17:55:45 -0700 +Subject: usb: dwc2: Remove unnecessary kfree + +From: John Youn + +commit cd4b1e34655d46950c065d9284b596cd8d7b28cd upstream. + +This shouldn't be freed by the HCD as it is owned by the core and +allocated with devm_kzalloc. + +Signed-off-by: John Youn +Signed-off-by: Felipe Balbi +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/usb/dwc2/hcd.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/usb/dwc2/hcd.c ++++ b/drivers/usb/dwc2/hcd.c +@@ -2953,7 +2953,6 @@ error3: + error2: + usb_put_hcd(hcd); + error1: +- kfree(hsotg->core_params); + + #ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS + kfree(hsotg->last_frame_num_array);