blktrace: fix unlocked access to init/start-stop/teardown

commit 1f2cac107c 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: 6da127ad09 ("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>
This commit is contained in:
Jens Axboe 2017-11-05 09:13:48 -07:00 • committed by Ben Hutchings
commit 0dea4044c7