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: <20220822163933.b5hee76fsis376ji@amd.com>
Date:   Mon, 22 Aug 2022 11:39:33 -0500
From:   Michael Roth <michael.roth@....com>
To:     Jeremi Piotrowski <jpiotrowski@...ux.microsoft.com>
CC:     NOMURA JUNICHI(野村 淳一) 
        <junichi.nomura@....com>, LKML <linux-kernel@...r.kernel.org>,
        "x86@...nel.org" <x86@...nel.org>, "bp@...e.de" <bp@...e.de>
Subject: Re: [Regression v5.19-rc1] kernel fails to boot, no console output
 (Re: [PATCH v12 38/46] x86/sev: Add SEV-SNP feature detection/setup)

On Wed, Aug 17, 2022 at 10:40:40AM +0200, Jeremi Piotrowski wrote:
> On Tue, Aug 16, 2022 at 10:06:37AM -0500, Michael Roth wrote:
> > And if that does not avoid the issue, can you retry with the below change
> > (without the above change in place)?
> > 
> >   diff --git a/arch/x86/kernel/sev.c b/arch/x86/kernel/sev.c
> >   index 7b668f91c9ab..0b430f98e053 100644
> >   --- a/arch/x86/kernel/sev.c
> >   +++ b/arch/x86/kernel/sev.c
> >   @@ -2073,10 +2073,12 @@ static __init struct cc_blob_sev_info *find_cc_blob(struct boot_params *bp)
> >           struct cc_blob_sev_info *cc_info;
> >   
> >           /* Boot kernel would have passed the CC blob via boot_params. */
> >   +#if 0
> >           if (bp->cc_blob_address) {
> >                   cc_info = (struct cc_blob_sev_info *)(unsigned long)bp->cc_blob_address;
> >                   goto found_cc_info;
> >           }
> >   +#endif
> >   
> >           /*
> >            * If kernel was booted directly, without the use of the
> >   @@ -2087,7 +2089,7 @@ static __init struct cc_blob_sev_info *find_cc_blob(struct boot_params *bp)
> >           if (!cc_info)
> >                   return NULL;
> >   
> >   -found_cc_info:
> >   +//found_cc_info:
> >           if (cc_info->magic != CC_BLOB_SEV_HDR_MAGIC)
> >                   snp_abort();
> > 
> > Trying to see if you're hitting a separate issue or not.
> 
> This version boots correctly.

Hi Jeremi,

Still haven't been able to reproduce this on my systems, but it looks like
it's either an issue dereferencing boot_params, or bp->cc_blob_address is
pointing to garbage, so the cc_info->magic check fails. The latter seems
more likely, since sme_enable() previously made use of the same boot_params
pointer without any issues.

To confirm, please give the below fix a try:


diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c
index 52f989f6acc2..dd6cd0d7c740 100644
--- a/arch/x86/boot/compressed/sev.c
+++ b/arch/x86/boot/compressed/sev.c
@@ -392,6 +392,13 @@ bool snp_init(struct boot_params *bp)
        if (!bp)
                return false;

+       /*
+        * bp->cc_blob_address should only be set by boot/compressed kernel.
+        * Initialize it to 0 to ensure that uninitialized values from
+        * buggy bootloaders aren't propagated.
+        */
+       bp->cc_blob_address = 0;
+
        cc_info = find_cc_blob(bp);
        if (!cc_info)
                return false;

Thanks!

-Mike

> 
> > 
> > Thanks,
> > 
> > Mike
> > 
> > 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ