mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-04-27 22:32:31 +02:00
Missing template data size lower bounds checking
Each record in the IMA measurement list must contain some template data. Ensure the template data is not zero length. Reviewed-by: Petr Vorel <pvorel@suse.cz> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
parent
232836a079
commit
f57ea92d6e
@ -2189,6 +2189,10 @@ static int ima_measurement(const char *file)
|
||||
log_err("Unable to read template length\n");
|
||||
goto out;
|
||||
}
|
||||
if (entry.template_len == 0) {
|
||||
log_err("Invalid template data len\n");
|
||||
goto out;
|
||||
}
|
||||
} else {
|
||||
entry.template_len = SHA_DIGEST_LENGTH +
|
||||
TCG_EVENT_NAME_LEN_MAX + 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user