[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0F5B06BAB751E047AB5C87D1F77A77887D05640118@GVW0547EXC.americas.hpqcorp.net>
Date: Thu, 29 Jul 2010 20:16:53 +0000
From: "Miller, Mike (OS Dev)" <Mike.Miller@...com>
To: Kulikov Vasiliy <segooon@...il.com>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
CC: Chirag Kantharia <chirag.kantharia@...com>,
Jens Axboe <jaxboe@...ionio.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Alexey Dobriyan <adobriyan@...il.com>,
Christoph Hellwig <hch@...radead.org>,
Arnd Bergmann <arnd@...db.de>,
ISS StorageDev <iss_storagedev@...com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] cpqarray: check put_user() result
> -----Original Message-----
> From: Kulikov Vasiliy [mailto:segooon@...il.com]
> Sent: Thursday, July 29, 2010 10:55 AM
> To: kernel-janitors@...r.kernel.org
> Cc: Chirag Kantharia; Jens Axboe; Andrew Morton; Alexey
> Dobriyan; Christoph Hellwig; Arnd Bergmann; ISS StorageDev;
> linux-kernel@...r.kernel.org
> Subject: [PATCH] cpqarray: check put_user() result
>
> put_user() may fail, if so return -EFAULT.
>
> Signed-off-by: Kulikov Vasiliy <segooon@...il.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@...com>--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists