Linux filesystem development
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Norbert Szetei <norbert@doyensec.com>
Cc: Christian Brauner <brauner@kernel.org>,
	linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	akpm@linux-foundation.org, Bradley Morgan <brads@mainlining.org>
Subject: Re: [PATCH v2] nstree: check listing permission before taking a namespace reference
Date: Wed,  9 Sep 2026 10:02:13 +0200	[thread overview]
Message-ID: <20260909-arterien-zutreffen-extra-e2858bdb3209@brauner> (raw)
In-Reply-To: <ABA32239-733B-438C-B95A-B13ED69FF0F3@doyensec.com>

On Mon, 07 Sep 2026 16:22:17 +0200, Norbert Szetei wrote:
> legitimize_ns() takes a reference on the candidate namespace before
> may_list_ns() has decided whether the caller may see it. The
> __free(ns_put) cleanup on the denied path can drop the last reference to a
> mount namespace while we still hold the rcu read lock, and put_mnt_ns()
> may sleep there. This is the same problem commit 2ec2aff3c8e2 ("ns: make
> sure reference are dropped outside of rcu lock") fixed for the put_user()
> path. Neither ns_requested() nor may_list_ns() needs a reference, both
> only look at the namespace type and at the caller's own namespaces, so do
> the checks first and take the reference last.
> 
> [...]

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] nstree: check listing permission before taking a namespace reference
      https://git.kernel.org/vfs/vfs/c/ecfee3a7c9ea

      reply	other threads:[~2026-09-09  8:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 14:22 [PATCH v2] nstree: check listing permission before taking a namespace reference Norbert Szetei
2026-09-09  8:02 ` Christian Brauner [this message]

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=20260909-arterien-zutreffen-extra-e2858bdb3209@brauner \
    --to=brauner@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=brads@mainlining.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=norbert@doyensec.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