summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-03-25 16:46:43 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-03-25 16:46:43 -0700
commitdb24726bfefa68c606947a86132591568a06bfb4 (patch)
treebe98605d770f4e026c35f11cb2760ca28bbe984e /security
parent701c09c988bd60d950d49c48993b6c06efbfba7f (diff)
parent92063f3ca73aab794bd5408d3361fd5b5ea33079 (diff)
downloadlinux-db24726bfefa68c606947a86132591568a06bfb4.tar.bz2
Merge tag 'integrity-v5.12-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
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://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: integrity: double check iint_cache was initialized
Diffstat (limited to 'security')
-rw-r--r--security/integrity/iint.c8
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;