[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a221a65-71ae-2bca-e33c-f62c6b625461@huawei.com>
Date: Tue, 21 Nov 2023 20:38:34 +0800
From: shaozhengchao <shaozhengchao@...wei.com>
To: Hangbin Liu <liuhangbin@...il.com>
CC: <netdev@...r.kernel.org>, <davem@...emloft.net>, <dsahern@...nel.org>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<weiyongjun1@...wei.com>, <yuehaibing@...wei.com>
Subject: Re: [PATCH net] ipv4: igmp: fix refcnt uaf issue when receiving igmp
query packet
On 2023/11/21 10:56, Hangbin Liu wrote:
> Hi Zhengchao,
> On Tue, Nov 21, 2023 at 10:05:58AM +0800, Zhengchao Shao wrote:
>> ---
>> net/ipv4/igmp.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
>> index 76c3ea75b8dd..f217581904d6 100644
>> --- a/net/ipv4/igmp.c
>> +++ b/net/ipv4/igmp.c
>> @@ -1044,6 +1044,8 @@ static bool igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb,
>> for_each_pmc_rcu(in_dev, im) {
>> int changed;
>>
>> + if (!netif_running(im->interface->dev))
>> + continue;
>
> I haven't checked this part for a long time. What's the difference of in_dev->dev
> and im->interface->dev? I though they are the same, no?
>
> If they are the same, should we stop processing the query earlier? e.g.
>
Hi Hangbin:
Yes, they are the same.
> diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
> index 76c3ea75b8dd..f4e1d229c9aa 100644
> --- a/net/ipv4/igmp.c
> +++ b/net/ipv4/igmp.c
> @@ -1082,6 +1082,9 @@ int igmp_rcv(struct sk_buff *skb)
> goto drop;
> }
>
> + if (!netif_running(dev))
> + goto drop;
> +
> in_dev = __in_dev_get_rcu(dev);
> if (!in_dev)
> goto drop;
>
>
> BTW, does IPv6 MLD has this issue?
I will take a look at IPv6 MLD later. maybe tonight.
Thank you.
Zhengchao Shao
>
> Thanks
> Hangbin
>
Powered by blists - more mailing lists