Skip to content
  1. Nov 23, 2016
    • Eric W. Biederman's avatar
      exec: Ensure mm->user_ns contains the execed files · f84df2a6
      Eric W. Biederman authored
      
      
      When the user namespace support was merged the need to prevent
      ptrace from revealing the contents of an unreadable executable
      was overlooked.
      
      Correct this oversight by ensuring that the executed file
      or files are in mm->user_ns, by adjusting mm->user_ns.
      
      Use the new function privileged_wrt_inode_uidgid to see if
      the executable is a member of the user namespace, and as such
      if having CAP_SYS_PTRACE in the user namespace should allow
      tracing the executable.  If not update mm->user_ns to
      the parent user namespace until an appropriate parent is found.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarJann Horn <jann@thejh.net>
      Fixes: 9e4a36ec
      
       ("userns: Fail exec for suid and sgid binaries with ids outside our user namespace.")
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      f84df2a6
    • Eric W. Biederman's avatar
      ptrace: Don't allow accessing an undumpable mm · 84d77d3f
      Eric W. Biederman authored
      
      
      It is the reasonable expectation that if an executable file is not
      readable there will be no way for a user without special privileges to
      read the file.  This is enforced in ptrace_attach but if ptrace
      is already attached before exec there is no enforcement for read-only
      executables.
      
      As the only way to read such an mm is through access_process_vm
      spin a variant called ptrace_access_vm that will fail if the
      target process is not being ptraced by the current process, or
      the current process did not have sufficient privileges when ptracing
      began to read the target processes mm.
      
      In the ptrace implementations replace access_process_vm by
      ptrace_access_vm.  There remain several ptrace sites that still use
      access_process_vm as they are reading the target executables
      instructions (for kernel consumption) or register stacks.  As such it
      does not appear necessary to add a permission check to those calls.
      
      This bug has always existed in Linux.
      
      Fixes: v1.0
      Cc: stable@vger.kernel.org
      Reported-by: default avatarAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      84d77d3f
    • Eric W. Biederman's avatar
      ptrace: Capture the ptracer's creds not PT_PTRACE_CAP · 64b875f7
      Eric W. Biederman authored
      
      
      When the flag PT_PTRACE_CAP was added the PTRACE_TRACEME path was
      overlooked.  This can result in incorrect behavior when an application
      like strace traces an exec of a setuid executable.
      
      Further PT_PTRACE_CAP does not have enough information for making good
      security decisions as it does not report which user namespace the
      capability is in.  This has already allowed one mistake through
      insufficient granulariy.
      
      I found this issue when I was testing another corner case of exec and
      discovered that I could not get strace to set PT_PTRACE_CAP even when
      running strace as root with a full set of caps.
      
      This change fixes the above issue with strace allowing stracing as
      root a setuid executable without disabling setuid.  More fundamentaly
      this change allows what is allowable at all times, by using the correct
      information in it's decision.
      
      Cc: stable@vger.kernel.org
      Fixes: 4214e42f96d4 ("v2.4.9.11 -> v2.4.9.12")
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      64b875f7
    • Eric W. Biederman's avatar
      mm: Add a user_ns owner to mm_struct and fix ptrace permission checks · bfedb589
      Eric W. Biederman authored
      During exec dumpable is cleared if the file that is being executed is
      not readable by the user executing the file.  A bug in
      ptrace_may_access allows reading the file if the executable happens to
      enter into a subordinate user namespace (aka clone(CLONE_NEWUSER),
      unshare(CLONE_NEWUSER), or setns(fd, CLONE_NEWUSER).
      
      This problem is fixed with only necessary userspace breakage by adding
      a user namespace owner to mm_struct, captured at the time of exec, so
      it is clear in which user namespace CAP_SYS_PTRACE must be present in
      to be able to safely give read permission to the executable.
      
      The function ptrace_may_access is modified to verify that the ptracer
      has CAP_SYS_ADMIN in task->mm->user_ns instead of task->cred->user_ns.
      This ensures that if the task changes it's cred into a subordinate
      user namespace it does not become ptraceable.
      
      The function ptrace_attach is modified to only set PT_PTRACE_CAP when
      CAP_SYS_PTRACE is held over task->m...
      bfedb589
  2. Nov 21, 2016
    • Linus Torvalds's avatar
      Linux 4.9-rc6 · 9c763584
      Linus Torvalds authored
      v4.9-rc6
      9c763584
    • Linus Torvalds's avatar
      Merge branch 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm · 697ed8d0
      Linus Torvalds authored
      Pull ARM fixes from Russell King:
       "A few more ARM fixes:
      
         - the assembly backtrace code suffers problems with the new printk()
           implementation which assumes that kernel messages without KERN_CONT
           should have newlines inserted between them. Fix this.
         - fix a section naming error - ".init.text" rather than ".text.init"
         - preallocate DMA debug memory at core_initcall() time rather than
           fs_initcall(), as we have some core drivers that need to use DMA
           mapping - and that triggers a kernel warning from the DMA debug
           code.
         - fix XIP kernels after the ro_after_init changes made this data
           permanently read-only"
      
      * 'fixes' of git://git.armlinux.org.uk/~rmk/linux-arm:
        ARM: Fix XIP kernels
        ARM: 8628/1: dma-mapping: preallocate DMA-debug hash tables in core_initcall
        ARM: 8624/1: proc-v7m.S: fix init section name
        ARM: fix backtrace
      697ed8d0
  3. Nov 20, 2016
  4. Nov 19, 2016
    • Linus Torvalds's avatar
      Merge tag 'acpi-4.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 20afa6e2
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "They fix an ACPI thermal management regression introduced by a recent
        FADT handling cleanup, an ACPI tools build issue introduced by a
        recent ACPICA commit and a PCC mailbox initialization bug causing
        lockdep to complain loudly.
      
        Specifics:
      
         - Revert a recent ACPICA cleanup that attempted to get rid of all
           FADT version 2 legacy, but broke ACPI thermal management on at
           least one system (Rafael Wysocki).
      
         - Fix cross-compiled builds of ACPI tools that stopped working after
           a recent cleanup related to the handling of header files in ACPICA
           (Lv Zheng).
      
         - Fix a locking issue in the PCC channel initialization code that
           invokes devm_request_irq() under a spinlock (among other things)
           and causes lockdep to complain (Hoan Tran)"
      
      * tag 'acpi-4.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        tools/power/acpi: Remove direct kernel source include reference
        mailbox: PCC: Fix lockdep warning when request PCC channel
        Revert "ACPICA: FADT support cleanup"
      20afa6e2
    • Linus Torvalds's avatar
      Merge branch 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild · 04e36857
      Linus Torvalds authored
      Pull kbuild fixes from Michal Marek:
       "Here are some regression fixes for kbuild:
      
         - modversion support for exported asm symbols (Nick Piggin). The
           affected architectures need separate patches adding
           asm-prototypes.h.
      
         - fix rebuilds of lib-ksyms.o (Nick Piggin)
      
         - -fno-PIE builds (Sebastian Siewior and Borislav Petkov). This is
           not a kernel regression, but one of the Debian gcc package.
           Nevertheless, it's quite annoying, so I think it should go into
           mainline and stable now"
      
      * 'rc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
        kbuild: Steal gcc's pie from the very beginning
        kbuild: be more careful about matching preprocessed asm ___EXPORT_SYMBOL
        x86/kexec: add -fno-PIE
        scripts/has-stack-protector: add -fno-PIE
        kbuild: add -fno-PIE
        kbuild: modversions for EXPORT_SYMBOL() for asm
        kbuild: prevent lib-ksyms.o rebuilds
      04e36857
    • Linus Torvalds's avatar
      Merge tag 'nfsd-4.9-2' of git://linux-nfs.org/~bfields/linux · aad931a3
      Linus Torvalds authored
      Pull nfsd bugfix from Bruce Fields:
       "Just one fix for an NFS/RDMA crash"
      
      * tag 'nfsd-4.9-2' of git://linux-nfs.org/~bfields/linux:
        sunrpc: svc_age_temp_xprts_now should not call setsockopt non-tcp transports
      aad931a3
    • Pavel Machek's avatar
      MAINTAINERS: Add LED subsystem co-maintainer · dbfa048d
      Pavel Machek authored
      
      
      Mark me as a co-maintainer of LED subsystem.
      
      Signed-off-by: default avatarPavel Machek <pavel@ucw.cz>
      Signed-off-by: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
      dbfa048d
    • Rafael J. Wysocki's avatar
      Merge branches 'acpica-fixes', 'acpi-cppc-fixes' and 'acpi-tools-fixes' · aab0b243
      Rafael J. Wysocki authored
      * acpica-fixes:
        Revert "ACPICA: FADT support cleanup"
      
      * acpi-cppc-fixes:
        mailbox: PCC: Fix lockdep warning when request PCC channel
      
      * acpi-tools-fixes:
        tools/power/acpi: Remove direct kernel source include reference
      aab0b243
    • Linus Torvalds's avatar
      Merge tag 'sound-4.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · c1717701
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Three trivial fixes:
      
        A regression fix for ASRock mobo, a use-after-free fix at hot-unplug
        of USB-audio, and a quirk for new Thinkpad models"
      
      * tag 'sound-4.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: usb-audio: Fix use-after-free of usb_device at disconnect
        ALSA: hda - Fix mic regression by ASRock mobo fixup
        ALSA: hda - add a new condition to check if it is thinkpad
      c1717701
    • Linus Torvalds's avatar
      Merge tag 'gpio-v4.9-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio · bd2bc2b8
      Linus Torvalds authored
      Pull GPIO fixes from Linus Walleij:
       "These are hopefully the last GPIO fixes for v4.9. The most important
        is that it fixes the UML randconfig builds that have been nagging me
        for some time and me being confused about where the problem was really
        sitting, now this fix give this nice feeling that everything is solid
        and builds fine.
      
        Summary:
      
         - Finally, after being puzzled by a bunch of recurrent UML build
           failures on randconfigs from the build robot, Keno Fischer nailed
           it: GPIO_DEVRES is optional and depends on HAS_IOMEM even though
           many users just unconditionally rely on it to be available. And it
           *should* be available: garbage collection is nice for this and it
           *certainly* has nothing to do with having IOMEM. So we got rid of
           it, and now the UML builds should JustWork(TM).
      
         - Do not call .get_direction() on sleeping GPIO chips on the fastpath
           when locking GPIOs for interrupts: it is done from atomic context,
           no way.
      
         - Some driver fixes"
      
      * tag 'gpio-v4.9-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
        gpio: Remove GPIO_DEVRES option
        gpio: tc3589x: fix up .get_direction()
        gpio: do not double-check direction on sleeping chips
        gpio: pca953x: Move memcpy into mutex lock for set multiple
        gpio: pca953x: Fix corruption of other gpios in set_multiple.
      bd2bc2b8
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-for-v4.9-rc6-brown-paper-bag' of git://people.freedesktop.org/~airlied/linux · 12b70ec0
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "i915 fixes + 2 mediatek regressions.
      
        So some i915 fixes came in which I thought they might so I'm sending
        those along with two reverts for two patches to the mediatek driver
        that didn't seem to build so well, I've fixed up my -fixes ARM build
        and .config so I could see it, but yes brown paper bag time"
      
      * tag 'drm-fixes-for-v4.9-rc6-brown-paper-bag' of git://people.freedesktop.org/~airlied/linux:
        Revert "drm/mediatek: set vblank_disable_allowed to true"
        Revert "drm/mediatek: fix a typo of OD_CFG to OD_RELAYMODE"
        drm/i915: Assume non-DP++ port if dvo_port is HDMI and there's no AUX ch specified in the VBT
        drm/i915: Refresh that status of MST capable connectors in ->detect()
        drm/i915: Grab the rotation from the passed plane state for VLV sprites
        drm/i915: Mark CPU cache as dirty when used for rendering
      12b70ec0
  5. Nov 18, 2016