[PATCH 0/1] LSM: Mount option data management

From: Casey Schaufler

Date: Tue Nov 24 2026 - 13:15:46 EST


Mount option processing does not allow for multiple LSMs to process
options. It requires that the LSMs manage the data associated with their
options and assumes that one LSM will do all the work. A second LSM using
mount options clobbers the data of the first, resulting in mount failures.

In order for multiple LSMs to provide mount options the LSM management of
the data needs to change. A mount option blob replaces the LSM specific
data that is allocated. This still needs to be allocated within the
individual LSMs due to mount options being strictly optional. Duplication
and freeing, on the other hand, can be managed in the infrastructure.

SELinux provides a special challenge in that it defers mount option
handling in cases where the policy is not loaded. This requires that
additonal logic be added to detect if an allocated blob was created by
SELinux or by another LSM.

This is a substantial change from previous approaches to the problem,
which failed backward compatibility. Hence, it is not a verson 2.

https://github.com/cschaufler/lsm-stacking#mount-262221

Casey Schaufler (1):
LSM: infrastructure management of mount options

include/linux/lsm_hook_defs.h | 2 -
include/linux/lsm_hooks.h | 3 ++
security/lsm_init.c | 2 +
security/security.c | 29 ++++++++++-
security/selinux/hooks.c | 85 +++++++++++++++++-------------
security/selinux/include/objsec.h | 8 +++
security/smack/smack.h | 8 +++
security/smack/smack_lsm.c | 86 +++++++++++--------------------
8 files changed, 129 insertions(+), 94 deletions(-)

--
2.56.0