diff options
| author | Kuniyuki Iwashima <kuniyu@google.com> | 2026-07-03 00:09:12 +0000 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-07-11 12:57:49 +0200 |
| commit | 5ecbbb179e0c737eb1360a877508766efb16f010 (patch) | |
| tree | 0fe12710a118eef486c742f5d4297392ff291fed /include/linux | |
| parent | 23dad2d088dfc82cae1f5a936f8ff7ffebb38dd9 (diff) | |
rtnetlink: Lock sock_net(skb->sk) in rtnl_newlink().
There are a few cases where rtnl_net_lock() is not properly
held in rtnl_newlink().
When either of IFLA_NET_NS_PID / IFLA_NET_NS_FD / IFLA_TARGET_NETNSID
is specified but IFLA_LINK_NETNSID is not, sock_net(skb->sk) is used
as link_net in rtnl_newlink_link_net().
In addition, the do_setlink() path uses sock_net(skb->sk) and one
from the three netns attributes while rtnl_link_get_net_capable()
returns only one of four.
Let's add sock_net(skb->sk) to rtnl_nets in rtnl_newlink().
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260703001009.1572444-2-kuniyu@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
