aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorArianna Avanzini <avanzini.arianna@gmail.com>2014-12-09 16:57:45 -0500
committerJens Axboe <axboe@fb.com>2014-12-09 16:59:09 -0500
commit7eca210375dcc029ad69c0cf48d2bf7a71f0121d (patch)
tree77e87cbc837a754309fbefd0aa6cbeb21765822a /kernel/trace
parent959f5f5b2fa7ac3bdd37c91076e560c06513f1e6 (diff)
blktrace: don't let the sysfs interface remove trace from running list
Currently, blktrace can be started/stopped via its ioctl-based interface (used by the userspace blktrace tool) or via its ftrace interface. The function blk_trace_remove_queue(), called each time an "enable" tunable of the ftrace interface transitions to zero, removes the trace from the running list, even if no function from the sysfs interface adds it to such a list. This leads to a null pointer dereference. This commit changes the blk_trace_remove_queue() function so that it does not remove the blk_trace from the running list. v2: - Now the patch removes the invocation of list_del() instead of adding an useless if branch, as suggested by Namhyung Kim. Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/blktrace.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index c1bd4ada2a04..bd05fd2d5d2b 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -1493,9 +1493,6 @@ static int blk_trace_remove_queue(struct request_queue *q)
1493 if (atomic_dec_and_test(&blk_probes_ref)) 1493 if (atomic_dec_and_test(&blk_probes_ref))
1494 blk_unregister_tracepoints(); 1494 blk_unregister_tracepoints();
1495 1495
1496 spin_lock_irq(&running_trace_lock);
1497 list_del(&bt->running_list);
1498 spin_unlock_irq(&running_trace_lock);
1499 blk_trace_free(bt); 1496 blk_trace_free(bt);
1500 return 0; 1497 return 0;
1501} 1498}