sys_poll: Fix negative timeout values for x86 userland on x86_64 kernels
PATCH 1/1 sys_poll: Fix negative timeout values for x86 userland on x86_64 kernels
sizeof(int/long) differs on x86 and x86_64, so provide a compat_sys_poll().
Signed-off-by Thomas Meyer <[email protected]>
--- arch/x86/ia32/ia32entry.S | 2 +- fs/compat.c | 6 ++++++ include/linux/compat.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletions(-)
arch/x86/ia32/ia32entry.S +1 -1
@@ -671,7 +671,7 @@ ia32_sys_call_table: .quad sys_getresuid16 /* 165 */ .quad sys32_vm86_warning /* vm86 */ .quad quiet_ni_syscall /* query_module */ - .quad sys_poll + .quad compat_sys_poll .quad quiet_ni_syscall /* old nfsservctl */ .quad sys_setresgid16 /* 170 */ .quad sys_getresgid16
fs/compat.c +6 -0
@@ -1621,6 +1621,12 @@ asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, sigsetsize); } +asmlinkage long compat_sys_poll (struct pollfd __user *ufds,unsigned int nfds, +int timeout) +{ +return sys_poll (ufds, nfds, timeout); +} +asmlinkage long compat_sys_ppoll (struct pollfd __user *ufds,unsigned int nfds,struct compat_timespec __user *tsp,const compat_sigset_t __user *sigmask,compat_size_t sigsetsize)
include/linux/compat.h +2 -0
@@ -433,6 +433,8 @@ asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp,compat_ulong_t __user *exp, struct compat_timespec __user *tsp, void __user *sig); +asmlinkage long compat_sys_poll (struct pollfd __user *ufds,unsigned int nfds, +int timeout); asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, struct compat_timespec __user *tsp,
Signature · 1 line
1.7.6
Quoted 2 lines · Thomas Meyer
sizeof(int/long) differs on x86 and
x86_64, so provide acompat_sys_poll().
Please provide a more descriptive Changelog, since this is a stable candidate patch.
Quoted 50 lines
Signed-off-by Thomas Meyer <[email protected]>--- arch/x86/ia32/ia32entry.S | 2 +- fs/compat.c | 6 ++++++ include/linux/compat.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletions(-)arch/x86/ia32/ia32entry.S +1
-1@@ -671,7 +671,7 @@ ia32_sys_call_table: .quad sys_getresuid16 /* 165 */ .quad sys32_vm86_warning /* vm86 */ .quad quiet_ni_syscall /* query_module */ - .quad sys_poll + .quad compat_sys_poll .quad quiet_ni_syscall /* old nfsservctl */ .quad sys_setresgid16 /* 170 */ .quad sys_getresgid16fs/compat.c +6
-0@@ -1621,6 +1621,12 @@ asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp, sigsetsize); } +asmlinkage long compat_sys_poll (struct pollfd __user *ufds,unsigned int nfds, +int timeout) +{ +return sys_poll (ufds, nfds, timeout); +} +asmlinkage long compat_sys_ppoll (struct pollfd __user *ufds,unsigned int nfds,struct compat_timespec __user *tsp,const compat_sigset_t __user *sigmask,compat_size_t sigsetsize)include/linux/compat.h +2
-0@@ -433,6 +433,8 @@ asmlinkage long compat_sys_pselect6(int n, compat_ulong_t __user *inp,compat_ulong_t __user *exp, struct compat_timespec __user *tsp, void __user *sig); +asmlinkage long compat_sys_poll (struct pollfd __user *ufds,unsigned int nfds, +int timeout); asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, unsigned int nfds, struct compat_timespec __user *tsp,
Quoted 1 line · Thomas Meyer
sizeof(int/long) differs on x86 and
x86_64, so provide acompat_sys_poll().
Thanks. Looks good now.
I suspect other architectures using the compat layer need the same change though. Perhaps send a note to [email protected]
-Andi