1. 27 Mar, 2024 5 commits
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2024-03-27-11-25' of... · dc189b8e
      Linus Torvalds authored
      Merge tag 'mm-hotfixes-stable-2024-03-27-11-25' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
      
      Pull misc fixes from Andrew Morton:
       "Various hotfixes. About half are cc:stable and the remainder address
        post-6.8 issues or aren't considered suitable for backporting.
      
        zswap figures prominently in the post-6.8 issues - folloup against the
        large amount of changes we have just made to that code.
      
        Apart from that, all over the map"
      
      * tag 'mm-hotfixes-stable-2024-03-27-11-25' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (21 commits)
        crash: use macro to add crashk_res into iomem early for specific arch
        mm: zswap: fix data loss on SWP_SYNCHRONOUS_IO devices
        selftests/mm: fix ARM related issue with fork after pthread_create
        hexagon: vmlinux.lds.S: handle attributes section
        userfaultfd: fix deadlock warning when locking src and dst VMAs
        tmpfs: fix race on handling dquot rbtree
        selftests/mm: sigbus-wp test requires UFFD_FEATURE_WP_HUGETLBFS_SHMEM
        mm: zswap: fix writeback shinker GFP_NOIO/GFP_NOFS recursion
        ARM: prctl: reject PR_SET_MDWE on pre-ARMv6
        prctl: generalize PR_SET_MDWE support check to be per-arch
        MAINTAINERS: remove incorrect M: tag for dm-devel@lists.linux.dev
        mm: zswap: fix kernel BUG in sg_init_one
        selftests: mm: restore settings from only parent process
        tools/Makefile: remove cgroup target
        mm: cachestat: fix two shmem bugs
        mm: increase folio batch size
        mm,page_owner: fix recursion
        mailmap: update entry for Leonard Crestez
        init: open /initrd.image with O_LARGEFILE
        selftests/mm: Fix build with _FORTIFY_SOURCE
        ...
      dc189b8e
    • Linus Torvalds's avatar
      Merge tag 'probes-fixes-v6.9-rc1' of... · 96249052
      Linus Torvalds authored
      Merge tag 'probes-fixes-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
      
      Pull probes fixlet from Masami Hiramatsu:
      
       - tracing/probes: initialize a 'val' local variable with zero.
      
         This variable is read by FETCH_OP_ST_EDATA in a loop, and is
         initialized by FETCH_OP_ARG in the same loop. Since this
         initialization is not obvious, smatch warns about it.
      
         Explicitly initializing 'val' with zero fixes this warning.
      
      * tag 'probes-fixes-v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        tracing: probes: Fix to zero initialize a local variable
      96249052
    • Linus Torvalds's avatar
      Merge tag 'execve-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux · f4a43291
      Linus Torvalds authored
      Pull execve fixes from Kees Cook:
      
       - Fix selftests to conform to the TAP output format (Muhammad Usama
         Anjum)
      
       - Fix NOMMU linux_binprm::exec pointer in auxv (Max Filippov)
      
       - Replace deprecated strncpy usage (Justin Stitt)
      
       - Replace another /bin/sh instance in selftests
      
      * tag 'execve-v6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
        binfmt: replace deprecated strncpy
        exec: Fix NOMMU linux_binprm::exec in transfer_args_to_stack()
        selftests/exec: Convert remaining /bin/sh to /bin/bash
        selftests/exec: execveat: Improve debug reporting
        selftests/exec: recursion-depth: conform test to TAP format output
        selftests/exec: load_address: conform test to TAP format output
        selftests/exec: binfmt_script: Add the overall result line according to TAP
      f4a43291
    • Linus Torvalds's avatar
      Fix build errors due to new UIO_MEM_DMA_COHERENT mess · 498e47cd
      Linus Torvalds authored
      Commit 576882ef ("uio: introduce UIO_MEM_DMA_COHERENT type")
      introduced a new use-case for 'struct uio_mem' where the 'mem' field now
      contains a kernel virtual address when 'memtype' is set to
      UIO_MEM_DMA_COHERENT.
      
      That in turn causes build errors, because 'mem' is of type
      'phys_addr_t', and a virtual address is a pointer type.  When the code
      just blindly uses cast to mix the two, it caused problems when
      phys_addr_t isn't the same size as a pointer - notably on 32-bit
      architectures with PHYS_ADDR_T_64BIT.
      
      The proper thing to do would probably be to use a union member, and not
      have any casts, and make the 'mem' member be a union of 'mem.physaddr'
      and 'mem.vaddr', based on 'memtype'.
      
      This is not that proper thing.  This is just fixing the ugly casts to be
      even uglier, but at least not cause build errors on 32-bit platforms
      with 64-bit physical addresses.
      Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Fixes: 576882ef ("uio: introduce UIO_MEM_DMA_COHERENT type")
      Fixes: 7722151e ("uio_pruss: UIO_MEM_DMA_COHERENT conversion")
      Fixes: 01994780 ("uio_dmem_genirq: UIO_MEM_DMA_COHERENT conversion")
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Chris Leech <cleech@redhat.com>
      Cc: Nilesh Javali <njavali@marvell.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linuxfoundation.org>
      498e47cd
    • Linus Torvalds's avatar
      Fix memory leak in posix_clock_open() · 5b4cdd9c
      Linus Torvalds authored
      If the clk ops.open() function returns an error, we don't release the
      pccontext we allocated for this clock.
      
      Re-organize the code slightly to make it all more obvious.
      Reported-by: default avatarRohit Keshri <rkeshri@redhat.com>
      Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
      Fixes: 60c69466 ("posix-clock: introduce posix_clock_context concept")
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linuxfoundation.org>
      5b4cdd9c
  2. 26 Mar, 2024 23 commits
  3. 25 Mar, 2024 4 commits
  4. 24 Mar, 2024 8 commits
    • Linus Torvalds's avatar
      Linux 6.9-rc1 · 4cece764
      Linus Torvalds authored
      4cece764
    • Linus Torvalds's avatar
      Merge tag 'efi-fixes-for-v6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi · ab8de2db
      Linus Torvalds authored
      Pull EFI fixes from Ard Biesheuvel:
      
       - Fix logic that is supposed to prevent placement of the kernel image
         below LOAD_PHYSICAL_ADDR
      
       - Use the firmware stack in the EFI stub when running in mixed mode
      
       - Clear BSS only once when using mixed mode
      
       - Check efi.get_variable() function pointer for NULL before trying to
         call it
      
      * tag 'efi-fixes-for-v6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
        efi: fix panic in kdump kernel
        x86/efistub: Don't clear BSS twice in mixed mode
        x86/efistub: Call mixed mode boot services on the firmware's stack
        efi/libstub: fix efi_random_alloc() to allocate memory at alloc_min or higher address
      ab8de2db
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2024-03-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 5e74df2f
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
      
       - Ensure that the encryption mask at boot is properly propagated on
         5-level page tables, otherwise the PGD entry is incorrectly set to
         non-encrypted, which causes system crashes during boot.
      
       - Undo the deferred 5-level page table setup as it cannot work with
         memory encryption enabled.
      
       - Prevent inconsistent XFD state on CPU hotplug, where the MSR is reset
         to the default value but the cached variable is not, so subsequent
         comparisons might yield the wrong result and as a consequence the
         result prevents updating the MSR.
      
       - Register the local APIC address only once in the MPPARSE enumeration
         to prevent triggering the related WARN_ONs() in the APIC and topology
         code.
      
       - Handle the case where no APIC is found gracefully by registering a
         fake APIC in the topology code. That makes all related topology
         functions work correctly and does not affect the actual APIC driver
         code at all.
      
       - Don't evaluate logical IDs during early boot as the local APIC IDs
         are not yet enumerated and the invoked function returns an error
         code. Nothing requires the logical IDs before the final CPUID
         enumeration takes place, which happens after the enumeration.
      
       - Cure the fallout of the per CPU rework on UP which misplaced the
         copying of boot_cpu_data to per CPU data so that the final update to
         boot_cpu_data got lost which caused inconsistent state and boot
         crashes.
      
       - Use copy_from_kernel_nofault() in the kprobes setup as there is no
         guarantee that the address can be safely accessed.
      
       - Reorder struct members in struct saved_context to work around another
         kmemleak false positive
      
       - Remove the buggy code which tries to update the E820 kexec table for
         setup_data as that is never passed to the kexec kernel.
      
       - Update the resource control documentation to use the proper units.
      
       - Fix a Kconfig warning observed with tinyconfig
      
      * tag 'x86-urgent-2024-03-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/boot/64: Move 5-level paging global variable assignments back
        x86/boot/64: Apply encryption mask to 5-level pagetable update
        x86/cpu: Add model number for another Intel Arrow Lake mobile processor
        x86/fpu: Keep xfd_state in sync with MSR_IA32_XFD
        Documentation/x86: Document that resctrl bandwidth control units are MiB
        x86/mpparse: Register APIC address only once
        x86/topology: Handle the !APIC case gracefully
        x86/topology: Don't evaluate logical IDs during early boot
        x86/cpu: Ensure that CPU info updates are propagated on UP
        kprobes/x86: Use copy_from_kernel_nofault() to read from unsafe address
        x86/pm: Work around false positive kmemleak report in msr_build_context()
        x86/kexec: Do not update E820 kexec table for setup_data
        x86/config: Fix warning for 'make ARCH=x86_64 tinyconfig'
      5e74df2f
    • Linus Torvalds's avatar
      Merge tag 'sched-urgent-2024-03-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · b136f68e
      Linus Torvalds authored
      Pull scheduler doc clarification from Thomas Gleixner:
       "A single update for the documentation of the base_slice_ns tunable to
        clarify that any value which is less than the tick slice has no effect
        because the scheduler tick is not guaranteed to happen within the set
        time slice"
      
      * tag 'sched-urgent-2024-03-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/doc: Update documentation for base_slice_ns and CONFIG_HZ relation
      b136f68e
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-6.9-2024-03-24' of git://git.infradead.org/users/hch/dma-mapping · 864ad046
      Linus Torvalds authored
      Pull dma-mapping fixes from Christoph Hellwig:
       "This has a set of swiotlb alignment fixes for sometimes very long
        standing bugs from Will. We've been discussion them for a while and
        they should be solid now"
      
      * tag 'dma-mapping-6.9-2024-03-24' of git://git.infradead.org/users/hch/dma-mapping:
        swiotlb: Reinstate page-alignment for mappings >= PAGE_SIZE
        iommu/dma: Force swiotlb_max_mapping_size on an untrusted device
        swiotlb: Fix alignment checks when both allocation and DMA masks are present
        swiotlb: Honour dma_alloc_coherent() alignment in swiotlb_alloc()
        swiotlb: Enforce page alignment in swiotlb_alloc()
        swiotlb: Fix double-allocation of slots due to broken alignment handling
      864ad046
    • Oleksandr Tymoshenko's avatar
      efi: fix panic in kdump kernel · 62b71cd7
      Oleksandr Tymoshenko authored
      Check if get_next_variable() is actually valid pointer before
      calling it. In kdump kernel this method is set to NULL that causes
      panic during the kexec-ed kernel boot.
      
      Tested with QEMU and OVMF firmware.
      
      Fixes: bad267f9 ("efi: verify that variable services are supported")
      Signed-off-by: default avatarOleksandr Tymoshenko <ovt@google.com>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      62b71cd7
    • Ard Biesheuvel's avatar
      x86/efistub: Don't clear BSS twice in mixed mode · df7ecce8
      Ard Biesheuvel authored
      Clearing BSS should only be done once, at the very beginning.
      efi_pe_entry() is the entrypoint from the firmware, which may not clear
      BSS and so it is done explicitly. However, efi_pe_entry() is also used
      as an entrypoint by the mixed mode startup code, in which case BSS will
      already have been cleared, and doing it again at this point will corrupt
      global variables holding the firmware's GDT/IDT and segment selectors.
      
      So make the memset() conditional on whether the EFI stub is running in
      native mode.
      
      Fixes: b3810c5a ("x86/efistub: Clear decompressor BSS in native EFI entrypoint")
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      df7ecce8
    • Ard Biesheuvel's avatar
      x86/efistub: Call mixed mode boot services on the firmware's stack · cefcd4fe
      Ard Biesheuvel authored
      Normally, the EFI stub calls into the EFI boot services using the stack
      that was live when the stub was entered. According to the UEFI spec,
      this stack needs to be at least 128k in size - this might seem large but
      all asynchronous processing and event handling in EFI runs from the same
      stack and so quite a lot of space may be used in practice.
      
      In mixed mode, the situation is a bit different: the bootloader calls
      the 32-bit EFI stub entry point, which calls the decompressor's 32-bit
      entry point, where the boot stack is set up, using a fixed allocation
      of 16k. This stack is still in use when the EFI stub is started in
      64-bit mode, and so all calls back into the EFI firmware will be using
      the decompressor's limited boot stack.
      
      Due to the placement of the boot stack right after the boot heap, any
      stack overruns have gone unnoticed. However, commit
      
        5c4feadb0011983b ("x86/decompressor: Move global symbol references to C code")
      
      moved the definition of the boot heap into C code, and now the boot
      stack is placed right at the base of BSS, where any overruns will
      corrupt the end of the .data section.
      
      While it would be possible to work around this by increasing the size of
      the boot stack, doing so would affect all x86 systems, and mixed mode
      systems are a tiny (and shrinking) fraction of the x86 installed base.
      
      So instead, record the firmware stack pointer value when entering from
      the 32-bit firmware, and switch to this stack every time a EFI boot
      service call is made.
      
      Cc: <stable@kernel.org> # v6.1+
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      cefcd4fe