Re: [PATCH v20 22/23] LSM: Add /proc attr entry for full LSM context
From: Randy Dunlap <rdunlap@infradead.org>
Date: 2020-08-26 18:03:08
Also in:
linux-api, selinux
Hi, On 8/26/20 7:52 AM, Casey Schaufler wrote:
quoted hunk ↗ jump to hunk
diff --git a/Documentation/security/lsm.rst b/Documentation/security/lsm.rst index 6a2a2e973080..fd4c87358d54 100644 --- a/Documentation/security/lsm.rst +++ b/Documentation/security/lsm.rst@@ -129,3 +129,31 @@ to identify it as the first security module to be registered. The capabilities security module does not use the general security blobs, unlike other modules. The reasons are historical and are based on overhead, complexity and performance concerns. + +LSM External Interfaces +======================= + +The LSM infrastructure does not generally provide external interfaces. +The individual security modules provide what external interfaces they +require. + +The file ``/sys/kernel/security/lsm`` provides a comma +separated list of the active security modules. + +The file ``/proc/pid/attr/display`` contains the name of the security +module for which the ``/proc/pid/attr/current`` interface will +apply. This interface can be written to. + +The infrastructure does provide an interface for the special +case where multiple security modules provide a process context. +This is provided in compound context format. + +- `lsm\0value\0lsm\0value\0` + +The `lsm` and `value` fields are nul terminated bytestrings.
Preferably NUL-terminated
+Each field may contain whitespace or non-printable characters. +The nul bytes are included in the size of a compound context.
NUL
+The context ``Bell\0Secret\0Biba\0Loose\0`` has a size of 23. + +The file ``/proc/pid/attr/context`` provides the security +context of the identified process.
thanks. -- ~Randy Reported-by: Randy Dunlap <rdunlap@infradead.org>