Messages in this thread Patch in this message | | | From | Roberto Sassu <> | Subject | [PATCH 4/6] ima: check result of crypto_shash_update() in ima_calc_field_array_hash_tfm | Date | Fri, 15 Nov 2013 14:45:42 +0100 |
| |
This patch adds a check of the result from the first crypto_shash_update() 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 | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/security/integrity/ima/ima_crypto.c b/security/integrity/ima/ima_crypto.c index 676e029..e22708b 100644 --- a/security/integrity/ima/ima_crypto.c +++ b/security/integrity/ima/ima_crypto.c @@ -163,6 +163,9 @@ static int ima_calc_field_array_hash_tfm(struct ima_field_data *field_data, rc = crypto_shash_update(&desc.shash, (const u8 *) &field_data[i].len, sizeof(field_data[i].len)); + if (rc) + break; + rc = crypto_shash_update(&desc.shash, field_data[i].data, field_data[i].len); if (rc) -- 1.8.1.4 [unhandled content-type:application/x-pkcs7-signature] | |