Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lans Zhang <jia.zhang@windriver.com>
To: dhowells@redhat.com
Cc: kexec@lists.infradead.org, vgoyal@redhat.com, bhe@redhat.com
Subject: [V2][PATCH 2/2] pefile: Fix the failure of calculation for digest
Date: Wed, 13 Jul 2016 21:35:37 +0800	[thread overview]
Message-ID: <1468416937-21237-2-git-send-email-jia.zhang@windriver.com> (raw)
In-Reply-To: <1468416937-21237-1-git-send-email-jia.zhang@windriver.com>

The 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>
Cc: David Howells <dhowells@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
---
 crypto/asymmetric_keys/mscode_parser.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/crypto/asymmetric_keys/mscode_parser.c b/crypto/asymmetric_keys/mscode_parser.c
index 6a76d5c..9492e1c 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;
 }
-- 
1.9.1


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2016-07-13 13:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-13 13:35 [V2][PATCH 1/2] PKCS#7: Fix kernel panic when referring to the empty AuthorityKeyIdentifier Lans Zhang
2016-07-13 13:35 ` Lans Zhang [this message]
2016-07-14  2:14   ` [V2][PATCH 2/2] pefile: Fix the failure of calculation for digest Dave Young
2016-07-14  2:18   ` Dave Young
2016-07-14  2:16 ` [V2][PATCH 1/2] PKCS#7: Fix kernel panic when referring to the empty AuthorityKeyIdentifier Dave Young
2016-07-15 14:48 ` David Howells
2016-07-16  1:31   ` Lans Zhang
2016-07-17 22:58     ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468416937-21237-2-git-send-email-jia.zhang@windriver.com \
    --to=jia.zhang@windriver.com \
    --cc=bhe@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=kexec@lists.infradead.org \
    --cc=vgoyal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox