Skip to content

ipv6: fix address publication races with addrconf_ifdown

Daehyeon Ko lkml netdev 4 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 5 repliesApplied 4/4
  2. v33 patches 5 repliesSuperseded
  3. v22 patches 7 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v11 patch1 replySuperseded

Changes in v4 from the cover letter

- Reorder the first two patches so the hash cleanup precedes publication serialization; retain all existing patch subjects.
- Describe the freed hash entry as a use-after-free and document the mutual backport dependency in patches 1 and 2.
- Keep patch 2 scoped to idev->dead; drop the preliminary READ_ONCE() conversions and the unrelated disable_ipv6 recheck.
- State which finding was triggered and which follow-ons came from source review, including the observed device-teardown symptom.
- Initialize ifpub, cstamp and tstamp together in patch 3.
- Add patch 4 for the stable-privacy DAD recovery race.

Patches in v4 All 4 applied

#Subject and filesSizeRepliesApplied
1/4ipv6: remove ifaddr from hash during ifdown list cleanupnet/ipv6/addrconf.c+4 -01 replyApplied
2/4ipv6: serialize address publication with device teardownnet/ipv6/addrconf.c+9 -31 replyApplied
3/4ipv6: initialize temporary ifaddr before publicationinclude/net/addrconf.h net/ipv6/addrconf.c+16 -72 repliesApplied
4/4ipv6: do not restart DAD for a dead ifaddrnet/ipv6/addrconf.c+7 -31 replyApplied

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchIdo Schimmel
1/4R-b
2/4R-b
3/4R-b
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH net v4 0/4] ipv6: fix address publication races with addrconf_ifdown

The first patch removes each non-kept ifaddr from the address hash during the per-device list cleanup. This prevents addrconf_ifdown() from freeing a captured object that a late publisher left linked in the hash.

The second patch serializes hash and device-list publication with dead device teardown. The cleanup patch is now first, so the newly atomic publisher cannot create a captured-but-still-hashed intermediate state.

The third patch initializes a temporary address's public-ifaddr reference and both timestamps before publication. No lifetime update can observe a partially initialized relationship.

The fourth patch prevents stable-privacy DAD recovery from changing a DEAD replacement address back to PREDAD and queueing work after teardown has cleared its route.

The original deterministic test used a direct internal caller, kprobes and atomic rendezvous at existing instruction boundaries. A real RA separately reached ipv6_add_addr() with can_block=false. No new kernel build or runtime test was run for v4. Validation used source review, strict checkpatch and multi-tree apply tests.

Changes in v4:
- Reorder the first two patches so the hash cleanup precedes publication serialization; retain all existing patch subjects.
- Describe the freed hash entry as a use-after-free and document the mutual backport dependency in patches 1 and 2.
- Keep patch 2 scoped to idev->dead; drop the preliminary READ_ONCE() conversions and the unrelated disable_ipv6 recheck.
- State which finding was triggered and which follow-ons came from source review, including the observed device-teardown symptom.
- Initialize ifpub, cstamp and tstamp together in patch 3.
- Add patch 4 for the stable-privacy DAD recovery race.

Daehyeon Ko (4):
ipv6: remove ifaddr from hash during ifdown list cleanup
ipv6: serialize address publication with device teardown
ipv6: initialize temporary ifaddr before publication
ipv6: do not restart DAD for a dead ifaddr

 include/net/addrconf.h |  3 +++
 net/ipv6/addrconf.c    | 46 +++++++++++++++++++++++++++++++++-------------
 2 files changed, 36 insertions(+), 13 deletions(-)

base-commit: 513444cc62e231a11c9b15ea88de0890da9b2b4f

Signature · 1 line
2.55.0