1. 29 May, 2020 11 commits
  2. 28 May, 2020 16 commits
    • Linus Torvalds's avatar
      Merge branch 'akpm' (patches from Andrew) · 75caf310
      Linus Torvalds authored
      Merge misc fixes from Andrew Morton:
       "5 fixes"
      
      * emailed patches from Andrew Morton <akpm@linux-foundation.org>:
        include/asm-generic/topology.h: guard cpumask_of_node() macro argument
        fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info()
        mm: remove VM_BUG_ON(PageSlab()) from page_mapcount()
        mm,thp: stop leaking unreleased file pages
        mm/z3fold: silence kmemleak false positives of slots
      75caf310
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · d16eea2f
      Linus Torvalds authored
      Pull input fixes from Dmitry Torokhov:
       "Just a few random driver fixups"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: synaptics - add a second working PNP_ID for Lenovo T470s
        Input: applespi - replace zero-length array with flexible-array
        Input: axp20x-pek - always register interrupt handlers
        Input: lm8333 - update contact email
        Input: synaptics-rmi4 - fix error return code in rmi_driver_probe()
        Input: synaptics-rmi4 - really fix attn_data use-after-free
        Input: i8042 - add ThinkPad S230u to i8042 reset list
        Revert "Input: i8042 - add ThinkPad S230u to i8042 nomux list"
        Input: dlink-dir685-touchkeys - fix a typo in driver name
        Input: xpad - add custom init packet for Xbox One S controllers
        Input: evdev - call input_flush_device() on release(), not flush()
        Input: i8042 - add ThinkPad S230u to i8042 nomux list
        Input: usbtouchscreen - add support for BonXeon TP
        Input: cros_ec_keyb - use cros_ec_cmd_xfer_status helper
        Input: mms114 - fix handling of mms345l
        Input: elants_i2c - support palm detection
      d16eea2f
    • Linus Torvalds's avatar
      Merge tag 'csky-for-linus-5.7-rc8' of git://github.com/c-sky/csky-linux · 6b5f2590
      Linus Torvalds authored
      Pull csky fixes from Guo Ren:
       "Another four fixes for csky:
      
         - fix req_syscall debug
      
         - fix abiv2 syscall_trace
      
         - fix preempt enable
      
         - clean up regs usage in entry.S"
      
      * tag 'csky-for-linus-5.7-rc8' of git://github.com/c-sky/csky-linux:
        csky: Fixup CONFIG_DEBUG_RSEQ
        csky: Coding convention in entry.S
        csky: Fixup abiv2 syscall_trace break a4 & a5
        csky: Fixup CONFIG_PREEMPT panic
      6b5f2590
    • Jens Axboe's avatar
      Revert "block: end bio with BLK_STS_AGAIN in case of non-mq devs and REQ_NOWAIT" · b0beb280
      Jens Axboe authored
      This reverts commit c58c1f83.
      
      io_uring does do the right thing for this case, and we're still returning
      -EAGAIN to userspace for the cases we don't support. Revert this change
      to avoid doing endless spins of resubmits.
      
      Cc: stable@vger.kernel.org # v5.6
      Reported-by: default avatarBijan Mottahedeh <bijan.mottahedeh@oracle.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b0beb280
    • Arnd Bergmann's avatar
      include/asm-generic/topology.h: guard cpumask_of_node() macro argument · 4377748c
      Arnd Bergmann authored
      drivers/hwmon/amd_energy.c:195:15: error: invalid operands to binary expression ('void' and 'int')
                                              (channel - data->nr_cpus));
                                              ~~~~~~~~~^~~~~~~~~~~~~~~~~
      include/asm-generic/topology.h:51:42: note: expanded from macro 'cpumask_of_node'
          #define cpumask_of_node(node)       ((void)node, cpu_online_mask)
                                                     ^~~~
      include/linux/cpumask.h:618:72: note: expanded from macro 'cpumask_first_and'
       #define cpumask_first_and(src1p, src2p) cpumask_next_and(-1, (src1p), (src2p))
                                                                             ^~~~~
      
      Fixes: f0b848ce ("cpumask: Introduce cpumask_of_{node,pcibus} to replace {node,pcibus}_to_cpumask")
      Fixes: 8abee956 ("hwmon: Add amd_energy driver to report energy counters")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Link: http://lkml.kernel.org/r/20200527134623.930247-1-arnd@arndb.deSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4377748c
    • Alexander Potapenko's avatar
      fs/binfmt_elf.c: allocate initialized memory in fill_thread_core_info() · 1d605416
      Alexander Potapenko authored
      KMSAN reported uninitialized data being written to disk when dumping
      core.  As a result, several kilobytes of kmalloc memory may be written
      to the core file and then read by a non-privileged user.
      Reported-by: default avatarsam <sunhaoyl@outlook.com>
      Signed-off-by: default avatarAlexander Potapenko <glider@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarKees Cook <keescook@chromium.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Alexey Dobriyan <adobriyan@gmail.com>
      Cc: <stable@vger.kernel.org>
      Link: http://lkml.kernel.org/r/20200419100848.63472-1-glider@google.com
      Link: https://github.com/google/kmsan/issues/76Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1d605416
    • Konstantin Khlebnikov's avatar
      mm: remove VM_BUG_ON(PageSlab()) from page_mapcount() · 6988f31d
      Konstantin Khlebnikov authored
      Replace superfluous VM_BUG_ON() with comment about correct usage.
      
      Technically reverts commit 1d148e21 ("mm: add VM_BUG_ON_PAGE() to
      page_mapcount()"), but context lines have changed.
      
      Function isolate_migratepages_block() runs some checks out of lru_lock
      when choose pages for migration.  After checking PageLRU() it checks
      extra page references by comparing page_count() and page_mapcount().
      Between these two checks page could be removed from lru, freed and taken
      by slab.
      
      As a result this race triggers VM_BUG_ON(PageSlab()) in page_mapcount().
      Race window is tiny.  For certain workload this happens around once a
      year.
      
          page:ffffea0105ca9380 count:1 mapcount:0 mapping:ffff88ff7712c180 index:0x0 compound_mapcount: 0
          flags: 0x500000000008100(slab|head)
          raw: 0500000000008100 dead000000000100 dead000000000200 ffff88ff7712c180
          raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000
          page dumped because: VM_BUG_ON_PAGE(PageSlab(page))
          ------------[ cut here ]------------
          kernel BUG at ./include/linux/mm.h:628!
          invalid opcode: 0000 [#1] SMP NOPTI
          CPU: 77 PID: 504 Comm: kcompactd1 Tainted: G        W         4.19.109-27 #1
          Hardware name: Yandex T175-N41-Y3N/MY81-EX0-Y3N, BIOS R05 06/20/2019
          RIP: 0010:isolate_migratepages_block+0x986/0x9b0
      
      The code in isolate_migratepages_block() was added in commit
      119d6d59 ("mm, compaction: avoid isolating pinned pages") before
      adding VM_BUG_ON into page_mapcount().
      
      This race has been predicted in 2015 by Vlastimil Babka (see link
      below).
      
      [akpm@linux-foundation.org: comment tweaks, per Hugh]
      Fixes: 1d148e21 ("mm: add VM_BUG_ON_PAGE() to page_mapcount()")
      Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Cc: David Rientjes <rientjes@google.com>
      Cc: <stable@vger.kernel.org>
      Link: http://lkml.kernel.org/r/159032779896.957378.7852761411265662220.stgit@buzz
      Link: https://lore.kernel.org/lkml/557710E1.6060103@suse.cz/
      Link: https://lore.kernel.org/linux-mm/158937872515.474360.5066096871639561424.stgit@buzz/T/ (v1)
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6988f31d
    • Hugh Dickins's avatar
      mm,thp: stop leaking unreleased file pages · 2f33a706
      Hugh Dickins authored
      When collapse_file() calls try_to_release_page(), it has already isolated
      the page: so if releasing buffers happens to fail (as it sometimes does),
      remember to putback_lru_page(): otherwise that page is left unreclaimable
      and unfreeable, and the file extent uncollapsible.
      
      Fixes: 99cb0dbd ("mm,thp: add read-only THP support for (non-shmem) FS")
      Signed-off-by: default avatarHugh Dickins <hughd@google.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarSong Liu <songliubraving@fb.com>
      Acked-by: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
      Acked-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: <stable@vger.kernel.org>	[5.4+]
      Link: http://lkml.kernel.org/r/alpine.LSU.2.11.2005231837500.1766@eggly.anvilsSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2f33a706
    • Qian Cai's avatar
      mm/z3fold: silence kmemleak false positives of slots · af4798a5
      Qian Cai authored
      Kmemleak reported many leaks while under memory pressue in,
      
          slots = alloc_slots(pool, gfp);
      
      which is referenced by "zhdr" in init_z3fold_page(),
      
          zhdr->slots = slots;
      
      However, "zhdr" could be gone without freeing slots as the later will be
      freed separately when the last "handle" off of "handles" array is freed.
      It will be within "slots" which is always aligned.
      
        unreferenced object 0xc000000fdadc1040 (size 104):
        comm "oom04", pid 140476, jiffies 4295359280 (age 3454.970s)
        hex dump (first 32 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          z3fold_zpool_malloc+0x7b0/0xe10
          alloc_slots at mm/z3fold.c:214
          (inlined by) init_z3fold_page at mm/z3fold.c:412
          (inlined by) z3fold_alloc at mm/z3fold.c:1161
          (inlined by) z3fold_zpool_malloc at mm/z3fold.c:1735
          zpool_malloc+0x34/0x50
          zswap_frontswap_store+0x60c/0xda0
          zswap_frontswap_store at mm/zswap.c:1093
          __frontswap_store+0x128/0x330
          swap_writepage+0x58/0x110
          pageout+0x16c/0xa40
          shrink_page_list+0x1ac8/0x25c0
          shrink_inactive_list+0x270/0x730
          shrink_lruvec+0x444/0xf30
          shrink_node+0x2a4/0x9c0
          do_try_to_free_pages+0x158/0x640
          try_to_free_pages+0x1bc/0x5f0
          __alloc_pages_slowpath.constprop.60+0x4dc/0x15a0
          __alloc_pages_nodemask+0x520/0x650
          alloc_pages_vma+0xc0/0x420
          handle_mm_fault+0x1174/0x1bf0
      Signed-off-by: default avatarQian Cai <cai@lca.pw>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarVitaly Wool <vitaly.wool@konsulko.com>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Link: http://lkml.kernel.org/r/20200522220052.2225-1-cai@lca.pwSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      af4798a5
    • Jens Axboe's avatar
      Merge branch 'nvme-5.7' of git://git.infradead.org/nvme into block-5.7 · 15fede12
      Jens Axboe authored
      Pull NVMe poll fix from Christoph.
      
      * 'nvme-5.7' of git://git.infradead.org/nvme:
        nvme-pci: avoid race between nvme_reap_pending_cqes() and nvme_poll()
      15fede12
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-5.7-2020-05-27' of... · ed52a9b5
      Dave Airlie authored
      Merge tag 'amd-drm-fixes-5.7-2020-05-27' of git://people.freedesktop.org/~agd5f/linux into drm-fixes
      
      amd-drm-fixes-5.7-2020-05-27:
      
      amdgpu:
      - Display atomic test fix
      - Fix soft hang in display vupdate code
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexdeucher@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200527222700.4378-1-alexander.deucher@amd.com
      ed52a9b5
    • Guo Ren's avatar
      csky: Fixup CONFIG_DEBUG_RSEQ · f36e0aab
      Guo Ren authored
      Put the rseq_syscall check point at the prologue of the syscall
      will break the a0 ... a7. This will casue system call bug when
      DEBUG_RSEQ is enabled.
      
      So move it to the epilogue of syscall, but before syscall_trace.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      f36e0aab
    • Guo Ren's avatar
      csky: Coding convention in entry.S · 20f69538
      Guo Ren authored
      There is no fixup or feature in the patch, we only cleanup with:
      
       - Remove unnecessary reg used (r11, r12), just use r9 & r10 &
         syscallid regs as temp useage.
       - Add _TIF_SYSCALL_WORK and _TIF_WORK_MASK to gather macros.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      20f69538
    • Guo Ren's avatar
      csky: Fixup abiv2 syscall_trace break a4 & a5 · e0bbb538
      Guo Ren authored
      Current implementation could destory a4 & a5 when strace, so we need to get them
      from pt_regs by SAVE_ALL.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      e0bbb538
    • Guo Ren's avatar
      csky: Fixup CONFIG_PREEMPT panic · 90089759
      Guo Ren authored
      log:
      [    0.13373200] Calibrating delay loop...
      [    0.14077600] ------------[ cut here ]------------
      [    0.14116700] WARNING: CPU: 0 PID: 0 at kernel/sched/core.c:3790 preempt_count_add+0xc8/0x11c
      [    0.14348000] DEBUG_LOCKS_WARN_ON((preempt_count() < 0))Modules linked in:
      [    0.14395100] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.6.0 #7
      [    0.14410800]
      [    0.14427400] Call Trace:
      [    0.14450700] [<807cd226>] dump_stack+0x8a/0xe4
      [    0.14473500] [<80072792>] __warn+0x10e/0x15c
      [    0.14495900] [<80072852>] warn_slowpath_fmt+0x72/0xc0
      [    0.14518600] [<800a5240>] preempt_count_add+0xc8/0x11c
      [    0.14544900] [<807ef918>] _raw_spin_lock+0x28/0x68
      [    0.14572600] [<800e0eb8>] vprintk_emit+0x84/0x2d8
      [    0.14599000] [<800e113a>] vprintk_default+0x2e/0x44
      [    0.14625100] [<800e2042>] vprintk_func+0x12a/0x1d0
      [    0.14651300] [<800e1804>] printk+0x30/0x48
      [    0.14677600] [<80008052>] lockdep_init+0x12/0xb0
      [    0.14703800] [<80002080>] start_kernel+0x558/0x7f8
      [    0.14730000] [<800052bc>] csky_start+0x58/0x94
      [    0.14756600] irq event stamp: 34
      [    0.14775100] hardirqs last  enabled at (33): [<80067370>] ret_from_exception+0x2c/0x72
      [    0.14793700] hardirqs last disabled at (34): [<800e0eae>] vprintk_emit+0x7a/0x2d8
      [    0.14812300] softirqs last  enabled at (32): [<800655b0>] __do_softirq+0x578/0x6d8
      [    0.14830800] softirqs last disabled at (25): [<8007b3b8>] irq_exit+0xec/0x128
      
      The preempt_count of reg could be destroyed after csky_do_IRQ without reload
      from memory.
      
      After reference to other architectures (arm64, riscv), we move preempt entry
      into ret_from_exception and disable irq at the beginning of
      ret_from_exception instead of RESTORE_ALL.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Reported-by: default avatarLu Baoquan <lu.baoquan@intellif.com>
      90089759
    • Valentine Fatiev's avatar
      IB/ipoib: Fix double free of skb in case of multicast traffic in CM mode · 1acba6a8
      Valentine Fatiev authored
      When connected mode is set, and we have connected and datagram traffic in
      parallel, ipoib might crash with double free of datagram skb.
      
      The current mechanism assumes that the order in the completion queue is
      the same as the order of sent packets for all QPs. Order is kept only for
      specific QP, in case of mixed UD and CM traffic we have few QPs (one UD and
      few CM's) in parallel.
      
      The problem:
      ----------------------------------------------------------
      
      Transmit queue:
      -----------------
      UD skb pointer kept in queue itself, CM skb kept in spearate queue and
      uses transmit queue as a placeholder to count the number of total
      transmitted packets.
      
      0   1   2   3   4  5  6  7  8   9  10  11 12 13 .........127
      ------------------------------------------------------------
      NL ud1 UD2 CM1 ud3 cm2 cm3 ud4 cm4 ud5 NL NL NL ...........
      ------------------------------------------------------------
          ^                                  ^
         tail                               head
      
      Completion queue (problematic scenario) - the order not the same as in
      the transmit queue:
      
        1  2  3  4  5  6  7  8  9
      ------------------------------------
       ud1 CM1 UD2 ud3 cm2 cm3 ud4 cm4 ud5
      ------------------------------------
      
      1. CM1 'wc' processing
         - skb freed in cm separate ring.
         - tx_tail of transmit queue increased although UD2 is not freed.
           Now driver assumes UD2 index is already freed and it could be used for
           new transmitted skb.
      
      0   1   2   3   4  5  6  7  8   9  10  11 12 13 .........127
      ------------------------------------------------------------
      NL NL  UD2 CM1 ud3 cm2 cm3 ud4 cm4 ud5 NL NL NL ...........
      ------------------------------------------------------------
              ^   ^                       ^
            (Bad)tail                    head
      (Bad - Could be used for new SKB)
      
      In this case (due to heavy load) UD2 skb pointer could be replaced by new
      transmitted packet UD_NEW, as the driver assumes its free.  At this point
      we will have to process two 'wc' with same index but we have only one
      pointer to free.
      
      During second attempt to free the same skb we will have NULL pointer
      exception.
      
      2. UD2 'wc' processing
         - skb freed according the index we got from 'wc', but it was already
           overwritten by mistake. So actually the skb that was released is the
           skb of the new transmitted packet and not the original one.
      
      3. UD_NEW 'wc' processing
         - attempt to free already freed skb. NUll pointer exception.
      
      The fix:
      -----------------------------------------------------------------------
      
      The fix is to stop using the UD ring as a placeholder for CM packets, the
      cyclic ring variables tx_head and tx_tail will manage the UD tx_ring, a
      new cyclic variables global_tx_head and global_tx_tail are introduced for
      managing and counting the overall outstanding sent packets, then the send
      queue will be stopped and waken based on these variables only.
      
      Note that no locking is needed since global_tx_head is updated in the xmit
      flow and global_tx_tail is updated in the NAPI flow only.  A previous
      attempt tried to use one variable to count the outstanding sent packets,
      but it did not work since xmit and NAPI flows can run at the same time and
      the counter will be updated wrongly. Thus, we use the same simple cyclic
      head and tail scheme that we have today for the UD tx_ring.
      
      Fixes: 2c104ea6 ("IB/ipoib: Get rid of the tx_outstanding variable in all modes")
      Link: https://lore.kernel.org/r/20200527134705.480068-1-leon@kernel.orgSigned-off-by: default avatarValentine Fatiev <valentinef@mellanox.com>
      Signed-off-by: default avatarAlaa Hleihel <alaa@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Acked-by: default avatarDoug Ledford <dledford@redhat.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      1acba6a8
  3. 27 May, 2020 13 commits
    • Aric Cyr's avatar
      drm/amd/display: Fix potential integer wraparound resulting in a hang · 4e518320
      Aric Cyr authored
      [Why]
      If VUPDATE_END is before VUPDATE_START the delay calculated can become
      very large, causing a soft hang.
      
      [How]
      Take the absolute value of the difference between START and END.
      Signed-off-by: default avatarAric Cyr <aric.cyr@amd.com>
      Reviewed-by: default avatarNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
      Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      4e518320
    • Simon Ser's avatar
      drm/amd/display: drop cursor position check in atomic test · f7d5991b
      Simon Ser authored
      get_cursor_position already handles the case where the cursor has
      negative off-screen coordinates by not setting
      dc_cursor_position.enabled.
      Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
      Fixes: 626bf90f ("drm/amd/display: add basic atomic check for cursor plane")
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      f7d5991b
    • Dongli Zhang's avatar
      nvme-pci: avoid race between nvme_reap_pending_cqes() and nvme_poll() · 9210c075
      Dongli Zhang authored
      There may be a race between nvme_reap_pending_cqes() and nvme_poll(), e.g.,
      when doing live reset while polling the nvme device.
      
            CPU X                        CPU Y
                                     nvme_poll()
      nvme_dev_disable()
      -> nvme_stop_queues()
      -> nvme_suspend_io_queues()
      -> nvme_suspend_queue()
                                     -> spin_lock(&nvmeq->cq_poll_lock);
      -> nvme_reap_pending_cqes()
         -> nvme_process_cq()        -> nvme_process_cq()
      
      In the above scenario, the nvme_process_cq() for the same queue may be
      running on both CPU X and CPU Y concurrently.
      
      It is much more easier to reproduce the issue when CONFIG_PREEMPT is
      enabled in kernel. When CONFIG_PREEMPT is disabled, it would take longer
      time for nvme_stop_queues()-->blk_mq_quiesce_queue() to wait for grace
      period.
      
      This patch protects nvme_process_cq() with nvmeq->cq_poll_lock in
      nvme_reap_pending_cqes().
      
      Fixes: fa46c6fb ("nvme/pci: move cqe check after device shutdown")
      Signed-off-by: default avatarDongli Zhang <dongli.zhang@oracle.com>
      Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
      Reviewed-by: default avatarKeith Busch <kbusch@kernel.org>
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      9210c075
    • Linus Torvalds's avatar
      Merge tag 'fsnotify_for_v5.7-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · b0c3ba31
      Linus Torvalds authored
      Pull fanotify FAN_DIR_MODIFY disabling from Jan Kara:
       "A single patch that disables FAN_DIR_MODIFY support that was merged in
        this merge window.
      
        When discussing further functionality we realized it may be more
        logical to guard it with a feature flag or to call things slightly
        differently (or maybe not) so let's not set the API in stone for now."
      
      * tag 'fsnotify_for_v5.7-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        fanotify: turn off support for FAN_DIR_MODIFY
      b0c3ba31
    • Linus Torvalds's avatar
      Merge branch 'for-5.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · 3301f6ae
      Linus Torvalds authored
      Pull cgroup fixes from Tejun Heo:
      
       - Reverted stricter synchronization for cgroup recursive stats which
         was prepping it for event counter usage which never got merged. The
         change was causing performation regressions in some cases.
      
       - Restore bpf-based device-cgroup operation even when cgroup1 device
         cgroup is disabled.
      
       - An out-param init fix.
      
      * 'for-5.7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        device_cgroup: Cleanup cgroup eBPF device filter code
        xattr: fix uninitialized out-param
        Revert "cgroup: Add memory barriers to plug cgroup_rstat_updated() race window"
      3301f6ae
    • Jason Gunthorpe's avatar
      RDMA/core: Fix double destruction of uobject · c85f4abe
      Jason Gunthorpe authored
      Fix use after free when user user space request uobject concurrently for
      the same object, within the RCU grace period.
      
      In that case, remove_handle_idr_uobject() is called twice and we will have
      an extra put on the uobject which cause use after free.  Fix it by leaving
      the uobject write locked after it was removed from the idr.
      
      Call to rdma_lookup_put_uobject with UVERBS_LOOKUP_DESTROY instead of
      UVERBS_LOOKUP_WRITE will do the work.
      
        refcount_t: underflow; use-after-free.
        WARNING: CPU: 0 PID: 1381 at lib/refcount.c:28 refcount_warn_saturate+0xfe/0x1a0
        Kernel panic - not syncing: panic_on_warn set ...
        CPU: 0 PID: 1381 Comm: syz-executor.0 Not tainted 5.5.0-rc3 #8
        Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014
        Call Trace:
         dump_stack+0x94/0xce
         panic+0x234/0x56f
         __warn+0x1cc/0x1e1
         report_bug+0x200/0x310
         fixup_bug.part.11+0x32/0x80
         do_error_trap+0xd3/0x100
         do_invalid_op+0x31/0x40
         invalid_op+0x1e/0x30
        RIP: 0010:refcount_warn_saturate+0xfe/0x1a0
        Code: 0f 0b eb 9b e8 23 f6 6d ff 80 3d 6c d4 19 03 00 75 8d e8 15 f6 6d ff 48 c7 c7 c0 02 55 bd c6 05 57 d4 19 03 01 e8 a2 58 49 ff <0f> 0b e9 6e ff ff ff e8 f6 f5 6d ff 80 3d 42 d4 19 03 00 0f 85 5c
        RSP: 0018:ffffc90002df7b98 EFLAGS: 00010282
        RAX: 0000000000000000 RBX: ffff88810f6a193c RCX: ffffffffba649009
        RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88811b0283cc
        RBP: 0000000000000003 R08: ffffed10236060e3 R09: ffffed10236060e3
        R10: 0000000000000001 R11: ffffed10236060e2 R12: ffff88810f6a193c
        R13: ffffc90002df7d60 R14: 0000000000000000 R15: ffff888116ae6a08
         uverbs_uobject_put+0xfd/0x140
         __uobj_perform_destroy+0x3d/0x60
         ib_uverbs_close_xrcd+0x148/0x170
         ib_uverbs_write+0xaa5/0xdf0
         __vfs_write+0x7c/0x100
         vfs_write+0x168/0x4a0
         ksys_write+0xc8/0x200
         do_syscall_64+0x9c/0x390
         entry_SYSCALL_64_after_hwframe+0x44/0xa9
        RIP: 0033:0x465b49
        Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
        RSP: 002b:00007f759d122c58 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
        RAX: ffffffffffffffda RBX: 000000000073bfa8 RCX: 0000000000465b49
        RDX: 000000000000000c RSI: 0000000020000080 RDI: 0000000000000003
        RBP: 0000000000000003 R08: 0000000000000000 R09: 0000000000000000
        R10: 0000000000000000 R11: 0000000000000246 R12: 00007f759d1236bc
        R13: 00000000004ca27c R14: 000000000070de40 R15: 00000000ffffffff
        Dumping ftrace buffer:
           (ftrace buffer empty)
        Kernel Offset: 0x39400000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
      
      Fixes: 7452a3c7 ("IB/uverbs: Allow RDMA_REMOVE_DESTROY to work concurrently with disassociate")
      Link: https://lore.kernel.org/r/20200527135534.482279-1-leon@kernel.orgSigned-off-by: default avatarMaor Gottlieb <maorg@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
      c85f4abe
    • Amir Goldstein's avatar
      fanotify: turn off support for FAN_DIR_MODIFY · f1793699
      Amir Goldstein authored
      FAN_DIR_MODIFY has been enabled by commit 44d705b0 ("fanotify:
      report name info for FAN_DIR_MODIFY event") in 5.7-rc1. Now we are
      planning further extensions to the fanotify API and during that we
      realized that FAN_DIR_MODIFY may behave slightly differently to be more
      consistent with extensions we plan. So until we finalize these
      extensions, let's not bind our hands with exposing FAN_DIR_MODIFY to
      userland.
      Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      f1793699
    • Linus Torvalds's avatar
      Merge branch 'exec-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace · 006f38a1
      Linus Torvalds authored
      Pull execve fix from Eric Biederman:
       "While working on my exec cleanups I found a bug in exec that winds up
        miscomputing the ambient credentials during exec. Andy appears to have
        to been confused as to why credentials are computed for both the
        script and the interpreter
      
        From the original patch description:
      
         [3] Linux very confusingly processes both the script and the
             interpreter if applicable, for reasons that elude me. The results
             from thinking about a script's file capabilities and/or setuid
             bits are mostly discarded.
      
        The only value in struct cred that gets changed in cap_bprm_set_creds
        that I could find that might persist between the script and the
        interpreter was cap_ambient. Which is fixed with this trivial change"
      
      * 'exec-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        exec: Always set cap_ambient in cap_bprm_set_creds
      006f38a1
    • Krzysztof Kozlowski's avatar
      x86: Hide the archdata.iommu field behind generic IOMMU_API · ed3119e4
      Krzysztof Kozlowski authored
      There is a generic, kernel wide configuration symbol for enabling the
      IOMMU specific bits: CONFIG_IOMMU_API.  Implementations (including
      INTEL_IOMMU and AMD_IOMMU driver) select it so use it here as well.
      
      This makes the conditional archdata.iommu field consistent with other
      platforms and also fixes any compile test builds of other IOMMU drivers,
      when INTEL_IOMMU or AMD_IOMMU are not selected).
      
      For the case when INTEL_IOMMU/AMD_IOMMU and COMPILE_TEST are not
      selected, this should create functionally equivalent code/choice.  With
      COMPILE_TEST this field could appear if other IOMMU drivers are chosen
      but neither INTEL_IOMMU nor AMD_IOMMU are not.
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Fixes: e93a1695 ("iommu: Enable compile testing for some of drivers")
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Acked-by: default avatarBorislav Petkov <bp@suse.de>
      Link: https://lore.kernel.org/r/20200518120855.27822-2-krzk@kernel.orgSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      ed3119e4
    • Krzysztof Kozlowski's avatar
      ia64: Hide the archdata.iommu field behind generic IOMMU_API · e18a8c10
      Krzysztof Kozlowski authored
      There is a generic, kernel wide configuration symbol for enabling the
      IOMMU specific bits: CONFIG_IOMMU_API.  Implementations (including
      INTEL_IOMMU driver) select it so use it here as well.
      
      This makes the conditional archdata.iommu field consistent with other
      platforms and also fixes any compile test builds of other IOMMU drivers,
      when INTEL_IOMMU is not selected).
      
      For the case when INTEL_IOMMU and COMPILE_TEST are not selected, this
      should create functionally equivalent code/choice.  With COMPILE_TEST
      this field could appear if other IOMMU drivers are chosen but
      INTEL_IOMMU not.
      Reported-by: default avatarkbuild test robot <lkp@intel.com>
      Fixes: e93a1695 ("iommu: Enable compile testing for some of drivers")
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      
      Link: https://lore.kernel.org/r/20200518120855.27822-1-krzk@kernel.orgSigned-off-by: default avatarJoerg Roedel <jroedel@suse.de>
      e18a8c10
    • Kailang Yang's avatar
      ALSA: hda/realtek - Add new codec supported for ALC287 · 630e3612
      Kailang Yang authored
      Enable new codec supported for ALC287.
      Signed-off-by: default avatarKailang Yang <kailang@realtek.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/dcf5ce5507104d0589a917cbb71dc3c6@realtek.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      630e3612
    • Dennis Kadioglu's avatar
      Input: synaptics - add a second working PNP_ID for Lenovo T470s · 642aa86e
      Dennis Kadioglu authored
      The Lenovo Thinkpad T470s I own has a different touchpad with "LEN007a"
      instead of the already included PNP ID "LEN006c". However, my touchpad
      seems to work well without any problems using RMI. So this patch adds the
      other PNP ID.
      Signed-off-by: default avatarDennis Kadioglu <denk@eclipso.email>
      Link: https://lore.kernel.org/r/ff770543cd53ae818363c0fe86477965@mail.eclipso.deSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      642aa86e
    • Takashi Iwai's avatar
      ALSA: usb-audio: Quirks for Gigabyte TRX40 Aorus Master onboard audio · 7f5ad9c9
      Takashi Iwai authored
      Gigabyte TRX40 Aorus Master is equipped with two USB-audio devices,
      a Realtek ALC1220-VB codec (USB ID 0414:a001) and an ESS SABRE9218 DAC
      (USB ID 0414:a000).  The latter serves solely for the headphone output
      on the front panel while the former serves for the rest I/Os (mostly
      for the I/Os in the rear panel but also including the front mic).
      
      Both chips do work more or less with the unmodified USB-audio driver,
      but there are a few glitches.  The ALC1220-VB returns an error for an
      inquiry to some jacks, as already seen on other TRX40-based mobos.
      However this machine has a slightly incompatible configuration, hence
      the existing mapping cannot be used as is.
      
      Meanwhile the ESS chip seems working without any quirk.  But since
      both audio devices don't provide any specific names, both cards appear
      as "USB-Audio", and it's quite confusing for users.
      
      This patch is an attempt to overcome those issues:
      
      - The specific mapping table for ALC1220-VB is provided, reducing the
        non-working nodes and renaming the badly chosen controls.
        The connector map isn't needed here unlike other TRX40 quirks.
      
      - For both USB IDs (0414:a000 and 0414:a001), provide specific card
        name strings, so that user-space can identify more easily; and more
        importantly, UCM profile can be applied to each.
      Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200526082810.29506-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      7f5ad9c9