1. 09 Dec, 2016 9 commits
    • Thomas Gleixner's avatar
      x86/ldt: Make all size computations unsigned · 990e9dc3
      Thomas Gleixner authored
      ldt->size can never be negative. The helper functions take 'unsigned int'
      arguments which are assigned from ldt->size. The related user space
      user_desc struct member entry_number is unsigned as well.
      
      But ldt->size itself and a few local variables which are related to
      ldt->size are type 'int' which makes no sense whatsoever and results in
      typecasts which make the eyes bleed.
      
      Clean it up and convert everything which is related to ldt->size to
      unsigned it.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      990e9dc3
    • Dan Carpenter's avatar
      x86/ldt: Make a size argument unsigned · 296dc580
      Dan Carpenter authored
      My static checker complains that we put an upper bound on the "size"
      argument but not a lower bound.  The checker is not smart enough to know
      the possible ranges of "old_mm->context.ldt->size" from
      init_new_context_ldt() so it thinks maybe it could be negative.
      
      Let's make it unsigned to silence the warning and future proof the code
      a bit.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarAndy Lutomirski <luto@kernel.org>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: kernel-janitors@vger.kernel.org
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Link: http://lkml.kernel.org/r/20161208105602.GA11382@elgon.mountainSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      296dc580
    • Linus Torvalds's avatar
      Merge branch 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · 810ac7b7
      Linus Torvalds authored
      Pull libnvdimm fixes from Dan Williams:
       "Several fixes to the DSM (ACPI device specific method) marshaling
        implementation.
      
        I consider these urgent enough to send for 4.9 consideration since
        they fix the kernel's handling of ARS (Address Range Scrub) commands.
        Especially for platforms without machine-check-recovery capabilities,
        successful execution of ARS commands enables the platform to
        potentially break out of an infinite reboot problem if a media error
        is present in the boot path. There is also a one line fix for a
        device-dax read-only mapping regression.
      
        Commits 9a901f54 ("acpi, nfit: fix extended status translations
        for ACPI DSMs") and 325896ff ("device-dax: fix private mapping
        restriction, permit read-only") are true regression fixes for changes
        introduced this cycle.
      
        Commit efda1b5d ("acpi, nfit, libnvdimm: fix / harden ars_status
        output length handling") fixes the kernel's handling of zero-length
        results, this never would have worked in the past, but we only just
        recently discovered a BIOS implementation that emits this arguably
        spec non-compliant result.
      
        The remaining two commits are additional fall out from thinking
        through the implications of a zero / truncated length result of the
        ARS Status command.
      
        In order to mitigate the risk that these changes introduce yet more
        regressions they are backstopped by a new unit test in commit
        a7de92da ("tools/testing/nvdimm: unit test acpi_nfit_ctl()") that
        mocks up inputs to acpi_nfit_ctl()"
      
      * 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        device-dax: fix private mapping restriction, permit read-only
        tools/testing/nvdimm: unit test acpi_nfit_ctl()
        acpi, nfit: fix bus vs dimm confusion in xlat_status
        acpi, nfit: validate ars_status output buffer size
        acpi, nfit, libnvdimm: fix / harden ars_status output length handling
        acpi, nfit: fix extended status translations for ACPI DSMs
      810ac7b7
    • Linus Torvalds's avatar
      Merge branch 'for-4.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata · 861d75d0
      Linus Torvalds authored
      Pull libata fixes from Tejun Heo:
       "This is quite late but SCT Write Same support added during this cycle
        is broken subtly but seriously and it'd be best to disable it before
        v4.9 gets released.
      
        This contains two commits - one low impact sata_mv fix and the
        mentioned disabling of SCT Write Same"
      
      * 'for-4.9-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
        libata-scsi: disable SCT Write Same for the moment
        ata: sata_mv: check for errors when parsing nr-ports from dt
      861d75d0
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-4.9-rc9' of git://github.com/ceph/ceph-client · af9468db
      Linus Torvalds authored
      Pull ceph fix from Ilya Dryomov:
       "A fix for an issue with ->d_revalidate() in ceph, causing frequent
        kernel crashes.
      
        Marked for stable - it goes back to 4.6, but started popping up only
        in 4.8"
      
      * tag 'ceph-for-4.9-rc9' of git://github.com/ceph/ceph-client:
        ceph: don't set req->r_locked_dir in ceph_d_revalidate
      af9468db
    • Linus Torvalds's avatar
      Merge tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 1f6c926c
      Linus Torvalds authored
      Pull ARM SoC fixes from Olof Johansson:
       "Final batch of SoC fixes
      
        A few fixes that have trickled in over the last week, all fixing minor
        errors in devicetrees -- UART pin assignment on Allwinner H3,
        correcting number of SATA ports on a Marvell-based Linkstation
        platform and a display clock fix for Freescale/NXP i.MX7D that fixes a
        freeze when starting up X"
      
      * tag 'armsoc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        ARM: dts: orion5x: fix number of sata port for linkstation ls-gl
        ARM: dts: imx7d: fix LCDIF clock assignment
        dts: sun8i-h3: correct UART3 pin definitions
      1f6c926c
    • Linus Torvalds's avatar
      Merge tag 'm68k-for-v4.9-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k · 75147120
      Linus Torvalds authored
      Pull m68k fixes from Geert Uytterhoeven:
      
       - build fix for drivers calling ndelay() in a conditional block without
         curly braces
      
       - defconfig updates
      
      * tag 'm68k-for-v4.9-tag2' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
        m68k: Fix ndelay() macro
        m68k/defconfig: Update defconfigs for v4.9-rc1
      75147120
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 1ca17e97
      Linus Torvalds authored
      Pull drm fix from Dave Airlie:
       "Just a single fix for amdgpu to just suspend the gpu on 'shutdown'
        instead of shutting it down fully, as for some reason the hw was
        getting upset in some situations"
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
        drm/amdgpu: just suspend the hw on pci shutdown
      1ca17e97
    • Linus Torvalds's avatar
      Revert "radix tree test suite: fix compilation" · 2b41226b
      Linus Torvalds authored
      This reverts commit 53855d10.
      
      It shouldn't have come in yet - it depends on the changes in linux-next
      that will come in during the next merge window.  As Matthew Wilcox says,
      the test suite is broken with the current state without the revert.
      Requested-by: default avatarMatthew Wilcox <mawilcox@microsoft.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2b41226b
  2. 08 Dec, 2016 10 commits
  3. 07 Dec, 2016 20 commits
    • Nicolai Stange's avatar
      libata-scsi: disable SCT Write Same for the moment · e185934f
      Nicolai Stange authored
      SCT Write Same support had been introduced with
      commit 7b203094 ("libata: Add support for SCT Write Same")
      
      Some problems, namely excessive userspace segfaults, had been reported at
      
        http://lkml.kernel.org/r/20160908192736.GA4356@gmail.com
      
      This lead to commit 0ce1b18c ("libata: Some drives failing on
      SCT Write Same") which strived to disable SCT Write Same on !ZAC devices.
      Due to the way this was done and to the logic in sd_config_write_same(),
      this didn't work for those devices that have
      ->max_ws_blocks > SD_MAX_WS10_BLOCKS: for these, ->no_write_same and
      ->max_write_same_sectors would still be non-zero,
      but ->ws10 == ->ws16 == 0. This would cause sd_setup_write_same_cmnd() to
      demultiplex REQ_OP_WRITE_SAME requests to WRITE_SAME, and these in turn
      aren't supported by libata-scsi:
      
        EXT4-fs (dm-1): Delayed block allocation failed for inode 2625094 at
                        logical offset 2032 with max blocks 2 with error 121
        EXT4-fs (dm-1): This should not happen!! Data will be lost
      
      121 == EREMOTEIO is what scsi_io_completion() asserts in case of
      invalid opcodes.
      
      Back to the original problem of userspace segfaults: this can be tracked
      down to ata_format_sct_write_same() overwriting the input page. Sometimes,
      this page is ZERO_PAGE(0) which ceases to be filled with zeros from that
      point on. Since ZERO_PAGE(0) is used for userspace .bss mappings, code of
      the following is doomed:
      
        static char *a = NULL; /* .bss */
        ...
        if (a)
          *a = 'a';
      
      This problem is not solved by disabling SCT Write Same for !ZAC devices
      only.
      
      It can certainly be fixed, but the final release is quite close -- so
      disable SCT Write Same for all ATA devices rather than introducing some
      SCT key buffer allocation schemes at this point.
      
      Fixes: 7b203094 ("libata: Add support for SCT Write Same")
      Signed-off-by: default avatarNicolai Stange <nicstange@gmail.com>
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      e185934f
    • Stefan Agner's avatar
      ARM: dts: imx7d: fix LCDIF clock assignment · 4b707fa0
      Stefan Agner authored
      The eLCDIF IP of the i.MX 7 SoC knows multiple clocks and lists them
      separately:
      
      Clock      Clock Root              Description
      apb_clk    MAIN_AXI_CLK_ROOT       AXI clock
      pix_clk    LCDIF_PIXEL_CLK_ROOT    Pixel clock
      ipg_clk_s  MAIN_AXI_CLK_ROOT       Peripheral access clock
      
      All of them are switched by a single gate, which is part of the
      IMX7D_LCDIF_PIXEL_ROOT_CLK clock. Hence using that clock also for
      the AXI bus clock (clock-name "axi") makes sure the gate gets
      enabled when accessing registers.
      
      There seem to be no separate AXI display clock, and the clock is
      optional. Hence remove the dummy clock.
      
      This fixes kernel freezes when starting the X-Server (which
      disables/re-enables the display controller).
      
      Fixes: e8ed73f6 ("ARM: dts: imx7d: add lcdif support")
      Signed-off-by: default avatarStefan Agner <stefan@agner.ch>
      Reviewed-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
      Acked-by: default avatarShawn Guo <shawnguo@kernel.org>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      4b707fa0
    • Jorik Jonker's avatar
      dts: sun8i-h3: correct UART3 pin definitions · 4367c1d8
      Jorik Jonker authored
      In a previous commit, I made a copy/paste error in the pinmux
      definitions of UART3: PG{13,14} instead of PA{13,14}. This commit takes
      care of that. I have tested this commit on Orange Pi PC and Orange Pi
      Plus, and it works for these boards.
      
      Fixes: e3d11d3c ("dts: sun8i-h3: add pinmux definitions for
      UART2-3")
      Signed-off-by: default avatarJorik Jonker <jorik@kippendief.biz>
      Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      4367c1d8
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ea5a9eff
      Linus Torvalds authored
      Pull x86 fixes from Ingo Molnar:
       "Misc fixes: a core dumping crash fix, a guess-unwinder regression fix,
        plus three build warning fixes"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/unwind: Fix guess-unwinder regression
        x86/build: Annotate die() with noreturn to fix build warning on clang
        x86/platform/olpc: Fix resume handler build warning
        x86/apic/uv: Silence a shift wrapping warning
        x86/coredump: Always use user_regs_struct for compat_elf_gregset_t
      ea5a9eff
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 68f5503b
      Linus Torvalds authored
      Pull scheduler fix from Ingo Molnar:
       "An autogroup nice level adjustment bug fix"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/autogroup: Fix 64-bit kernel nice level adjustment
      68f5503b
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · bf7f1c7e
      Linus Torvalds authored
      Pull perf fixes from Ingo Molnar:
       "A bogus warning fix, a counter width handling fix affecting certain
        machines, plus a oneliner hw-enablement patch for Knights Mill CPUs"
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        perf/core: Remove invalid warning from list_update_cgroup_even()t
        perf/x86: Fix full width counter, counter overflow
        perf/x86/intel: Enable C-state residency events for Knights Mill
      bf7f1c7e
    • Linus Torvalds's avatar
      Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5b43f97f
      Linus Torvalds authored
      Pull locking fixes from Ingo Molnar:
       "Two rtmutex race fixes (which miraculously never triggered, that we
        know of), plus two lockdep printk formatting regression fixes"
      
      * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        lockdep: Fix report formatting
        locking/rtmutex: Use READ_ONCE() in rt_mutex_owner()
        locking/rtmutex: Prevent dequeue vs. unlock race
        locking/selftest: Fix output since KERN_CONT changes
      5b43f97f
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 407cf05d
      Linus Torvalds authored
      Pull objtool fix from Ingo Molnar:
       "A single late breaking fix for objtool"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        objtool: Fix bytes check of lea's rex_prefix
      407cf05d
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse · ce779d6b
      Linus Torvalds authored
      Pull fuse fix from Miklos Szeredi:
       "Fix a regression spotted by Jeff Layton"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
        fuse: fix clearing suid, sgid for chown()
      ce779d6b
    • Linus Torvalds's avatar
      Revert "default exported asm symbols to zero" · f27c2f69
      Linus Torvalds authored
      This reverts commit 8ab2ae65.
      
      I loved that commit because of how it explained what the problem with
      newer versions of binutils were, but the actual patch itself turns out
      to not work very well.
      
      It has two problems:
      
       - a zero CRC value isn't actually right.  It happens to work for the
         case where both sides of the equation fail at giving the symbol a
         crc, but there are cases where the users of the exported symbol get
         the right crc (due to seeing the C declarations), but the actual
         exporting itself does not (due to the whole weak asm symbol issue).
      
         So then the module load fails after all - we did have a crc for the
         symbol, but we couldn't match it with the loaded module.
      
       - it seems that the alpha assembler has special semantics for the
         '.set' directive, and on alpha it doesn't actually set the value of
         the specified symbol at all, it is instead used to set various
         assembly modes (eg ".set noat" and ".set noreorder").
      
         So using ".set" to set the symbol value would just cause build
         failures on alpha.
      
      I'm sure we'll find some other workaround for these issues (hopefully
      that involves getting rid of modversions entirely some day, but people
      are also talking about just using smarter tools).  But for now we'll
      just fall back on commit faaae2a5 ("Re-enable CONFIG_MODVERSIONS in
      a slightly weaker form") that just let's a missing crc through.
      Reported-by: default avatarJan Stancek <jstancek@redhat.com>
      Reported-by: default avatarPhilip Müller <philm@manjaro.org>
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f27c2f69
    • Linus Torvalds's avatar
      Don't feed anything but regular iovec's to blk_rq_map_user_iov · a0ac402c
      Linus Torvalds authored
      In theory we could map other things, but there's a reason that function
      is called "user_iov".  Using anything else (like splice can do) just
      confuses it.
      Reported-and-tested-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a0ac402c
    • Alex Deucher's avatar
      drm/amdgpu: just suspend the hw on pci shutdown · faefba95
      Alex Deucher authored
      We can't just reuse pci_remove as there may be userspace still
      doing things.
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98638
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97980Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Reported-and-tested-by: default avatarMike Lothian <mike@fireburn.co.uk>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      faefba95
    • John David Anglin's avatar
      parisc: Remove unnecessary TLB purges from flush_dcache_page_asm and flush_icache_page_asm · febe4296
      John David Anglin authored
      We have four routines in pacache.S that use temporary alias pages:
      copy_user_page_asm(), clear_user_page_asm(), flush_dcache_page_asm() and
      flush_icache_page_asm().  copy_user_page_asm() and clear_user_page_asm()
      don't purge the TLB entry used for the operation.
      flush_dcache_page_asm() and flush_icache_page_asm do purge the entry.
      
      Presumably, this was thought to optimize TLB use.  However, the
      operation is quite heavy weight on PA 1.X processors as we need to take
      the TLB lock and a TLB broadcast is sent to all processors.
      
      This patch removes the purges from flush_dcache_page_asm() and
      flush_icache_page_asm.
      Signed-off-by: default avatarJohn David Anglin  <dave.anglin@bell.net>
      Cc: <stable@vger.kernel.org> # v3.16+
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      febe4296
    • John David Anglin's avatar
      parisc: Purge TLB before setting PTE · c78e710c
      John David Anglin authored
      The attached change interchanges the order of purging the TLB and
      setting the corresponding page table entry.  TLB purges are strongly
      ordered.  It occurred to me one night that setting the PTE first might
      have subtle ordering issues on SMP machines and cause random memory
      corruption.
      
      A TLB lock guards the insertion of user TLB entries.  So after the TLB
      is purged, a new entry can't be inserted until the lock is released.
      This ensures that the new PTE value is used when the lock is released.
      
      Since making this change, no random segmentation faults have been
      observed on the Debian hppa buildd servers.
      Signed-off-by: default avatarJohn David Anglin  <dave.anglin@bell.net>
      Cc: <stable@vger.kernel.org> # v3.16+
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      c78e710c
    • Dan Williams's avatar
      device-dax: fix private mapping restriction, permit read-only · 325896ff
      Dan Williams authored
      Hugh notes in response to commit 4cb19355 "device-dax: fail all
      private mapping attempts":
      
        "I think that is more restrictive than you intended: haven't tried, but I
        believe it rejects a PROT_READ, MAP_SHARED, O_RDONLY fd mmap, leaving no
        way to mmap /dev/dax without write permission to it."
      
      Indeed it does restrict read-only mappings, switch to checking
      VM_MAYSHARE, not VM_SHARED.
      
      Cc: <stable@vger.kernel.org>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Pawel Lebioda <pawel.lebioda@intel.com>
      Fixes: 4cb19355 ("device-dax: fail all private mapping attempts")
      Reported-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      325896ff
    • Dan Williams's avatar
      tools/testing/nvdimm: unit test acpi_nfit_ctl() · a7de92da
      Dan Williams authored
      A recent flurry of bug discoveries in the nfit driver's DSM marshalling
      routine has highlighted the fact that we do not have unit test coverage
      for this routine. Add a self-test of acpi_nfit_ctl() routine before
      probing the "nfit_test.0" device. This mocks stimulus to acpi_nfit_ctl()
      and if any of the tests fail "nfit_test.0" will be unavailable causing
      the rest of the tests to not run / fail.
      
      This unit test will also be a place to land reproductions of quirky BIOS
      behavior discovered in the field and ensure the kernel does not regress
      against implementations it has seen in practice.
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      a7de92da
    • Dan Williams's avatar
      acpi, nfit: fix bus vs dimm confusion in xlat_status · d6eb270c
      Dan Williams authored
      Given dimms and bus commands share the same command number space we need
      to be careful that we are translating status in the correct context.
      Otherwise we can, for example, fail an ND_CMD_GET_CONFIG_SIZE command
      because max_xfer is zero. It fails because that condition erroneously
      correlates with the 'cleared == 0' failure of ND_CMD_CLEAR_ERROR.
      
      Cc: <stable@vger.kernel.org>
      Fixes: aef25338 ("libnvdimm, nfit: centralize command status translation")
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      d6eb270c
    • Dan Williams's avatar
      acpi, nfit: validate ars_status output buffer size · 82aa37cf
      Dan Williams authored
      If an ARS Status command returns truncated output, do not process
      partial records or otherwise consume non-status fields.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 0caeef63 ("libnvdimm: Add a poison list and export badblocks")
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      82aa37cf
    • Dan Williams's avatar
      acpi, nfit, libnvdimm: fix / harden ars_status output length handling · efda1b5d
      Dan Williams authored
      Given ambiguities in the ACPI 6.1 definition of the "Output (Size)"
      field of the ARS (Address Range Scrub) Status command, a firmware
      implementation may in practice return 0, 4, or 8 to indicate that there
      is no output payload to process.
      
      The specification states "Size of Output Buffer in bytes, including this
      field.". However, 'Output Buffer' is also the name of the entire
      payload, and earlier in the specification it states "Max Query ARS
      Status Output Buffer Size: Maximum size of buffer (including the Status
      and Extended Status fields)".
      
      Without this fix if the BIOS happens to return 0 it causes memory
      corruption as evidenced by this result from the acpi_nfit_ctl() unit
      test.
      
       ars_status00000000: 00020000 00000000                    ........
       BUG: stack guard page was hit at ffffc90001750000 (stack is ffffc9000174c000..ffffc9000174ffff)
       kernel stack overflow (page fault): 0000 [#1] SMP DEBUG_PAGEALLOC
       task: ffff8803332d2ec0 task.stack: ffffc9000174c000
       RIP: 0010:[<ffffffff814cfe72>]  [<ffffffff814cfe72>] __memcpy+0x12/0x20
       RSP: 0018:ffffc9000174f9a8  EFLAGS: 00010246
       RAX: ffffc9000174fab8 RBX: 0000000000000000 RCX: 000000001fffff56
       RDX: 0000000000000000 RSI: ffff8803231f5a08 RDI: ffffc90001750000
       RBP: ffffc9000174fa88 R08: ffffc9000174fab0 R09: ffff8803231f54b8
       R10: 0000000000000008 R11: 0000000000000001 R12: 0000000000000000
       R13: 0000000000000000 R14: 0000000000000003 R15: ffff8803231f54a0
       FS:  00007f3a611af640(0000) GS:ffff88033ed00000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: ffffc90001750000 CR3: 0000000325b20000 CR4: 00000000000406e0
       Stack:
        ffffffffa00bc60d 0000000000000008 ffffc90000000001 ffffc9000174faac
        0000000000000292 ffffffffa00c24e4 ffffffffa00c2914 0000000000000000
        0000000000000000 ffffffff00000003 ffff880331ae8ad0 0000000800000246
       Call Trace:
        [<ffffffffa00bc60d>] ? acpi_nfit_ctl+0x49d/0x750 [nfit]
        [<ffffffffa01f4fe0>] nfit_test_probe+0x670/0xb1b [nfit_test]
      
      Cc: <stable@vger.kernel.org>
      Fixes: 747ffe11 ("libnvdimm, tools/testing/nvdimm: fix 'ars_status' output buffer sizing")
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      efda1b5d
    • Vishal Verma's avatar
      acpi, nfit: fix extended status translations for ACPI DSMs · 9a901f54
      Vishal Verma authored
      ACPI DSMs can have an 'extended' status which can be non-zero to convey
      additional information about the command. In the xlat_status routine,
      where we translate the command statuses, we were returning an error for
      a non-zero extended status, even if the primary status indicated success.
      
      Return from each command's 'case' once we have verified both its status
      and extend status are good.
      
      Cc: <stable@vger.kernel.org>
      Fixes: 11294d63 ("nfit: fail DSMs that return non-zero status by default")
      Signed-off-by: default avatarVishal Verma <vishal.l.verma@intel.com>
      Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      9a901f54
  4. 06 Dec, 2016 1 commit