This is a note to let you know that I've just added the patch titled net: usb: lan78xx: fix possible skb leak to the 4.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: net-usb-lan78xx-fix-possible-skb-leak.patch and it can be found in the queue-4.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Sat 11 Jan 2020 09:14:34 AM CET From: Eric Dumazet <edumazet@xxxxxxxxxx> Date: Tue, 7 Jan 2020 10:57:01 -0800 Subject: net: usb: lan78xx: fix possible skb leak From: Eric Dumazet <edumazet@xxxxxxxxxx> [ Upstream commit 47240ba0cd09bb6fe6db9889582048324999dfa4 ] If skb_linearize() fails, we need to free the skb. TSO makes skb bigger, and this bug might be the reason Raspberry Pi 3B+ users had to disable TSO. Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Signed-off-by: Eric Dumazet <edumazet@xxxxxxxxxx> Reported-by: RENARD Pierre-Francois <pfrenard@xxxxxxxxx> Cc: Stefan Wahren <stefan.wahren@xxxxxxxx> Cc: Woojung Huh <woojung.huh@xxxxxxxxxxxxx> Cc: Microchip Linux Driver Support <UNGLinuxDriver@xxxxxxxxxxxxx> Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/net/usb/lan78xx.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -2736,11 +2736,6 @@ static int lan78xx_stop(struct net_devic return 0; } -static int lan78xx_linearize(struct sk_buff *skb) -{ - return skb_linearize(skb); -} - static struct sk_buff *lan78xx_tx_prep(struct lan78xx_net *dev, struct sk_buff *skb, gfp_t flags) { @@ -2751,8 +2746,10 @@ static struct sk_buff *lan78xx_tx_prep(s return NULL; } - if (lan78xx_linearize(skb) < 0) + if (skb_linearize(skb)) { + dev_kfree_skb_any(skb); return NULL; + } tx_cmd_a = (u32)(skb->len & TX_CMD_A_LEN_MASK_) | TX_CMD_A_FCS_; Patches currently in stable-queue which might be from edumazet@xxxxxxxxxx are queue-4.19/vlan-vlan_changelink-should-propagate-errors.patch queue-4.19/net-usb-lan78xx-fix-possible-skb-leak.patch queue-4.19/bpf-clear-skb-tstamp-in-bpf_redirect-when-necessary.patch queue-4.19/pkt_sched-fq-do-not-accept-silly-tca_fq_quantum.patch queue-4.19/vlan-fix-memory-leak-in-vlan_dev_set_egress_priority.patch queue-4.19/gtp-fix-bad-unlock-balance-in-gtp_encap_enable_socket.patch queue-4.19/macvlan-do-not-assume-mac_header-is-set-in-macvlan_broadcast.patch queue-4.19/tcp-fix-old-stuff-d-sack-causing-sack-to-be-treated-as-d-sack.patch