Skip to content

Commit 0f62edb

Browse files
axboegregkh
authored andcommitted
blktrace: fix trace mutex deadlock
commit 2967acb upstream. A previous commit changed the locking around registration/cleanup, but direct callers of blk_trace_remove() were missed. This means that if we hit the error path in setup, we will deadlock on attempting to re-acquire the queue trace mutex. Fixes: 1f2cac1 ("blktrace: fix unlocked access to init/start-stop/teardown") Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 0ef5b09 commit 0f62edb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/trace/blktrace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ static int __blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
572572
return ret;
573573

574574
if (copy_to_user(arg, &buts, sizeof(buts))) {
575-
blk_trace_remove(q);
575+
__blk_trace_remove(q);
576576
return -EFAULT;
577577
}
578578
return 0;
@@ -618,7 +618,7 @@ static int compat_blk_trace_setup(struct request_queue *q, char *name,
618618
return ret;
619619

620620
if (copy_to_user(arg, &buts.name, ARRAY_SIZE(buts.name))) {
621-
blk_trace_remove(q);
621+
__blk_trace_remove(q);
622622
return -EFAULT;
623623
}
624624

0 commit comments

Comments
 (0)