dect
/
linux-2.6
Archived
13
0
Fork 0
This repository has been archived on 2022-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
linux-2.6/arch/arm
Mika Westerberg 782a0fd167 ARM: 6005/1: arm: kprobes: fix register corruption with jprobes
Current implementation of jprobes allocates empty pt_regs from the
stack which is then passed to kprobe_handler() and eventually to
singlestep().  Now when instruction being simulated is STMFD (like
in normal function prologues without CONFIG_FRAME_POINTER), stores
using SP actually write over top of the fabricated pt_regs
structure.

This can be reproduced for example by using LKDTM module:
    # modprobe lkdtm
    # mount -t debugfs none /sys/kernel/debug
    # echo PANIC > /sys/kernel/debug/provoke-crash/INT_HW_IRQ_EN

after this, it fails with corrupted registers (before the requested crash would occur):

lkdtm: Crash point INT_HW_IRQ_EN of type PANIC hit, trigger in 9 rounds
lkdtm: Crash point INT_HW_IRQ_EN of type PANIC hit, trigger in 8 rounds
Internal error: Oops - undefined instruction: 0 [#1]
last sysfs file: /sys/devices/platform/serial8250.0/sleep_timeout
Modules linked in: lkdtm
CPU: 0    Not tainted  (2.6.34-rc2 #69)
PC is at irq_desc+0x1638/0xeeb0
LR is at 0x25
pc : [<c050b428>]    lr : [<00000025>]    psr: c80a0013
sp : ce94bd60  ip : c050b3e8  fp : a0000013
r10: c0aa453c  r9 : cf5d4000  r8 : ce9a1822
r7 : c050b424  r6 : 00000025  r5 : c039d8f8  r4 : c050b3e8
r3 : 00000001  r2 : cf4d0440  r1 : c039d8f8  r0 : 00000020
Flags: NZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 10c5387d  Table: 8e804019  DAC: 00000015
Process sh (pid: 496, stack limit = 0xce94a2e8)
Stack: (0xce94bd60 to 0xce94c000)
[...]
Code: 000002cd 00000000 00000000 00000001 (dead4ead)
---[ end trace 2b46d5f2b682f370 ]---
Kernel panic - not syncing: Fatal exception in interrupt

This patch allocates enough space (2 * sizeof(struct pt_regs)) from
the stack to prevent such corruption.

Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
Acked-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-03-29 17:33:33 +01:00
..
boot ARM: 5990/1: ARM: use __armv5tej_mmu_cache_flush for V5TEJ instead of __armv4_mmu_cache_flush 2010-03-15 14:32:02 +00:00
common [ARM] locomo: fix unpaired spin_lock_irqsave 2010-03-22 12:03:09 +08:00
configs Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-03-18 16:59:30 -07:00
include/asm ARM: 6001/1: removing compilation warning comming from clkdev.h 2010-03-29 17:33:32 +01:00
kernel ARM: 6005/1: arm: kprobes: fix register corruption with jprobes 2010-03-29 17:33:33 +01:00
lib
mach-aaec2000
mach-at91 ARM: 5986/1: at91sam9g20-ek: Correct braces in I2C registration code 2010-03-13 10:48:21 +00:00
mach-bcmring
mach-clps711x
mach-davinci Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
mach-dove Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-ebsa110
mach-ep93xx Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-03-12 16:04:50 -08:00
mach-footbridge Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-gemini Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-03-01 09:15:15 -08:00
mach-h720x
mach-integrator Merge branches 'clks' and 'pnx' into devel 2010-02-25 22:10:38 +00:00
mach-iop13xx Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-iop32x Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-iop33x Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-ixp4xx dma-mapping: arm: use generic pci_set_dma_mask and pci_set_consistent_dma_mask 2010-03-12 15:52:42 -08:00
mach-ixp23xx ARM: Fix IXP23xx build error in mach/memory.h 2010-03-20 15:33:09 +00:00
mach-ixp2000 Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-kirkwood [ARM] Kirkwood: WPS button keycode mapping 2010-03-23 13:48:14 -04:00
mach-ks8695
mach-l7200
mach-lh7a40x Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-loki Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-mmp [ARM] mmp: fix for variables in uncompress.h being discarded 2010-03-22 12:03:05 +08:00
mach-msm Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-mv78xx0 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-mx1 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-mx2 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-mx3 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-mx5 mx51_babbage: Fix ckih2 parameter in mx51_clocks_init function 2010-02-24 10:29:14 +01:00
mach-mx25 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-mxc91231 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-netx
mach-nomadik Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
mach-ns9xxx Merge branch 'misc2' into devel 2010-02-25 22:09:41 +00:00
mach-nuc93x
mach-omap1 Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-03-01 09:15:15 -08:00
mach-omap2 ARM/OMAP: Remove the +x bit from a couple of source files 2010-03-12 09:16:09 -08:00
mach-orion5x [ARM] Orion5x: replace KEY_WLAN with KEY_WPS_BUTTON 2010-03-23 13:48:15 -04:00
mach-pnx4008 Merge branches 'clks' and 'pnx' into devel 2010-02-25 22:10:38 +00:00
mach-pxa [ARM] pxa/raumfeld: fix button name 2010-03-22 12:03:11 +08:00
mach-realview Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-03-01 09:15:15 -08:00
mach-rpc ARM: Fix RiscPC decompressor build errors 2010-03-15 22:04:54 +00:00
mach-s3c24a0/include/mach Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-s3c64xx ARM: SAMSUNG: Fixup commit 4e6d488af3 2010-03-15 23:11:41 +00:00
mach-s3c2400
mach-s3c2410 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-03-12 16:04:50 -08:00
mach-s3c2412 ARM: SAMSUNG: Remove dma-plat.h to allow plat-s3c64xx to be removed 2010-02-21 23:10:35 +00:00
mach-s3c2440 ARM: S3C2440: Fix s3c2440 cpufreq compilation post move. 2010-03-15 22:43:12 +00:00
mach-s3c2443 ARM: Merge next-samsung-s3c2443-clock 2010-03-07 22:56:19 +00:00
mach-s5p6440 ARM: SAMSUNG: Fixup commit 4e6d488af3 2010-03-15 23:11:41 +00:00
mach-s5p6442 ARM: SAMSUNG: Fixup commit 4e6d488af3 2010-03-15 23:11:41 +00:00
mach-s5pc100 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2010-03-12 16:04:50 -08:00
mach-s5pv210 Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
mach-sa1100 Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-03-12 16:00:54 -08:00
mach-shark
mach-shmobile ARM: mach-shmobile: ap4evb SDHI0 platform data V2 2010-03-15 12:06:47 +09:00
mach-stmp37xx
mach-stmp378x
mach-u300 Merge branch 'for-next' into for-linus 2010-03-08 16:55:37 +01:00
mach-ux500 Merge branch 'master' into for-linus 2010-03-08 20:24:11 +00:00
mach-versatile Merge branches 'clks' and 'pnx' into devel 2010-02-25 22:10:38 +00:00
mach-w90x900 NUC900 LCD Controller Driver 2010-03-12 15:52:34 -08:00
mm ARM: 5996/1: ARM: Change the mandatory barriers implementation (4/4) 2010-03-25 21:13:50 +00:00
nwfpe
oprofile
plat-iop ARM: Add caller information to ioremap 2010-02-15 21:39:11 +00:00
plat-mxc Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
plat-nomadik Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00
plat-omap omap: McBSP: Drop unnecessary status/error bit clearing on reg_cacheretrieved register values 2010-03-12 09:16:09 -08:00
plat-orion
plat-pxa
plat-s3c24xx ARM: S3C2440: Fix s3c2440 cpufreq compilation post move. 2010-03-15 22:43:12 +00:00
plat-s5p ARM: S5PV210: Update Kconfig and Makefiles 2010-02-24 22:47:23 +00:00
plat-s5pc1xx
plat-samsung ARM: SAMSUNG: Fix build error from stale define in <plat/uncompress.h> 2010-03-15 22:57:18 +00:00
plat-stmp3xxx Merge branches 'clks' and 'pnx' into devel 2010-02-25 22:10:38 +00:00
tools ARM: Update mach-types 2010-03-20 15:37:39 +00:00
vfp ARM: 5997/1: ARM: Correct the VFPv3 detection 2010-03-28 10:40:14 +01:00
Kconfig ARM: Fix sorting of platform group config options and includes 2010-03-15 19:03:06 +00:00
Kconfig-nommu
Kconfig.debug ARM: SAMSUNG: Move plat-s3c Kconfig entries to plat-samsung and plat-s3c24xx 2010-02-24 01:52:06 +00:00
Makefile Merge branch 'origin' into devel-stable 2010-03-08 20:21:04 +00:00