Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66378
b: refs/heads/master
c: 32da477
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Oct 10, 2007
1 parent df7b402 commit 18daea9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 890d52d3f1e28888c4122e120426588f5ad63d37
refs/heads/master: 32da477a5bfe96b6dfc8960e0d22d89ca09fd10a
21 changes: 10 additions & 11 deletions trunk/fs/compat_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,22 +324,21 @@ struct ifconf32 {

static int dev_ifname32(unsigned int fd, unsigned int cmd, unsigned long arg)
{
struct net_device *dev;
struct ifreq32 ifr32;
struct ifreq __user *uifr;
int err;

if (copy_from_user(&ifr32, compat_ptr(arg), sizeof(ifr32)))
uifr = compat_alloc_user_space(sizeof(struct ifreq));
if (copy_in_user(uifr, compat_ptr(arg), sizeof(struct ifreq32)));
return -EFAULT;

dev = dev_get_by_index(ifr32.ifr_ifindex);
if (!dev)
return -ENODEV;
err = sys_ioctl(fd, SIOCGIFNAME, (unsigned long)uifr);
if (err)
return err;

strlcpy(ifr32.ifr_name, dev->name, sizeof(ifr32.ifr_name));
dev_put(dev);

err = copy_to_user(compat_ptr(arg), &ifr32, sizeof(ifr32));
return (err ? -EFAULT : 0);
if (copy_in_user(compat_ptr(arg), uifr, sizeof(struct ifreq32)))
return -EFAULT;

return 0;
}

static int dev_ifconf(unsigned int fd, unsigned int cmd, unsigned long arg)
Expand Down

0 comments on commit 18daea9

Please sign in to comment.