Linux kernel source tree
Go to file
NeilBrown 833d2b3a07
Add start_renaming_two_dentries()
A few callers want to lock for a rename and already have both dentries.
Also debugfs does want to perform a lookup but doesn't want permission
checking, so start_renaming_dentry() cannot be used.

This patch introduces start_renaming_two_dentries() which is given both
dentries.  debugfs performs one lookup itself.  As it will only continue
with a negative dentry and as those cannot be renamed or unlinked, it is
safe to do the lookup before getting the rename locks.

overlayfs uses start_renaming_two_dentries() in three places and  selinux
uses it twice in sel_make_policy_nodes().

In sel_make_policy_nodes() we now lock for rename twice instead of just
once so the combined operation is no longer atomic w.r.t the parent
directory locks.  As selinux_state.policy_mutex is held across the whole
operation this does not open up any interesting races.

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/20251113002050.676694-13-neilb@ownmail.net
Signed-off-by: Christian Brauner <brauner@kernel.org>
2025-11-14 13:15:58 +01:00
Documentation
LICENSES
arch Kbuild fixes for 6.18 #1 2025-10-11 15:47:12 -07:00
block
certs
crypto
drivers i2c-for-6.18-rc1-hotfix 2025-10-12 13:27:56 -07:00
fs Add start_renaming_two_dentries() 2025-11-14 13:15:58 +01:00
include Add start_renaming_two_dentries() 2025-11-14 13:15:58 +01:00
init
io_uring
ipc VFS: introduce start_creating_noperm() and start_removing_noperm() 2025-11-14 13:15:56 +01:00
kernel tracing fixes for v6.18: 2025-10-11 16:06:04 -07:00
lib
mm
net
rust
samples
scripts Kbuild fixes for 6.18 #1 2025-10-11 15:47:12 -07:00
security Add start_renaming_two_dentries() 2025-11-14 13:15:58 +01:00
sound
tools
usr
virt
.clang-format
.clippy.toml
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.pylintrc
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 6.18-rc1 2025-10-12 13:42:36 -07:00
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the reStructuredText markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.