From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Damien Le Moal <damien.lemoal@wdc.com>
Cc: stable@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Subject: Re: [PATCH] null_blk: Fix zone size initialization
Date: Mon, 4 Jan 2021 13:25:23 +0100 [thread overview]
Message-ID: <X/MJM2cLKxnCeJcI@kroah.com> (raw)
In-Reply-To: <20210104121147.809755-1-damien.lemoal@wdc.com>
On Mon, Jan 04, 2021 at 09:11:47PM +0900, Damien Le Moal wrote:
> commit 0ebcdd702f49aeb0ad2e2d894f8c124a0acc6e23 upstream.
>
> For a null_blk device with zoned mode enabled is currently initialized
> with a number of zones equal to the device capacity divided by the zone
> size, without considering if the device capacity is a multiple of the
> zone size. If the zone size is not a divisor of the capacity, the zones
> end up not covering the entire capacity, potentially resulting is out
> of bounds accesses to the zone array.
>
> Fix this by adding one last smaller zone with a size equal to the
> remainder of the disk capacity divided by the zone size if the capacity
> is not a multiple of the zone size. For such smaller last zone, the zone
> capacity is also checked so that it does not exceed the smaller zone
> size.
>
> Reported-by: Naohiro Aota <naohiro.aota@wdc.com>
> Fixes: ca4b2a011948 ("null_blk: add zone support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
> drivers/block/null_blk_zoned.c | 20 +++++++++++++-------
> 1 file changed, 13 insertions(+), 7 deletions(-)
That worked, thanks!
greg k-h
next prev parent reply other threads:[~2021-01-04 12:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-28 11:49 FAILED: patch "[PATCH] null_blk: Fix zone size initialization" failed to apply to 4.19-stable tree gregkh
2021-01-04 6:11 ` [PATCH] null_blk: Fix zone size initialization Damien Le Moal
2021-01-04 6:14 ` FAILED: patch "[PATCH] null_blk: Fix zone size initialization" failed to apply to 4.19-stable tree Damien Le Moal
2021-01-04 10:52 ` gregkh
2021-01-04 11:54 ` Damien Le Moal
2021-01-04 12:11 ` [PATCH] null_blk: Fix zone size initialization Damien Le Moal
2021-01-04 12:25 ` Greg Kroah-Hartman [this message]
2021-01-04 12:13 ` FAILED: patch "[PATCH] null_blk: Fix zone size initialization" failed to apply to 4.19-stable tree Damien Le Moal
-- strict thread matches above, loose matches on Subject: below --
2020-12-28 11:49 FAILED: patch "[PATCH] null_blk: Fix zone size initialization" failed to apply to 5.4-stable tree gregkh
2021-01-04 6:10 ` [PATCH] null_blk: Fix zone size initialization Damien Le Moal
2021-01-04 10:53 ` Greg Kroah-Hartman
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=X/MJM2cLKxnCeJcI@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=axboe@kernel.dk \
--cc=damien.lemoal@wdc.com \
--cc=stable@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 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.