]>
Commit | Line | Data |
---|---|---|
cd1a2927 MT |
1 | Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes) |
2 | Date: 2004-08-30 | |
3 | Initial Package Version: 2.4.27 | |
4 | Upstream Status: Rejected Upstream | |
5 | Origin: http://www.northernsecurity.net/adamantix/diffs/2.4.20-propolice.patch | |
6 | Description: Linux kernel patch for Smashing Stack Protector. This patch allows | |
7 | the use of -fstack-protector durring the kernel build. | |
8 | http://www.linuxfromscratch.org/hints/downloads/files/ssp.txt | |
9 | http://www.linuxfromscratch.org/hlfs/ | |
10 | ||
11 | diff -Naur linux-2.4.26.orig/include/linux/kernel.h linux-2.4.26.ssp/include/linux/kernel.h | |
12 | --- linux-2.4.26.orig/include/linux/kernel.h 2002-11-28 23:53:15.000000000 +0000 | |
13 | +++ linux-2.4.26.ssp/include/linux/kernel.h 2004-04-18 19:54:08.000000000 +0000 | |
14 | @@ -86,6 +86,9 @@ | |
15 | extern void dev_probe_lock(void); | |
16 | extern void dev_probe_unlock(void); | |
17 | ||
18 | +extern int __guard; | |
19 | +extern void __stack_smash_handler(int, char []); | |
20 | + | |
21 | extern int session_of_pgrp(int pgrp); | |
22 | ||
23 | asmlinkage int printk(const char * fmt, ...) | |
24 | diff -Naur linux-2.4.26.orig/kernel/ksyms.c linux-2.4.26.ssp/kernel/ksyms.c | |
25 | --- linux-2.4.26.orig/kernel/ksyms.c 2004-02-18 13:36:32.000000000 +0000 | |
26 | +++ linux-2.4.26.ssp/kernel/ksyms.c 2004-04-18 19:54:08.000000000 +0000 | |
27 | @@ -528,6 +528,8 @@ | |
28 | EXPORT_SYMBOL(single_open); | |
29 | EXPORT_SYMBOL(single_release); | |
30 | EXPORT_SYMBOL(seq_release_private); | |
31 | +EXPORT_SYMBOL_NOVERS(__guard); | |
32 | +EXPORT_SYMBOL_NOVERS(__stack_smash_handler); | |
33 | ||
34 | /* Program loader interfaces */ | |
35 | EXPORT_SYMBOL(setup_arg_pages); | |
36 | diff -Naur linux-2.4.26.orig/lib/Makefile linux-2.4.26.ssp/lib/Makefile | |
37 | --- linux-2.4.26.orig/lib/Makefile 2004-04-14 13:05:40.000000000 +0000 | |
38 | +++ linux-2.4.26.ssp/lib/Makefile 2004-04-18 19:54:08.000000000 +0000 | |
39 | @@ -12,7 +12,7 @@ | |
40 | rbtree.o crc32.o firmware_class.o | |
41 | ||
42 | obj-y := errno.o ctype.o string.o vsprintf.o brlock.o cmdline.o \ | |
43 | - bust_spinlocks.o rbtree.o dump_stack.o | |
44 | + bust_spinlocks.o rbtree.o dump_stack.o propolice.o | |
45 | ||
46 | obj-$(CONFIG_FW_LOADER) += firmware_class.o | |
47 | obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o | |
48 | diff -Naur linux-2.4.26.orig/lib/propolice.c linux-2.4.26.ssp/lib/propolice.c | |
49 | --- linux-2.4.26.orig/lib/propolice.c 1970-01-01 00:00:00.000000000 +0000 | |
50 | +++ linux-2.4.26.ssp/lib/propolice.c 2004-04-18 19:54:08.000000000 +0000 | |
51 | @@ -0,0 +1,13 @@ | |
52 | + /* | |
53 | + * linux/lib/errno.c | |
54 | + * | |
55 | + * | |
56 | + */ | |
57 | + | |
58 | + int __guard = '\0\0\n\777'; | |
59 | + | |
60 | + void __stack_smash_handler (int damaged, char func[]) | |
61 | + { | |
62 | + static char *message = "propolice detects %x at function %s.\n" ; | |
63 | + panic (message, damaged, func); | |
64 | +} |