android_kernel_oneplus_msm8998/security/integrity
Sascha Hauer b1b8f7b23a ima: always return negative code for error
[ Upstream commit f5e1040196dbfe14c77ce3dfe3b7b08d2d961e88 ]

integrity_kernel_read() returns the number of bytes read. If this is
a short read then this positive value is returned from
ima_calc_file_hash_atfm(). Currently this is only indirectly called from
ima_calc_file_hash() and this function only tests for the return value
being zero or nonzero and also doesn't forward the return value.
Nevertheless there's no point in returning a positive value as an error,
so translate a short read into -EINVAL.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-10-17 13:40:54 -07:00
..
evm EVM: Use crypto_memneq() for digest comparisons 2016-02-17 12:31:04 -08:00
ima ima: always return negative code for error 2019-10-17 13:40:54 -07:00
digsig.c integrity: prevent loading untrusted certificates on the IMA trusted keyring 2015-10-09 15:31:18 -04:00
digsig_asymmetric.c integrity: do zero padding of the key id 2014-10-06 17:33:27 +01:00
iint.c integrity: add validity checks for 'path' parameter 2015-05-21 13:59:28 -04:00
integrity.h integrity: add validity checks for 'path' parameter 2015-05-21 13:59:28 -04:00
integrity_audit.c Merge git://git.infradead.org/users/eparis/audit 2014-04-12 12:38:53 -07:00
Kconfig kconfig: use bool instead of boolean for type definition attributes 2015-01-07 13:08:04 +01:00
Makefile integrity: make integrity files as 'integrity' module 2014-09-09 10:28:58 -04:00