raw1394 missing failure handling
PATCH 1/1 raw1394 missing failure handling
Hi,
In the raw1394 driver the failure handling for
a __copy_to_user call is missing.
With friendly regards,
Takis
Signature · 2 lines
K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group http://people.mech.kuleuven.ac.be/~pissaris/
drivers/ieee1394/raw1394.c +2 -1
@@ -443,7 +443,8 @@ static ssize_t raw1394_read(struct file req->req.error =RAW1394_ERROR_MEMFAULT ; } } -__copy_to_user (buffer, &req->req,sizeof (req->req)); +if (__copy_to_user (buffer, &req->req,sizeof (req->req))) +return -EFAULT ;free_pending_request (req);return sizeof (struct raw1394_request );
Hi,
Quoted 2 lines · Panagiotis Issaris
In the raw1394 driver the failure handling for
a__copy_to_usercall is missing.
Your patch is obviously incorrect as it doesn't free the request before it returns.
Best regards,
Anton
Signature · 4 lines
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/
Hi,
Quoted 12 lines · Anton Altaparmakov
Quoted 4 lines · Panagiotis Issaris
In the raw1394 driver the failure handling for
a__copy_to_usercall is missing.Your patch is obviously incorrect as it doesn't free the request before it returns.
Oops. Thanks for replying! Any more problems with the updated patch?
With friendly regards,
Takis
Signature · 2 lines
K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group http://people.mech.kuleuven.ac.be/~pissaris/
drivers/ieee1394/raw1394.c +5 -1
@@ -443,7 +443,11 @@ static ssize_t raw1394_read(struct file req->req.error =RAW1394_ERROR_MEMFAULT ; } } -__copy_to_user (buffer, &req->req,sizeof (req->req)); +if (__copy_to_user (buffer, &req->req,sizeof (req->req))) + { +free_pending_request (req); +return -EFAULT ; + }free_pending_request (req);return sizeof (struct raw1394_request );
Quoted 12 lines · Panagiotis Issaris
Hi,
Quoted 8 lines · Anton Altaparmakov
Quoted 4 lines · Panagiotis Issaris
In the raw1394 driver the failure handling for
a__copy_to_usercall is missing.
Quoted 7 lines
Quoted 4 lines
Your patch is obviously incorrect as it doesn't free the request before it returns.
Oops. Thanks for replying! Any more problems with the updated patch?
Formatting... Opening curly brace should go on the same line with "if".
Signature · 1 line
Dmitry
Hi,
Quoted 11 lines · Dmitry Torokhov
Quoted 4 lines · Panagiotis Issaris
Oops. Thanks for replying! Any more problems with the updated patch?
Formatting... Opening curly brace should go on the same line with "if".
Thanks. Here's my third try :-)
With friendly regards,
Takis
Signature · 2 lines
K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group http://people.mech.kuleuven.ac.be/~pissaris/
drivers/ieee1394/raw1394.c +4 -1
@@ -443,7 +443,10 @@ static ssize_t raw1394_read(struct file req->req.error =RAW1394_ERROR_MEMFAULT ; } } -__copy_to_user (buffer, &req->req,sizeof (req->req)); +if (__copy_to_user (buffer, &req->req,sizeof (req->req))) { +free_pending_request (req); +return -EFAULT ; + }free_pending_request (req);return sizeof (struct raw1394_request );
Quoted 4 lines
Thanks. Here's my third try :-)
With friendly regards,
Takis
I'll apply this to the 1394 tree and send it to Linus after testing if you add a Signed-off-by: line per Documentation/SubmittingPatches . Also, please cc [email protected] with ieee1394 changes.
Thanks,
Jody
Quoted 21 lines
Signature · 6 lines
-- K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group http://people.mech.kuleuven.ac.be/~pissaris/ diff -pruN linux-2.6.11/drivers/ieee1394/raw1394.c linux-2.6.11-pi/drivers/ieee1394/raw1394.cdrivers/ieee1394/raw1394.c +4
-1@@ -443,7 +443,10 @@ static ssize_t raw1394_read(struct file req->req.error =RAW1394_ERROR_MEMFAULT ; } } -__copy_to_user (buffer, &req->req,sizeof (req->req)); +if (__copy_to_user (buffer, &req->req,sizeof (req->req))) { +free_pending_request (req); +return -EFAULT ; + }free_pending_request (req);return sizeof (struct raw1394_request );
Hi,
Quoted 5 lines · Jody McIntyre
I'll apply this to the 1394 tree and send it to Linus after testing if you add a Signed-off-by: line per
Documentation/SubmittingPatches. Also, please cc [email protected] with ieee1394 changes.
Sure! Thanks!
Adds the missing failure handling for a __copy_to_user call.
drivers/ieee1394/raw1394.c +4 -1
@@ -443,7 +443,10 @@ static ssize_t raw1394_read(struct file req->req.error =RAW1394_ERROR_MEMFAULT ; } } -__copy_to_user (buffer, &req->req,sizeof (req->req)); +if (__copy_to_user (buffer, &req->req,sizeof (req->req))) { +free_pending_request (req); +return -EFAULT ; + }free_pending_request (req);return sizeof (struct raw1394_request );
Signature · 2 lines
K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group http://people.mech.kuleuven.ac.be/~pissaris/
Hi Jody,
My previous e-mail seemed to be messed up by Thunderbird... so now I'm using good old Mutt again.
Quoted 9 lines · Jody McIntyre
Quoted 4 lines
Thanks. Here's my third try :-)
With friendly regards,
TakisI'll apply this to the 1394 tree and send it to Linus after testing if you add a Signed-off-by: line per
Documentation/SubmittingPatches. Also, please cc [email protected] with ieee1394 changes.
Sure! Thanks!
Adds the missing failure handling for a __copy_to_user call.
drivers/ieee1394/raw1394.c +4 -1
@@ -443,7 +443,10 @@ static ssize_t raw1394_read(struct file req->req.error =RAW1394_ERROR_MEMFAULT ; } } -__copy_to_user (buffer, &req->req,sizeof (req->req)); +if (__copy_to_user (buffer, &req->req,sizeof (req->req))) { +free_pending_request (req); +return -EFAULT ; + }free_pending_request (req);return sizeof (struct raw1394_request );
Signature · 2 lines
K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group http://people.mech.kuleuven.ac.be/~pissaris/
Quoted 4 lines · Panagiotis Issaris
Adds the missing failure handling for a
__copy_to_usercall.Signed-off-by Panagiotis Issaris <[email protected]>
Sorry I didn't notice this sooner, but this was already fixed and has been sent to Linus (hopefully to appear in 2.6.12.)
Jody
Quoted 27 lines
diff -pruN
linux-2.6.11/drivers/ieee1394/raw1394.clinux-2.6.11-pi/drivers/ieee1394/raw1394.cdrivers/ieee1394/raw1394.c +4
-1@@ -443,7 +443,10 @@ static ssize_t raw1394_read(struct file req->req.error =RAW1394_ERROR_MEMFAULT ; } } -__copy_to_user (buffer, &req->req,sizeof (req->req)); +if (__copy_to_user (buffer, &req->req,sizeof (req->req))) { +free_pending_request (req); +return -EFAULT ; + }free_pending_request (req);return sizeof (struct raw1394_request );Signature · 9 lines
-- K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group http://people.mech.kuleuven.ac.be/~pissaris/ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Quoted 10 lines · Jody McIntyre
Quoted 4 lines · Panagiotis Issaris
Adds the missing failure handling for a
__copy_to_usercall.Signed-off-by Panagiotis Issaris <[email protected]>Sorry I didn't notice this sooner, but this was already fixed and has been sent to Linus (hopefully to appear in 2.6.12.)
Jody
Jody, Panagiotis; A much more complete patch is already sitting in the bk queue. This is a relatively small piece of that one. You can get it from:
<ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.11/2.6.11-mm1/broken-out>
As the bk-ieee1394.patch you can see there.
Quoted 29 lines
Quoted 29 lines
diff -pruN
linux-2.6.11/drivers/ieee1394/raw1394.clinux-2.6.11-pi/drivers/ieee1394/raw1394.c---linux-2.6.11/drivers/ieee1394/raw1394.c2005-03-02 11:44:26.000000000 +0100 +++linux-2.6.11-pi/drivers/ieee1394/raw1394.c2005-03-02 15:27:15.000000000 +0100 @@ -443,7 +443,10 @@ staticssize_traw1394_read(struct filereq->req.error=RAW1394_ERROR_MEMFAULT; }}(quoted diff) +1
-1- __copy_to_user(buffer, &req->req, sizeof(req->req)); + if (__copy_to_user(buffer, &req->req, sizeof(req->req))){ +
free_pending_request(req);drivers/ieee1394/raw1394.c +2
-1+return -EFAULT ; + }free_pending_request (req);return sizeof (struct raw1394_request ); -- K.U.Leuven, Mechanical Eng., Mechatronics & Robotics ResearchGroup http://people.mech.kuleuven.ac.be/~pissaris/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 8 lines
Cheers, Gene "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) 99.34% setiathome rank, not too shabby for a WV hillbilly Yahoo.com attorneys please note, additions to this message by Gene Heskett are: Copyright 2005 by Maurice Eugene Heskett, all rights reserved.
Quoted 17 lines · On Wed, 02 Mar 2005 12:10:50 +0100 Panagiotis Issaris wrote:
In the raw1394 driver the failure handling for
a__copy_to_usercall is missing.With friendly regards,
TakisSignature · 7 lines
K.U.Leuven, Mechanical Eng., Mechatronics & Robotics Research Group http://people.mech.kuleuven.ac.be/~pissaris/ [pi-20050302T114855-linux_2_6_11-raw1394_copy_to_user_failure_handling.diff text/x-patch (922 bytes)] diff -pruN linux-2.6.11/drivers/ieee1394/raw1394.c linux-2.6.11-pi/drivers/ieee1394/raw1394.c
drivers/ieee1394/raw1394.c static ssize_t raw1394_read(struct file · line 447
Quoted 6 lines
drivers/ieee1394/raw1394.c +2
-1@@ -443,7 +443,8 @@ static ssize_t raw1394_read(struct file req->req.error =RAW1394_ERROR_MEMFAULT ; } } -__copy_to_user (buffer, &req->req,sizeof (req->req)); +if (__copy_to_user (buffer, &req->req,sizeof (req->req))) +return -EFAULT ;
Bug: "req" is not freed in the failure case.
Quoted 4 lines
drivers/ieee1394/raw1394.c +0
-0free_pending_request (req);return sizeof (struct raw1394_request );