diff options
| author | Alexander Mikhalitsyn <[email protected]> | 2025-07-03 22:23:10 +0000 |
|---|---|---|
| committer | Christian Brauner <[email protected]> | 2025-07-04 07:32:35 +0000 |
| commit | c679d17d3f2d895b34e660673141ad250889831f (patch) | |
| tree | cbedd6411c1691026dcb3e5077e9d1f19089959f /net/core/scm.c | |
| parent | af_unix: stash pidfs dentry when needed (diff) | |
| download | kernel-c679d17d3f2d895b34e660673141ad250889831f.tar.gz kernel-c679d17d3f2d895b34e660673141ad250889831f.zip | |
af_unix: enable handing out pidfds for reaped tasks in SCM_PIDFD
Now everything is ready to pass PIDFD_STALE to pidfd_prepare().
This will allow opening pidfd for reaped tasks.
Cc: [email protected]
Cc: [email protected]
Cc: David S. Miller <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Simon Horman <[email protected]>
Cc: Willem de Bruijn <[email protected]>
Cc: Leon Romanovsky <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: Kuniyuki Iwashima <[email protected]>
Cc: Lennart Poettering <[email protected]>
Cc: Luca Boccassi <[email protected]>
Cc: David Rheinsberg <[email protected]>
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
Link: https://lore.kernel.org/[email protected]
Reviewed-by: Christian Brauner <[email protected]>
Reviewed-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'net/core/scm.c')
| -rw-r--r-- | net/core/scm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/scm.c b/net/core/scm.c index 358a4e04d46c..072d5742440a 100644 --- a/net/core/scm.c +++ b/net/core/scm.c @@ -23,6 +23,7 @@ #include <linux/security.h> #include <linux/pid_namespace.h> #include <linux/pid.h> +#include <uapi/linux/pidfd.h> #include <linux/pidfs.h> #include <linux/nsproxy.h> #include <linux/slab.h> @@ -482,7 +483,7 @@ static void scm_pidfd_recv(struct msghdr *msg, struct scm_cookie *scm) if (!scm->pid) return; - pidfd = pidfd_prepare(scm->pid, 0, &pidfd_file); + pidfd = pidfd_prepare(scm->pid, PIDFD_STALE, &pidfd_file); if (put_cmsg(msg, SOL_SOCKET, SCM_PIDFD, sizeof(int), &pidfd)) { if (pidfd_file) { |
