Skip to contentSkip to conversation

inux-2.6.9/fs/proc/base.c: array size

KJ walter harms 1 participant 1 message Dec 20, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi list,
i was looking for arrays (and possible overflows) when i noticed that proc_pid_wchan() uses a 128-Byte array for something that can change its size via define.

Fix possible overflow: rewrite arraysize with correct constant

re,
walter

fs/proc/base.c renamed from fs/proc/base.c.bak +1 -1
@@ -400,7 +400,7 @@
 	char *modname;
 	const char *sym_name;
 	unsigned long wchan, size, offset;
-	char namebuf[128];
+	char namebuf[KSYM_NAME_LEN+1];
 
 	wchan = get_wchan(task);
 

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors