mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fw-cdev __user annotations
@ 2007-10-14 18:34 Al Viro
  2007-10-14 18:52 ` Stefan Richter
  0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2007-10-14 18:34 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, stefanr


Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 drivers/firewire/fw-cdev.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/firewire/fw-cdev.c b/drivers/firewire/fw-cdev.c
index 7538864..0647130 100644
--- a/drivers/firewire/fw-cdev.c
+++ b/drivers/firewire/fw-cdev.c
@@ -722,10 +722,11 @@ static int ioctl_queue_iso(struct client *client, void *buffer)
 		buffer_end = 0;
 	}
 
-	if (!access_ok(VERIFY_READ, request->packets, request->size))
+	p = (struct fw_cdev_iso_packet __user *)u64_to_uptr(request->packets);
+
+	if (!access_ok(VERIFY_READ, p, request->size))
 		return -EFAULT;
 
-	p = (struct fw_cdev_iso_packet __user *)u64_to_uptr(request->packets);
 	end = (void __user *)p + request->size;
 	count = 0;
 	while (p < end) {
-- 
1.5.3.GIT



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

* Re: [PATCH] fw-cdev __user annotations
  2007-10-14 18:34 [PATCH] fw-cdev __user annotations Al Viro
@ 2007-10-14 18:52 ` Stefan Richter
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Richter @ 2007-10-14 18:52 UTC (permalink / raw)
  To: Al Viro; +Cc: torvalds, linux-kernel

Al Viro wrote:
> --- a/drivers/firewire/fw-cdev.c
> +++ b/drivers/firewire/fw-cdev.c
> @@ -722,10 +722,11 @@ static int ioctl_queue_iso(struct client *client, void *buffer)
>  		buffer_end = 0;
>  	}
>  
> -	if (!access_ok(VERIFY_READ, request->packets, request->size))
> +	p = (struct fw_cdev_iso_packet __user *)u64_to_uptr(request->packets);
> +
> +	if (!access_ok(VERIFY_READ, p, request->size))
>  		return -EFAULT;
>  
> -	p = (struct fw_cdev_iso_packet __user *)u64_to_uptr(request->packets);
>  	end = (void __user *)p + request->size;
>  	count = 0;
>  	while (p < end) {

Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

I will enqueue it in case Linus doesn't pick it up before my next pull
request.
-- 
Stefan Richter
-=====-=-=== =-=- -===-
http://arcgraph.de/sr/

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

end of thread, other threads:[~2007-10-14 18:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-14 18:34 [PATCH] fw-cdev __user annotations Al Viro
2007-10-14 18:52 ` Stefan Richter

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

all inboxes | Powered by JetHome®