cvs commit: patches/linux linux-2.4.25-ssp-1.patch linux-2.6.3-ssp-1.patch

tushar at linuxfromscratch.org tushar at linuxfromscratch.org
Thu Feb 19 20:05:17 PST 2004


tushar      04/02/19 21:05:17

  Added:       linux    linux-2.4.25-ssp-1.patch linux-2.6.3-ssp-1.patch
  Log:
  linux ssp patches
  
  Revision  Changes    Path
  1.1                  patches/linux/linux-2.4.25-ssp-1.patch
  
  Index: linux-2.4.25-ssp-1.patch
  ===================================================================
  Submitted By: Robert Connolly <cendres at videotron dot ca> (ashes)
  Date: 2004-02-19
  Initial Package Version: 2.4.25
  Origin: http://www.northernsecurity.net/adamantix/diffs/2.4.20-propolice.patch
  Description: Linux kernel patch for Smashing Stack Protector. This patch allows the use of
  -fstack-protector durring the kernel build.
  https://twocents.mooo.com/hints/downloads/files/winter.txt
  https://twocents.mooo.com/hints/downloads/files/ssp.txt
  
  diff -Naur linux-2.4.23.orig/include/linux/kernel.h linux-2.4.23/include/linux/kernel.h
  --- linux-2.4.23.orig/include/linux/kernel.h	2002-11-28 23:53:15.000000000 +0000
  +++ linux-2.4.23/include/linux/kernel.h	2003-12-19 07:57:31.000000000 +0000
  @@ -86,6 +86,9 @@
   extern void dev_probe_lock(void);
   extern void dev_probe_unlock(void);
   
  +extern int __guard;
  +extern void __stack_smash_handler(int, char []);
  +
   extern int session_of_pgrp(int pgrp);
   
   asmlinkage int printk(const char * fmt, ...)
  diff -Naur linux-2.4.23.orig/kernel/ksyms.c linux-2.4.23/kernel/ksyms.c
  --- linux-2.4.23.orig/kernel/ksyms.c	2003-11-28 18:26:21.000000000 +0000
  +++ linux-2.4.23/kernel/ksyms.c	2003-12-19 07:58:01.000000000 +0000
  @@ -518,6 +518,8 @@
   EXPORT_SYMBOL(single_open);
   EXPORT_SYMBOL(single_release);
   EXPORT_SYMBOL(seq_release_private);
  +EXPORT_SYMBOL_NOVERS(__guard);
  +EXPORT_SYMBOL_NOVERS(__stack_smash_handler);
   
   /* Program loader interfaces */
   EXPORT_SYMBOL(setup_arg_pages);
  diff -Naur linux-2.4.23.orig/lib/Makefile linux-2.4.23/lib/Makefile
  --- linux-2.4.23.orig/lib/Makefile	2003-11-28 18:26:21.000000000 +0000
  +++ linux-2.4.23/lib/Makefile	2003-12-19 07:57:31.000000000 +0000
  @@ -12,7 +12,7 @@
   	       rbtree.o crc32.o firmware_class.o
   
   obj-y := errno.o ctype.o string.o vsprintf.o brlock.o cmdline.o \
  -	 bust_spinlocks.o rbtree.o dump_stack.o
  +	 bust_spinlocks.o rbtree.o dump_stack.o propolice.o
   
   obj-$(CONFIG_FW_LOADER) += firmware_class.o
   obj-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
  diff -Naur linux-2.4.23.orig/lib/propolice.c linux-2.4.23/lib/propolice.c
  --- linux-2.4.23.orig/lib/propolice.c	1970-01-01 00:00:00.000000000 +0000
  +++ linux-2.4.23/lib/propolice.c	2003-12-19 07:57:31.000000000 +0000
  @@ -0,0 +1,13 @@
  + /*
  +  *  linux/lib/errno.c
  +  *
  +  *
  +  */
  + 
  + int __guard = '\0\0\n\777';
  + 
  + void __stack_smash_handler (int damaged, char func[])
  + 	 {
  +	   static char *message = "propolice detects %x at function %s.\n" ;
  +	   panic (message, damaged, func);
  +}
  
  
  
  1.1                  patches/linux/linux-2.6.3-ssp-1.patch
  
  Index: linux-2.6.3-ssp-1.patch
  ===================================================================
  Submitted By: Robert Connolly <cendres at videotron dot ca> (ashes)
  Date: 2003-02-19
  Initial Package Version: 2.6.3
  Origin: http://www.northernsecurity.net/adamantix/diffs/2.6.0-propolice.patch
  Description: Linux kernel patch for Smashing Stack Protector. This patch allows
  the use of -fstack-protector durring the kernel build.
  https://twocents.mooo.com/hints/downloads/files/winter.txt
  https://twocents.mooo.com/hints/downloads/files/ssp.txt
  
  diff -Naur linux-2.6.3.orig/Makefile linux-2.6.3/Makefile
  --- linux-2.6.3.orig/Makefile	2004-02-18 03:58:39.000000000 +0000
  +++ linux-2.6.3/Makefile	2004-02-19 06:23:42.000000000 +0000
  @@ -277,7 +277,7 @@
   		   $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
   
   CFLAGS 		:= -Wall -Wstrict-prototypes -Wno-trigraphs \
  -	  	   -fno-strict-aliasing -fno-common
  +	  	   -fno-strict-aliasing -fno-common -fstack-protector
   AFLAGS		:= -D__ASSEMBLY__
   
   export	VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
  diff -Naur linux-2.6.3.orig/arch/i386/kernel/i386_ksyms.c linux-2.6.3/arch/i386/kernel/i386_ksyms.c
  --- linux-2.6.3.orig/arch/i386/kernel/i386_ksyms.c	2004-02-18 03:59:52.000000000 +0000
  +++ linux-2.6.3/arch/i386/kernel/i386_ksyms.c	2004-02-19 06:23:42.000000000 +0000
  @@ -96,6 +96,11 @@
   EXPORT_SYMBOL_NOVERS(__down_failed_interruptible);
   EXPORT_SYMBOL_NOVERS(__down_failed_trylock);
   EXPORT_SYMBOL_NOVERS(__up_wakeup);
  +
  +/* SSP */
  +EXPORT_SYMBOL_NOVERS(__guard);
  +EXPORT_SYMBOL_NOVERS(__stack_smash_handler);
  +
   /* Networking helper routines. */
   EXPORT_SYMBOL(csum_partial_copy_generic);
   /* Delay loops */
  diff -Naur linux-2.6.3.orig/arch/um/kernel/ksyms.c linux-2.6.3/arch/um/kernel/ksyms.c
  --- linux-2.6.3.orig/arch/um/kernel/ksyms.c	2004-02-18 03:57:14.000000000 +0000
  +++ linux-2.6.3/arch/um/kernel/ksyms.c	2004-02-19 06:23:42.000000000 +0000
  @@ -90,3 +90,5 @@
   EXPORT_SYMBOL(kmap_atomic_to_page);
   #endif
   
  +EXPORT_SYMBOL_NOVERS(__guard);
  +EXPORT_SYMBOL_NOVERS(__stack_smash_handler);
  diff -Naur linux-2.6.3.orig/include/linux/kernel.h linux-2.6.3/include/linux/kernel.h
  --- linux-2.6.3.orig/include/linux/kernel.h	2004-02-18 03:57:11.000000000 +0000
  +++ linux-2.6.3/include/linux/kernel.h	2004-02-19 06:23:42.000000000 +0000
  @@ -115,6 +115,8 @@
   #define TAINT_FORCED_RMMOD		(1<<3)
   
   extern void dump_stack(void);
  +extern int __guard;
  +extern void __stack_smash_handler(int, char []);
   
   #ifdef DEBUG
   #define pr_debug(fmt,arg...) \
  diff -Naur linux-2.6.3.orig/lib/Makefile linux-2.6.3/lib/Makefile
  --- linux-2.6.3.orig/lib/Makefile	2004-02-18 03:57:14.000000000 +0000
  +++ linux-2.6.3/lib/Makefile	2004-02-19 06:24:06.000000000 +0000
  @@ -6,7 +6,7 @@
   lib-y := errno.o ctype.o string.o vsprintf.o cmdline.o \
   	 bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \
   	 kobject.o idr.o div64.o parser.o int_sqrt.o \
  -	 bitmap.o extable.o
  +	 bitmap.o extable.o propolice.o
   
   lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
   lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
  diff -Naur linux-2.6.3.orig/lib/propolice.c linux-2.6.3/lib/propolice.c
  --- linux-2.6.3.orig/lib/propolice.c	1970-01-01 00:00:00.000000000 +0000
  +++ linux-2.6.3/lib/propolice.c	2004-02-19 06:23:42.000000000 +0000
  @@ -0,0 +1,13 @@
  + /*
  +  *  linux/lib/errno.c
  +  *
  +  *
  +  */
  + 
  + int __guard = '\0\0\n\777';
  + 
  + void __stack_smash_handler (int damaged, char func[])
  + 	 {
  +	   static char *message = "propolice detects %x at function %s.\n" ;
  +	   panic (message, damaged, func);
  +}
  
  
  



More information about the patches mailing list