1. 09 Dec, 2016 7 commits
  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 3 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · bc3913a5
      Linus Torvalds authored
      Pull sparc fix from David Miller:
       "A use-before-NULL-check from Dan Carpenter"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        dbri: move dereference after check for NULL
      bc3913a5
    • Dan Carpenter's avatar
      dbri: move dereference after check for NULL · 163117e8
      Dan Carpenter authored
      We accidentally introduced a dereference before the NULL check in
      xmit_descs() as part of silencing a GCC warning.
      
      Fixes: 16f46050 ("dbri: Fix compiler warning")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      163117e8
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · da1b466f
      Linus Torvalds authored
      Pull networking fixes from David Miller:
      
       1) When dcbnl_cee_fill() fails to be able to push a new netlink
          attribute, it return 0 instead of an error code. From Pan Bian.
      
       2) Two suffix handling fixes to FIB trie code, from Alexander Duyck.
      
       3) bnxt_hwrm_stat_ctx_alloc() goes through all the trouble of setting
          and maintaining a return code 'rc' but fails to actually return it.
          Also from Pan Bian.
      
       4) ping socket ICMP handler needs to validate ICMP header length, from
          Kees Cook.
      
       5) caif_sktinit_module() has this interesting logic:
      
              int err = sock_register(...);
              if (!err)
                      return err;
              return 0;
      
          Just return sock_register()'s return value directly which is the
          only possible correct thing to do.
      
       6) Two bnx2x driver fixes from Yuval Mintz, return a reasonable
          estimate from get_ringparam() ethtool op when interface is down and
          avoid trying to use UDP port based tunneling on 577xx chips.
      
       7) Fix ep93xx_eth crash on module unload from Florian Fainelli.
      
       8) Missing uapi exports, from Stephen Hemminger.
      
       9) Don't schedule work from sk_destruct(), because the socket will be
          freed upon return from that function. From Herbert Xu.
      
      10) Buggy drivers, of which we know there is at least one, can send a
          huge packet into the TCP stack but forget to set the gso_size in the
          SKB, which causes all kinds of problems.
      
          Correct this when it happens, and emit a one-time warning with the
          device name included so that it can be diagnosed more easily.
      
          From Marcelo Ricardo Leitner.
      
      11) virtio-net does DMA off the stack causes hiccups with VMAP_STACK,
          fix from Andy Lutomirski.
      
      12) Fix fec driver compilation with CONFIG_M5272, from Nikita
          Yushchenko.
      
      13) mlx5 fixes from Kamal Heib, Saeed Mahameed, and Mohamad Haj Yahia.
          (erroneously flushing queues on error, module parameter validation,
          etc)
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (34 commits)
        net/mlx5e: Change the SQ/RQ operational state to positive logic
        net/mlx5e: Don't flush SQ on error
        net/mlx5e: Don't notify HW when filling the edge of ICO SQ
        net/mlx5: Fix query ISSI flow
        net/mlx5: Remove duplicate pci dev name print
        net/mlx5: Verify module parameters
        net: fec: fix compile with CONFIG_M5272
        be2net: Add DEVSEC privilege to SET_HSW_CONFIG command.
        virtio-net: Fix DMA-from-the-stack in virtnet_set_mac_address()
        tcp: warn on bogus MSS and try to amend it
        uapi glibc compat: fix outer guard of net device flags enum
        net: stmmac: clear reset value of snps, wr_osr_lmt/snps, rd_osr_lmt before writing
        netlink: Do not schedule work from sk_destruct
        uapi: export nf_log.h
        uapi: export tc_skbmod.h
        net: ep93xx_eth: Do not crash unloading module
        bnx2x: Prevent tunnel config for 577xx
        bnx2x: Correct ringparam estimate when DOWN
        isdn: hisax: set error code on failure
        net: bnx2x: fix improper return value
        ...
      da1b466f