diff options
author | Lans Zhang <jia.zhang@windriver.com> | 2016-07-18 00:10:47 +0100 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2016-07-18 12:19:46 +1000 |
commit | ea10f5e0c062b9511ff3ec99cc9fe9e804595f3a (patch) | |
tree | 810b7c0a5168e37868dcb236a3a7fca5094dd161 | |
parent | 8b807e57bceac32519c7976fe7fbe0e289292f1a (diff) | |
download | linux-crypto-ea10f5e0c062b9511ff3ec99cc9fe9e804595f3a.tar.gz linux-crypto-ea10f5e0c062b9511ff3ec99cc9fe9e804595f3a.zip |
pefile: Fix the failure of calculation for digest
Commit b8cc7ddcdc 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: b8cc7ddcdc (KEYS: Generalise system_verify_data() to provide access to internal content)
Signed-off-by: Lans Zhang <jia.zhang@windriver.com>
Tested-by: Dave Young <dyoung@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
cc: kexec@lists.infradead.org
cc: linux-crypto@vger.kernel.org
Signed-off-by: James Morris <james.l.morris@oracle.com>
Diffstat (limited to '')
-rw-r--r-- | crypto/asymmetric_keys/mscode_parser.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/asymmetric_keys/mscode_parser.c b/crypto/asymmetric_keys/mscode_parser.c index 6a76d5c7..9492e1c2 100644 --- a/crypto/asymmetric_keys/mscode_parser.c +++ b/crypto/asymmetric_keys/mscode_parser.c @@ -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; } |