[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <da1d3625-f2a1-bd38-21e0-1e64139f6893@huawei.com>
Date: Wed, 3 Jun 2020 10:20:22 +0800
From: Yuehaibing <yuehaibing@...wei.com>
To: Cong Wang <xiyou.wangcong@...il.com>
CC: David Miller <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
"Jiri Pirko" <jiri@...lanox.com>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: genetlink: Fix memleak in
genl_family_rcv_msg_dumpit()
On 2020/6/3 2:04, Cong Wang wrote:
> On Mon, Jun 1, 2020 at 11:47 PM YueHaibing <yuehaibing@...wei.com> wrote:
>> @@ -630,6 +625,9 @@ static int genl_family_rcv_msg_dumpit(const struct genl_family *family,
>> err = __netlink_dump_start(net->genl_sock, skb, nlh, &c);
>> }
>>
>> + genl_family_rcv_msg_attrs_free(info->family, info->attrs, true);
>> + genl_dumpit_info_free(info);
>> +
>> return err;
>> }
>
> I do not think you can just move it after __netlink_dump_start(),
> because cb->done() can be called, for example, in netlink_sock_destruct()
> too.
netlink_sock_destruct() call cb->done() while nlk->cb_running is true,
if nlk->cb_running is not set to true in __netlink_dump_start() before return,
the memleak still occurs.
>
>
Powered by blists - more mailing lists