All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Arvind Sankar <nivedita@alum.mit.edu>, linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@kernel.org>, x86@kernel.org
Subject: Re: kexec breaks with 5.4 due to memzero_explicit
Date: Mon, 7 Oct 2019 10:50:27 +0200	[thread overview]
Message-ID: <28f3d204-47a2-8b4f-f6a7-11d73c2d87c8@redhat.com> (raw)
In-Reply-To: <20191007030939.GB5270@rani.riverdale.lan>

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

Hi,

On 07-10-2019 05:09, Arvind Sankar wrote:
> Hi, arch/x86/purgatory/purgatory.ro has an undefined symbol
> memzero_explicit. This has come from commit 906a4bb97f5d ("crypto:
> sha256 - Use get/put_unaligned_be32 to get input, memzero_explicit")
> according to git bisect.

Hmm, it (obviously) does build for me and using kexec still also works
for me.

But it seems that you are right and that this should not build, weird.

Thank you for reporting this. I've attached a patch which should fix this,
I'm also sending this the regular way, so that the x86 maintainers can pick it up.

Can you please give this a try and let us know if it fixes things for you?

Regards,

Hans

[-- Attachment #2: 0001-x86-boot-Provide-memzero_explicit.patch --]
[-- Type: text/x-patch, Size: 1100 bytes --]

From d371dbdef635b57d993bda428a9eb6b929f4472d Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 7 Oct 2019 10:43:00 +0200
Subject: [PATCH] x86/boot: Provide memzero_explicit

The purgatory code now uses the shared lib/crypto/sha256.c sha256
implementation. This needs memzero_explicit, implement this.

Reported-by: Arvind Sankar <nivedita@alum.mit.edu>
Fixes: 906a4bb97f5d ("crypto: sha256 - Use get/put_unaligned_be32 to get input, memzero_explicit")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 arch/x86/boot/compressed/string.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/boot/compressed/string.c b/arch/x86/boot/compressed/string.c
index 81fc1eaa3229..511332e279fe 100644
--- a/arch/x86/boot/compressed/string.c
+++ b/arch/x86/boot/compressed/string.c
@@ -50,6 +50,11 @@ void *memset(void *s, int c, size_t n)
 	return s;
 }
 
+void memzero_explicit(void *s, size_t count)
+{
+	memset(s, 0, count);
+}
+
 void *memmove(void *dest, const void *src, size_t n)
 {
 	unsigned char *d = dest;
-- 
2.23.0


  reply	other threads:[~2019-10-07  8:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-07  3:09 kexec breaks with 5.4 due to memzero_explicit Arvind Sankar
2019-10-07  8:50 ` Hans de Goede [this message]
2019-10-07  9:10   ` Hans de Goede
2019-10-07 13:09     ` Ingo Molnar
2019-10-07 13:40       ` Hans de Goede
2019-10-07 13:55         ` Ingo Molnar
2019-10-07 13:53       ` Ingo Molnar
2019-10-07 14:07       ` Hans de Goede
2019-10-07 13:20     ` Arvind Sankar
2019-10-07 16:56       ` Hans de Goede

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=28f3d204-47a2-8b4f-f6a7-11d73c2d87c8@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=nivedita@alum.mit.edu \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.