From: Ido Schimmel <idosch@nvidia.com>
To: Xia Yan <yanxia@cmss.chinamobile.com>
Cc: netdev@vger.kernel.org, David Ahern <dsahern@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>,
linux-kernel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
stable@vger.kernel.org, yana06070@163.com
Subject: Re: [PATCH net] ipv4/ipv6: preserve multicast filters after a failed source leave
Date: Mon, 2 Nov 2026 15:06:58 +0200 [thread overview]
Message-ID: <20261102130658.GA922454@shredder> (raw)
In-Reply-To: <20261030063603.697510-1-yanxia@cmss.chinamobile.com>
On Fri, Oct 30, 2026 at 02:36:03PM +0800, Xia Yan wrote:
> After joining a group with IP_ADD_MEMBERSHIP or IPV6_JOIN_GROUP,
> MCAST_LEAVE_SOURCE_GROUP for an unjoined source returns EADDRNOTAVAIL
> but switches the socket's filter mode, so the existing membership stops
> receiving. Leaving and rejoining the group restores reception.
> IP_DROP_SOURCE_MEMBERSHIP has the same problem.
>
> ip_mc_source() and ip6_mc_source() allow an empty-filter mode switch before
> checking whether a source list exists for deletion. The failed request
> changes EXCLUDE {} to INCLUDE {}, so the socket no longer accepts packets
> from any source.
>
> Check for a missing source list before changing the filter mode. Preserve
> EADDRNOTAVAIL for the rejected deletion and keep mode switches for valid
> source additions.
>
> Found while reviewing the error paths of ip_mc_source() and
> ip6_mc_source().
> The reproducer uses socket calls without kernel changes or fault injection.
>
> Tested with a UDP socket reproducer under UML using the IPv4 generic and
> legacy APIs and the IPv6 generic API. All three paths lose reception
> before this change and keep receiving with the fix. Source joins and
> leaves, block/unblock, last-source leave, and ordinary leave/rejoin also
> pass.
>
> W=1 x86_64 builds with derived allmodconfig and allyesconfig configurations
> also pass, with no changes to the warning sets.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org
> Signed-off-by: Xia Yan <yanxia@cmss.chinamobile.com>
Same comment as:
https://lore.kernel.org/netdev/20261030151629.GA85001@shredder/
Not a regression and not a security issue / crash. Please target
net-next and drop the Fixes and stable tags.
prev parent reply other threads:[~2026-11-02 13:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 6:36 [PATCH net] ipv4/ipv6: preserve multicast filters after a failed source leave Xia Yan
2026-11-01 10:48 ` Xia Yan
2026-11-02 13:06 ` Ido Schimmel [this message]
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=20261102130658.GA922454@shredder \
--to=idosch@nvidia.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=yana06070@163.com \
--cc=yanxia@cmss.chinamobile.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox