linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/7] block: fix blktrace debugfs use after free
@ 2020-05-16  3:19 Luis Chamberlain
  2020-05-16  3:19 ` [PATCH v5 1/7] block: add docs for gendisk / request_queue refcount helpers Luis Chamberlain
                   ` (6 more replies)
  0 siblings, 7 replies; 24+ messages in thread
From: Luis Chamberlain @ 2020-05-16  3:19 UTC (permalink / raw)
  To: axboe, viro, bvanassche, gregkh, rostedt, mingo, jack, ming.lei,
	nstange, akpm
  Cc: mhocko, yukuai3, linux-block, linux-fsdevel, linux-mm,
	linux-kernel, Luis Chamberlain

On this v5 I've split up the first patch into 3, one for comments,
another for context / might_sleep() updates, and the last the big
revert back to synchronous request_queue removal. I didn't update
the context for the put / decrements for gendisk & request_queue
as they would be updated in the next patch.

Since the first 3 patches are a reflection of the original one, I've
left the Reviewed-by's collected in place.

I've changed the kzalloc() / snprintf() to just kasprintf() as requested
by Bart. Since it was not clear that we don't have the bdev on
do_blk_trace_setup() for the patch titled "blktrace: break out of
blktrace setup on concurrent calls", I've added a comment so that
someone doesn't later try to add a dev_printk() or the like.

I've also addressed a compilation issue with debugfs disabled reported
by 0-day on the patch titled "blktrace: fix debugfs use after free". It
was missing a "static inline" on a function. I've also moved the new
declarations underneath the "#ifdef CONFIG_BLOCK" on include/linux/genhd.h,
I previously had them outside of this block.

I've left in place the scsi-generic blktrace suppport given I didn't receive any
feedback to kill it. This ensures this works as it used to.

Since these are minor changes I've given this a spin with break-blktrace
tests I have written and also ran blktrace with a scsi-generic media
changer. Both sg0 (the controller) and sg1 worked as expected.

These changes are based on linux-next tag next-20200515, and can also be
found on my git tree:

https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/log/?h=20200515-blktrace-fixes

Luis Chamberlain (7):
  block: add docs for gendisk / request_queue refcount helpers
  block: clarify context for gendisk / request_queue refcount increment
    helpers
  block: revert back to synchronous request_queue removal
  block: move main block debugfs initialization to its own file
  blktrace: fix debugfs use after free
  blktrace: break out of blktrace setup on concurrent calls
  loop: be paranoid on exit and prevent new additions / removals

 block/Makefile               |  10 +-
 block/blk-core.c             |  32 ++++--
 block/blk-debugfs.c          | 197 +++++++++++++++++++++++++++++++++++
 block/blk-mq-debugfs.c       |   5 -
 block/blk-sysfs.c            |  46 ++++----
 block/blk.h                  |  24 +++++
 block/bsg.c                  |   2 +
 block/genhd.c                |  73 ++++++++++++-
 block/partitions/core.c      |   9 ++
 drivers/block/loop.c         |   4 +
 drivers/scsi/ch.c            |   1 +
 drivers/scsi/sg.c            |  75 +++++++++++++
 drivers/scsi/st.c            |   2 +
 include/linux/blkdev.h       |   6 +-
 include/linux/blktrace_api.h |   1 -
 include/linux/genhd.h        |  69 ++++++++++++
 kernel/trace/blktrace.c      |  37 +++++--
 17 files changed, 545 insertions(+), 48 deletions(-)
 create mode 100644 block/blk-debugfs.c

-- 
2.26.2


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-06-05 22:33 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-16  3:19 [PATCH v5 0/7] block: fix blktrace debugfs use after free Luis Chamberlain
2020-05-16  3:19 ` [PATCH v5 1/7] block: add docs for gendisk / request_queue refcount helpers Luis Chamberlain
2020-05-16  3:19 ` [PATCH v5 2/7] block: clarify context for gendisk / request_queue refcount increment helpers Luis Chamberlain
2020-05-16  3:19 ` [PATCH v5 3/7] block: revert back to synchronous request_queue removal Luis Chamberlain
2020-05-16  3:19 ` [PATCH v5 4/7] block: move main block debugfs initialization to its own file Luis Chamberlain
2020-05-19 15:33   ` Christoph Hellwig
2020-05-16  3:19 ` [PATCH v5 5/7] blktrace: fix debugfs use after free Luis Chamberlain
2020-05-19 14:44   ` Greg KH
2020-05-19 15:52     ` Luis Chamberlain
2020-05-19 17:03       ` Greg KH
2020-05-19 16:37   ` Christoph Hellwig
2020-05-19 16:54     ` Greg KH
2020-05-27  3:12     ` Luis Chamberlain
2020-05-28  1:15       ` Bart Van Assche
2020-05-29  7:56         ` Luis Chamberlain
2020-05-29 14:09           ` Bart Van Assche
2020-06-01 17:05       ` Luis Chamberlain
2020-06-05  4:48         ` Bart Van Assche
2020-06-05 22:33           ` Luis Chamberlain
2020-05-16  3:19 ` [PATCH v5 6/7] blktrace: break out of blktrace setup on concurrent calls Luis Chamberlain
2020-05-19 15:37   ` Christoph Hellwig
2020-05-19 16:10   ` Bart Van Assche
2020-05-16  3:19 ` [PATCH v5 7/7] loop: be paranoid on exit and prevent new additions / removals Luis Chamberlain
2020-05-19 15:36   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).