netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][ATM]: [he] possibly using corrupted structure (from felipewd@terra.com.br)
@ 2003-09-22 14:52 chas williams
  2003-09-23 10:56 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: chas williams @ 2003-09-22 14:52 UTC (permalink / raw)
  To: davem; +Cc: netdev

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@relax.cmf.nrl.navy.mil	1.1446
# [ATM]: [he] possibly using corrupted structure (from felipewd@terra.com.br)
# --------------------------------------------
#
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(&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:
@@ -2889,8 +2891,9 @@
 			}
 			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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][ATM]: [he] possibly using corrupted structure (from felipewd@terra.com.br)
  2003-09-22 14:52 [PATCH][ATM]: [he] possibly using corrupted structure (from felipewd@terra.com.br) chas williams
@ 2003-09-23 10:56 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-09-23 10:56 UTC (permalink / raw)
  To: chas3; +Cc: chas, netdev

On Mon, 22 Sep 2003 10:52:52 -0400
chas williams <chas@cmf.nrl.navy.mil> wrote:

> please apply to both 2.4 and 2.6.  --thanks

Applied, thanks Chas.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-23 10:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-22 14:52 [PATCH][ATM]: [he] possibly using corrupted structure (from felipewd@terra.com.br) chas williams
2003-09-23 10:56 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).