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: <20190207121729.GE2414@zn.tnic>
Date:   Thu, 7 Feb 2019 13:17:29 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Thomas Garnier <thgarnie@...omium.org>
Cc:     kernel-hardening@...ts.openwall.com, kristen@...ux.intel.com,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
        "Peter Zijlstra (Intel)" <peterz@...radead.org>,
        Ard Biesheuvel <ard.biesheuvel@...aro.org>,
        Thomas Garnier <thgarnie@...gle.com>,
        Nadav Amit <namit@...are.com>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v6 02/27] x86: Use symbol name in jump table for PIE
 support

On Thu, Jan 31, 2019 at 11:24:09AM -0800, Thomas Garnier wrote:
> Replace the %c constraint with %P. The %c is incompatible with PIE
> because it implies an immediate value whereas %P reference a symbol.

How so?

AFAIK, %c requires a constant operand and if %P is used to print a
constant, it simply drops syntax-specific prefixes and does a bare
constant.

I guess that here

https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#x86Operandmodifiers

is not entirely correct as it should not say "If used for a constant"
for %P but say "symbol or constant".

But before/after asm doesn't show any difference. So what gives?

before:
# 39 "./arch/x86/include/asm/jump_label.h" 1
        1:
        .byte 0xe9
         .long .L241 - 2f       #
        2:
        .pushsection __jump_table,  "aw" 
         .balign 8 
        .long 1b - ., .L241 - .         #
         .quad __use_tsc + 1 - .        #,
        .popsection

after:
# 39 "./arch/x86/include/asm/jump_label.h" 1
        1:
        .byte 0xe9
         .long .L241 - 2f       #
        2:
        .pushsection __jump_table,  "aw" 
         .balign 8 
        .long 1b - ., .L241 - .         #
         .quad __use_tsc+1 - .  #
        .popsection 

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ