pefile: Fix the failure of calculation for digest

Commit e68503bd68 forgot to set digest_len and thus cause the following
error reported by kexec when launching a crash kernel:

	kexec_file_load failed: Bad message

Fixes: e68503bd68 (KEYS: Generalise system_verify_data() to provide access to internal content)
Signed-off-by: Lans Zhang <[email protected]>
Tested-by: Dave Young <[email protected]>
Signed-off-by: David Howells <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: Vivek Goyal <[email protected]>
cc: [email protected]
cc: [email protected]
Signed-off-by: James Morris <[email protected]>
This commit is contained in:
Lans Zhang 2016-07-18 00:10:47 +01:00 • committed by James Morris
commit d128471a14

View file

@ -124,5 +124,10 @@ int mscode_note_digest(void *context, size_t hdrlen,
struct pefile_context *ctx = context;
ctx->digest = kmemdup(value, vlen, GFP_KERNEL);
return ctx->digest ? 0 : -ENOMEM;
if (!ctx->digest)
return -ENOMEM;
ctx->digest_len = vlen;
return 0;
}