public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpqarray: check put_user() result
@ 2010-07-29 15:54 Kulikov Vasiliy
  2010-07-29 20:16 ` Miller, Mike (OS Dev)
  2010-08-03 10:53 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Kulikov Vasiliy @ 2010-07-29 15:54 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Chirag Kantharia, Jens Axboe, Andrew Morton, Alexey Dobriyan,
	Christoph Hellwig, Arnd Bergmann, iss_storagedev, linux-kernel

put_user() may fail, if so return -EFAULT.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
 drivers/block/cpqarray.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index 9473215..d53b029 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -1179,7 +1179,8 @@ out_passthru:
 		return error;
 	case IDAGETCTLRSIG:
 		if (!arg) return -EINVAL;
-		put_user(host->ctlr_sig, (int __user *)arg);
+		if (put_user(host->ctlr_sig, (int __user *)arg))
+			return -EFAULT;
 		return 0;
 	case IDAREVALIDATEVOLS:
 		if (MINOR(bdev->bd_dev) != 0)
@@ -1187,7 +1188,8 @@ out_passthru:
 		return revalidate_allvol(host);
 	case IDADRIVERVERSION:
 		if (!arg) return -EINVAL;
-		put_user(DRIVER_VERSION, (unsigned long __user *)arg);
+		if (put_user(DRIVER_VERSION, (unsigned long __user *)arg))
+			return -EFAULT;
 		return 0;
 	case IDAGETPCIINFO:
 	{
-- 
1.7.0.4


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

* RE: [PATCH] cpqarray: check put_user() result
  2010-07-29 15:54 [PATCH] cpqarray: check put_user() result Kulikov Vasiliy
@ 2010-07-29 20:16 ` Miller, Mike (OS Dev)
  2010-08-03 10:53 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Miller, Mike (OS Dev) @ 2010-07-29 20:16 UTC (permalink / raw)
  To: Kulikov Vasiliy, kernel-janitors@vger.kernel.org
  Cc: Chirag Kantharia, Jens Axboe, Andrew Morton, Alexey Dobriyan,
	Christoph Hellwig, Arnd Bergmann, ISS StorageDev,
	linux-kernel@vger.kernel.org

 

> -----Original Message-----
> From: Kulikov Vasiliy [mailto:segooon@gmail.com] 
> Sent: Thursday, July 29, 2010 10:55 AM
> To: kernel-janitors@vger.kernel.org
> Cc: Chirag Kantharia; Jens Axboe; Andrew Morton; Alexey 
> Dobriyan; Christoph Hellwig; Arnd Bergmann; ISS StorageDev; 
> linux-kernel@vger.kernel.org
> Subject: [PATCH] cpqarray: check put_user() result
> 
> put_user() may fail, if so return -EFAULT.
> 
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
> ---
>  drivers/block/cpqarray.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/block/cpqarray.c 
> b/drivers/block/cpqarray.c index 9473215..d53b029 100644
> --- a/drivers/block/cpqarray.c
> +++ b/drivers/block/cpqarray.c
> @@ -1179,7 +1179,8 @@ out_passthru:
>  		return error;
>  	case IDAGETCTLRSIG:
>  		if (!arg) return -EINVAL;
> -		put_user(host->ctlr_sig, (int __user *)arg);
> +		if (put_user(host->ctlr_sig, (int __user *)arg))
> +			return -EFAULT;
>  		return 0;
>  	case IDAREVALIDATEVOLS:
>  		if (MINOR(bdev->bd_dev) != 0)
> @@ -1187,7 +1188,8 @@ out_passthru:
>  		return revalidate_allvol(host);
>  	case IDADRIVERVERSION:
>  		if (!arg) return -EINVAL;
> -		put_user(DRIVER_VERSION, (unsigned long __user *)arg);
> +		if (put_user(DRIVER_VERSION, (unsigned long 
> __user *)arg))
> +			return -EFAULT;
>  		return 0;
>  	case IDAGETPCIINFO:
>  	{
> --
> 1.7.0.4
> 
> 
Acked-by: Mike Miller <mike.miller@hp.com>

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

* Re: [PATCH] cpqarray: check put_user() result
  2010-07-29 15:54 [PATCH] cpqarray: check put_user() result Kulikov Vasiliy
  2010-07-29 20:16 ` Miller, Mike (OS Dev)
@ 2010-08-03 10:53 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2010-08-03 10:53 UTC (permalink / raw)
  To: Kulikov Vasiliy
  Cc: kernel-janitors@vger.kernel.org, Chirag Kantharia, Andrew Morton,
	Alexey Dobriyan, Christoph Hellwig, Arnd Bergmann,
	iss_storagedev@hp.com, linux-kernel@vger.kernel.org

On 2010-07-29 17:54, Kulikov Vasiliy wrote:
> put_user() may fail, if so return -EFAULT.

Applied.

-- 
Jens Axboe


Confidentiality Notice: This e-mail message, its contents and any attachments to it are confidential to the intended recipient, and may contain information that is privileged and/or exempt from disclosure under applicable law. If you are not the intended recipient, please immediately notify the sender and destroy the original e-mail message and any attachments (and any copies that may have been made) from your system or otherwise. Any unauthorized use, copying, disclosure or distribution of this information is strictly prohibited.

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

end of thread, other threads:[~2010-08-03 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 15:54 [PATCH] cpqarray: check put_user() result Kulikov Vasiliy
2010-07-29 20:16 ` Miller, Mike (OS Dev)
2010-08-03 10:53 ` Jens Axboe

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