login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
June
»
3
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Peter Zijlstra
Subject:
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails
Date: Thursday, June 3, 2010 - 3:42 am
On Thu, 2010-06-03 at 12:35 +0200, Dan Carpenter wrote:
quoted text
> copy_to_user() returns the number of bytes remaining, but we want to > return -EFAULT. > ret = fcntl(fd, F_SETOWN_EX, NULL); > With the original code ret would be 8 here. > > V2: Takuya Yoshikawa pointed out a similar issue in f_getown_ex() > > Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
quoted text
> diff --git a/fs/fcntl.c b/fs/fcntl.c > index f74d270..51e11bf 100644 > --- a/fs/fcntl.c > +++ b/fs/fcntl.c > @@ -274,7 +274,7 @@ static int f_setown_ex(struct file *filp, unsigned long arg) > > ret = copy_from_user(&owner, owner_p, sizeof(owner)); > if (ret) > - return ret; > + return -EFAULT; > > switch (owner.type) { > case F_OWNER_TID: > @@ -332,8 +332,11 @@ static int f_getown_ex(struct file *filp, unsigned long arg) > } > read_unlock(&filp->f_owner.lock); > > - if (!ret) > + if (!ret) { > ret = copy_to_user(owner_p, &owner, sizeof(owner)); > + if (ret) > + ret = -EFAULT; > + } > return ret; > } >
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[patch] fcntl: return -EFAULT if copy_to_user fails
, Dan Carpenter
, (Thu Jun 3, 3:04 am)
Re: [patch] fcntl: return -EFAULT if copy_to_user fails
, Takuya Yoshikawa
, (Thu Jun 3, 3:22 am)
[patch v2] fcntl: return -EFAULT if copy_to_user fails
, Dan Carpenter
, (Thu Jun 3, 3:35 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails
, Peter Zijlstra
, (Thu Jun 3, 3:42 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails
, Jens Axboe
, (Thu Jun 3, 4:59 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails
, Takuya Yoshikawa
, (Thu Jun 3, 5:16 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails
, Eric Dumazet
, (Thu Jun 3, 5:38 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails
, Dan Carpenter
, (Thu Jun 3, 5:45 am)
Re: [patch] fcntl: return -EFAULT if copy_to_user fails
, Al Viro
, (Thu Jun 3, 5:45 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails
, Nick Piggin
, (Thu Jun 3, 6:10 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails
, Takuya Yoshikawa
, (Thu Jun 3, 6:24 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails
, Eric Dumazet
, (Thu Jun 3, 6:42 am)
Re: [patch v2] fcntl: return -EFAULT if copy_to_user fails
, Dan Carpenter
, (Fri Jun 4, 4:14 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg KH
Og dreams of kernels
Jens Axboe
[PATCH 31/33] Fusion: sg chaining support
Arnd Bergmann
Re: finding your own dead "CONFIG_" variables
Mark Brown
[PATCH 2/2] Subject: natsemi: Allow users to disable workaround for DspCfg reset
Tony Breeds
[LGUEST] Look in object dir for .config
git
:
Brian Downing
Re: Git in a Nutshell guide
John Benes
Re: master has some toys
Matthias Lederhofer
[PATCH 4/7] introduce GIT_WORK_TREE to specify the work tree
Alexander Sulfrian
[RFC/PATCH] RE: git calls SSH_ASKPASS even if DISPLAY is not set
Junio C Hamano
Re: Rss produced by git is not valid xml?
git-commits-head
:
Linux Kernel Mailing List
iSeries: fix section mismatch in iseries_veth
Linux Kernel Mailing List
ixbge: remove TX lock and redo TX accounting.
Linux Kernel Mailing List
ixgbe: fix several counter register errata
Linux Kernel Mailing List
b43: fix build with CONFIG_SSB_PCIHOST=n
Linux Kernel Mailing List
9p: block-based virtio client
linux-netdev
:
Michael Breuer
Re: [PATCH] af_packet: Don't use skb after dev_queue_xmit()
Michael Breuer
Re: [PATCH] af_packet: Don't use skb after dev_queue_xmit()
David Daney
[PATCH 5/7] Staging: Octeon Ethernet: Convert to NAPI.
Wolfgang Grandegger
[PATCH net-next v4 1/3] can: mscan: fix improper return if dlc < 8 in start_xmi...
Amit Kumar Salecha
[PATCHv3 NEXT 2/2] NET: Add Qlogic ethernet driver for CNA devices
openbsd-misc
:
Theo de Raadt
Re: Old IPSEC bug
Tomáš Bodžár
Problem with vpnc connection - check group password !
Insan Praja SW
Mandoc Compiling Error
Carl Roberso
Re: Cannot change MTU of carp interface?
Richard Daemon
Re: booting openbsd on eee without cd-rom
Colocation donated by:
Syndicate