linux/arch/arm
Will Deacon acfdd4b1f7 ARM: 7791/1: a.out: remove partial a.out support
a.out support on ARM requires that argc, argv and envp are passed in
r0-r2 respectively, which requires hacking load_aout_binary to
prevent argc being clobbered by the return code. Whilst mainline kernels
do set the registers up in start_thread, the aout loader has never
carried the hack in mainline.

Initialising the registers in this way actually goes against the libc
expectations for ELF binaries, where argc, argv and envp are passed on
the stack, with r0 being used to hold a pointer to an exit function for
cleaning up after the dynamic linker if required. If the pointer is
NULL, then it is ignored. When execing an ELF binary, Linux currently
zeroes r0, then sets it to argc and then finally clobbers it with the
return value of the execve syscall, so we actually end up with:

	r0 = 0
	stack[0] = argc
	r1 = stack[1] = argv
	r2 = stack[2] = envp

libc treats r1 and r2 as undefined. The clobbering of r0 by sys_execve
works for user-spawned threads, but when executing an ELF binary from a
kernel thread (via call_usermodehelper), the execve is performed on the
ret_from_fork path, which restores r0 from the saved pt_regs, resulting
in argc being presented to the C library. This has horrible consequences
when the application exits, since we have an exit function registered
using argc, resulting in a jump to hyperspace.

This patch solves the problem by removing the partial a.out support from
arch/arm/ altogether.

Cc: <stable@vger.kernel.org>
Cc: Ashish Sangwan <ashishsangwan2@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-07-26 12:02:10 +01:00
..
boot ARM: SoC fixes for 3.11-rc 2013-07-13 15:00:26 -07:00
common arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
configs ARM: SoC fixes for 3.11-rc 2013-07-13 15:00:26 -07:00
crypto ARM: 7723/1: crypto: sha1-armv4-large.S: fix SP handling 2013-05-22 22:01:35 +01:00
include ARM: 7791/1: a.out: remove partial a.out support 2013-07-26 12:02:10 +01:00
kernel ARM: 7789/1: Do not run dummy_flush_tlb_a15_erratum() on non-Cortex-A15 2013-07-26 12:02:09 +01:00
kvm KVM fixes for 3.11 2013-07-03 13:21:40 -07:00
lib arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-at91 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-bcm ARM: bcm281xx: Remove init_irq declaration in machine description 2013-05-14 09:48:40 -07:00
mach-bcm2835 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-clps711x reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-cns3xxx reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-davinci Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2013-07-13 12:09:57 -07:00
mach-dove Watchdog: allow orion_wdt to be built for Dove 2013-07-11 22:17:56 +02:00
mach-ebsa110 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-ep93xx reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-exynos arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-footbridge reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-gemini
mach-highbank arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-imx arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-integrator reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-iop13xx reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-iop32x reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-iop33x
mach-ixp4xx ARM: SoC fixes for 3.11-rc 2013-07-13 15:00:26 -07:00
mach-keystone arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-kirkwood Watchdog: allow orion_wdt to be built for Dove 2013-07-11 22:17:56 +02:00
mach-ks8695 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-lpc32xx reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-mmp reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-msm arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-mv78xx0 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-mvebu arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-mxs Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-07-09 18:24:39 -07:00
mach-netx reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-nomadik reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-nspire arm: Add Initial TI-Nspire support 2013-06-21 20:06:30 +02:00
mach-omap1 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-omap2 arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-orion5x Watchdog: allow orion_wdt to be built for Dove 2013-07-11 22:17:56 +02:00
mach-picoxcell reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-prima2 arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-pxa reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-realview reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-rockchip arm: add basic support for Rockchip RK3066a boards 2013-06-21 09:21:02 +02:00
mach-rpc reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-s3c24xx cpufreq: s3c24xx: fix "depends on ARM_S3C24XX" in Kconfig 2013-07-16 21:52:22 +02:00
mach-s3c64xx reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-s5p64x0 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-s5pc100 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-s5pv210 For the 3.11 merge we only have one new MFD driver for the Kontron PLD. 2013-07-10 11:10:27 -07:00
mach-sa1100 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-shark reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-shmobile arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-socfpga arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-spear arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-sti arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-sunxi reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-tegra arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-u300 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-ux500 arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mach-versatile reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-vexpress ARM SoC specific changes 2013-07-02 13:43:38 -07:00
mach-virt Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-07-03 09:46:29 -07:00
mach-vt8500 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-w90x900 reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
mach-zynq arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
mm ARM: 7789/1: Do not run dummy_flush_tlb_a15_erratum() on non-Cortex-A15 2013-07-26 12:02:09 +01:00
net arm: bpf_jit: can call module_free() from any context 2013-05-20 14:03:50 -07:00
nwfpe
oprofile
plat-iop reboot: arm: change reboot_mode to use enum reboot_mode 2013-07-09 10:33:29 -07:00
plat-omap Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-07-06 14:09:38 -07:00
plat-orion Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-07-06 14:09:38 -07:00
plat-pxa
plat-samsung Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2013-07-06 14:09:38 -07:00
plat-versatile arm: delete __cpuinit/__CPUINIT usage from all ARM users 2013-07-14 19:36:52 -04:00
tools
vfp ARM: 7729/1: vfp: ensure VFP_arch is non-zero when VFP is not supported 2013-05-22 22:01:37 +01:00
xen xen/arm and xen/arm64: implement HYPERVISOR_tmem_op 2013-07-04 11:41:12 +00:00
Kconfig ARM: 7791/1: a.out: remove partial a.out support 2013-07-26 12:02:10 +01:00
Kconfig-nommu ARM: mpu: Ensure that MPU depends on CPU_V7 2013-06-17 15:13:18 +01:00
Kconfig.debug ARM: document DEBUG_UNCOMPRESS Kconfig option 2013-07-22 12:03:50 +01:00
Makefile Merge branch 'for-linus' of git://git.linaro.org/people/rmk/linux-arm 2013-07-03 09:46:29 -07:00