Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756289Ab3ETMmz (ORCPT ); Mon, 20 May 2013 08:42:55 -0400 Received: from mail-pb0-f48.google.com ([209.85.160.48]:50981 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755331Ab3ETMmx (ORCPT ); Mon, 20 May 2013 08:42:53 -0400 Date: Mon, 20 May 2013 21:42:44 +0900 Message-ID: <87vc6dzut7.wl%satoru.takeuchi@gmail.com> From: Satoru Takeuchi To: Greg Kroah-Hartman Cc: Al Viro , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Alexander van Heukelum Subject: Re: [ 027/102] x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...) In-Reply-To: <20130519183727.GC17958@kroah.com> References: <20130517213244.277411019@linuxfoundation.org> <20130517213247.228264908@linuxfoundation.org> <20130517224930.GW25399@ZenIV.linux.org.uk> <20130517235133.GC20969@kroah.com> <20130519183727.GC17958@kroah.com> User-Agent: Wanderlust/2.14.0 (Africa) Emacs/23.4 Mule/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4918 Lines: 138 At Sun, 19 May 2013 11:37:27 -0700, Greg Kroah-Hartman wrote: > > On Fri, May 17, 2013 at 04:51:33PM -0700, Greg Kroah-Hartman wrote: > > On Fri, May 17, 2013 at 11:49:30PM +0100, Al Viro wrote: > > > On Fri, May 17, 2013 at 02:35:42PM -0700, Greg Kroah-Hartman wrote: > > > > 3.9-stable review patch. If anyone has any objections, please let me know. > > > > > > This is seriously wrong. For 3.9 you _need_ asmlinkage_protect() in that > > > thing; by the time when that went into the tree, mainline already had > > > it generated automatically by SYSCALL_DEFINE, so there was no point in > > > that part of patch - the switch to SYSCALL_DEFINE alone did the job. > > > For 3.9 it's very much needed; as the matter of fact, in 3.9 that commit > > > is a no-op in the form you took. > > > > > > We can grab all prereqs into 3.9-stable (there's not that much of those), > > > but that would be much more intrusive than the variant adding explicit > > > asmlinkage_protect() in those two syscalls. > > > > Ok, Alexander was saying something was off here. > > > > Can someone send me just the needed patch to get this working properly, > > and I will be glad to drop this one from the 3.9.x tree. > > I've now dropped this, and will release without it. Here is the backported patch. It calls asmlinkage_protect() properly and is as similar to upstream patch as possible. It can be applied to 3.9.3 and can be built successfully. Satoru --- From: Satoru Takeuchi Date: Mon, 20 May 2013 21:32:20 +0900 Subject: x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...) commit 5522ddb3fc0dfd4a503c8278eafd88c9f2d3fada upstream. Commit 49cb25e9290 x86: 'get rid of pt_regs argument in vm86/vm86old' got rid of the pt_regs stub for sys_vm86old and sys_vm86. The functions were, however, not changed to use the calling convention for syscalls. Reported-and-tested-by: Hans de Bruin Signed-off-by: Alexander van Heukelum Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/syscalls.h | 4 ++-- arch/x86/kernel/vm86_32.c | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h index 6cf0a9c..5a0be0a 100644 --- a/arch/x86/include/asm/syscalls.h +++ b/arch/x86/include/asm/syscalls.h @@ -37,8 +37,8 @@ asmlinkage int sys_get_thread_area(struct user_desc __user *); unsigned long sys_sigreturn(void); /* kernel/vm86_32.c */ -int sys_vm86old(struct vm86_struct __user *); -int sys_vm86(unsigned long, unsigned long); +asmlinkage long sys_vm86old(struct vm86_struct __user *); +asmlinkage long sys_vm86(unsigned long, unsigned long); #else /* CONFIG_X86_32 */ diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c index 1cf5766..3dbdd9c 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -48,7 +49,6 @@ #include #include #include -#include /* * Known problems: @@ -202,17 +202,16 @@ out: static int do_vm86_irq_handling(int subfunction, int irqnumber); static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk); -int sys_vm86old(struct vm86_struct __user *v86) +SYSCALL_DEFINE1(vm86old, struct vm86_struct __user *, v86) { struct kernel_vm86_struct info; /* declare this _on top_, * this avoids wasting of stack space. * This remains on the stack until we * return to 32 bit user space. */ - struct task_struct *tsk; + struct task_struct *tsk = current; int tmp, ret = -EPERM; - tsk = current; if (tsk->thread.saved_sp0) goto out; tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, @@ -227,11 +226,12 @@ int sys_vm86old(struct vm86_struct __user *v86) do_sys_vm86(&info, tsk); ret = 0; /* we never return here */ out: + asmlinkage_protect(1, ret, v86); return ret; } -int sys_vm86(unsigned long cmd, unsigned long arg) +SYSCALL_DEFINE2(vm86, unsigned long, cmd, unsigned long, arg) { struct kernel_vm86_struct info; /* declare this _on top_, * this avoids wasting of stack space. @@ -278,6 +278,7 @@ int sys_vm86(unsigned long cmd, unsigned long arg) do_sys_vm86(&info, tsk); ret = 0; /* we never return here */ out: + asmlinkage_protect(2, ret, cmd, arg); return ret; } -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/