mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-06-30 21:02:33 +02:00
Define and verify the template data length upper bounds
The template data length is variable, based on the template format. Define some sort of upper bounds. Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
@ -2189,7 +2189,8 @@ static int ima_measurement(const char *file)
|
||||
log_err("Unable to read template length\n");
|
||||
goto out;
|
||||
}
|
||||
if (entry.template_len == 0) {
|
||||
if (entry.template_len == 0 ||
|
||||
entry.template_len > MAX_TEMPLATE_SIZE) {
|
||||
log_err("Invalid template data len\n");
|
||||
goto out;
|
||||
}
|
||||
|
Reference in New Issue
Block a user