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>] [day] [month] [year] [list]
Message-Id: <20230604-nolibc-syscall-ret-v1-1-779513fc915d@weissschuh.net>
Date:   Sun, 04 Jun 2023 21:52:59 +0200
From:   Thomas Weißschuh <linux@...ssschuh.net>
To:     Willy Tarreau <w@....eu>
Cc:     linux-kernel@...r.kernel.org,
        Thomas Weißschuh <linux@...ssschuh.net>
Subject: [PATCH] tools/nolibc: handle large return values from syscall()

Syscalls return values long values. Don't truncate to int.

Fixes: 33158bb86d46 ("tools/nolibc/unistd: add syscall()")
Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
---

Just noticed this when responding at
https://lore.kernel.org/lkml/ea4e7442-7223-4211-ba29-70821e907888@t-8ch.de/

Feel free to squash this directly into the broken commit.
---
 tools/include/nolibc/unistd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/include/nolibc/unistd.h b/tools/include/nolibc/unistd.h
index 6773e83c16a0..c20b2fbf065e 100644
--- a/tools/include/nolibc/unistd.h
+++ b/tools/include/nolibc/unistd.h
@@ -58,7 +58,7 @@ int tcsetpgrp(int fd, pid_t pid)
 
 #define _syscall(N, ...)                                                      \
 ({                                                                            \
-	int _ret = my_syscall##N(__VA_ARGS__);                                \
+	long _ret = my_syscall##N(__VA_ARGS__);                               \
 	if (_ret < 0) {                                                       \
 		SET_ERRNO(-_ret);                                             \
 		_ret = -1;                                                    \

---
base-commit: a76324560e0f8f916d89452dd6aec1104e97a3c6
change-id: 20230604-nolibc-syscall-ret-520dfe9fb6b0

Best regards,
-- 
Thomas Weißschuh <linux@...ssschuh.net>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ