Re: [PATCH net] ipv6: fix cached route reuse for SO_MARK control messages
From: Xia Yan
Date: Wed Nov 04 2026 - 04:23:05 EST
Hi,
Thanks for the review. I reproduced the race with a test-only pause
after sk_dst_check() takes a reference to the cached route. Changing
the socket mark to the cmsg mark while the sender is paused still lets
v1 send through the old route.
I've prepared v2 to record whether an SO_MARK cmsg was supplied and use
a fresh route lookup for those UDP and ping sends. With v2, the send
skips the cache helper and returns EACCES. The cache check added in v1
is gone, so the comment there no longer needs the proposed mark update.
The series also adds connected-socket cases to cmsg_so_mark.sh. The
same test fails two IPv6 cases on baseline and passes all 54 with the
fix; the separate UDP/ping route checks pass 50/50.
DSCP and flowlabel remain separate follow-ups, as discussed with Willem:
https://lore.kernel.org/netdev/20261031033159.2712-1-yanxia@xxxxxxxxxxxxxxxxxxxx/
The other port and source-address cases still need checking.
I'll send v2 as a new thread.
Best regards,
Xia Yan
pw-bot: cr