linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org
Subject: Re: [PATCH] block: genhd: fix double kfree() in __alloc_disk_node()
Date: Mon, 20 Sep 2021 17:02:19 +0900	[thread overview]
Message-ID: <c5b78df8-1ab7-04fa-d6e8-c7270c3bc373@i-love.sakura.ne.jp> (raw)
In-Reply-To: <20210920064028.GB26999@lst.de>

On 2021/09/20 15:40, Christoph Hellwig wrote:
> I was going to suggest to just move the bd_disk initialization after
> the bd_stats allocations,  but iseems like we currently don't even
> the zero the bdev on allocation.  So I suspect we should do that first
> to avoid nasty surprises.

Hmm? bdev_alloc_inode() zeros the bdev on allocation.
Are you talking about some other function?

static struct inode *bdev_alloc_inode(struct super_block *sb)
{
	struct bdev_inode *ei = kmem_cache_alloc(bdev_cachep, GFP_KERNEL);

	if (!ei)
		return NULL;
	memset(&ei->bdev, 0, sizeof(ei->bdev));
	return &ei->vfs_inode;
}

  reply	other threads:[~2021-09-20  8:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-19 13:35 [syzbot] KASAN: use-after-free Read in bdev_free_inode syzbot
2021-09-19 13:37 ` Tetsuo Handa
2021-09-19 14:44   ` [PATCH] block: genhd: fix double kfree() in __alloc_disk_node() Tetsuo Handa
2021-09-20  6:40     ` Christoph Hellwig
2021-09-20  8:02       ` Tetsuo Handa [this message]
2021-09-20  8:05         ` Christoph Hellwig
2021-09-20  8:31           ` [PATCH v2] " Tetsuo Handa
2021-09-20  8:40             ` Christoph Hellwig
2021-10-09  4:53 ` [syzbot] KASAN: use-after-free Read in bdev_free_inode syzbot

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=c5b78df8-1ab7-04fa-d6e8-c7270c3bc373@i-love.sakura.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    /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 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).