aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTsuneo.Yoshioka@f-secure.com <Tsuneo.Yoshioka@f-secure.com>2005-09-12 12:49:24 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-12 13:49:57 -0400
commit83b942bd3437d84d6ddf582477120b6b86369052 (patch)
tree75fcfc6d7f175cd35911bf93713d45a82c67a3fc
parent9acf23c42b13d682abbd5db1d293c7a77ae54b61 (diff)
[PATCH] x86-64: Fix 32bit sendfile
If we use 64bit kernel on ia64/x86_64/s390 architecture, and we run 32bit binary on 32bit compatibility mode, sendfile system call seems be not set offset argument. This is because sendfile's return value is not zero but the code regards the result by return value is zero or not. This problem will be affect to ia64/x86_64/s390 and not affect to other architecture does not affect other architecture (mips/parisc/ppc64/sparc64). Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--arch/ia64/ia32/sys_ia32.c2
-rw-r--r--arch/s390/kernel/compat_linux.c2
-rw-r--r--arch/x86_64/ia32/sys_ia32.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index e29a8a55486a..3fa67ecebc83 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -2327,7 +2327,7 @@ sys32_sendfile (int out_fd, int in_fd, int __user *offset, unsigned int count)
2327 ret = sys_sendfile(out_fd, in_fd, offset ? (off_t __user *) &of : NULL, count); 2327 ret = sys_sendfile(out_fd, in_fd, offset ? (off_t __user *) &of : NULL, count);
2328 set_fs(old_fs); 2328 set_fs(old_fs);
2329 2329
2330 if (!ret && offset && put_user(of, offset)) 2330 if (offset && put_user(of, offset))
2331 return -EFAULT; 2331 return -EFAULT;
2332 2332
2333 return ret; 2333 return ret;
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 18610cea03a2..ed877d0f27e6 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -678,7 +678,7 @@ asmlinkage long sys32_sendfile(int out_fd, int in_fd, compat_off_t *offset, size
678 ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count); 678 ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count);
679 set_fs(old_fs); 679 set_fs(old_fs);
680 680
681 if (!ret && offset && put_user(of, offset)) 681 if (offset && put_user(of, offset))
682 return -EFAULT; 682 return -EFAULT;
683 683
684 return ret; 684 return ret;
diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c
index 04d80406ce4f..5389df610e78 100644
--- a/arch/x86_64/ia32/sys_ia32.c
+++ b/arch/x86_64/ia32/sys_ia32.c
@@ -751,7 +751,7 @@ sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, s32 count)
751 ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count); 751 ret = sys_sendfile(out_fd, in_fd, offset ? &of : NULL, count);
752 set_fs(old_fs); 752 set_fs(old_fs);
753 753
754 if (!ret && offset && put_user(of, offset)) 754 if (offset && put_user(of, offset))
755 return -EFAULT; 755 return -EFAULT;
756 756
757 return ret; 757 return ret;