linux-yocto/net/mptcp
Eric Dumazet 0c5eba454e net: lockless sock_i_ino()
[ Upstream commit 5d6b58c932ec451a5c41482790eb5b1ecf165a94 ]

Followup of commit c51da3f7a1 ("net: remove sock_i_uid()")

A recent syzbot report was the trigger for this change.

Over the years, we had many problems caused by the
read_lock[_bh](&sk->sk_callback_lock) in sock_i_uid().

We could fix smc_diag_dump_proto() or make a more radical move:

Instead of waiting for new syzbot reports, cache the socket
inode number in sk->sk_ino, so that we no longer
need to acquire sk->sk_callback_lock in sock_i_ino().

This makes socket dumps faster (one less cache line miss,
and two atomic ops avoided).

Prior art:

commit 25a9c8a443 ("netlink: Add __sock_i_ino() for __netlink_diag_dump().")
commit 4f9bf2a2f5 ("tcp: Don't acquire inet_listen_hashbucket::lock with disabled BH.")
commit efc3dbc374 ("rds: Make rds_sock_lock BH rather than IRQ safe.")

Fixes: d2d6422f8b ("x86: Allow to enable PREEMPT_RT.")
Reported-by: syzbot+50603c05bbdf4dfdaffa@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/68b73804.050a0220.3db4df.01d8.GAE@google.com/T/#u
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/20250902183603.740428-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-09-09 19:02:26 +02:00
..
bpf.c bpf: Add update_socket_protocol hook 2023-08-16 10:22:16 -07:00
crypto_test.c mptcp: fill in missing MODULE_DESCRIPTION() 2023-12-17 20:54:22 +00:00
crypto.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ctrl.c mptcp: sysctl: add available_path_managers 2025-03-20 10:14:49 +01:00
diag.c tcp: ulp: diag: more info without CAP_NET_ADMIN 2025-03-07 19:39:53 -08:00
fastopen.c mptcp: cleanup mem accounting 2025-02-19 19:05:28 -08:00
Kconfig
Makefile mptcp: pm: split in-kernel PM specific code 2025-03-10 13:35:50 -07:00
mib.c mptcp: add MPJoinRejected MIB counter 2025-04-15 08:21:47 -07:00
mib.h mptcp: add MPJoinRejected MIB counter 2025-04-15 08:21:47 -07:00
mptcp_diag.c mptcp: drop duplicate header inclusions 2024-03-06 20:24:10 -08:00
mptcp_pm_gen.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-11-07 13:44:16 -08:00
mptcp_pm_gen.h mptcp: add token for get-addr in yaml 2024-03-04 13:07:45 +00:00
options.c mptcp: drop skb if MPTCP skb extension allocation fails 2025-08-28 16:34:32 +02:00
pm_kernel.c mptcp: pm: kernel: flush: do not reset ADD_ADDR limit 2025-08-28 16:34:32 +02:00
pm_netlink.c mptcp: pm: split netlink and in-kernel init 2025-03-20 10:14:48 +01:00
pm_userspace.c mptcp: pm: Defer freeing of MPTCP userspace path manager entries 2025-04-23 16:27:58 -07:00
pm.c mptcp: disable add_addr retransmission when timeout is 0 2025-08-28 16:34:32 +02:00
protocol.c net: lockless sock_i_ino() 2025-09-09 19:02:26 +02:00
protocol.h mptcp: plug races between subflow fail and subflow creation 2025-07-15 17:31:25 -07:00
sched.c mptcp: sched: split validation part 2025-04-15 08:21:46 -07:00
sockopt.c mptcp: sockopt: fix getting freebind & transparent 2025-03-21 19:05:26 +01:00
subflow.c mptcp: plug races between subflow fail and subflow creation 2025-07-15 17:31:25 -07:00
syncookies.c
token_test.c mptcp: token kunit: set protocol 2024-02-26 18:42:12 -08:00
token.c