aboutsummaryrefslogtreecommitdiffstats
path: root/net/appletalk
diff options
context:
space:
mode:
authorPetr Vandrovec <petr@vandrovec.name>2006-03-28 02:39:31 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-03-28 20:02:43 -0500
commitf6c90b71a355a0a4a22e1cfee5748617adc25a53 (patch)
tree2fdbe51a57e25a781128ce4a8c85375201221ded /net/appletalk
parentf1465f7ea9e7aecba8e41d4aac9240f9b7fe2e24 (diff)
[NET]: Fix ipx/econet/appletalk/irda ioctl crashes
Fix kernel oopses whenever somebody issues compatible ioctl on AppleTalk, Econet, IPX or IRDA socket. For AppleTalk/Econet/IRDA it restores state in which these sockets were before compat_ioctl was introduced to the socket ops, for IPX it implements support for 4 ioctls which were not implemented before - as these ioctls use structures which match between 32bit and 64bit userspace, no special code is needed, just call 64bit ioctl handler. Signed-off-by: Petr Vandrovec <petr@vandrovec.name> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/appletalk')
-rw-r--r--net/appletalk/ddp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index 697ac55e29dc..7b1eb9a4fc96 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -1819,6 +1819,22 @@ static int atalk_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
1819 return rc; 1819 return rc;
1820} 1820}
1821 1821
1822
1823#ifdef CONFIG_COMPAT
1824static int atalk_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
1825{
1826 /*
1827 * All Appletalk ioctls except SIOCATALKDIFADDR are standard. And
1828 * SIOCATALKDIFADDR is handled by upper layer as well, so there is
1829 * nothing to do. Eventually SIOCATALKDIFADDR should be moved
1830 * here so there is no generic SIOCPROTOPRIVATE translation in the
1831 * system.
1832 */
1833 return -ENOIOCTLCMD;
1834}
1835#endif
1836
1837
1822static struct net_proto_family atalk_family_ops = { 1838static struct net_proto_family atalk_family_ops = {
1823 .family = PF_APPLETALK, 1839 .family = PF_APPLETALK,
1824 .create = atalk_create, 1840 .create = atalk_create,
@@ -1836,6 +1852,9 @@ static const struct proto_ops SOCKOPS_WRAPPED(atalk_dgram_ops) = {
1836 .getname = atalk_getname, 1852 .getname = atalk_getname,
1837 .poll = datagram_poll, 1853 .poll = datagram_poll,
1838 .ioctl = atalk_ioctl, 1854 .ioctl = atalk_ioctl,
1855#ifdef CONFIG_COMPAT
1856 .compat_ioctl = atalk_compat_ioctl,
1857#endif
1839 .listen = sock_no_listen, 1858 .listen = sock_no_listen,
1840 .shutdown = sock_no_shutdown, 1859 .shutdown = sock_no_shutdown,
1841 .setsockopt = sock_no_setsockopt, 1860 .setsockopt = sock_no_setsockopt,