ima: reduce memory usage when a template containing the n field is used
authorRoberto Sassu <roberto.sassu@polito.it>
Mon, 3 Feb 2014 12:56:05 +0000 (13:56 +0100)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Fri, 7 Mar 2014 16:32:30 +0000 (11:32 -0500)
Before this change, to correctly calculate the template digest for the
'ima' template, the event name field (id: 'n') length was set to the fixed
size of 256 bytes.

This patch reduces the length of the event name field to the string
length incremented of one (to make room for the termination character '\0')
and handles the specific case of the digest calculation for the 'ima'
template directly in ima_calc_field_array_hash_tfm().

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
security/integrity/ima/ima_crypto.c
security/integrity/ima/ima_template_lib.c

Simple merge