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] [day] [month] [year] [list]
Date: Tue, 2 Jan 2024 17:26:58 +0100
From: Ard Biesheuvel <ardb@...nel.org>
To: Tom Lendacky <thomas.lendacky@....com>
Cc: Yuntao Wang <ytcoode@...il.com>, linux-efi@...r.kernel.org, 
	linux-kernel@...r.kernel.org, "Borislav Petkov (AMD)" <bp@...en8.de>, 
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>, Ingo Molnar <mingo@...nel.org>, 
	Dionna Glaze <dionnaglaze@...gle.com>, Nikolay Borisov <nik.borisov@...e.com>
Subject: Re: [PATCH] x86/efistub: fix the missing KASLR_FLAG bit in boot_params->hdr.loadflags

On Tue, 2 Jan 2024 at 17:26, Tom Lendacky <thomas.lendacky@....com> wrote:
>
> On 1/2/24 09:29, Ard Biesheuvel wrote:
> > On Tue, 26 Dec 2023 at 15:03, Yuntao Wang <ytcoode@...il.com> wrote:
> >>
> >> When KASLR is enabled, the KASLR_FLAG bit in boot_params->hdr.loadflags
> >> should be set to 1 to propagate KASLR status from compressed kernel to
> >> kernel, just as the choose_random_location() function does.
> >>
> >> Currently, when kernel is booted via efi stub, the KASLR_FLAG bit in
> >> boot_params->hdr.loadflags is not set, even though it should be. This
> >> causes some functions, such as kernel_randomize_memory(), not to execute
> >> as expected. Fix it.
> >>
> >> Signed-off-by: Yuntao Wang <ytcoode@...il.com>
> >> ---
> >>   drivers/firmware/efi/libstub/x86-stub.c | 5 ++++-
> >>   1 file changed, 4 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/efi/libstub/x86-stub.c
> >> index da9b7b8d0716..b0c68593ad40 100644
> >> --- a/drivers/firmware/efi/libstub/x86-stub.c
> >> +++ b/drivers/firmware/efi/libstub/x86-stub.c
> >> @@ -787,7 +787,10 @@ static efi_status_t efi_decompress_kernel(unsigned long *kernel_entry)
> >>                          efi_debug("AMI firmware v2.0 or older detected - disabling physical KASLR\n");
> >>                          seed[0] = 0;
> >>                  }
> >> -       }
> >> +
> >> +               boot_params_ptr->hdr.loadflags |= KASLR_FLAG;
> >> +       } else
> >> +               boot_params_ptr->hdr.loadflags &= ~KASLR_FLAG;
> >>
> >
> > Thanks for the fix.
>
> Does it need a Fixes: tag?
>

Yes, I've added that.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ