public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* PATCH: 2.6.7-rc3 drivers/scsi/megaraid.c: user/kernel pointer bugs
@ 2004-06-09 23:14 Robert T. Johnson
  0 siblings, 0 replies; only message in thread
From: Robert T. Johnson @ 2004-06-09 23:14 UTC (permalink / raw)
  To: Linux SCSI developers

Since arg is a user pointer, so are uioc_mimd and uiocp, and hence umc is 
a user pointer.  Thus reading umc->xferaddr requires dereferencing a user 
pointer, which isn't safe.  Let me know if you have any questions or I've
made an error.

Best,
Rob

P.S. megaraid.c still lists linux-megaraid-devel@dell.com as the updates
address, even though the list has been discontinued.

--- linux-2.6.7-rc3-full/drivers/scsi/megaraid.c.orig	Wed Jun  9 12:43:49 2004
+++ linux-2.6.7-rc3-full/drivers/scsi/megaraid.c	Wed Jun  9 12:43:10 2004
@@ -3815,7 +3815,8 @@ mega_n_to_m(void *arg, megacmd_t *mc)
 
 			umc = MBOX_P(uiocp);
 
-			upthru = (mega_passthru *)umc->xferaddr;
+			if (get_user(upthru, (mega_passthru **)&umc->xferaddr))
+				return (-EFAULT);
 
 			if( put_user(mc->status, (u8 *)&upthru->scsistatus) )
 				return (-EFAULT);
@@ -3831,7 +3832,8 @@ mega_n_to_m(void *arg, megacmd_t *mc)
 
 			umc = (megacmd_t *)uioc_mimd->mbox;
 
-			upthru = (mega_passthru *)umc->xferaddr;
+			if (get_user(upthru, (mega_passthru **)&umc->xferaddr))
+				return (-EFAULT);
 
 			if( put_user(mc->status, (u8 *)&upthru->scsistatus) )
 				return (-EFAULT);





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-06-09 23:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-09 23:14 PATCH: 2.6.7-rc3 drivers/scsi/megaraid.c: user/kernel pointer bugs Robert T. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox