Re: Flaws with "UIO: Add the User IO core code" (with patch)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Alan Cox <alan@...>
Cc: Greg Kroah-Hartman <gregkh@...>, <linux-kernel@...>, <torvalds@...>, Thomas Gleixner <tglx@...>, Benedikt Spranger <b.spranger@...>
Date: Saturday, April 28, 2007 - 2:52 pm

Am Samstag 28 April 2007 01:19 schrieb Alan Cox:

I reviewed the code once more and find it OK. There is only one legal
value for the parameter "count" of uio_read(), and that's sizeof(int).
The data that is actually read is the element "event" of struct uio_device,
which is of type atomic_t. The latter has the size of an int.

Unfortunately, the fact that the read count _must_ be sizeof(int) is not
mentioned in the documentation. I'll send a patch for that ASAP.


This patch should fix it:


Index: linux-2.6.22-rc/drivers/uio/uio.c
===================================================================
--- linux-2.6.22-rc.orig/drivers/uio/uio.c	2007-04-28 20:01:02.000000000 +0200
+++ linux-2.6.22-rc/drivers/uio/uio.c	2007-04-28 20:15:00.000000000 +0200
@@ -633,6 +633,8 @@
 	if (ret)
 		goto err_uio_dev_add_attributes;
 
+	info->uio_dev = idev;
+
 	if (idev->info->irq >= 0) {
 		ret = request_irq(idev->info->irq, uio_interrupt,
 				  idev->info->irq_flags, idev->info->name, idev);
@@ -640,7 +642,6 @@
 			goto err_request_irq;
 	}
 
-	info->uio_dev = idev;
 	return 0;
 
 err_request_irq:


Thanks for your review,
Hans

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] UIO patches for 2.6.21, Greg KH, (Fri Apr 27, 6:49 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Bill Davidsen, (Sat Apr 28, 3:56 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Hans-Jürgen Koch, (Sat Apr 28, 4:03 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Alan Cox, (Sat Apr 28, 4:15 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Thomas Gleixner, (Sat Apr 28, 4:31 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Greg KH, (Sat Apr 28, 9:23 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Thomas Gleixner, (Sun Apr 29, 4:30 am)
Re: [GIT PATCH] UIO patches for 2.6.21, Pavel Machek, (Mon May 7, 4:02 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Jan Engelhardt, (Sun Apr 29, 8:09 am)
Re: [GIT PATCH] UIO patches for 2.6.21, Alan Cox, (Sun Apr 29, 12:27 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Thomas Gleixner, (Sat Apr 28, 4:02 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Andrew Morton, (Fri Apr 27, 7:04 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Hans-Jürgen Koch, (Fri Apr 27, 8:28 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Alan Cox, (Fri Apr 27, 7:26 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Greg KH, (Fri Apr 27, 7:11 pm)
Re: [GIT PATCH] UIO patches for 2.6.21, Thomas Gleixner, (Sat Apr 28, 7:38 am)
[PATCH 1/3] UIO: Add the User IO core code, Greg Kroah-Hartman, (Fri Apr 27, 6:50 pm)
Flaws with "UIO: Add the User IO core code", Alan Cox, (Fri Apr 27, 7:19 pm)
Re: Flaws with "UIO: Add the User IO core code" (with patch), Hans-Jürgen Koch, (Sat Apr 28, 2:52 pm)
Re: Flaws with "UIO: Add the User IO core code" (with patch), Hans-Jürgen Koch, (Sat Apr 28, 5:03 pm)
Re: Flaws with "UIO: Add the User IO core code" (with patch), Thomas Gleixner, (Sat Apr 28, 5:08 pm)
Re: Flaws with "UIO: Add the User IO core code", Hans-Jürgen Koch, (Sat Apr 28, 5:14 pm)
Re: Flaws with "UIO: Add the User IO core code" (with patch), Hans-Jürgen Koch, (Sun Apr 29, 6:18 pm)
Re: Flaws with "UIO: Add the User IO core code" (with patch), Thomas Gleixner, (Sat Apr 28, 4:38 pm)
Re: Flaws with "UIO: Add the User IO core code", Thomas Gleixner, (Sat Apr 28, 7:39 am)
[PATCH 2/3] UIO: Documentation, Greg Kroah-Hartman, (Fri Apr 27, 6:50 pm)
Re: [PATCH 2/3] UIO: Documentation, Randy Dunlap, (Tue May 1, 7:42 pm)
Re: [PATCH 2/3] UIO: Documentation, Hans-Jürgen Koch, (Wed May 2, 4:41 am)
Re: [PATCH 2/3] UIO: Documentation, Randy Dunlap, (Wed May 2, 4:52 pm)
Re: [PATCH 2/3] UIO: Documentation, Hans-Jürgen Koch, (Wed May 2, 6:00 pm)
Re: [PATCH 2/3] UIO: Documentation, Randy Dunlap, (Wed May 2, 7:37 pm)
Re: [PATCH 2/3] UIO: Documentation, Greg KH, (Thu May 3, 1:37 am)
Re: [PATCH 2/3] UIO: Documentation, Hans-Jürgen Koch, (Thu May 3, 2:39 am)
Re: [PATCH 2/3] UIO: Documentation, Hans-Jürgen Koch, (Fri May 4, 5:37 am)
Re: [PATCH 2/3] UIO: Documentation, Randy Dunlap, (Mon May 7, 1:46 pm)
Re: [PATCH 2/3] UIO: Documentation, Hans-Jürgen Koch, (Mon May 7, 4:01 pm)
[PATCH 3/3] UIO: Hilscher CIF card driver, Greg Kroah-Hartman, (Fri Apr 27, 6:50 pm)
Re: [PATCH 3/3] UIO: Hilscher CIF card driver (with patch), Hans-Jürgen Koch, (Sun Apr 29, 3:44 pm)