lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <146879704739.32133.1831526981378509732.stgit@warthog.procyon.org.uk>
Date:	Mon, 18 Jul 2016 00:10:47 +0100
From:	David Howells <dhowells@...hat.com>
To:	jmorris@...ei.org
Cc:	keyring@...r.kernel.org, Lans Zhang <jia.zhang@...driver.com>,
	Baoquan He <bhe@...hat.com>, kexec@...ts.infradead.org,
	linux-kernel@...r.kernel.org, dhowells@...hat.com,
	linux-security-module@...r.kernel.org,
	linux-crypto@...r.kernel.org, Dave Young <dyoung@...hat.com>,
	Vivek Goyal <vgoyal@...hat.com>
Subject: [PATCH 2/3] pefile: Fix the failure of calculation for digest

From: Lans Zhang <jia.zhang@...driver.com>

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@...driver.com>
Tested-by: Dave Young <dyoung@...hat.com>
Signed-off-by: David Howells <dhowells@...hat.com>
Cc: Baoquan He <bhe@...hat.com>
Cc: Vivek Goyal <vgoyal@...hat.com>
cc: kexec@...ts.infradead.org
cc: linux-crypto@...r.kernel.org
---

 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 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,
 	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;
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ