diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-31 09:20:16 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-31 09:20:16 -0400 |
commit | 7b70c4275f28702b76b273c8534c38f8313812e9 (patch) | |
tree | 1df2229ca02466bd1adda814ac5c37aa0a597db1 /arch/arm/kernel | |
parent | ceb0885d3b01bb2e2f18765770e212914f2864be (diff) | |
parent | a20df564d15bd28e3df24e1c65b885bd74d23f17 (diff) |
Merge branch 'devel-stable' into devel
Conflicts:
arch/arm/kernel/entry-armv.S
arch/arm/kernel/setup.c
arch/arm/mm/init.c
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/kernel/asm-offsets.c | 3 | ||||
-rw-r--r-- | arch/arm/kernel/compat.c | 7 | ||||
-rw-r--r-- | arch/arm/kernel/compat.h | 2 | ||||
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 8 | ||||
-rw-r--r-- | arch/arm/kernel/process.c | 13 | ||||
-rw-r--r-- | arch/arm/kernel/setup.c | 11 |
7 files changed, 38 insertions, 10 deletions
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index ea023c6aa31e..980b78e31328 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -13,10 +13,12 @@ CFLAGS_REMOVE_return_address.o = -pg | |||
13 | 13 | ||
14 | # Object file lists. | 14 | # Object file lists. |
15 | 15 | ||
16 | obj-y := compat.o elf.o entry-armv.o entry-common.o irq.o \ | 16 | obj-y := elf.o entry-armv.o entry-common.o irq.o \ |
17 | process.o ptrace.o return_address.o setup.o signal.o \ | 17 | process.o ptrace.o return_address.o setup.o signal.o \ |
18 | sys_arm.o stacktrace.o time.o traps.o | 18 | sys_arm.o stacktrace.o time.o traps.o |
19 | 19 | ||
20 | obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += compat.o | ||
21 | |||
20 | obj-$(CONFIG_LEDS) += leds.o | 22 | obj-$(CONFIG_LEDS) += leds.o |
21 | obj-$(CONFIG_OC_ETM) += etm.o | 23 | obj-$(CONFIG_OC_ETM) += etm.o |
22 | 24 | ||
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 883511522fca..85f2a019f77b 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c | |||
@@ -40,6 +40,9 @@ | |||
40 | int main(void) | 40 | int main(void) |
41 | { | 41 | { |
42 | DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); | 42 | DEFINE(TSK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); |
43 | #ifdef CONFIG_CC_STACKPROTECTOR | ||
44 | DEFINE(TSK_STACK_CANARY, offsetof(struct task_struct, stack_canary)); | ||
45 | #endif | ||
43 | BLANK(); | 46 | BLANK(); |
44 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); | 47 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); |
45 | DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); | 48 | DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); |
diff --git a/arch/arm/kernel/compat.c b/arch/arm/kernel/compat.c index 0a1385442f43..925652318b8b 100644 --- a/arch/arm/kernel/compat.c +++ b/arch/arm/kernel/compat.c | |||
@@ -217,10 +217,3 @@ void __init convert_to_tag_list(struct tag *tags) | |||
217 | struct param_struct *params = (struct param_struct *)tags; | 217 | struct param_struct *params = (struct param_struct *)tags; |
218 | build_tag_list(params, ¶ms->u2); | 218 | build_tag_list(params, ¶ms->u2); |
219 | } | 219 | } |
220 | |||
221 | void __init squash_mem_tags(struct tag *tag) | ||
222 | { | ||
223 | for (; tag->hdr.size; tag = tag_next(tag)) | ||
224 | if (tag->hdr.tag == ATAG_MEM) | ||
225 | tag->hdr.tag = ATAG_NONE; | ||
226 | } | ||
diff --git a/arch/arm/kernel/compat.h b/arch/arm/kernel/compat.h index 27e61a68bd1c..39264ab1b9c6 100644 --- a/arch/arm/kernel/compat.h +++ b/arch/arm/kernel/compat.h | |||
@@ -9,5 +9,3 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | extern void convert_to_tag_list(struct tag *tags); | 11 | extern void convert_to_tag_list(struct tag *tags); |
12 | |||
13 | extern void squash_mem_tags(struct tag *tag); | ||
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index e864e482118a..bb8e93a76407 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -737,6 +737,11 @@ ENTRY(__switch_to) | |||
737 | ldr r6, [r2, #TI_CPU_DOMAIN] | 737 | ldr r6, [r2, #TI_CPU_DOMAIN] |
738 | #endif | 738 | #endif |
739 | set_tls r3, r4, r5 | 739 | set_tls r3, r4, r5 |
740 | #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) | ||
741 | ldr r7, [r2, #TI_TASK] | ||
742 | ldr r8, =__stack_chk_guard | ||
743 | ldr r7, [r7, #TSK_STACK_CANARY] | ||
744 | #endif | ||
740 | #ifdef CONFIG_MMU | 745 | #ifdef CONFIG_MMU |
741 | mcr p15, 0, r6, c3, c0, 0 @ Set domain register | 746 | mcr p15, 0, r6, c3, c0, 0 @ Set domain register |
742 | #endif | 747 | #endif |
@@ -745,6 +750,9 @@ ENTRY(__switch_to) | |||
745 | ldr r0, =thread_notify_head | 750 | ldr r0, =thread_notify_head |
746 | mov r1, #THREAD_NOTIFY_SWITCH | 751 | mov r1, #THREAD_NOTIFY_SWITCH |
747 | bl atomic_notifier_call_chain | 752 | bl atomic_notifier_call_chain |
753 | #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) | ||
754 | str r7, [r8] | ||
755 | #endif | ||
748 | THUMB( mov ip, r4 ) | 756 | THUMB( mov ip, r4 ) |
749 | mov r0, r5 | 757 | mov r0, r5 |
750 | ARM( ldmia r4, {r4 - sl, fp, sp, pc} ) @ Load all regs saved previously | 758 | ARM( ldmia r4, {r4 - sl, fp, sp, pc} ) @ Load all regs saved previously |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 2e2ec97cc50c..401e38be1f78 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/tick.h> | 28 | #include <linux/tick.h> |
29 | #include <linux/utsname.h> | 29 | #include <linux/utsname.h> |
30 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
31 | #include <linux/random.h> | ||
31 | 32 | ||
32 | #include <asm/cacheflush.h> | 33 | #include <asm/cacheflush.h> |
33 | #include <asm/leds.h> | 34 | #include <asm/leds.h> |
@@ -37,6 +38,12 @@ | |||
37 | #include <asm/stacktrace.h> | 38 | #include <asm/stacktrace.h> |
38 | #include <asm/mach/time.h> | 39 | #include <asm/mach/time.h> |
39 | 40 | ||
41 | #ifdef CONFIG_CC_STACKPROTECTOR | ||
42 | #include <linux/stackprotector.h> | ||
43 | unsigned long __stack_chk_guard __read_mostly; | ||
44 | EXPORT_SYMBOL(__stack_chk_guard); | ||
45 | #endif | ||
46 | |||
40 | static const char *processor_modes[] = { | 47 | static const char *processor_modes[] = { |
41 | "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" , | 48 | "USER_26", "FIQ_26" , "IRQ_26" , "SVC_26" , "UK4_26" , "UK5_26" , "UK6_26" , "UK7_26" , |
42 | "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26", | 49 | "UK8_26" , "UK9_26" , "UK10_26", "UK11_26", "UK12_26", "UK13_26", "UK14_26", "UK15_26", |
@@ -445,3 +452,9 @@ unsigned long get_wchan(struct task_struct *p) | |||
445 | } while (count ++ < 16); | 452 | } while (count ++ < 16); |
446 | return 0; | 453 | return 0; |
447 | } | 454 | } |
455 | |||
456 | unsigned long arch_randomize_brk(struct mm_struct *mm) | ||
457 | { | ||
458 | unsigned long range_end = mm->brk + 0x02000000; | ||
459 | return randomize_range(mm->brk, range_end, 0) ? : mm->brk; | ||
460 | } | ||
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 776ea1aa974b..d5231ae7355a 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -47,7 +47,9 @@ | |||
47 | #include <asm/traps.h> | 47 | #include <asm/traps.h> |
48 | #include <asm/unwind.h> | 48 | #include <asm/unwind.h> |
49 | 49 | ||
50 | #if defined(CONFIG_DEPRECATED_PARAM_STRUCT) | ||
50 | #include "compat.h" | 51 | #include "compat.h" |
52 | #endif | ||
51 | #include "atags.h" | 53 | #include "atags.h" |
52 | #include "tcm.h" | 54 | #include "tcm.h" |
53 | 55 | ||
@@ -755,6 +757,13 @@ static int __init setup_elfcorehdr(char *arg) | |||
755 | early_param("elfcorehdr", setup_elfcorehdr); | 757 | early_param("elfcorehdr", setup_elfcorehdr); |
756 | #endif /* CONFIG_CRASH_DUMP */ | 758 | #endif /* CONFIG_CRASH_DUMP */ |
757 | 759 | ||
760 | static void __init squash_mem_tags(struct tag *tag) | ||
761 | { | ||
762 | for (; tag->hdr.size; tag = tag_next(tag)) | ||
763 | if (tag->hdr.tag == ATAG_MEM) | ||
764 | tag->hdr.tag = ATAG_NONE; | ||
765 | } | ||
766 | |||
758 | void __init setup_arch(char **cmdline_p) | 767 | void __init setup_arch(char **cmdline_p) |
759 | { | 768 | { |
760 | struct tag *tags = (struct tag *)&init_tags; | 769 | struct tag *tags = (struct tag *)&init_tags; |
@@ -775,12 +784,14 @@ void __init setup_arch(char **cmdline_p) | |||
775 | else if (mdesc->boot_params) | 784 | else if (mdesc->boot_params) |
776 | tags = phys_to_virt(mdesc->boot_params); | 785 | tags = phys_to_virt(mdesc->boot_params); |
777 | 786 | ||
787 | #if defined(CONFIG_DEPRECATED_PARAM_STRUCT) | ||
778 | /* | 788 | /* |
779 | * If we have the old style parameters, convert them to | 789 | * If we have the old style parameters, convert them to |
780 | * a tag list. | 790 | * a tag list. |
781 | */ | 791 | */ |
782 | if (tags->hdr.tag != ATAG_CORE) | 792 | if (tags->hdr.tag != ATAG_CORE) |
783 | convert_to_tag_list(tags); | 793 | convert_to_tag_list(tags); |
794 | #endif | ||
784 | if (tags->hdr.tag != ATAG_CORE) | 795 | if (tags->hdr.tag != ATAG_CORE) |
785 | tags = (struct tag *)&init_tags; | 796 | tags = (struct tag *)&init_tags; |
786 | 797 | ||