diff options
| author | Kuniyuki Iwashima <kuniyu@google.com> | 2025-11-15 02:08:35 +0000 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-11-18 19:19:31 -0800 |
| commit | 384900542dc85f3aac7918fea8e7ef62141e3ea6 (patch) | |
| tree | b1cd2cb95b8592913248116847f820c8565129e6 /net/unix/af_unix.h | |
| parent | da8fc7a39be897426e1ac05aa90263abf40621b7 (diff) | |
af_unix: Don't call wait_for_unix_gc() on every sendmsg().
We have been calling wait_for_unix_gc() on every sendmsg() in case
there are too many inflight AF_UNIX sockets.
This is also because the old GC implementation had poor knowledge
of the inflight sockets and had to suspect every sendmsg().
This was improved by commit d9f21b361333 ("af_unix: Try to run GC
async."), but we do not even need to call wait_for_unix_gc() if the
process is not sending AF_UNIX sockets.
The wait_for_unix_gc() call only helps when a malicious process
continues to create cyclic references, and we can detect that
in a better place and slow it down.
Let's move wait_for_unix_gc() to unix_prepare_fpl() that is called
only when AF_UNIX socket fd is passed via SCM_RIGHTS.
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20251115020935.2643121-5-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/unix/af_unix.h')
| -rw-r--r-- | net/unix/af_unix.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/net/unix/af_unix.h b/net/unix/af_unix.h index 0fb5b348ad94..2f1bfe3217c1 100644 --- a/net/unix/af_unix.h +++ b/net/unix/af_unix.h @@ -30,7 +30,6 @@ void unix_update_edges(struct unix_sock *receiver); int unix_prepare_fpl(struct scm_fp_list *fpl); void unix_destroy_fpl(struct scm_fp_list *fpl); void unix_schedule_gc(void); -void wait_for_unix_gc(struct scm_fp_list *fpl); /* SOCK_DIAG */ long unix_inq_len(struct sock *sk); |