]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: log anon inode class name
authorChristian Göttsche <cgzones@googlemail.com>
Tue, 8 Mar 2022 17:09:26 +0000 (18:09 +0100)
committerPaul Moore <paul@paul-moore.com>
Tue, 3 May 2022 20:09:03 +0000 (16:09 -0400)
commite911dd9a3c4fec28945d25d855ff6f0bc5beb38e
tree35e4e508fbec1d159d5c299650fe47a31d310a74
parentf1d869f3e38df1e3e8820411e35947a5b7d27c56
selinux: log anon inode class name

Log the anonymous inode class name in the security hook
inode_init_security_anon.  This name is the key for name based type
transitions on the anon_inode security class on creation.  Example:

    type=AVC msg=audit(02/16/22 22:02:50.585:216) : avc:  granted \
        { create } for  pid=2136 comm=mariadbd anonclass=[io_uring] \
        scontext=system_u:system_r:mysqld_t:s0 \
        tcontext=system_u:system_r:mysqld_iouring_t:s0 tclass=anon_inode

Add a new LSM audit data type holding the inode and the class name.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
[PM: adjusted 'anonclass' to be a trusted string, cgzones approved]
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/lsm_audit.h
security/lsm_audit.c
security/selinux/hooks.c