diff options
| author | Thomas Weißschuh <linux@weissschuh.net> | 2026-07-03 19:30:16 +0200 |
|---|---|---|
| committer | Thomas Weißschuh <linux@weissschuh.net> | 2026-07-03 20:00:09 +0200 |
| commit | a3b2181459a2c74c03ddbad585f884eefc8ff8ff (patch) | |
| tree | 672d2f9ee20f76d3452018c268e82f62f56db704 | |
| parent | 4f5777cfbd98c10e71c7fbfe4615dd499fada7b7 (diff) | |
| download | linux-next-a3b2181459a2c74c03ddbad585f884eefc8ff8ff.tar.gz linux-next-a3b2181459a2c74c03ddbad585f884eefc8ff8ff.zip | |
tools/nolibc: mark arg1 operand in __nolibc_syscall0() as write-only
__nolibc_syscall0() does not set the arg1 variable before passing it to
the asm block. This uninitialized variable read is undefined behavior.
Clang can miscompile this.
Mark the asm operand as write-only to fix this.
Fixes: 8e1930296f92 ("tools/nolibc: Add support for SPARC")
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260703-nolibc-sparc-asm-v1-1-c7fe73e2e777@weissschuh.net
| -rw-r--r-- | tools/include/nolibc/arch-sparc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/include/nolibc/arch-sparc.h b/tools/include/nolibc/arch-sparc.h index ddae9bc10dfe..23fab40accfa 100644 --- a/tools/include/nolibc/arch-sparc.h +++ b/tools/include/nolibc/arch-sparc.h @@ -45,7 +45,7 @@ \ __asm__ volatile ( \ _NOLIBC_SYSCALL \ - : "+r"(_arg1) \ + : "=r"(_arg1) \ : "r"(_num) \ : "memory", "cc" \ ); \ |
