[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1316282477.5814.19.camel@localhost.localdomain>
Date: Sat, 17 Sep 2011 20:01:17 +0200
From: Thomas Meyer <thomas@...3r.de>
To: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-arch@...r.kernel.org
Subject: [PATCH 3/3] truncate()/ftruncate() fix length argument on ia32
emulation.
move signed-extended int to long, because of signed test.
Signed-off-by: Thomas Meyer <thomas@...3r.de>
---
arch/x86/ia32/ia32entry.S | 4 ++--
fs/compat.c | 10 ++++++++++
include/linux/compat.h | 2 ++
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 30f4116..074b9d3 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -595,8 +595,8 @@ ia32_sys_call_table:
.quad compat_sys_old_readdir
.quad sys32_mmap /* 90 */
.quad sys_munmap
- .quad sys_truncate
- .quad sys_ftruncate
+ .quad compat_sys_truncate
+ .quad compat_sys_ftruncate
.quad sys_fchmod
.quad sys_fchown16 /* 95 */
.quad sys_getpriority
diff --git a/fs/compat.c b/fs/compat.c
index 232675e..315ea2d 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1814,3 +1814,13 @@ compat_sys_open_by_handle_at(int mountdirfd,
return do_handle_open(mountdirfd, handle, flags);
}
#endif
+
+asmlinkage long compat_sys_truncate(const char __user *path, int length)
+{
+ return sys_truncate(path, length);
+}
+
+asmlinkage long compat_sys_ftruncate(unsigned int fd, int length)
+{
+ return sys_ftruncate(fd, length);
+}
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 3bfb30a..7a3b0e7 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -544,6 +544,8 @@ asmlinkage ssize_t compat_sys_mq_timedreceive(mqd_t mqdes,
const struct compat_timespec __user *u_abs_timeout);
asmlinkage long compat_sys_socketcall(int call, u32 __user *args);
asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args);
+asmlinkage long compat_sys_truncate(const char __user *path, int length);
+asmlinkage long compat_sys_ftruncate(unsigned int fd, int length);
extern ssize_t compat_rw_copy_check_uvector(int type,
const struct compat_iovec __user *uvector,
--
1.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists