Skip to contentSkip to conversation

Fix thinko in mips/mips64 sys_sysmips

PATCH Applied Ben Collins 2 participants 2 messages May 26, 2003 – May 27, 2003 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix thinko in mips/mips64 sys_sysmips

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

arch/mips64/kernel/syscall.c +1 -1
Index: linux-2.4/arch/mips64/kernel/syscall.c
===================================================================
@@ -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;
arch/mips/kernel/sysmips.c +1 -1
Index: linux-2.4/arch/mips/kernel/sysmips.c
===================================================================
@@ -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;
Applied
#1 lore raw
Quoted 6 lines · Ben Collins

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