Skip to content

Commit 59ff24e

Browse files
committed
ipv6: use RCU protection in ip6_default_advmss()
jira LE-3467 cve CVE-2025-21765 Rebuild_History Non-Buildable kernel-4.18.0-553.58.1.el8_10 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 c92854d commit 59ff24e

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
@@ -2763,13 +2763,18 @@ static unsigned int ip6_default_advmss(const struct dst_entry *dst)
27632763
{
27642764
struct net_device *dev = dst->dev;
27652765
unsigned int mtu = dst_mtu(dst);
2766-
struct net *net = dev_net(dev);
2766+
struct net *net;
27672767

27682768
mtu -= sizeof(struct ipv6hdr) + sizeof(struct tcphdr);
27692769

2770+
rcu_read_lock();
2771+
2772+
net = dev_net_rcu(dev);
27702773
if (mtu < net->ipv6.sysctl.ip6_rt_min_advmss)
27712774
mtu = net->ipv6.sysctl.ip6_rt_min_advmss;
27722775

2776+
rcu_read_unlock();
2777+
27732778
/*
27742779
* Maximal non-jumbo IPv6 payload is IPV6_MAXPLEN and
27752780
* corresponding MSS is IPV6_MAXPLEN - tcp_header_size.

0 commit comments

Comments
 (0)