Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1681211
| From | Baoquan He <bhe@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 2/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions |
| Date | 2017-07-05 01:20 +0200 |
| Message-ID | <tZFgS-6y4-1@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <tZwGB-Oa-15@gated-at.bofh.it> <tZx9E-12c-5@gated-at.bofh.it> <tZxjj-1fd-15@gated-at.bofh.it> <tZy5I-1N0-21@gated-at.bofh.it> <tZyfo-1QF-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 07/04/17 at 05:46pm, Thomas Gleixner wrote:
> On Tue, 4 Jul 2017, Matt Fleming wrote:
> > On Tue, 04 Jul, at 04:46:58PM, Thomas Gleixner wrote:
> > > On Tue, 4 Jul 2017, Baoquan He wrote:
> > >
> > > > In fact I just referred to code in setup_arch(). Now I have a question,
> > > > though CONFIG_EFI=y but efi firmware is not enabled,
> > > > boot_params.efi_info.efi_loader_signature should be initilized to 0.
> > > > Then below code is also problematic.
> > > >
> > > > #ifdef CONFIG_EFI
> > > > if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
> > > > EFI32_LOADER_SIGNATURE, 4)) {
> > > > set_bit(EFI_BOOT, &efi.flags);
> > > > } else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
> > > > EFI64_LOADER_SIGNATURE, 4)) {
> > > > set_bit(EFI_BOOT, &efi.flags);
> > > > set_bit(EFI_64BIT, &efi.flags);
> > > > }
> > > >
> > > > if (efi_enabled(EFI_BOOT))
> > > > efi_memblock_x86_reserve_range();
> > > > #endif
> > >
> > > Indeed. Matt?
> >
> > It's possibly that I'm missing some context, but boot_params should be
> > zero'd -- the x86 boot protocol requires that the entire data
> > structure be zero'd on allocation.
> >
> > Have I missed something?
>
> No. I misread the code. The strncmp() operates on
> boot_params.efi_info.efi_loader_signature itself, so yes, all is fine.
Sorry, I must be dizzy at late night of yesterday, just gave wrong
answer when questioned.
>
> It's just Baoquans copy and paste wreckage which is busted.
>
> Thanks,
>
> tglx
>
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH v2 2/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-04 10:10 +0200
Re: [PATCH v2 2/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions Thomas Gleixner <tglx@linutronix.de> - 2017-07-04 16:10 +0200
Re: [PATCH v2 2/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-04 16:40 +0200
Re: [PATCH v2 2/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions Thomas Gleixner <tglx@linutronix.de> - 2017-07-04 16:50 +0200
Re: [PATCH v2 2/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions Matt Fleming <matt@codeblueprint.co.uk> - 2017-07-04 17:40 +0200
Re: [PATCH v2 2/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions Thomas Gleixner <tglx@linutronix.de> - 2017-07-04 17:50 +0200
Re: [PATCH v2 2/2] x86/boot/KASLR: Restrict kernel to be randomized in mirror regions Baoquan He <bhe@redhat.com> - 2017-07-05 01:20 +0200
csiph-web