Skip to contentSkip to conversation

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

PATCH New [email protected] 1 participant 1 message Dec 25, 2004 Proc filesystem

lore
Share & tools
lore
#0 lore raw

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

[Sorry about duplicate, had mail problems]

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

---

 kj-domen/fs/proc/base.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
fs/proc/base.c renamed from fs/proc/base.c~array_size-fs_proc_base.c.bak +1 -1
diff -puN fs/proc/base.c~array_size-fs_proc_base.c.bak fs/proc/base.c
@@ -401,7 +401,7 @@ static int proc_pid_wchan(struct task_st
 	char *modname;
 	const char *sym_name;
 	unsigned long wchan, size, offset;
-	char namebuf[128];
+	char namebuf[KSYM_NAME_LEN+1];
 
 	wchan = get_wchan(task);
 

diff -L fs/proc/base.c.bak -puN /dev/null /dev/null _