packages (Titanium): kernel-bare-grsecurity/linux-2.6-grsecurity.patch - ht...

hawk hawk at pld-linux.org
Thu Feb 25 13:40:23 CET 2010


Author: hawk                         Date: Thu Feb 25 12:40:23 2010 GMT
Module: packages                      Tag: Titanium
---- Log message:
- http://www.grsecurity.net/~spender/grsecurity-2.1.14-2.6.32.9-201002231820.patch
  with localversion killed

---- Files affected:
packages/kernel-bare-grsecurity:
   linux-2.6-grsecurity.patch (1.1.2.50 -> 1.1.2.51) 

---- Diffs:

================================================================
Index: packages/kernel-bare-grsecurity/linux-2.6-grsecurity.patch
diff -u packages/kernel-bare-grsecurity/linux-2.6-grsecurity.patch:1.1.2.50 packages/kernel-bare-grsecurity/linux-2.6-grsecurity.patch:1.1.2.51
--- packages/kernel-bare-grsecurity/linux-2.6-grsecurity.patch:1.1.2.50	Sun Dec 20 23:30:28 2009
+++ packages/kernel-bare-grsecurity/linux-2.6-grsecurity.patch	Thu Feb 25 13:40:10 2010
@@ -1,53 +1,6 @@
-diff -urNp linux-2.6.31.9/arch/alpha/include/asm/atomic.h linux-2.6.31.9/arch/alpha/include/asm/atomic.h
---- linux-2.6.31.9/arch/alpha/include/asm/atomic.h	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/alpha/include/asm/atomic.h	2009-12-14 18:31:31.971710264 -0500
-@@ -18,9 +18,11 @@
- #define ATOMIC64_INIT(i)	( (atomic64_t) { (i) } )
- 
- #define atomic_read(v)		((v)->counter + 0)
-+#define atomic_read_unchecked(v)	((v)->counter + 0)
- #define atomic64_read(v)	((v)->counter + 0)
- 
- #define atomic_set(v,i)		((v)->counter = (i))
-+#define atomic_set_unchecked(v,i)	((v)->counter = (i))
- #define atomic64_set(v,i)	((v)->counter = (i))
- 
- /*
-@@ -44,6 +46,11 @@ static __inline__ void atomic_add(int i,
- 	:"Ir" (i), "m" (v->counter));
- }
- 
-+static __inline__ void atomic_add_unchecked(int i, atomic_unchecked_t * v)
-+{
-+	atomic_add(i, (atomic_t *)v);
-+}
-+
- static __inline__ void atomic64_add(long i, atomic64_t * v)
- {
- 	unsigned long temp;
-@@ -74,6 +81,11 @@ static __inline__ void atomic_sub(int i,
- 	:"Ir" (i), "m" (v->counter));
- }
- 
-+static __inline__ void atomic_sub_unchecked(int i, atomic_unchecked_t * v)
-+{
-+	atomic_sub(i, (atomic_t *)v);
-+}
-+
- static __inline__ void atomic64_sub(long i, atomic64_t * v)
- {
- 	unsigned long temp;
-@@ -246,6 +258,7 @@ static __inline__ int atomic64_add_unles
- #define atomic64_dec_and_test(v) (atomic64_sub_return(1, (v)) == 0)
- 
- #define atomic_inc(v) atomic_add(1,(v))
-+#define atomic_inc_unchecked(v) atomic_add_unchecked(1,(v))
- #define atomic64_inc(v) atomic64_add(1,(v))
- 
- #define atomic_dec(v) atomic_sub(1,(v))
-diff -urNp linux-2.6.31.9/arch/alpha/include/asm/elf.h linux-2.6.31.9/arch/alpha/include/asm/elf.h
---- linux-2.6.31.9/arch/alpha/include/asm/elf.h	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/alpha/include/asm/elf.h	2009-12-14 18:31:31.971710264 -0500
+diff -urNp linux-2.6.32.9/arch/alpha/include/asm/elf.h linux-2.6.32.9/arch/alpha/include/asm/elf.h
+--- linux-2.6.32.9/arch/alpha/include/asm/elf.h	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/alpha/include/asm/elf.h	2010-02-23 17:09:53.067670152 -0500
 @@ -91,6 +91,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
  
  #define ELF_ET_DYN_BASE		(TASK_UNMAPPED_BASE + 0x1000000)
@@ -62,9 +15,9 @@
  /* $0 is set by ld.so to a pointer to a function which might be 
     registered using atexit.  This provides a mean for the dynamic
     linker to call DT_FINI functions for shared libraries that have
-diff -urNp linux-2.6.31.9/arch/alpha/include/asm/pgtable.h linux-2.6.31.9/arch/alpha/include/asm/pgtable.h
---- linux-2.6.31.9/arch/alpha/include/asm/pgtable.h	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/alpha/include/asm/pgtable.h	2009-12-14 18:31:31.990851110 -0500
+diff -urNp linux-2.6.32.9/arch/alpha/include/asm/pgtable.h linux-2.6.32.9/arch/alpha/include/asm/pgtable.h
+--- linux-2.6.32.9/arch/alpha/include/asm/pgtable.h	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/alpha/include/asm/pgtable.h	2010-02-23 17:09:53.067670152 -0500
 @@ -101,6 +101,17 @@ struct vm_area_struct;
  #define PAGE_SHARED	__pgprot(_PAGE_VALID | __ACCESS_BITS)
  #define PAGE_COPY	__pgprot(_PAGE_VALID | __ACCESS_BITS | _PAGE_FOW)
@@ -83,9 +36,9 @@
  #define PAGE_KERNEL	__pgprot(_PAGE_VALID | _PAGE_ASM | _PAGE_KRE | _PAGE_KWE)
  
  #define _PAGE_NORMAL(x) __pgprot(_PAGE_VALID | __ACCESS_BITS | (x))
-diff -urNp linux-2.6.31.9/arch/alpha/kernel/module.c linux-2.6.31.9/arch/alpha/kernel/module.c
---- linux-2.6.31.9/arch/alpha/kernel/module.c	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/alpha/kernel/module.c	2009-12-14 18:31:31.991719717 -0500
+diff -urNp linux-2.6.32.9/arch/alpha/kernel/module.c linux-2.6.32.9/arch/alpha/kernel/module.c
+--- linux-2.6.32.9/arch/alpha/kernel/module.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/alpha/kernel/module.c	2010-02-23 17:09:53.067670152 -0500
 @@ -182,7 +182,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, 
  
  	/* The small sections were sorted to the end of the segment.
@@ -95,10 +48,10 @@
  	got = sechdrs[me->arch.gotsecindex].sh_addr;
  
  	for (i = 0; i < n; i++) {
-diff -urNp linux-2.6.31.9/arch/alpha/kernel/osf_sys.c linux-2.6.31.9/arch/alpha/kernel/osf_sys.c
---- linux-2.6.31.9/arch/alpha/kernel/osf_sys.c	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/alpha/kernel/osf_sys.c	2009-12-14 18:31:32.001719267 -0500
-@@ -1212,6 +1212,10 @@ arch_get_unmapped_area(struct file *filp
+diff -urNp linux-2.6.32.9/arch/alpha/kernel/osf_sys.c linux-2.6.32.9/arch/alpha/kernel/osf_sys.c
+--- linux-2.6.32.9/arch/alpha/kernel/osf_sys.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/alpha/kernel/osf_sys.c	2010-02-23 17:09:53.067670152 -0500
+@@ -1205,6 +1205,10 @@ arch_get_unmapped_area(struct file *filp
  	   merely specific addresses, but regions of memory -- perhaps
  	   this feature should be incorporated into all ports?  */
  
@@ -109,7 +62,7 @@
  	if (addr) {
  		addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit);
  		if (addr != (unsigned long) -ENOMEM)
-@@ -1219,8 +1223,8 @@ arch_get_unmapped_area(struct file *filp
+@@ -1212,8 +1216,8 @@ arch_get_unmapped_area(struct file *filp
  	}
  
  	/* Next, try allocating at TASK_UNMAPPED_BASE.  */
@@ -120,9 +73,9 @@
  	if (addr != (unsigned long) -ENOMEM)
  		return addr;
  
-diff -urNp linux-2.6.31.9/arch/alpha/mm/fault.c linux-2.6.31.9/arch/alpha/mm/fault.c
---- linux-2.6.31.9/arch/alpha/mm/fault.c	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/alpha/mm/fault.c	2009-12-14 18:31:32.002722322 -0500
+diff -urNp linux-2.6.32.9/arch/alpha/mm/fault.c linux-2.6.32.9/arch/alpha/mm/fault.c
+--- linux-2.6.32.9/arch/alpha/mm/fault.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/alpha/mm/fault.c	2010-02-23 17:09:53.071672140 -0500
 @@ -54,6 +54,124 @@ __load_new_mm_context(struct mm_struct *
  	__reload_thread(pcb);
  }
@@ -279,73 +232,10 @@
  	} else if (!cause) {
  		/* Allow reads even for write-only mappings */
  		if (!(vma->vm_flags & (VM_READ | VM_WRITE)))
-diff -urNp linux-2.6.31.9/arch/arm/include/asm/atomic.h linux-2.6.31.9/arch/arm/include/asm/atomic.h
---- linux-2.6.31.9/arch/arm/include/asm/atomic.h	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/arm/include/asm/atomic.h	2009-12-14 18:31:32.008722880 -0500
-@@ -20,6 +20,7 @@
- #ifdef __KERNEL__
- 
- #define atomic_read(v)	((v)->counter)
-+#define atomic_read_unchecked(v)	((v)->counter)
- 
- #if __LINUX_ARM_ARCH__ >= 6
- 
-@@ -44,6 +45,11 @@ static inline void atomic_set(atomic_t *
- 	: "cc");
- }
- 
-+static inline void atomic_set_unchecked(atomic_unchecked_t *v, int i)
-+{
-+	atomic_set((atomic_t *)v, i);
-+}
-+
- static inline void atomic_add(int i, atomic_t *v)
- {
- 	unsigned long tmp;
-@@ -60,6 +66,11 @@ static inline void atomic_add(int i, ato
- 	: "cc");
- }
- 
-+static inline void atomic_add_unchecked(int i, atomic_unchecked_t *v)
-+{
-+	atomic_add(i, (atomic_t *)v);
-+}
-+
- static inline int atomic_add_return(int i, atomic_t *v)
- {
- 	unsigned long tmp;
-@@ -98,6 +109,11 @@ static inline void atomic_sub(int i, ato
- 	: "cc");
- }
- 
-+static inline void atomic_sub_unchecked(int i, atomic_unchecked_t *v)
-+{
-+	atomic_sub(i, (atomic_t *)v);
-+}
-+
- static inline int atomic_sub_return(int i, atomic_t *v)
- {
- 	unsigned long tmp;
-@@ -164,6 +180,7 @@ static inline void atomic_clear_mask(uns
- #endif
- 
- #define atomic_set(v,i)	(((v)->counter) = (i))
-+#define atomic_set_unchecked(v,i)	(((v)->counter) = (i))
- 
- static inline int atomic_add_return(int i, atomic_t *v)
- {
-@@ -232,6 +249,7 @@ static inline int atomic_add_unless(atom
- #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
- 
- #define atomic_inc(v)		atomic_add(1, v)
-+#define atomic_inc_unchecked(v)		atomic_add_unchecked(1, v)
- #define atomic_dec(v)		atomic_sub(1, v)
- 
- #define atomic_inc_and_test(v)	(atomic_add_return(1, v) == 0)
-diff -urNp linux-2.6.31.9/arch/arm/include/asm/elf.h linux-2.6.31.9/arch/arm/include/asm/elf.h
---- linux-2.6.31.9/arch/arm/include/asm/elf.h	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/arm/include/asm/elf.h	2009-12-14 18:31:32.014732405 -0500
-@@ -103,7 +103,14 @@ extern int arm_elf_read_implies_exec(con
+diff -urNp linux-2.6.32.9/arch/arm/include/asm/elf.h linux-2.6.32.9/arch/arm/include/asm/elf.h
+--- linux-2.6.32.9/arch/arm/include/asm/elf.h	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/include/asm/elf.h	2010-02-23 17:09:53.071672140 -0500
+@@ -109,7 +109,14 @@ int dump_task_regs(struct task_struct *t
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
  
@@ -361,9 +251,9 @@
  
  /* When the program starts, a1 contains a pointer to a function to be 
     registered with atexit, as per the SVR4 ABI.  A value of 0 means we 
-diff -urNp linux-2.6.31.9/arch/arm/include/asm/kmap_types.h linux-2.6.31.9/arch/arm/include/asm/kmap_types.h
---- linux-2.6.31.9/arch/arm/include/asm/kmap_types.h	2009-12-08 17:29:51.577600232 -0500
-+++ linux-2.6.31.9/arch/arm/include/asm/kmap_types.h	2009-12-14 18:31:32.016714958 -0500
+diff -urNp linux-2.6.32.9/arch/arm/include/asm/kmap_types.h linux-2.6.32.9/arch/arm/include/asm/kmap_types.h
+--- linux-2.6.32.9/arch/arm/include/asm/kmap_types.h	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/include/asm/kmap_types.h	2010-02-23 17:09:53.071672140 -0500
 @@ -19,6 +19,7 @@ enum km_type {
  	KM_SOFTIRQ0,
  	KM_SOFTIRQ1,
@@ -372,10 +262,10 @@
  	KM_TYPE_NR
  };
  
-diff -urNp linux-2.6.31.9/arch/arm/include/asm/uaccess.h linux-2.6.31.9/arch/arm/include/asm/uaccess.h
---- linux-2.6.31.9/arch/arm/include/asm/uaccess.h	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/arm/include/asm/uaccess.h	2009-12-14 18:31:32.017716940 -0500
-@@ -400,6 +400,9 @@ extern unsigned long __must_check __strn
+diff -urNp linux-2.6.32.9/arch/arm/include/asm/uaccess.h linux-2.6.32.9/arch/arm/include/asm/uaccess.h
+--- linux-2.6.32.9/arch/arm/include/asm/uaccess.h	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/include/asm/uaccess.h	2010-02-23 17:09:53.071672140 -0500
+@@ -403,6 +403,9 @@ extern unsigned long __must_check __strn
  
  static inline unsigned long __must_check copy_from_user(void *to, const void __user *from, unsigned long n)
  {
@@ -385,7 +275,7 @@
  	if (access_ok(VERIFY_READ, from, n))
  		n = __copy_from_user(to, from, n);
  	else /* security hole - plug it */
-@@ -409,6 +412,9 @@ static inline unsigned long __must_check
+@@ -412,6 +415,9 @@ static inline unsigned long __must_check
  
  static inline unsigned long __must_check copy_to_user(void __user *to, const void *from, unsigned long n)
  {
@@ -395,22 +285,169 @@
  	if (access_ok(VERIFY_WRITE, to, n))
  		n = __copy_to_user(to, from, n);
  	return n;
-diff -urNp linux-2.6.31.9/arch/arm/mach-ns9xxx/clock.c linux-2.6.31.9/arch/arm/mach-ns9xxx/clock.c
---- linux-2.6.31.9/arch/arm/mach-ns9xxx/clock.c	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/arm/mach-ns9xxx/clock.c	2009-12-14 18:31:32.038722269 -0500
-@@ -195,7 +195,7 @@ static int clk_debugfs_open(struct inode
- 	return single_open(file, clk_debugfs_show, NULL);
- }
- 
--static struct file_operations clk_debugfs_operations = {
-+static const struct file_operations clk_debugfs_operations = {
- 	.open = clk_debugfs_open,
- 	.read = seq_read,
- 	.llseek = seq_lseek,
-diff -urNp linux-2.6.31.9/arch/arm/mm/mmap.c linux-2.6.31.9/arch/arm/mm/mmap.c
---- linux-2.6.31.9/arch/arm/mm/mmap.c	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/arm/mm/mmap.c	2009-12-14 18:31:32.044718124 -0500
-@@ -62,6 +62,10 @@ arch_get_unmapped_area(struct file *filp
+diff -urNp linux-2.6.32.9/arch/arm/kernel/kgdb.c linux-2.6.32.9/arch/arm/kernel/kgdb.c
+--- linux-2.6.32.9/arch/arm/kernel/kgdb.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/kernel/kgdb.c	2010-02-23 17:09:53.071672140 -0500
+@@ -190,7 +190,7 @@ void kgdb_arch_exit(void)
+  * and we handle the normal undef case within the do_undefinstr
+  * handler.
+  */
+-struct kgdb_arch arch_kgdb_ops = {
++const struct kgdb_arch arch_kgdb_ops = {
+ #ifndef __ARMEB__
+ 	.gdb_bpt_instr		= {0xfe, 0xde, 0xff, 0xe7}
+ #else /* ! __ARMEB__ */
+diff -urNp linux-2.6.32.9/arch/arm/mach-at91/pm.c linux-2.6.32.9/arch/arm/mach-at91/pm.c
+--- linux-2.6.32.9/arch/arm/mach-at91/pm.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/mach-at91/pm.c	2010-02-23 17:09:53.071672140 -0500
+@@ -348,7 +348,7 @@ static void at91_pm_end(void)
+ }
+ 
+ 
+-static struct platform_suspend_ops at91_pm_ops ={
++static const struct platform_suspend_ops at91_pm_ops ={
+ 	.valid	= at91_pm_valid_state,
+ 	.begin	= at91_pm_begin,
+ 	.enter	= at91_pm_enter,
+diff -urNp linux-2.6.32.9/arch/arm/mach-omap1/pm.c linux-2.6.32.9/arch/arm/mach-omap1/pm.c
+--- linux-2.6.32.9/arch/arm/mach-omap1/pm.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/mach-omap1/pm.c	2010-02-23 17:09:53.071672140 -0500
+@@ -647,7 +647,7 @@ static struct irqaction omap_wakeup_irq 
+ 
+ 
+ 
+-static struct platform_suspend_ops omap_pm_ops ={
++static const struct platform_suspend_ops omap_pm_ops ={
+ 	.prepare	= omap_pm_prepare,
+ 	.enter		= omap_pm_enter,
+ 	.finish		= omap_pm_finish,
+diff -urNp linux-2.6.32.9/arch/arm/mach-omap2/pm24xx.c linux-2.6.32.9/arch/arm/mach-omap2/pm24xx.c
+--- linux-2.6.32.9/arch/arm/mach-omap2/pm24xx.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/mach-omap2/pm24xx.c	2010-02-23 17:09:53.071672140 -0500
+@@ -326,7 +326,7 @@ static void omap2_pm_finish(void)
+ 	enable_hlt();
+ }
+ 
+-static struct platform_suspend_ops omap_pm_ops = {
++static const struct platform_suspend_ops omap_pm_ops = {
+ 	.prepare	= omap2_pm_prepare,
+ 	.enter		= omap2_pm_enter,
+ 	.finish		= omap2_pm_finish,
+diff -urNp linux-2.6.32.9/arch/arm/mach-omap2/pm34xx.c linux-2.6.32.9/arch/arm/mach-omap2/pm34xx.c
+--- linux-2.6.32.9/arch/arm/mach-omap2/pm34xx.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/mach-omap2/pm34xx.c	2010-02-23 17:09:53.071672140 -0500
+@@ -401,7 +401,7 @@ static void omap3_pm_end(void)
+ 	return;
+ }
+ 
+-static struct platform_suspend_ops omap_pm_ops = {
++static const struct platform_suspend_ops omap_pm_ops = {
+ 	.begin		= omap3_pm_begin,
+ 	.end		= omap3_pm_end,
+ 	.prepare	= omap3_pm_prepare,
+diff -urNp linux-2.6.32.9/arch/arm/mach-pnx4008/pm.c linux-2.6.32.9/arch/arm/mach-pnx4008/pm.c
+--- linux-2.6.32.9/arch/arm/mach-pnx4008/pm.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/mach-pnx4008/pm.c	2010-02-23 17:09:53.071672140 -0500
+@@ -116,7 +116,7 @@ static int pnx4008_pm_valid(suspend_stat
+ 	       (state == PM_SUSPEND_MEM);
+ }
+ 
+-static struct platform_suspend_ops pnx4008_pm_ops = {
++static const struct platform_suspend_ops pnx4008_pm_ops = {
+ 	.enter = pnx4008_pm_enter,
+ 	.valid = pnx4008_pm_valid,
+ };
+diff -urNp linux-2.6.32.9/arch/arm/mach-pxa/pm.c linux-2.6.32.9/arch/arm/mach-pxa/pm.c
+--- linux-2.6.32.9/arch/arm/mach-pxa/pm.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/mach-pxa/pm.c	2010-02-23 17:09:53.071672140 -0500
+@@ -95,7 +95,7 @@ void pxa_pm_finish(void)
+ 		pxa_cpu_pm_fns->finish();
+ }
+ 
+-static struct platform_suspend_ops pxa_pm_ops = {
++static const struct platform_suspend_ops pxa_pm_ops = {
+ 	.valid		= pxa_pm_valid,
+ 	.enter		= pxa_pm_enter,
+ 	.prepare	= pxa_pm_prepare,
+diff -urNp linux-2.6.32.9/arch/arm/mach-pxa/sharpsl_pm.c linux-2.6.32.9/arch/arm/mach-pxa/sharpsl_pm.c
+--- linux-2.6.32.9/arch/arm/mach-pxa/sharpsl_pm.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/mach-pxa/sharpsl_pm.c	2010-02-23 17:09:53.071672140 -0500
+@@ -891,7 +891,7 @@ static void sharpsl_apm_get_power_status
+ }
+ 
+ #ifdef CONFIG_PM
+-static struct platform_suspend_ops sharpsl_pm_ops = {
++static const struct platform_suspend_ops sharpsl_pm_ops = {
+ 	.prepare	= pxa_pm_prepare,
+ 	.finish		= pxa_pm_finish,
+ 	.enter		= corgi_pxa_pm_enter,
+diff -urNp linux-2.6.32.9/arch/arm/mach-sa1100/pm.c linux-2.6.32.9/arch/arm/mach-sa1100/pm.c
+--- linux-2.6.32.9/arch/arm/mach-sa1100/pm.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/mach-sa1100/pm.c	2010-02-23 17:09:53.071672140 -0500
+@@ -120,7 +120,7 @@ unsigned long sleep_phys_sp(void *sp)
+ 	return virt_to_phys(sp);
+ }
+ 
+-static struct platform_suspend_ops sa11x0_pm_ops = {
++static const struct platform_suspend_ops sa11x0_pm_ops = {
+ 	.enter		= sa11x0_pm_enter,
+ 	.valid		= suspend_valid_only_mem,
+ };
+diff -urNp linux-2.6.32.9/arch/arm/mm/fault.c linux-2.6.32.9/arch/arm/mm/fault.c
+--- linux-2.6.32.9/arch/arm/mm/fault.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/mm/fault.c	2010-02-23 17:09:53.071672140 -0500
+@@ -166,6 +166,13 @@ __do_user_fault(struct task_struct *tsk,
+ 	}
+ #endif
+ 
++#ifdef CONFIG_PAX_PAGEEXEC
++	if (fsr & FSR_LNX_PF) {
++		pax_report_fault(regs, (void *)regs->ARM_pc, (void *)regs->ARM_sp);
++		do_group_exit(SIGKILL);
++	}
++#endif
++
+ 	tsk->thread.address = addr;
+ 	tsk->thread.error_code = fsr;
+ 	tsk->thread.trap_no = 14;
+@@ -357,6 +364,33 @@ do_page_fault(unsigned long addr, unsign
+ }
+ #endif					/* CONFIG_MMU */
+ 
++#ifdef CONFIG_PAX_PAGEEXEC
++void pax_report_insns(void *pc, void *sp)
++{
++	long i;
++
++	printk(KERN_ERR "PAX: bytes at PC: ");
++	for (i = 0; i < 20; i++) {
++		unsigned char c;
++		if (get_user(c, (__force unsigned char __user *)pc+i))
++			printk(KERN_CONT "?? ");
++		else
++			printk(KERN_CONT "%02x ", c);
++	}
++	printk("\n");
++
++	printk(KERN_ERR "PAX: bytes at SP-4: ");
++	for (i = -1; i < 20; i++) {
++		unsigned long c;
++		if (get_user(c, (__force unsigned long __user *)sp+i))
++			printk(KERN_CONT "???????? ");
++		else
++			printk(KERN_CONT "%08lx ", c);
++	}
++	printk("\n");
++}
++#endif
++
+ /*
+  * First Level Translation Fault Handler
+  *
+diff -urNp linux-2.6.32.9/arch/arm/mm/mmap.c linux-2.6.32.9/arch/arm/mm/mmap.c
+--- linux-2.6.32.9/arch/arm/mm/mmap.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/mm/mmap.c	2010-02-23 17:09:53.071672140 -0500
+@@ -63,6 +63,10 @@ arch_get_unmapped_area(struct file *filp
  	if (len > TASK_SIZE)
  		return -ENOMEM;
  
@@ -421,7 +458,7 @@
  	if (addr) {
  		if (do_align)
  			addr = COLOUR_ALIGN(addr, pgoff);
-@@ -74,10 +78,10 @@ arch_get_unmapped_area(struct file *filp
+@@ -75,10 +79,10 @@ arch_get_unmapped_area(struct file *filp
  			return addr;
  	}
  	if (len > mm->cached_hole_size) {
@@ -435,7 +472,7 @@
  	}
  
  full_search:
-@@ -93,8 +97,8 @@ full_search:
+@@ -94,8 +98,8 @@ full_search:
  			 * Start a new search - just in case we missed
  			 * some holes.
  			 */
@@ -446,73 +483,21 @@
  				mm->cached_hole_size = 0;
  				goto full_search;
  			}
-diff -urNp linux-2.6.31.9/arch/avr32/include/asm/atomic.h linux-2.6.31.9/arch/avr32/include/asm/atomic.h
---- linux-2.6.31.9/arch/avr32/include/asm/atomic.h	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/avr32/include/asm/atomic.h	2009-12-14 18:31:32.048719116 -0500
-@@ -20,7 +20,9 @@
- #define ATOMIC_INIT(i)  { (i) }
- 
- #define atomic_read(v)		((v)->counter)
-+#define atomic_read_unchecked(v)	((v)->counter)
- #define atomic_set(v, i)	(((v)->counter) = i)
-+#define atomic_set_unchecked(v, i)	(((v)->counter) = i)
- 
- /*
-  * atomic_sub_return - subtract the atomic variable
-@@ -48,6 +50,18 @@ static inline int atomic_sub_return(int 
+diff -urNp linux-2.6.32.9/arch/arm/plat-s3c/pm.c linux-2.6.32.9/arch/arm/plat-s3c/pm.c
+--- linux-2.6.32.9/arch/arm/plat-s3c/pm.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/arm/plat-s3c/pm.c	2010-02-23 17:09:53.071672140 -0500
+@@ -355,7 +355,7 @@ static void s3c_pm_finish(void)
+ 	s3c_pm_check_cleanup();
  }
  
- /*
-+ * atomic_sub_return_unchecked - subtract the atomic variable
-+ * @i: integer value to subtract
-+ * @v: pointer of type atomic_unchecked_t
-+ *
-+ * Atomically subtracts @i from @v. Returns the resulting value.
-+ */
-+static inline int atomic_sub_return_unchecked(int i, atomic_unchecked_t *v)
-+{
-+	return atomic_sub_return(i, (atomic_t *)v);
-+}
-+
-+/*
-  * atomic_add_return - add integer to atomic variable
-  * @i: integer value to add
-  * @v: pointer of type atomic_t
-@@ -76,6 +90,18 @@ static inline int atomic_add_return(int 
- }
- 
- /*
-+ * atomic_add_return_unchecked - add integer to atomic variable
-+ * @i: integer value to add
-+ * @v: pointer of type atomic_unchecked_t
-+ *
-+ * Atomically adds @i to @v. Returns the resulting value.
-+ */
-+static inline int atomic_add_return_unchecked(int i, atomic_unchecked_t *v)
-+{
-+	return atomic_add_return(i, (atomic_t *)v);
-+}
-+
-+/*
-  * atomic_sub_unless - sub unless the number is a given value
-  * @v: pointer of type atomic_t
-  * @a: the amount to add to v...
-@@ -176,9 +202,12 @@ static inline int atomic_sub_if_positive
- #define atomic_cmpxchg(v, o, n)	(cmpxchg(&((v)->counter), (o), (n)))
- 
- #define atomic_sub(i, v)	(void)atomic_sub_return(i, v)
-+#define atomic_sub_unchecked(i, v)	(void)atomic_sub_return_unchecked(i, v)
- #define atomic_add(i, v)	(void)atomic_add_return(i, v)
-+#define atomic_add_unchecked(i, v)	(void)atomic_add_return_unchecked(i, v)
- #define atomic_dec(v)		atomic_sub(1, (v))
- #define atomic_inc(v)		atomic_add(1, (v))
-+#define atomic_inc_unchecked(v)	(void)atomic_add_return_unchecked(1, (v))
- 
- #define atomic_dec_return(v)	atomic_sub_return(1, v)
- #define atomic_inc_return(v)	atomic_add_return(1, v)
-diff -urNp linux-2.6.31.9/arch/avr32/include/asm/elf.h linux-2.6.31.9/arch/avr32/include/asm/elf.h
---- linux-2.6.31.9/arch/avr32/include/asm/elf.h	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/avr32/include/asm/elf.h	2009-12-14 18:31:32.060886576 -0500
+-static struct platform_suspend_ops s3c_pm_ops = {
++static const struct platform_suspend_ops s3c_pm_ops = {
+ 	.enter		= s3c_pm_enter,
+ 	.prepare	= s3c_pm_prepare,
+ 	.finish		= s3c_pm_finish,
+diff -urNp linux-2.6.32.9/arch/avr32/include/asm/elf.h linux-2.6.32.9/arch/avr32/include/asm/elf.h
+--- linux-2.6.32.9/arch/avr32/include/asm/elf.h	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/avr32/include/asm/elf.h	2010-02-23 17:09:53.071672140 -0500
 @@ -85,8 +85,14 @@ typedef struct user_fpu_struct elf_fpreg
     the loader.  We need to make sure that it is out of the way of the program
     that it will "exec", and that there is sufficient room for the brk.  */
@@ -529,9 +514,9 @@
  
  /* This yields a mask that user programs can use to figure out what
     instruction set this CPU supports.  This could be done in user space,
-diff -urNp linux-2.6.31.9/arch/avr32/include/asm/kmap_types.h linux-2.6.31.9/arch/avr32/include/asm/kmap_types.h
---- linux-2.6.31.9/arch/avr32/include/asm/kmap_types.h	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/avr32/include/asm/kmap_types.h	2009-12-14 18:31:32.061724850 -0500
+diff -urNp linux-2.6.32.9/arch/avr32/include/asm/kmap_types.h linux-2.6.32.9/arch/avr32/include/asm/kmap_types.h
+--- linux-2.6.32.9/arch/avr32/include/asm/kmap_types.h	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/avr32/include/asm/kmap_types.h	2010-02-23 17:09:53.071672140 -0500
 @@ -22,7 +22,8 @@ D(10)	KM_IRQ0,
  D(11)	KM_IRQ1,
  D(12)	KM_SOFTIRQ0,
@@ -542,9 +527,21 @@
  };
  
  #undef D
-diff -urNp linux-2.6.31.9/arch/avr32/mm/fault.c linux-2.6.31.9/arch/avr32/mm/fault.c
---- linux-2.6.31.9/arch/avr32/mm/fault.c	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/avr32/mm/fault.c	2009-12-14 18:31:32.061724850 -0500
+diff -urNp linux-2.6.32.9/arch/avr32/mach-at32ap/pm.c linux-2.6.32.9/arch/avr32/mach-at32ap/pm.c
+--- linux-2.6.32.9/arch/avr32/mach-at32ap/pm.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/avr32/mach-at32ap/pm.c	2010-02-23 17:09:53.071672140 -0500
+@@ -176,7 +176,7 @@ out:
+ 	return 0;
+ }
+ 
+-static struct platform_suspend_ops avr32_pm_ops = {
++static const struct platform_suspend_ops avr32_pm_ops = {
+ 	.valid	= avr32_pm_valid_state,
+ 	.enter	= avr32_pm_enter,
+ };
+diff -urNp linux-2.6.32.9/arch/avr32/mm/fault.c linux-2.6.32.9/arch/avr32/mm/fault.c
+--- linux-2.6.32.9/arch/avr32/mm/fault.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/avr32/mm/fault.c	2010-02-23 17:09:53.071672140 -0500
 @@ -41,6 +41,23 @@ static inline int notify_page_fault(stru
  
  int exception_trace = 1;
@@ -586,187 +583,33 @@
  		if (exception_trace && printk_ratelimit())
  			printk("%s%s[%d]: segfault at %08lx pc %08lx "
  			       "sp %08lx ecr %lu\n",
-diff -urNp linux-2.6.31.9/arch/blackfin/include/asm/atomic.h linux-2.6.31.9/arch/blackfin/include/asm/atomic.h
---- linux-2.6.31.9/arch/blackfin/include/asm/atomic.h	2009-11-09 19:32:31.000000000 -0500
-+++ linux-2.6.31.9/arch/blackfin/include/asm/atomic.h	2009-12-14 18:31:32.070762992 -0500
-@@ -15,8 +15,10 @@
- 
- #define ATOMIC_INIT(i)	{ (i) }
- #define atomic_set(v, i)	(((v)->counter) = i)
-+#define atomic_set_unchecked(v, i)	(((v)->counter) = i)
- 
- #define atomic_read(v)	__raw_uncached_fetch_asm(&(v)->counter)
-+#define atomic_read_unchecked(v)	__raw_uncached_fetch_asm(&(v)->counter)
- 
- asmlinkage int __raw_uncached_fetch_asm(const volatile int *ptr);
- 
-@@ -35,11 +37,21 @@ static inline void atomic_add(int i, ato
- 	__raw_atomic_update_asm(&v->counter, i);
+diff -urNp linux-2.6.32.9/arch/blackfin/kernel/kgdb.c linux-2.6.32.9/arch/blackfin/kernel/kgdb.c
+--- linux-2.6.32.9/arch/blackfin/kernel/kgdb.c	2010-02-09 07:57:19.000000000 -0500
++++ linux-2.6.32.9/arch/blackfin/kernel/kgdb.c	2010-02-23 17:09:53.071672140 -0500
+@@ -428,7 +428,7 @@ int kgdb_arch_handle_exception(int vecto
+ 	return -1;		/* this means that we do not want to exit from the handler */
  }
  
-+static inline void atomic_add_unchecked(int i, atomic_unchecked_t *v)
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel-bare-grsecurity/linux-2.6-grsecurity.patch?r1=1.1.2.50&r2=1.1.2.51&f=u



More information about the pld-cvs-commit mailing list