[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220120214948.3637895-1-smayhew@redhat.com>
Date: Thu, 20 Jan 2022 16:49:46 -0500
From: Scott Mayhew <smayhew@...hat.com>
To: selinux@...r.kernel.org, linux-nfs@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH RFC v2 0/2] selinux: parse sids earlier to avoid doing memory allocations under spinlock
selinux_sb_mnt_opts_compat() is called under the sb_lock spinlock and
shouldn't be performing any memory allocations.
The first patch fixes this by parsing the sids at the same time the
context mount options are being parsed from the mount options string
and storing the parsed sids in the selinux_mnt_opts struct.
The second patch adds logic to selinux_set_mnt_opts() and
selinux_sb_remount() that checks to see if a sid has already been
parsed before calling parse_sid(), and adds the parsed sids to the
data being copied in selinux_fs_context_dup().
Scott Mayhew (2):
selinux: Fix selinux_sb_mnt_opts_compat()
selinux: try to use preparsed sid before calling parse_sid()
security/selinux/hooks.c | 181 ++++++++++++++++++++++++++++-----------
1 file changed, 129 insertions(+), 52 deletions(-)
--
2.31.1
Powered by blists - more mailing lists