]> git.baikalelectronics.ru Git - kernel.git/commit
KSYM_SYMBOL_LEN fixes
authorHugh Dickins <hugh@veritas.com>
Tue, 9 Dec 2008 21:14:27 +0000 (13:14 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 10 Dec 2008 16:01:54 +0000 (08:01 -0800)
commit089695924deadb5726a81a0f1532f8d427a85294
tree39f41dc5e46a9f0e1151963eb1d4f2b7ff77ee3d
parent0765d445485fb8799b007622861d8b9397820e12
KSYM_SYMBOL_LEN fixes

Miles Lane tailing /sys files hit a BUG which Pekka Enberg has tracked
to my 70836584e6841ccacffb3cfb10305ad00f1c983d sprint_symbol(): use
less stack exposing a bug in slub's list_locations() -
kallsyms_lookup() writes a 0 to namebuf[KSYM_NAME_LEN-1], but that was
beyond the end of page provided.

The 100 slop which list_locations() allows at end of page looks roughly
enough for all the other stuff it might print after the symbol before
it checks again: break out KSYM_SYMBOL_LEN earlier than before.

Latencytop and ftrace and are using KSYM_NAME_LEN buffers where they
need KSYM_SYMBOL_LEN buffers, and vmallocinfo a 2*KSYM_NAME_LEN buffer
where it wants a KSYM_SYMBOL_LEN buffer: fix those before anyone copies
them.

[akpm@linux-foundation.org: ftrace.h needs module.h]
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc Miles Lane <miles.lane@gmail.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Steven Rostedt <srostedt@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/base.c
include/linux/ftrace.h
kernel/latencytop.c
mm/slub.c
mm/vmalloc.c