From: Satoru Takeuchi <satoru.takeuchi@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Al Viro <viro@ZenIV.linux.org.uk>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Alexander van Heukelum <heukelum@fastmail.fm>
Subject: Re: [ 027/102] x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...)
Date: Mon, 20 May 2013 21:42:44 +0900 [thread overview]
Message-ID: <87vc6dzut7.wl%satoru.takeuchi@gmail.com> (raw)
In-Reply-To: <20130519183727.GC17958@kroah.com>
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 <satoru.takeuchi@gmail.com>
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 <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(-)
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 <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 __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
next prev parent reply other threads:[~2013-05-20 12:42 UTC|newest]
Thread overview: 113+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-17 21:35 [ 000/102] 3.9.3-stable review Greg Kroah-Hartman
2013-05-17 21:35 ` [ 001/102] KVM: VMX: fix halt emulation while emulating invalid guest sate Greg Kroah-Hartman
2013-05-17 21:35 ` [ 002/102] KVM: emulator: emulate AAM Greg Kroah-Hartman
2013-05-17 21:35 ` [ 003/102] KVM: emulator: emulate XLAT Greg Kroah-Hartman
2013-05-17 21:35 ` [ 004/102] KVM: emulator: emulate SALC Greg Kroah-Hartman
2013-05-17 21:35 ` [ 005/102] HID: reintroduce fix-up for certain Sony RF receivers Greg Kroah-Hartman
2013-05-17 21:35 ` [ 006/102] ARM: OMAP: RX-51: change probe order of touchscreen and panel SPI devices Greg Kroah-Hartman
2013-05-17 21:35 ` [ 007/102] ASoC: wm8994: missing break in wm8994_aif3_hw_params() Greg Kroah-Hartman
2013-05-17 21:35 ` [ 008/102] ACPICA: Fix possible buffer overflow during a field unit read operation Greg Kroah-Hartman
2013-05-17 21:35 ` [ 009/102] Revert "ALSA: hda - Dont set up active streams twice" Greg Kroah-Hartman
2013-05-17 21:35 ` [ 010/102] ALSA: HDA: Fix Oops caused by dereference NULL pointer Greg Kroah-Hartman
2013-05-17 21:35 ` [ 011/102] ALSA: hda - Fix 3.9 regression of EAPD init on Conexant codecs Greg Kroah-Hartman
2013-05-17 21:35 ` [ 012/102] DMA: OF: Check properties value before running be32_to_cpup() on it Greg Kroah-Hartman
2013-05-17 21:35 ` [ 013/102] dm table: fix write same support Greg Kroah-Hartman
2013-05-17 21:35 ` [ 014/102] dm stripe: fix regression in stripe_width calculation Greg Kroah-Hartman
2013-05-17 21:35 ` [ 015/102] dm bufio: avoid a possible __vmalloc deadlock Greg Kroah-Hartman
2013-05-17 21:35 ` [ 016/102] dm snapshot: fix error return code in snapshot_ctr Greg Kroah-Hartman
2013-05-17 21:35 ` [ 017/102] dm cache: fix error return code in cache_create Greg Kroah-Hartman
2013-05-17 21:35 ` [ 018/102] math64: New div64_u64_rem helper Greg Kroah-Hartman
2013-05-17 21:35 ` [ 019/102] sched: Lower chances of cputime scaling overflow Greg Kroah-Hartman
2013-05-17 21:35 ` [ 020/102] sched: Avoid " Greg Kroah-Hartman
2013-05-17 21:35 ` [ 021/102] sched: Do not account bogus utime Greg Kroah-Hartman
2013-05-17 21:35 ` [ 022/102] Revert "math64: New div64_u64_rem helper" Greg Kroah-Hartman
2013-05-17 21:35 ` [ 023/102] sched: Avoid prev->stime underflow Greg Kroah-Hartman
2013-05-17 21:35 ` [ 024/102] nfsd4: dont allow owner override on 4.1 CLAIM_FH opens Greg Kroah-Hartman
2013-05-17 21:35 ` [ 025/102] nfsd: fix oops when legacy_recdir_name_error is passed a -ENOENT error Greg Kroah-Hartman
2013-05-17 21:35 ` [ 026/102] hp_accel: Ignore the error from lis3lv02d_poweron() at resume Greg Kroah-Hartman
2013-05-17 21:35 ` [ 027/102] x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...) Greg Kroah-Hartman
2013-05-17 22:49 ` Al Viro
2013-05-17 23:51 ` Greg Kroah-Hartman
2013-05-19 12:58 ` Satoru Takeuchi
2013-05-19 18:37 ` Greg Kroah-Hartman
2013-05-20 12:42 ` Satoru Takeuchi [this message]
2013-05-17 21:35 ` [ 028/102] shm: fix null pointer deref when userspace specifies invalid hugepage size Greg Kroah-Hartman
2013-05-17 21:35 ` [ 029/102] xen/vcpu/pvhvm: Fix vcpu hotplugging hanging Greg Kroah-Hartman
2013-05-17 21:35 ` [ 030/102] SCSI: sd: fix array cache flushing bug causing performance problems Greg Kroah-Hartman
2013-05-17 21:35 ` [ 031/102] audit: Syscall rules are not applied to existing processes on non-x86 Greg Kroah-Hartman
2013-05-17 21:35 ` [ 032/102] audit: vfs: fix audit_inode call in O_CREAT case of do_last Greg Kroah-Hartman
2013-05-17 21:35 ` [ 033/102] time: Revert ALWAYS_USE_PERSISTENT_CLOCK compile time optimizaitons Greg Kroah-Hartman
2013-05-17 21:35 ` [ 034/102] timer: Dont reinitialize the cpu base lock during CPU_UP_PREPARE Greg Kroah-Hartman
2013-05-17 21:35 ` [ 035/102] tick: Cleanup NOHZ per cpu data on cpu down Greg Kroah-Hartman
2013-05-17 21:35 ` [ 036/102] tracing: Fix leaks of filter preds Greg Kroah-Hartman
2013-05-17 21:35 ` [ 037/102] ext4: limit group search loop for non-extent files Greg Kroah-Hartman
2013-05-17 21:35 ` [ 038/102] x86/microcode: Add local mutex to fix physical CPU hot-add deadlock Greg Kroah-Hartman
2013-05-17 21:35 ` [ 039/102] ARM: 7720/1: ARM v6/v7 cmpxchg64 shouldnt clear upper 32 bits of the old/new value Greg Kroah-Hartman
2013-05-17 21:35 ` [ 040/102] powerpc: Bring all threads online prior to migration/hibernation Greg Kroah-Hartman
2013-05-17 21:35 ` [ 041/102] powerpc/kexec: Fix kexec when using VMX optimised memcpy Greg Kroah-Hartman
2013-05-17 21:35 ` [ 042/102] ath9k: fix key allocation error handling for powersave keys Greg Kroah-Hartman
2013-05-17 21:35 ` [ 043/102] mwifiex: clear is_suspended flag when interrupt is received early Greg Kroah-Hartman
2013-05-17 21:35 ` [ 044/102] mwifiex: fix memory leak issue when driver unload Greg Kroah-Hartman
2013-05-17 21:36 ` [ 045/102] mwifiex: fix setting of multicast filter Greg Kroah-Hartman
2013-05-17 21:36 ` [ 046/102] tile: support new Tilera hypervisor Greg Kroah-Hartman
2013-05-17 21:36 ` [ 047/102] B43: Handle DMA RX descriptor underrun Greg Kroah-Hartman
2013-05-17 21:36 ` [ 048/102] iwl4965: workaround connection regression on passive channel Greg Kroah-Hartman
2013-05-17 21:36 ` [ 049/102] drm/mgag200: Fix writes into MGA1064_PIX_CLK_CTL register Greg Kroah-Hartman
2013-05-17 21:36 ` [ 050/102] drm/mgag200: Fix framebuffer base address programming Greg Kroah-Hartman
2013-05-17 21:36 ` [ 051/102] drm/mm: fix dump table BUG Greg Kroah-Hartman
2013-05-17 21:36 ` [ 052/102] drm: dont check modeset locks in panic handler Greg Kroah-Hartman
2013-05-17 21:36 ` [ 053/102] drm/i915: clear the stolen fb before resuming Greg Kroah-Hartman
2013-05-17 21:36 ` [ 054/102] tcp: force a dst refcount when prequeue packet Greg Kroah-Hartman
2013-05-17 21:36 ` [ 055/102] sfc: Fix naming of MTD partitions for FPGA bitfiles Greg Kroah-Hartman
2013-05-17 21:36 ` [ 056/102] net: tun: release the reference of tun device in tun_recvmsg Greg Kroah-Hartman
2013-05-17 21:36 ` [ 057/102] net: mac802154: comparision issue of type cast, finding by EXTRA_CFLAGS=-W Greg Kroah-Hartman
2013-05-17 21:36 ` [ 058/102] tcp: reset timer after any SYNACK retransmit Greg Kroah-Hartman
2013-05-17 21:36 ` [ 059/102] 3c509.c: call SET_NETDEV_DEV for all device types (ISA/ISAPnP/EISA) Greg Kroah-Hartman
2013-05-17 21:36 ` [ 060/102] net_sched: act_ipt forward compat with xtables Greg Kroah-Hartman
2013-05-17 21:36 ` [ 061/102] net: use netdev_features_t in skb_needs_linearize() Greg Kroah-Hartman
2013-05-17 21:36 ` [ 062/102] net: vlan,ethtool: netdev_features_t is more than 32 bit Greg Kroah-Hartman
2013-05-17 21:36 ` [ 063/102] bridge: fix race with topology change timer Greg Kroah-Hartman
2013-05-17 21:36 ` [ 064/102] asix: fix BUG in receive path when lowering MTU Greg Kroah-Hartman
2013-05-17 21:36 ` [ 065/102] packet: tpacket_v3: do not trigger bug() on wrong header status Greg Kroah-Hartman
2013-05-17 21:36 ` [ 066/102] virtio: dont expose u16 in userspace api Greg Kroah-Hartman
2013-05-17 21:36 ` [ 067/102] net: frag, fix race conditions in LRU list maintenance Greg Kroah-Hartman
2013-05-17 21:36 ` [ 068/102] 3c59x: fix freeing nonexistent resource on driver unload Greg Kroah-Hartman
2013-05-17 21:36 ` [ 069/102] 3c59x: fix PCI resource management Greg Kroah-Hartman
2013-05-17 21:36 ` [ 070/102] if_cablemodem.h: Add parenthesis around ioctl macros Greg Kroah-Hartman
2013-05-17 21:36 ` [ 071/102] macvlan: fix passthru mode race between dev removal and rx path Greg Kroah-Hartman
2013-05-17 21:36 ` [ 072/102] ipv6: do not clear pinet6 field Greg Kroah-Hartman
2013-05-21 11:44 ` Roman Gushchin
2013-05-21 21:47 ` Eric Dumazet
2013-05-22 8:12 ` Roman Gushchin
2013-05-17 21:36 ` [ 073/102] ipv6,gre: do not leak info to user-space Greg Kroah-Hartman
2013-05-17 21:36 ` [ 074/102] xfrm6: release dev before returning error Greg Kroah-Hartman
2013-05-17 21:36 ` [ 075/102] pch_dma: Use GFP_ATOMIC because called from interrupt context Greg Kroah-Hartman
2013-05-17 21:36 ` [ 076/102] watchdog: Fix race condition in registration code Greg Kroah-Hartman
2013-05-17 21:36 ` [ 077/102] drbd: Fix build error when CONFIG_CRYPTO_HMAC is not set Greg Kroah-Hartman
2013-05-17 21:36 ` [ 078/102] drbd: fix memory leak Greg Kroah-Hartman
2013-05-17 21:36 ` [ 079/102] drbd: fix for deadlock when using automatic split-brain-recovery Greg Kroah-Hartman
2013-05-17 21:36 ` [ 080/102] VSOCK: Drop bogus __init annotation from vsock_init_tables() Greg Kroah-Hartman
2013-05-17 21:36 ` [ 081/102] ARM: EXYNOS5: Fix kernel dump in AFTR idle mode Greg Kroah-Hartman
2013-05-17 21:36 ` [ 082/102] drivers/rtc/rtc-pcf2123.c: fix error return code in pcf2123_probe() Greg Kroah-Hartman
2013-05-17 21:36 ` [ 083/102] cpufreq / intel_pstate: remove idle time and duration from sample and calculations Greg Kroah-Hartman
2013-05-17 21:36 ` [ 084/102] cpufreq / intel_pstate: use lowest requested max performance Greg Kroah-Hartman
2013-05-17 21:36 ` [ 085/102] cpufreq / intel_pstate: fix ffmpeg regression Greg Kroah-Hartman
2013-05-17 21:36 ` [ 086/102] iscsi-target: Fix processing of OOO commands Greg Kroah-Hartman
2013-05-17 21:36 ` [ 087/102] target: close target_put_sess_cmd() vs. core_tmr_abort_task() race Greg Kroah-Hartman
2013-05-17 21:36 ` [ 088/102] target/iblock: Fix WCE=1 + DPOFUA=1 backend WRITE regression Greg Kroah-Hartman
2013-05-17 21:36 ` [ 089/102] ACPI / EC: Restart transaction even when the IBF flag set Greg Kroah-Hartman
2013-05-17 21:36 ` [ 090/102] drivers/char/ipmi: memcpy, need additional 2 bytes to avoid memory overflow Greg Kroah-Hartman
2013-05-17 21:36 ` [ 091/102] ipmi: ipmi_devintf: compat_ioctl method fails to take ipmi_mutex Greg Kroah-Hartman
2013-05-17 21:36 ` [ 092/102] ASoC: da7213: Fix setting dmic_samplephase and dmic_clk_rate Greg Kroah-Hartman
2013-05-17 21:36 ` [ 093/102] drm/radeon: check incoming cliprects pointer Greg Kroah-Hartman
2013-05-17 21:36 ` [ 094/102] drm/radeon: restore nomodeset operation (v2) Greg Kroah-Hartman
2013-05-17 21:36 ` [ 095/102] usermodehelper: check subprocess_info->path != NULL Greg Kroah-Hartman
2013-05-17 21:36 ` [ 096/102] parisc: only re-enable interrupts if we need to schedule or deliver signals when returning to userspace Greg Kroah-Hartman
2013-05-17 21:36 ` [ 097/102] parisc: fix SMP races when updating PTE and TLB entries in entry.S Greg Kroah-Hartman
2013-05-17 21:36 ` [ 098/102] parisc: use long branch in fork_like macro Greg Kroah-Hartman
2013-05-17 21:36 ` [ 099/102] parisc: fix NATIVE set up in build Greg Kroah-Hartman
2013-05-17 21:36 ` [ 100/102] parisc: make default cross compiler search more robust (v3) Greg Kroah-Hartman
2013-05-17 21:36 ` [ 101/102] audit: Make testing for a valid loginuid explicit Greg Kroah-Hartman
2013-05-17 21:36 ` [ 102/102] target: Use FD_MAX_SECTORS/FD_BLOCKSIZE for blockdevs using fileio Greg Kroah-Hartman
2013-05-19 13:00 ` [ 000/102] 3.9.3-stable review Satoru Takeuchi
2013-05-19 18:38 ` Greg Kroah-Hartman
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=87vc6dzut7.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).