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

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

 



On Thu, Nov 18, 2021 at 11:51:21PM +0900, Tetsuo Handa 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() ?

Yes, that probably makes sense.



[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