diff options
author | Shaun Pereira <spereira@tusc.com.au> | 2006-03-22 02:58:08 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-03-22 02:58:08 -0500 |
commit | 89bbfc95d65839d6ae23ddab8a3cc5af4ae88383 (patch) | |
tree | f2d5e55533f07109680d7ed7e56cc85222703c69 /net | |
parent | 67b52e554ba973947704fcb4fc284d7bab9ab931 (diff) |
[NET]: allow 32 bit socket ioctl in 64 bit kernel
Since the register_ioctl32_conversion() patch in the kernel is now obsolete,
provide another method to allow 32 bit user space ioctls to reach the kernel.
Signed-off-by: Shaun Pereira <spereira@tusc.com.au>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/socket.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/socket.c b/net/socket.c index e3c21d5ec288..e2d5bae994de 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -107,6 +107,10 @@ static unsigned int sock_poll(struct file *file, | |||
107 | struct poll_table_struct *wait); | 107 | struct poll_table_struct *wait); |
108 | static long sock_ioctl(struct file *file, | 108 | static long sock_ioctl(struct file *file, |
109 | unsigned int cmd, unsigned long arg); | 109 | unsigned int cmd, unsigned long arg); |
110 | #ifdef CONFIG_COMPAT | ||
111 | static long compat_sock_ioctl(struct file *file, | ||
112 | unsigned int cmd, unsigned long arg); | ||
113 | #endif | ||
110 | static int sock_fasync(int fd, struct file *filp, int on); | 114 | static int sock_fasync(int fd, struct file *filp, int on); |
111 | static ssize_t sock_readv(struct file *file, const struct iovec *vector, | 115 | static ssize_t sock_readv(struct file *file, const struct iovec *vector, |
112 | unsigned long count, loff_t *ppos); | 116 | unsigned long count, loff_t *ppos); |
@@ -128,6 +132,9 @@ static struct file_operations socket_file_ops = { | |||
128 | .aio_write = sock_aio_write, | 132 | .aio_write = sock_aio_write, |
129 | .poll = sock_poll, | 133 | .poll = sock_poll, |
130 | .unlocked_ioctl = sock_ioctl, | 134 | .unlocked_ioctl = sock_ioctl, |
135 | #ifdef CONFIG_COMPAT | ||
136 | .compat_ioctl = compat_sock_ioctl, | ||
137 | #endif | ||
131 | .mmap = sock_mmap, | 138 | .mmap = sock_mmap, |
132 | .open = sock_no_open, /* special open code to disallow open via /proc */ | 139 | .open = sock_no_open, /* special open code to disallow open via /proc */ |
133 | .release = sock_close, | 140 | .release = sock_close, |
@@ -2136,6 +2143,20 @@ void socket_seq_show(struct seq_file *seq) | |||
2136 | } | 2143 | } |
2137 | #endif /* CONFIG_PROC_FS */ | 2144 | #endif /* CONFIG_PROC_FS */ |
2138 | 2145 | ||
2146 | #ifdef CONFIG_COMPAT | ||
2147 | static long compat_sock_ioctl(struct file *file, unsigned cmd, | ||
2148 | unsigned long arg) | ||
2149 | { | ||
2150 | struct socket *sock = file->private_data; | ||
2151 | int ret = -ENOIOCTLCMD; | ||
2152 | |||
2153 | if (sock->ops->compat_ioctl) | ||
2154 | ret = sock->ops->compat_ioctl(sock, cmd, arg); | ||
2155 | |||
2156 | return ret; | ||
2157 | } | ||
2158 | #endif | ||
2159 | |||
2139 | /* ABI emulation layers need these two */ | 2160 | /* ABI emulation layers need these two */ |
2140 | EXPORT_SYMBOL(move_addr_to_kernel); | 2161 | EXPORT_SYMBOL(move_addr_to_kernel); |
2141 | EXPORT_SYMBOL(move_addr_to_user); | 2162 | EXPORT_SYMBOL(move_addr_to_user); |