lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACVXFVPJ0MUaCCDV2ZGdB1_JYXM0iNq=_e7ejjA77dL_TMSigQ@mail.gmail.com>
Date:	Sun, 4 Aug 2013 08:19:40 +0800
From:	Ming Lei <ming.lei@...onical.com>
To:	David Miller <davem@...emloft.net>
Cc:	oneukum@...e.de, gregkh@...uxfoundation.org,
	sarah.a.sharp@...ux.intel.com, netdev@...r.kernel.org,
	linux-usb@...r.kernel.org, eric.dumazet@...il.com,
	bhutchings@...arflare.com, grundler@...gle.com, freddy@...x.com.tw,
	stern@...land.harvard.edu
Subject: Re: [PATCH v1 3/4] USBNET: support DMA SG

On Sun, Aug 4, 2013 at 3:07 AM, David Miller <davem@...emloft.net> wrote:
> From: Oliver Neukum <oneukum@...e.de>
> Date: Sat, 03 Aug 2013 07:56:53 +0200
>
>> On Sat, 2013-08-03 at 10:46 +0800, Ming Lei wrote:
>>
>>> @@ -1268,10 +1298,14 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
>>>      entry = (struct skb_data *) skb->cb;
>>>      entry->urb = urb;
>>>      entry->dev = dev;
>>> -    entry->length = length;
>>>
>>>      usb_fill_bulk_urb (urb, dev->udev, dev->out,
>>>                      skb->data, skb->len, tx_complete, skb);
>>> +    if (dev->can_dma_sg) {
>>> +            if (build_dma_sg(skb, urb) < 0)
>>> +                    goto drop;
>>
>> Where do you free urb->sg?
>
> Indeed, this appears to leak.
>
> The devio.c code in the USB layer takes care to manage freeing of
> the urb->sg, so this usbnet code will have to as well.

Hamm, kfree(urb->sg) is removed carelessly in v1, sorry for that.

Will fix it in -v2.

Thanks,
--
Ming Lei
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ