linux-mips
[Top] [All Lists]

[PATCH] Fix thinko in mips/mips64 sys_sysmips

To: Marcelo Tosatti <marcelo@conectiva.com.br>
Subject: [PATCH] Fix thinko in mips/mips64 sys_sysmips
From: Ben Collins <bcollins@debian.org>
Date: Mon, 26 May 2003 10:37:55 -0400
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.4i
This has already been fixed in Linus' tree. Here's hoping it gets into
2.4 sometime soon. Note in the patch that "node" is the userspace
pointer and "nodename" is the string where "node" was
strncpy_from_user()'d to.

So it really should be using "nodename".



Index: linux-2.4/arch/mips64/kernel/syscall.c
===================================================================
--- linux-2.4/arch/mips64/kernel/syscall.c      (revision 3226)
+++ linux-2.4/arch/mips64/kernel/syscall.c      (working copy)
@@ -207,7 +207,7 @@
                        return -EFAULT;
 
                down_write(&uts_sem);
-               strncpy(system_utsname.nodename, name, len);
+               strncpy(system_utsname.nodename, nodename, len);
                system_utsname.nodename[len] = '\0';
                up_write(&uts_sem);
                return 0;
Index: linux-2.4/arch/mips/kernel/sysmips.c
===================================================================
--- linux-2.4/arch/mips/kernel/sysmips.c        (revision 3226)
+++ linux-2.4/arch/mips/kernel/sysmips.c        (working copy)
@@ -65,7 +65,7 @@
                        return -EFAULT;
 
                down_write(&uts_sem);
-               strncpy(system_utsname.nodename, name, len);
+               strncpy(system_utsname.nodename, nodename, len);
                system_utsname.nodename[len] = '\0';
                up_write(&uts_sem);
                return 0;

<Prev in Thread] Current Thread [Next in Thread>