Commit 0723ce6a authored by Yanmin Zhang's avatar Yanmin Zhang Committed by Linus Torvalds

[PATCH] x86_64: Fix 32bit aio setup

Kernel 2.6.9-rc3-mm3 has a bug in function sys32_io_setup in file
arch/x86_64/ia32/sys_ia32.c.  Local variable ctx64 is not initiated before
sys32_io_setup calls sys_io_setup.  If ctx64 is not zero, and sys_io_setup
will return -EINVAL.  Generic function compat_sys_io_setup has not the bug.

Here is the patch against 2.6.9-rc3-mm3. Just use compat_sys_io_setup to
replace sys32_io_setup.
Signed-off-by: default avatarZhang Yanmin <yanmin.zhang@intel.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a6d21e85
......@@ -547,7 +547,7 @@ ia32_sys_call_table:
.quad compat_sys_sched_getaffinity
.quad sys32_set_thread_area
.quad sys32_get_thread_area
.quad sys32_io_setup /* 245 */
.quad compat_sys_io_setup /* 245 */
.quad sys_io_destroy
.quad sys32_io_getevents
.quad sys32_io_submit
......
......@@ -1186,21 +1186,6 @@ long sys32_kill(int pid, int sig)
return sys_kill(pid, sig);
}
long sys32_io_setup(unsigned nr_reqs, u32 __user *ctx32p)
{
long ret;
aio_context_t ctx64;
mm_segment_t oldfs = get_fs();
set_fs(KERNEL_DS);
ret = sys_io_setup(nr_reqs, &ctx64);
set_fs(oldfs);
/* truncating is ok because it's a user address */
if (!ret)
ret = put_user((u32)ctx64, ctx32p);
return ret;
}
asmlinkage long sys32_io_submit(aio_context_t ctx_id, int nr,
compat_uptr_t __user *iocbpp)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment