compat: remove unnecessary assignment in compat_rw_copy_check_uvector()
PATCH 1/3 compat: remove unnecessary assignment in compat_rw_copy_check_uvector()
*@ret_pointer is initialized to @fast_pointer thus the assignment is redundant.
--- fs/compat.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
fs/compat.c +1 -3
@@ -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;
Signature · 1 line
1.7.3.4.600.g982838b0
PATCH 2/3 compat: update comment of compat statfs syscalls
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.
--- fs/compat.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/compat.c +1 -1
@@ -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)
Signature · 1 line
1.7.3.4.600.g982838b0
PATCH 3/3 compat: copy missing fields in compat_statfs64 to user
In reply to Namhyung Kimf_flags and f_spare fields were not copied to userspace when compat_sys_[f]statfs64 called.
---
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(-)
fs/compat.c +3 -1
@@ -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 ; }
Signature · 1 line
1.7.3.4.600.g982838b0
Re: [PATCH 3/3] compat: copy missing fields in compat_statfs64 to user
Quoted 9 lines · Namhyung Kim
f_flagsandf_sparefields were not copied to userspace when compat_sys_[f]statfs64 called.Signed-off-by Namhyung Kim <[email protected]>Cc Christoph Hellwig <[email protected]>---
It seems structcompat_statfslacks thef_flagsfield 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.