All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
Cc: Chanho Min <chanho.min@lge.com>,
	"David S . Miller" <davem@davemloft.net>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	gunho.lee@lge.com, stable@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH] ipv6: mcast: extend RCU protection in igmp6_send()
Date: Thu, 21 Aug 2025 09:04:53 -0400	[thread overview]
Message-ID: <aKcZdaEtye817DgO@laps> (raw)
In-Reply-To: <062219ff-6abf-4289-84da-67a5c731564e@redhat.com>

On Thu, Aug 21, 2025 at 11:23:23AM +0200, Paolo Abeni wrote:
>On 8/18/25 11:24 AM, Chanho Min wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> [ Upstream commit 087c1faa594fa07a66933d750c0b2610aa1a2946 ]
>>
>> igmp6_send() can be called without RTNL or RCU being held.
>>
>> Extend RCU protection so that we can safely fetch the net pointer
>> and avoid a potential UAF.
>>
>> Note that we no longer can use sock_alloc_send_skb() because
>> ipv6.igmp_sk uses GFP_KERNEL allocations which can sleep.
>>
>> Instead use alloc_skb() and charge the net->ipv6.igmp_sk
>> socket under RCU protection.
>>
>> Cc: stable@vger.kernel.org # 5.4
>> Fixes: b8ad0cbc58f7 ("[NETNS][IPV6] mcast - handle several network namespace")
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>> Reviewed-by: David Ahern <dsahern@kernel.org>
>> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
>> Link: https://patch.msgid.link/20250207135841.1948589-9-edumazet@google.com
>> [ chanho: Backports to v5.4.y. v5.4.y does not include
>> commit b4a11b2033b7(net: fix IPSTATS_MIB_OUTPKGS increment in OutForwDatagrams),
>> so IPSTATS_MIB_OUTREQUESTS was changed to IPSTATS_MIB_OUTPKGS defined as
>> 'OutRequests'. ]
>> Signed-off-by: Chanho Min <chanho.min@lge.com>
>> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>
>FWIW, the SoB chain above looks incorrect, as I think that neither Jakub
>nor Sasha have touched yet this patch.

It's a backport of an older backport where there already exists a commit with
both Jakub's any my signoff:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=81b25a07ebf53f9ef4ca8f3d96a8ddb94561dd5a

But yes, the SoB chain is wrong because Chanho Min's SoB should come after
ours, not before.

-- 
Thanks,
Sasha

  reply	other threads:[~2025-08-21 13:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18  9:24 [PATCH] ipv6: mcast: extend RCU protection in igmp6_send() Chanho Min
2025-08-21  9:23 ` Paolo Abeni
2025-08-21 13:04   ` Sasha Levin [this message]
2025-08-24  6:03 ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aKcZdaEtye817DgO@laps \
    --to=sashal@kernel.org \
    --cc=chanho.min@lge.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gunho.lee@lge.com \
    --cc=kuba@kernel.org \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.