Skip to contentSkip to conversation

bug in syscal arg sign extension

PATCH David S. Miller 2 participants 3 messages Aug 27, 2004 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

Remember this topic long ago?

Anyways, there was a bug in my sparc64 code and it causes all kinds of trouble for logging daemons. I was sign extending the buffer pointer arg instead of the length arg to sys_syslog() Ooops!
:-)

Fix attached in cases anyone was doing work for the platform based upon my sparc64 stuff.

===== arch/sparc64/kernel/sys32.S 1.9 vs edited =====

arch/sparc64/kernel/sys32.S +1 -1
@@ -120,7 +120,7 @@
 SIGN2(sys32_setpgid, sys_setpgid, %o0, %o1)
 SIGN3(sys32_setpriority, sys_setpriority, %o0, %o1, %o2)
 SIGN1(sys32_ssetmask, sys_ssetmask, %o0)
-SIGN2(sys32_syslog, sys_syslog, %o0, %o1)
+SIGN2(sys32_syslog, sys_syslog, %o0, %o2)
 SIGN1(sys32_umask, sys_umask, %o0)
 SIGN3(sys32_tgkill, sys_tgkill, %o0, %o1, %o2)
 SIGN1(sys32_sendto, sys_sendto, %o0)
#1 lore raw
Quoted 11 lines · David S. Miller

Remember this topic long ago?

Anyways, there was a bug in my sparc64 code and it causes all kinds of trouble for logging daemons. I was sign extending the buffer pointer arg instead of the length arg to sys_syslog() Ooops!
:-)

Fix attached in cases anyone was doing work for the platform based upon my sparc64 stuff.

Thanks for the hint. From a quick look at your list I think there are several bugs on x86-64.

But some entries I don't understand. e.g. why are you sign extending open or prctl?

-Andi

Quoted 13 lines

===== arch/sparc64/kernel/sys32.S 1.9 vs edited =====

arch/sparc64/kernel/sys32.S +1 -1
@@ -120,7 +120,7 @@
 SIGN2(sys32_setpgid, sys_setpgid, %o0, %o1)
 SIGN3(sys32_setpriority, sys_setpriority, %o0, %o1, %o2)
 SIGN1(sys32_ssetmask, sys_ssetmask, %o0)
-SIGN2(sys32_syslog, sys_syslog, %o0, %o1)
+SIGN2(sys32_syslog, sys_syslog, %o0, %o2)
 SIGN1(sys32_umask, sys_umask, %o0)
 SIGN3(sys32_tgkill, sys_tgkill, %o0, %o1, %o2)
 SIGN1(sys32_sendto, sys_sendto, %o0)
#2 lore raw
Quoted 2 lines · On Fri, 27 Aug 2004 17:52:47 +0200 Andi Kleen <[email protected]> wrote:

But some entries I don't understand. e.g. why are you sign extending open or prctl?

Just for completeness.