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:   Thu, 11 Jan 2018 18:56:26 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Linus Torvalds <torvalds@...ux-foundation.org>
Cc:     David Woodhouse <dwmw2@...radead.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        the arch/x86 maintainers <x86@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Andi Kleen <ak@...ux.intel.com>, Paul Turner <pjt@...gle.com>,
        Greg Kroah-Hartman <gregkh@...ux-foundation.org>,
        Tim Chen <tim.c.chen@...ux.intel.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Kees Cook <keescook@...gle.com>,
        Andy Lutomirski <luto@...capital.net>,
        Jiri Kosina <jikos@...nel.org>,
        One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>
Subject: Re: [PATCH 2/3] objtool: Ignore retpoline alternatives

On Thu, Jan 11, 2018 at 09:29:48AM -0800, Linus Torvalds wrote:

> Secondly, we use lots of the the "small numbers for local labels" both
> in inline asm and in *.S files.
> 
> I think doing
> 
>        jne 1f
>   ...
>   1:
> 
> is a _hell_ of a lot more legible than
> 
>         jne .LPrefix_%
>     ...
>   .LPrefix_%
> 
> unless you have some *major* reason to use an explicit label name.

Small number maybe; but the value at hand was a random 999 or so, which
is not a small number.

But I find a descriptive label ever so much better than a random number.

> Sure, if you grew up writing perl, and think that an illegible mess of
> random characters is a requirement for programming, then the ".L%"
> format looks natural.

I grew up on BASIC and have bad memories of random big number goto. I'll
take those random trailing character any day if it includes human
readable bits before.

> But if you're an actual human, the "small numbers as labels" is fine.

I find descriptive labels much nicer than random numbers, I'll take some
crazy characters if so required.


Consider the retpoline thing:

 call .Lset_up_target
.Lcapture_spec:
  pause
  jmp .Lcapture_spec
.Lset_up_target:
  mov %r11, (%rsp);
  ret;


over:

 call 2f
1:
 pause
 jmp 1b
2:
 mov %r11, (%rsp)
 ret


give me the first any day of the week.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ