]> www.infradead.org Git - users/hch/misc.git/commit
blktrace: move copy_[to|from]_user() out of ->debugfs_lock
authorMing Lei <ming.lei@redhat.com>
Thu, 28 Nov 2024 12:50:27 +0000 (20:50 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Dec 2024 13:58:30 +0000 (06:58 -0700)
commitd70393faca7a0006b588a26f7cd4c53ba4ad3da6
treee03e39d32db753ce27d8c2f0dd88ec5c8da09c5a
parent35a5351e903a7441811792e29c2728c3020861ee
blktrace: move copy_[to|from]_user() out of ->debugfs_lock

Move copy_[to|from]_user() out of ->debugfs_lock and cut the dependency
between mm->mmap_lock and q->debugfs_lock, then we avoids lots of
lockdep false positive warning. Obviously ->debug_lock isn't needed
for copy_[to|from]_user().

The only behavior change is to call blk_trace_remove() in case of setup
failure handling by re-grabbing ->debugfs_lock, and this way is just
fine since we do cover concurrent setup() & remove().

Reported-by: syzbot+91585b36b538053343e4@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-block/67450fd4.050a0220.1286eb.0007.GAE@google.com/
Closes: https://lore.kernel.org/linux-block/6742e584.050a0220.1cc393.0038.GAE@google.com/
Closes: https://lore.kernel.org/linux-block/6742a600.050a0220.1cc393.002e.GAE@google.com/
Closes: https://lore.kernel.org/linux-block/67420102.050a0220.1cc393.0019.GAE@google.com/
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20241128125029.4152292-3-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
kernel/trace/blktrace.c