From ab72b00734ae4d0b5ff273a0f6c7abeaa3713c76 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 25 Oct 2009 15:39:37 +0000 Subject: ARM: Fix signal restart issues with NX and OABI compat The signal restarting code was placed on the user stack when OABI compatibility is enabled. Unfortunately, with an EABI NX executable, this results in an attempt to run code from the non-executable stack, which segfaults the application. Fix this by placing the code in the vectors page, along side the signal return code, and directing the application to that code. Reported-by: saeed bishara Tested-by: saeed bishara Signed-off-by: Russell King --- arch/arm/kernel/traps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'arch/arm/kernel/traps.c') diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index f838f36eb702..95718a6b50a6 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -1,7 +1,7 @@ /* * linux/arch/arm/kernel/traps.c * - * Copyright (C) 1995-2002 Russell King + * Copyright (C) 1995-2009 Russell King * Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds * * This program is free software; you can redistribute it and/or modify @@ -751,6 +751,8 @@ void __init early_trap_init(void) */ memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes, sizeof(sigreturn_codes)); + memcpy((void *)KERN_RESTART_CODE, syscall_restart_code, + sizeof(syscall_restart_code)); flush_icache_range(vectors, vectors + PAGE_SIZE); modify_domain(DOMAIN_USER, DOMAIN_CLIENT); -- cgit v1.2.1