cvs commit: patches/linux linux-2.4.20-propolice.patch linux-2.6.0-propolice.patch

tushar at linuxfromscratch.org tushar at linuxfromscratch.org
Wed Dec 3 10:33:44 PST 2003


tushar      03/12/03 11:33:44

  Added:       linux    linux-2.4.20-propolice.patch
                        linux-2.6.0-propolice.patch
  Log:
  Added linux propolice patches
  
  Revision  Changes    Path
  1.1                  patches/linux/linux-2.4.20-propolice.patch
  
  Index: linux-2.4.20-propolice.patch
  ===================================================================
  Submitted By: Robert Connolly <cendres at videotron dot ca> (ashes)
  Date: 2003-12-01
  Initial Package Version: 2.4.20
  Origin: http://www.northernsecurity.net/adamantix/diffs/2.4.20-propolice.patch
  Description: Linux kernel patch for ProPolice Stack Gaurd 
  http://www.linuxfromscratch.org/hints/downloads/files/propolice.txt
  http://www.topside.org/~ashes/files/protector/propolice.txt
  
  diff -uNr linux-2.4.20.orig/include/linux/kernel.h linux-2.4.20.ssp/include/linux/kernel.h
  --- linux-2.4.20.orig/include/linux/kernel.h	2002-11-29 00:53:15.000000000 +0100
  +++ linux-2.4.20.ssp/include/linux/kernel.h	2003-05-20 00:06:59.000000000 +0200
  @@ -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 -uNr linux-2.4.20.orig/kernel/ksyms.c linux-2.4.20.ssp/kernel/ksyms.c
  --- linux-2.4.20.orig/kernel/ksyms.c	2002-11-29 00:53:15.000000000 +0100
  +++ linux-2.4.20.ssp/kernel/ksyms.c	2003-05-20 00:04:34.000000000 +0200
  @@ -502,6 +502,8 @@
   EXPORT_SYMBOL(seq_release);
   EXPORT_SYMBOL(seq_read);
   EXPORT_SYMBOL(seq_lseek);
  +EXPORT_SYMBOL_NOVERS(__guard);
  +EXPORT_SYMBOL_NOVERS(__stack_smash_handler);
   
   /* Program loader interfaces */
   EXPORT_SYMBOL(setup_arg_pages);
  diff -uNr linux-2.4.20.orig/lib/Makefile linux-2.4.20.ssp/lib/Makefile
  --- linux-2.4.20.orig/lib/Makefile	2002-11-29 00:53:15.000000000 +0100
  +++ linux-2.4.20.ssp/lib/Makefile	2003-05-19 23:57:02.000000000 +0200
  @@ -11,7 +11,7 @@
   export-objs := cmdline.o dec_and_lock.o rwsem-spinlock.o rwsem.o rbtree.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_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
   obj-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
  diff -uNr linux-2.4.20.orig/lib/propolice.c linux-2.4.20.ssp/lib/propolice.c
  --- linux-2.4.20.orig/lib/propolice.c	1970-01-01 01:00:00.000000000 +0100
  +++ linux-2.4.20.ssp/lib/propolice.c	2003-05-20 00:00:37.000000000 +0200
  @@ -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.0-propolice.patch
  
  Index: linux-2.6.0-propolice.patch
  ===================================================================
  Submitted By: Robert Connolly <cendres at videotron dot ca> (ashes)
  Date: 2003-12-01
  Initial Package Version: 2.6.0
  Origin: http://www.northernsecurity.net/adamantix/diffs/2.6.0-propolice.patch
  Description: Linux kernel patch for ProPolice Stack Gaurd
  http://www.linuxfromscratch.org/hints/downloads/files/propolice.txt
  http://www.topside.org/~ashes/files/protector/propolice.txt
  
  diff -uNr linux-2.6.0-test9-bk1/arch/i386/kernel/i386_ksyms.c linux-2.6.0-test9-bk1-ssp/arch/i386/kernel/i386_ksyms.c
  --- linux-2.6.0-test9-bk1/arch/i386/kernel/i386_ksyms.c	2003-10-25 20:44:54.000000000 +0200
  +++ linux-2.6.0-test9-bk1-ssp/arch/i386/kernel/i386_ksyms.c	2003-10-28 14:16:45.000000000 +0100
  @@ -97,6 +97,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 -uNr linux-2.6.0-test9-bk1/arch/um/kernel/ksyms.c linux-2.6.0-test9-bk1-ssp/arch/um/kernel/ksyms.c
  --- linux-2.6.0-test9-bk1/arch/um/kernel/ksyms.c	2003-10-25 20:42:51.000000000 +0200
  +++ linux-2.6.0-test9-bk1-ssp/arch/um/kernel/ksyms.c	2003-10-28 14:16:45.000000000 +0100
  @@ -90,3 +90,5 @@
   EXPORT_SYMBOL(kmap_atomic_to_page);
   #endif
   
  +EXPORT_SYMBOL_NOVERS(__guard);
  +EXPORT_SYMBOL_NOVERS(__stack_smash_handler);
  diff -uNr linux-2.6.0-test9-bk1/include/linux/kernel.h linux-2.6.0-test9-bk1-ssp/include/linux/kernel.h
  --- linux-2.6.0-test9-bk1/include/linux/kernel.h	2003-10-25 20:42:42.000000000 +0200
  +++ linux-2.6.0-test9-bk1-ssp/include/linux/kernel.h	2003-10-28 14:16:46.000000000 +0100
  @@ -110,6 +110,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 -uNr linux-2.6.0-test9-bk1/lib/Makefile linux-2.6.0-test9-bk1-ssp/lib/Makefile
  --- linux-2.6.0-test9-bk1/lib/Makefile	2003-10-25 20:42:51.000000000 +0200
  +++ linux-2.6.0-test9-bk1-ssp/lib/Makefile	2003-10-28 14:16:46.000000000 +0100
  @@ -5,7 +5,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
  +	 kobject.o idr.o div64.o parser.o propolice.o
   
   lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
   lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
  diff -uNr linux-2.6.0-test9-bk1/lib/propolice.c linux-2.6.0-test9-bk1-ssp/lib/propolice.c
  --- linux-2.6.0-test9-bk1/lib/propolice.c	1970-01-01 01:00:00.000000000 +0100
  +++ linux-2.6.0-test9-bk1-ssp/lib/propolice.c	2003-10-28 14:16:46.000000000 +0100
  @@ -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);
  +}
  diff -uNr linux-2.6.0-test9-bk1/Makefile linux-2.6.0-test9-bk1-ssp/Makefile
  --- linux-2.6.0-test9-bk1/Makefile	2003-10-28 14:21:32.000000000 +0100
  +++ linux-2.6.0-test9-bk1-ssp/Makefile	2003-10-28 14:17:04.000000000 +0100
  @@ -276,7 +276,7 @@
   		   $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
   
   CFLAGS 		:= -Wall -Wstrict-prototypes -Wno-trigraphs -O2 \
  -	  	   -fno-strict-aliasing -fno-common
  +	  	   -fno-strict-aliasing -fno-common -fstack-protector
   AFLAGS		:= -D__ASSEMBLY__
   
   export	VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
  
  
  



More information about the patches mailing list