From: Thomas Meyer <thomas@m3y3r.de>
To: Andi Kleen <andi@firstfloor.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH] sys_poll: Fix negative timeout values for x86 userland on x86_64 kernels
Date: Sat, 17 Sep 2011 14:30:25 +0200 [thread overview]
Message-ID: <1316262630.5814.9.camel@localhost.localdomain> (raw)
sizeof(int/long) differs on x86 and x86_64, so provide a compat_sys_poll().
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
arch/x86/ia32/ia32entry.S | 2 +-
fs/compat.c | 6 ++++++
include/linux/compat.h | 2 ++
3 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 54edb207..30f4116 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -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
diff --git a/fs/compat.c b/fs/compat.c
index 58b1da4..f176fda 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -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)
diff --git a/include/linux/compat.h b/include/linux/compat.h
index c6e7523..3bfb30a 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -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,
--
1.7.6
next reply other threads:[~2011-09-17 12:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-17 12:30 Thomas Meyer [this message]
2011-09-17 14:29 ` [PATCH] sys_poll: Fix negative timeout values for x86 userland on x86_64 kernels Eric Dumazet
2011-09-17 16:49 ` Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2011-09-24 8:31 Thomas Meyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1316262630.5814.9.camel@localhost.localdomain \
--to=thomas@m3y3r.de \
--cc=andi@firstfloor.org \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox