Skip to content
  1. Jul 29, 2020
  2. Jul 14, 2020
    • Bruce Ashfield's avatar
      Merge tag 'v5.4.51' into v5.4/standard/base · fed60f1c
      Bruce Ashfield authored
      This is the 5.4.51 stable release
      
      # gpg: Signature made Thu 09 Jul 2020 03:37:57 AM EDT
      # gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
      # gpg: Can't check signature: No public key
      fed60f1c
  3. Jul 13, 2020
    • Jun Miao's avatar
      arm64: dts: ti: k3-am65-main: add sd wp-invert into k3-am65 dtb · 953da1f7
      Jun Miao authored
      
      
      Fix a VFS: unable to mount roofs because of SD card is read only.
      The error value(-30) means that the sd card is read only, but in fact the card isn't
      write-protect. We add the wr-inverted into k3-am65-dts to change the return value for
      getting the correct state, so that we can mount the rootfs normally and it works well.
      
      Error log:
      mmcblk1: p1 p2
      md: Waiting for all devices to be available before autodetect
      md: If you don't use raid, use raid=noautodetect
      md: Autodetecting RAID arrays.
      md: autorun ...
      md: ... autorun DONE.
      VFS: Cannot open root device "mmcblk1p2" or unknown-block(179,26): error -30
      Please append a correct "root=" boot option; here are the available partitions:
      0100 4096 ram0
      (driver?)
      0101 4096 ram1
      (driver?)
      0102 4096 ram2
      
      Signed-off-by: default avatarJun Miao <jun.miao@windriver.com>
      Signed-off-by: default avatarBruce Ashfield <bruce.ashfield@gmail.com>
      953da1f7
  4. Jul 09, 2020
    • Greg Kroah-Hartman's avatar
      Linux 5.4.51 · 1c54d3c1
      Greg Kroah-Hartman authored
      v5.4.51
      1c54d3c1
    • Peter Jones's avatar
      efi: Make it possible to disable efivar_ssdt entirely · 8ba1913c
      Peter Jones authored
      commit 435d1a47
      
       upstream.
      
      In most cases, such as CONFIG_ACPI_CUSTOM_DSDT and
      CONFIG_ACPI_TABLE_UPGRADE, boot-time modifications to firmware tables
      are tied to specific Kconfig options.  Currently this is not the case
      for modifying the ACPI SSDT via the efivar_ssdt kernel command line
      option and associated EFI variable.
      
      This patch adds CONFIG_EFI_CUSTOM_SSDT_OVERLAYS, which defaults
      disabled, in order to allow enabling or disabling that feature during
      the build.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarPeter Jones <pjones@redhat.com>
      Link: https://lore.kernel.org/r/20200615202408.2242614-1-pjones@redhat.com
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8ba1913c
    • Hou Tao's avatar
      dm zoned: assign max_io_len correctly · 43986c32
      Hou Tao authored
      commit 7b237748 upstream.
      
      The unit of max_io_len is sector instead of byte (spotted through
      code review), so fix it.
      
      Fixes: 3b1a94c8
      
       ("dm zoned: drive-managed zoned block device target")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
      Reviewed-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      43986c32
    • Babu Moger's avatar
      x86/resctrl: Fix memory bandwidth counter width for AMD · 215e5622
      Babu Moger authored
      commit 2c18bd52 upstream.
      
      Memory bandwidth is calculated reading the monitoring counter
      at two intervals and calculating the delta. It is the software’s
      responsibility to read the count often enough to avoid having
      the count roll over _twice_ between reads.
      
      The current code hardcodes the bandwidth monitoring counter's width
      to 24 bits for AMD. This is due to default base counter width which
      is 24. Currently, AMD does not implement the CPUID 0xF.[ECX=1]:EAX
      to adjust the counter width. But, the AMD hardware supports much
      wider bandwidth counter with the default width of 44 bits.
      
      Kernel reads these monitoring counters every 1 second and adjusts the
      counter value for overflow. With 24 bits and scale value of 64 for AMD,
      it can only measure up to 1GB/s without overflowing. For the rates
      above 1GB/s this will fail to measure the bandwidth.
      
      Fix the issue setting the default width to 44 bits by adjusting the
      offset.
      
      AMD future products will implement CPUID 0xF.[ECX=1]:EAX.
      
       [ bp: Let the line stick out and drop {}-brackets around a single
         statement. ]
      
      Fixes: 4d05bf71
      
       ("x86/resctrl: Introduce AMD QOS feature")
      Signed-off-by: default avatarBabu Moger <babu.moger@amd.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Link: https://lkml.kernel.org/r/159129975546.62538.5656031125604254041.stgit@naples-babu.amd.com
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      
      215e5622
    • Vlastimil Babka's avatar
      mm, compaction: make capture control handling safe wrt interrupts · d827fe70
      Vlastimil Babka authored
      commit b9e20f0d upstream.
      
      Hugh reports:
      
       "While stressing compaction, one run oopsed on NULL capc->cc in
        __free_one_page()'s task_capc(zone): compact_zone_order() had been
        interrupted, and a page was being freed in the return from interrupt.
      
        Though you would not expect it from the source, both gccs I was using
        (4.8.1 and 7.5.0) had chosen to compile compact_zone_order() with the
        ".cc = &cc" implemented by mov %rbx,-0xb0(%rbp) immediately before
        callq compact_zone - long after the "current->capture_control =
        &capc". An interrupt in between those finds capc->cc NULL (zeroed by
        an earlier rep stos).
      
        This could presumably be fixed by a barrier() before setting
        current->capture_control in compact_zone_order(); but would also need
        more care on return from compact_zone(), in order not to risk leaking
        a page captured by interrupt just before capture_control is reset.
      
        Maybe that is the preferable fix, but I felt safer for task_capc() to
        exclude the rather surprising possibility of capture at interrupt
        time"
      
      I have checked that gcc10 also behaves the same.
      
      The advantage of fix in compact_zone_order() is that we don't add
      another test in the page freeing hot path, and that it might prevent
      future problems if we stop exposing pointers to uninitialized structures
      in current task.
      
      So this patch implements the suggestion for compact_zone_order() with
      barrier() (and WRITE_ONCE() to prevent store tearing) for setting
      current->capture_control, and prevents page leaking with
      WRITE_ONCE/READ_ONCE in the proper order.
      
      Link: http://lkml.kernel.org/r/20200616082649.27173-1-vbabka@suse.cz
      Fixes: 5e1f0f09
      
       ("mm, compaction: capture a page under direct compaction")
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Reported-by: default avatarHugh Dickins <hughd@google.com>
      Suggested-by: default avatarHugh Dickins <hughd@google.com>
      Acked-by: default avatarHugh Dickins <hughd@google.com>
      Cc: Alex Shi <alex.shi@linux.alibaba.com>
      Cc: Li Wang <liwang@redhat.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: <stable@vger.kernel.org>	[5.1+]
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d827fe70
    • Vlastimil Babka's avatar
      mm, compaction: fully assume capture is not NULL in compact_zone_order() · 64a94c55
      Vlastimil Babka authored
      commit 6467552c upstream.
      
      Dan reports:
      
      The patch 5e1f0f09: "mm, compaction: capture a page under direct
      compaction" from Mar 5, 2019, leads to the following Smatch complaint:
      
          mm/compaction.c:2321 compact_zone_order()
           error: we previously assumed 'capture' could be null (see line 2313)
      
      mm/compaction.c
        2288  static enum compact_result compact_zone_order(struct zone *zone, int order,
        2289                  gfp_t gfp_mask, enum compact_priority prio,
        2290                  unsigned int alloc_flags, int classzone_idx,
        2291                  struct page **capture)
                                            ^^^^^^^
      
        2313		if (capture)
                          ^^^^^^^
      Check for NULL
      
        2314			current->capture_control = &capc;
        2315
        2316		ret = compact_zone(&cc, &capc);
        2317
        2318		VM_BUG_ON(!list_empty(&cc.freepages));
        2319		VM_BUG_ON(!list_empty(&cc.migratepages));
        2320
        2321		*capture = capc.page;
                      ^^^^^^^^
      Unchecked dereference.
      
        2322		current->capture_control = NULL;
        2323
      
      In practice this is not an issue, as the only caller path passes non-NULL
      capture:
      
      __alloc_pages_direct_compact()
        struct page *page = NULL;
        try_to_compact_pages(capture = &page);
          compact_zone_order(capture = capture);
      
      So let's remove the unnecessary check, which should also make Smatch happy.
      
      Fixes: 5e1f0f09
      
       ("mm, compaction: capture a page under direct compaction")
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Suggested-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Link: http://lkml.kernel.org/r/18b0df3c-0589-d96c-23fa-040798fee187@suse.cz
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      64a94c55
    • Marc Zyngier's avatar
      irqchip/gic: Atomically update affinity · 2a9278ac
      Marc Zyngier authored
      commit 005c34ae upstream.
      
      The GIC driver uses a RMW sequence to update the affinity, and
      relies on the gic_lock_irqsave/gic_unlock_irqrestore sequences
      to update it atomically.
      
      But these sequences only expand into anything meaningful if
      the BL_SWITCHER option is selected, which almost never happens.
      
      It also turns out that using a RMW and locks is just as silly,
      as the GIC distributor supports byte accesses for the GICD_TARGETRn
      registers, which when used make the update atomic by definition.
      
      Drop the terminally broken code and replace it by a byte write.
      
      Fixes: 04c8b0f8
      
       ("irqchip/gic: Make locking a BL_SWITCHER only feature")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2a9278ac
    • Sumit Semwal's avatar
      dma-buf: Move dma_buf_release() from fops to dentry_ops · 7ba23593
      Sumit Semwal authored
      commit 4ab59c3c upstream.
      
      Charan Teja reported a 'use-after-free' in dmabuffs_dname [1], which
      happens if the dma_buf_release() is called while the userspace is
      accessing the dma_buf pseudo fs's dmabuffs_dname() in another process,
      and dma_buf_release() releases the dmabuf object when the last reference
      to the struct file goes away.
      
      I discussed with Arnd Bergmann, and he suggested that rather than tying
      the dma_buf_release() to the file_operations' release(), we can tie it to
      the dentry_operations' d_release(), which will be called when the last ref
      to the dentry is removed.
      
      The path exercised by __fput() calls f_op->release() first, and then calls
      dput, which eventually calls d_op->d_release().
      
      In the 'normal' case, when no userspace access is happening via dma_buf
      pseudo fs, there should be exactly one fd, file, dentry and inode, so
      closing the fd will kill of everything right away.
      
      In the presented case, the dentry's d_release() will be called only when
      the dentry's last ref is released.
      
      Therefore, lets move dma_buf_release() from fops->release() to
      d_ops->d_release()
      
      Many thanks to Arnd for his FS insights :)
      
      [1]: https://lore.kernel.org/patchwork/patch/1238278/
      
      Fixes: bb2bb903
      
       ("dma-buf: add DMA_BUF_SET_NAME ioctls")
      Reported-by: default avatar <syzbot+3643a18836bce555bff6@syzkaller.appspotmail.com>
      Cc: <stable@vger.kernel.org> [5.3+]
      Cc: Arnd Bergmann <arnd@arndb.de>
      Reported-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      Tested-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200611114418.19852-1-sumit.semwal@linaro.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7ba23593
    • Alex Deucher's avatar
      drm/amdgpu/atomfirmware: fix vram_info fetching for renoir · 4ae695a0
      Alex Deucher authored
      commit d7a6634a
      
       upstream.
      
      Renoir uses integrated_system_info table v12.  The table
      has the same layout as v11 with respect to this data.  Just
      reuse the existing code for v12 for stable.
      
      Fixes incorrectly reported vram info in the driver output.
      
      Acked-by: default avatarEvan Quan <evan.quan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4ae695a0