From: Roberto Sassu Date: Tue, 16 May 2017 12:53:47 +0000 (+0200) Subject: ima: fix get_binary_runtime_size() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e4586c79d4ba24a02f63a17e49207007c3bbdaea;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ima: fix get_binary_runtime_size() Remove '+ 1' from 'size += strlen(entry->template_desc->name) + 1;', as the template name is sent to userspace without the '\0' character. Signed-off-by: Roberto Sassu Signed-off-by: Mimi Zohar --- diff --git a/security/integrity/ima/ima_queue.c b/security/integrity/ima/ima_queue.c index d9aa5ab71204..a02a86d51102 100644 --- a/security/integrity/ima/ima_queue.c +++ b/security/integrity/ima/ima_queue.c @@ -81,7 +81,7 @@ static int get_binary_runtime_size(struct ima_template_entry *entry) size += sizeof(u32); /* pcr */ size += sizeof(entry->digest); size += sizeof(int); /* template name size field */ - size += strlen(entry->template_desc->name) + 1; + size += strlen(entry->template_desc->name); size += sizeof(entry->template_data_len); size += entry->template_data_len; return size;