Skip to content

Commit 7eca210

Browse files
ariavaaxboe
authored andcommitted
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>
1 parent 959f5f5 commit 7eca210

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

‎kernel/trace/blktrace.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,9 +1493,6 @@ static int blk_trace_remove_queue(struct request_queue *q)
14931493
if (atomic_dec_and_test(&blk_probes_ref))
14941494
blk_unregister_tracepoints();
14951495

1496-
spin_lock_irq(&running_trace_lock);
1497-
list_del(&bt->running_list);
1498-
spin_unlock_irq(&running_trace_lock);
14991496
blk_trace_free(bt);
15001497
return 0;
15011498
}

0 commit comments

Comments
 (0)