mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
net: remove sock_i_uid()
Difference between sock_i_uid() and sk_uid() is that after sock_orphan(), sock_i_uid() returns GLOBAL_ROOT_UID while sk_uid() returns the last cached sk->sk_uid value. None of sock_i_uid() callers care about this. Use sk_uid() which is much faster and inlined. Note that diag/dump users are calling sock_i_ino() and can not see the full benefit yet. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Lorenzo Colitti <lorenzo@google.com> Reviewed-by: Maciej Żenczykowski <maze@google.com> Link: https://patch.msgid.link/20250620133001.4090592-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
e84a4927a4
commit
c51da3f7a1
@@ -4783,7 +4783,7 @@ static int packet_seq_show(struct seq_file *seq, void *v)
|
||||
READ_ONCE(po->ifindex),
|
||||
packet_sock_flag(po, PACKET_SOCK_RUNNING),
|
||||
atomic_read(&s->sk_rmem_alloc),
|
||||
from_kuid_munged(seq_user_ns(seq), sock_i_uid(s)),
|
||||
from_kuid_munged(seq_user_ns(seq), sk_uid(s)),
|
||||
sock_i_ino(s));
|
||||
}
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ static int sk_diag_fill(struct sock *sk, struct sk_buff *skb,
|
||||
|
||||
if ((req->pdiag_show & PACKET_SHOW_INFO) &&
|
||||
nla_put_u32(skb, PACKET_DIAG_UID,
|
||||
from_kuid_munged(user_ns, sock_i_uid(sk))))
|
||||
from_kuid_munged(user_ns, sk_uid(sk))))
|
||||
goto out_nlmsg_trim;
|
||||
|
||||
if ((req->pdiag_show & PACKET_SHOW_MCLIST) &&
|
||||
|
||||
Reference in New Issue
Block a user