All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [patch] isdn: copy_from_user size fix in sc/ioctl.c
@ 2005-06-04 15:01 Domen Puncer
  0 siblings, 0 replies; only message in thread
From: Domen Puncer @ 2005-06-04 15:01 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 909 bytes --]

A few lines above the patch we have:
	char *srec;
	srec = kmalloc(SCIOC_SRECSIZE, GFP_KERNEL);

sizeof pointer is probably not meant here.


Signed-off-by: Domen Puncer <domen@coderock.org>

diff -pruNX dontdiff c/drivers/isdn/sc/ioctl.c a/drivers/isdn/sc/ioctl.c
--- c/drivers/isdn/sc/ioctl.c	2005-01-22 02:48:21.000000000 +0100
+++ a/drivers/isdn/sc/ioctl.c	2005-06-04 15:36:48.000000000 +0200
@@ -72,14 +72,14 @@ int sc_ioctl(int card, scs_ioctl *data)
 		/*
 		 * Get the SRec from user space
 		 */
-		if (copy_from_user(srec, data->dataptr, sizeof(srec))) {
+		if (copy_from_user(srec, data->dataptr, SCIOC_SRECSIZE)) {
 			kfree(rcvmsg);
 			kfree(srec);
 			return -EFAULT;
 		}
 
 		status = send_and_receive(card, CMPID, cmReqType2, cmReqClass0, cmReqLoadProc,
-				0, sizeof(srec), srec, rcvmsg, SAR_TIMEOUT);
+				0, SCIOC_SRECSIZE, srec, rcvmsg, SAR_TIMEOUT);
 		kfree(rcvmsg);
 		kfree(srec);
 

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

only message in thread, other threads:[~2005-06-04 15:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-04 15:01 [KJ] [patch] isdn: copy_from_user size fix in sc/ioctl.c Domen Puncer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.