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

arekm arekm at pld-linux.org
Wed Aug 24 09:31:55 CEST 2011


Author: arekm                        Date: Wed Aug 24 07:31:55 2011 GMT
Module: packages                      Tag: GRSECURITY_RAW
---- Log message:
http://grsecurity.net/~spender/grsecurity-2.2.2-3.0.3-201108232250.patch

---- Files affected:
packages/kernel:
   kernel-grsec_full.patch (1.3.2.68 -> 1.3.2.69) 

---- Diffs:

================================================================
Index: packages/kernel/kernel-grsec_full.patch
diff -u packages/kernel/kernel-grsec_full.patch:1.3.2.68 packages/kernel/kernel-grsec_full.patch:1.3.2.69
--- packages/kernel/kernel-grsec_full.patch:1.3.2.68	Wed May 18 10:44:24 2011
+++ packages/kernel/kernel-grsec_full.patch	Wed Aug 24 09:31:32 2011
@@ -1,21 +1,6 @@
-diff -urNp linux-2.6.38.6/arch/alpha/include/asm/dma-mapping.h linux-2.6.38.6/arch/alpha/include/asm/dma-mapping.h
---- linux-2.6.38.6/arch/alpha/include/asm/dma-mapping.h	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/alpha/include/asm/dma-mapping.h	2011-04-28 19:34:14.000000000 -0400
-@@ -3,9 +3,9 @@
- 
- #include <linux/dma-attrs.h>
- 
--extern struct dma_map_ops *dma_ops;
-+extern const struct dma_map_ops *dma_ops;
- 
--static inline struct dma_map_ops *get_dma_ops(struct device *dev)
-+static inline const struct dma_map_ops *get_dma_ops(struct device *dev)
- {
- 	return dma_ops;
- }
-diff -urNp linux-2.6.38.6/arch/alpha/include/asm/elf.h linux-2.6.38.6/arch/alpha/include/asm/elf.h
---- linux-2.6.38.6/arch/alpha/include/asm/elf.h	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/alpha/include/asm/elf.h	2011-04-28 19:34:14.000000000 -0400
+diff -urNp linux-3.0.3/arch/alpha/include/asm/elf.h linux-3.0.3/arch/alpha/include/asm/elf.h
+--- linux-3.0.3/arch/alpha/include/asm/elf.h	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/alpha/include/asm/elf.h	2011-08-23 21:47:55.000000000 -0400
 @@ -90,6 +90,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_N
  
  #define ELF_ET_DYN_BASE		(TASK_UNMAPPED_BASE + 0x1000000)
@@ -30,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.38.6/arch/alpha/include/asm/pgtable.h linux-2.6.38.6/arch/alpha/include/asm/pgtable.h
---- linux-2.6.38.6/arch/alpha/include/asm/pgtable.h	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/alpha/include/asm/pgtable.h	2011-04-28 19:34:14.000000000 -0400
+diff -urNp linux-3.0.3/arch/alpha/include/asm/pgtable.h linux-3.0.3/arch/alpha/include/asm/pgtable.h
+--- linux-3.0.3/arch/alpha/include/asm/pgtable.h	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/alpha/include/asm/pgtable.h	2011-08-23 21:47:55.000000000 -0400
 @@ -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)
@@ -51,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.38.6/arch/alpha/kernel/module.c linux-2.6.38.6/arch/alpha/kernel/module.c
---- linux-2.6.38.6/arch/alpha/kernel/module.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/alpha/kernel/module.c	2011-04-28 19:34:14.000000000 -0400
+diff -urNp linux-3.0.3/arch/alpha/kernel/module.c linux-3.0.3/arch/alpha/kernel/module.c
+--- linux-3.0.3/arch/alpha/kernel/module.c	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/alpha/kernel/module.c	2011-08-23 21:47:55.000000000 -0400
 @@ -182,7 +182,7 @@ apply_relocate_add(Elf64_Shdr *sechdrs, 
  
  	/* The small sections were sorted to the end of the segment.
@@ -63,10 +48,10 @@
  	got = sechdrs[me->arch.gotsecindex].sh_addr;
  
  	for (i = 0; i < n; i++) {
-diff -urNp linux-2.6.38.6/arch/alpha/kernel/osf_sys.c linux-2.6.38.6/arch/alpha/kernel/osf_sys.c
---- linux-2.6.38.6/arch/alpha/kernel/osf_sys.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/alpha/kernel/osf_sys.c	2011-04-28 19:34:14.000000000 -0400
-@@ -1162,7 +1162,7 @@ arch_get_unmapped_area_1(unsigned long a
+diff -urNp linux-3.0.3/arch/alpha/kernel/osf_sys.c linux-3.0.3/arch/alpha/kernel/osf_sys.c
+--- linux-3.0.3/arch/alpha/kernel/osf_sys.c	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/alpha/kernel/osf_sys.c	2011-08-23 21:47:55.000000000 -0400
+@@ -1145,7 +1145,7 @@ arch_get_unmapped_area_1(unsigned long a
  		/* At this point:  (!vma || addr < vma->vm_end). */
  		if (limit - len < addr)
  			return -ENOMEM;
@@ -75,7 +60,7 @@
  			return addr;
  		addr = vma->vm_end;
  		vma = vma->vm_next;
-@@ -1198,6 +1198,10 @@ arch_get_unmapped_area(struct file *filp
+@@ -1181,6 +1181,10 @@ arch_get_unmapped_area(struct file *filp
  	   merely specific addresses, but regions of memory -- perhaps
  	   this feature should be incorporated into all ports?  */
  
@@ -86,7 +71,7 @@
  	if (addr) {
  		addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit);
  		if (addr != (unsigned long) -ENOMEM)
-@@ -1205,8 +1209,8 @@ arch_get_unmapped_area(struct file *filp
+@@ -1188,8 +1192,8 @@ arch_get_unmapped_area(struct file *filp
  	}
  
  	/* Next, try allocating at TASK_UNMAPPED_BASE.  */
@@ -97,49 +82,9 @@
  	if (addr != (unsigned long) -ENOMEM)
  		return addr;
  
-diff -urNp linux-2.6.38.6/arch/alpha/kernel/pci_iommu.c linux-2.6.38.6/arch/alpha/kernel/pci_iommu.c
---- linux-2.6.38.6/arch/alpha/kernel/pci_iommu.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/alpha/kernel/pci_iommu.c	2011-04-28 19:34:14.000000000 -0400
-@@ -950,7 +950,7 @@ static int alpha_pci_set_mask(struct dev
- 	return 0;
- }
- 
--struct dma_map_ops alpha_pci_ops = {
-+const struct dma_map_ops alpha_pci_ops = {
- 	.alloc_coherent		= alpha_pci_alloc_coherent,
- 	.free_coherent		= alpha_pci_free_coherent,
- 	.map_page		= alpha_pci_map_page,
-@@ -962,5 +962,5 @@ struct dma_map_ops alpha_pci_ops = {
- 	.set_dma_mask		= alpha_pci_set_mask,
- };
- 
--struct dma_map_ops *dma_ops = &alpha_pci_ops;
-+const struct dma_map_ops *dma_ops = &alpha_pci_ops;
- EXPORT_SYMBOL(dma_ops);
-diff -urNp linux-2.6.38.6/arch/alpha/kernel/pci-noop.c linux-2.6.38.6/arch/alpha/kernel/pci-noop.c
---- linux-2.6.38.6/arch/alpha/kernel/pci-noop.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/alpha/kernel/pci-noop.c	2011-04-28 19:34:14.000000000 -0400
-@@ -173,7 +173,7 @@ static int alpha_noop_set_mask(struct de
- 	return 0;
- }
- 
--struct dma_map_ops alpha_noop_ops = {
-+const struct dma_map_ops alpha_noop_ops = {
- 	.alloc_coherent		= alpha_noop_alloc_coherent,
- 	.free_coherent		= alpha_noop_free_coherent,
- 	.map_page		= alpha_noop_map_page,
-@@ -183,7 +183,7 @@ struct dma_map_ops alpha_noop_ops = {
- 	.set_dma_mask		= alpha_noop_set_mask,
- };
- 
--struct dma_map_ops *dma_ops = &alpha_noop_ops;
-+const struct dma_map_ops *dma_ops = &alpha_noop_ops;
- EXPORT_SYMBOL(dma_ops);
- 
- void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
-diff -urNp linux-2.6.38.6/arch/alpha/mm/fault.c linux-2.6.38.6/arch/alpha/mm/fault.c
---- linux-2.6.38.6/arch/alpha/mm/fault.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/alpha/mm/fault.c	2011-04-28 19:34:14.000000000 -0400
+diff -urNp linux-3.0.3/arch/alpha/mm/fault.c linux-3.0.3/arch/alpha/mm/fault.c
+--- linux-3.0.3/arch/alpha/mm/fault.c	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/alpha/mm/fault.c	2011-08-23 21:47:55.000000000 -0400
 @@ -54,6 +54,124 @@ __load_new_mm_context(struct mm_struct *
  	__reload_thread(pcb);
  }
@@ -296,10 +241,10 @@
  	} else if (!cause) {
  		/* Allow reads even for write-only mappings */
  		if (!(vma->vm_flags & (VM_READ | VM_WRITE)))
-diff -urNp linux-2.6.38.6/arch/arm/include/asm/elf.h linux-2.6.38.6/arch/arm/include/asm/elf.h
---- linux-2.6.38.6/arch/arm/include/asm/elf.h	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/arm/include/asm/elf.h	2011-04-28 19:34:14.000000000 -0400
-@@ -115,7 +115,14 @@ int dump_task_regs(struct task_struct *t
+diff -urNp linux-3.0.3/arch/arm/include/asm/elf.h linux-3.0.3/arch/arm/include/asm/elf.h
+--- linux-3.0.3/arch/arm/include/asm/elf.h	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/include/asm/elf.h	2011-08-23 21:47:55.000000000 -0400
+@@ -116,7 +116,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.  */
  
@@ -315,7 +260,7 @@
  
  /* 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 
-@@ -125,10 +132,6 @@ int dump_task_regs(struct task_struct *t
+@@ -126,10 +133,6 @@ int dump_task_regs(struct task_struct *t
  extern void elf_set_personality(const struct elf32_hdr *);
  #define SET_PERSONALITY(ex)	elf_set_personality(&(ex))
  
@@ -326,9 +271,9 @@
  extern int vectors_user_mapping(void);
  #define arch_setup_additional_pages(bprm, uses_interp) vectors_user_mapping()
  #define ARCH_HAS_SETUP_ADDITIONAL_PAGES
-diff -urNp linux-2.6.38.6/arch/arm/include/asm/kmap_types.h linux-2.6.38.6/arch/arm/include/asm/kmap_types.h
---- linux-2.6.38.6/arch/arm/include/asm/kmap_types.h	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/arm/include/asm/kmap_types.h	2011-04-28 19:34:14.000000000 -0400
+diff -urNp linux-3.0.3/arch/arm/include/asm/kmap_types.h linux-3.0.3/arch/arm/include/asm/kmap_types.h
+--- linux-3.0.3/arch/arm/include/asm/kmap_types.h	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/include/asm/kmap_types.h	2011-08-23 21:47:55.000000000 -0400
 @@ -21,6 +21,7 @@ enum km_type {
  	KM_L1_CACHE,
  	KM_L2_CACHE,
@@ -337,10 +282,45 @@
  	KM_TYPE_NR
  };
  
-diff -urNp linux-2.6.38.6/arch/arm/include/asm/uaccess.h linux-2.6.38.6/arch/arm/include/asm/uaccess.h
---- linux-2.6.38.6/arch/arm/include/asm/uaccess.h	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/arm/include/asm/uaccess.h	2011-04-28 19:34:14.000000000 -0400
-@@ -403,6 +403,9 @@ extern unsigned long __must_check __strn
+diff -urNp linux-3.0.3/arch/arm/include/asm/uaccess.h linux-3.0.3/arch/arm/include/asm/uaccess.h
+--- linux-3.0.3/arch/arm/include/asm/uaccess.h	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/include/asm/uaccess.h	2011-08-23 21:47:55.000000000 -0400
+@@ -22,6 +22,8 @@
+ #define VERIFY_READ 0
+ #define VERIFY_WRITE 1
+ 
++extern void check_object_size(const void *ptr, unsigned long n, bool to);
++
+ /*
+  * The exception table consists of pairs of addresses: the first is the
+  * address of an instruction that is allowed to fault, and the second is
+@@ -387,8 +389,23 @@ do {									\
+ 
+ 
+ #ifdef CONFIG_MMU
+-extern unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n);
+-extern unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n);
++extern unsigned long __must_check ___copy_from_user(void *to, const void __user *from, unsigned long n);
++extern unsigned long __must_check ___copy_to_user(void __user *to, const void *from, unsigned long n);
++
++static inline unsigned long __must_check __copy_from_user(void *to, const void __user *from, unsigned long n)
++{
++	if (!__builtin_constant_p(n))
++		check_object_size(to, n, false);
++	return ___copy_from_user(to, from, n);
++}
++
++static inline unsigned long __must_check __copy_to_user(void __user *to, const void *from, unsigned long n)
++{
++	if (!__builtin_constant_p(n))
++		check_object_size(from, n, true);
++	return ___copy_to_user(to, from, n);
++}
++
+ extern unsigned long __must_check __copy_to_user_std(void __user *to, const void *from, unsigned long n);
+ extern unsigned long __must_check __clear_user(void __user *addr, unsigned long n);
+ extern unsigned long __must_check __clear_user_std(void __user *addr, unsigned long n);
+@@ -403,6 +420,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)
  {
@@ -350,7 +330,7 @@
  	if (access_ok(VERIFY_READ, from, n))
  		n = __copy_from_user(to, from, n);
  	else /* security hole - plug it */
-@@ -412,6 +415,9 @@ static inline unsigned long __must_check
+@@ -412,6 +432,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)
  {
@@ -360,21 +340,23 @@
  	if (access_ok(VERIFY_WRITE, to, n))
  		n = __copy_to_user(to, from, n);
  	return n;
-diff -urNp linux-2.6.38.6/arch/arm/kernel/kgdb.c linux-2.6.38.6/arch/arm/kernel/kgdb.c
---- linux-2.6.38.6/arch/arm/kernel/kgdb.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/arm/kernel/kgdb.c	2011-04-28 19:34:14.000000000 -0400
-@@ -246,7 +246,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.38.6/arch/arm/kernel/process.c linux-2.6.38.6/arch/arm/kernel/process.c
---- linux-2.6.38.6/arch/arm/kernel/process.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/arm/kernel/process.c	2011-04-28 19:34:14.000000000 -0400
+diff -urNp linux-3.0.3/arch/arm/kernel/armksyms.c linux-3.0.3/arch/arm/kernel/armksyms.c
+--- linux-3.0.3/arch/arm/kernel/armksyms.c	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/kernel/armksyms.c	2011-08-23 21:47:55.000000000 -0400
+@@ -98,8 +98,8 @@ EXPORT_SYMBOL(__strncpy_from_user);
+ #ifdef CONFIG_MMU
+ EXPORT_SYMBOL(copy_page);
+ 
+-EXPORT_SYMBOL(__copy_from_user);
+-EXPORT_SYMBOL(__copy_to_user);
++EXPORT_SYMBOL(___copy_from_user);
++EXPORT_SYMBOL(___copy_to_user);
+ EXPORT_SYMBOL(__clear_user);
+ 
+ EXPORT_SYMBOL(__get_user_1);
+diff -urNp linux-3.0.3/arch/arm/kernel/process.c linux-3.0.3/arch/arm/kernel/process.c
+--- linux-3.0.3/arch/arm/kernel/process.c	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/kernel/process.c	2011-08-23 21:47:55.000000000 -0400
 @@ -28,7 +28,6 @@
  #include <linux/tick.h>
  #include <linux/utsname.h>
@@ -383,7 +365,7 @@
  #include <linux/hw_breakpoint.h>
  
  #include <asm/cacheflush.h>
-@@ -477,12 +476,6 @@ unsigned long get_wchan(struct task_stru
+@@ -479,12 +478,6 @@ unsigned long get_wchan(struct task_stru
  	return 0;
  }
  
@@ -396,21 +378,151 @@
  #ifdef CONFIG_MMU
  /*
   * The vectors page is always readable from user space for the
-diff -urNp linux-2.6.38.6/arch/arm/mach-msm/last_radio_log.c linux-2.6.38.6/arch/arm/mach-msm/last_radio_log.c
---- linux-2.6.38.6/arch/arm/mach-msm/last_radio_log.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/arm/mach-msm/last_radio_log.c	2011-04-28 19:34:14.000000000 -0400
-@@ -47,7 +47,7 @@ static ssize_t last_radio_log_read(struc
- 	return count;
+diff -urNp linux-3.0.3/arch/arm/kernel/traps.c linux-3.0.3/arch/arm/kernel/traps.c
+--- linux-3.0.3/arch/arm/kernel/traps.c	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/kernel/traps.c	2011-08-23 21:48:14.000000000 -0400
+@@ -257,6 +257,8 @@ static int __die(const char *str, int er
+ 
+ static DEFINE_SPINLOCK(die_lock);
+ 
++extern void gr_handle_kernel_exploit(void);
++
+ /*
+  * This function is protected against re-entrancy.
+  */
+@@ -284,6 +286,9 @@ void die(const char *str, struct pt_regs
+ 		panic("Fatal exception in interrupt");
+ 	if (panic_on_oops)
+ 		panic("Fatal exception");
++
++	gr_handle_kernel_exploit();
++
+ 	if (ret != NOTIFY_STOP)
+ 		do_exit(SIGSEGV);
  }
+diff -urNp linux-3.0.3/arch/arm/lib/copy_from_user.S linux-3.0.3/arch/arm/lib/copy_from_user.S
+--- linux-3.0.3/arch/arm/lib/copy_from_user.S	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/lib/copy_from_user.S	2011-08-23 21:47:55.000000000 -0400
+@@ -16,7 +16,7 @@
+ /*
+  * Prototype:
+  *
+- *	size_t __copy_from_user(void *to, const void *from, size_t n)
++ *	size_t ___copy_from_user(void *to, const void *from, size_t n)
+  *
+  * Purpose:
+  *
+@@ -84,11 +84,11 @@
  
--static struct file_operations last_radio_log_fops = {
-+static struct file_operations last_radio_log_fops = {	/* cannot be const, see msm_init_last_radio_log */
- 	.read = last_radio_log_read,
- 	.llseek = default_llseek,
- };
-diff -urNp linux-2.6.38.6/arch/arm/mach-ux500/mbox-db5500.c linux-2.6.38.6/arch/arm/mach-ux500/mbox-db5500.c
---- linux-2.6.38.6/arch/arm/mach-ux500/mbox-db5500.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/arm/mach-ux500/mbox-db5500.c	2011-04-28 19:34:14.000000000 -0400
+ 	.text
+ 
+-ENTRY(__copy_from_user)
++ENTRY(___copy_from_user)
+ 
+ #include "copy_template.S"
+ 
+-ENDPROC(__copy_from_user)
++ENDPROC(___copy_from_user)
+ 
+ 	.pushsection .fixup,"ax"
+ 	.align 0
+diff -urNp linux-3.0.3/arch/arm/lib/copy_to_user.S linux-3.0.3/arch/arm/lib/copy_to_user.S
+--- linux-3.0.3/arch/arm/lib/copy_to_user.S	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/lib/copy_to_user.S	2011-08-23 21:47:55.000000000 -0400
+@@ -16,7 +16,7 @@
+ /*
+  * Prototype:
+  *
+- *	size_t __copy_to_user(void *to, const void *from, size_t n)
++ *	size_t ___copy_to_user(void *to, const void *from, size_t n)
+  *
+  * Purpose:
+  *
+@@ -88,11 +88,11 @@
+ 	.text
+ 
+ ENTRY(__copy_to_user_std)
+-WEAK(__copy_to_user)
++WEAK(___copy_to_user)
+ 
+ #include "copy_template.S"
+ 
+-ENDPROC(__copy_to_user)
++ENDPROC(___copy_to_user)
+ ENDPROC(__copy_to_user_std)
+ 
+ 	.pushsection .fixup,"ax"
+diff -urNp linux-3.0.3/arch/arm/lib/uaccess.S linux-3.0.3/arch/arm/lib/uaccess.S
+--- linux-3.0.3/arch/arm/lib/uaccess.S	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/lib/uaccess.S	2011-08-23 21:47:55.000000000 -0400
+@@ -20,7 +20,7 @@
+ 
+ #define PAGE_SHIFT 12
+ 
+-/* Prototype: int __copy_to_user(void *to, const char *from, size_t n)
++/* Prototype: int ___copy_to_user(void *to, const char *from, size_t n)
+  * Purpose  : copy a block to user memory from kernel memory
+  * Params   : to   - user memory
+  *          : from - kernel memory
+@@ -40,7 +40,7 @@ USER(		T(strgtb) r3, [r0], #1)			@ May f
+ 		sub	r2, r2, ip
+ 		b	.Lc2u_dest_aligned
+ 
+-ENTRY(__copy_to_user)
++ENTRY(___copy_to_user)
+ 		stmfd	sp!, {r2, r4 - r7, lr}
+ 		cmp	r2, #4
+ 		blt	.Lc2u_not_enough
+@@ -278,14 +278,14 @@ USER(		T(strgeb) r3, [r0], #1)			@ May f
+ 		ldrgtb	r3, [r1], #0
+ USER(		T(strgtb) r3, [r0], #1)			@ May fault
+ 		b	.Lc2u_finished
+-ENDPROC(__copy_to_user)
++ENDPROC(___copy_to_user)
+ 
+ 		.pushsection .fixup,"ax"
+ 		.align	0
+ 9001:		ldmfd	sp!, {r0, r4 - r7, pc}
+ 		.popsection
+ 
+-/* Prototype: unsigned long __copy_from_user(void *to,const void *from,unsigned long n);
++/* Prototype: unsigned long ___copy_from_user(void *to,const void *from,unsigned long n);
+  * Purpose  : copy a block from user memory to kernel memory
+  * Params   : to   - kernel memory
+  *          : from - user memory
+@@ -304,7 +304,7 @@ USER(		T(ldrgtb) r3, [r1], #1)			@ May f
+ 		sub	r2, r2, ip
+ 		b	.Lcfu_dest_aligned
+ 
+-ENTRY(__copy_from_user)
++ENTRY(___copy_from_user)
+ 		stmfd	sp!, {r0, r2, r4 - r7, lr}
+ 		cmp	r2, #4
+ 		blt	.Lcfu_not_enough
+@@ -544,7 +544,7 @@ USER(		T(ldrgeb) r3, [r1], #1)			@ May f
+ USER(		T(ldrgtb) r3, [r1], #1)			@ May fault
+ 		strgtb	r3, [r0], #1
+ 		b	.Lcfu_finished
+-ENDPROC(__copy_from_user)
++ENDPROC(___copy_from_user)
+ 
+ 		.pushsection .fixup,"ax"
+ 		.align	0
+diff -urNp linux-3.0.3/arch/arm/lib/uaccess_with_memcpy.c linux-3.0.3/arch/arm/lib/uaccess_with_memcpy.c
+--- linux-3.0.3/arch/arm/lib/uaccess_with_memcpy.c	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/lib/uaccess_with_memcpy.c	2011-08-23 21:47:55.000000000 -0400
+@@ -103,7 +103,7 @@ out:
+ }
+ 
+ unsigned long
+-__copy_to_user(void __user *to, const void *from, unsigned long n)
++___copy_to_user(void __user *to, const void *from, unsigned long n)
+ {
+ 	/*
+ 	 * This test is stubbed out of the main function above to keep
+diff -urNp linux-3.0.3/arch/arm/mach-ux500/mbox-db5500.c linux-3.0.3/arch/arm/mach-ux500/mbox-db5500.c
+--- linux-3.0.3/arch/arm/mach-ux500/mbox-db5500.c	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/mach-ux500/mbox-db5500.c	2011-08-23 21:48:14.000000000 -0400
 @@ -168,7 +168,7 @@ static ssize_t mbox_read_fifo(struct dev
  	return sprintf(buf, "0x%X\n", mbox_value);
  }
@@ -420,10 +532,10 @@
  
  static int mbox_show(struct seq_file *s, void *data)
  {
-diff -urNp linux-2.6.38.6/arch/arm/mm/fault.c linux-2.6.38.6/arch/arm/mm/fault.c
---- linux-2.6.38.6/arch/arm/mm/fault.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/arm/mm/fault.c	2011-04-28 19:34:14.000000000 -0400
-@@ -167,6 +167,13 @@ __do_user_fault(struct task_struct *tsk,
+diff -urNp linux-3.0.3/arch/arm/mm/fault.c linux-3.0.3/arch/arm/mm/fault.c
+--- linux-3.0.3/arch/arm/mm/fault.c	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/mm/fault.c	2011-08-23 21:47:55.000000000 -0400
+@@ -182,6 +182,13 @@ __do_user_fault(struct task_struct *tsk,
  	}
  #endif
  
@@ -437,7 +549,7 @@
  	tsk->thread.address = addr;
  	tsk->thread.error_code = fsr;
  	tsk->thread.trap_no = 14;
-@@ -364,6 +371,33 @@ do_page_fault(unsigned long addr, unsign
+@@ -379,6 +386,33 @@ do_page_fault(unsigned long addr, unsign
  }
  #endif					/* CONFIG_MMU */
  
@@ -471,10 +583,10 @@
  /*
   * First Level Translation Fault Handler
   *
-diff -urNp linux-2.6.38.6/arch/arm/mm/mmap.c linux-2.6.38.6/arch/arm/mm/mmap.c
---- linux-2.6.38.6/arch/arm/mm/mmap.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/arm/mm/mmap.c	2011-04-28 19:34:14.000000000 -0400
-@@ -64,6 +64,10 @@ arch_get_unmapped_area(struct file *filp
+diff -urNp linux-3.0.3/arch/arm/mm/mmap.c linux-3.0.3/arch/arm/mm/mmap.c
+--- linux-3.0.3/arch/arm/mm/mmap.c	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/arm/mm/mmap.c	2011-08-23 21:47:55.000000000 -0400
+@@ -65,6 +65,10 @@ arch_get_unmapped_area(struct file *filp
  	if (len > TASK_SIZE)
  		return -ENOMEM;
  
@@ -485,7 +597,7 @@
  	if (addr) {
  		if (do_align)
  			addr = COLOUR_ALIGN(addr, pgoff);
-@@ -71,15 +75,14 @@ arch_get_unmapped_area(struct file *filp
+@@ -72,15 +76,14 @@ arch_get_unmapped_area(struct file *filp
  			addr = PAGE_ALIGN(addr);
  
  		vma = find_vma(mm, addr);
@@ -504,8 +616,8 @@
 +		mm->cached_hole_size = 0;
  	}
  	/* 8 bits of randomness in 20 address space bits */
- 	if (current->flags & PF_RANDOMIZE)
-@@ -98,14 +101,14 @@ full_search:
+ 	if ((current->flags & PF_RANDOMIZE) &&
+@@ -100,14 +103,14 @@ full_search:
  			 * Start a new search - just in case we missed
  			 * some holes.
  			 */
@@ -523,9 +635,9 @@
  			/*
  			 * Remember the place where we stopped the search:
  			 */
-diff -urNp linux-2.6.38.6/arch/avr32/include/asm/elf.h linux-2.6.38.6/arch/avr32/include/asm/elf.h
---- linux-2.6.38.6/arch/avr32/include/asm/elf.h	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/avr32/include/asm/elf.h	2011-04-28 19:34:14.000000000 -0400
+diff -urNp linux-3.0.3/arch/avr32/include/asm/elf.h linux-3.0.3/arch/avr32/include/asm/elf.h
+--- linux-3.0.3/arch/avr32/include/asm/elf.h	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/avr32/include/asm/elf.h	2011-08-23 21:47:55.000000000 -0400
 @@ -84,8 +84,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.  */
@@ -542,9 +654,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.38.6/arch/avr32/include/asm/kmap_types.h linux-2.6.38.6/arch/avr32/include/asm/kmap_types.h
---- linux-2.6.38.6/arch/avr32/include/asm/kmap_types.h	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/avr32/include/asm/kmap_types.h	2011-04-28 19:34:14.000000000 -0400
+diff -urNp linux-3.0.3/arch/avr32/include/asm/kmap_types.h linux-3.0.3/arch/avr32/include/asm/kmap_types.h
+--- linux-3.0.3/arch/avr32/include/asm/kmap_types.h	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/avr32/include/asm/kmap_types.h	2011-08-23 21:47:55.000000000 -0400
 @@ -22,7 +22,8 @@ D(10)	KM_IRQ0,
  D(11)	KM_IRQ1,
  D(12)	KM_SOFTIRQ0,
@@ -555,9 +667,9 @@
  };
  
  #undef D
-diff -urNp linux-2.6.38.6/arch/avr32/mm/fault.c linux-2.6.38.6/arch/avr32/mm/fault.c
---- linux-2.6.38.6/arch/avr32/mm/fault.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/avr32/mm/fault.c	2011-04-28 19:34:14.000000000 -0400
+diff -urNp linux-3.0.3/arch/avr32/mm/fault.c linux-3.0.3/arch/avr32/mm/fault.c
+--- linux-3.0.3/arch/avr32/mm/fault.c	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/avr32/mm/fault.c	2011-08-23 21:47:55.000000000 -0400
 @@ -41,6 +41,23 @@ static inline int notify_page_fault(stru
  
  int exception_trace = 1;
@@ -599,42 +711,9 @@
  		if (exception_trace && printk_ratelimit())
  			printk("%s%s[%d]: segfault at %08lx pc %08lx "
  			       "sp %08lx ecr %lu\n",
-diff -urNp linux-2.6.38.6/arch/blackfin/kernel/kgdb.c linux-2.6.38.6/arch/blackfin/kernel/kgdb.c
---- linux-2.6.38.6/arch/blackfin/kernel/kgdb.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/blackfin/kernel/kgdb.c	2011-04-28 19:34:14.000000000 -0400
-@@ -420,7 +420,7 @@ int kgdb_arch_handle_exception(int vecto
- 	return -1;		/* this means that we do not want to exit from the handler */
- }
- 
--struct kgdb_arch arch_kgdb_ops = {
-+const struct kgdb_arch arch_kgdb_ops = {
- 	.gdb_bpt_instr = {0xa1},
- #ifdef CONFIG_SMP
- 	.flags = KGDB_HW_BREAKPOINT|KGDB_THR_PROC_SWAP,
-diff -urNp linux-2.6.38.6/arch/blackfin/mm/maccess.c linux-2.6.38.6/arch/blackfin/mm/maccess.c
---- linux-2.6.38.6/arch/blackfin/mm/maccess.c	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/blackfin/mm/maccess.c	2011-04-28 19:34:14.000000000 -0400
-@@ -16,7 +16,7 @@ static int validate_memory_access_addres
- 	return bfin_mem_access_type(addr, size);
- }
- 
--long probe_kernel_read(void *dst, void *src, size_t size)
-+long probe_kernel_read(void *dst, const void *src, size_t size)
- {
- 	unsigned long lsrc = (unsigned long)src;
- 	int mem_type;
-@@ -55,7 +55,7 @@ long probe_kernel_read(void *dst, void *
- 	return -EFAULT;
- }
- 
--long probe_kernel_write(void *dst, void *src, size_t size)
-+long probe_kernel_write(void *dst, const void *src, size_t size)
- {
- 	unsigned long ldst = (unsigned long)dst;
- 	int mem_type;
-diff -urNp linux-2.6.38.6/arch/frv/include/asm/kmap_types.h linux-2.6.38.6/arch/frv/include/asm/kmap_types.h
---- linux-2.6.38.6/arch/frv/include/asm/kmap_types.h	2011-03-14 21:20:32.000000000 -0400
-+++ linux-2.6.38.6/arch/frv/include/asm/kmap_types.h	2011-04-28 19:34:14.000000000 -0400
+diff -urNp linux-3.0.3/arch/frv/include/asm/kmap_types.h linux-3.0.3/arch/frv/include/asm/kmap_types.h
+--- linux-3.0.3/arch/frv/include/asm/kmap_types.h	2011-07-21 22:17:23.000000000 -0400
++++ linux-3.0.3/arch/frv/include/asm/kmap_types.h	2011-08-23 21:47:55.000000000 -0400
 @@ -23,6 +23,7 @@ enum km_type {
  	KM_IRQ1,
  	KM_SOFTIRQ0,
@@ -643,9 +722,9 @@
  	KM_TYPE_NR
<<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.68&r2=1.3.2.69&f=u



More information about the pld-cvs-commit mailing list