]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dtrace: fix leaking psinfo objects
authorKris Van Hees <kris.van.hees@oracle.com>
Fri, 4 Apr 2014 14:04:58 +0000 (10:04 -0400)
committerNick Alcock <nick.alcock@oracle.com>
Tue, 21 Jul 2015 14:29:31 +0000 (15:29 +0100)
commit3753ea415f57b8e2aa6b7a6b4596ec68f986ce09
tree920c2a78593b0fcc79e92acdc116346476ca10d7
parent9bfab8638e8d089f7e0c03d0c995a0dafa1641ef
dtrace: fix leaking psinfo objects

The psinfo objects created from a kmem cache (slab) to hold information
about a task's environment and arguments can leak when a task executes
two consecutive execve() calls.  The implementation also made it possible
for tasks to have no psinfo (NULL) after a fork() unless an execve() was
done shortly after.  This commit resolved both problems by adding a refc
to the psinfo objects (so one can be shared across task parentage
relations due to fork()), and by ensuring that upon execve() any existing
psinfo gets its refc decremented and a new psinfo object gets installed
to reflect the new execution environment.

This commit also adds the necessary initialization of a psinfo object for
tasks that do not have a mm object associated with them.

Orabug: 18383027

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Chuck Anderson <chuck.anderson@oracle.com>
fs/exec.c
include/linux/dtrace_psinfo.h
kernel/dtrace/dtrace_os.c
kernel/fork.c