lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <op.veh043ad7p4s8u@pikus>
Date:	Fri, 18 Jun 2010 15:59:17 +0200
From:	Michał Nazarewicz <m.nazarewicz@...sung.com>
To:	Greg KH <gregkh@...e.de>, Arnd Bergmann <arnd@...db.de>
Cc:	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
	Frederic Weisbecker <fweisbec@...il.com>,
	John Kacur <jkacur@...hat.com>,
	Andi Kleen <andi@...stfloor.org>,
	David Brownell <dbrownell@...rs.sourceforge.net>
Subject: Re: [PATCH 5/6] usb/gadget: Do not take BKL for gadget->ops->ioctl

On Tue, 01 Jun 2010 23:04:44 +0200, Arnd Bergmann <arnd@...db.de> wrote:
> There is no gadget driver in the tree that
> actually implements the ioctl operation, so
> obviously it is not necessary to hold the
> BKL around the call.

Should the callback in ops be renamed to unlocked_ioctl then as to not
create confusion? Just a thought.

> --- a/drivers/usb/gadget/f_fs.c
> +++ b/drivers/usb/gadget/f_fs.c
> @@ -714,9 +714,7 @@ static long ffs_ep0_ioctl(struct file *file, unsigned code, unsigned long value)
>  		struct ffs_function *func = ffs->func;
>  		ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV;
>  	} else if (gadget->ops->ioctl) {
> -		lock_kernel();
>  		ret = gadget->ops->ioctl(gadget, code, value);
> -		unlock_kernel();
>  	} else {
>  		ret = -ENOTTY;
>  	}

> --- a/drivers/usb/gadget/inode.c
> +++ b/drivers/usb/gadget/inode.c
> @@ -1299,11 +1299,9 @@ static long dev_ioctl (struct file *fd, unsigned code, unsigned long value)
>  	struct usb_gadget	*gadget = dev->gadget;
>  	long ret = -ENOTTY;
>-	if (gadget->ops->ioctl) {
> -		lock_kernel();
> +	if (gadget->ops->ioctl)
>  		ret = gadget->ops->ioctl (gadget, code, value);
> -		unlock_kernel();
> -	}
> +
>  	return ret;
>  }

-- 
Best regards,                                        _     _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=./ `o
| Computer Science,  Michał "mina86" Nazarewicz       (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ