All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: linux-block@vger.kernel.org, wangyangbo <yangbonis@icloud.com>,
	axboe@kernel.dk
Subject: Re: [PATCH] loop: mask loop_control_ioctl parameter only as minor
Date: Thu, 18 Nov 2021 23:51:21 +0900	[thread overview]
Message-ID: <1ebd5c91-442c-1ab0-f71f-0feff04e37f5@i-love.sakura.ne.jp> (raw)
In-Reply-To: <c685d6dc-3918-6ee5-df59-f2d814635228@I-love.SAKURA.ne.jp>

On 2021/11/18 23:15, Tetsuo Handa wrote:
> On 2021/11/18 11:36, wangyangbo wrote:
>> @@ -2170,11 +2170,11 @@ static long loop_control_ioctl(struct file *file, unsigned int cmd,
>>  {
>>  	switch (cmd) {
>>  	case LOOP_CTL_ADD:
>> -		return loop_add(parm);
>> +		return loop_add(MINOR(parm));
> 
> Better to return -EINVAL or something if out of minor range?

Well, this is not specific to loop devices.
Shouldn't the minor range be checked by device_add_disk() ?

  reply	other threads:[~2021-11-18 14:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18  2:36 [PATCH] loop: mask loop_control_ioctl parameter only as minor wangyangbo
2021-11-18 14:15 ` Tetsuo Handa
2021-11-18 14:51   ` Tetsuo Handa [this message]
2021-11-18 15:21     ` wang yangbo
2021-11-19  7:15     ` Christoph Hellwig
2021-11-19  1:50   ` wangyangbo
2021-11-19  2:24 ` [PATCH] loop: check loop_control_ioctl parameter in range of minor wangyangbo
2021-11-19  2:32 ` [PATCH v2] " wangyangbo

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=1ebd5c91-442c-1ab0-f71f-0feff04e37f5@i-love.sakura.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=yangbonis@icloud.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.