OSDN Git Service

Merge branch 'for-linus-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 28 Jun 2015 20:55:08 +0000 (13:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 28 Jun 2015 20:55:08 +0000 (13:55 -0700)
Pull UML updates from Richard Weinberger:

 - remove hppfs ("HonePot ProcFS")

 - initial support for musl libc

 - uaccess cleanup

 - random cleanups and bug fixes all over the place

* 'for-linus-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml: (21 commits)
  um: Don't pollute kernel namespace with uapi
  um: Include sys/types.h for makedev(), major(), minor()
  um: Do not use stdin and stdout identifiers for struct members
  um: Do not use __ptr_t type for stack_t's .ss pointer
  um: Fix mconsole dependency
  um: Handle tracehook_report_syscall_entry() result
  um: Remove copy&paste code from init.h
  um: Stop abusing __KERNEL__
  um: Catch unprotected user memory access
  um: Fix warning in setup_signal_stack_si()
  um: Rework uaccess code
  um: Add uaccess.h to ldt.c
  um: Add uaccess.h to syscalls_64.c
  um: Add asm/elf.h to vma.c
  um: Cleanup mem_32/64.c headers
  um: Remove hppfs
  um: Move syscall() declaration into os.h
  um: kernel: ksyms: Export symbol syscall() for fixing modpost issue
  um/os-Linux: Use char[] for syscall_stub declarations
  um: Use char[] for linker script address declarations
  ...

1  2 
arch/um/include/asm/Kbuild
arch/um/kernel/trap.c

@@@ -21,7 -21,7 +21,6 @@@ generic-y += param.
  generic-y += pci.h
  generic-y += percpu.h
  generic-y += preempt.h
- generic-y += sections.h
 -generic-y += scatterlist.h
  generic-y += switch_to.h
  generic-y += topology.h
  generic-y += trace_clock.h
diff --combined arch/um/kernel/trap.c
@@@ -7,7 -7,6 +7,7 @@@
  #include <linux/sched.h>
  #include <linux/hardirq.h>
  #include <linux/module.h>
 +#include <linux/uaccess.h>
  #include <asm/current.h>
  #include <asm/pgtable.h>
  #include <asm/tlbflush.h>
@@@ -36,10 -35,10 +36,10 @@@ int handle_page_fault(unsigned long add
        *code_out = SEGV_MAPERR;
  
        /*
 -       * If the fault was during atomic operation, don't take the fault, just
 +       * If the fault was with pagefaults disabled, don't take the fault, just
         * fail.
         */
 -      if (in_atomic())
 +      if (faulthandler_disabled())
                goto out_nosemaphore;
  
        if (is_user)
@@@ -220,6 -219,11 +220,11 @@@ unsigned long segv(struct faultinfo fi
                show_regs(container_of(regs, struct pt_regs, regs));
                panic("Segfault with no mm");
        }
+       else if (!is_user && address < TASK_SIZE) {
+               show_regs(container_of(regs, struct pt_regs, regs));
+               panic("Kernel tried to access user memory at addr 0x%lx, ip 0x%lx",
+                      address, ip);
+       }
  
        if (SEGV_IS_FIXABLE(&fi))
                err = handle_page_fault(address, ip, is_write, is_user,