Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'parisc-4.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull parisc fixes from Helge Deller:
"One important patch which fixes crashes due to stack randomization on
architectures where the stack grows upwards (currently parisc and
metag only).

This bug went unnoticed on parisc since kernel 3.14 where the flexible
mmap memory layout support was added by commit 9dabf60dc4ab. The
changes in fs/exec.c are inside an #ifdef CONFIG_STACK_GROWSUP section
and will not affect other platforms.

The other two patches rename args of the kthread_arg() function and
fixes a printk output"

* 'parisc-4.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
parisc,metag: Fix crashes due to stack randomization on stack-grows-upwards architectures
parisc: copy_thread(): rename 'arg' argument to 'kthread_arg'
parisc: %pf is only for function pointers

+17 -5
+4
arch/parisc/include/asm/elf.h
··· 348 348 349 349 #define ELF_HWCAP 0 350 350 351 + #define STACK_RND_MASK (is_32bit_task() ? \ 352 + 0x7ff >> (PAGE_SHIFT - 12) : \ 353 + 0x3ffff >> (PAGE_SHIFT - 12)) 354 + 351 355 struct mm_struct; 352 356 extern unsigned long arch_randomize_brk(struct mm_struct *); 353 357 #define arch_randomize_brk arch_randomize_brk
+6 -4
arch/parisc/kernel/process.c
··· 181 181 return 1; 182 182 } 183 183 184 + /* 185 + * Copy architecture-specific thread state 186 + */ 184 187 int 185 188 copy_thread(unsigned long clone_flags, unsigned long usp, 186 - unsigned long arg, struct task_struct *p) 189 + unsigned long kthread_arg, struct task_struct *p) 187 190 { 188 191 struct pt_regs *cregs = &(p->thread.regs); 189 192 void *stack = task_stack_page(p); ··· 198 195 extern void * const child_return; 199 196 200 197 if (unlikely(p->flags & PF_KTHREAD)) { 198 + /* kernel thread */ 201 199 memset(cregs, 0, sizeof(struct pt_regs)); 202 200 if (!usp) /* idle thread */ 203 201 return 0; 204 - 205 - /* kernel thread */ 206 202 /* Must exit via ret_from_kernel_thread in order 207 203 * to call schedule_tail() 208 204 */ ··· 217 215 #else 218 216 cregs->gr[26] = usp; 219 217 #endif 220 - cregs->gr[25] = arg; 218 + cregs->gr[25] = kthread_arg; 221 219 } else { 222 220 /* user thread */ 223 221 /* usp must be word aligned. This also prevents users from
+3
arch/parisc/kernel/sys_parisc.c
··· 77 77 if (stack_base > STACK_SIZE_MAX) 78 78 stack_base = STACK_SIZE_MAX; 79 79 80 + /* Add space for stack randomization. */ 81 + stack_base += (STACK_RND_MASK << PAGE_SHIFT); 82 + 80 83 return PAGE_ALIGN(STACK_TOP - stack_base); 81 84 } 82 85
+1 -1
drivers/parisc/superio.c
··· 348 348 BUG(); 349 349 return -1; 350 350 } 351 - printk("superio_fixup_irq(%s) ven 0x%x dev 0x%x from %pf\n", 351 + printk(KERN_DEBUG "superio_fixup_irq(%s) ven 0x%x dev 0x%x from %ps\n", 352 352 pci_name(pcidev), 353 353 pcidev->vendor, pcidev->device, 354 354 __builtin_return_address(0));
+3
fs/exec.c
··· 659 659 if (stack_base > STACK_SIZE_MAX) 660 660 stack_base = STACK_SIZE_MAX; 661 661 662 + /* Add space for stack randomization. */ 663 + stack_base += (STACK_RND_MASK << PAGE_SHIFT); 664 + 662 665 /* Make sure we didn't let the argument array grow too large. */ 663 666 if (vma->vm_end - vma->vm_start > stack_base) 664 667 return -ENOMEM;