The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Aleksa Sarai <cyphar@cyphar.com>
Cc: luca.boccassi@gmail.com, linux-fsdevel@vger.kernel.org,
	christian@brauner.io, linux-kernel@vger.kernel.org,
	oleg@redhat.com
Subject: Re: [PATCH v9] pidfd: add ioctl to retrieve pid info
Date: Wed, 09 Oct 2024 16:05:42 -0600	[thread overview]
Message-ID: <87y12x7wzt.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20241009.210353-murky.mole.elite.putt-JnYGYHfGrAtK@cyphar.com>

Aleksa Sarai <cyphar@cyphar.com> writes:

>> In fairness, this is how statx works and statx does this to not require
>> syscall retries to figure out what flags the current kernel supports and
>> instead defers that to stx_mask.
>> 
>> However, I think verifying the value is slightly less fragile -- as long
>> as we get a cheap way for userspace to check what flags are supported
>> (such as CHECK_FIELDS[1]). It would kind of suck if userspace would have
>> to do 50 syscalls to figure out what request_mask values are valid.
>
> Unfortunately, we probably need to find a different way to do
> CHECK_FIELDS for extensible-struct ioctls because CHECK_FIELDS uses the
> top bit in a u64 but we can't set a size that large with ioctl
> numbers...

Add a separate PIDFD_GET_VALID_REQUEST_MASK ioctl()?

But then I'm bad at designing interfaces...

jon

  reply	other threads:[~2024-10-09 22:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 12:18 [PATCH v9] pidfd: add ioctl to retrieve pid info luca.boccassi
2024-10-08 13:06 ` Christian Brauner
2024-10-08 13:10   ` Luca Boccassi
2024-10-09 20:52     ` Aleksa Sarai
2024-10-10  9:38       ` Christian Brauner
2024-10-08 13:23   ` Christian Brauner
2024-10-09 19:20 ` Jonathan Corbet
2024-10-09 20:56   ` Aleksa Sarai
2024-10-09 21:06     ` Aleksa Sarai
2024-10-09 22:05       ` Jonathan Corbet [this message]
2024-10-13  5:57         ` Aleksa Sarai
2024-10-10  9:36     ` Christian Brauner
2024-10-10 12:41       ` Jonathan Corbet
2024-10-10 13:16       ` David Laight
2024-10-10  9:26   ` Christian Brauner
2024-10-09 20:50 ` Aleksa Sarai
2024-10-10  9:46   ` Christian Brauner
2024-10-10 15:55     ` Luca Boccassi

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=87y12x7wzt.fsf@trenco.lwn.net \
    --to=corbet@lwn.net \
    --cc=christian@brauner.io \
    --cc=cyphar@cyphar.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.boccassi@gmail.com \
    --cc=oleg@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox