Skip to content
  1. Aug 06, 2023
  2. Aug 05, 2023
    • Linus Torvalds's avatar
      Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · c9d26d8d
      Linus Torvalds authored
      Pull clk fixes from Stephen Boyd:
       "A few clk driver fixes for some SoC clk drivers:
      
         - Change a usleep() to udelay() to avoid scheduling while atomic in
           the Amlogic PLL code
      
         - Revert a patch to the Mediatek MT8183 driver that caused an
           out-of-bounds write
      
         - Return the right error value when devm_of_iomap() fails in
           imx93_clocks_probe()
      
         - Constrain the Kconfig for the fixed mmio clk so that it depends on
           HAS_IOMEM and can't be compiled on architectures such as s390"
      
      * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: fixed-mmio: make COMMON_CLK_FIXED_MMIO depend on HAS_IOMEM
        clk: imx93: Propagate correct error in imx93_clocks_probe()
        clk: mediatek: mt8183: Add back SSPM related clocks
        clk: meson: change usleep_range() to udelay() for atomic context
      c9d26d8d
    • Linus Torvalds's avatar
      Merge tag 'hyperv-fixes-signed-20230804' of... · 024ff300
      Linus Torvalds authored
      Merge tag 'hyperv-fixes-signed-20230804' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
      
      Pull hyperv fixes from Wei Liu:
      
       - Fix a bug in a python script for Hyper-V (Ani Sinha)
      
       - Workaround a bug in Hyper-V when IBT is enabled (Michael Kelley)
      
       - Fix an issue parsing MP table when Linux runs in VTL2 (Saurabh
         Sengar)
      
       - Several cleanup patches (Nischala Yelchuri, Kameron Carr, YueHaibing,
         ZhiHu)
      
      * tag 'hyperv-fixes-signed-20230804' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
        Drivers: hv: vmbus: Remove unused extern declaration vmbus_ontimer()
        x86/hyperv: add noop functions to x86_init mpparse functions
        vmbus_testing: fix wrong python syntax for integer value comparison
        x86/hyperv: fix a warning in mshyperv.h
        x86/hyperv: Disable IBT when hypercall page lacks ENDBR instruction
        x86/hyperv: Improve code for referencing hyperv_pcpu_input_arg
        Drivers: hv: Change hv_free_hyperv_page() to take void * argument
      024ff300
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · e661f98c
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - A pair of fixes for build-related failures in the selftests
      
       - A fix for a sparse warning in acpi_os_ioremap()
      
       - A fix to restore the kernel PA offset in vmcoreinfo, to fix crash
         handling
      
      * tag 'riscv-for-linus-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        Documentation: kdump: Add va_kernel_pa_offset for RISCV64
        riscv: Export va_kernel_pa_offset in vmcoreinfo
        RISC-V: ACPI: Fix acpi_os_ioremap to return iomem address
        selftests: riscv: Fix compilation error with vstate_exec_nolibc.c
        selftests/riscv: fix potential build failure during the "emit_tests" step
      e661f98c
    • Linus Torvalds's avatar
      Merge tag 'pm-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · ea4f142f
      Linus Torvalds authored
      Pull power management fix from Rafael Wysocki:
       "Fix a sparse warning triggered by the TPMI interface recently added to
        the Intel RAPL power capping driver (Zhang Rui)"
      
      * tag 'pm-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        powercap: intel_rapl: Fix a sparse warning in TPMI interface
      ea4f142f
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · e6fda526
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
       "More SVE/SME fixes for ptrace() and for the (potentially future) case
        where SME is implemented in hardware without SVE support"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64/fpsimd: Sync and zero pad FPSIMD state for streaming SVE
        arm64/fpsimd: Sync FPSIMD state with SVE for SME only systems
        arm64/ptrace: Don't enable SVE when setting streaming SVE
        arm64/ptrace: Flush FP state when setting ZT0
        arm64/fpsimd: Clear SME state in the target task when setting the VL
      e6fda526
    • Linus Torvalds's avatar
      Merge tag 'mtd/fixes-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · c8273a25
      Linus Torvalds authored
      Pull mtd fixes from Miquel Raynal:
       "Raw NAND fixes:
         - fsl_upm: Fix an off-by one test in fun_exec_op()
         - Rockchip:
             - Align hwecc vs. raw page helper layouts
             - Fix oobfree offset and description
         - Meson: Fix OOB available bytes for ECC
         - Omap ELM: Fix incorrect type in assignment
      
        SPI-NOR fix:
         - Avoid holes in struct spi_mem_op
      
        Hyperbus fix:
         - Add Tudor as reviewer in MAINTAINERS
      
        SPI-NAND fixes:
         - Winbond and Toshiba: Fix ecc_get_status"
      
      * tag 'mtd/fixes-for-6.5-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
        mtd: rawnand: fsl_upm: Fix an off-by one test in fun_exec_op()
        mtd: spi-nor: avoid holes in struct spi_mem_op
        MAINTAINERS: Add myself as reviewer for HYPERBUS
        mtd: rawnand: rockchip: Align hwecc vs. raw page helper layouts
        mtd: rawnand: rockchip: fix oobfree offset and description
        mtd: rawnand: meson: fix OOB available bytes for ECC
        mtd: rawnand: omap_elm: Fix incorrect type in assignment
        mtd: spinand: winbond: Fix ecc_get_status
        mtd: spinand: toshiba: Fix ecc_get_status
      c8273a25
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2023-08-04' of git://anongit.freedesktop.org/drm/drm · 4142fc67
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Small set of fixes this week, i915 and a few misc ones. I didn't see
        an amd pull so maybe next week it'll have a few more on that driver.
      
        ttm:
         - NULL ptr deref fix
      
        panel:
         - add missing MODULE_DEVICE_TABLE
      
        imx/ipuv3:
         - timing fix
      
        i915:
         - Fix bug in getting msg length in AUX CH registers handler
         - Gen12 AUX invalidation fixes
         - Fix premature release of request's reusable memory"
      
      * tag 'drm-fixes-2023-08-04' of git://anongit.freedesktop.org/drm/drm:
        drm/panel: samsung-s6d7aa0: Add MODULE_DEVICE_TABLE
        drm/i915: Fix premature release of request's reusable memory
        drm/i915/gt: Support aux invalidation on all engines
        drm/i915/gt: Poll aux invalidation register bit on invalidation
        drm/i915/gt: Enable the CCS_FLUSH bit in the pipe control and in the CS
        drm/i915/gt: Rename flags with bit_group_X according to the datasheet
        drm/i915/gt: Ensure memory quiesced before invalidation
        drm/i915: Add the gen12_needs_ccs_aux_inv helper
        drm/i915/gt: Cleanup aux invalidation registers
        drm/i915/gvt: Fix bug in getting msg length in AUX CH registers handler
        drm/imx/ipuv3: Fix front porch adjustment upon hactive aligning
        drm/ttm: check null pointer before accessing when swapping
      4142fc67
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-6.5-rc5' of https://github.com/ceph/ceph-client · 4593f3c2
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "Two patches to improve RBD exclusive lock interaction with
        osd_request_timeout option and another fix to reduce the potential for
        erroneous blocklisting -- this time in CephFS. All going to stable"
      
      * tag 'ceph-for-6.5-rc5' of https://github.com/ceph/ceph-client:
        libceph: fix potential hang in ceph_osdc_notify()
        rbd: prevent busy loop when requesting exclusive lock
        ceph: defer stopping mdsc delayed_work
      4593f3c2
    • Linus Torvalds's avatar
      file: reinstate f_pos locking optimization for regular files · 79796425
      Linus Torvalds authored
      
      
      In commit 20ea1e7d ("file: always lock position for
      FMODE_ATOMIC_POS") we ended up always taking the file pos lock, because
      pidfd_getfd() could get a reference to the file even when it didn't have
      an elevated file count due to threading of other sharing cases.
      
      But Mateusz Guzik reports that the extra locking is actually measurable,
      so let's re-introduce the optimization, and only force the locking for
      directory traversal.
      
      Directories need the lock for correctness reasons, while regular files
      only need it for "POSIX semantics".  Since pidfd_getfd() is about
      debuggers etc special things that are _way_ outside of POSIX, we can
      relax the rules for that case.
      
      Reported-by: default avatarMateusz Guzik <mjguzik@gmail.com>
      Cc: Christian Brauner <brauner@kernel.org>
      Link: https://lore.kernel.org/linux-fsdevel/20230803095311.ijpvhx3fyrbkasul@f/
      
      
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      79796425
  3. Aug 04, 2023
  4. Aug 03, 2023
    • Mark Brown's avatar
      arm64/ptrace: Flush FP state when setting ZT0 · 89a65c3f
      Mark Brown authored
      
      
      When setting ZT0 via ptrace we do not currently force a reload of the
      floating point register state from memory, do that to ensure that the newly
      set value gets loaded into the registers on next task execution.
      
      The function was templated off the function for FPSIMD which due to our
      providing the option of embedding a FPSIMD regset within the SVE regset
      does not directly include the flush.
      
      Fixes: f90b529b ("arm64/sme: Implement ZT0 ptrace support")
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-zt0-flush-v1-1-72e854eaf96e@kernel.org
      
      
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      89a65c3f
    • Mark Brown's avatar
      arm64/fpsimd: Clear SME state in the target task when setting the VL · c9bb40b7
      Mark Brown authored
      
      
      When setting SME vector lengths we clear TIF_SME to reenable SME traps,
      doing a reallocation of the backing storage on next use. We do this using
      clear_thread_flag() which operates on the current thread, meaning that when
      setting the vector length via ptrace we may both not force traps for the
      target task and force a spurious flush of any SME state that the tracing
      task may have.
      
      Clear the flag in the target task.
      
      Fixes: e12310a0 ("arm64/sme: Implement ptrace support for streaming mode SVE registers")
      Reported-by: default avatarDavid Spickett <David.Spickett@arm.com>
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20230803-arm64-fix-ptrace-tif-sme-v1-1-88312fd6fbfd@kernel.org
      
      
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      c9bb40b7
    • hanyu001@208suo.com's avatar
      parisc: unaligned: Add required spaces after ',' · 99b2f159
      hanyu001@208suo.com authored
      
      
      Fix checkpatch warnings:
      unaligned.c:475: ERROR: space required after that ','
      
      Signed-off-by: default avatarYu Han <hanyu001@208suo.com>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      99b2f159
    • Arnd Bergmann's avatar
      parport: gsc: remove DMA leftover code · 2e1b1d70
      Arnd Bergmann authored
      
      
      This driver does not actually work with DMA mode, but still tries
      to call ISA DMA interface functions that are stubbed out on
      parisc, resulting in a W=1 build warning:
      
      drivers/parport/parport_gsc.c: In function 'parport_remove_chip':
      drivers/parport/parport_gsc.c:389:20: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
        389 |    free_dma(p->dma);
      
      Remove the corresponding code as a prerequisite for turning on -Wempty-body
      by default in all kernels.
      
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      2e1b1d70
    • Petr Tesarik's avatar
      parisc: pci-dma: remove unused and dead EISA code and comment · ce9ff57d
      Petr Tesarik authored
      
      
      Clearly, this code isn't needed, but it gives a false positive when
      grepping the complete source tree for coherent_dma_mask.
      
      Signed-off-by: default avatarPetr Tesarik <petr.tesarik.ext@huawei.com>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      ce9ff57d
    • Mike Rapoport (IBM)'s avatar
      parisc/mm: preallocate fixmap page tables at init · c2ff2b73
      Mike Rapoport (IBM) authored
      
      
      Christoph Biedl reported early OOM on recent kernels:
      
          swapper: page allocation failure: order:0, mode:0x100(__GFP_ZERO),
      nodemask=(null)
          CPU: 0 PID: 0 Comm: swapper Not tainted 6.3.0-rc4+ #16
          Hardware name: 9000/785/C3600
          Backtrace:
           [<10408594>] show_stack+0x48/0x5c
           [<10e152d8>] dump_stack_lvl+0x48/0x64
           [<10e15318>] dump_stack+0x24/0x34
           [<105cf7f8>] warn_alloc+0x10c/0x1c8
           [<105d068c>] __alloc_pages+0xbbc/0xcf8
           [<105d0e4c>] __get_free_pages+0x28/0x78
           [<105ad10c>] __pte_alloc_kernel+0x30/0x98
           [<10406934>] set_fixmap+0xec/0xf4
           [<10411ad4>] patch_map.constprop.0+0xa8/0xdc
           [<10411bb0>] __patch_text_multiple+0xa8/0x208
           [<10411d78>] patch_text+0x30/0x48
           [<1041246c>] arch_jump_label_transform+0x90/0xcc
           [<1056f734>] jump_label_update+0xd4/0x184
           [<1056fc9c>] static_key_enable_cpuslocked+0xc0/0x110
           [<1056fd08>] static_key_enable+0x1c/0x2c
           [<1011362c>] init_mem_debugging_and_hardening+0xdc/0xf8
           [<1010141c>] start_kernel+0x5f0/0xa98
           [<10105da8>] start_parisc+0xb8/0xe4
      
          Mem-Info:
          active_anon:0 inactive_anon:0 isolated_anon:0
           active_file:0 inactive_file:0 isolated_file:0
           unevictable:0 dirty:0 writeback:0
           slab_reclaimable:0 slab_unreclaimable:0
           mapped:0 shmem:0 pagetables:0
           sec_pagetables:0 bounce:0
           kernel_misc_reclaimable:0
           free:0 free_pcp:0 free_cma:0
          Node 0 active_anon:0kB inactive_anon:0kB active_file:0kB
      inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB
      mapped:0kB dirty:0kB writeback:0kB shmem:0kB
      +writeback_tmp:0kB kernel_stack:0kB pagetables:0kB sec_pagetables:0kB
      all_unreclaimable? no
          Normal free:0kB boost:0kB min:0kB low:0kB high:0kB
      reserved_highatomic:0KB active_anon:0kB inactive_anon:0kB active_file:0kB
      inactive_file:0kB unevictable:0kB writepending:0kB
      +present:1048576kB managed:1039360kB mlocked:0kB bounce:0kB free_pcp:0kB
      local_pcp:0kB free_cma:0kB
          lowmem_reserve[]: 0 0
          Normal: 0*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB
      0*1024kB 0*2048kB 0*4096kB = 0kB
          0 total pagecache pages
          0 pages in swap cache
          Free swap  = 0kB
          Total swap = 0kB
          262144 pages RAM
          0 pages HighMem/MovableOnly
          2304 pages reserved
          Backtrace:
           [<10411d78>] patch_text+0x30/0x48
           [<1041246c>] arch_jump_label_transform+0x90/0xcc
           [<1056f734>] jump_label_update+0xd4/0x184
           [<1056fc9c>] static_key_enable_cpuslocked+0xc0/0x110
           [<1056fd08>] static_key_enable+0x1c/0x2c
           [<1011362c>] init_mem_debugging_and_hardening+0xdc/0xf8
           [<1010141c>] start_kernel+0x5f0/0xa98
           [<10105da8>] start_parisc+0xb8/0xe4
      
          Kernel Fault: Code=15 (Data TLB miss fault) at addr 0f7fe3c0
          CPU: 0 PID: 0 Comm: swapper Not tainted 6.3.0-rc4+ #16
          Hardware name: 9000/785/C3600
      
      This happens because patching static key code temporarily maps it via
      fixmap and if it happens before page allocator is initialized set_fixmap()
      cannot allocate memory using pte_alloc_kernel().
      
      Make sure that fixmap page tables are preallocated early so that
      pte_offset_kernel() in set_fixmap() never resorts to pte allocation.
      
      Signed-off-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Tested-by: default avatarChristoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>
      Tested-by: default avatarJohn David Anglin <dave.anglin@bell.net>
      Cc: <stable@vger.kernel.org> # v6.4+
      c2ff2b73
    • David Howells's avatar
      udp: Fix __ip_append_data()'s handling of MSG_SPLICE_PAGES · 0f71c9ca
      David Howells authored
      
      
      __ip_append_data() can get into an infinite loop when asked to splice into
      a partially-built UDP message that has more than the frag-limit data and up
      to the MTU limit.  Something like:
      
              pipe(pfd);
              sfd = socket(AF_INET, SOCK_DGRAM, 0);
              connect(sfd, ...);
              send(sfd, buffer, 8161, MSG_CONFIRM|MSG_MORE);
              write(pfd[1], buffer, 8);
              splice(pfd[0], 0, sfd, 0, 0x4ffe0ul, 0);
      
      where the amount of data given to send() is dependent on the MTU size (in
      this instance an interface with an MTU of 8192).
      
      The problem is that the calculation of the amount to copy in
      __ip_append_data() goes negative in two places, and, in the second place,
      this gets subtracted from the length remaining, thereby increasing it.
      
      This happens when pagedlen > 0 (which happens for MSG_ZEROCOPY and
      MSG_SPLICE_PAGES), because the terms in:
      
              copy = datalen - transhdrlen - fraggap - pagedlen;
      
      then mostly cancel when pagedlen is substituted for, leaving just -fraggap.
      This causes:
      
              length -= copy + transhdrlen;
      
      to increase the length to more than the amount of data in msg->msg_iter,
      which causes skb_splice_from_iter() to be unable to fill the request and it
      returns less than 'copied' - which means that length never gets to 0 and we
      never exit the loop.
      
      Fix this by:
      
       (1) Insert a note about the dodgy calculation of 'copy'.
      
       (2) If MSG_SPLICE_PAGES, clear copy if it is negative from the above
           equation, so that 'offset' isn't regressed and 'length' isn't
           increased, which will mean that length and thus copy should match the
           amount left in the iterator.
      
       (3) When handling MSG_SPLICE_PAGES, give a warning and return -EIO if
           we're asked to splice more than is in the iterator.  It might be
           better to not give the warning or even just give a 'short' write.
      
      [!] Note that this ought to also affect MSG_ZEROCOPY, but MSG_ZEROCOPY
      avoids the problem by simply assuming that everything asked for got copied,
      not just the amount that was in the iterator.  This is a potential bug for
      the future.
      
      Fixes: 7ac7c987 ("udp: Convert udp_sendpage() to use MSG_SPLICE_PAGES")
      Reported-by: default avatar <syzbot+f527b971b4bdc8e79f9e@syzkaller.appspotmail.com>
      Link: https://lore.kernel.org/r/000000000000881d0606004541d1@google.com/
      
      
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: David Ahern <dsahern@kernel.org>
      cc: Jens Axboe <axboe@kernel.dk>
      Reviewed-by: default avatarWillem de Bruijn <willemb@google.com>
      Link: https://lore.kernel.org/r/1420063.1690904933@warthog.procyon.org.uk
      
      
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0f71c9ca