Commit 87ebb62
net: clear sk->sk_ino in sk_set_socket(sk, NULL)
Andrei Vagin reported that blamed commit broke CRIU.
Indeed, while we want to keep sk_uid unchanged when a socket
is cloned, we want to clear sk->sk_ino.
Otherwise, sock_diag might report multiple sockets sharing
the same inode number.
Move the clearing part from sock_orphan() to sk_set_socket(sk, NULL),
called both from sock_orphan() and sk_clone_lock().
Fixes: 5d6b58c ("net: lockless sock_i_ino()")
Closes: https://lore.kernel.org/netdev/aMhX-VnXkYDpKd9V@google.com/
Closes: checkpoint-restore/criu#2744
Reported-by: Andrei Vagin <avagin@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Andrei Vagin <avagin@google.com>
Link: https://patch.msgid.link/20250917135337.1736101-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent 3fbfe25 commit 87ebb62
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2061 | 2061 | | |
2062 | 2062 | | |
2063 | 2063 | | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
2064 | 2067 | | |
2065 | 2068 | | |
2066 | 2069 | | |
| |||
2082 | 2085 | | |
2083 | 2086 | | |
2084 | 2087 | | |
2085 | | - | |
2086 | | - | |
2087 | 2088 | | |
2088 | 2089 | | |
2089 | 2090 | | |
| |||
0 commit comments