Skip to content

Commit

Permalink
pefile: Fix the failure of calculation for digest
Browse files Browse the repository at this point in the history
Commit e68503b 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: e68503b (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]>
  • Loading branch information
Lans Zhang authored and James Morris committed Jul 18, 2016
1 parent a46e667 commit d128471
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crypto/asymmetric_keys/mscode_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit d128471

Please sign in to comment.