mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Daehyeon Ko <4ncienth@gmail.com>
Cc: 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>,
	Hannes Frederic Sowa <hannes@stressinduktion.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v4 1/4] ipv6: remove ifaddr from hash during ifdown list cleanup
Date: Thu, 15 Oct 2026 17:31:53 +0300	[thread overview]
Message-ID: <20261015143153.GA1794897@shredder> (raw)
In-Reply-To: <20261015050651.1841557-2-4ncienth@gmail.com>

On Thu, Oct 15, 2026 at 02:06:48PM +0900, Daehyeon Ko wrote:
> addrconf_ifdown() clears the address hash before snapshotting the
> per-device address list. A concurrent ipv6_add_addr() can publish an
> address after the hash scan and before the list snapshot.
> 
> The ifdown path then removes the address from the device list and drops
> the list-owned reference while it is still linked in the hash. Once the
> remaining references are released, inet6_ifa_finish_destroy() warns, but
> a DEAD address continues to kfree_rcu(). The hash therefore points to
> freed memory that later RCU walkers can dereference.
> 
> This follow-on was found by source review and was not separately
> triggered at runtime.
> 
> Remove each non-kept address from the hash immediately before removing
> it from the per-device list. Keeping it hashed through the delete
> notification blocks same-address publication until NETDEV_DOWN has been
> delivered. hlist_del_init_rcu() is safe when the earlier hash scan
> already removed the address.
> 
> This handles a late publisher captured by the list snapshot. The next
> change serializes publication with teardown so an add cannot miss both
> observations. Both changes are required when backporting the complete fix.
> 
> Fixes: 73a8bd74e261 ("ipv6: Revert 'administrative down' address handling changes.")
> Cc: stable@vger.kernel.org
> Reported-by: Ido Schimmel <idosch@nvidia.com>
> Link: https://lore.kernel.org/r/20261004135117.GA206930@shredder
> Link: https://lore.kernel.org/r/179161099539.434549.2238120015372268173@kernel.org
> Suggested-by: Ido Schimmel <idosch@nvidia.com>
> Assisted-by: LLM
> Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>

  reply	other threads:[~2026-10-15 14:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  5:06 [PATCH net v4 0/4] ipv6: fix address publication races with addrconf_ifdown Daehyeon Ko
2026-10-15  5:06 ` [PATCH net v4 1/4] ipv6: remove ifaddr from hash during ifdown list cleanup Daehyeon Ko
2026-10-15 14:31   ` Ido Schimmel [this message]
2026-10-15  5:06 ` [PATCH net v4 2/4] ipv6: serialize address publication with device teardown Daehyeon Ko
2026-10-15 14:32   ` Ido Schimmel
2026-10-15  5:06 ` [PATCH net v4 3/4] ipv6: initialize temporary ifaddr before publication Daehyeon Ko
2026-10-15 14:32   ` Ido Schimmel
2026-10-15  5:06 ` [PATCH net v4 4/4] ipv6: do not restart DAD for a dead ifaddr Daehyeon Ko
2026-10-15 14:32   ` Ido Schimmel

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=20261015143153.GA1794897@shredder \
    --to=idosch@nvidia.com \
    --cc=4ncienth@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=hannes@stressinduktion.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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

all inboxes | Powered by JetHome®