diff options
author | Roberto Sassu <roberto.sassu@huawei.com> | 2023-03-10 09:53:59 +0100 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2023-03-10 18:31:35 -0500 |
commit | 42994ee3cd7298b27698daa6848ed7168e72d056 (patch) | |
tree | d3c8295c2b7f4d59ff0bc25cbfd0f606f5e3dc53 /include/linux/lsm_hooks.h | |
parent | f89f8e1661e6bef87073ad4934e1eede5f69f4b7 (diff) | |
download | linux-stable-42994ee3cd7298b27698daa6848ed7168e72d056.tar.gz linux-stable-42994ee3cd7298b27698daa6848ed7168e72d056.tar.bz2 linux-stable-42994ee3cd7298b27698daa6848ed7168e72d056.zip |
security: Introduce LSM_ORDER_LAST and set it for the integrity LSM
Introduce LSM_ORDER_LAST, to satisfy the requirement of LSMs needing to be
last, e.g. the 'integrity' LSM, without changing the kernel command line or
configuration.
Also, set this order for the 'integrity' LSM. While not enforced, this is
the only LSM expected to use it.
Similarly to LSM_ORDER_FIRST, LSMs with LSM_ORDER_LAST are always enabled
and put at the end of the LSM list, if selected in the kernel
configuration. Setting one of these orders alone, does not cause the LSMs
to be selected and compiled built-in in the kernel.
Finally, for LSM_ORDER_MUTABLE LSMs, set the found variable to true if an
LSM is found, regardless of its order. In this way, the kernel would not
wrongly report that the LSM is not built-in in the kernel if its order is
LSM_ORDER_LAST.
Fixes: 79f7865d844c ("LSM: Introduce "lsm=" for boottime LSM selection")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Acked-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'include/linux/lsm_hooks.h')
-rw-r--r-- | include/linux/lsm_hooks.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index ddbbe89a7a48..c2be66c669ae 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -92,6 +92,7 @@ extern void security_add_hooks(struct security_hook_list *hooks, int count, enum lsm_order { LSM_ORDER_FIRST = -1, /* This is only for capabilities. */ LSM_ORDER_MUTABLE = 0, + LSM_ORDER_LAST = 1, /* This is only for integrity. */ }; struct lsm_info { |