All of lore.kernel.org
 help / color / mirror / Atom feed
From: Satoru Takeuchi <satoru.takeuchi@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	Alexander van Heukelum <heukelum@fastmail.fm>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [ 21/21] x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...)
Date: Fri, 24 May 2013 20:13:19 +0900	[thread overview]
Message-ID: <87li743a28.wl%satoru.takeuchi@gmail.com> (raw)
In-Reply-To: <20130522205235.095666610@linuxfoundation.org>

At Wed, 22 May 2013 15:10:39 -0700,
Greg Kroah-Hartman wrote:
> 
> 3.9-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Alexander van Heukelum <heukelum@fastmail.fm>
> 
> 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.

> 
> [AV: killed asmlinkage_protect() - it's done automatically now]

The Patch itself is OK. But the above one line is not correct and should
be removed. This backport patch calls asmlinkage_protect() since 3.9
doesn't automatically call it. It's why the original upstream patch is
dropped from 3.9.3.

Thanks,
Satoru

> 
> Backported-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
> Reported-and-tested-by: Hans de Bruin <jmdebruin@xmsnet.nl>
> Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> ---
>  arch/x86/include/asm/syscalls.h |    4 ++--
>  arch/x86/kernel/vm86_32.c       |   11 ++++++-----
>  2 files changed, 8 insertions(+), 7 deletions(-)
> 
> --- a/arch/x86/include/asm/syscalls.h
> +++ b/arch/x86/include/asm/syscalls.h
> @@ -37,8 +37,8 @@ asmlinkage int sys_get_thread_area(struc
>  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 */
>  
> --- a/arch/x86/kernel/vm86_32.c
> +++ b/arch/x86/kernel/vm86_32.c
> @@ -33,6 +33,7 @@
>  #include <linux/capability.h>
>  #include <linux/errno.h>
>  #include <linux/interrupt.h>
> +#include <linux/syscalls.h>
>  #include <linux/sched.h>
>  #include <linux/kernel.h>
>  #include <linux/signal.h>
> @@ -48,7 +49,6 @@
>  #include <asm/io.h>
>  #include <asm/tlbflush.h>
>  #include <asm/irq.h>
> -#include <asm/syscalls.h>
>  
>  /*
>   * 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 __use
>  	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
>  	do_sys_vm86(&info, tsk);
>  	ret = 0;	/* we never return here */
>  out:
> +	asmlinkage_protect(2, ret, cmd, arg);
>  	return ret;
>  }
>  
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-05-24 11:19 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 22:10 [ 00/21] 3.9.4-stable review Greg Kroah-Hartman
2013-05-22 22:10 ` [ 01/21] arm64: debug: clear mdscr_el1 instead of taking the OS lock Greg Kroah-Hartman
2013-05-22 22:10 ` [ 02/21] arm64: mm: Fix operands of clz in __flush_dcache_all Greg Kroah-Hartman
2013-05-22 22:10 ` [ 03/21] btrfs: dont stop searching after encountering the wrong item Greg Kroah-Hartman
2013-05-22 22:10 ` [ 04/21] hwmon: fix error return code in abituguru_probe() Greg Kroah-Hartman
2013-05-22 22:10 ` [ 05/21] i2c: designware: fix RX FIFO overrun Greg Kroah-Hartman
2013-05-22 22:10 ` [ 06/21] i2c: designware: always clear interrupts before enabling them Greg Kroah-Hartman
2013-05-22 22:10 ` [ 07/21] x86: Fix bit corruption at CPU resume time Greg Kroah-Hartman
2013-05-22 22:10 ` [ 08/21] drm/nouveau/bios: fix thinko in ZM_MASK_ADD opcode Greg Kroah-Hartman
2013-05-22 22:10 ` [ 09/21] drm/radeon: Fix VRAM size calculation for VRAM >= 4GB Greg Kroah-Hartman
2013-05-22 22:10 ` [ 10/21] virtio_console: fix uapi header Greg Kroah-Hartman
2013-05-22 22:10 ` [ 11/21] NTB: variable dereferenced before check Greg Kroah-Hartman
2013-05-22 22:10 ` [ 12/21] ntb: off by one sanity checks Greg Kroah-Hartman
2013-05-22 22:10 ` [ 13/21] NTB: fix pointer math issues Greg Kroah-Hartman
2013-05-22 22:10 ` [ 14/21] NTB: Handle 64bit BAR sizes Greg Kroah-Hartman
2013-05-22 22:10 ` [ 15/21] NTB: Link toggle memory leak Greg Kroah-Hartman
2013-05-22 22:10 ` [ 16/21] NTB: reset tx_index on link toggle Greg Kroah-Hartman
2013-05-22 22:10 ` [ 17/21] NTB: Correctly handle receive buffers of the minimal size Greg Kroah-Hartman
2013-05-22 22:10 ` [ 18/21] NTB: memcpy lockup workaround Greg Kroah-Hartman
2013-05-22 22:10 ` [ 19/21] ntb_netdev: remove from list on exit Greg Kroah-Hartman
2013-05-22 22:10 ` [ 20/21] NTB: Multiple NTB client fix Greg Kroah-Hartman
2013-05-22 22:10 ` [ 21/21] x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...) Greg Kroah-Hartman
2013-05-24 11:13   ` Satoru Takeuchi [this message]
2013-05-23 16:52 ` [ 00/21] 3.9.4-stable review Shuah Khan
2013-05-23 16:52   ` Shuah Khan
2013-05-23 16:57   ` Greg Kroah-Hartman
2013-05-24 11:46 ` Satoru Takeuchi

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=87li743a28.wl%satoru.takeuchi@gmail.com \
    --to=satoru.takeuchi@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heukelum@fastmail.fm \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.