mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/7] allow reaped pidfds receive in SCM_PIDFD
@ 2025-07-03 22:23 Alexander Mikhalitsyn
  2025-07-03 22:23 ` [PATCH net-next v3 1/7] af_unix: rework unix_maybe_add_creds() to allow sleep Alexander Mikhalitsyn
                   ` (7 more replies)
  0 siblings, 8 replies; 16+ messages in thread
From: Alexander Mikhalitsyn @ 2025-07-03 22:23 UTC (permalink / raw)
  To: kuniyu
  Cc: Alexander Mikhalitsyn, linux-kernel, netdev, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
	Leon Romanovsky, Arnd Bergmann, Christian Brauner,
	Lennart Poettering, Luca Boccassi, David Rheinsberg,
	Simon Horman

This is a logical continuation of a story from [1], where Christian
extented SO_PEERPIDFD to allow getting pidfds for a reaped tasks.

Git tree (based on vfs/vfs-6.17.pidfs):
v3: https://github.com/mihalicyn/linux/commits/scm_pidfd_stale.v3
current: https://github.com/mihalicyn/linux/commits/scm_pidfd_stale

Changelog for version 3:
 - rename __scm_replace_pid() to scm_replace_pid() [ as Kuniyuki suggested ]
 - ("af_unix/scm: fix whitespace errors") commit introduced [ as Kuniyuki suggested ]
 - don't stash pidfs dentry for netlink case [ as Kuniyuki suggested ]
 - splited whitespace changes [ as Kuniyuki suggested ]
 - removed unix_set_pid_to_skb() to simplify changes [ as Kuniyuki suggested ]

Changelog for version 2:
 - renamed __skb_set_pid() -> unix_set_pid_to_skb() [ as Kuniyuki suggested ]
 - get rid of extra helper (__scm_set_cred()) I've introduced before [ as Kuniyuki suggested ]
 - s/__inline__/inline/ for functions I touched [ as Kuniyuki suggested ]
 - get rid of chunk in unix_destruct_scm() with NULLifying UNIXCB(skb).pid [ as Kuniyuki suggested ]
 - added proper error handling in scm_send() for scm_set_cred() return value [ found by me during rework ]
 - don't do get_pid() in __scm_replace_pid() [ as Kuniyuki suggested ]
 - move __scm_replace_pid() from scm.h to scm.c [ as Kuniyuki suggested ]
 - fixed kdoc for unix_maybe_add_creds() [ thanks to Kuniyuki's review ]
 - added RWB tags from Christian and Kuniyuki

Links to previous versions:
v2: https://lore.kernel.org/netdev/20250701083922.97928-1-aleksandr.mikhalitsyn@canonical.com
tree: https://github.com/mihalicyn/linux/commits/scm_pidfd_stale.v2
v1: https://lore.kernel.org/netdev/20250629214449.14462-1-aleksandr.mikhalitsyn@canonical.com
tree: https://github.com/mihalicyn/linux/commits/scm_pidfd_stale.v1

/!\ Notice
Series based on https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/log/?h=vfs-6.17.pidfs
It does not use pidfs_get_pid()/pidfs_put_pid() API as these were removed in a scope of [2].
I've checked that net-next branch currently (still) has these obsolete functions, but it
will eventually include changes from [2], so it's not a big problem.

Link: https://lore.kernel.org/all/20250425-work-pidfs-net-v2-0-450a19461e75@kernel.org/ [1]
Link: https://lore.kernel.org/all/20250618-work-pidfs-persistent-v2-0-98f3456fd552@kernel.org/ [2]

Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Kuniyuki Iwashima <kuniyu@google.com>
Cc: Lennart Poettering <mzxreary@0pointer.de>
Cc: Luca Boccassi <bluca@debian.org>
Cc: David Rheinsberg <david@readahead.eu>

Alexander Mikhalitsyn (7):
  af_unix: rework unix_maybe_add_creds() to allow sleep
  af_unix: introduce unix_skb_to_scm helper
  af_unix: introduce and use scm_replace_pid() helper
  af_unix/scm: fix whitespace errors
  af_unix: stash pidfs dentry when needed
  af_unix: enable handing out pidfds for reaped tasks in SCM_PIDFD
  selftests: net: extend SCM_PIDFD test to cover stale pidfds

 include/net/scm.h                             |   4 +-
 net/core/scm.c                                |  32 ++-
 net/unix/af_unix.c                            |  57 +++--
 .../testing/selftests/net/af_unix/scm_pidfd.c | 217 ++++++++++++++----
 4 files changed, 247 insertions(+), 63 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH net-next v3 0/7] allow reaped pidfds receive in SCM_PIDFD
@ 2025-07-03 22:22 Alexander Mikhalitsyn
  0 siblings, 0 replies; 16+ messages in thread
From: Alexander Mikhalitsyn @ 2025-07-03 22:22 UTC (permalink / raw)
  To: kuniyu
  Cc: Alexander Mikhalitsyn, linux-kernel, netdev, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Willem de Bruijn,
	Leon Romanovsky, Arnd Bergmann, Christian Brauner,
	Lennart Poettering, Luca Boccassi, David Rheinsberg,
	Kuniyuki Iwashima, Simon Horman

This is a logical continuation of a story from [1], where Christian
extented SO_PEERPIDFD to allow getting pidfds for a reaped tasks.

Git tree (based on vfs/vfs-6.17.pidfs):
v3: https://github.com/mihalicyn/linux/commits/scm_pidfd_stale.v3
current: https://github.com/mihalicyn/linux/commits/scm_pidfd_stale

Changelog for version 3:
 - rename __scm_replace_pid() to scm_replace_pid() [ as Kuniyuki suggested ]
 - ("af_unix/scm: fix whitespace errors") commit introduced [ as Kuniyuki suggested ]
 - don't stash pidfs dentry for netlink case [ as Kuniyuki suggested ]
 - splited whitespace changes [ as Kuniyuki suggested ]
 - removed unix_set_pid_to_skb() to simplify changes [ as Kuniyuki suggested ]

Changelog for version 2:
 - renamed __skb_set_pid() -> unix_set_pid_to_skb() [ as Kuniyuki suggested ]
 - get rid of extra helper (__scm_set_cred()) I've introduced before [ as Kuniyuki suggested ]
 - s/__inline__/inline/ for functions I touched [ as Kuniyuki suggested ]
 - get rid of chunk in unix_destruct_scm() with NULLifying UNIXCB(skb).pid [ as Kuniyuki suggested ]
 - added proper error handling in scm_send() for scm_set_cred() return value [ found by me during rework ]
 - don't do get_pid() in __scm_replace_pid() [ as Kuniyuki suggested ]
 - move __scm_replace_pid() from scm.h to scm.c [ as Kuniyuki suggested ]
 - fixed kdoc for unix_maybe_add_creds() [ thanks to Kuniyuki's review ]
 - added RWB tags from Christian and Kuniyuki

Links to previous versions:
v2: https://lore.kernel.org/netdev/20250701083922.97928-1-aleksandr.mikhalitsyn@canonical.com
tree: https://github.com/mihalicyn/linux/commits/scm_pidfd_stale.v2
v1: https://lore.kernel.org/netdev/20250629214449.14462-1-aleksandr.mikhalitsyn@canonical.com
tree: https://github.com/mihalicyn/linux/commits/scm_pidfd_stale.v1

/!\ Notice
Series based on https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/log/?h=vfs-6.17.pidfs
It does not use pidfs_get_pid()/pidfs_put_pid() API as these were removed in a scope of [2].
I've checked that net-next branch currently (still) has these obsolete functions, but it
will eventually include changes from [2], so it's not a big problem.

Link: https://lore.kernel.org/all/20250425-work-pidfs-net-v2-0-450a19461e75@kernel.org/ [1]
Link: https://lore.kernel.org/all/20250618-work-pidfs-persistent-v2-0-98f3456fd552@kernel.org/ [2]

Cc: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Willem de Bruijn <willemb@google.com>
Cc: Leon Romanovsky <leon@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Kuniyuki Iwashima <kuniyu@google.com>
Cc: Lennart Poettering <mzxreary@0pointer.de>
Cc: Luca Boccassi <bluca@debian.org>
Cc: David Rheinsberg <david@readahead.eu>

Alexander Mikhalitsyn (7):
  af_unix: rework unix_maybe_add_creds() to allow sleep
  af_unix: introduce unix_skb_to_scm helper
  af_unix: introduce and use scm_replace_pid() helper
  af_unix/scm: fix whitespace errors
  af_unix: stash pidfs dentry when needed
  af_unix: enable handing out pidfds for reaped tasks in SCM_PIDFD
  selftests: net: extend SCM_PIDFD test to cover stale pidfds

 include/net/scm.h                             |   4 +-
 net/core/scm.c                                |  32 ++-
 net/unix/af_unix.c                            |  57 +++--
 .../testing/selftests/net/af_unix/scm_pidfd.c | 217 ++++++++++++++----
 4 files changed, 247 insertions(+), 63 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-07-04  7:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-03 22:23 [PATCH net-next v3 0/7] allow reaped pidfds receive in SCM_PIDFD Alexander Mikhalitsyn
2025-07-03 22:23 ` [PATCH net-next v3 1/7] af_unix: rework unix_maybe_add_creds() to allow sleep Alexander Mikhalitsyn
2025-07-04  6:32   ` Kuniyuki Iwashima
2025-07-03 22:23 ` [PATCH net-next v3 2/7] af_unix: introduce unix_skb_to_scm helper Alexander Mikhalitsyn
2025-07-03 22:23 ` [PATCH net-next v3 3/7] af_unix: introduce and use scm_replace_pid() helper Alexander Mikhalitsyn
2025-07-04  6:33   ` Kuniyuki Iwashima
2025-07-03 22:23 ` [PATCH net-next v3 4/7] af_unix/scm: fix whitespace errors Alexander Mikhalitsyn
2025-07-04  6:34   ` Kuniyuki Iwashima
2025-07-03 22:23 ` [PATCH net-next v3 5/7] af_unix: stash pidfs dentry when needed Alexander Mikhalitsyn
2025-07-04  6:36   ` Kuniyuki Iwashima
2025-07-03 22:23 ` [PATCH net-next v3 6/7] af_unix: enable handing out pidfds for reaped tasks in SCM_PIDFD Alexander Mikhalitsyn
2025-07-04  6:37   ` Kuniyuki Iwashima
2025-07-04  6:52     ` Aleksandr Mikhalitsyn
2025-07-03 22:23 ` [PATCH net-next v3 7/7] selftests: net: extend SCM_PIDFD test to cover stale pidfds Alexander Mikhalitsyn
2025-07-04  7:42 ` [PATCH net-next v3 0/7] allow reaped pidfds receive in SCM_PIDFD Christian Brauner
  -- strict thread matches above, loose matches on Subject: below --
2025-07-03 22:22 Alexander Mikhalitsyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®