]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selinux: shrink critical section in sel_write_load()
authorStephen Smalley <stephen.smalley.work@gmail.com>
Thu, 30 Apr 2026 18:36:52 +0000 (14:36 -0400)
committerPaul Moore <paul@paul-moore.com>
Tue, 5 May 2026 20:02:28 +0000 (16:02 -0400)
commit868f31e4061eca8c3cd607d79d954d5e54f204aa
tree937261f5c68340e174aabfdafa0b79aad69b3841
parenta02cd6805562305f936e807da83e253b719dd965
selinux: shrink critical section in sel_write_load()

Currently sel_write_load() takes the policy mutex earlier than
necessary. Move the taking of the mutex later. This avoids
holding it unnecessarily across the vmalloc() and copy_from_user()
of the policy data.

Cc: stable@vger.kernel.org
Signed-off-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/selinuxfs.c