linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] compat: remove unnecessary assignment in compat_rw_copy_check_uvector()
@ 2010-12-26 16:41 Namhyung Kim
  2010-12-26 16:41 ` [PATCH 2/3] compat: update comment of compat statfs syscalls Namhyung Kim
  2010-12-26 16:41 ` [PATCH 3/3] compat: copy missing fields in compat_statfs64 to user Namhyung Kim
  0 siblings, 2 replies; 4+ messages in thread
From: Namhyung Kim @ 2010-12-26 16:41 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel, linux-kernel, Jeff Moyer

*@ret_pointer is initialized to @fast_pointer thus the assignment is
redundant.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
---
 fs/compat.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/fs/compat.c b/fs/compat.c
index b074e9f79148..0a22f973f4b5 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -597,10 +597,8 @@ ssize_t compat_rw_copy_check_uvector(int type,
 	if (nr_segs > fast_segs) {
 		ret = -ENOMEM;
 		iov = kmalloc(nr_segs*sizeof(struct iovec), GFP_KERNEL);
-		if (iov == NULL) {
-			*ret_pointer = fast_pointer;
+		if (iov == NULL)
 			goto out;
-		}
 	}
 	*ret_pointer = iov;
 
-- 
1.7.3.4.600.g982838b0


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

* [PATCH 2/3] compat: update comment of compat statfs syscalls
  2010-12-26 16:41 [PATCH 1/3] compat: remove unnecessary assignment in compat_rw_copy_check_uvector() Namhyung Kim
@ 2010-12-26 16:41 ` Namhyung Kim
  2010-12-26 16:41 ` [PATCH 3/3] compat: copy missing fields in compat_statfs64 to user Namhyung Kim
  1 sibling, 0 replies; 4+ messages in thread
From: Namhyung Kim @ 2010-12-26 16:41 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel, linux-kernel, Jiri Kosina

The commit 7ed1ee6118ae ("Take statfs variants to fs/statfs.c")
separates out statfs syscalls from fs/open.c. Thus the comment
should be changed also.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Jiri Kosina <trivial@kernel.org>
---
 fs/compat.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/compat.c b/fs/compat.c
index 0a22f973f4b5..037df434b038 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -257,7 +257,7 @@ static int put_compat_statfs(struct compat_statfs __user *ubuf, struct kstatfs *
 }
 
 /*
- * The following statfs calls are copies of code from fs/open.c and
+ * The following statfs calls are copies of code from fs/statfs.c and
  * should be checked against those from time to time
  */
 asmlinkage long compat_sys_statfs(const char __user *pathname, struct compat_statfs __user *buf)
-- 
1.7.3.4.600.g982838b0


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

* [PATCH 3/3] compat: copy missing fields in compat_statfs64 to user
  2010-12-26 16:41 [PATCH 1/3] compat: remove unnecessary assignment in compat_rw_copy_check_uvector() Namhyung Kim
  2010-12-26 16:41 ` [PATCH 2/3] compat: update comment of compat statfs syscalls Namhyung Kim
@ 2010-12-26 16:41 ` Namhyung Kim
  2010-12-27 15:36   ` Christoph Hellwig
  1 sibling, 1 reply; 4+ messages in thread
From: Namhyung Kim @ 2010-12-26 16:41 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel, linux-kernel, Christoph Hellwig

f_flags and f_spare fields were not copied to userspace when
compat_sys_[f]statfs64 called.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
---
It seems struct compat_statfs lacks the f_flags field in it but I'm not
sure whether it is intended or not. Is it useful if I make a patch for
it too?

 fs/compat.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/compat.c b/fs/compat.c
index 037df434b038..2524511518e7 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -320,7 +320,9 @@ static int put_compat_statfs64(struct compat_statfs64 __user *ubuf, struct kstat
 	    __put_user(kbuf->f_namelen, &ubuf->f_namelen) ||
 	    __put_user(kbuf->f_fsid.val[0], &ubuf->f_fsid.val[0]) ||
 	    __put_user(kbuf->f_fsid.val[1], &ubuf->f_fsid.val[1]) ||
-	    __put_user(kbuf->f_frsize, &ubuf->f_frsize))
+	    __put_user(kbuf->f_frsize, &ubuf->f_frsize) ||
+	    __put_user(kbuf->f_flags, &ubuf->f_flags) ||
+	    __clear_user(ubuf->f_spare, sizeof(ubuf->f_spare)))
 		return -EFAULT;
 	return 0;
 }
-- 
1.7.3.4.600.g982838b0


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

* Re: [PATCH 3/3] compat: copy missing fields in compat_statfs64 to user
  2010-12-26 16:41 ` [PATCH 3/3] compat: copy missing fields in compat_statfs64 to user Namhyung Kim
@ 2010-12-27 15:36   ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2010-12-27 15:36 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Alexander Viro, linux-fsdevel, linux-kernel, Christoph Hellwig

On Mon, Dec 27, 2010 at 01:41:54AM +0900, Namhyung Kim wrote:
> f_flags and f_spare fields were not copied to userspace when
> compat_sys_[f]statfs64 called.
> 
> Signed-off-by: Namhyung Kim <namhyung@gmail.com>
> Cc: Christoph Hellwig <hch@lst.de>
> ---
> It seems struct compat_statfs lacks the f_flags field in it but I'm not
> sure whether it is intended or not. Is it useful if I make a patch for
> it too?

Looks good.  We discussed this a while back before it fell under the
table again.

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

end of thread, other threads:[~2010-12-27 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-26 16:41 [PATCH 1/3] compat: remove unnecessary assignment in compat_rw_copy_check_uvector() Namhyung Kim
2010-12-26 16:41 ` [PATCH 2/3] compat: update comment of compat statfs syscalls Namhyung Kim
2010-12-26 16:41 ` [PATCH 3/3] compat: copy missing fields in compat_statfs64 to user Namhyung Kim
2010-12-27 15:36   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).