Prev: [tip:x86/asm] x86, asm: Merge cmpxchg_486_u64() and cmpxchg8b_emu()
Next: [PATCH 03/13] AppArmor: contexts used in attaching policy to system objects
From: Miller, Mike (OS Dev) on 29 Jul 2010 16:30 > -----Original Message----- > From: Kulikov Vasiliy [mailto:segooon(a)gmail.com] > Sent: Thursday, July 29, 2010 10:55 AM > To: kernel-janitors(a)vger.kernel.org > Cc: Chirag Kantharia; Jens Axboe; Andrew Morton; Alexey > Dobriyan; Christoph Hellwig; Arnd Bergmann; ISS StorageDev; > linux-kernel(a)vger.kernel.org > Subject: [PATCH] cpqarray: check put_user() result > > put_user() may fail, if so return -EFAULT. > > Signed-off-by: Kulikov Vasiliy <segooon(a)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(a)hp.com>-- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Jens Axboe on 3 Aug 2010 07:10
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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |