From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: John David Anglin <dave.anglin@bell.net>, Helge Deller <deller@gmx.de>
Subject: [56/65] parisc: only re-enable interrupts if we need to schedule or deliver signals when returning to userspace
Date: Mon, 03 Jun 2013 18:11:12 -0400 [thread overview]
Message-ID: <20130603221201.828398198@goodmis.org> (raw)
In-Reply-To: 20130603221016.243553628@goodmis.org
[-- Attachment #1: 0056-parisc-only-re-enable-interrupts-if-we-need-to-sched.patch --]
[-- Type: text/plain, Size: 2409 bytes --]
3.6.11.5 stable review patch.
If anyone has any objections, please let me know.
------------------
From: John David Anglin <dave.anglin@bell.net>
[ Upstream commit c207a76bf155cb5cf24cf849c08f6555e9180594 ]
Helge and I have found that we have a kernel stack overflow problem
which causes a variety of random failures.
Currently, we re-enable interrupts when returning from an external
interrupt incase we need to schedule or delivery
signals. As a result, a potentially unlimited number of interrupts
can occur while we are running on the kernel
stack. It is very limited in space (currently, 16k). This change
defers enabling interrupts until we have
actually decided to schedule or delivery signals. This only occurs
when we about to return to userspace. This
limits the number of interrupts on the kernel stack to one. In other
cases, interrupts remain disabled until the
final return from interrupt (rfi).
Signed-off-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
arch/parisc/kernel/entry.S | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 18670a0..38a4998 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -909,11 +909,6 @@ ENTRY(syscall_exit_rfi)
STREG %r19,PT_SR7(%r16)
intr_return:
- /* NOTE: Need to enable interrupts incase we schedule. */
- ssm PSW_SM_I, %r0
-
-intr_check_resched:
-
/* check for reschedule */
mfctl %cr30,%r1
LDREG TI_FLAGS(%r1),%r19 /* sched.h: TIF_NEED_RESCHED */
@@ -940,6 +935,11 @@ intr_check_sig:
LDREG PT_IASQ1(%r16), %r20
cmpib,COND(=),n 0,%r20,intr_restore /* backward */
+ /* NOTE: We need to enable interrupts if we have to deliver
+ * signals. We used to do this earlier but it caused kernel
+ * stack overflows. */
+ ssm PSW_SM_I, %r0
+
copy %r0, %r25 /* long in_syscall = 0 */
#ifdef CONFIG_64BIT
ldo -16(%r30),%r29 /* Reference param save area */
@@ -991,6 +991,10 @@ intr_do_resched:
cmpib,COND(=) 0, %r20, intr_do_preempt
nop
+ /* NOTE: We need to enable interrupts if we schedule. We used
+ * to do this earlier but it caused kernel stack overflows. */
+ ssm PSW_SM_I, %r0
+
#ifdef CONFIG_64BIT
ldo -16(%r30),%r29 /* Reference param save area */
#endif
--
1.7.10.4
next prev parent reply other threads:[~2013-06-03 22:11 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-03 22:10 [00/65] 3.6.11.5-stable review Steven Rostedt
2013-06-03 22:10 ` [01/65] KVM: VMX: fix halt emulation while emulating invalid guest sate Steven Rostedt
2013-06-03 22:10 ` [02/65] ARM: OMAP: RX-51: change probe order of touchscreen and panel SPI devices Steven Rostedt
2013-06-03 22:10 ` [03/65] ASoC: wm8994: missing break in wm8994_aif3_hw_params() Steven Rostedt
2013-06-03 22:10 ` [04/65] ACPICA: Fix possible buffer overflow during a field unit read operation Steven Rostedt
2013-06-03 22:10 ` [05/65] ALSA: HDA: Fix Oops caused by dereference NULL pointer Steven Rostedt
2013-06-03 22:10 ` [06/65] dm stripe: fix regression in stripe_width calculation Steven Rostedt
2013-06-03 22:10 ` [07/65] dm bufio: avoid a possible __vmalloc deadlock Steven Rostedt
2013-06-04 12:59 ` Mikulas Patocka
2013-06-04 14:42 ` Steven Rostedt
2013-06-05 14:54 ` Steven Rostedt
2013-06-03 22:10 ` [08/65] dm snapshot: fix error return code in snapshot_ctr Steven Rostedt
2013-06-03 22:10 ` [09/65] math64: New div64_u64_rem helper Steven Rostedt
2013-06-04 13:45 ` Stanislaw Gruszka
2013-06-04 14:43 ` Steven Rostedt
2013-06-03 22:10 ` [10/65] hp_accel: Ignore the error from lis3lv02d_poweron() at resume Steven Rostedt
2013-06-03 22:10 ` [11/65] xen/vcpu/pvhvm: Fix vcpu hotplugging hanging Steven Rostedt
2013-06-03 22:10 ` [12/65] sd: fix array cache flushing bug causing performance problems Steven Rostedt
2013-06-03 22:10 ` [13/65] audit: Syscall rules are not applied to existing processes on non-x86 Steven Rostedt
2013-06-03 22:10 ` [14/65] timer: Dont reinitialize the cpu base lock during CPU_UP_PREPARE Steven Rostedt
2013-06-03 22:10 ` [15/65] tick: Cleanup NOHZ per cpu data on cpu down Steven Rostedt
2013-06-03 22:10 ` [16/65] tracing: Fix leaks of filter preds Steven Rostedt
2013-06-03 22:10 ` [17/65] ext4: limit group search loop for non-extent files Steven Rostedt
2013-06-03 22:10 ` [18/65] ARM: 7720/1: ARM v6/v7 cmpxchg64 shouldnt clear upper 32 bits of the old/new value Steven Rostedt
2013-06-03 22:10 ` [19/65] powerpc: Bring all threads online prior to migration/hibernation Steven Rostedt
2013-06-03 22:10 ` [20/65] powerpc/kexec: Fix kexec when using VMX optimised memcpy Steven Rostedt
2013-06-03 22:10 ` [21/65] ath9k: fix key allocation error handling for powersave keys Steven Rostedt
2013-06-03 22:10 ` [22/65] mwifiex: clear is_suspended flag when interrupt is received early Steven Rostedt
2013-06-03 22:10 ` [23/65] mwifiex: fix memory leak issue when driver unload Steven Rostedt
2013-06-03 22:10 ` [24/65] mwifiex: fix setting of multicast filter Steven Rostedt
2013-06-03 22:10 ` [25/65] tile: support new Tilera hypervisor Steven Rostedt
2013-06-03 22:10 ` [26/65] B43: Handle DMA RX descriptor underrun Steven Rostedt
2013-06-03 22:10 ` [27/65] drm/mgag200: Fix writes into MGA1064_PIX_CLK_CTL register Steven Rostedt
2013-06-03 22:10 ` [28/65] drm/mgag200: Fix framebuffer base address programming Steven Rostedt
2013-06-03 22:10 ` [29/65] tcp: force a dst refcount when prequeue packet Steven Rostedt
2013-06-03 22:10 ` [30/65] sfc: Fix naming of MTD partitions for FPGA bitfiles Steven Rostedt
2013-06-03 22:10 ` [31/65] net: mac802154: comparision issue of type cast, finding by EXTRA_CFLAGS=-W Steven Rostedt
2013-06-03 22:10 ` [32/65] 3c509.c: call SET_NETDEV_DEV for all device types (ISA/ISAPnP/EISA) Steven Rostedt
2013-06-03 22:10 ` [33/65] net_sched: act_ipt forward compat with xtables Steven Rostedt
2013-06-03 22:10 ` [34/65] net: use netdev_features_t in skb_needs_linearize() Steven Rostedt
2013-06-03 22:10 ` [35/65] net: vlan,ethtool: netdev_features_t is more than 32 bit Steven Rostedt
2013-06-03 22:10 ` [36/65] bridge: fix race with topology change timer Steven Rostedt
2013-06-03 22:10 ` [37/65] packet: tpacket_v3: do not trigger bug() on wrong header status Steven Rostedt
2013-06-03 22:10 ` [38/65] 3c59x: fix freeing nonexistent resource on driver unload Steven Rostedt
2013-06-03 22:10 ` [39/65] 3c59x: fix PCI resource management Steven Rostedt
2013-06-03 22:10 ` [40/65] if_cablemodem.h: Add parenthesis around ioctl macros Steven Rostedt
2013-06-03 22:10 ` [41/65] macvlan: fix passthru mode race between dev removal and rx path Steven Rostedt
2013-06-03 22:10 ` [42/65] ipv6: do not clear pinet6 field Steven Rostedt
2013-06-03 22:10 ` [43/65] xfrm6: release dev before returning error Steven Rostedt
2013-06-03 22:11 ` [44/65] pch_dma: Use GFP_ATOMIC because called from interrupt context Steven Rostedt
2013-06-03 22:11 ` [45/65] watchdog: Fix race condition in registration code Steven Rostedt
2013-06-03 22:11 ` [46/65] drbd: fix for deadlock when using automatic split-brain-recovery Steven Rostedt
2013-06-03 22:11 ` [47/65] ARM: EXYNOS5: Fix kernel dump in AFTR idle mode Steven Rostedt
2013-06-03 22:11 ` [48/65] drivers/rtc/rtc-pcf2123.c: fix error return code in pcf2123_probe() Steven Rostedt
2013-06-03 22:11 ` [49/65] iscsi-target: Fix processing of OOO commands Steven Rostedt
2013-06-03 22:11 ` [50/65] target: close target_put_sess_cmd() vs. core_tmr_abort_task() race Steven Rostedt
2013-06-03 22:11 ` [51/65] ACPI / EC: Restart transaction even when the IBF flag set Steven Rostedt
2013-06-03 22:11 ` [52/65] drivers/char/ipmi: memcpy, need additional 2 bytes to avoid memory overflow Steven Rostedt
2013-06-03 22:11 ` [53/65] ipmi: ipmi_devintf: compat_ioctl method fails to take ipmi_mutex Steven Rostedt
2013-06-03 22:11 ` [54/65] drm/radeon: check incoming cliprects pointer Steven Rostedt
2013-06-03 22:11 ` [55/65] usermodehelper: check subprocess_info->path != NULL Steven Rostedt
2013-06-03 22:11 ` Steven Rostedt [this message]
2013-06-03 22:11 ` [57/65] parisc: fix SMP races when updating PTE and TLB entries in entry.S Steven Rostedt
2013-06-03 22:11 ` [58/65] parisc: fix NATIVE set up in build Steven Rostedt
2013-06-03 22:11 ` [59/65] parisc: make default cross compiler search more robust (v3) Steven Rostedt
2013-06-03 22:11 ` [60/65] btrfs: dont stop searching after encountering the wrong item Steven Rostedt
2013-06-03 22:11 ` [61/65] hwmon: fix error return code in abituguru_probe() Steven Rostedt
2013-06-03 22:11 ` [62/65] i2c: designware: fix RX FIFO overrun Steven Rostedt
2013-06-03 22:11 ` [63/65] i2c: designware: always clear interrupts before enabling them Steven Rostedt
2013-06-03 22:11 ` [64/65] drm/radeon: Fix VRAM size calculation for VRAM >= 4GB Steven Rostedt
2013-06-03 22:11 ` [65/65] virtio_console: fix uapi header Steven Rostedt
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=20130603221201.828398198@goodmis.org \
--to=rostedt@goodmis.org \
--cc=dave.anglin@bell.net \
--cc=deller@gmx.de \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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