All of lore.kernel.org
 help / color / mirror / Atom feed
* BUG: Linux 2.6.25 ptrace leaks struct_task
@ 2008-06-27 18:30 Joris van Rantwijk
  2008-06-27 20:00 ` Jeff Dike
  0 siblings, 1 reply; 5+ messages in thread
From: Joris van Rantwijk @ 2008-06-27 18:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: Pekka Enberg, Thorsten Knabe

I think sys32_ptrace() is leaking struct_task.

In arch/x86/kernel/ptrace.c, function sys32_ptrace(), there
is a call to ptrace_get_task_struct(). In some cases (such as
PTRACE_GETREGS), there is no matching call to put_task_struct().

Test case: fork many childs, calling PTRACE_GETREGS on each child.
Indeed this causes unbounded growth of the task_struct allocation
in /proc/slabinfo, and it also causes physical memory to disappear
from /proc/meminfo.

I have tested this on Linux 2.6.25.4 for x86_64, but the
relevant code has not been changed in 2.6.25.9.
This bug appears to be fixed in 2.6.26-rc8: the code looks
different and I can't reproduce the issue there.

Oops, just discovered this problem has already been reported
in http://lkml.org/lkml/2008/5/29/266 although not much
seems to have been done about it.

Should this be fixed for 2.6.25.10 ?

Is it likely that this bug is related to the mysterious
disappearance of memory from /proc/meminfo as reported in
http://lkml.org/lkml/2008/6/24/15 ?

Even so, how is it possible that memory just disappears
from /proc/meminfo? It can't be the task_struct cache itself,
because that is all covered under Slab, right ?

Greetings, Joris.

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

end of thread, other threads:[~2008-06-27 20:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-27 18:30 BUG: Linux 2.6.25 ptrace leaks struct_task Joris van Rantwijk
2008-06-27 20:00 ` Jeff Dike
2008-06-27 20:17   ` Roland McGrath
2008-06-27 20:18   ` [PATCH 2.6.25-stable] x86_64 ptrace: fix sys32_ptrace task_struct leak Roland McGrath
2008-06-27 20:48   ` Roland McGrath

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.