IMA: Add support for file reads without contents
authorScott Branden <scott.branden@broadcom.com>
Fri, 2 Oct 2020 17:38:24 +0000 (10:38 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Oct 2020 11:37:04 +0000 (13:37 +0200)
commit34736daeecd1608bee21e3bf5170cd4c95143109
tree4a9ef1ccc777e0f278eab20ffd39e53ff7a1fb19
parent2039bda1fa8dad3f4275b29eeaffef545bcbc85d
IMA: Add support for file reads without contents

When the kernel_read_file LSM hook is called with contents=false, IMA
can appraise the file directly, without requiring a filled buffer. When
such a buffer is available, though, IMA can continue to use it instead
of forcing a double read here.

Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Link: https://lore.kernel.org/lkml/20200706232309.12010-10-scott.branden@broadcom.com/
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Link: https://lore.kernel.org/r/20201002173828.2099543-13-keescook@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/integrity/ima/ima_main.c