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]
Date:	Fri, 28 Nov 2008 22:33:05 +0000
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Keith Packard <keithp@...thp.com>
Cc:	linux-kernel@...r.kernel.org, Greg Kroah-Hartman <gregkh@...e.de>,
	Keith Packard <keithp@...thp.com>
Subject: Re: [PATCH] usb/serial: Add compat_ioctl pass-through

On Fri, 28 Nov 2008 14:28:02 -0800
Keith Packard <keithp@...thp.com> wrote:

> USB serial devices with extended IOCTLs cannot be used in a 64-bit kernel
> from 32-bit user space as the compat_ioctl path is missing. This adds a
> pass-through so that drivers may offer this functionality. This requires
> that all drivers actually implement a compat_ioctl function if they want to
> support this operation.
> 
> Signed-off-by: Keith Packard <keithp@...thp.com>

Would be far better to keep compatible ioctls anyway however that aside
clearly it should be passed on.

> +static int serial_compat_ioctl(struct tty_struct *tty, struct file *file,
> +			       unsigned int cmd, unsigned long arg)
> +{
> +	struct usb_serial_port *port = tty->driver_data;
> +	int retval = -ENODEV;

Can never be used only overwritten so why not replace with -ENOIOCTLCMD
and remove the else of the if

Also I get a CodingStyle whine about the port->serial-> side of the if
not needing { }

> +	/* Called with bkl held */
>  	int  (*ioctl)(struct tty_struct *tty, struct file *file,
>  		      unsigned int cmd, unsigned long arg);

No... the ioctl path for tty comes from unlocked_ioctl so the BKL is not
held and should not be held.

Alan
--
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