Re: [PATCH] loop: mask loop_control_ioctl parameter only as minor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Nov 18, 2021, at 22:51, Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> 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() ?
I just think ioctl paramter need to make sense. 

Perhaps block layer need add/update/del check for consistency, but as inner interface caller check is also agreeable.

By the way, do other driver have similar problems?





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux