All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Christoph Hellwig <hch@infradead.org>,
	axboe@kernel.dk, viro@zeniv.linux.org.uk, bvanassche@acm.org,
	rostedt@goodmis.org, mingo@redhat.com, jack@suse.cz,
	ming.lei@redhat.com, nstange@suse.de, akpm@linux-foundation.org,
	mhocko@suse.com, yukuai3@huawei.com, linux-block@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Omar Sandoval <osandov@fb.com>,
	Hannes Reinecke <hare@suse.com>, Michal Hocko <mhocko@kernel.org>,
	syzbot+603294af2d01acfdd6da@syzkaller.appspotmail.com
Subject: Re: [PATCH v3 4/6] blktrace: fix debugfs use after free
Date: Fri, 1 May 2020 15:24:45 +0000	[thread overview]
Message-ID: <20200501152445.GN11244@42.do-not-panic.com> (raw)
In-Reply-To: <20200429125726.GA2123334@kroah.com>

On Wed, Apr 29, 2020 at 02:57:26PM +0200, Greg KH wrote:
> On Wed, Apr 29, 2020 at 12:21:52PM +0000, Luis Chamberlain wrote:
> > On Wed, Apr 29, 2020 at 05:04:06AM -0700, Christoph Hellwig wrote:
> > > On Wed, Apr 29, 2020 at 12:02:30PM +0000, Luis Chamberlain wrote:
> > > > > Err, that function is static and has two callers.
> > > > 
> > > > Yes but that is to make it easier to look for who is creating the
> > > > debugfs_dir for either the request_queue or partition. I'll export
> > > > blk_debugfs_root and we'll open code all this.
> > > 
> > > No, please not.  exported variables are usually a bad idea.  Just
> > > skip the somewhat pointless trivial static function.
> > 
> > Alrighty. It has me thinking we might want to only export those symbols
> > to a specific namespace. Thoughts, preferences?
> > 
> > BLOCK_GENHD_PRIVATE ?
> 
> That's a nice add-on issue after this is fixed.  As Christoph and I
> pointed out, you have _less_ code in the file if you remove the static
> wrapper function.  Do that now and then worry about symbol namespaces
> please.

So it turns out that in the old implementation, it was implicit that the
request_queue directory was shared with the scsi drive. So, the
q->debugfs_dir *will* be set, and as we have it here', we'd silently be
overwriting the old q->debugfs_dir, as the queue is the same. To keep
things working as it used to, with both, we just need to use a symlink
here. With the old way, we'd *always* create the sg directory and re-use
that, however since we can only have one blktrace per request_queue, it
still had the same restriction, this was just implicit. Using a symlink
will make this much more obvious and upkeep the old functionality. We'll
need to only export one symbol. I'll roll this in.

  Luis

  reply	other threads:[~2020-05-01 15:24 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29  7:46 [PATCH v3 0/6] block: fix blktrace debugfs use after free Luis Chamberlain
2020-04-29  7:46 ` [PATCH v3 1/6] block: revert back to synchronous request_queue removal Luis Chamberlain
2020-04-29 11:15   ` Christoph Hellwig
2020-05-02  0:22   ` Bart Van Assche
2020-05-03 10:32     ` Matthew Wilcox
2020-05-04 16:18       ` Luis Chamberlain
2020-05-04 16:16     ` Luis Chamberlain
2020-04-29  7:46 ` [PATCH v3 2/6] block: move main block debugfs initialization to its own file Luis Chamberlain
2020-04-29 11:15   ` Christoph Hellwig
2020-04-29  7:46 ` [PATCH v3 3/6] blktrace: move blktrace debugfs creation to helper function Luis Chamberlain
2020-04-29 11:20   ` Christoph Hellwig
2020-05-02  0:25   ` Bart Van Assche
2020-04-29  7:46 ` [PATCH v3 4/6] blktrace: fix debugfs use after free Luis Chamberlain
2020-04-29  9:47   ` Greg KH
2020-04-29 11:26   ` Christoph Hellwig
2020-04-29 11:45     ` Luis Chamberlain
2020-04-29 11:50       ` Christoph Hellwig
2020-04-29 12:02         ` Luis Chamberlain
2020-04-29 12:04           ` Christoph Hellwig
2020-04-29 12:21             ` Luis Chamberlain
2020-04-29 12:57               ` Greg KH
2020-05-01 15:24                 ` Luis Chamberlain [this message]
2020-05-07 11:30   ` [blktrace] d106a3fdba: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2020-05-07 11:30     ` [blktrace] d106a3fdba: BUG:kernel_NULL_pointer_dereference, address kernel test robot
2020-04-29  7:46 ` [PATCH v3 5/6] blktrace: break out of blktrace setup on concurrent calls Luis Chamberlain
2020-04-29  9:49   ` Greg KH
2020-05-01 15:06     ` Luis Chamberlain
2020-05-01 15:34       ` Christoph Hellwig
2020-05-01 15:40         ` Luis Chamberlain
2020-05-01 15:50           ` Luis Chamberlain
2020-05-01 15:50             ` Luis Chamberlain
2020-05-01 16:51       ` Greg KH
2020-04-29  7:46 ` [PATCH v3 6/6] loop: be paranoid on exit and prevent new additions / removals Luis Chamberlain
2020-04-29  9:50   ` Greg KH
2020-05-03  9:09     ` Luis Chamberlain
2020-04-29 14:05   ` Ming Lei
2020-04-29  8:48 [PATCH v3 4/6] blktrace: fix debugfs use after free Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200501152445.GN11244@42.do-not-panic.com \
    --to=mcgrof@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hare@suse.com \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mhocko@suse.com \
    --cc=ming.lei@redhat.com \
    --cc=mingo@redhat.com \
    --cc=nstange@suse.de \
    --cc=osandov@fb.com \
    --cc=rostedt@goodmis.org \
    --cc=syzbot+603294af2d01acfdd6da@syzkaller.appspotmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.