skb_clone related query

pavi1729 pavitra1729 at gmail.com
Tue Jan 5 01:11:34 EST 2016


Jeff,
   I have submitte a fix for the same on linux-usb and netdev mailing
list. Just waiting for review.
Please review the same.

http://www.spinics.net/lists/netdev/msg358605.html


Cheers,
Pavi

On Mon, Jan 4, 2016 at 11:36 PM, Jeff Haran <Jeff.Haran at citrix.com> wrote:
>> -----Original Message-----
>> From: kernelnewbies-bounces at kernelnewbies.org [mailto:kernelnewbies-
>> bounces at kernelnewbies.org] On Behalf Of pavi1729
>> Sent: Monday, December 28, 2015 6:16 AM
>> To: kernelnewbies at kernelnewbies.org
>> Subject: skb_clone related query
>>
>> Hi,
>>   Just out of curisity, I was looking at Kernel 3.14, skb_clone function in
>> f_ncm.c
>>
>> http://lxr.free-
>> electrons.com/source/drivers/usb/gadget/f_ncm.c?v=3.14#L1063
>>
>>
>> QUERY : Shouldn't a kfree_skb(skb2); happen before goto err @1070 ?
>>               Is this not a memleak ?
>>
>>
>> 1068           if (!skb_pull(skb2, index)) {
>> 1069                         ret = -EOVERFLOW;
>> 1070                         goto err;
>> 1071           }
>>
>>
>> Thanks,
>> Pavi
>
> Looks like an skb leak to me. Though the fix would need to consider the case where skb2 was set equal to skb at line 1061 instead of being cloned.
>
> Jeff Haran
>



More information about the Kernelnewbies mailing list