1. 14 1月, 2016 1 次提交
  2. 12 1月, 2016 1 次提交
  3. 11 1月, 2016 10 次提交
    • M
      um: Use race-free temporary file creation · 3e46b253
      Mickaël Salaün 提交于
      Open the memory mapped file with the O_TMPFILE flag when available.
      Signed-off-by: NMickaël Salaün <mic@digikod.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Acked-by: NTristan Schmelcher <tschmelcher@google.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      3e46b253
    • M
      um: Do not set unsecure permission for temporary file · 571d2f0c
      Mickaël Salaün 提交于
      Remove the insecure 0777 mode for temporary file to prohibit other users
      to change the executable mapped code.
      
      An attacker could gain access to the mapped file descriptor from the
      temporary file (before it is unlinked) in a read-only mode but it should
      not be accessible in write mode to avoid arbitrary code execution.
      
      To not change the hostfs behavior, the temporary file creation
      permission now depends on the current umask(2) and the implementation of
      mkstemp(3).
      Signed-off-by: NMickaël Salaün <mic@digikod.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Acked-by: NTristan Schmelcher <tschmelcher@google.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      571d2f0c
    • M
      um: Fix build error and kconfig for i386 · 42d91f61
      Mickaël Salaün 提交于
      Fix build error by generating elfcore.o only when ELF_CORE (depending on
      COREDUMP) is selected:
      
      arch/x86/um/built-in.o: In function `elf_core_write_extra_phdrs':
      (.text+0x3e62): undefined reference to `dump_emit'
      arch/x86/um/built-in.o: In function `elf_core_write_extra_data':
      (.text+0x3eef): undefined reference to `dump_emit'
      
      Fixes: 5d2acfc7 ("kconfig: make allnoconfig disable options behind EMBEDDED and EXPERT")
      Signed-off-by: NMickaël Salaün <mic@digikod.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Michal Marek <mmarek@suse.cz>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      42d91f61
    • M
      um: Add seccomp support · c50b4659
      Mickaël Salaün 提交于
      This brings SECCOMP_MODE_STRICT and SECCOMP_MODE_FILTER support through
      prctl(2) and seccomp(2) to User-mode Linux for i386 and x86_64
      subarchitectures.
      
      secure_computing() is called first in handle_syscall() so that the
      syscall emulation will be aborted quickly if matching a seccomp rule.
      
      This is inspired from Meredydd Luff's patch
      (https://gerrit.chromium.org/gerrit/21425).
      Signed-off-by: NMickaël Salaün <mic@digikod.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Will Drewry <wad@chromium.org>
      Cc: Chris Metcalf <cmetcalf@ezchip.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Meredydd Luff <meredydd@senatehouse.org>
      Cc: David Drysdale <drysdale@google.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Acked-by: NKees Cook <keescook@chromium.org>
      c50b4659
    • M
      um: Add full asm/syscall.h support · d8f8b844
      Mickaël Salaün 提交于
      Add subarchitecture-independent implementation of asm-generic/syscall.h
      allowing access to user system call parameters and results:
      * syscall_get_nr()
      * syscall_rollback()
      * syscall_get_error()
      * syscall_get_return_value()
      * syscall_set_return_value()
      * syscall_get_arguments()
      * syscall_set_arguments()
      * syscall_get_arch() provided by arch/x86/um/asm/syscall.h
      
      This provides the necessary syscall helpers needed by
      HAVE_ARCH_SECCOMP_FILTER plus syscall_get_error().
      
      This is inspired from Meredydd Luff's patch
      (https://gerrit.chromium.org/gerrit/21425).
      Signed-off-by: NMickaël Salaün <mic@digikod.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Will Drewry <wad@chromium.org>
      Cc: Meredydd Luff <meredydd@senatehouse.org>
      Cc: David Drysdale <drysdale@google.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Acked-by: NKees Cook <keescook@chromium.org>
      d8f8b844
    • M
      um: Fix ptrace GETREGS/SETREGS bugs · e04c989e
      Mickaël Salaün 提交于
      This fix two related bugs:
      * PTRACE_GETREGS doesn't get the right orig_ax (syscall) value
      * PTRACE_SETREGS can't set the orig_ax value (erased by initial value)
      
      Get rid of the now useless and error-prone get_syscall().
      
      Fix inconsistent behavior in the ptrace implementation for i386 when
      updating orig_eax automatically update the syscall number as well. This
      is now updated in handle_syscall().
      Signed-off-by: NMickaël Salaün <mic@digikod.net>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Will Drewry <wad@chromium.org>
      Cc: Thomas Meyer <thomas@m3y3r.de>
      Cc: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
      Cc: Anton Ivanov <aivanov@brocade.com>
      Cc: Meredydd Luff <meredydd@senatehouse.org>
      Cc: David Drysdale <drysdale@google.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Acked-by: NKees Cook <keescook@chromium.org>
      e04c989e
    • A
      um: Update UBD to use pread/pwrite family of functions · 8c6157b6
      Anton Ivanov 提交于
      This decreases the number of syscalls per read/write by half.
      Signed-off-by: NAnton Ivanov <aivanov@brocade.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      8c6157b6
    • A
      um: Do not change hard IRQ flags in soft IRQ processing · 470a166e
      Anton Ivanov 提交于
      Software IRQ processing in generic architectures assumes that the
      exit out of hard IRQ may have re-enabled interrupts (some
      architectures may have an implicit EOI). It presumes them enabled
      and toggles the flags once more just in case unless this is turned
      off in the architecture specific hardirq.h by setting
      __ARCH_IRQ_EXIT_IRQS_DISABLED
      
      This patch adds this to UML where due to the way IRQs are handled
      it is an optimization (it works fine without it too).
      Signed-off-by: NAnton Ivanov <aivanov@brocade.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      470a166e
    • A
      um: Prevent IRQ handler reentrancy · d5e3f5cb
      Anton Ivanov 提交于
      The existing IRQ handler design in UML does not prevent reentrancy
      
      This is mitigated by fd-enable/fd-disable semantics for the IO
      portion of the UML subsystem. The timer, however, can and is
      re-entered resulting in very deep stack usage and occasional
      stack exhaustion.
      
      This patch prevents this by checking if there is a timer
      interrupt in-flight before processing any pending timer interrupts.
      Signed-off-by: NAnton Ivanov <aivanov@brocade.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      d5e3f5cb
    • V
      uml: flush stdout before forking · 0754fb29
      Vegard Nossum 提交于
      I was seeing some really weird behaviour where piping UML's output
      somewhere would cause output to get duplicated:
      
        $ ./vmlinux | head -n 40
        Checking that ptrace can change system call numbers...Core dump limits :
                soft - 0
                hard - NONE
        OK
        Checking syscall emulation patch for ptrace...Core dump limits :
                soft - 0
                hard - NONE
        OK
        Checking advanced syscall emulation patch for ptrace...Core dump limits :
                soft - 0
                hard - NONE
        OK
        Core dump limits :
                soft - 0
                hard - NONE
      
      This is because these tests do a fork() which duplicates the non-empty
      stdout buffer, then glibc flushes the duplicated buffer as each child
      exits.
      
      A simple workaround is to flush before forking.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NVegard Nossum <vegard.nossum@oracle.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      0754fb29
  4. 10 1月, 2016 2 次提交
  5. 09 1月, 2016 12 次提交
  6. 08 1月, 2016 1 次提交
  7. 07 1月, 2016 13 次提交