1. 04 May, 2016 2 commits
    • Andy Lutomirski's avatar
      selftests/sigaltstack: Fix the sigaltstack test on old kernels · 158b67b5
      Andy Lutomirski authored
      The handling for old kernels was wrong, resulting in a segfault.  Fix it.
      Reported-by: default avatarIngo Molnar <mingo@kernel.org>
      Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Stas Sergeev <stsp@list.ru>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-api@vger.kernel.org
      Link: http://lkml.kernel.org/r/f3e739bf435beeaecbd5f038f1359d2eac6d1e63.1462296606.git.luto@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      158b67b5
    • Andy Lutomirski's avatar
      signals/sigaltstack: If SS_AUTODISARM, bypass on_sig_stack() · c876eeab
      Andy Lutomirski authored
      If a signal stack is set up with SS_AUTODISARM, then the kernel
      inherently avoids incorrectly resetting the signal stack if signals
      recurse: the signal stack will be reset on the first signal
      delivery.  This means that we don't need check the stack pointer
      when delivering signals if SS_AUTODISARM is set.
      
      This will make segmented x86 programs more robust: currently there's
      a hole that could be triggered if ESP/RSP appears to point to the
      signal stack but actually doesn't due to a nonzero SS base.
      Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Aleksa Sarai <cyphar@cyphar.com>
      Cc: Amanieu d'Antras <amanieu@gmail.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
      Cc: Jason Low <jason.low2@hp.com>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Moore <pmoore@redhat.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Stas Sergeev <stsp@list.ru>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vladimir Davydov <vdavydov@parallels.com>
      Cc: linux-api@vger.kernel.org
      Link: http://lkml.kernel.org/r/c46bee4654ca9e68c498462fd11746e2bd0d98c8.1462296606.git.luto@kernel.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      c876eeab
  2. 03 May, 2016 4 commits
    • Stas Sergeev's avatar
      selftests/sigaltstack: Add new testcase for sigaltstack(SS_ONSTACK|SS_AUTODISARM) · 19fd2868
      Stas Sergeev authored
      This patch adds the test case for SS_AUTODISARM flag.
      The test-case tries to set SS_AUTODISARM flag and checks if
      the nested signal corrupts the stack after swapcontext().
      Signed-off-by: default avatarStas Sergeev <stsp@list.ru>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-api@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Link: http://lkml.kernel.org/r/1460665206-13646-5-git-send-email-stsp@list.ruSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      19fd2868
    • Stas Sergeev's avatar
      signals/sigaltstack: Implement SS_AUTODISARM flag · 2a742138
      Stas Sergeev authored
      This patch implements the SS_AUTODISARM flag that can be OR-ed with
      SS_ONSTACK when forming ss_flags.
      
      When this flag is set, sigaltstack will be disabled when entering
      the signal handler; more precisely, after saving sas to uc_stack.
      When leaving the signal handler, the sigaltstack is restored by
      uc_stack.
      
      When this flag is used, it is safe to switch from sighandler with
      swapcontext(). Without this flag, the subsequent signal will corrupt
      the state of the switched-away sighandler.
      
      To detect the support of this functionality, one can do:
      
        err = sigaltstack(SS_DISABLE | SS_AUTODISARM);
        if (err && errno == EINVAL)
      	unsupported();
      Signed-off-by: default avatarStas Sergeev <stsp@list.ru>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Aleksa Sarai <cyphar@cyphar.com>
      Cc: Amanieu d'Antras <amanieu@gmail.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Eric W. Biederman <ebiederm@xmission.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
      Cc: Jason Low <jason.low2@hp.com>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Moore <pmoore@redhat.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vladimir Davydov <vdavydov@parallels.com>
      Cc: linux-api@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Link: http://lkml.kernel.org/r/1460665206-13646-4-git-send-email-stsp@list.ruSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      2a742138
    • Stas Sergeev's avatar
      signals/sigaltstack: Prepare to add new SS_xxx flags · 407bc16a
      Stas Sergeev authored
      This patch adds SS_FLAG_BITS - the mask that splits sigaltstack
      mode values and bit-flags. Since there is no bit-flags yet, the
      mask is defined to 0. The flags are added by subsequent patches.
      With every new flag, the mask should have the appropriate bit cleared.
      
      This makes sure if some flag is tried on a kernel that doesn't
      support it, the -EINVAL error will be returned, because such a
      flag will be treated as an invalid mode rather than the bit-flag.
      
      That way the existence of the particular features can be probed
      at run-time.
      
      This change was suggested by Andy Lutomirski:
      
        https://lkml.org/lkml/2016/3/6/158Signed-off-by: default avatarStas Sergeev <stsp@list.ru>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Amanieu d'Antras <amanieu@gmail.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Sasha Levin <sasha.levin@oracle.com>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vladimir Davydov <vdavydov@parallels.com>
      Cc: linux-api@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Link: http://lkml.kernel.org/r/1460665206-13646-3-git-send-email-stsp@list.ruSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      407bc16a
    • Stas Sergeev's avatar
      signals/sigaltstack, x86/signals: Unify the x86 sigaltstack check with other architectures · 0b4521e8
      Stas Sergeev authored
      Currently x86's get_sigframe() checks for "current->sas_ss_size"
      to determine whether there is a need to switch to sigaltstack.
      The common practice used by all other arches is to check for
      sas_ss_flags(sp) == 0
      
      This patch makes the code consistent with other architectures.
      
      The slight complexity of the patch is added by the optimization on
      !sigstack check that was requested by Andy Lutomirski: sas_ss_flags(sp)==0
      already implies that we are not on a sigstack, so the code is shuffled
      to avoid the duplicate checking.
      
      This patch should have no user-visible impact.
      Signed-off-by: default avatarStas Sergeev <stsp@list.ru>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Shuah Khan <shuahkh@osg.samsung.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-api@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Link: http://lkml.kernel.org/r/1460665206-13646-2-git-send-email-stsp@list.ruSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      0b4521e8
  3. 01 May, 2016 2 commits
  4. 30 Apr, 2016 6 commits
    • Linus Torvalds's avatar
      Merge tag 'powerpc-4.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 1b46bac6
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "A few more powerpc fixes for 4.6:
      
         - cxl: Keep IRQ mappings on context teardown from Michael Neuling
      
         - cxl: Poll for outstanding IRQs when detaching a context from
           Michael Neuling
      
         - Wire up preadv2 and pwritev2 syscalls from Rui Salvaterra"
      
      * tag 'powerpc-4.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc: wire up preadv2 and pwritev2 syscalls
        cxl: Poll for outstanding IRQs when detaching a context
        cxl: Keep IRQ mappings on context teardown
      1b46bac6
    • Linus Torvalds's avatar
      Merge tag 'edac_fix_for_4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp · 65c4cbeb
      Linus Torvalds authored
      Pull EDAC fix from Borislav Petkov:
       "Make sure sb_edac and i7core_edac do not terminate MCE processing on
        the decoding callchain prematurely"
      
      * tag 'edac_fix_for_4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp:
        EDAC: i7core, sb_edac: Don't return NOTIFY_BAD from mce_decoder callback
      65c4cbeb
    • Linus Torvalds's avatar
      Merge tag 'pm+acpi-4.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · b49a5195
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "One revert of a recent cpufreq commit that introduced a regression and
        a fix for intel_pstate's Turbo Activation Ratio handling code.
      
        Specifics:
      
         - Revert cpufreq commit that attempted to fix a problem in the
           ondemand/conservative governor code, but did that incorrectly and
           introduced another problem instead (Rafael Wysocki).
      
         - Fix incorrect decoding of MSR contents related to the Turbo
           Activation Ratio (TAR) handling in the intel_pstate driver
           (Srinivas Pandruvada)"
      
      * tag 'pm+acpi-4.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: intel_pstate: Fix processing for turbo activation ratio
        Revert "cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC"
      b49a5195
    • Linus Torvalds's avatar
      Merge tag 'mmc-v4.6-rc4' of git://git.linaro.org/people/ulf.hansson/mmc · a8feb782
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "Here are a two MMC host fixes:
      
        - sdhci-acpi: Reduce Baytrail eMMC/SD/SDIO hangs
      
        - sunxi: Disable eMMC HS-DDR for Allwinner A80"
      
      * tag 'mmc-v4.6-rc4' of git://git.linaro.org/people/ulf.hansson/mmc:
        mmc: sunxi: Disable eMMC HS-DDR (MMC_CAP_1_8V_DDR) for Allwinner A80
        mmc: sdhci-acpi: Reduce Baytrail eMMC/SD/SDIO hangs
      a8feb782
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · b9cc335f
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "A few fixes all over the place:
      
        radeon is probably the biggest standout, it's a fix for screen
        corruption or hung black outputs so I thought it was worth pulling in.
      
        Otherwise some amdgpu power control fixes, some misc vmwgfx fixes, one
        etnaviv fix, one virtio-gpu fix, two DP MST fixes, and a single TTM
        fix"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/vmwgfx: Fix order of operation
        drm/vmwgfx: use vmw_cmd_dx_cid_check for query commands.
        drm/vmwgfx: Enable SVGA_3D_CMD_DX_SET_PREDICATION
        drm/amdgpu: disable vm interrupts with vm_fault_stop=2
        drm/amdgpu: print a message if ATPX dGPU power control is missing
        Revert "drm/amdgpu: disable runtime pm on PX laptops without dGPU power control"
        drm/radeon: fix vertical bars appear on monitor (v2)
        drm/ttm: fix kref count mess in ttm_bo_move_to_lru_tail
        drm/virtio: send vblank event after crtc updates
        drm/dp/mst: Restore primary hub guid on resume
        drm/dp/mst: Get validated port ref in drm_dp_update_payload_part1()
        drm/etnaviv: don't move linear memory window on 3D cores without MC2.0
      b9cc335f
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma · 925d96a0
      Linus Torvalds authored
      Pull rdma fixes from Doug Ledford:
       "Final set of -rc fixes for 4.6.
      
        I've collected up a number of patches that are all pretty small with
        the exception of only a couple.  The hfi1 driver has a number of
        important patches, and it is what really drives the line count of this
        pull request up.  These are all small and I've got this kernel built
        and running in the test lab (I have most of the hardware, I think nes
        is the only thing in this patch set that I can't say I've personally
        tested and have up and running).
      
        Summary:
      
         - A number of collected fixes for oopses, memory corruptions,
           deadlocks, etc.  All of these fixes are small (many only 5-10
           lines), obvious, and tested.
      
         - Fix for the security issue related to the use of write for
           bi-directional communications"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma:
        RDMA/nes: don't leak skb if carrier down
        IB/security: Restrict use of the write() interface
        IB/hfi1: Use kernel default llseek for ui device
        IB/hfi1: Don't attempt to free resources if initialization failed
        IB/hfi1: Fix missing lock/unlock in verbs drain callback
        IB/rdmavt: Fix send scheduling
        IB/hfi1: Prevent unpinning of wrong pages
        IB/hfi1: Fix deadlock caused by locking with wrong scope
        IB/hfi1: Prevent NULL pointer deferences in caching code
        MAINTAINERS: Update iser/isert maintainer contact info
        IB/mlx5: Expose correct max_sge_rd limit
        RDMA/iw_cxgb4: Fix bar2 virt addr calculation for T4 chips
        iw_cxgb4: handle draining an idle qp
        iw_cxgb3: initialize ibdev.iwcm->ifname for port mapping
        iw_cxgb4: initialize ibdev.iwcm->ifname for port mapping
        IB/core: Don't drain non-existent rq queue-pair
        IB/core: Fix oops in ib_cache_gid_set_default_gid
      925d96a0
  5. 29 Apr, 2016 26 commits