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]
Date:   Tue, 18 Feb 2020 13:03:54 -0500
From:   Arvind Sankar <nivedita@...m.mit.edu>
To:     Arvind Sankar <nivedita@...m.mit.edu>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] x86/boot/compressed/64: Remove .bss/.pgtable from
 bzImage

On Wed, Feb 05, 2020 at 11:29:21AM -0500, Arvind Sankar wrote:
> On Thu, Jan 09, 2020 at 10:02:17AM -0500, Arvind Sankar wrote:
> > Commit 5b11f1cee579 ("x86, boot: straighten out ranges to copy/zero in
> > compressed/head*.S") introduced a separate .pgtable section, splitting
> > it out from the rest of .bss. This section was added without the
> > writeable flag, marking it as read-only. This results in the linker
> > putting the .rela.dyn section (containing bogus dynamic relocations from
> > head_64.o) after the .bss and .pgtable sections.
> > 
> > When we use objcopy to convert compressed/vmlinux into a binary for the
> > bzImage, the .bss and .pgtable sections get materialized as ~176KiB of
> > zero bytes in the binary in order to place .rela.dyn at the correct
> > location.
> > 
> > Fix this by marking .pgtable as writeable. This moves the .rela.dyn
> > section earlier so that .bss and .pgtable are the last allocated
> > sections and so don't appear in bzImage.
> > 
> > Signed-off-by: Arvind Sankar <nivedita@...m.mit.edu>
> > ---
> >  arch/x86/boot/compressed/head_64.S | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
> > index 58a512e33d8d..6eb30f8a3ce7 100644
> > --- a/arch/x86/boot/compressed/head_64.S
> > +++ b/arch/x86/boot/compressed/head_64.S
> > @@ -709,7 +709,7 @@ SYM_DATA_END_LABEL(boot_stack, SYM_L_LOCAL, boot_stack_end)
> >  /*
> >   * Space for page tables (not in .bss so not zeroed)
> >   */
> > -	.section ".pgtable","a",@nobits
> > +	.section ".pgtable","aw",@nobits
> >  	.balign 4096
> >  SYM_DATA_LOCAL(pgtable,		.fill BOOT_PGT_SIZE, 1, 0)
> >  
> > -- 
> > 2.24.1
> > 
> 
> Gentle reminder.
> 
> https://lore.kernel.org/lkml/20200109150218.16544-1-nivedita@alum.mit.edu

Ping.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ