]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selinux: Use simple_start_creating() / simple_done_creating()
authorNeilBrown <neil@brown.name>
Tue, 24 Feb 2026 22:16:51 +0000 (09:16 +1100)
committerChristian Brauner <brauner@kernel.org>
Fri, 6 Mar 2026 09:24:12 +0000 (10:24 +0100)
commitc4573e18e286c5741f52b12de2b1fe791b614f9a
tree6906abd5eea0717f0a15196f5ea84776a64e19ea
parent5c6c7ae93236ee46be8e9ac396af2de5d222986c
selinux: Use simple_start_creating() / simple_done_creating()

Instead of explicitly locking the parent and performing a lookup in
selinux, use simple_start_creating(), and then use
simple_done_creating() to unlock.

This extends the region that the directory is locked for, and also
performs a lookup.
The lock extension is of no real consequence.
The lookup uses simple_lookup() and so always succeeds.  Thus when
d_make_persistent() is called the dentry will already be hashed.
d_make_persistent() handles this case.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: NeilBrown <neil@brown.name>
Link: https://patch.msgid.link/20260224222542.3458677-7-neilb@ownmail.net
Signed-off-by: Christian Brauner <brauner@kernel.org>
security/selinux/selinuxfs.c