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-next>] [day] [month] [year] [list]
Date:   Sat, 2 Dec 2023 15:45:13 +0300
From:   Alexey Dobriyan <adobriyan@...il.com>
To:     Willy Tarreau <w@....eu>,
        Thomas Weißschuh <linux@...ssschuh.net>
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH] nolibc: optimise _start() on x86_64

Just jump into _start_c, it is not going to return anyway.

Signed-off-by: Alexey Dobriyan <adobriyan@...il.com>
---

	Also, kernel clears all registers before starting process,
	I'm not sure why

		xor ebp, ebp

	was added.

 tools/include/nolibc/arch-x86_64.h |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/tools/include/nolibc/arch-x86_64.h
+++ b/tools/include/nolibc/arch-x86_64.h
@@ -167,8 +167,7 @@ void __attribute__((weak, noreturn, optimize("Os", "omit-frame-pointer"))) __no_
 		"xor  %ebp, %ebp\n"       /* zero the stack frame                            */
 		"mov  %rsp, %rdi\n"       /* save stack pointer to %rdi, as arg1 of _start_c */
 		"and  $-16, %rsp\n"       /* %rsp must be 16-byte aligned before call        */
-		"call _start_c\n"         /* transfer to c runtime                           */
-		"hlt\n"                   /* ensure it does not return                       */
+		"jmp  _start_c\n"         /* transfer to c runtime                           */
 	);
 	__builtin_unreachable();
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ