]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.4.96/x86-x32-use-compat-shims-for-io_-setup-submit.patch
Fix up backported ptrace patch
[thirdparty/kernel/stable-queue.git] / releases / 3.4.96 / x86-x32-use-compat-shims-for-io_-setup-submit.patch
1 From 7fd44dacdd803c0bbf38bf478d51d280902bb0f1 Mon Sep 17 00:00:00 2001
2 From: Mike Frysinger <vapier@gentoo.org>
3 Date: Sun, 4 May 2014 20:43:15 -0400
4 Subject: x86, x32: Use compat shims for io_{setup,submit}
5
6 From: Mike Frysinger <vapier@gentoo.org>
7
8 commit 7fd44dacdd803c0bbf38bf478d51d280902bb0f1 upstream.
9
10 The io_setup takes a pointer to a context id of type aio_context_t.
11 This in turn is typed to a __kernel_ulong_t. We could tweak the
12 exported headers to define this as a 64bit quantity for specific
13 ABIs, but since we already have a 32bit compat shim for the x86 ABI,
14 let's just re-use that logic. The libaio package is also written to
15 expect this as a pointer type, so a compat shim would simplify that.
16
17 The io_submit func operates on an array of pointers to iocb structs.
18 Padding out the array to be 64bit aligned is a huge pain, so convert
19 it over to the existing compat shim too.
20
21 We don't convert io_getevents to the compat func as its only purpose
22 is to handle the timespec struct, and the x32 ABI uses 64bit times.
23
24 With this change, the libaio package can now pass its testsuite when
25 built for the x32 ABI.
26
27 Signed-off-by: Mike Frysinger <vapier@gentoo.org>
28 Link: http://lkml.kernel.org/r/1399250595-5005-1-git-send-email-vapier@gentoo.org
29 Cc: H.J. Lu <hjl.tools@gmail.com>
30 Signed-off-by: H. Peter Anvin <hpa@zytor.com>
31 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32
33 ---
34 arch/x86/syscalls/syscall_64.tbl | 6 ++++--
35 1 file changed, 4 insertions(+), 2 deletions(-)
36
37 --- a/arch/x86/syscalls/syscall_64.tbl
38 +++ b/arch/x86/syscalls/syscall_64.tbl
39 @@ -212,10 +212,10 @@
40 203 common sched_setaffinity sys_sched_setaffinity
41 204 common sched_getaffinity sys_sched_getaffinity
42 205 64 set_thread_area
43 -206 common io_setup sys_io_setup
44 +206 64 io_setup sys_io_setup
45 207 common io_destroy sys_io_destroy
46 208 common io_getevents sys_io_getevents
47 -209 common io_submit sys_io_submit
48 +209 64 io_submit sys_io_submit
49 210 common io_cancel sys_io_cancel
50 211 64 get_thread_area
51 212 common lookup_dcookie sys_lookup_dcookie
52 @@ -353,3 +353,5 @@
53 540 x32 process_vm_writev compat_sys_process_vm_writev
54 541 x32 setsockopt compat_sys_setsockopt
55 542 x32 getsockopt compat_sys_getsockopt
56 +543 x32 io_setup compat_sys_io_setup
57 +544 x32 io_submit compat_sys_io_submit