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] [day] [month] [year] [list]
Date:   Sat, 14 Jan 2023 10:53:33 +0800
From:   shaozhengchao <shaozhengchao@...wei.com>
To:     Eric Dumazet <eric.dumazet@...il.com>, <netdev@...r.kernel.org>,
        <linux-wireless@...r.kernel.org>, <johannes@...solutions.net>,
        <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
        <pabeni@...hat.com>
CC:     <weiyongjun1@...wei.com>, <yuehaibing@...wei.com>
Subject: Re: [PATCH] wifi: mac80211: fix memory leak in ieee80211_if_add()



On 2023/1/13 16:15, Eric Dumazet wrote:
> 
> On 11/17/22 07:45, Zhengchao Shao wrote:
>> When register_netdevice() failed in ieee80211_if_add(), ndev->tstats
>> isn't released. Fix it.
>>
>> Fixes: 5a490510ba5f ("mac80211: use per-CPU TX/RX statistics")
>> Signed-off-by: Zhengchao Shao <shaozhengchao@...wei.com>
>> ---
>>   net/mac80211/iface.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
>> index dd9ac1f7d2ea..46f08ec5ed76 100644
>> --- a/net/mac80211/iface.c
>> +++ b/net/mac80211/iface.c
>> @@ -2258,6 +2258,7 @@ int ieee80211_if_add(struct ieee80211_local 
>> *local, const char *name,
>>           ret = cfg80211_register_netdevice(ndev);
>>           if (ret) {
>> +            ieee80211_if_free(ndev);
>>               free_netdev(ndev);
>>               return ret;
>>           }
> 
> 
> Note: I will send a revert of this buggy patch, this was adding a double 
> free.
> 
> 
Hi Eric:
	Thank you very much for pointing out my problem. I'll be more
rigorous in the future.

Zhengchao Shao
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ