🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: org.kernel.vger.selinux
1 messages
1 total messages Started by Takaya Saeki Fri, 09 May 2025 02:50
[RFC] selinux: Keep genfscon prefix match semantics in userspace for wildcard
#1
Author: Takaya Saeki
Date: Fri, 09 May 2025 02:50
28 lines
5679 bytes
Hello Stephen, Paul, and all libselinux maintainers.

I'd like to ask your opinions about an idea to keep the semantics of genfs in
the userspace, before sending a patch to expose the new genfs_seclabel_wildcard
kernel capability to libselinux users in polcaps.h as
POLICYDB_CAP_GENFS_SECLABEL_WILDCARD.

As a background, we introduced the genfs wildcard feature to the kernel selinux
in https://lore.kernel.org/selinux/20250318083139.1515253-1-takayas@chromium.org/
(Thank you for your help and reviews!)
That enabled libselinux to use wildcards in genfs rules. There we changed the
semantics of genfs with the capability enabled in the kernel space from prefix
match to exact match with wildcards for kernel implementation simplicity.

I'm wondering whether we can keep the user-facing semantics of (genfscon ...)
statements in CIL files in the following way.

When secilc compiles a (genfscon ...) statement to the kernel binary format, it
adds a following `*` to the compiled kernel genfscon statement if the input has
(policycap genfs_seclabel_wildcard). If the input doesn't have one, secilc does
not add any following `*`. That keeps the behavior of (genfscon ...) in CIL
from the user perspective with and without the new wildcard capability. This is
similar to what our first kernel patch did, but done in the userspace by secilc
this time. So, the (genfscon ...) keeps the backward compatibility of prefix
match for libselinux users, while keeping the kernel implementation simple.
That would allow users to keep existing rules without modification.

I'd like to hear your opinions.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads