Skip to contentSkip to conversation

patch "usb: gadget: eem: fix wrong eem header operation" added to usb-linus

PATCH [email protected] 1 participant 1 message Jun 9, 2021

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

usb: gadget: eem: fix wrong eem header operation

to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.

The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)

The patch will hopefully also be merged in Linus's tree for the next -rc kernel release.

If you have any questions about this process, please let me know.

From 305f670846a31a261462577dd0b967c4fa796871 Mon Sep 17 00:00:00 2001
From: Linyu Yuan <[email protected]>
Date: Wed, 9 Jun 2021 07:35:47 +0800
Subject: usb: gadget: eem: fix wrong eem header operation

when skb_clone() or skb_copy_expand() fail,
it should pull skb with lengh indicated by header, or not it will read network data and check it as header.

---
 drivers/usb/gadget/function/f_eem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/function/f_eem.c +2 -2
index e6cb38439c41..2cd9942707b4 100644
@@ -495,7 +495,7 @@ static int eem_unwrap(struct gether *port,
 			skb2 = skb_clone(skb, GFP_ATOMIC);
 			if (unlikely(!skb2)) {
 				DBG(cdev, "unable to unframe EEM packet\n");
-				continue;
+				goto next;
 			}
 			skb_trim(skb2, len - ETH_FCS_LEN);
 
@@ -505,7 +505,7 @@ static int eem_unwrap(struct gether *port,
 						GFP_ATOMIC);
 			if (unlikely(!skb3)) {
 				dev_kfree_skb_any(skb2);
-				continue;
+				goto next;
 			}
 			dev_kfree_skb_any(skb2);
 			skb_queue_tail(list, skb3);
Signature · 1 line
2.32.0