aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat_ioctl.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-11 22:40:14 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-11 22:40:14 -0400
commit038a5008b2f395c85e6e71d6ddf3c684e7c405b0 (patch)
tree4735eab577e97e5a22c3141e3f60071c8065585e /fs/compat_ioctl.c
parentdd6d1844af33acb4edd0a40b1770d091a22c94be (diff)
parent266918303226cceac7eca38ced30f15f277bd89c (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (867 commits) [SKY2]: status polling loop (post merge) [NET]: Fix NAPI completion handling in some drivers. [TCP]: Limit processing lost_retrans loop to work-to-do cases [TCP]: Fix lost_retrans loop vs fastpath problems [TCP]: No need to re-count fackets_out/sacked_out at RTO [TCP]: Extract tcp_match_queue_to_sack from sacktag code [TCP]: Kill almost unused variable pcount from sacktag [TCP]: Fix mark_head_lost to ignore R-bit when trying to mark L [TCP]: Add bytes_acked (ABC) clearing to FRTO too [IPv6]: Update setsockopt(IPV6_MULTICAST_IF) to support RFC 3493, try2 [NETFILTER]: x_tables: add missing ip6t_modulename aliases [NETFILTER]: nf_conntrack_tcp: fix connection reopening [QETH]: fix qeth_main.c [NETLINK]: fib_frontend build fixes [IPv6]: Export userland ND options through netlink (RDNSS support) [9P]: build fix with !CONFIG_SYSCTL [NET]: Fix dev_put() and dev_hold() comments [NET]: make netlink user -> kernel interface synchronious [NET]: unify netlink kernel socket recognition [NET]: cleanup 3rd argument in netlink_sendskb ... Fix up conflicts manually in Documentation/feature-removal-schedule.txt and my new least favourite crap, the "mod_devicetable" support in the files include/linux/mod_devicetable.h and scripts/mod/file2alias.c. (The latter files seem to be explicitly _designed_ to get conflicts when different subsystems work with them - that have an absolutely horrid lack of subsystem separation!) Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/compat_ioctl.c')
-rw-r--r--fs/compat_ioctl.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index b9e3357bcc2e..9c3fd07f35e0 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -319,22 +319,21 @@ struct ifconf32 {
319 319
320static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg) 320static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg)
321{ 321{
322 struct net_device *dev; 322 struct ifreq __user *uifr;
323 struct ifreq32 ifr32;
324 int err; 323 int err;
325 324
326 if (copy_from_user(&ifr32, compat_ptr(arg), sizeof(ifr32))) 325 uifr = compat_alloc_user_space(sizeof(struct ifreq));
326 if (copy_in_user(uifr, compat_ptr(arg), sizeof(struct ifreq32)));
327 return -EFAULT; 327 return -EFAULT;
328 328
329 dev = dev_get_by_index(ifr32.ifr_ifindex); 329 err = sys_ioctl(fd, SIOCGIFNAME, (unsigned long)uifr);
330 if (!dev) 330 if (err)
331 return -ENODEV; 331 return err;
332 332
333 strlcpy(ifr32.ifr_name, dev->name, sizeof(ifr32.ifr_name)); 333 if (copy_in_user(compat_ptr(arg), uifr, sizeof(struct ifreq32)))
334 dev_put(dev); 334 return -EFAULT;
335 335
336 err = copy_to_user(compat_ptr(arg), &ifr32, sizeof(ifr32)); 336 return 0;
337 return (err ? -EFAULT : 0);
338} 337}
339 338
340static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg) 339static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg)