]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: use dst_dev_rcu() in sk_setup_caps()
authorEric Dumazet <edumazet@google.com>
Fri, 2 Jan 2026 20:37:26 +0000 (12:37 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:15:01 +0000 (10:15 +0100)
commit5d1be493d1110c9e720b4c51a6e587bb2fb4ac12
treedce06fd7e024769f3ec1082bae08ad76e8ac4cd2
parent8e8d6bf68633d2a2cbd01814584d29beb38fef68
net: use dst_dev_rcu() in sk_setup_caps()

[ Upstream commit 99a2ace61b211b0be861b07fbaa062fca4b58879 ]

Use RCU to protect accesses to dst->dev from sk_setup_caps()
and sk_dst_gso_max_size().

Also use dst_dev_rcu() in ip6_dst_mtu_maybe_forward(),
and ip_dst_mtu_maybe_forward().

ip4_dst_hoplimit() can use dst_dev_net_rcu().

Fixes: 4a6ce2b6f2ec ("net: introduce a new function dst_dev_put()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20250828195823.3958522-6-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[Harshit: Backport to 6.12.y, resolve conflict due to missing commit:
22d6c9eebf2e ("net: Unexport shared functions for DCCP.")  in 6.12.y]
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/ip.h
include/net/ip6_route.h
include/net/route.h
net/core/sock.c