• Sascha Hauer's avatar
    ima: always return negative code for error · f5e10401
    Sascha Hauer authored
    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: default avatarSascha Hauer <s.hauer@pengutronix.de>
    Signed-off-by: default avatarMimi Zohar <zohar@linux.ibm.com>
    f5e10401
ima_crypto.c 15.6 KB