summaryrefslogtreecommitdiff
path: root/scripts/basic
diff options
context:
space:
mode:
authorMax Kellermann <max.kellermann@ionos.com>2024-12-13 13:50:05 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-23 17:22:55 +0100
commit04c3c7acb5ecf5b7023ea42e5f2f2379ea89f187 (patch)
treeb4415858123bbb85c09a1e11b5a36580612ce448 /scripts/basic
parent3d460376254edfd6327ee26d124a0d169d25486c (diff)
downloadlinux-04c3c7acb5ecf5b7023ea42e5f2f2379ea89f187.tar.gz
linux-04c3c7acb5ecf5b7023ea42e5f2f2379ea89f187.tar.bz2
linux-04c3c7acb5ecf5b7023ea42e5f2f2379ea89f187.zip
cachefiles: Parse the "secctx" immediately
[ Upstream commit e5a8b6446c0d370716f193771ccacf3260a57534 ] Instead of storing an opaque string, call security_secctx_to_secid() right in the "secctx" command handler and store only the numeric "secid". This eliminates an unnecessary string allocation and allows the daemon to receive errors when writing the "secctx" command instead of postponing the error to the "bind" command handler. For example, if the kernel was built without `CONFIG_SECURITY`, "bind" will return `EOPNOTSUPP`, but the daemon doesn't know why. With this patch, the "secctx" will instead return `EOPNOTSUPP` which is the right context for this error. This patch adds a boolean flag `have_secid` because I'm not sure if we can safely assume that zero is the special secid value for "not set". This appears to be true for SELinux, Smack and AppArmor, but since this attribute is not documented, I'm unable to derive a stable guarantee for that. Signed-off-by: Max Kellermann <max.kellermann@ionos.com> Signed-off-by: David Howells <dhowells@redhat.com> Link: https://lore.kernel.org/r/20241209141554.638708-1-max.kellermann@ionos.com/ Link: https://lore.kernel.org/r/20241213135013.2964079-6-dhowells@redhat.com Signed-off-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions