path: root/security
diff options
authorLinus Torvalds <>2021-03-25 16:46:43 -0700
committerLinus Torvalds <>2021-03-25 16:46:43 -0700
commitdb24726bfefa68c606947a86132591568a06bfb4 (patch)
treebe98605d770f4e026c35f11cb2760ca28bbe984e /security
parent701c09c988bd60d950d49c48993b6c06efbfba7f (diff)
parent92063f3ca73aab794bd5408d3361fd5b5ea33079 (diff)
Merge tag 'integrity-v5.12-fix' of git://
Pull integrity fix from Mimi Zohar: "Just one patch to address a NULL ptr dereferencing when there is a mismatch between the user enabled LSMs and IMA/EVM" * tag 'integrity-v5.12-fix' of git:// integrity: double check iint_cache was initialized
Diffstat (limited to 'security')
1 files changed, 8 insertions, 0 deletions
diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 1d20003243c3..0ba01847e836 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -98,6 +98,14 @@ struct integrity_iint_cache *integrity_inode_get(struct inode *inode)
struct rb_node *node, *parent = NULL;
struct integrity_iint_cache *iint, *test_iint;
+ /*
+ * The integrity's "iint_cache" is initialized at security_init(),
+ * unless it is not included in the ordered list of LSMs enabled
+ * on the boot command line.
+ */
+ if (!iint_cache)
+ panic("%s: lsm=integrity required.\n", __func__);
iint = integrity_iint_find(inode);
if (iint)
return iint;