All of lore.kernel.org
 help / color / mirror / Atom feed
From: RENARD Pierre-Francois <pfrenard@gmail.com>
To: Eric Dumazet <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	Stefan Wahren <stefan.wahren@i2se.com>,
	Woojung Huh <woojung.huh@microchip.com>,
	Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
Subject: Re: [PATCH net] net: usb: lan78xx: fix possible skb leak
Date: Wed, 8 Jan 2020 20:13:37 +0100	[thread overview]
Message-ID: <393ec56d-5d37-ac75-13af-25ade6aabac8@gmail.com> (raw)
In-Reply-To: <20200107185701.137063-1-edumazet@google.com>

I tried with last rawhide kernel 5.5.0-0.rc5.git0.1.local.fc32.aarch64
I compiled it this night. (I check it includes the patch for lan78xx.c )

Both tests (scp and nfs ) are failing the same way as before.

Fox



On 1/7/20 7:57 PM, Eric Dumazet wrote:
> 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@google.com>
> Reported-by: RENARD Pierre-Francois <pfrenard@gmail.com>
> Cc: Stefan Wahren <stefan.wahren@i2se.com>
> Cc: Woojung Huh <woojung.huh@microchip.com>
> Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>
> ---
>   drivers/net/usb/lan78xx.c | 9 +++------
>   1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
> index f940dc6485e56a7e8f905082ce920f5dd83232b0..fb4781080d6dec2af22f41c5e064350ea74130b3 100644
> --- a/drivers/net/usb/lan78xx.c
> +++ b/drivers/net/usb/lan78xx.c
> @@ -2724,11 +2724,6 @@ static int lan78xx_stop(struct net_device *net)
>   	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)
>   {
> @@ -2740,8 +2735,10 @@ static struct sk_buff *lan78xx_tx_prep(struct lan78xx_net *dev,
>   		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_;
>   



  parent reply	other threads:[~2020-01-08 19:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-07 18:57 [PATCH net] net: usb: lan78xx: fix possible skb leak Eric Dumazet
2020-01-07 22:10 ` David Miller
2020-01-08 19:13 ` RENARD Pierre-Francois [this message]
2020-01-08 20:25   ` Eric Dumazet
2020-01-08 23:19     ` RENARD Pierre-Francois
2020-01-10 19:07       ` Eric Dumazet
2020-01-11  8:20         ` RENARD Pierre-Francois

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=393ec56d-5d37-ac75-13af-25ade6aabac8@gmail.com \
    --to=pfrenard@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stefan.wahren@i2se.com \
    --cc=woojung.huh@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.