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 d9aa5ab..a02a86d 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;