Skip to content

Commit 40c5e22

Browse files
author
Guillaume Nault
committed
vrf: use RCU protection in l3mdev_l3_out()
JIRA: https://issues.redhat.com/browse/RHEL-81542 Upstream Status: linux.git CVE: CVE-2025-21791 commit 6d0ce46 Author: Eric Dumazet <edumazet@google.com> Date: Fri Feb 7 13:58:38 2025 +0000 vrf: use RCU protection in l3mdev_l3_out() l3mdev_l3_out() can be called without RCU being held: raw_sendmsg() ip_push_pending_frames() ip_send_skb() ip_local_out() __ip_local_out() l3mdev_ip_out() Add rcu_read_lock() / rcu_read_unlock() pair to avoid a potential UAF. Fixes: a8e3e1a ("net: l3mdev: Add hook to output path") Signed-off-by: Eric Dumazet <edumazet@google.com> Reviewed-by: David Ahern <dsahern@kernel.org> Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com> Link: https://patch.msgid.link/20250207135841.1948589-7-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Guillaume Nault <gnault@redhat.com>
1 parent 15b5887 commit 40c5e22

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/net/l3mdev.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,12 @@ struct sk_buff *l3mdev_l3_out(struct sock *sk, struct sk_buff *skb, u16 proto)
209209
if (netif_is_l3_slave(dev)) {
210210
struct net_device *master;
211211

212+
rcu_read_lock();
212213
master = netdev_master_upper_dev_get_rcu(dev);
213214
if (master && master->l3mdev_ops->l3mdev_l3_out)
214215
skb = master->l3mdev_ops->l3mdev_l3_out(master, sk,
215216
skb, proto);
217+
rcu_read_unlock();
216218
}
217219

218220
return skb;

0 commit comments

Comments
 (0)