Now that all preconditions are met, allow handing out pidfs for reaped sk->sk_peer_pids. Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx> --- net/core/sock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/core/sock.c b/net/core/sock.c index b969d2210656..017b02b69e8b 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -148,6 +148,8 @@ #include <linux/ethtool.h> +#include <uapi/linux/pidfd.h> + #include "dev.h" static DEFINE_MUTEX(proto_list_mutex); @@ -1891,7 +1893,7 @@ int sk_getsockopt(struct sock *sk, int level, int optname, if (!peer_pid) return -ENODATA; - pidfd = pidfd_prepare(peer_pid, 0, &pidfd_file); + pidfd = pidfd_prepare(peer_pid, PIDFD_STALE, &pidfd_file); put_pid(peer_pid); if (pidfd < 0) { /* -- 2.47.2