]> www.infradead.org Git - users/jedix/linux-maple.git/commit
fs: don't try and remove empty rbtree node
authorChristian Brauner <brauner@kernel.org>
Wed, 16 Oct 2024 17:49:48 +0000 (19:49 +0200)
committerChristian Brauner <brauner@kernel.org>
Thu, 17 Oct 2024 13:33:43 +0000 (15:33 +0200)
commit229fd15908fe1f99b1de4cde3326e62d1e892611
tree85170e2e4f9a88758e1a23892f4f4e814d528e4d
parentd6a77668a708f0b5ca6713b39c178c9d9563c35b
fs: don't try and remove empty rbtree node

When copying a namespace we won't have added the new copy into the
namespace rbtree until after the copy succeeded. Calling free_mnt_ns()
will try to remove the copy from the rbtree which is invalid. Simply
free the namespace skeleton directly.

Link: https://lore.kernel.org/r/20241016-adapter-seilwinde-83c508a7bde1@brauner
Fixes: 1901c92497bd ("fs: keep an index of current mount namespaces")
Tested-by: Brad Spengler <spender@grsecurity.net>
Cc: stable@vger.kernel.org # v6.11+
Reported-by: Brad Spengler <spender@grsecurity.net>
Suggested-by: Brad Spengler <spender@grsecurity.net>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/namespace.c