Skip to content

Commit 9601d84

Browse files
committed
ipv6: use RCU protection in ip6_default_advmss()
jira LE-3187 cve CVE-2025-21765 Rebuild_History Non-Buildable kernel-5.14.0-570.19.1.el9_6 commit-author Eric Dumazet <edumazet@google.com> commit 3c8ffcd ip6_default_advmss() needs rcu protection to make sure the net structure it reads does not disappear. Fixes: 5578689 ("[NETNS][IPV6] route6 - make route6 per namespace") Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Link: https://patch.msgid.link/20250205155120.1676781-11-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> (cherry picked from commit 3c8ffcd) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent cb32423 commit 9601d84

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/ipv6/route.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3189,13 +3189,18 @@ static unsigned int ip6_default_advmss(const struct dst_entry *dst)
31893189
{
31903190
struct net_device *dev = dst->dev;
31913191
unsigned int mtu = dst_mtu(dst);
3192-
struct net *net = dev_net(dev);
3192+
struct net *net;
31933193

31943194
mtu -= sizeof(struct ipv6hdr) + sizeof(struct tcphdr);
31953195

3196+
rcu_read_lock();
3197+
3198+
net = dev_net_rcu(dev);
31963199
if (mtu < net->ipv6.sysctl.ip6_rt_min_advmss)
31973200
mtu = net->ipv6.sysctl.ip6_rt_min_advmss;
31983201

3202+
rcu_read_unlock();
3203+
31993204
/*
32003205
* Maximal non-jumbo IPv6 payload is IPV6_MAXPLEN and
32013206
* corresponding MSS is IPV6_MAXPLEN - tcp_header_size.

0 commit comments

Comments
 (0)