LSM: Helpers for attribute names and filling lsm_ctx
authorCasey Schaufler <casey@schaufler-ca.com>
Tue, 12 Sep 2023 20:56:52 +0000 (13:56 -0700)
committerPaul Moore <paul@paul-moore.com>
Mon, 13 Nov 2023 03:54:42 +0000 (22:54 -0500)
commite1ca7129db2c3b3c4d261702905a752e6b2710b4
tree34bad43a2ebc45477a111b9e7cb27aa76b4e70d7
parent5f42375904b08890f2e8e7cd955c5bf0c2c0d05a
LSM: Helpers for attribute names and filling lsm_ctx

Add lsm_name_to_attr(), which translates a text string to a
LSM_ATTR value if one is available.

Add lsm_fill_user_ctx(), which fills a struct lsm_ctx, including
the trailing attribute value.

Both are used in module specific components of LSM system calls.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Reviewed-by: John Johansen <john.johansen@canonical.com>
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Reviewed-by: Mickaël Salaün <mic@digikod.net>
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/security.h
security/lsm_syscalls.c
security/security.c