All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	linux-block <linux-block@vger.kernel.org>
Subject: Re: [PATCH] block: use "unsigned long" for blk_validate_block_size()
Date: Fri, 17 Dec 2021 09:25:08 -0700	[thread overview]
Message-ID: <b114e2c8-d5c2-c2e8-9aeb-c18eaba52de0@kernel.dk> (raw)
In-Reply-To: <f81aaa2b-16c4-6e20-8a13-33f0a7d319d1@i-love.sakura.ne.jp>

On 12/17/21 4:38 AM, Tetsuo Handa wrote:
> Use of "unsigned short" for loop_validate_block_size() is wrong [1], and
> commit af3c570fb0df422b ("loop: Use blk_validate_block_size() to validate
> block size") changed to use "unsigned int".
> 
> However, since lo_simple_ioctl(LOOP_SET_BLOCK_SIZE) passes "unsigned long
> arg" to loop_set_block_size(), blk_validate_block_size() can't validate
> the upper 32bits on 64bits environment. A block size like 0x100000200
> should be rejected.

Wouldn't it make more sense to validate that part on the loop side? A
block size > 32-bit doesn't make any sense.

-- 
Jens Axboe


  reply	other threads:[~2021-12-17 16:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 11:38 [PATCH] block: use "unsigned long" for blk_validate_block_size() Tetsuo Handa
2021-12-17 16:25 ` Jens Axboe [this message]
2021-12-17 18:09   ` Tetsuo Handa
2021-12-18  1:32     ` Tetsuo Handa
2021-12-18  9:41       ` [PATCH v2] " Tetsuo Handa
2021-12-21 16:20         ` Christoph Hellwig
2021-12-21 16:33         ` Jens Axboe

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=b114e2c8-d5c2-c2e8-9aeb-c18eaba52de0@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    /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.