| To: | davem@xxxxxxxxxx |
|---|---|
| Subject: | [PATCH][ATM]: [he] possibly using corrupted structure (from felipewd@xxxxxxxxxxxx) |
| From: | chas williams <chas@xxxxxxxxxxxxxxxx> |
| Date: | Mon, 22 Sep 2003 10:52:52 -0400 |
| Cc: | netdev@xxxxxxxxxxx |
| Reply-to: | chas3@xxxxxxxxxxxxxxxxxxxxx |
| Sender: | netdev-bounce@xxxxxxxxxxx |
please apply to both 2.4 and 2.6. --thanks
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1445 -> 1.1446
# drivers/atm/he.c 1.24 -> 1.25
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/09/22 chas@xxxxxxxxxxxxxxxxxxxxxx 1.1446
# [ATM]: [he] possibly using corrupted structure (from felipewd@xxxxxxxxxxxx)
# --------------------------------------------
#
diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c
--- a/drivers/atm/he.c Mon Sep 22 10:51:28 2003
+++ b/drivers/atm/he.c Mon Sep 22 10:51:28 2003
@@ -2864,8 +2864,10 @@
if (!capable(CAP_NET_ADMIN))
return -EPERM;
- copy_from_user(®, (struct he_ioctl_reg *) arg,
- sizeof(struct he_ioctl_reg));
+ if (copy_from_user(®, (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:
@@ -2889,8 +2891,9 @@
}
spin_unlock_irqrestore(&he_dev->global_lock, flags);
if (err == 0)
- copy_to_user((struct he_ioctl_reg *) arg, ®,
- sizeof(struct
he_ioctl_reg));
+ if (copy_to_user((struct he_ioctl_reg *) arg,
®,
+ sizeof(struct
he_ioctl_reg)))
+ return -EFAULT;
break;
default:
#ifdef CONFIG_ATM_HE_USE_SUNI
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: Fw: Re: [PATCH] (6/6) ipvs -- get rid of skb_linearize, Rusty Russell |
|---|---|
| Next by Date: | [PATCH 2.6.0-test5][ROSE] timer cleanups, Vinay K Nallamothu |
| Previous by Thread: | 3c59x 2.6 napi patch, Michele 'mydecay' Marchetto |
| Next by Thread: | Re: [PATCH][ATM]: [he] possibly using corrupted structure (from felipewd@xxxxxxxxxxxx), David S. Miller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |