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]
Date:   Wed, 6 May 2020 20:16:02 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Josh Poimboeuf <jpoimboe@...hat.com>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org, rostedt@...dmis.org,
        mhiramat@...nel.org, bristot@...hat.com, jbaron@...mai.com,
        torvalds@...ux-foundation.org, tglx@...utronix.de,
        mingo@...nel.org, namit@...are.com, hpa@...or.com, luto@...nel.org,
        ard.biesheuvel@...aro.org, pbonzini@...hat.com,
        mathieu.desnoyers@...icios.com
Subject: Re: [PATCH v4 14/18] static_call: Add static_cond_call()

On Wed, May 06, 2020 at 01:09:24PM -0500, Josh Poimboeuf wrote:

> #define __ARCH_DEFINE_STATIC_CALL_TRAMP(name, insns)			\
> 	asm(".pushsection .static_call.text, \"ax\"		\n"	\
> 	    ".align 4						\n"	\
> 	    ".globl " STATIC_CALL_TRAMP_STR(name) "		\n"	\
> 	    STATIC_CALL_TRAMP_STR(name) ":			\n"	\
> 	    insns "						\n"	\
> 	    ".type " STATIC_CALL_TRAMP_STR(name) ", @function	\n"	\
> 	    ".size " STATIC_CALL_TRAMP_STR(name) ", . - " STATIC_CALL_TRAMP_STR(name) " \n" \
> 	    ".popsection					\n")
> 
> #define ARCH_DEFINE_STATIC_CALL_TRAMP(name, func)			\
> 	__ARCH_DEFINE_STATIC_CALL_TRAMP(name, "jmp.d32 " # func)

Note that this one is now:

	.byte 0xe9; .long #func - (. + 4);

due to clang not actually understanding jmp.d32 :-(

> #define ARCH_DEFINE_STATIC_CALL_RETTRAMP(name, func)			\
> 	__ARCH_DEFINE_STATIC_CALL_TRAMP(name, "ret; nop; nop; nop; nop")
> 
> I like it.  Makes it easy to see the differences between the tramps.

OK, ok.. changed :-)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ