packages (GRSECURITY_RAW): kernel/kernel-grsec_full.patch http://www.grsecu...

arekm arekm at pld-linux.org
Mon Nov 22 12:42:55 CET 2010


Author: arekm                        Date: Mon Nov 22 11:42:55 2010 GMT
Module: packages                      Tag: GRSECURITY_RAW
---- Log message:
http://www.grsecurity.net/~spender/grsecurity-2.2.0-2.6.36-201011151726.patch

---- Files affected:
packages/kernel:
   kernel-grsec_full.patch (1.3.2.46 -> 1.3.2.47) 

---- Diffs:

================================================================
Index: packages/kernel/kernel-grsec_full.patch
diff -u packages/kernel/kernel-grsec_full.patch:1.3.2.46 packages/kernel/kernel-grsec_full.patch:1.3.2.47
--- packages/kernel/kernel-grsec_full.patch:1.3.2.46	Sun Nov  7 07:52:07 2010
+++ packages/kernel/kernel-grsec_full.patch	Mon Nov 22 12:42:37 2010
@@ -2611,7 +2611,40 @@
  }
 diff -urNp linux-2.6.36/arch/powerpc/kernel/process.c linux-2.6.36/arch/powerpc/kernel/process.c
 --- linux-2.6.36/arch/powerpc/kernel/process.c	2010-10-20 16:30:22.000000000 -0400
-+++ linux-2.6.36/arch/powerpc/kernel/process.c	2010-11-06 18:58:15.000000000 -0400
++++ linux-2.6.36/arch/powerpc/kernel/process.c	2010-11-13 16:29:01.000000000 -0500
+@@ -654,8 +654,8 @@ void show_regs(struct pt_regs * regs)
+ 	 * Lookup NIP late so we have the best change of getting the
+ 	 * above info out without failing
+ 	 */
+-	printk("NIP ["REG"] %pS\n", regs->nip, (void *)regs->nip);
+-	printk("LR ["REG"] %pS\n", regs->link, (void *)regs->link);
++	printk("NIP ["REG"] %pA\n", regs->nip, (void *)regs->nip);
++	printk("LR ["REG"] %pA\n", regs->link, (void *)regs->link);
+ #endif
+ 	show_stack(current, (unsigned long *) regs->gpr[1]);
+ 	if (!user_mode(regs))
+@@ -1145,10 +1145,10 @@ void show_stack(struct task_struct *tsk,
+ 		newsp = stack[0];
+ 		ip = stack[STACK_FRAME_LR_SAVE];
+ 		if (!firstframe || ip != lr) {
+-			printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip);
++			printk("["REG"] ["REG"] %pA", sp, ip, (void *)ip);
+ #ifdef CONFIG_FUNCTION_GRAPH_TRACER
+ 			if ((ip == rth || ip == mrth) && curr_frame >= 0) {
+-				printk(" (%pS)",
++				printk(" (%pA)",
+ 				       (void *)current->ret_stack[curr_frame].ret);
+ 				curr_frame--;
+ 			}
+@@ -1168,7 +1168,7 @@ void show_stack(struct task_struct *tsk,
+ 			struct pt_regs *regs = (struct pt_regs *)
+ 				(sp + STACK_FRAME_OVERHEAD);
+ 			lr = regs->link;
+-			printk("--- Exception: %lx at %pS\n    LR = %pS\n",
++			printk("--- Exception: %lx at %pA\n    LR = %pA\n",
+ 			       regs->trap, (void *)regs->nip, (void *)lr);
+ 			firstframe = 1;
+ 		}
 @@ -1251,54 +1251,6 @@ unsigned long arch_align_stack(unsigned 
  	return sp & ~0xf;
  }
@@ -4026,6 +4059,82 @@
  	.alloc_coherent			= dma_4v_alloc_coherent,
  	.free_coherent			= dma_4v_free_coherent,
  	.map_page			= dma_4v_map_page,
+diff -urNp linux-2.6.36/arch/sparc/kernel/process_32.c linux-2.6.36/arch/sparc/kernel/process_32.c
+--- linux-2.6.36/arch/sparc/kernel/process_32.c	2010-10-20 16:30:22.000000000 -0400
++++ linux-2.6.36/arch/sparc/kernel/process_32.c	2010-11-13 16:29:01.000000000 -0500
+@@ -196,7 +196,7 @@ void __show_backtrace(unsigned long fp)
+ 		       rw->ins[4], rw->ins[5],
+ 		       rw->ins[6],
+ 		       rw->ins[7]);
+-		printk("%pS\n", (void *) rw->ins[7]);
++		printk("%pA\n", (void *) rw->ins[7]);
+ 		rw = (struct reg_window32 *) rw->ins[6];
+ 	}
+ 	spin_unlock_irqrestore(&sparc_backtrace_lock, flags);
+@@ -263,14 +263,14 @@ void show_regs(struct pt_regs *r)
+ 
+         printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx    %s\n",
+ 	       r->psr, r->pc, r->npc, r->y, print_tainted());
+-	printk("PC: <%pS>\n", (void *) r->pc);
++	printk("PC: <%pA>\n", (void *) r->pc);
+ 	printk("%%G: %08lx %08lx  %08lx %08lx  %08lx %08lx  %08lx %08lx\n",
+ 	       r->u_regs[0], r->u_regs[1], r->u_regs[2], r->u_regs[3],
+ 	       r->u_regs[4], r->u_regs[5], r->u_regs[6], r->u_regs[7]);
+ 	printk("%%O: %08lx %08lx  %08lx %08lx  %08lx %08lx  %08lx %08lx\n",
+ 	       r->u_regs[8], r->u_regs[9], r->u_regs[10], r->u_regs[11],
+ 	       r->u_regs[12], r->u_regs[13], r->u_regs[14], r->u_regs[15]);
+-	printk("RPC: <%pS>\n", (void *) r->u_regs[15]);
++	printk("RPC: <%pA>\n", (void *) r->u_regs[15]);
+ 
+ 	printk("%%L: %08lx %08lx  %08lx %08lx  %08lx %08lx  %08lx %08lx\n",
+ 	       rw->locals[0], rw->locals[1], rw->locals[2], rw->locals[3],
+@@ -305,7 +305,7 @@ void show_stack(struct task_struct *tsk,
+ 		rw = (struct reg_window32 *) fp;
+ 		pc = rw->ins[7];
+ 		printk("[%08lx : ", pc);
+-		printk("%pS ] ", (void *) pc);
++		printk("%pA ] ", (void *) pc);
+ 		fp = rw->ins[6];
+ 	} while (++count < 16);
+ 	printk("\n");
+diff -urNp linux-2.6.36/arch/sparc/kernel/process_64.c linux-2.6.36/arch/sparc/kernel/process_64.c
+--- linux-2.6.36/arch/sparc/kernel/process_64.c	2010-10-20 16:30:22.000000000 -0400
++++ linux-2.6.36/arch/sparc/kernel/process_64.c	2010-11-13 16:34:22.000000000 -0500
+@@ -180,14 +180,14 @@ static void show_regwindow(struct pt_reg
+ 	printk("i4: %016lx i5: %016lx i6: %016lx i7: %016lx\n",
+ 	       rwk->ins[4], rwk->ins[5], rwk->ins[6], rwk->ins[7]);
+ 	if (regs->tstate & TSTATE_PRIV)
+-		printk("I7: <%pS>\n", (void *) rwk->ins[7]);
++		printk("I7: <%pA>\n", (void *) rwk->ins[7]);
+ }
+ 
+ void show_regs(struct pt_regs *regs)
+ {
+ 	printk("TSTATE: %016lx TPC: %016lx TNPC: %016lx Y: %08x    %s\n", regs->tstate,
+ 	       regs->tpc, regs->tnpc, regs->y, print_tainted());
+-	printk("TPC: <%pS>\n", (void *) regs->tpc);
++	printk("TPC: <%pA>\n", (void *) regs->tpc);
+ 	printk("g0: %016lx g1: %016lx g2: %016lx g3: %016lx\n",
+ 	       regs->u_regs[0], regs->u_regs[1], regs->u_regs[2],
+ 	       regs->u_regs[3]);
+@@ -200,7 +200,7 @@ void show_regs(struct pt_regs *regs)
+ 	printk("o4: %016lx o5: %016lx sp: %016lx ret_pc: %016lx\n",
+ 	       regs->u_regs[12], regs->u_regs[13], regs->u_regs[14],
+ 	       regs->u_regs[15]);
+-	printk("RPC: <%pS>\n", (void *) regs->u_regs[15]);
++	printk("RPC: <%pA>\n", (void *) regs->u_regs[15]);
+ 	show_regwindow(regs);
+ 	show_stack(current, (unsigned long *) regs->u_regs[UREG_FP]);
+ }
+@@ -285,7 +285,7 @@ void arch_trigger_all_cpu_backtrace(void
+ 		       ((tp && tp->task) ? tp->task->pid : -1));
+ 
+ 		if (gp->tstate & TSTATE_PRIV) {
+-			printk("             TPC[%pS] O7[%pS] I7[%pS] RPC[%pS]\n",
++			printk("             TPC[%pA] O7[%pA] I7[%pA] RPC[%pA]\n",
+ 			       (void *) gp->tpc,
+ 			       (void *) gp->o7,
+ 			       (void *) gp->i7,
 diff -urNp linux-2.6.36/arch/sparc/kernel/sys_sparc_32.c linux-2.6.36/arch/sparc/kernel/sys_sparc_32.c
 --- linux-2.6.36/arch/sparc/kernel/sys_sparc_32.c	2010-10-20 16:30:22.000000000 -0400
 +++ linux-2.6.36/arch/sparc/kernel/sys_sparc_32.c	2010-11-06 18:58:15.000000000 -0400
@@ -4170,9 +4279,30 @@
  		mm->get_unmapped_area = arch_get_unmapped_area_topdown;
  		mm->unmap_area = arch_unmap_area_topdown;
  	}
+diff -urNp linux-2.6.36/arch/sparc/kernel/traps_32.c linux-2.6.36/arch/sparc/kernel/traps_32.c
+--- linux-2.6.36/arch/sparc/kernel/traps_32.c	2010-10-20 16:30:22.000000000 -0400
++++ linux-2.6.36/arch/sparc/kernel/traps_32.c	2010-11-13 16:29:01.000000000 -0500
+@@ -76,7 +76,7 @@ void die_if_kernel(char *str, struct pt_
+ 		      count++ < 30				&&
+                       (((unsigned long) rw) >= PAGE_OFFSET)	&&
+ 		      !(((unsigned long) rw) & 0x7)) {
+-			printk("Caller[%08lx]: %pS\n", rw->ins[7],
++			printk("Caller[%08lx]: %pA\n", rw->ins[7],
+ 			       (void *) rw->ins[7]);
+ 			rw = (struct reg_window32 *)rw->ins[6];
+ 		}
 diff -urNp linux-2.6.36/arch/sparc/kernel/traps_64.c linux-2.6.36/arch/sparc/kernel/traps_64.c
 --- linux-2.6.36/arch/sparc/kernel/traps_64.c	2010-10-20 16:30:22.000000000 -0400
-+++ linux-2.6.36/arch/sparc/kernel/traps_64.c	2010-11-06 18:58:15.000000000 -0400
++++ linux-2.6.36/arch/sparc/kernel/traps_64.c	2010-11-13 16:34:06.000000000 -0500
+@@ -75,7 +75,7 @@ static void dump_tl1_traplog(struct tl1_
+ 		       i + 1,
+ 		       p->trapstack[i].tstate, p->trapstack[i].tpc,
+ 		       p->trapstack[i].tnpc, p->trapstack[i].tt);
+-		printk("TRAPLOG: TPC<%pS>\n", (void *) p->trapstack[i].tpc);
++		printk("TRAPLOG: TPC<%pA>\n", (void *) p->trapstack[i].tpc);
+ 	}
+ }
+ 
 @@ -95,6 +95,12 @@ void bad_trap(struct pt_regs *regs, long
  
  	lvl -= 0x100;
@@ -4204,6 +4334,94 @@
  	dump_tl1_traplog((struct tl1_traplog *)(regs + 1));
  
  	sprintf (buffer, "Bad trap %lx at tl>0", lvl);
+@@ -1141,7 +1152,7 @@ static void cheetah_log_errors(struct pt
+ 	       regs->tpc, regs->tnpc, regs->u_regs[UREG_I7], regs->tstate);
+ 	printk("%s" "ERROR(%d): ",
+ 	       (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id());
+-	printk("TPC<%pS>\n", (void *) regs->tpc);
++	printk("TPC<%pA>\n", (void *) regs->tpc);
+ 	printk("%s" "ERROR(%d): M_SYND(%lx),  E_SYND(%lx)%s%s\n",
+ 	       (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
+ 	       (afsr & CHAFSR_M_SYNDROME) >> CHAFSR_M_SYNDROME_SHIFT,
+@@ -1748,7 +1759,7 @@ void cheetah_plus_parity_error(int type,
+ 		       smp_processor_id(),
+ 		       (type & 0x1) ? 'I' : 'D',
+ 		       regs->tpc);
+-		printk(KERN_EMERG "TPC<%pS>\n", (void *) regs->tpc);
++		printk(KERN_EMERG "TPC<%pA>\n", (void *) regs->tpc);
+ 		panic("Irrecoverable Cheetah+ parity error.");
+ 	}
+ 
+@@ -1756,7 +1767,7 @@ void cheetah_plus_parity_error(int type,
+ 	       smp_processor_id(),
+ 	       (type & 0x1) ? 'I' : 'D',
+ 	       regs->tpc);
+-	printk(KERN_WARNING "TPC<%pS>\n", (void *) regs->tpc);
++	printk(KERN_WARNING "TPC<%pA>\n", (void *) regs->tpc);
+ }
+ 
+ struct sun4v_error_entry {
+@@ -1963,9 +1974,9 @@ void sun4v_itlb_error_report(struct pt_r
+ 
+ 	printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
+ 	       regs->tpc, tl);
+-	printk(KERN_EMERG "SUN4V-ITLB: TPC<%pS>\n", (void *) regs->tpc);
++	printk(KERN_EMERG "SUN4V-ITLB: TPC<%pA>\n", (void *) regs->tpc);
+ 	printk(KERN_EMERG "SUN4V-ITLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
+-	printk(KERN_EMERG "SUN4V-ITLB: O7<%pS>\n",
++	printk(KERN_EMERG "SUN4V-ITLB: O7<%pA>\n",
+ 	       (void *) regs->u_regs[UREG_I7]);
+ 	printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] "
+ 	       "pte[%lx] error[%lx]\n",
+@@ -1987,9 +1998,9 @@ void sun4v_dtlb_error_report(struct pt_r
+ 
+ 	printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n",
+ 	       regs->tpc, tl);
+-	printk(KERN_EMERG "SUN4V-DTLB: TPC<%pS>\n", (void *) regs->tpc);
++	printk(KERN_EMERG "SUN4V-DTLB: TPC<%pA>\n", (void *) regs->tpc);
+ 	printk(KERN_EMERG "SUN4V-DTLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
+-	printk(KERN_EMERG "SUN4V-DTLB: O7<%pS>\n",
++	printk(KERN_EMERG "SUN4V-DTLB: O7<%pA>\n",
+ 	       (void *) regs->u_regs[UREG_I7]);
+ 	printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] "
+ 	       "pte[%lx] error[%lx]\n",
+@@ -2196,13 +2207,13 @@ void show_stack(struct task_struct *tsk,
+ 			fp = (unsigned long)sf->fp + STACK_BIAS;
+ 		}
+ 
+-		printk(" [%016lx] %pS\n", pc, (void *) pc);
++		printk(" [%016lx] %pA\n", pc, (void *) pc);
+ #ifdef CONFIG_FUNCTION_GRAPH_TRACER
+ 		if ((pc + 8UL) == (unsigned long) &return_to_handler) {
+ 			int index = tsk->curr_ret_stack;
+ 			if (tsk->ret_stack && index >= graph) {
+ 				pc = tsk->ret_stack[index - graph].ret;
+-				printk(" [%016lx] %pS\n", pc, (void *) pc);
++				printk(" [%016lx] %pA\n", pc, (void *) pc);
+ 				graph++;
+ 			}
+ 		}
+@@ -2255,7 +2266,7 @@ void die_if_kernel(char *str, struct pt_
+ 		while (rw &&
+ 		       count++ < 30 &&
+ 		       kstack_valid(tp, (unsigned long) rw)) {
+-			printk("Caller[%016lx]: %pS\n", rw->ins[7],
++			printk("Caller[%016lx]: %pA\n", rw->ins[7],
+ 			       (void *) rw->ins[7]);
+ 
+ 			rw = kernel_stack_up(rw);
+diff -urNp linux-2.6.36/arch/sparc/kernel/unaligned_64.c linux-2.6.36/arch/sparc/kernel/unaligned_64.c
+--- linux-2.6.36/arch/sparc/kernel/unaligned_64.c	2010-10-20 16:30:22.000000000 -0400
++++ linux-2.6.36/arch/sparc/kernel/unaligned_64.c	2010-11-13 16:33:46.000000000 -0500
+@@ -278,7 +278,7 @@ static void log_unaligned(struct pt_regs
+ 	static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5);
+ 
+ 	if (__ratelimit(&ratelimit)) {
+-		printk("Kernel unaligned access at TPC[%lx] %pS\n",
++		printk("Kernel unaligned access at TPC[%lx] %pA\n",
+ 		       regs->tpc, (void *) regs->tpc);
+ 	}
+ }
 diff -urNp linux-2.6.36/arch/sparc/lib/atomic_64.S linux-2.6.36/arch/sparc/lib/atomic_64.S
 --- linux-2.6.36/arch/sparc/lib/atomic_64.S	2010-10-20 16:30:22.000000000 -0400
 +++ linux-2.6.36/arch/sparc/lib/atomic_64.S	2010-11-06 18:58:15.000000000 -0400
@@ -4783,7 +5001,7 @@
  			goto bad_area;
 diff -urNp linux-2.6.36/arch/sparc/mm/fault_64.c linux-2.6.36/arch/sparc/mm/fault_64.c
 --- linux-2.6.36/arch/sparc/mm/fault_64.c	2010-10-20 16:30:22.000000000 -0400
-+++ linux-2.6.36/arch/sparc/mm/fault_64.c	2010-11-06 18:58:15.000000000 -0400
++++ linux-2.6.36/arch/sparc/mm/fault_64.c	2010-11-13 16:29:01.000000000 -0500
 @@ -21,6 +21,9 @@
  #include <linux/kprobes.h>
  #include <linux/kdebug.h>
@@ -4794,6 +5012,15 @@
  
  #include <asm/page.h>
  #include <asm/pgtable.h>
+@@ -74,7 +77,7 @@ static void __kprobes bad_kernel_pc(stru
+ 	printk(KERN_CRIT "OOPS: Bogus kernel PC [%016lx] in fault handler\n",
+ 	       regs->tpc);
+ 	printk(KERN_CRIT "OOPS: RPC [%016lx]\n", regs->u_regs[15]);
+-	printk("OOPS: RPC <%pS>\n", (void *) regs->u_regs[15]);
++	printk("OOPS: RPC <%pA>\n", (void *) regs->u_regs[15]);
+ 	printk(KERN_CRIT "OOPS: Fault was to vaddr[%lx]\n", vaddr);
+ 	dump_stack();
+ 	unhandled_fault(regs->tpc, current, regs);
 @@ -272,6 +275,457 @@ static void noinline __kprobes bogus_32b
  	show_regs(regs);
  }
@@ -7885,6 +8112,18 @@
  #ifdef CONFIG_4KSTACKS
  #define THREAD_ORDER	0
  #else
+diff -urNp linux-2.6.36/arch/x86/include/asm/page_64_types.h linux-2.6.36/arch/x86/include/asm/page_64_types.h
+--- linux-2.6.36/arch/x86/include/asm/page_64_types.h	2010-10-20 16:30:22.000000000 -0400
++++ linux-2.6.36/arch/x86/include/asm/page_64_types.h	2010-11-11 18:21:08.000000000 -0500
+@@ -56,7 +56,7 @@ void copy_page(void *to, void *from);
+ 
+ /* duplicated to the one in bootmem.h */
+ extern unsigned long max_pfn;
+-extern unsigned long phys_base;
++extern const unsigned long phys_base;
+ 
+ extern unsigned long __phys_addr(unsigned long);
+ #define __phys_reloc_hide(x)	(x)
 diff -urNp linux-2.6.36/arch/x86/include/asm/paravirt.h linux-2.6.36/arch/x86/include/asm/paravirt.h
 --- linux-2.6.36/arch/x86/include/asm/paravirt.h	2010-10-20 16:30:22.000000000 -0400
 +++ linux-2.6.36/arch/x86/include/asm/paravirt.h	2010-11-06 18:58:15.000000000 -0400
@@ -10209,7 +10448,7 @@
  	DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx));
 diff -urNp linux-2.6.36/arch/x86/kernel/cpu/common.c linux-2.6.36/arch/x86/kernel/cpu/common.c
 --- linux-2.6.36/arch/x86/kernel/cpu/common.c	2010-10-20 16:30:22.000000000 -0400
-+++ linux-2.6.36/arch/x86/kernel/cpu/common.c	2010-11-06 18:58:15.000000000 -0400
++++ linux-2.6.36/arch/x86/kernel/cpu/common.c	2010-11-11 18:21:08.000000000 -0500
 @@ -83,60 +83,6 @@ static const struct cpu_dev __cpuinitcon
  
  static const struct cpu_dev *this_cpu __cpuinitdata = &default_cpu;
@@ -10309,7 +10548,15 @@
  
  	memset(me->thread.tls_array, 0, GDT_ENTRY_TLS_ENTRIES * 8);
  	syscall_init();
-@@ -1224,7 +1174,7 @@ void __cpuinit cpu_init(void)
+@@ -1170,7 +1120,6 @@ void __cpuinit cpu_init(void)
+ 	wrmsrl(MSR_KERNEL_GS_BASE, 0);
+ 	barrier();
+ 
+-	x86_configure_nx();
+ 	if (cpu != 0)
+ 		enable_x2apic();
+ 
+@@ -1224,7 +1173,7 @@ void __cpuinit cpu_init(void)
  {
  	int cpu = smp_processor_id();
  	struct task_struct *curr = current;
@@ -10621,7 +10868,16 @@
  	if (probe_kernel_address((unsigned short *)ip, ud2))
 diff -urNp linux-2.6.36/arch/x86/kernel/dumpstack.c linux-2.6.36/arch/x86/kernel/dumpstack.c
 --- linux-2.6.36/arch/x86/kernel/dumpstack.c	2010-10-20 16:30:22.000000000 -0400
-+++ linux-2.6.36/arch/x86/kernel/dumpstack.c	2010-11-06 18:58:15.000000000 -0400
++++ linux-2.6.36/arch/x86/kernel/dumpstack.c	2010-11-13 16:29:01.000000000 -0500
+@@ -27,7 +27,7 @@ static int die_counter;
+ 
+ void printk_address(unsigned long address, int reliable)
+ {
+-	printk(" [<%p>] %s%pS\n", (void *) address,
++	printk(" [<%p>] %s%pA\n", (void *) address,
+ 			reliable ? "" : "? ", (void *) address);
+ }
+ 
 @@ -206,7 +206,7 @@ void dump_stack(void)
  #endif
  
@@ -12170,7 +12426,7 @@
 +	.endr
 diff -urNp linux-2.6.36/arch/x86/kernel/head_64.S linux-2.6.36/arch/x86/kernel/head_64.S
 --- linux-2.6.36/arch/x86/kernel/head_64.S	2010-10-20 16:30:22.000000000 -0400
-+++ linux-2.6.36/arch/x86/kernel/head_64.S	2010-11-06 18:58:15.000000000 -0400
++++ linux-2.6.36/arch/x86/kernel/head_64.S	2010-11-11 18:21:08.000000000 -0500
 @@ -19,6 +19,7 @@
  #include <asm/cache.h>
  #include <asm/processor-flags.h>
@@ -12297,7 +12553,15 @@
  #define NEXT_PAGE(name) \
  	.balign	PAGE_SIZE; \
  ENTRY(name)
-@@ -350,13 +352,36 @@ NEXT_PAGE(init_level4_pgt)
+@@ -339,7 +341,6 @@ ENTRY(name)
+ 	i = i + 1 ;					\
+ 	.endr
+ 
+-	.data
+ 	/*
+ 	 * This default setting generates an ident mapping at address 0x100000
+ 	 * and a mapping for the kernel that precisely maps virtual address
+@@ -350,13 +351,36 @@ NEXT_PAGE(init_level4_pgt)
  	.quad	level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
  	.org	init_level4_pgt + L4_PAGE_OFFSET*8, 0
  	.quad	level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE
@@ -12334,7 +12598,7 @@
  
  NEXT_PAGE(level3_kernel_pgt)
  	.fill	L3_START_KERNEL,8,0
-@@ -364,20 +389,23 @@ NEXT_PAGE(level3_kernel_pgt)
+@@ -364,20 +388,23 @@ NEXT_PAGE(level3_kernel_pgt)
  	.quad	level2_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE
  	.quad	level2_fixmap_pgt - __START_KERNEL_map + _PAGE_TABLE
  
@@ -12366,7 +12630,7 @@
  
  NEXT_PAGE(level2_kernel_pgt)
  	/*
-@@ -390,33 +418,55 @@ NEXT_PAGE(level2_kernel_pgt)
+@@ -390,33 +417,55 @@ NEXT_PAGE(level2_kernel_pgt)
  	 *  If you want to increase this then increase MODULES_VADDR
  	 *  too.)
  	 */
@@ -17420,7 +17684,7 @@
  		pnp_bios_is_utter_crap = 1;
 diff -urNp linux-2.6.36/arch/x86/mm/fault.c linux-2.6.36/arch/x86/mm/fault.c
 --- linux-2.6.36/arch/x86/mm/fault.c	2010-10-20 16:30:22.000000000 -0400
-+++ linux-2.6.36/arch/x86/mm/fault.c	2010-11-06 18:58:50.000000000 -0400
++++ linux-2.6.36/arch/x86/mm/fault.c	2010-11-13 16:29:01.000000000 -0500
 @@ -11,10 +11,18 @@
  #include <linux/kprobes.h>		/* __kprobes, ...		*/
  #include <linux/mmiotrace.h>		/* kmmio_handler, ...		*/
@@ -17814,7 +18078,7 @@
 +		}
 +		if (address < PAX_USER_SHADOW_BASE) {
 +			printk(KERN_ERR "PAX: please report this to pageexec at freemail.hu\n");
-+			printk(KERN_ERR "PAX: faulting IP: %pS\n", (void *)regs->ip);
++			printk(KERN_ERR "PAX: faulting IP: %pA\n", (void *)regs->ip);
 +			show_trace_log_lvl(NULL, NULL, (void *)regs->sp, regs->bp, KERN_ERR);
 +		} else
 +			address -= PAX_USER_SHADOW_BASE;
@@ -18707,7 +18971,7 @@
  		return "[vsyscall]";
 diff -urNp linux-2.6.36/arch/x86/mm/init.c linux-2.6.36/arch/x86/mm/init.c
 --- linux-2.6.36/arch/x86/mm/init.c	2010-10-20 16:30:22.000000000 -0400
-+++ linux-2.6.36/arch/x86/mm/init.c	2010-11-06 18:58:15.000000000 -0400
++++ linux-2.6.36/arch/x86/mm/init.c	2010-11-11 18:21:08.000000000 -0500
 @@ -70,11 +70,7 @@ static void __init find_early_table_spac
  	 * cause a hotspot and fill up ZONE_DMA. The page tables
  	 * need roughly 0.5KB per GB.
@@ -18736,7 +19000,7 @@
  		return 1;
  	if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
  		return 0;
-@@ -380,6 +382,88 @@ void free_init_pages(char *what, unsigne
+@@ -380,6 +382,86 @@ void free_init_pages(char *what, unsigne
  
  void free_initmem(void)
  {
@@ -18814,8 +19078,6 @@
 +			continue;
 +		if ((unsigned long)__va(__pa(_text)) <= addr && addr < (unsigned long)__va(__pa(_sdata)))
 +			set_pmd(pmd, __pmd(pmd_val(*pmd) & ~_PAGE_RW));
-+		else
-+			set_pmd(pmd, __pmd(pmd_val(*pmd) | (_PAGE_NX & __supported_pte_mask)));
 +	}
 +#endif
 +
@@ -20404,7 +20666,7 @@
  	int rearm = 0, budget = blk_iopoll_budget;
 diff -urNp linux-2.6.36/block/blk-map.c linux-2.6.36/block/blk-map.c
 --- linux-2.6.36/block/blk-map.c	2010-10-20 16:30:22.000000000 -0400
-+++ linux-2.6.36/block/blk-map.c	2010-11-06 18:58:15.000000000 -0400
++++ linux-2.6.36/block/blk-map.c	2010-11-11 18:24:09.000000000 -0500
 @@ -54,7 +54,7 @@ static int __blk_rq_map_user(struct requ
  	 * direct dma. else, set up kernel bounce buffers
  	 */
@@ -20414,7 +20676,16 @@
  		bio = bio_map_user(q, NULL, uaddr, len, reading, gfp_mask);
  	else
  		bio = bio_copy_user(q, map_data, uaddr, len, reading, gfp_mask);
-@@ -297,7 +297,7 @@ int blk_rq_map_kern(struct request_queue
+@@ -205,6 +205,8 @@ int blk_rq_map_user_iov(struct request_q
+ 			unaligned = 1;
+ 			break;
+ 		}
++		if (!iov[i].iov_len)
++			return -EINVAL;
+ 	}
+ 
+ 	if (unaligned || (q->dma_pad_mask & len) || map_data)
+@@ -297,7 +299,7 @@ int blk_rq_map_kern(struct request_queue
  	if (!len || !kbuf)
  		return -EINVAL;
  
@@ -20435,6 +20706,67 @@
  {
  	struct list_head *cpu_list, local_list;
  
+diff -urNp linux-2.6.36/block/scsi_ioctl.c linux-2.6.36/block/scsi_ioctl.c
+--- linux-2.6.36/block/scsi_ioctl.c	2010-10-20 16:30:22.000000000 -0400
++++ linux-2.6.36/block/scsi_ioctl.c	2010-11-11 18:32:59.000000000 -0500
+@@ -321,33 +321,47 @@ static int sg_io(struct request_queue *q
+ 	if (hdr->iovec_count) {
+ 		const int size = sizeof(struct sg_iovec) * hdr->iovec_count;
+ 		size_t iov_data_len;
+-		struct sg_iovec *iov;
++		struct sg_iovec *sg_iov;
++		struct iovec *iov;
++		int i;
+ 
+-		iov = kmalloc(size, GFP_KERNEL);
+-		if (!iov) {
++		sg_iov = kmalloc(size, GFP_KERNEL);
++		if (!sg_iov) {
+ 			ret = -ENOMEM;
+ 			goto out;
+ 		}
+ 
+-		if (copy_from_user(iov, hdr->dxferp, size)) {
+-			kfree(iov);
++		if (copy_from_user(sg_iov, hdr->dxferp, size)) {
++			kfree(sg_iov);
+ 			ret = -EFAULT;
+ 			goto out;
+ 		}
+ 
++		/*
++		 * Sum up the vecs, making sure they don't overflow
++		 */
++		iov = (struct iovec *) sg_iov;
++		iov_data_len = 0;
++		for (i = 0; i < hdr->iovec_count; i++) {
++			if (iov_data_len + iov[i].iov_len < iov_data_len) {
++				kfree(sg_iov);
++				ret = -EINVAL;
++				goto out;
++			}
++			iov_data_len += iov[i].iov_len;
++		}
++
+ 		/* SG_IO howto says that the shorter of the two wins */
+-		iov_data_len = iov_length((struct iovec *)iov,
+-					  hdr->iovec_count);
+ 		if (hdr->dxfer_len < iov_data_len) {
+-			hdr->iovec_count = iov_shorten((struct iovec *)iov,
++			hdr->iovec_count = iov_shorten(iov,
+ 						       hdr->iovec_count,
+ 						       hdr->dxfer_len);
+ 			iov_data_len = hdr->dxfer_len;
+ 		}
+ 
+-		ret = blk_rq_map_user_iov(q, rq, NULL, iov, hdr->iovec_count,
++		ret = blk_rq_map_user_iov(q, rq, NULL, sg_iov, hdr->iovec_count,
+ 					  iov_data_len, GFP_KERNEL);
+-		kfree(iov);
++		kfree(sg_iov);
+ 	} else if (hdr->dxfer_len)
+ 		ret = blk_rq_map_user(q, rq, NULL, hdr->dxferp, hdr->dxfer_len,
+ 				      GFP_KERNEL);
 diff -urNp linux-2.6.36/crypto/lrw.c linux-2.6.36/crypto/lrw.c
 --- linux-2.6.36/crypto/lrw.c	2010-10-20 16:30:22.000000000 -0400
 +++ linux-2.6.36/crypto/lrw.c	2010-11-06 18:58:15.000000000 -0400
@@ -20449,7 +20781,7 @@
  	crypto_cipher_clear_flags(child, CRYPTO_TFM_REQ_MASK);
 diff -urNp linux-2.6.36/Documentation/dontdiff linux-2.6.36/Documentation/dontdiff
 --- linux-2.6.36/Documentation/dontdiff	2010-10-20 16:30:22.000000000 -0400
-+++ linux-2.6.36/Documentation/dontdiff	2010-11-06 18:58:15.000000000 -0400
++++ linux-2.6.36/Documentation/dontdiff	2010-11-11 18:21:08.000000000 -0500
 @@ -3,6 +3,7 @@
  *.bin
  *.cpio
@@ -20486,7 +20818,15 @@
  SCCS
  System.map*
  TAGS
-@@ -76,7 +84,10 @@ btfixupprep
+@@ -62,6 +70,7 @@ aic7*reg_print.c*
+ aic7*seq.h*
+ aicasm
+ aicdb.h*
++altivec[0-9].c
+ asm-offsets.h
+ asm_offsets.h
+ autoconf.h*
+@@ -76,7 +85,10 @@ btfixupprep
  build
  bvmlinux
  bzImage*
@@ -20497,7 +20837,7 @@
  comp*.log
  compile.h*
  conf
-@@ -100,19 +111,22 @@ fore200e_mkfirm
+@@ -100,19 +112,23 @@ fore200e_mkfirm
  fore200e_pca_fw.c*
  gconf
  gen-devlist
@@ -20516,12 +20856,13 @@
 +initramfs_data.cpio.bz2
  initramfs_data.cpio.gz
  initramfs_list
++int[0-9]*.c
  kallsyms
 -kconfig
  keywords.c
  ksym.c*
  ksym.h*
-@@ -136,10 +150,13 @@ mkboot
+@@ -136,10 +152,13 @@ mkboot
  mkbugboot
  mkcpustr
  mkdep
@@ -20535,7 +20876,7 @@
  modules.order
  modversions.h*
  ncscope.*
-@@ -151,7 +168,9 @@ parse.h
+@@ -151,7 +170,9 @@ parse.h
  patches*
  pca200e.bin
  pca200e_ecd.bin2
@@ -20545,7 +20886,7 @@
  piggyback
  pnmtologo
  ppc_defs.h*
-@@ -160,12 +179,14 @@ qconf
+@@ -160,15 +181,18 @@ qconf
  raid6altivec*.c
  raid6int*.c
  raid6tables.c
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel/kernel-grsec_full.patch?r1=1.3.2.46&r2=1.3.2.47&f=u



More information about the pld-cvs-commit mailing list