Fix: statedump missing check for NULL namespace
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 11 Sep 2012 16:09:53 +0000 (12:09 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 11 Sep 2012 16:09:53 +0000 (12:09 -0400)
Cause kernel OOPS. statedump PID namespace support is newly introduced
in lttng-modules 2.1. Happens when iterating on a zombie process.

Reported-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
instrumentation/events/lttng-module/lttng-statedump.h

index ea0b6d9d99eeeade8aaec9be89cee228c85e729f..d350cad3fd45048f99b3d777266ecdf79b82b538 100644 (file)
@@ -67,10 +67,12 @@ TRACE_EVENT(lttng_statedump_process_state,
                                struct task_struct *parent;
                                pid_t ret = 0;
 
-                               rcu_read_lock();
-                               parent = rcu_dereference(p->real_parent);
-                               ret = task_tgid_nr_ns(parent, pid_ns);
-                               rcu_read_unlock();
+                               if (pid_ns) {
+                                       rcu_read_lock();
+                                       parent = rcu_dereference(p->real_parent);
+                                       ret = task_tgid_nr_ns(parent, pid_ns);
+                                       rcu_read_unlock();
+                               }
                                ret;
                        }))
                tp_memcpy(name, p->comm, TASK_COMM_LEN)
This page took 0.02646 seconds and 4 git commands to generate.