Skip to content

Commit c679d17

Browse files
mihalicynbrauner
authored andcommitted
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]>
1 parent 2775832 commit c679d17

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/core/scm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <linux/security.h>
2424
#include <linux/pid_namespace.h>
2525
#include <linux/pid.h>
26+
#include <uapi/linux/pidfd.h>
2627
#include <linux/pidfs.h>
2728
#include <linux/nsproxy.h>
2829
#include <linux/slab.h>
@@ -482,7 +483,7 @@ static void scm_pidfd_recv(struct msghdr *msg, struct scm_cookie *scm)
482483
if (!scm->pid)
483484
return;
484485

485-
pidfd = pidfd_prepare(scm->pid, 0, &pidfd_file);
486+
pidfd = pidfd_prepare(scm->pid, PIDFD_STALE, &pidfd_file);
486487

487488
if (put_cmsg(msg, SOL_SOCKET, SCM_PIDFD, sizeof(int), &pidfd)) {
488489
if (pidfd_file) {

0 commit comments

Comments
 (0)