From: Shreyansh Chouhan <chouhan.shreyansh630@gmail.com>
To: axboe@kernel.dk, hch@infradead.org
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
syzbot+cf89d662483d6a1a0790@syzkaller.appspotmail.com
Subject: Re: [PATCH v2] loop: fix setting arbitrarily large block size
Date: Tue, 20 Jul 2021 12:55:07 +0530 [thread overview]
Message-ID: <YPZ6U29ci0xjIQ/O@fedora> (raw)
In-Reply-To: <20210626082406.348821-1-chouhan.shreyansh630@gmail.com>
Hi,
Pinging for review since there has been no activity on this
patch for some time.
Thank you,
Shreyansh Chouhan
On Sat, Jun 26, 2021 at 01:54:06PM +0530, Shreyansh Chouhan wrote:
>
> loop_validate_block_size took an unsigned short argument. Passing an
> argument with size greater than the size of unsigned short would cause
> an overflow and could potentially render the upper bound check on the
> block size useless, allowing to set an arbitrarily large block size.
>
> Reported-by: syzbot+cf89d662483d6a1a0790@syzkaller.appspotmail.com
> Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh630@gmail.com>
> ---
>
> Changes from v1: Fixed the spelling of reported-by tag. Fixed the
> commit message.
>
> drivers/block/loop.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> index 9a758cf66507..635baff0dd66 100644
> --- a/drivers/block/loop.c
> +++ b/drivers/block/loop.c
> @@ -236,7 +236,7 @@ static void __loop_update_dio(struct loop_device *lo, bool dio)
> * @bsize: size to validate
> */
> static int
> -loop_validate_block_size(unsigned short bsize)
> +loop_validate_block_size(unsigned long bsize)
> {
> if (bsize < 512 || bsize > PAGE_SIZE || !is_power_of_2(bsize))
> return -EINVAL;
> --
> 2.31.1
>
next prev parent reply other threads:[~2021-07-20 7:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-22 16:10 [PATCH] loop: fix setting arbitrarily large block size Shreyansh Chouhan
2021-06-23 5:09 ` [RESEND PATCH] " Shreyansh Chouhan
2021-06-24 6:14 ` Christoph Hellwig
2021-06-26 8:24 ` [PATCH v2] " Shreyansh Chouhan
2021-06-28 5:34 ` Christoph Hellwig
2021-07-20 7:25 ` Shreyansh Chouhan [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-07-14 20:34 Shreyansh Chouhan
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=YPZ6U29ci0xjIQ/O@fedora \
--to=chouhan.shreyansh630@gmail.com \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+cf89d662483d6a1a0790@syzkaller.appspotmail.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.