Commit 0f290034 authored by Chas Williams's avatar Chas Williams Committed by Stephen Hemminger

[ATM]: [he] Possibly using corrupted structure (from felipewd@terra.com.br)

parent 19323b83
......@@ -2860,8 +2860,10 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg)
if (!capable(CAP_NET_ADMIN))
return -EPERM;
copy_from_user(&reg, (struct he_ioctl_reg *) arg,
sizeof(struct he_ioctl_reg));
if (copy_from_user(&reg, (struct he_ioctl_reg *) arg,
sizeof(struct he_ioctl_reg)))
return -EFAULT;
spin_lock_irqsave(&he_dev->global_lock, flags);
switch (reg.type) {
case HE_REGTYPE_PCI:
......@@ -2885,8 +2887,9 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg)
}
spin_unlock_irqrestore(&he_dev->global_lock, flags);
if (err == 0)
copy_to_user((struct he_ioctl_reg *) arg, &reg,
sizeof(struct he_ioctl_reg));
if (copy_to_user((struct he_ioctl_reg *) arg, &reg,
sizeof(struct he_ioctl_reg)))
return -EFAULT;
break;
default:
#ifdef CONFIG_ATM_HE_USE_SUNI
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment