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] [day] [month] [year] [list]
Date:   Fri, 12 Jan 2018 21:36:21 +0100
From:   Ingo Molnar <mingo@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        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


* Peter Zijlstra <peterz@...radead.org> wrote:

> > 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.

Absolutely, in fact I detest what we have:

+#define __FILL_RETURN_BUFFER(reg, nr, sp)      \
+       mov     $(nr/2), reg;                   \
+771:                                           \
+       call    772f;                           \
+773:   /* speculation trap */                  \
+       pause;                                  \
+       jmp     773b;                           \
+772:                                           \
+       call    774f;                           \
+775:   /* speculation trap */                  \
+       pause;                                  \
+       jmp     775b;                           \
+774:                                           \
+       dec     reg;                            \
+       jnz     771b;                           \
+       add     $(BITS_PER_LONG/8) * nr, sp;

I mean, WTF??

Also, note that this:

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

becomes even more readable with a bit more human-readability improvements:

	call .L_set_up_target

 .L_capture_spec:
	pause
	jmp .L_capture_spec

 .L_set_up_target:
	mov %r11, (%rsp)
	ret 

I.e. the underscores in the label names, the tabs and the newlines create better 
vertical and horizontal separation between the syntactical elements and provide 
grouping of larger constructs.

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ