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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 25 Sep 2019 19:10:25 +0200
From:   Borislav Petkov <bp@...en8.de>
To:     Nick Desaulniers <ndesaulniers@...gle.com>
Cc:     "H. Peter Anvin" <hpa@...or.com>,
        Jarkko Sakkinen <jarkko.sakkinen@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        clang-built-linux <clang-built-linux@...glegroups.com>,
        "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
        Tri Vo <trong@...roid.com>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Rob Herring <robh@...nel.org>,
        George Rimar <grimar@...esssoftek.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Fangrui Song <maskray@...gle.com>,
        Peter Smith <Peter.Smith@....com>, Rui Ueyama <ruiu@...gle.com>
Subject: Re: [PATCH v2] x86, realmode: explicitly set entry via command line

On Wed, Sep 25, 2019 at 09:35:24AM -0700, Nick Desaulniers wrote:
> Thanks for the consideration Boris.  So IIUC if the preceding sections
> are larger than 0x1000 altogether, setting the entry there will be
> wrong?

Well, I spent some time this morning grepping to find out whether PA
0x1000 was magical but didn't find anything. Perhaps hpa can refresh my
memory...

> Currently, .text looks like it's currently at 0x1000 for a defconfig,
> and I assume that could move in the case I stated above?

Yes, I think we shouldn't hardcode.

> $ readelf -S arch/x86/realmode/rm/realmode.elf | grep text
>   [ 3] .text             PROGBITS        00001000 201000 000f51 00  AX
>  0   0 4096
> ...
> 
> In that case, it seems that maybe I should set the ENTRY in the linker
> script as:
> diff --git a/arch/x86/realmode/rm/realmode.lds.S
> b/arch/x86/realmode/rm/realmode.lds.S
> index 3bb980800c58..64d135d1ee63 100644
> --- a/arch/x86/realmode/rm/realmode.lds.S
> +++ b/arch/x86/realmode/rm/realmode.lds.S
> @@ -11,6 +11,7 @@
> 
>  OUTPUT_FORMAT("elf32-i386")
>  OUTPUT_ARCH(i386)
> +ENTRY(pa_text_start)

Well, looking at arch/x86/boot/setup.ld, it does do:

ENTRY(_start)

for the global _start symbol in .../boot/header.S.

So you doing the respective thing in that linker script would make
sense...

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ