All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: harshit.m.mogalapalli@gmail.com, error27@gmail.com, hch@lst.de,
	Richard Weinberger <richard@nod.at>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH linux-next] ubi: block: Fix a possible use-after-free bug in ubiblock_create()
Date: Tue, 14 Feb 2023 15:10:47 +0100	[thread overview]
Message-ID: <20230214141047.GA13930@lst.de> (raw)
In-Reply-To: <20230214093801.1267044-1-harshit.m.mogalapalli@oracle.com>

On Tue, Feb 14, 2023 at 01:38:01AM -0800, Harshit Mogalapalli wrote:
> Smatch warns:
> 	drivers/mtd/ubi/block.c:438 ubiblock_create()
> 	warn: '&dev->list' not removed from list
> 
> 'dev' is freed in 'out_free_dev:, but it is still on the list.
> 
> To fix this, delete the list item before freeing.
> 
> Fixes: 91cc8fbcc8c7 ("ubi: block: set BLK_MQ_F_BLOCKING")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>

Thanks, this looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@lst.de>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: harshit.m.mogalapalli@gmail.com, error27@gmail.com, hch@lst.de,
	Richard Weinberger <richard@nod.at>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH linux-next] ubi: block: Fix a possible use-after-free bug in ubiblock_create()
Date: Tue, 14 Feb 2023 15:10:47 +0100	[thread overview]
Message-ID: <20230214141047.GA13930@lst.de> (raw)
In-Reply-To: <20230214093801.1267044-1-harshit.m.mogalapalli@oracle.com>

On Tue, Feb 14, 2023 at 01:38:01AM -0800, Harshit Mogalapalli wrote:
> Smatch warns:
> 	drivers/mtd/ubi/block.c:438 ubiblock_create()
> 	warn: '&dev->list' not removed from list
> 
> 'dev' is freed in 'out_free_dev:, but it is still on the list.
> 
> To fix this, delete the list item before freeing.
> 
> Fixes: 91cc8fbcc8c7 ("ubi: block: set BLK_MQ_F_BLOCKING")
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>

Thanks, this looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

  parent reply	other threads:[~2023-02-14 14:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  9:38 [PATCH linux-next] ubi: block: Fix a possible use-after-free bug in ubiblock_create() Harshit Mogalapalli
2023-02-14  9:38 ` Harshit Mogalapalli
2023-02-14  9:47 ` Richard Weinberger
2023-02-14  9:47   ` Richard Weinberger
2023-02-14 14:10 ` Christoph Hellwig [this message]
2023-02-14 14:10   ` Christoph Hellwig

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=20230214141047.GA13930@lst.de \
    --to=hch@lst.de \
    --cc=error27@gmail.com \
    --cc=harshit.m.mogalapalli@gmail.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.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.