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: <20090310112410.GA27997@uranus.ravnborg.org>
Date:	Tue, 10 Mar 2009 12:24:10 +0100
From:	Sam Ravnborg <sam@...nborg.org>
To:	Yinghai Lu <yinghai@...nel.org>
Cc:	Jeremy Fitzhardinge <jeremy@...p.org>, Ingo Molnar <mingo@...e.hu>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	the arch/x86 maintainers <x86@...nel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Absolute symbols in vmlinux_64.lds.S

On Mon, Mar 09, 2009 at 10:57:19PM -0700, Yinghai Lu wrote:
> On Mon, Mar 9, 2009 at 10:37 PM, Sam Ravnborg <sam@...nborg.org> wrote:
> > On Mon, Mar 09, 2009 at 06:23:55PM -0700, Yinghai Lu wrote:
> >> Jeremy Fitzhardinge wrote:
> >> > Why does vmlinux_64.lds.S use absolute symbols for things like
> >> > __bss_start/stop:
> >> >
> >> >  __bss_start = .;        /* BSS */
> >> >  .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
> >> >     *(.bss.page_aligned)
> >> >     *(.bss)
> >> >     }
> >> >  __bss_stop = .;
> >> >
> >> >
> >> > vmlinux_32.lds.S puts __bss_start/stop into the .bss section itself.  Is
> >> > there some particular reason they need to be absolute symbols
> >> > (relocation?).
> >> >
> >>
> >> they are the same.
> >
> > Thats depends on the value of '.' where you assign __bss_start.
> > We have had several bugs where the symbol assinged outside the
> > section was less than expected because the linker aling the
> > start of the section equal to the lrgest alignment requirement
> > of a member in the section.
> >
> > So in this case if '.' equals to 0xabcd and the lagest
> > alignment requirement inside the block is 0x1000 and we have
> > __bss_start1 = .;
> > .bss : {
> >        __bss_start2 = .;
> >        *(.bss.page_aligned)
> > }
> >
> > Then you would see that:
> > __bss_start1 equals 0xabcd
> > __bss_start2 equals 0xb000
> 
> good to know...
> 
> anyway, more lines
> 
>   . = ALIGN(PAGE_SIZE);
>   __nosave_begin = .;
>   .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
>       *(.data.nosave)
>   } :data.init2 /* use another section data.init2, see PERCPU_VADDR() above */
>   . = ALIGN(PAGE_SIZE);
>   __nosave_end = .;
> 
>   __bss_start = .;              /* BSS */
>   .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
>         *(.bss.page_aligned)
>         *(.bss)
>         }
>   __bss_stop = .;
> 
>   _end = . ;
> 
> 
> there are extra ALIGN(PAGE_SIZE) between them....

So you say that we do hit this issue here - right.
But the better way to do it is to include the assignment inside the {} block,
thus we are not dependent on an ALIGN() that logically belongs to .data_nosave.

	Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ