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 'fixes' of git://git.linaro.org/people/rmk/linux-arm

Pull arm fixes fixes from Russell King:
"This fixes a couple of problems with commit 48be69a026b2 ("ARM: move
signal handlers into a vdso-like page"), one of which was originally
discovered via my testing originally, but the fix for it was never
actually committed.

The other shows up on noMMU builds, and such platforms are extremely
rare and as such are not part of my nightly testing"

* 'fixes' of git://git.linaro.org/people/rmk/linux-arm:
ARM: fix nommu builds with 48be69a02 (ARM: move signal handlers into a vdso-like page)
ARM: fix a cockup in 48be69a02 (ARM: move signal handlers into a vdso-like page)

+31 -28
+2
arch/arm/include/asm/elf.h
··· 130 130 extern unsigned long arch_randomize_brk(struct mm_struct *mm); 131 131 #define arch_randomize_brk arch_randomize_brk 132 132 133 + #ifdef CONFIG_MMU 133 134 #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1 134 135 struct linux_binprm; 135 136 int arch_setup_additional_pages(struct linux_binprm *, int); 137 + #endif 136 138 137 139 #endif
+5 -4
arch/arm/kernel/process.c
··· 474 474 "[sigpage]" : NULL; 475 475 } 476 476 477 + static struct page *signal_page; 477 478 extern struct page *get_signal_page(void); 478 479 479 480 int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) 480 481 { 481 482 struct mm_struct *mm = current->mm; 482 - struct page *page; 483 483 unsigned long addr; 484 484 int ret; 485 485 486 - page = get_signal_page(); 487 - if (!page) 486 + if (!signal_page) 487 + signal_page = get_signal_page(); 488 + if (!signal_page) 488 489 return -ENOMEM; 489 490 490 491 down_write(&mm->mmap_sem); ··· 497 496 498 497 ret = install_special_mapping(mm, addr, PAGE_SIZE, 499 498 VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC, 500 - &page); 499 + &signal_page); 501 500 502 501 if (ret == 0) 503 502 mm->context.sigpage = addr;
+24 -24
arch/arm/kernel/signal.c
··· 402 402 __put_user(sigreturn_codes[idx+1], rc+1)) 403 403 return 1; 404 404 405 - if ((cpsr & MODE32_BIT) && !IS_ENABLED(CONFIG_ARM_MPU)) { 405 + #ifdef CONFIG_MMU 406 + if (cpsr & MODE32_BIT) { 406 407 struct mm_struct *mm = current->mm; 407 408 408 409 /* ··· 413 412 */ 414 413 retcode = mm->context.sigpage + signal_return_offset + 415 414 (idx << 2) + thumb; 416 - } else { 415 + } else 416 + #endif 417 + { 417 418 /* 418 419 * Ensure that the instruction cache sees 419 420 * the return code written onto the stack. ··· 617 614 return 0; 618 615 } 619 616 620 - static struct page *signal_page; 621 - 622 617 struct page *get_signal_page(void) 623 618 { 624 - if (!signal_page) { 625 - unsigned long ptr; 626 - unsigned offset; 627 - void *addr; 619 + unsigned long ptr; 620 + unsigned offset; 621 + struct page *page; 622 + void *addr; 628 623 629 - signal_page = alloc_pages(GFP_KERNEL, 0); 624 + page = alloc_pages(GFP_KERNEL, 0); 630 625 631 - if (!signal_page) 632 - return NULL; 626 + if (!page) 627 + return NULL; 633 628 634 - addr = page_address(signal_page); 629 + addr = page_address(page); 635 630 636 - /* Give the signal return code some randomness */ 637 - offset = 0x200 + (get_random_int() & 0x7fc); 638 - signal_return_offset = offset; 631 + /* Give the signal return code some randomness */ 632 + offset = 0x200 + (get_random_int() & 0x7fc); 633 + signal_return_offset = offset; 639 634 640 - /* 641 - * Copy signal return handlers into the vector page, and 642 - * set sigreturn to be a pointer to these. 643 - */ 644 - memcpy(addr + offset, sigreturn_codes, sizeof(sigreturn_codes)); 635 + /* 636 + * Copy signal return handlers into the vector page, and 637 + * set sigreturn to be a pointer to these. 638 + */ 639 + memcpy(addr + offset, sigreturn_codes, sizeof(sigreturn_codes)); 645 640 646 - ptr = (unsigned long)addr + offset; 647 - flush_icache_range(ptr, ptr + sizeof(sigreturn_codes)); 648 - } 641 + ptr = (unsigned long)addr + offset; 642 + flush_icache_range(ptr, ptr + sizeof(sigreturn_codes)); 649 643 650 - return signal_page; 644 + return page; 651 645 }