]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: parse contexts for mount options early
authorOndrej Mosnacek <omosnace@redhat.com>
Wed, 2 Feb 2022 12:55:29 +0000 (13:55 +0100)
committerPaul Moore <paul@paul-moore.com>
Fri, 4 Feb 2022 18:40:15 +0000 (13:40 -0500)
commit41795389c8fc3214e50daec55dc635cb1950830a
tree4d059d7be87344b94d82c704ee15d99a26762eec
parent267ba63676c8c00263c2a8850b9aeb7c983ffec9
selinux: parse contexts for mount options early

Commit 316dc62e52bf ("selinux: Fix selinux_sb_mnt_opts_compat()")
started to parse mount options into SIDs in selinux_add_opt() if policy
has already been loaded. Since it's extremely unlikely that anyone would
depend on the ability to set SELinux contexts on fs_context before
loading the policy and then mounting that context after simplify the
logic by always parsing the options early.

Note that the multi-step mounting is only possible with the new
fscontext mount API and wasn't possible before its introduction.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c