rpms/kernel/devel linux-2.6-execshield.patch,1.56,1.57

Dave Jones (davej) fedora-extras-commits at redhat.com
Tue Jun 12 03:10:46 UTC 2007


Author: davej

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20110

Modified Files:
	linux-2.6-execshield.patch 
Log Message:
codingstyle nits found with checkpatch

linux-2.6-execshield.patch:

Index: linux-2.6-execshield.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-execshield.patch,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- linux-2.6-execshield.patch	6 Jun 2007 21:55:41 -0000	1.56
+++ linux-2.6-execshield.patch	12 Jun 2007 03:10:40 -0000	1.57
@@ -147,14 +147,14 @@
  
 +int exec_shield = (1<<0);
 +/* exec_shield is a bitmask:
-+          0: off; vdso at STACK_TOP, 1 page below TASK_SIZE
-+   (1<<0) 1: on [also on if !=0]
-+   (1<<1) 2: force noexecstack regardless of PT_GNU_STACK
-+   The old settings
-+   (1<<2) 4: vdso just below .text of main (unless too low)
-+   (1<<3) 8: vdso just below .text of PT_INTERP (unless too low)
-+   are ignored because the vdso is placed completely randomly
-+*/
++ * 0: off; vdso at STACK_TOP, 1 page below TASK_SIZE
++ * (1<<0) 1: on [also on if !=0]
++ * (1<<1) 2: force noexecstack regardless of PT_GNU_STACK
++ * The old settings
++ * (1<<2) 4: vdso just below .text of main (unless too low)
++ * (1<<3) 8: vdso just below .text of PT_INTERP (unless too low)
++ * are ignored because the vdso is placed completely randomly
++ */
 +
 +static int __init setup_exec_shield(char *str)
 +{
@@ -230,12 +230,13 @@
  		return prev;
  	}
  
-@@ -933,7 +940,7 @@ unsigned long do_mmap_pgoff(struct file 
+@@ -933,7 +940,8 @@ unsigned long do_mmap_pgoff(struct file 
  	/* Obtain the address to map to. we verify (or select) it and ensure
  	 * that it represents a valid section of the address space.
  	 */
 -	addr = get_unmapped_area(file, addr, len, pgoff, flags);
-+	addr = get_unmapped_area_prot(file, addr, len, pgoff, flags, prot & PROT_EXEC);
++	addr = get_unmapped_area_prot(file, addr, len, pgoff, flags,
++		prot & PROT_EXEC);
  	if (addr & ~PAGE_MASK)
  		return addr;
  
@@ -260,7 +261,7 @@
  	if (file && file->f_op && file->f_op->get_unmapped_area)
  		get_area = file->f_op->get_unmapped_area;
  	addr = get_area(file, addr, len, pgoff, flags);
-@@ -1393,7 +1405,71 @@ get_unmapped_area(struct file *file, uns
+@@ -1393,7 +1405,73 @@ get_unmapped_area(struct file *file, uns
  	return addr;
  }
  
@@ -311,7 +312,9 @@
 +			 * as much as possible:
 +			 */
 +			if (addr >= 0x01000000) {
-+				tmp = randomize_range(0x01000000, PAGE_ALIGN(max(mm->start_brk, (unsigned long)0x08000000)), len);
++				tmp = randomize_range(0x01000000,
++					PAGE_ALIGN(max(mm->start_brk, (unsigned long)0x08000000)),
++					len);
 +				vma = find_vma(mm, tmp);
 +				if (TASK_SIZE - len >= tmp &&
 +				    (!vma || tmp + len <= vma->vm_start))
@@ -386,7 +389,7 @@
 ===================================================================
 --- linux-2.6.orig/arch/i386/kernel/traps.c
 +++ linux-2.6/arch/i386/kernel/traps.c
-@@ -638,7 +638,82 @@ DO_ERROR(10, SIGSEGV, "invalid TSS", inv
+@@ -638,7 +638,84 @@ DO_ERROR(10, SIGSEGV, "invalid TSS", inv
  DO_ERROR(11, SIGBUS,  "segment not present", segment_not_present)
  DO_ERROR(12, SIGBUS,  "stack segment", stack_segment)
  DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
@@ -433,8 +436,10 @@
 +		 * we won't hit this branch next time around.
 +		 */
 +		if (print_fatal_signals >= 2) {
-+			printk("#GPF fixup (%ld[seg:%lx]) at %08lx, CPU#%d.\n", error_code, error_code/8, regs->eip, smp_processor_id());
-+			printk(" exec_limit: %08lx, user_cs: %08lx/%08lx, CPU_cs: %08lx/%08lx.\n", current->mm->context.exec_limit, desc1->a, desc1->b, desc2->a, desc2->b);
++			printk(KERN_ERR "#GPF fixup (%ld[seg:%lx]) at %08lx, CPU#%d.\n",
++				error_code, error_code/8, regs->eip, smp_processor_id());
++			printk(KERN_ERR "exec_limit: %08lx, user_cs: %08lx/%08lx, CPU_cs: %08lx/%08lx.\n",
++				current->mm->context.exec_limit, desc1->a, desc1->b, desc2->a, desc2->b);
 +		}
 +		load_user_cs_desc(cpu, current->mm);
 +		return 1;
@@ -498,9 +503,9 @@
 +		return;
 +
 +	if (print_fatal_signals) {
-+		printk("#GPF(%ld[seg:%lx]) at %08lx, CPU#%d.\n", error_code,
++		printk(KERN_ERR "#GPF(%ld[seg:%lx]) at %08lx, CPU#%d.\n", error_code,
 +			error_code/8, regs->eip, smp_processor_id());
-+		printk(" exec_limit: %08lx, user_cs: %08lx/%08lx.\n",
++		printk(KERN_ERR "exec_limit: %08lx, user_cs: %08lx/%08lx.\n",
 +			current->mm->context.exec_limit,
 +			current->mm->context.user_cs.a,
 +			current->mm->context.user_cs.b);
@@ -544,14 +549,15 @@
  	} else
  		return -EINVAL;
  
-@@ -514,7 +515,10 @@ void __init paging_init(void)
+@@ -514,7 +515,11 @@ void __init paging_init(void)
  	set_nx();
  	if (nx_enabled)
  		printk("NX (Execute Disable) protection: active\n");
 +	else
  #endif
 +	if (exec_shield)
-+		printk("Using x86 segment limits to approximate NX protection\n");
++		printk(KERN_INFO "Using x86 segment limits to approximate "
++			"NX protection\n");
  
  	pagetable_init();
  
@@ -592,11 +598,12 @@
  #include <asm/uaccess.h>
  #include <asm/processor.h>
  #include <asm/tlbflush.h>
-@@ -130,6 +132,12 @@ __change_page_attr(struct page *page, pg
+@@ -130,6 +132,13 @@ __change_page_attr(struct page *page, pg
  	BUG_ON(PageHighMem(page));
  	address = (unsigned long)page_address(page);
  
-+	if (address >= (unsigned long)__start_rodata && address <= (unsigned long)__end_rodata &&
++	if (address >= (unsigned long)__start_rodata &&
++		address <= (unsigned long)__end_rodata &&
 +		(pgprot_val(prot) & _PAGE_RW)) {
 +		pgprot_val(prot) &= ~(_PAGE_RW);
 +		add_taint(TAINT_MACHINE_CHECK);
@@ -1188,7 +1195,7 @@
  
 -	if (!whole || num_threads<2)
 -		wchan = get_wchan(task);
-+	if (!whole || num_threads<2) {
++	if (!whole || num_threads < 2) {
 +		wchan = 0;
 +		if (current->uid == task->uid || current->euid == task->uid ||
 +			capable(CAP_SYS_NICE))
@@ -1344,8 +1351,8 @@
  #define ARCH_HAS_SETUP_ADDITIONAL_PAGES
  extern int arch_setup_additional_pages(struct linux_binprm *bprm,
 -                                       int executable_stack);
-+                                       int executable_stack, unsigned long start_code,
-+                                       unsigned long interp_map_address);
++					int executable_stack, unsigned long start_code,
++					unsigned long interp_map_address);
  
  extern unsigned int vdso_enabled;
  
@@ -1527,7 +1534,7 @@
 -extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
 +extern unsigned long get_unmapped_area_prot(struct file *, unsigned long, unsigned long, unsigned long, unsigned long, int);
 +
-+static inline unsigned long get_unmapped_area(struct file * file, unsigned long addr,
++static inline unsigned long get_unmapped_area(struct file *file, unsigned long addr,
 +		unsigned long len, unsigned long pgoff, unsigned long flags)
 +{
 +	return get_unmapped_area_prot(file, addr, len, pgoff, flags, 0);
@@ -1610,11 +1617,11 @@
 +
 +static void print_fatal_signal(struct pt_regs *regs, int signr)
 +{
-+	printk("%s/%d: potentially unexpected fatal signal %d.\n",
++	printk(KERN_INFO "%s/%d: potentially unexpected fatal signal %d.\n",
 +		current->comm, current->pid, signr);
 +
 +#ifdef __i386__
-+	printk("code at %08lx: ", regs->eip);
++	printk(KERN_INFO "code at %08lx: ", regs->eip);
 +	{
 +		int i;
 +		for (i = 0; i < 16; i++) {




More information about the fedora-extras-commits mailing list