Re: [PATCH v6 17/17] ima: Setup securityfs for IMA namespace

From
Stefan Berger <stefanb@linux.ibm.com>
Date
2021-12-16 02:42:02
Also in
linux-integrity, lkml
Reply to
Mimi Zohar, 2021-12-15
On 12/15/21 16:31, Mimi Zohar wrote:
Hi Stefan, James,

On Fri, 2021-12-10 at 14:47 -0500, Stefan Berger wrote:
quoted
Setup securityfs with symlinks, directories, and files for IMA
namespacing support. The same directory structure that IMA uses on the
host is also created for the namespacing case.

The securityfs file and directory ownerships cannot be set when the
IMA namespace is initialized. Therefore, delay the setup of the file
system to a later point when securityfs is in securityfs_fill_super.

This filesystem can now be mounted as follows:

mount -t securityfs /sys/kernel/security/ /sys/kernel/security/

The following directories, symlinks, and files are then available.

$ ls -l sys/kernel/security/
total 0
lr--r--r--. 1 root root 0 Dec  2 00:18 ima -> integrity/ima
drwxr-xr-x. 3 root root 0 Dec  2 00:18 integrity
The ima symlink was introduced for backwards compatibilty.  Refer to
commit 0c343af8065b ("integrity: Add an integrity directory in
securityfs").  The symlink shouldn't need to be supported in IMA
namespace.
That's backwards compatibility for applications and scripts. If we want to have these running unmodified inside IMA namespaces I think it's better to keep the symbolic link and not treat the IMA namespaces any different than the host.

   Stefan
thanks,

Mimi
quoted
$ ls -l sys/kernel/security/ima/
total 0
-r--r-----. 1 root root 0 Dec  2 00:18 ascii_runtime_measurements
-r--r-----. 1 root root 0 Dec  2 00:18 binary_runtime_measurements
-rw-------. 1 root root 0 Dec  2 00:18 policy
-r--r-----. 1 root root 0 Dec  2 00:18 runtime_measurements_count
-r--r-----. 1 root root 0 Dec  2 00:18 violations

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Thread (40 messages) 40 messages, 5 authors, last reply 2021-12-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help