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, 27 Apr 2007 00:08:58 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Paul Fulghum <paulkf@...rogate.com>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: compat_ioctl question

On Friday 27 April 2007, Paul Fulghum wrote:
> Arnd Bergmann wrote:
> > It depends a lot on what your specific driver does in the ioctl
> > handler, but normally you should define a compat_ioctl() function.
> > What driver are you talking about?
> 
> drivers/char/synclink.c
> drivers/char/synclinkmp.c
> drivers/char/synclink_gt.c
> drivers/char/pcmcia/synclink_cs.c
> 
> All use the same set of ioctl() codes that
> are peculiar to the synclink drivers.

So you are interested in the MGSL_* set of ioctls, right?
AFAICS, they are all compatible, with the exception of
MGSL_IOCGPARAMS and MGSL_IOCSPARAMS.

Fortunately, these two have different ioctl numbers on
64 bit, so you can define a new
 
#define MGSL_IOCSPARAMS32 _IOR(MGSL_MAGIC_IOC,0,struct _MGSL_PARAMS32)
#define MGSL_IOCGPARAMS32 _IOR(MGSL_MAGIC_IOC,1,struct _MGSL_PARAMS32)

and handle both versions in the ioctl function.

> Defining compat_ioctl() seems to be the best way, but
> that will require modifying the base tty code to allow
> the individual tty drivers to register compat_ioctl().

Yes, that would be the right solution. I've started this
some time ago, but never finished it:
http://www.uwsg.iu.edu/hypermail/linux/kernel/0511.0/1732.html

> Currently the tty file ops do not include that and
> tty_io.c does not register a compat_ioctl(), instead
> relying on compat_ioctl.h and compat_ioctl.c

Just adding the hook in tty_io.c should be trivial, please do that.
If you like, you can also move the vt ioctls in order to reduce
the size of fs/compat_ioctl.c.

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