Thread (42 messages) 42 messages, 5 authors, 2018-09-18

[PATCH 07/18] LSM: Add minor LSM initialization loop

From: Kees Cook <hidden>
Date: 2018-09-16 01:49:14
Also in: lkml

On Sat, Sep 15, 2018 at 6:27 PM, Jann Horn [off-list ref] wrote:
On Sun, Sep 16, 2018 at 3:11 AM Kees Cook [off-list ref] wrote:
quoted
Split initialization loop into two phases: "exclusive" LSMs and "minor"
LSMs.

Signed-off-by: Kees Cook <redacted>
---
 include/linux/lsm_hooks.h | 6 ++++++
 security/security.c       | 8 +++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
index f8e618e2bdd2..ec3419b9b16f 100644
--- a/include/linux/lsm_hooks.h
+++ b/include/linux/lsm_hooks.h
@@ -2039,7 +2039,13 @@ extern char *lsm_names;
 extern void security_add_hooks(struct security_hook_list *hooks, int count,
                                char *lsm);

+enum lsm_type {
+       LSM_TYPE_EXCLUSIVE = 0,
+       LSM_TYPE_MINOR,
+};
Is the intent of this explicit zero assignment that LSM_TYPE_EXCLUSIVE
should be the default? If so, perhaps a comment "/* default */", or
something like that, might be helpful.
You cut the patch quote off where I do exactly that:
quoted
+       enum lsm_type type;     /* Optional: default is LSM_TYPE_EXCLUSIVE */
:)

-Kees

-- 
Kees Cook
Pixel Security
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help