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: <CA+55aFzLA2dBhVTsvEBZ58aS2Jgp020cPC3MvMR_RuJqFmM67Q@mail.gmail.com>
Date:   Thu, 11 Jan 2018 09:29:48 -0800
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     David Woodhouse <dwmw2@...radead.org>
Cc:     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>,
        Peter Zijlstra <peterz@...radead.org>,
        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 8:27 AM, David Woodhouse <dwmw2@...radead.org> wrote:
>
> <mode name="peterz">
>   Ick, numbers. Use .Lfoo_%= instead.
> </mode>

Actually, I think PeterZ is wrong on this one.

First off, we do *not* use %= in inline asms in the kernel yet, and we
shouldn't start just because of these.

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.

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.

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

The one requirement for the small numbers thing is that you really
have to give the direction when you use them. Because re-using the
same number *will* happen, and is normal.

That, btw, is also why it's pointless to make the small numbers
"bigger". Using "1122" as a label is actively worse than just using
"1".

You shouldn't try to fool yourself and think that your number is
"unique". It doesn't need to be. A label needs to be unique within one
use, and the use just tells _which_ of the non-unique numbers you use.

And yes, you could even re-use the number within one macro or inline
asm. But that's just confusing. Make the number unique for the
particular macro or inline use.

                   Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ