aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLans Zhang <jia.zhang@windriver.com>2016-07-17 19:10:47 -0400
committerJames Morris <james.l.morris@oracle.com>2016-07-17 22:19:46 -0400
commitd128471a14775cd11abd81c09b2a086997ab3150 (patch)
tree21be8fee8cab58c36dda207eb2950e1678ebdbe7
parenta46e667887448da10e26e46442bda01d1f311aaf (diff)
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 <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>
-rw-r--r--crypto/asymmetric_keys/mscode_parser.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/asymmetric_keys/mscode_parser.c b/crypto/asymmetric_keys/mscode_parser.c
index 6a76d5c70ef6..9492e1c22d38 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,
124 struct pefile_context *ctx = context; 124 struct pefile_context *ctx = context;
125 125
126 ctx->digest = kmemdup(value, vlen, GFP_KERNEL); 126 ctx->digest = kmemdup(value, vlen, GFP_KERNEL);
127 return ctx->digest ? 0 : -ENOMEM; 127 if (!ctx->digest)
128 return -ENOMEM;
129
130 ctx->digest_len = vlen;
131
132 return 0;
128} 133}