Re: [PATCH net-next v2 0/3] Add SCM_PIDFD and SO_PEERPIDFD

From: Christian Brauner
Date: Wed Mar 22 2023 - 10:13:36 EST


On Tue, Mar 21, 2023 at 07:33:39PM +0100, Alexander Mikhalitsyn wrote:
> 1. Implement SCM_PIDFD, a new type of CMSG type analogical to SCM_CREDENTIALS,
> but it contains pidfd instead of plain pid, which allows programmers not
> to care about PID reuse problem.
>
> 2. Add SO_PEERPIDFD which allows to get pidfd of peer socket holder pidfd.
> This thing is direct analog of SO_PEERCRED which allows to get plain PID.
>
> 3. Add SCM_PIDFD / SO_PEERPIDFD kselftest
>
> Idea comes from UAPI kernel group:
> https://uapi-group.org/kernel-features/
>
> Big thanks to Christian Brauner and Lennart Poettering for productive
> discussions about this.
>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
> Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
> Cc: Paolo Abeni <pabeni@xxxxxxxxxx>
> Cc: Leon Romanovsky <leon@xxxxxxxxxx>
> Cc: David Ahern <dsahern@xxxxxxxxxx>
> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> Cc: Kees Cook <keescook@xxxxxxxxxxxx>
> Cc: Christian Brauner <brauner@xxxxxxxxxx>
> Cc: Kuniyuki Iwashima <kuniyu@xxxxxxxxxx>
> Cc: Lennart Poettering <mzxreary@xxxxxxxxxxx>
>
> Alexander Mikhalitsyn (3):
> scm: add SO_PASSPIDFD and SCM_PIDFD
> net: core: add getsockopt SO_PEERPIDFD
> selftests: net: add SCM_PIDFD / SO_PEERPIDFD test
>
> arch/alpha/include/uapi/asm/socket.h | 3 +
> arch/mips/include/uapi/asm/socket.h | 3 +
> arch/parisc/include/uapi/asm/socket.h | 3 +
> arch/sparc/include/uapi/asm/socket.h | 3 +
> include/linux/net.h | 1 +
> include/linux/socket.h | 1 +
> include/net/scm.h | 14 +-
> include/uapi/asm-generic/socket.h | 3 +
> net/core/sock.c | 32 ++
> net/mptcp/sockopt.c | 1 +
> net/unix/af_unix.c | 18 +-
> tools/include/uapi/asm-generic/socket.h | 3 +
> tools/testing/selftests/net/.gitignore | 1 +
> tools/testing/selftests/net/af_unix/Makefile | 3 +-
> .../testing/selftests/net/af_unix/scm_pidfd.c | 336 ++++++++++++++++++
> 15 files changed, 417 insertions(+), 8 deletions(-)
> create mode 100644 tools/testing/selftests/net/af_unix/scm_pidfd.c

What's the commit for this work? Because this seems to fail to apply
cleanly on anything from v6.3-rc1 until v6.3-rc3.