ima: fix get_binary_runtime_size()
authorRoberto Sassu <roberto.sassu@huawei.com>
Tue, 16 May 2017 12:53:47 +0000 (14:53 +0200)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Wed, 21 Jun 2017 18:37:12 +0000 (14:37 -0400)
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 <roberto.sassu@huawei.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
security/integrity/ima/ima_queue.c

index d9aa5ab712044a4d7e0a3a11ecfb86547198e3af..a02a86d5110285c39eeb4f77d5d36aedc576d7fb 100644 (file)
@@ -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;