diff options
author | Arnd Bergmann <arnd@arndb.de> | 2009-11-07 01:52:32 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-07 01:52:32 -0500 |
commit | 50857e2a59d8beddc6bb76137df026d67f30d5ca (patch) | |
tree | 7b6d244ad6fa07ff199c7d1436750d535b6b8dcd /fs/compat_ioctl.c | |
parent | 2dceba14ef0e62738d58777a1bd4018130d47a74 (diff) |
net/tun: handle compat_ioctl directly
The tun driver is the only code in the kernel that operates
on a character device with struct ifreq. Change the driver
to handle the conversion itself so we can contain the
remaining ifreq handling in the socket layer.
This also fixes a bug in the handling of invalid ioctl
numbers on an unbound tun device. The driver treats this
as a TUNSETIFF in native mode, but there is no way for
the generic compat_ioctl() function to emulate this
behaviour. Possibly the driver was only doing this
accidentally anyway, but if any code relies on this
misfeature, it now also works in compat mode.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/compat_ioctl.c')
-rw-r--r-- | fs/compat_ioctl.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index f91fd51b32e3..c562e9a4da70 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
@@ -539,12 +539,6 @@ static int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long arg) | |||
539 | set_fs (old_fs); | 539 | set_fs (old_fs); |
540 | if (!err) { | 540 | if (!err) { |
541 | switch (cmd) { | 541 | switch (cmd) { |
542 | /* TUNSETIFF is defined as _IOW, it should be _IORW | ||
543 | * as the data is copied back to user space, but that | ||
544 | * cannot be fixed without breaking all existing apps. | ||
545 | */ | ||
546 | case TUNSETIFF: | ||
547 | case TUNGETIFF: | ||
548 | case SIOCGIFFLAGS: | 542 | case SIOCGIFFLAGS: |
549 | case SIOCGIFMETRIC: | 543 | case SIOCGIFMETRIC: |
550 | case SIOCGIFMTU: | 544 | case SIOCGIFMTU: |
@@ -1979,18 +1973,6 @@ COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND) | |||
1979 | COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST) | 1973 | COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST) |
1980 | COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI) | 1974 | COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI) |
1981 | #endif | 1975 | #endif |
1982 | /* Big T */ | ||
1983 | COMPATIBLE_IOCTL(TUNSETNOCSUM) | ||
1984 | COMPATIBLE_IOCTL(TUNSETDEBUG) | ||
1985 | COMPATIBLE_IOCTL(TUNSETPERSIST) | ||
1986 | COMPATIBLE_IOCTL(TUNSETOWNER) | ||
1987 | COMPATIBLE_IOCTL(TUNSETLINK) | ||
1988 | COMPATIBLE_IOCTL(TUNSETGROUP) | ||
1989 | COMPATIBLE_IOCTL(TUNGETFEATURES) | ||
1990 | COMPATIBLE_IOCTL(TUNSETOFFLOAD) | ||
1991 | COMPATIBLE_IOCTL(TUNSETTXFILTER) | ||
1992 | COMPATIBLE_IOCTL(TUNGETSNDBUF) | ||
1993 | COMPATIBLE_IOCTL(TUNSETSNDBUF) | ||
1994 | /* Big V */ | 1976 | /* Big V */ |
1995 | COMPATIBLE_IOCTL(VT_SETMODE) | 1977 | COMPATIBLE_IOCTL(VT_SETMODE) |
1996 | COMPATIBLE_IOCTL(VT_GETMODE) | 1978 | COMPATIBLE_IOCTL(VT_GETMODE) |
@@ -2571,8 +2553,6 @@ HANDLE_IOCTL(SIOCSIFPFLAGS, dev_ifsioc) | |||
2571 | HANDLE_IOCTL(SIOCGIFPFLAGS, dev_ifsioc) | 2553 | HANDLE_IOCTL(SIOCGIFPFLAGS, dev_ifsioc) |
2572 | HANDLE_IOCTL(SIOCGIFTXQLEN, dev_ifsioc) | 2554 | HANDLE_IOCTL(SIOCGIFTXQLEN, dev_ifsioc) |
2573 | HANDLE_IOCTL(SIOCSIFTXQLEN, dev_ifsioc) | 2555 | HANDLE_IOCTL(SIOCSIFTXQLEN, dev_ifsioc) |
2574 | HANDLE_IOCTL(TUNSETIFF, dev_ifsioc) | ||
2575 | HANDLE_IOCTL(TUNGETIFF, dev_ifsioc) | ||
2576 | HANDLE_IOCTL(SIOCETHTOOL, ethtool_ioctl) | 2556 | HANDLE_IOCTL(SIOCETHTOOL, ethtool_ioctl) |
2577 | HANDLE_IOCTL(SIOCBONDENSLAVE, bond_ioctl) | 2557 | HANDLE_IOCTL(SIOCBONDENSLAVE, bond_ioctl) |
2578 | HANDLE_IOCTL(SIOCBONDRELEASE, bond_ioctl) | 2558 | HANDLE_IOCTL(SIOCBONDRELEASE, bond_ioctl) |