diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-10-25 11:39:37 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-10-25 11:39:37 -0400 |
commit | ab72b00734ae4d0b5ff273a0f6c7abeaa3713c76 (patch) | |
tree | ca002f2e4e6b78fd2d5747aa8d478faa5d84e9f6 /arch/arm/kernel/traps.c | |
parent | 0996391139f43d032335b5360db11da62a2cbb39 (diff) |
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 <saeed.bishara@gmail.com>
Tested-by: saeed bishara <saeed.bishara@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/traps.c')
-rw-r--r-- | arch/arm/kernel/traps.c | 4 |
1 files changed, 3 insertions, 1 deletions
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 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/kernel/traps.c | 2 | * linux/arch/arm/kernel/traps.c |
3 | * | 3 | * |
4 | * Copyright (C) 1995-2002 Russell King | 4 | * Copyright (C) 1995-2009 Russell King |
5 | * Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds | 5 | * Fragments that appear the same as linux/arch/i386/kernel/traps.c (C) Linus Torvalds |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -751,6 +751,8 @@ void __init early_trap_init(void) | |||
751 | */ | 751 | */ |
752 | memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes, | 752 | memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes, |
753 | sizeof(sigreturn_codes)); | 753 | sizeof(sigreturn_codes)); |
754 | memcpy((void *)KERN_RESTART_CODE, syscall_restart_code, | ||
755 | sizeof(syscall_restart_code)); | ||
754 | 756 | ||
755 | flush_icache_range(vectors, vectors + PAGE_SIZE); | 757 | flush_icache_range(vectors, vectors + PAGE_SIZE); |
756 | modify_domain(DOMAIN_USER, DOMAIN_CLIENT); | 758 | modify_domain(DOMAIN_USER, DOMAIN_CLIENT); |