SOURCES (LINUX_2_6): grsecurity-2.1.9-2.6.18.patch - official grse...

hawk hawk at pld-linux.org
Mon Oct 9 08:38:03 CEST 2006


Author: hawk                         Date: Mon Oct  9 06:38:03 2006 GMT
Module: SOURCES                       Tag: LINUX_2_6
---- Log message:
- official grsecurity for 2.6.18
- raw from http://www.grsecurity.net/grsecurity-2.1.9-2.6.18-200610021833.patch.gz

---- Files affected:
SOURCES:
   grsecurity-2.1.9-2.6.18.patch (1.1.2.2 -> 1.1.2.3) 

---- Diffs:

================================================================
Index: SOURCES/grsecurity-2.1.9-2.6.18.patch
diff -u SOURCES/grsecurity-2.1.9-2.6.18.patch:1.1.2.2 SOURCES/grsecurity-2.1.9-2.6.18.patch:1.1.2.3
--- SOURCES/grsecurity-2.1.9-2.6.18.patch:1.1.2.2	Thu Sep 28 02:33:37 2006
+++ SOURCES/grsecurity-2.1.9-2.6.18.patch	Mon Oct  9 08:37:58 2006
@@ -38,16 +38,16 @@
 diff -urNp linux-2.6.18/arch/alpha/kernel/ptrace.c linux-2.6.18/arch/alpha/kernel/ptrace.c
 --- linux-2.6.18/arch/alpha/kernel/ptrace.c	2006-09-19 23:42:06.000000000 -0400
 +++ linux-2.6.18/arch/alpha/kernel/ptrace.c	2006-09-22 20:04:35.000000000 -0400
-@@ -16,6 +16,7 @@
+@@ -15,6 +15,7 @@
+ #include <linux/slab.h>
  #include <linux/security.h>
  #include <linux/signal.h>
- #include <linux/vs_pid.h>
 +#include <linux/grsecurity.h>
  
  #include <asm/uaccess.h>
  #include <asm/pgtable.h>
-@@ -289,6 +290,9 @@ do_sys_ptrace(long request, long pid, lo
- 		goto out;
+@@ -283,6 +284,9 @@ do_sys_ptrace(long request, long pid, lo
+ 		goto out_notsk;
  	}
  
 +	if (gr_handle_ptrace(child, request))
@@ -1891,8 +1891,8 @@
  }
  
  /*
-@@ -295,7 +295,7 @@ void show_regs(struct pt_regs * regs)
- 		0xffff & regs->xcs,regs->eip, smp_processor_id());
+@@ -293,7 +293,7 @@ void show_regs(struct pt_regs * regs)
+ 	printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip, smp_processor_id());
  	print_symbol("EIP is at %s\n", regs->eip);
  
 -	if (user_mode_vm(regs))
@@ -1900,7 +1900,7 @@
  		printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
  	printk(" EFLAGS: %08lx    %s  (%s %.*s)\n",
  	       regs->eflags, print_tainted(), system_utsname.release,
-@@ -344,8 +344,8 @@ int kernel_thread(int (*fn)(void *), voi
+@@ -342,8 +342,8 @@ int kernel_thread(int (*fn)(void *), voi
  	regs.ebx = (unsigned long) fn;
  	regs.edx = (unsigned long) arg;
  
@@ -1911,7 +1911,7 @@
  	regs.orig_eax = -1;
  	regs.eip = (unsigned long) kernel_thread_helper;
  	regs.xcs = __KERNEL_CS;
-@@ -367,7 +367,7 @@ void exit_thread(void)
+@@ -364,7 +364,7 @@ void exit_thread(void)
  		struct task_struct *tsk = current;
  		struct thread_struct *t = &tsk->thread;
  		int cpu = get_cpu();
@@ -1920,7 +1920,7 @@
  
  		kfree(t->io_bitmap_ptr);
  		t->io_bitmap_ptr = NULL;
-@@ -388,6 +388,9 @@ void flush_thread(void)
+@@ -385,6 +385,9 @@ void flush_thread(void)
  {
  	struct task_struct *tsk = current;
  
@@ -1930,7 +1930,7 @@
  	memset(tsk->thread.debugreg, 0, sizeof(unsigned long)*8);
  	memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));	
  	clear_tsk_thread_flag(tsk, TIF_DEBUG);
-@@ -421,7 +424,7 @@ int copy_thread(int nr, unsigned long cl
+@@ -418,7 +421,7 @@ int copy_thread(int nr, unsigned long cl
  	struct task_struct *tsk;
  	int err;
  
@@ -1939,7 +1939,7 @@
  	*childregs = *regs;
  	childregs->eax = 0;
  	childregs->esp = esp;
-@@ -465,6 +468,11 @@ int copy_thread(int nr, unsigned long cl
+@@ -462,6 +465,11 @@ int copy_thread(int nr, unsigned long cl
  		if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX)
  			goto out;
  
@@ -1951,7 +1951,7 @@
  		desc = p->thread.tls_array + idx - GDT_ENTRY_TLS_MIN;
  		desc->a = LDT_entry_a(&info);
  		desc->b = LDT_entry_b(&info);
-@@ -644,7 +652,11 @@ struct task_struct fastcall * __switch_t
+@@ -641,7 +649,11 @@ struct task_struct fastcall * __switch_t
  	struct thread_struct *prev = &prev_p->thread,
  				 *next = &next_p->thread;
  	int cpu = smp_processor_id();
@@ -3704,59 +3704,172 @@
  
 diff -urNp linux-2.6.18/arch/i386/lib/usercopy.c linux-2.6.18/arch/i386/lib/usercopy.c
 --- linux-2.6.18/arch/i386/lib/usercopy.c	2006-09-19 23:42:06.000000000 -0400
-+++ linux-2.6.18/arch/i386/lib/usercopy.c	2006-09-22 20:45:03.000000000 -0400
-@@ -32,6 +32,7 @@ do {									   \
- 	int __d0, __d1, __d2;						   \
- 	might_sleep();							   \
- 	__asm__ __volatile__(						   \
-+		"	movw %w10,%%ds\n"				   \
- 		"	testl %1,%1\n"					   \
- 		"	jz 2f\n"					   \
- 		"0:	lodsb\n"					   \
-@@ -42,6 +43,8 @@ do {									   \
- 		"	jnz 0b\n"					   \
- 		"1:	subl %1,%0\n"					   \
- 		"2:\n"							   \
-+		"	pushl %%ss\n"					   \
-+		"	popl %%ds\n"					   \
- 		".section .fixup,\"ax\"\n"				   \
- 		"3:	movl %5,%0\n"					   \
- 		"	jmp 2b\n"					   \
-@@ -52,7 +55,8 @@ do {									   \
- 		".previous"						   \
- 		: "=d"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1),	   \
- 		  "=&D" (__d2)						   \
++++ linux-2.6.18/arch/i386/lib/usercopy.c	2006-09-23 00:27:55.000000000 -0400
+@@ -27,34 +27,41 @@ static inline int __movsl_is_ok(unsigned
+  * Copy a null terminated string from userspace.
+  */
+ 
+-#define __do_strncpy_from_user(dst,src,count,res)			   \
+-do {									   \
+-	int __d0, __d1, __d2;						   \
+-	might_sleep();							   \
+-	__asm__ __volatile__(						   \
+-		"	testl %1,%1\n"					   \
+-		"	jz 2f\n"					   \
+-		"0:	lodsb\n"					   \
+-		"	stosb\n"					   \
+-		"	testb %%al,%%al\n"				   \
+-		"	jz 1f\n"					   \
+-		"	decl %1\n"					   \
+-		"	jnz 0b\n"					   \
+-		"1:	subl %1,%0\n"					   \
+-		"2:\n"							   \
+-		".section .fixup,\"ax\"\n"				   \
+-		"3:	movl %5,%0\n"					   \
+-		"	jmp 2b\n"					   \
+-		".previous\n"						   \
+-		".section __ex_table,\"a\"\n"				   \
+-		"	.align 4\n"					   \
+-		"	.long 0b,3b\n"					   \
+-		".previous"						   \
+-		: "=d"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1),	   \
+-		  "=&D" (__d2)						   \
 -		: "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \
-+		: "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst),\
-+		  "r"(__USER_DS)					   \
- 		: "memory");						   \
- } while (0)
+-		: "memory");						   \
+-} while (0)
++static long __do_strncpy_from_user(char *dst, const char __user *src, long count)
++{
++	int __d0, __d1, __d2;
++	long res = -EFAULT;
++
++	might_sleep();
++	__asm__ __volatile__(
++		"	movw %w10,%%ds\n"
++		"	testl %1,%1\n"
++		"	jz 2f\n"
++		"0:	lodsb\n"
++		"	stosb\n"
++		"	testb %%al,%%al\n"
++		"	jz 1f\n"
++		"	decl %1\n"
++		"	jnz 0b\n"
++		"1:	subl %1,%0\n"
++		"2:\n"
++		"	pushl %%ss\n"
++		"	popl %%ds\n"
++		".section .fixup,\"ax\"\n"
++		"3:	movl %5,%0\n"
++		"	jmp 2b\n"
++		".previous\n"
++		".section __ex_table,\"a\"\n"
++		"	.align 4\n"
++		"	.long 0b,3b\n"
++		".previous"
++		: "=d"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1),
++		  "=&D" (__d2)
++		: "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst),
++		  "r"(__USER_DS)
++		: "memory");
++	return res;
++}
  
-@@ -122,10 +126,13 @@ do {									\
- 	int __d0;							\
- 	might_sleep();							\
-   	__asm__ __volatile__(						\
-+		"	movw %w6,%%es\n"				\
- 		"0:	rep; stosl\n"					\
- 		"	movl %2,%0\n"					\
- 		"1:	rep; stosb\n"					\
- 		"2:\n"							\
-+		"	pushl %%ss\n"					\
-+		"	popl %%es\n"					\
- 		".section .fixup,\"ax\"\n"				\
- 		"3:	lea 0(%2,%0,4),%0\n"				\
- 		"	jmp 2b\n"					\
-@@ -136,7 +143,8 @@ do {									\
- 		"	.long 1b,2b\n"					\
- 		".previous"						\
- 		: "=&c"(size), "=&D" (__d0)				\
+ /**
+  * __strncpy_from_user: - Copy a NUL terminated string from userspace, with less checking.
+@@ -79,9 +86,7 @@ do {									   \
+ long
+ __strncpy_from_user(char *dst, const char __user *src, long count)
+ {
+-	long res;
+-	__do_strncpy_from_user(dst, src, count, res);
+-	return res;
++	return __do_strncpy_from_user(dst, src, count);
+ }
+ EXPORT_SYMBOL(__strncpy_from_user);
+ 
+@@ -108,7 +113,7 @@ strncpy_from_user(char *dst, const char 
+ {
+ 	long res = -EFAULT;
+ 	if (access_ok(VERIFY_READ, src, 1))
+-		__do_strncpy_from_user(dst, src, count, res);
++		res = __do_strncpy_from_user(dst, src, count);
+ 	return res;
+ }
+ EXPORT_SYMBOL(strncpy_from_user);
+@@ -117,27 +122,33 @@ EXPORT_SYMBOL(strncpy_from_user);
+  * Zero Userspace
+  */
+ 
+-#define __do_clear_user(addr,size)					\
+-do {									\
+-	int __d0;							\
+-	might_sleep();							\
+-  	__asm__ __volatile__(						\
+-		"0:	rep; stosl\n"					\
+-		"	movl %2,%0\n"					\
+-		"1:	rep; stosb\n"					\
+-		"2:\n"							\
+-		".section .fixup,\"ax\"\n"				\
+-		"3:	lea 0(%2,%0,4),%0\n"				\
+-		"	jmp 2b\n"					\
+-		".previous\n"						\
+-		".section __ex_table,\"a\"\n"				\
+-		"	.align 4\n"					\
+-		"	.long 0b,3b\n"					\
+-		"	.long 1b,2b\n"					\
+-		".previous"						\
+-		: "=&c"(size), "=&D" (__d0)				\
 -		: "r"(size & 3), "0"(size / 4), "1"(addr), "a"(0));	\
-+		: "r"(size & 3), "0"(size / 4), "1"(addr), "a"(0),	\
-+		  "r"(__USER_DS));					\
- } while (0)
+-} while (0)
++static unsigned long __do_clear_user(void __user *addr, unsigned long size)
++{
++	int __d0;
++
++	might_sleep();
++	__asm__ __volatile__(
++		"	movw %w6,%%es\n"
++		"0:	rep; stosl\n"
++		"	movl %2,%0\n"
++		"1:	rep; stosb\n"
++		"2:\n"
++		"	pushl %%ss\n"
++		"	popl %%es\n"
++		".section .fixup,\"ax\"\n"
++		"3:	lea 0(%2,%0,4),%0\n"
++		"	jmp 2b\n"
++		".previous\n"
++		".section __ex_table,\"a\"\n"
++		"	.align 4\n"
++		"	.long 0b,3b\n"
++		"	.long 1b,2b\n"
++		".previous"
++		: "=&c"(size), "=&D" (__d0)
++		: "r"(size & 3), "0"(size / 4), "1"(addr), "a"(0),
++		  "r"(__USER_DS));
++	return size;
++}
  
  /**
-@@ -197,14 +205,17 @@ long strnlen_user(const char __user *s, 
+  * clear_user: - Zero a block of memory in user space.
+@@ -154,7 +165,7 @@ clear_user(void __user *to, unsigned lon
+ {
+ 	might_sleep();
+ 	if (access_ok(VERIFY_WRITE, to, n))
+-		__do_clear_user(to, n);
++		n = __do_clear_user(to, n);
+ 	return n;
+ }
+ EXPORT_SYMBOL(clear_user);
+@@ -173,8 +184,7 @@ EXPORT_SYMBOL(clear_user);
+ unsigned long
+ __clear_user(void __user *to, unsigned long n)
+ {
+-	__do_clear_user(to, n);
+-	return n;
++	return __do_clear_user(to, n);
+ }
+ EXPORT_SYMBOL(__clear_user);
+ 
+@@ -197,14 +207,17 @@ long strnlen_user(const char __user *s, 
  	might_sleep();
  
  	__asm__ __volatile__(
@@ -3775,7 +3888,7 @@
  		".section .fixup,\"ax\"\n"
  		"2:	xorl %%eax,%%eax\n"
  		"	jmp 1b\n"
-@@ -216,7 +227,7 @@ long strnlen_user(const char __user *s, 
+@@ -216,7 +229,7 @@ long strnlen_user(const char __user *s, 
  		"	.long 0b,2b\n"
  		".previous"
  		:"=r" (n), "=D" (s), "=a" (res), "=c" (tmp)
@@ -3784,7 +3897,12 @@
  		:"cc");
  	return res & mask;
  }
-@@ -228,6 +239,7 @@ __copy_user_intel(void __user *to, const
+@@ -224,10 +237,11 @@ EXPORT_SYMBOL(strnlen_user);
+ 
+ #ifdef CONFIG_X86_INTEL_USERCOPY
+ static unsigned long
+-__copy_user_intel(void __user *to, const void *from, unsigned long size)
++__generic_copy_to_user_intel(void __user *to, const void *from, unsigned long size)
  {
  	int d0, d1;
  	__asm__ __volatile__(
@@ -3792,7 +3910,7 @@
  		       "       .align 2,0x90\n"
  		       "1:     movl 32(%4), %%eax\n"
  		       "       cmpl $67, %0\n"
-@@ -236,36 +248,36 @@ __copy_user_intel(void __user *to, const
+@@ -236,36 +250,36 @@ __copy_user_intel(void __user *to, const
  		       "       .align 2,0x90\n"
  		       "3:     movl 0(%4), %%eax\n"
  		       "4:     movl 4(%4), %%edx\n"
@@ -3845,7 +3963,7 @@
  		       "       addl $-64, %0\n"
  		       "       addl $64, %4\n"
  		       "       addl $64, %3\n"
-@@ -279,6 +291,8 @@ __copy_user_intel(void __user *to, const
+@@ -279,6 +293,8 @@ __copy_user_intel(void __user *to, const
  		       "36:    movl %%eax, %0\n"
  		       "37:    rep; movsb\n"
  		       "100:\n"
@@ -3854,16 +3972,126 @@
  		       ".section .fixup,\"ax\"\n"
  		       "101:   lea 0(%%eax,%0,4),%0\n"
  		       "       jmp 100b\n"
-@@ -325,7 +339,7 @@ __copy_user_intel(void __user *to, const
+@@ -325,7 +341,117 @@ __copy_user_intel(void __user *to, const
  		       "       .long 99b,101b\n"
  		       ".previous"
  		       : "=&c"(size), "=&D" (d0), "=&S" (d1)
 -		       :  "1"(to), "2"(from), "0"(size)
 +		       :  "1"(to), "2"(from), "0"(size), "r"(__USER_DS)
++		       : "eax", "edx", "memory");
++	return size;
++}
++
++static unsigned long
++__generic_copy_from_user_intel(void *to, const void __user *from, unsigned long size)
++{
++	int d0, d1;
++	__asm__ __volatile__(
++		       "       movw %w6, %%ds\n"
++		       "       .align 2,0x90\n"
++		       "1:     movl 32(%4), %%eax\n"
++		       "       cmpl $67, %0\n"
++		       "       jbe 3f\n"
++		       "2:     movl 64(%4), %%eax\n"
++		       "       .align 2,0x90\n"
++		       "3:     movl 0(%4), %%eax\n"
++		       "4:     movl 4(%4), %%edx\n"
++		       "5:     movl %%eax, %%es:0(%3)\n"
++		       "6:     movl %%edx, %%es:4(%3)\n"
++		       "7:     movl 8(%4), %%eax\n"
++		       "8:     movl 12(%4),%%edx\n"
++		       "9:     movl %%eax, %%es:8(%3)\n"
++		       "10:    movl %%edx, %%es:12(%3)\n"
++		       "11:    movl 16(%4), %%eax\n"
++		       "12:    movl 20(%4), %%edx\n"
++		       "13:    movl %%eax, %%es:16(%3)\n"
++		       "14:    movl %%edx, %%es:20(%3)\n"
++		       "15:    movl 24(%4), %%eax\n"
++		       "16:    movl 28(%4), %%edx\n"
++		       "17:    movl %%eax, %%es:24(%3)\n"
++		       "18:    movl %%edx, %%es:28(%3)\n"
++		       "19:    movl 32(%4), %%eax\n"
++		       "20:    movl 36(%4), %%edx\n"
++		       "21:    movl %%eax, %%es:32(%3)\n"
++		       "22:    movl %%edx, %%es:36(%3)\n"
++		       "23:    movl 40(%4), %%eax\n"
++		       "24:    movl 44(%4), %%edx\n"
++		       "25:    movl %%eax, %%es:40(%3)\n"
++		       "26:    movl %%edx, %%es:44(%3)\n"
++		       "27:    movl 48(%4), %%eax\n"
++		       "28:    movl 52(%4), %%edx\n"
++		       "29:    movl %%eax, %%es:48(%3)\n"
++		       "30:    movl %%edx, %%es:52(%3)\n"
++		       "31:    movl 56(%4), %%eax\n"
++		       "32:    movl 60(%4), %%edx\n"
++		       "33:    movl %%eax, %%es:56(%3)\n"
++		       "34:    movl %%edx, %%es:60(%3)\n"
++		       "       addl $-64, %0\n"
++		       "       addl $64, %4\n"
++		       "       addl $64, %3\n"
++		       "       cmpl $63, %0\n"
++		       "       ja  1b\n"
++		       "35:    movl  %0, %%eax\n"
++		       "       shrl  $2, %0\n"
++		       "       andl  $3, %%eax\n"
++		       "       cld\n"
++		       "99:    rep; movsl\n"
++		       "36:    movl %%eax, %0\n"
++		       "37:    rep; movsb\n"
++		       "100:\n"
++		       "       pushl %%ss\n"
++		       "       popl %%ds\n"
++		       ".section .fixup,\"ax\"\n"
++		       "101:   lea 0(%%eax,%0,4),%0\n"
++		       "       jmp 100b\n"
++		       ".previous\n"
++		       ".section __ex_table,\"a\"\n"
++		       "       .align 4\n"
++		       "       .long 1b,100b\n"
++		       "       .long 2b,100b\n"
++		       "       .long 3b,100b\n"
++		       "       .long 4b,100b\n"
++		       "       .long 5b,100b\n"
++		       "       .long 6b,100b\n"
++		       "       .long 7b,100b\n"
++		       "       .long 8b,100b\n"
++		       "       .long 9b,100b\n"
++		       "       .long 10b,100b\n"
++		       "       .long 11b,100b\n"
++		       "       .long 12b,100b\n"
++		       "       .long 13b,100b\n"
++		       "       .long 14b,100b\n"
++		       "       .long 15b,100b\n"
++		       "       .long 16b,100b\n"
++		       "       .long 17b,100b\n"
++		       "       .long 18b,100b\n"
++		       "       .long 19b,100b\n"
++		       "       .long 20b,100b\n"
++		       "       .long 21b,100b\n"
++		       "       .long 22b,100b\n"
++		       "       .long 23b,100b\n"
++		       "       .long 24b,100b\n"
++		       "       .long 25b,100b\n"
++		       "       .long 26b,100b\n"
++		       "       .long 27b,100b\n"
++		       "       .long 28b,100b\n"
++		       "       .long 29b,100b\n"
++		       "       .long 30b,100b\n"
++		       "       .long 31b,100b\n"
++		       "       .long 32b,100b\n"
++		       "       .long 33b,100b\n"
++		       "       .long 34b,100b\n"
++		       "       .long 35b,100b\n"
++		       "       .long 36b,100b\n"
++		       "       .long 37b,100b\n"
++		       "       .long 99b,101b\n"
++		       ".previous"
++		       : "=&c"(size), "=&D" (d0), "=&S" (d1)
++		       :  "1"(to), "2"(from), "0"(size), "r"(__USER_DS)
  		       : "eax", "edx", "memory");
  	return size;
  }
-@@ -335,6 +349,7 @@ __copy_user_zeroing_intel(void *to, cons
+@@ -335,6 +461,7 @@ __copy_user_zeroing_intel(void *to, cons
  {
  	int d0, d1;
  	__asm__ __volatile__(
@@ -3871,7 +4099,7 @@
  		       "        .align 2,0x90\n"
  		       "0:      movl 32(%4), %%eax\n"
  		       "        cmpl $67, %0\n"      
-@@ -343,36 +358,36 @@ __copy_user_zeroing_intel(void *to, cons
+@@ -343,36 +470,36 @@ __copy_user_zeroing_intel(void *to, cons
  		       "        .align 2,0x90\n"     
  		       "2:      movl 0(%4), %%eax\n" 
  		       "21:     movl 4(%4), %%edx\n" 
@@ -3924,7 +4152,7 @@
  		       "        addl $-64, %0\n"     
  		       "        addl $64, %4\n"      
  		       "        addl $64, %3\n"      
-@@ -386,6 +401,8 @@ __copy_user_zeroing_intel(void *to, cons
+@@ -386,6 +513,8 @@ __copy_user_zeroing_intel(void *to, cons
  		       "        movl %%eax,%0\n"
  		       "7:      rep; movsb\n"	
  		       "8:\n"			
@@ -3933,7 +4161,7 @@
  		       ".section .fixup,\"ax\"\n"
  		       "9:      lea 0(%%eax,%0,4),%0\n"	
  		       "16:     pushl %0\n"	
-@@ -420,7 +437,7 @@ __copy_user_zeroing_intel(void *to, cons
+@@ -420,7 +549,7 @@ __copy_user_zeroing_intel(void *to, cons
  		       "        .long 7b,16b\n" 
  		       ".previous"		
  		       : "=&c"(size), "=&D" (d0), "=&S" (d1)
@@ -3942,7 +4170,7 @@
  		       : "eax", "edx", "memory");
  	return size;
  }
-@@ -436,6 +453,7 @@ static unsigned long __copy_user_zeroing
+@@ -436,6 +565,7 @@ static unsigned long __copy_user_zeroing
          int d0, d1;
  
  	__asm__ __volatile__(
@@ -3950,7 +4178,7 @@
  	       "        .align 2,0x90\n"
  	       "0:      movl 32(%4), %%eax\n"
  	       "        cmpl $67, %0\n"
-@@ -444,36 +462,36 @@ static unsigned long __copy_user_zeroing
+@@ -444,36 +574,36 @@ static unsigned long __copy_user_zeroing
  	       "        .align 2,0x90\n"
  	       "2:      movl 0(%4), %%eax\n"
  	       "21:     movl 4(%4), %%edx\n"
@@ -4003,7 +4231,7 @@
  	       "        addl $-64, %0\n"
  	       "        addl $64, %4\n"
  	       "        addl $64, %3\n"
-@@ -488,6 +506,8 @@ static unsigned long __copy_user_zeroing
+@@ -488,6 +618,8 @@ static unsigned long __copy_user_zeroing
  	       "        movl %%eax,%0\n"
  	       "7:      rep; movsb\n"
  	       "8:\n"
@@ -4012,7 +4240,7 @@
  	       ".section .fixup,\"ax\"\n"
  	       "9:      lea 0(%%eax,%0,4),%0\n"
  	       "16:     pushl %0\n"
-@@ -522,7 +542,7 @@ static unsigned long __copy_user_zeroing
+@@ -522,7 +654,7 @@ static unsigned long __copy_user_zeroing
  	       "        .long 7b,16b\n"
  	       ".previous"
  	       : "=&c"(size), "=&D" (d0), "=&S" (d1)
@@ -4021,7 +4249,7 @@
  	       : "eax", "edx", "memory");
  	return size;
  }
-@@ -533,6 +553,7 @@ static unsigned long __copy_user_intel_n
+@@ -533,6 +665,7 @@ static unsigned long __copy_user_intel_n
          int d0, d1;
  
  	__asm__ __volatile__(
@@ -4029,7 +4257,7 @@
  	       "        .align 2,0x90\n"
  	       "0:      movl 32(%4), %%eax\n"
  	       "        cmpl $67, %0\n"
-@@ -541,36 +562,36 @@ static unsigned long __copy_user_intel_n
+@@ -541,36 +674,36 @@ static unsigned long __copy_user_intel_n
  	       "        .align 2,0x90\n"
  	       "2:      movl 0(%4), %%eax\n"
  	       "21:     movl 4(%4), %%edx\n"
@@ -4082,7 +4310,7 @@
  	       "        addl $-64, %0\n"
  	       "        addl $64, %4\n"
  	       "        addl $64, %3\n"
-@@ -585,6 +606,8 @@ static unsigned long __copy_user_intel_n
+@@ -585,6 +718,8 @@ static unsigned long __copy_user_intel_n
  	       "        movl %%eax,%0\n"
  	       "7:      rep; movsb\n"
  	       "8:\n"
@@ -4091,7 +4319,7 @@
  	       ".section .fixup,\"ax\"\n"
  	       "9:      lea 0(%%eax,%0,4),%0\n"
  	       "16:     jmp 8b\n"
-@@ -613,7 +636,7 @@ static unsigned long __copy_user_intel_n
+@@ -613,7 +748,7 @@ static unsigned long __copy_user_intel_n
  	       "        .long 7b,16b\n"
  	       ".previous"
  	       : "=&c"(size), "=&D" (d0), "=&S" (d1)
@@ -4100,59 +4328,296 @@
  	       : "eax", "edx", "memory");
  	return size;
  }
-@@ -637,6 +660,7 @@ unsigned long __copy_user_zeroing_intel_
- do {									\
- 	int __d0, __d1, __d2;						\
- 	__asm__ __volatile__(						\
-+		"	movw %w8,%%es\n"				\
- 		"	cmp  $7,%0\n"					\
- 		"	jbe  1f\n"					\
- 		"	movl %1,%0\n"					\
-@@ -652,6 +676,8 @@ do {									\
- 		"	movl %3,%0\n"					\
- 		"1:	rep; movsb\n"					\
- 		"2:\n"							\
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/grsecurity-2.1.9-2.6.18.patch?r1=1.1.2.2&r2=1.1.2.3&f=u



More information about the pld-cvs-commit mailing list