Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] Fix thinko in mips/mips64 sys_sysmips
@ 2003-05-26 14:37 Ben Collins
  2003-05-27  4:24 ` Ralf Baechle
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Collins @ 2003-05-26 14:37 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: linux-mips, ralf

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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix thinko in mips/mips64 sys_sysmips
  2003-05-26 14:37 [PATCH] Fix thinko in mips/mips64 sys_sysmips Ben Collins
@ 2003-05-27  4:24 ` Ralf Baechle
  0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2003-05-27  4:24 UTC (permalink / raw)
  To: Ben Collins; +Cc: Marcelo Tosatti, linux-mips

On Mon, May 26, 2003 at 10:37:55AM -0400, Ben Collins wrote:

> 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".

Thanks, applied.

This function being an afaik unused stoneage compatibility function is
a candidate to die anyway ...

  Ralf

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-27  4:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-26 14:37 [PATCH] Fix thinko in mips/mips64 sys_sysmips Ben Collins
2003-05-27  4:24 ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox