All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christian Brauner <brauner@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [GIT PULL] vfs pidfs
Date: Fri, 15 Nov 2024 15:04:33 +0100	[thread overview]
Message-ID: <20241115-vfs-pidfs-841631f030e8@brauner> (raw)

Hey Linus,

/* Summary */

This adds a new ioctl to retrieve information about a pidfd.

A common pattern when using pidfds is having to get information about
the process, which currently requires /proc being mounted, resolving the
fd to a pid, and then do manual string parsing of /proc/N/status and
friends. This needs to be reimplemented over and over in all userspace
projects (e.g.: it has been reimplemented in systemd, dbus, dbus-daemon,
polkit so far), and requires additional care in checking that the fd is
still valid after having parsed the data, to avoid races.

Having a programmatic API that can be used directly removes all these
requirements, including having /proc mounted.

As discussed at LPC24, add an ioctl with an extensible struct so that
more parameters can be added later if needed. Start with returning
pid/tgid/ppid and some creds unconditionally, and cgroupid optionally.

/* Testing */

gcc version 14.2.0 (Debian 14.2.0-6)
Debian clang version 16.0.6 (27+b1)

All patches are based on v6.12-rc3 and have been sitting in linux-next.
No build failures or warnings were observed.

/* Conflicts */

Merge conflicts with mainline
=============================

No known conflicts.

Merge conflicts with other trees
================================

No known conflicts.

The following changes since commit 8e929cb546ee42c9a61d24fae60605e9e3192354:

  Linux 6.12-rc3 (2024-10-13 14:33:32 -0700)

are available in the Git repository at:

  git@gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-6.13.pidfs

for you to fetch changes up to cdda1f26e74bac732eca537a69f19f6a37b641be:

  pidfd: add ioctl to retrieve pid info (2024-10-24 13:54:51 +0200)

Please consider pulling these changes from the signed vfs-6.13.pidfs tag.

Thanks!
Christian

----------------------------------------------------------------
vfs-6.13.pidfs

----------------------------------------------------------------
Luca Boccassi (1):
      pidfd: add ioctl to retrieve pid info

 fs/pidfs.c                                      | 86 ++++++++++++++++++++++++-
 include/uapi/linux/pidfd.h                      | 50 ++++++++++++++
 tools/testing/selftests/pidfd/pidfd_open_test.c | 82 ++++++++++++++++++++++-
 3 files changed, 214 insertions(+), 4 deletions(-)

             reply	other threads:[~2024-11-15 14:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-15 14:04 Christian Brauner [this message]
2024-11-18 19:49 ` [GIT PULL] vfs pidfs pr-tracker-bot
  -- strict thread matches above, loose matches on Subject: below --
2025-01-18 13:00 Christian Brauner
2025-01-20 18:59 ` pr-tracker-bot
2025-03-22 10:13 Christian Brauner
2025-03-24 21:01 ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241115-vfs-pidfs-841631f030e8@brauner \
    --to=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.