linux/net/unix
Kuniyuki Iwashima d82ba05263 af_unix: Set gc_in_progress to true in unix_gc().
Igor Ushakov reported that unix_gc() could run with gc_in_progress
being false if the work is scheduled while running:

  Thread 1         Thread 2                     Thread 3
  --------         --------                     --------
                   unix_schedule_gc()           unix_schedule_gc()
                   `- if (!gc_in_progress)      `- if (!gc_in_progress)
                      |- gc_in_progress = true     |
                      `- queue_work()              |
  unix_gc() <----------------/                     |
  |                                                |- gc_in_progress = true
  ...                                              `- queue_work()
  |                                                       |
  `- gc_in_progress = false                               |
                                                          |
  unix_gc() <---------------------------------------------'
  |
  ... /* gc_in_progress == false */
  |
  `- gc_in_progress = false

unix_peek_fpl() relies on gc_in_progress not to confuse GC
by MSG_PEEK.

Let's set gc_in_progress to true in unix_gc().

Fixes: 8b90a9f819 ("af_unix: Run GC on only one CPU.")
Reported-by: Igor Ushakov <sysroot314@gmail.com>
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260501073945.1884564-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-05-04 18:34:45 -07:00
..
af_unix.c Including fixes from Netfilter. 2026-04-23 16:50:42 -07:00
af_unix.h af_unix: Give up GC if MSG_PEEK intervened. 2026-03-12 13:37:18 -07:00
diag.c vfs-7.1-rc1.kino 2026-04-13 12:19:01 -07:00
garbage.c af_unix: Set gc_in_progress to true in unix_gc(). 2026-05-04 18:34:45 -07:00
Kconfig af_unix: Add a prompt to CONFIG_AF_UNIX_OOB 2024-12-19 19:16:15 -08:00
Makefile af_unix: Remove CONFIG_UNIX_SCM. 2024-01-31 16:41:16 -08:00
sysctl_net_unix.c af_unix: Clean up #include under net/unix/. 2025-03-25 04:30:07 -07:00
unix_bpf.c bpf, sockmap: Fix af_unix null-ptr-deref in proto update 2026-04-15 17:22:58 -07:00