blktrace: fix unlocked access to init/start-stop/teardown
authorJens Axboe <axboe@kernel.dk>
Sun, 5 Nov 2017 16:13:48 +0000 (09:13 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 13 Feb 2018 18:32:15 +0000 (18:32 +0000)
commitf6f7fd4a1b04fcc387cf999eae98422bbe944c65
tree3014f77edb09b7ac55c0099f9f33494374dd1406
parent699350953b69f487bd920accab21fabea79b7cf0
blktrace: fix unlocked access to init/start-stop/teardown

commit 1f2cac107c591c24b60b115d6050adc213d10fc0 upstream.

sg.c calls into the blktrace functions without holding the proper queue
mutex for doing setup, start/stop, or teardown.

Add internal unlocked variants, and export the ones that do the proper
locking.

Fixes: 6da127ad0918 ("blktrace: Add blktrace ioctls to SCSI generic devices")
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
kernel/trace/blktrace.c