]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: Fix selinux_sb_mnt_opts_compat()
authorScott Mayhew <smayhew@redhat.com>
Mon, 31 Jan 2022 18:57:36 +0000 (13:57 -0500)
committerPaul Moore <paul@paul-moore.com>
Tue, 1 Feb 2022 21:21:22 +0000 (16:21 -0500)
commite245610944fbed0f31726102107f21e8b6b7c57d
treea55011e8a046610992f9bb941b5b13caa764dfef
parent7da1af54c12231a0760a78746c5d441f1ea43dc3
selinux: Fix selinux_sb_mnt_opts_compat()

selinux_sb_mnt_opts_compat() is called under the sb_lock spinlock and
shouldn't be performing any memory allocations.  Fix this by parsing the
sids at the same time we're chopping up the security mount options
string and then using the pre-parsed sids when doing the comparison.

Fixes: b74495364134 ("selinux: fix sleeping function called from invalid context")
Fixes: 97417fc8bc8f ("lsm,selinux: add new hook to compare new mount to an existing mount")
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c