The lttng-statedump checks the return value of task_active_pid_ns()
before each use within trace_lttng_statedump_process_state(), but misses
the NULL check before dereferencing pid_ns->parent.
This race happens if a task exists in "dead" state while the statedump
iterates on that task.
Reported-by: Li Zhou <li.zhou@windriver.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
do {
trace_lttng_statedump_process_state(session,
p, type, mode, submode, status, pid_ns);
- pid_ns = pid_ns->parent;
+ pid_ns = pid_ns ? pid_ns->parent : NULL;
} while (pid_ns);
}