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-next>] [day] [month] [year] [list]
Message-ID: <c5b7896a7eb34d499979430156ea7e08@huawei.com>
Date:   Mon, 17 Aug 2020 02:27:23 +0000
From:   linmiaohe <linmiaohe@...wei.com>
To:     David Miller <davem@...emloft.net>
CC:     "kuba@...nel.org" <kuba@...nel.org>,
        "martin.varghese@...ia.com" <martin.varghese@...ia.com>,
        "fw@...len.de" <fw@...len.de>, "pshelar@....org" <pshelar@....org>,
        "dcaratti@...hat.com" <dcaratti@...hat.com>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "steffen.klassert@...unet.com" <steffen.klassert@...unet.com>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "shmulik@...anetworks.com" <shmulik@...anetworks.com>,
        "kyk.segfault@...il.com" <kyk.segfault@...il.com>,
        "sowmini.varadhan@...cle.com" <sowmini.varadhan@...cle.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: handle the return value of pskb_carve_frag_list()
 correctly

David Miller <davem@...emloft.net> wrote:
>> +	/* split line is in frag list */
>> +	if (k == 0 && pskb_carve_frag_list(skb, shinfo, off - pos, gfp_mask)) {
>> +		/* skb_frag_unref() is not needed here as shinfo->nr_frags = 0. */
>> +		if (skb_has_frag_list(skb))
>> +			kfree_skb_list(skb_shinfo(skb)->frag_list);
>> +		kfree(data);
>> +		return -ENOMEM;
>
>On error, the caller is going to kfree_skb(skb) which will take care of the frag list.
>

I'am sorry for my careless. The caller will take care of the frag list and kfree(data) is enough here.
Many thanks for review, will send v2 soon.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ