public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brendan Jackman <jackmanb@google.com>
To: Christian Brauner <brauner@kernel.org>, <linux-fsdevel@vger.kernel.org>
Cc: Eric Biggers <ebiggers@kernel.org>,
	Jeff Layton <jlayton@kernel.org>,
	 Josef Bacik <josef@toxicpanda.com>, Jan Kara <jack@suse.cz>,
	 Amir Goldstein <amir73il@gmail.com>
Subject: Re: [PATCH] pidfs: protect PIDFD_GET_* ioctls() via ifdef
Date: Tue, 06 Jan 2026 15:18:07 +0000	[thread overview]
Message-ID: <DFHLULRAP6CP.YQSIO9W6NHTC@google.com> (raw)
In-Reply-To: <20251224-ununterbrochen-gagen-ea949b83f8f2@brauner>

On Wed Dec 24, 2025 at 12:00 PM UTC, Christian Brauner wrote:
> We originally protected PIDFD_GET_<ns-type>_NAMESPACE ioctls() through
> ifdefs and recent rework made it possible to drop them. There was an
> oversight though. When the relevant namespace is turned off ns->ops will
> be NULL so even though opening a file descriptor is perfectly legitimate
> it would fail during inode eviction when the file was closed.
>
> The simple fix would be to check ns->ops for NULL and continue allow to
> retrieve namespace fds from pidfds but we don't allow retrieving them
> when the relevant namespace type is turned off. So keep the
> simplification but add the ifdefs back in.
>
> Reported-by: Eric Biggers <ebiggers@kernel.org>
> Link: https://lore.kernel.org/20251222214907.GA189632@quark
> Fixes: a71e4f103aed ("pidfs: simplify PIDFD_GET_<type>_NAMESPACE ioctls")
> Signed-off-by: Christian Brauner <brauner@kernel.org>

Thanks Christian, I was also getting a NULL deref from running
the x86:ldt_gdt_32 kselftest on QEMU under a minimal kconfig (via
task_active_pid_ns()), this fixes it.

Tested-by: Brendan Jackman <jackmanb@kernel.org>

  parent reply	other threads:[~2026-01-06 15:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17 12:36 [PATCH] pidfs: simplify PIDFD_GET_<type>_NAMESPACE ioctls Christian Brauner
2025-12-22 21:49 ` Eric Biggers
2025-12-24 12:00   ` [PATCH] pidfs: protect PIDFD_GET_* ioctls() via ifdef Christian Brauner
2025-12-28 21:01     ` Eric Biggers
2026-01-06 15:18     ` Brendan Jackman [this message]
2026-02-23 15:50 ` [PATCH] pidfs: simplify PIDFD_GET_<type>_NAMESPACE ioctls David Lechner
2026-02-24 11:08   ` Christian Brauner

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=DFHLULRAP6CP.YQSIO9W6NHTC@google.com \
    --to=jackmanb@google.com \
    --cc=amir73il@gmail.com \
    --cc=brauner@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=jack@suse.cz \
    --cc=jlayton@kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-fsdevel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox