Skip to content

Commit

Permalink
Revert "integrity: double check iint_cache was initialized"
Browse files Browse the repository at this point in the history
With the recent introduction of LSM_ORDER_LAST, the 'integrity' LSM is
always initialized (if selected in the kernel configuration) and the
iint_cache is always created (the kernel panics on error). Thus, the
additional check of iint_cache in integrity_inode_get() is no longer
necessary. If the 'integrity' LSM is not selected in the kernel
configuration, integrity_inode_get() just returns NULL.

This reverts commit 92063f3.

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>
  • Loading branch information
robertosassu authored and pcmoore committed Mar 10, 2023
1 parent 42994ee commit b7c1ae4
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions security/integrity/iint.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ 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;
Expand Down

0 comments on commit b7c1ae4

Please sign in to comment.