summaryrefslogtreecommitdiff
path: root/kernel/time
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>2013-07-02 19:30:53 (GMT)
committerSteven Rostedt <rostedt@goodmis.org>2013-07-02 21:13:34 (GMT)
commit8e2e2fa47129532a30cff6c25a47078dc97d9260 (patch)
tree6cc93f432b3186200c7afeaca1a432e497ad949c /kernel/time
parent7b85af63034818e43aee6c1d7bf1c7c6796a9073 (diff)
downloadlinux-fsl-qoriq-8e2e2fa47129532a30cff6c25a47078dc97d9260.tar.xz
tracing: Add trace_array_get/put() to event handling
Commit a695cb58162 "tracing: Prevent deleting instances when they are being read" tried to fix a race between deleting a trace instance and reading contents of a trace file. But it wasn't good enough. The following could crash the kernel: # cd /sys/kernel/debug/tracing/instances # ( while :; do mkdir foo; rmdir foo; done ) & # ( while :; do echo 1 > foo/events/sched/sched_switch 2> /dev/null; done ) & Luckily this can only be done by root user, but it should be fixed regardless. The problem is that a delete of the file can happen after the write to the event is opened, but before the enabling happens. The solution is to make sure the trace_array is available before succeeding in opening for write, and incerment the ref counter while opened. Now the instance can be deleted when the events are writing to the buffer, but the deletion of the instance will disable all events before the instance is actually deleted. Cc: stable@vger.kernel.org # 3.10 Reported-by: Alexander Lam <azl@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/time')
0 files changed, 0 insertions, 0 deletions