SOURCES (LINUX_2_6): kernel-pax.patch - raw http://www.grsecurity....

zbyniu zbyniu at pld-linux.org
Wed May 7 11:47:43 CEST 2008


Author: zbyniu                       Date: Wed May  7 09:47:43 2008 GMT
Module: SOURCES                       Tag: LINUX_2_6
---- Log message:
- raw http://www.grsecurity.net/~paxguy1/pax-linux-2.6.24.6-test45.patch

---- Files affected:
SOURCES:
   kernel-pax.patch (1.1.2.5 -> 1.1.2.6) 

---- Diffs:

================================================================
Index: SOURCES/kernel-pax.patch
diff -u SOURCES/kernel-pax.patch:1.1.2.5 SOURCES/kernel-pax.patch:1.1.2.6
--- SOURCES/kernel-pax.patch:1.1.2.5	Mon Jan 28 02:33:52 2008
+++ SOURCES/kernel-pax.patch	Wed May  7 11:47:37 2008
@@ -1,7 +1,15 @@
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/Documentation/dontdiff linux-2.6.24-pax/Documentation/dontdiff
---- linux-2.6.24/Documentation/dontdiff	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/Documentation/dontdiff	2008-01-25 15:28:01.000000000 +0100
-@@ -183,11 +183,14 @@ version.h*
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/Documentation/dontdiff linux-2.6.24.6-pax/Documentation/dontdiff
+--- linux-2.6.24.6/Documentation/dontdiff	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/Documentation/dontdiff	2008-02-29 18:07:50.000000000 +0100
+@@ -3,6 +3,7 @@
+ *.bin
+ *.cpio
+ *.css
++*.dbg
+ *.dvi
+ *.eps
+ *.gif
+@@ -183,11 +184,14 @@ version.h*
  vmlinux
  vmlinux-*
  vmlinux.aout
@@ -18,9 +26,9 @@
 +utsrelease.h
  zImage*
  zconf.hash.c
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/Makefile linux-2.6.24-pax/Makefile
---- linux-2.6.24/Makefile	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/Makefile	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/Makefile linux-2.6.24.6-pax/Makefile
+--- linux-2.6.24.6/Makefile	2008-05-04 12:46:30.000000000 +0200
++++ linux-2.6.24.6-pax/Makefile	2008-05-04 12:46:45.000000000 +0200
 @@ -214,7 +214,7 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH"
  
  HOSTCC       = gcc
@@ -30,9 +38,29 @@
  HOSTCXXFLAGS = -O2
  
  # Decide whether to build built-in, modular, or both.
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/alpha/kernel/module.c linux-2.6.24-pax/arch/alpha/kernel/module.c
---- linux-2.6.24/arch/alpha/kernel/module.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/alpha/kernel/module.c	2008-01-25 15:28:01.000000000 +0100
+@@ -507,6 +507,9 @@ else
+ KBUILD_CFLAGS	+= -O2
+ endif
+ 
++# Force gcc to behave correct even for buggy distributions
++KBUILD_CFLAGS         += $(call cc-option, -fno-stack-protector)
++
+ include $(srctree)/arch/$(SRCARCH)/Makefile
+ 
+ ifdef CONFIG_FRAME_POINTER
+@@ -520,9 +523,6 @@ KBUILD_CFLAGS	+= -g
+ KBUILD_AFLAGS	+= -gdwarf-2
+ endif
+ 
+-# Force gcc to behave correct even for buggy distributions
+-KBUILD_CFLAGS         += $(call cc-option, -fno-stack-protector)
+-
+ # arch Makefile may override CC so keep this after arch Makefile is included
+ NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
+ CHECKFLAGS     += $(NOSTDINC_FLAGS)
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/alpha/kernel/module.c linux-2.6.24.6-pax/arch/alpha/kernel/module.c
+--- linux-2.6.24.6/arch/alpha/kernel/module.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/alpha/kernel/module.c	2008-02-29 18:07:50.000000000 +0100
 @@ -176,7 +176,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, 
  
  	/* The small sections were sorted to the end of the segment.
@@ -42,9 +70,9 @@
  	got = sechdrs[me->arch.gotsecindex].sh_addr;
  
  	for (i = 0; i < n; i++) {
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/alpha/kernel/osf_sys.c linux-2.6.24-pax/arch/alpha/kernel/osf_sys.c
---- linux-2.6.24/arch/alpha/kernel/osf_sys.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/alpha/kernel/osf_sys.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/alpha/kernel/osf_sys.c linux-2.6.24.6-pax/arch/alpha/kernel/osf_sys.c
+--- linux-2.6.24.6/arch/alpha/kernel/osf_sys.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/alpha/kernel/osf_sys.c	2008-02-29 18:07:50.000000000 +0100
 @@ -1288,6 +1288,10 @@ arch_get_unmapped_area(struct file *filp
  	   merely specific addresses, but regions of memory -- perhaps
  	   this feature should be incorporated into all ports?  */
@@ -67,9 +95,9 @@
  	if (addr != (unsigned long) -ENOMEM)
  		return addr;
  
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/alpha/mm/fault.c linux-2.6.24-pax/arch/alpha/mm/fault.c
---- linux-2.6.24/arch/alpha/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/alpha/mm/fault.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/alpha/mm/fault.c linux-2.6.24.6-pax/arch/alpha/mm/fault.c
+--- linux-2.6.24.6/arch/alpha/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/alpha/mm/fault.c	2008-03-26 23:14:56.000000000 +0100
 @@ -23,6 +23,7 @@
  #include <linux/smp.h>
  #include <linux/interrupt.h>
@@ -225,7 +253,7 @@
 +
 +			}
 +			pax_report_fault(regs, (void *)regs->pc, (void *)rdusp());
-+			do_exit(SIGKILL);
++			do_group_exit(SIGKILL);
 +#else
  			goto bad_area;
 +#endif
@@ -234,9 +262,9 @@
  	} else if (!cause) {
  		/* Allow reads even for write-only mappings */
  		if (!(vma->vm_flags & (VM_READ | VM_WRITE)))
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/arm/mm/mmap.c linux-2.6.24-pax/arch/arm/mm/mmap.c
---- linux-2.6.24/arch/arm/mm/mmap.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/arm/mm/mmap.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/arm/mm/mmap.c linux-2.6.24.6-pax/arch/arm/mm/mmap.c
+--- linux-2.6.24.6/arch/arm/mm/mmap.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/arm/mm/mmap.c	2008-02-29 18:07:50.000000000 +0100
 @@ -60,6 +60,10 @@ arch_get_unmapped_area(struct file *filp
  	if (len > TASK_SIZE)
  		return -ENOMEM;
@@ -273,9 +301,9 @@
  				mm->cached_hole_size = 0;
  				goto full_search;
  			}
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/avr32/mm/fault.c linux-2.6.24-pax/arch/avr32/mm/fault.c
---- linux-2.6.24/arch/avr32/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/avr32/mm/fault.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/avr32/mm/fault.c linux-2.6.24.6-pax/arch/avr32/mm/fault.c
+--- linux-2.6.24.6/arch/avr32/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/avr32/mm/fault.c	2008-03-26 23:15:13.000000000 +0100
 @@ -41,6 +41,23 @@ static inline int notify_page_fault(stru
  
  int exception_trace = 1;
@@ -309,7 +337,7 @@
 +		if (mm->pax_flags & MF_PAX_PAGEEXEC) {
 +			if (ecr == ECR_PROTECTION_X || ecr == ECR_TLB_MISS_X) {
 +				pax_report_fault(regs, (void *)regs->pc, (void *)regs->sp);
-+				do_exit(SIGKILL);
++				do_group_exit(SIGKILL);
 +			}
 +		}
 +#endif
@@ -317,9 +345,9 @@
  		if (exception_trace && printk_ratelimit())
  			printk("%s%s[%d]: segfault at %08lx pc %08lx "
  			       "sp %08lx ecr %lu\n",
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/ia64/ia32/binfmt_elf32.c linux-2.6.24-pax/arch/ia64/ia32/binfmt_elf32.c
---- linux-2.6.24/arch/ia64/ia32/binfmt_elf32.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/ia64/ia32/binfmt_elf32.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/ia64/ia32/binfmt_elf32.c linux-2.6.24.6-pax/arch/ia64/ia32/binfmt_elf32.c
+--- linux-2.6.24.6/arch/ia64/ia32/binfmt_elf32.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/ia64/ia32/binfmt_elf32.c	2008-02-29 18:07:50.000000000 +0100
 @@ -45,6 +45,13 @@ randomize_stack_top(unsigned long stack_
  
  #define elf_read_implies_exec(ex, have_pt_gnu_stack)	(!(have_pt_gnu_stack))
@@ -334,9 +362,9 @@
  /* Ugly but avoids duplication */
  #include "../../../fs/binfmt_elf.c"
  
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/ia64/ia32/ia32priv.h linux-2.6.24-pax/arch/ia64/ia32/ia32priv.h
---- linux-2.6.24/arch/ia64/ia32/ia32priv.h	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/ia64/ia32/ia32priv.h	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/ia64/ia32/ia32priv.h linux-2.6.24.6-pax/arch/ia64/ia32/ia32priv.h
+--- linux-2.6.24.6/arch/ia64/ia32/ia32priv.h	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/ia64/ia32/ia32priv.h	2008-02-29 18:07:50.000000000 +0100
 @@ -303,7 +303,14 @@ struct old_linux32_dirent {
  #define ELF_DATA	ELFDATA2LSB
  #define ELF_ARCH	EM_386
@@ -353,9 +381,9 @@
  #define IA32_GATE_OFFSET	IA32_PAGE_OFFSET
  #define IA32_GATE_END		IA32_PAGE_OFFSET + PAGE_SIZE
  
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/ia64/kernel/module.c linux-2.6.24-pax/arch/ia64/kernel/module.c
---- linux-2.6.24/arch/ia64/kernel/module.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/ia64/kernel/module.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/ia64/kernel/module.c linux-2.6.24.6-pax/arch/ia64/kernel/module.c
+--- linux-2.6.24.6/arch/ia64/kernel/module.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/ia64/kernel/module.c	2008-02-29 18:07:50.000000000 +0100
 @@ -321,7 +321,7 @@ module_alloc (unsigned long size)
  void
  module_free (struct module *mod, void *module_region)
@@ -403,7 +431,7 @@
  in_core (const struct module *mod, uint64_t addr)
  {
 -	return addr - (uint64_t) mod->module_core < mod->core_size;
-+	return in_core_rx(mod, value) || in_core_rw(mod, value);
++	return in_core_rx(mod, addr) || in_core_rw(mod, addr);
  }
  
  static inline int
@@ -443,9 +471,9 @@
  		mod->arch.gp = gp;
  		DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp);
  	}
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/ia64/kernel/sys_ia64.c linux-2.6.24-pax/arch/ia64/kernel/sys_ia64.c
---- linux-2.6.24/arch/ia64/kernel/sys_ia64.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/ia64/kernel/sys_ia64.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/ia64/kernel/sys_ia64.c linux-2.6.24.6-pax/arch/ia64/kernel/sys_ia64.c
+--- linux-2.6.24.6/arch/ia64/kernel/sys_ia64.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/ia64/kernel/sys_ia64.c	2008-02-29 18:07:50.000000000 +0100
 @@ -43,6 +43,13 @@ arch_get_unmapped_area (struct file *fil
  	if (REGION_NUMBER(addr) == RGN_HPAGE)
  		addr = 0;
@@ -472,13 +500,13 @@
  				goto full_search;
  			}
  			return -ENOMEM;
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/ia64/mm/fault.c linux-2.6.24-pax/arch/ia64/mm/fault.c
---- linux-2.6.24/arch/ia64/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/ia64/mm/fault.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/ia64/mm/fault.c linux-2.6.24.6-pax/arch/ia64/mm/fault.c
+--- linux-2.6.24.6/arch/ia64/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/ia64/mm/fault.c	2008-03-26 23:15:32.000000000 +0100
 @@ -10,6 +10,7 @@
+ #include <linux/interrupt.h>
  #include <linux/kprobes.h>
  #include <linux/kdebug.h>
- #include <linux/vs_memory.h>
 +#include <linux/binfmts.h>
  
  #include <asm/pgtable.h>
@@ -521,7 +549,7 @@
 +
 +			up_read(&mm->mmap_sem);
 +			pax_report_fault(regs, (void *)regs->cr_iip, (void *)regs->r12);
-+			do_exit(SIGKILL);
++			do_group_exit(SIGKILL);
 +		}
 +#endif
 +
@@ -532,9 +560,9 @@
    survive:
  	/*
  	 * If for any reason at all we couldn't handle the fault, make
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/ia64/mm/init.c linux-2.6.24-pax/arch/ia64/mm/init.c
---- linux-2.6.24/arch/ia64/mm/init.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/ia64/mm/init.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/ia64/mm/init.c linux-2.6.24.6-pax/arch/ia64/mm/init.c
+--- linux-2.6.24.6/arch/ia64/mm/init.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/ia64/mm/init.c	2008-02-29 18:07:50.000000000 +0100
 @@ -20,8 +20,8 @@
  #include <linux/proc_fs.h>
  #include <linux/bitops.h>
@@ -565,9 +593,9 @@
  		vma->vm_page_prot = vm_get_page_prot(vma->vm_flags);
  		down_write(&current->mm->mmap_sem);
  		if (insert_vm_struct(current->mm, vma)) {
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/mips/kernel/binfmt_elfn32.c linux-2.6.24-pax/arch/mips/kernel/binfmt_elfn32.c
---- linux-2.6.24/arch/mips/kernel/binfmt_elfn32.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/mips/kernel/binfmt_elfn32.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/mips/kernel/binfmt_elfn32.c linux-2.6.24.6-pax/arch/mips/kernel/binfmt_elfn32.c
+--- linux-2.6.24.6/arch/mips/kernel/binfmt_elfn32.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/mips/kernel/binfmt_elfn32.c	2008-02-29 18:07:50.000000000 +0100
 @@ -50,6 +50,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
  #undef ELF_ET_DYN_BASE
  #define ELF_ET_DYN_BASE         (TASK32_SIZE / 3 * 2)
@@ -582,9 +610,9 @@
  #include <asm/processor.h>
  #include <linux/module.h>
  #include <linux/elfcore.h>
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/mips/kernel/binfmt_elfo32.c linux-2.6.24-pax/arch/mips/kernel/binfmt_elfo32.c
---- linux-2.6.24/arch/mips/kernel/binfmt_elfo32.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/mips/kernel/binfmt_elfo32.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/mips/kernel/binfmt_elfo32.c linux-2.6.24.6-pax/arch/mips/kernel/binfmt_elfo32.c
+--- linux-2.6.24.6/arch/mips/kernel/binfmt_elfo32.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/mips/kernel/binfmt_elfo32.c	2008-02-29 18:07:50.000000000 +0100
 @@ -52,6 +52,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
  #undef ELF_ET_DYN_BASE
  #define ELF_ET_DYN_BASE         (TASK32_SIZE / 3 * 2)
@@ -599,9 +627,9 @@
  #include <asm/processor.h>
  #include <linux/module.h>
  #include <linux/elfcore.h>
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/mips/kernel/syscall.c linux-2.6.24-pax/arch/mips/kernel/syscall.c
---- linux-2.6.24/arch/mips/kernel/syscall.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/mips/kernel/syscall.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/mips/kernel/syscall.c linux-2.6.24.6-pax/arch/mips/kernel/syscall.c
+--- linux-2.6.24.6/arch/mips/kernel/syscall.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/mips/kernel/syscall.c	2008-02-29 18:07:50.000000000 +0100
 @@ -93,6 +93,11 @@ unsigned long arch_get_unmapped_area(str
  	do_color_align = 0;
  	if (filp || (flags & MAP_SHARED))
@@ -623,9 +651,9 @@
  	if (do_color_align)
  		addr = COLOUR_ALIGN(addr, pgoff);
  	else
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/mips/mm/fault.c linux-2.6.24-pax/arch/mips/mm/fault.c
---- linux-2.6.24/arch/mips/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/mips/mm/fault.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/mips/mm/fault.c linux-2.6.24.6-pax/arch/mips/mm/fault.c
+--- linux-2.6.24.6/arch/mips/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/mips/mm/fault.c	2008-02-29 18:07:50.000000000 +0100
 @@ -26,6 +26,23 @@
  #include <asm/ptrace.h>
  #include <asm/highmem.h>		/* For VMALLOC_END */
@@ -650,9 +678,9 @@
  /*
   * This routine handles page faults.  It determines the address,
   * and the problem, and then passes it off to one of the appropriate
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/parisc/kernel/module.c linux-2.6.24-pax/arch/parisc/kernel/module.c
---- linux-2.6.24/arch/parisc/kernel/module.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/parisc/kernel/module.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/parisc/kernel/module.c linux-2.6.24.6-pax/arch/parisc/kernel/module.c
+--- linux-2.6.24.6/arch/parisc/kernel/module.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/parisc/kernel/module.c	2008-02-29 18:07:50.000000000 +0100
 @@ -73,16 +73,38 @@
  
  /* three functions to determine where in the module core
@@ -784,9 +812,9 @@
  
  	DEBUGP("register_unwind_table(), sect = %d at 0x%p - 0x%p (gp=0x%lx)\n",
  	       me->arch.unwind_section, table, end, gp);
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/parisc/kernel/sys_parisc.c linux-2.6.24-pax/arch/parisc/kernel/sys_parisc.c
---- linux-2.6.24/arch/parisc/kernel/sys_parisc.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/parisc/kernel/sys_parisc.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/parisc/kernel/sys_parisc.c linux-2.6.24.6-pax/arch/parisc/kernel/sys_parisc.c
+--- linux-2.6.24.6/arch/parisc/kernel/sys_parisc.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/parisc/kernel/sys_parisc.c	2008-02-29 18:07:50.000000000 +0100
 @@ -111,7 +111,7 @@ unsigned long arch_get_unmapped_area(str
  	if (flags & MAP_FIXED)
  		return addr;
@@ -796,9 +824,9 @@
  
  	if (filp) {
  		addr = get_shared_area(filp->f_mapping, addr, len, pgoff);
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/parisc/kernel/traps.c linux-2.6.24-pax/arch/parisc/kernel/traps.c
---- linux-2.6.24/arch/parisc/kernel/traps.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/parisc/kernel/traps.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/parisc/kernel/traps.c linux-2.6.24.6-pax/arch/parisc/kernel/traps.c
+--- linux-2.6.24.6/arch/parisc/kernel/traps.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/parisc/kernel/traps.c	2008-02-29 18:07:50.000000000 +0100
 @@ -713,9 +713,7 @@ void handle_interruption(int code, struc
  
  			down_read(&current->mm->mmap_sem);
@@ -810,9 +838,9 @@
  				fault_address = regs->iaoq[0];
  				fault_space = regs->iasq[0];
  
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/parisc/mm/fault.c linux-2.6.24-pax/arch/parisc/mm/fault.c
---- linux-2.6.24/arch/parisc/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/parisc/mm/fault.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/parisc/mm/fault.c linux-2.6.24.6-pax/arch/parisc/mm/fault.c
+--- linux-2.6.24.6/arch/parisc/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/parisc/mm/fault.c	2008-03-26 23:15:49.000000000 +0100
 @@ -16,6 +16,8 @@
  #include <linux/sched.h>
  #include <linux/interrupt.h>
@@ -974,7 +1002,7 @@
 +
 +			}
 +			pax_report_fault(regs, (void *)instruction_pointer(regs), (void *)regs->gr[30]);
-+			do_exit(SIGKILL);
++			do_group_exit(SIGKILL);
 +		}
 +#endif
 +
@@ -983,9 +1011,9 @@
  
  	/*
  	 * If for any reason at all we couldn't handle the fault, make
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/powerpc/kernel/module_32.c linux-2.6.24-pax/arch/powerpc/kernel/module_32.c
---- linux-2.6.24/arch/powerpc/kernel/module_32.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/powerpc/kernel/module_32.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/powerpc/kernel/module_32.c linux-2.6.24.6-pax/arch/powerpc/kernel/module_32.c
+--- linux-2.6.24.6/arch/powerpc/kernel/module_32.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/powerpc/kernel/module_32.c	2008-02-29 18:07:50.000000000 +0100
 @@ -126,7 +126,7 @@ int module_frob_arch_sections(Elf32_Ehdr
  			me->arch.core_plt_section = i;
  	}
@@ -1015,9 +1043,9 @@
  
  	/* Find this entry, or if that fails, the next avail. entry */
  	while (entry->jump[0]) {
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/powerpc/kernel/signal_32.c linux-2.6.24-pax/arch/powerpc/kernel/signal_32.c
---- linux-2.6.24/arch/powerpc/kernel/signal_32.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/powerpc/kernel/signal_32.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/powerpc/kernel/signal_32.c linux-2.6.24.6-pax/arch/powerpc/kernel/signal_32.c
+--- linux-2.6.24.6/arch/powerpc/kernel/signal_32.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/powerpc/kernel/signal_32.c	2008-02-29 18:07:50.000000000 +0100
 @@ -731,7 +731,7 @@ int handle_rt_signal32(unsigned long sig
  	/* Save user registers on the stack */
  	frame = &rt_sf->uc.uc_mcontext;
@@ -1027,9 +1055,9 @@
  		if (save_user_regs(regs, frame, 0))
  			goto badframe;
  		regs->link = current->mm->context.vdso_base + vdso32_rt_sigtramp;
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/powerpc/kernel/signal_64.c linux-2.6.24-pax/arch/powerpc/kernel/signal_64.c
---- linux-2.6.24/arch/powerpc/kernel/signal_64.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/powerpc/kernel/signal_64.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/powerpc/kernel/signal_64.c linux-2.6.24.6-pax/arch/powerpc/kernel/signal_64.c
+--- linux-2.6.24.6/arch/powerpc/kernel/signal_64.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/powerpc/kernel/signal_64.c	2008-02-29 18:07:50.000000000 +0100
 @@ -369,7 +369,7 @@ int handle_rt_signal64(int signr, struct
  	current->thread.fpscr.val = 0;
  
@@ -1039,9 +1067,9 @@
  		regs->link = current->mm->context.vdso_base + vdso64_rt_sigtramp;
  	} else {
  		err |= setup_trampoline(__NR_rt_sigreturn, &frame->tramp[0]);
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/powerpc/kernel/vdso.c linux-2.6.24-pax/arch/powerpc/kernel/vdso.c
---- linux-2.6.24/arch/powerpc/kernel/vdso.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/powerpc/kernel/vdso.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/powerpc/kernel/vdso.c linux-2.6.24.6-pax/arch/powerpc/kernel/vdso.c
+--- linux-2.6.24.6/arch/powerpc/kernel/vdso.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/powerpc/kernel/vdso.c	2008-02-29 18:07:50.000000000 +0100
 @@ -211,7 +211,7 @@ int arch_setup_additional_pages(struct l
  	vdso_base = VDSO32_MBASE;
  #endif
@@ -1060,9 +1088,9 @@
  	if (IS_ERR_VALUE(vdso_base)) {
  		rc = vdso_base;
  		goto fail_mmapsem;
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/powerpc/mm/fault.c linux-2.6.24-pax/arch/powerpc/mm/fault.c
---- linux-2.6.24/arch/powerpc/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/powerpc/mm/fault.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/powerpc/mm/fault.c linux-2.6.24.6-pax/arch/powerpc/mm/fault.c
+--- linux-2.6.24.6/arch/powerpc/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/powerpc/mm/fault.c	2008-03-26 23:16:06.000000000 +0100
 @@ -29,6 +29,12 @@
  #include <linux/module.h>
  #include <linux/kprobes.h>
@@ -1076,7 +1104,7 @@
  
  #include <asm/page.h>
  #include <asm/pgtable.h>
-@@ -62,6 +68,364 @@ static inline int notify_page_fault(stru
+@@ -62,6 +68,363 @@ static inline int notify_page_fault(stru
  }
  #endif
  
@@ -1114,7 +1142,6 @@
 +{
 +	int ret;
 +
-+	memset(vma, 0, sizeof(*vma));
 +	vma->vm_mm = current->mm;
 +	vma->vm_start = addr;
 +	vma->vm_end = addr + PAGE_SIZE;
@@ -1336,7 +1363,7 @@
 +			if (likely(call_syscall))
 +				goto emulate;
 +
-+			vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
++			vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
 +
 +			down_write(&current->mm->mmap_sem);
 +			if (current->mm->call_syscall) {
@@ -1385,7 +1412,7 @@
 +			if (likely(call_syscall))
 +				goto rt_emulate;
 +
-+			vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
++			vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
 +
 +			down_write(&current->mm->mmap_sem);
 +			if (current->mm->call_syscall) {
@@ -1441,7 +1468,7 @@
  /*
   * Check whether the instruction at regs->nip is a store using
   * an update addressing form which will update r1.
-@@ -157,7 +521,7 @@ int __kprobes do_page_fault(struct pt_re
+@@ -157,7 +520,7 @@ int __kprobes do_page_fault(struct pt_re
  	 * indicate errors in DSISR but can validly be set in SRR1.
  	 */
  	if (trap == 0x400)
@@ -1450,7 +1477,7 @@
  	else
  		is_write = error_code & DSISR_ISSTORE;
  #else
-@@ -357,6 +721,37 @@ bad_area:
+@@ -357,6 +720,37 @@ bad_area:
  bad_area_nosemaphore:
  	/* User mode accesses cause a SIGSEGV */
  	if (user_mode(regs)) {
@@ -1480,7 +1507,7 @@
 +				}
 +
 +				pax_report_fault(regs, (void*)regs->nip, (void*)regs->gpr[PT_R1]);
-+				do_exit(SIGKILL);
++				do_group_exit(SIGKILL);
 +			}
 +		}
 +#endif
@@ -1488,9 +1515,9 @@
  		_exception(SIGSEGV, regs, code, address);
  		return 0;
  	}
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/powerpc/mm/mmap.c linux-2.6.24-pax/arch/powerpc/mm/mmap.c
---- linux-2.6.24/arch/powerpc/mm/mmap.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/powerpc/mm/mmap.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/powerpc/mm/mmap.c linux-2.6.24.6-pax/arch/powerpc/mm/mmap.c
+--- linux-2.6.24.6/arch/powerpc/mm/mmap.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/powerpc/mm/mmap.c	2008-02-29 18:07:50.000000000 +0100
 @@ -75,10 +75,22 @@ void arch_pick_mmap_layout(struct mm_str
  	 */
  	if (mmap_is_legacy()) {
@@ -1514,9 +1541,9 @@
  		mm->get_unmapped_area = arch_get_unmapped_area_topdown;
  		mm->unmap_area = arch_unmap_area_topdown;
  	}
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/ppc/mm/fault.c linux-2.6.24-pax/arch/ppc/mm/fault.c
---- linux-2.6.24/arch/ppc/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/ppc/mm/fault.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/ppc/mm/fault.c linux-2.6.24.6-pax/arch/ppc/mm/fault.c
+--- linux-2.6.24.6/arch/ppc/mm/fault.c	2008-01-24 23:58:37.000000000 +0100
++++ linux-2.6.24.6-pax/arch/ppc/mm/fault.c	2008-03-26 23:16:50.000000000 +0100
 @@ -25,6 +25,11 @@
  #include <linux/interrupt.h>
  #include <linux/highmem.h>
@@ -1529,7 +1556,7 @@
  
  #include <asm/page.h>
  #include <asm/pgtable.h>
-@@ -48,6 +53,364 @@ unsigned long pte_misses;	/* updated by 
+@@ -48,6 +53,363 @@ unsigned long pte_misses;	/* updated by 
  unsigned long pte_errors;	/* updated by do_page_fault() */
  unsigned int probingmem;
  
@@ -1567,7 +1594,6 @@
 +{
 +	int ret;
 +
-+	memset(vma, 0, sizeof(*vma));
 +	vma->vm_mm = current->mm;
 +	vma->vm_start = addr;
 +	vma->vm_end = addr + PAGE_SIZE;
@@ -1789,7 +1815,7 @@
 +			if (likely(call_syscall))
 +				goto emulate;
 +
-+			vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
++			vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
 +
 +			down_write(&current->mm->mmap_sem);
 +			if (current->mm->call_syscall) {
@@ -1838,7 +1864,7 @@
 +			if (likely(call_syscall))
 +				goto rt_emulate;
 +
-+			vma = kmem_cache_alloc(vm_area_cachep, GFP_KERNEL);
++			vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL);
 +
 +			down_write(&current->mm->mmap_sem);
 +			if (current->mm->call_syscall) {
@@ -1894,7 +1920,7 @@
  /*
   * Check whether the instruction at regs->nip is a store using
   * an update addressing form which will update r1.
-@@ -109,7 +472,7 @@ int do_page_fault(struct pt_regs *regs, 
+@@ -109,7 +471,7 @@ int do_page_fault(struct pt_regs *regs, 
  	 * indicate errors in DSISR but can validly be set in SRR1.
  	 */
  	if (TRAP(regs) == 0x400)
@@ -1903,7 +1929,7 @@
  	else
  		is_write = error_code & 0x02000000;
  #endif /* CONFIG_4xx || CONFIG_BOOKE */
-@@ -204,15 +567,14 @@ good_area:
+@@ -204,15 +566,14 @@ good_area:
  		pte_t *ptep;
  		pmd_t *pmdp;
  
@@ -1921,7 +1947,7 @@
  		/* Since 4xx/Book-E supports per-page execute permission,
  		 * we lazily flush dcache to icache. */
  		ptep = NULL;
-@@ -235,6 +597,7 @@ good_area:
+@@ -235,6 +596,7 @@ good_area:
  			pte_unmap_unlock(ptep, ptl);
  		}
  #endif
@@ -1929,7 +1955,7 @@
  	/* a read */
  	} else {
  		/* protection fault */
-@@ -278,6 +641,33 @@ bad_area:
+@@ -278,6 +640,33 @@ bad_area:
  
  	/* User mode accesses cause a SIGSEGV */
  	if (user_mode(regs)) {
@@ -1955,7 +1981,7 @@
 +				}
 +
 +				pax_report_fault(regs, (void *)regs->nip, (void *)regs->gpr[1]);
-+				do_exit(SIGKILL);
++				do_group_exit(SIGKILL);
 +			}
 +		}
 +#endif
@@ -1963,9 +1989,9 @@
  		_exception(SIGSEGV, regs, code, address);
  		return 0;
  	}
-diff -NurpX linux-2.6.24-pax/Documentation/dontdiff linux-2.6.24/arch/s390/kernel/module.c linux-2.6.24-pax/arch/s390/kernel/module.c
---- linux-2.6.24/arch/s390/kernel/module.c	2008-01-24 23:58:37.000000000 +0100
-+++ linux-2.6.24-pax/arch/s390/kernel/module.c	2008-01-25 15:28:01.000000000 +0100
+diff -NurpX linux-2.6.24.6-pax/Documentation/dontdiff linux-2.6.24.6/arch/s390/kernel/module.c linux-2.6.24.6-pax/arch/s390/kernel/module.c
+--- linux-2.6.24.6/arch/s390/kernel/module.c	2008-01-24 23:58:37.000000000 +0100
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kernel-pax.patch?r1=1.1.2.5&r2=1.1.2.6&f=u



More information about the pld-cvs-commit mailing list