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) ...@@ -2860,8 +2860,10 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg)
if (!capable(CAP_NET_ADMIN)) if (!capable(CAP_NET_ADMIN))
return -EPERM; return -EPERM;
copy_from_user(&reg, (struct he_ioctl_reg *) arg, if (copy_from_user(&reg, (struct he_ioctl_reg *) arg,
sizeof(struct he_ioctl_reg)); sizeof(struct he_ioctl_reg)))
return -EFAULT;
spin_lock_irqsave(&he_dev->global_lock, flags); spin_lock_irqsave(&he_dev->global_lock, flags);
switch (reg.type) { switch (reg.type) {
case HE_REGTYPE_PCI: case HE_REGTYPE_PCI:
...@@ -2885,8 +2887,9 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg) ...@@ -2885,8 +2887,9 @@ he_ioctl(struct atm_dev *atm_dev, unsigned int cmd, void *arg)
} }
spin_unlock_irqrestore(&he_dev->global_lock, flags); spin_unlock_irqrestore(&he_dev->global_lock, flags);
if (err == 0) if (err == 0)
copy_to_user((struct he_ioctl_reg *) arg, &reg, if (copy_to_user((struct he_ioctl_reg *) arg, &reg,
sizeof(struct he_ioctl_reg)); sizeof(struct he_ioctl_reg)))
return -EFAULT;
break; break;
default: default:
#ifdef CONFIG_ATM_HE_USE_SUNI #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