Skip to content

Commit

Permalink
ima: fix get_binary_runtime_size()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mimi Zohar <[email protected]>
  • Loading branch information
robertosassu authored and Mimi Zohar committed Jun 21, 2017
1 parent 28a8dc4 commit e4586c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/integrity/ima/ima_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e4586c7

Please sign in to comment.