1. 06 Oct, 2024 5 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 4563243e
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "ARM64:
      
         - Fix pKVM error path on init, making sure we do not change critical
           system registers as we're about to fail
      
         - Make sure that the host's vector length is at capped by a value
           common to all CPUs
      
         - Fix kvm_has_feat*() handling of "negative" features, as the current
           code is pretty broken
      
         - Promote Joey to the status of official reviewer, while James steps
           down -- hopefully only temporarly
      
        x86:
      
         - Fix compilation with KVM_INTEL=KVM_AMD=n
      
         - Fix disabling KVM_X86_QUIRK_SLOT_ZAP_ALL when shadow MMU is in use
      
        Selftests:
      
         - Fix compilation on non-x86 architectures"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        x86/reboot: emergency callbacks are now registered by common KVM code
        KVM: x86: leave kvm.ko out of the build if no vendor module is requested
        KVM: x86/mmu: fix KVM_X86_QUIRK_SLOT_ZAP_ALL for shadow MMU
        KVM: arm64: Fix kvm_has_feat*() handling of negative features
        KVM: selftests: Fix build on architectures other than x86_64
        KVM: arm64: Another reviewer reshuffle
        KVM: arm64: Constrain the host to the maximum shared SVE VL with pKVM
        KVM: arm64: Fix __pkvm_init_vcpu cptr_el2 error path
      4563243e
    • Linus Torvalds's avatar
      Merge tag 'powerpc-6.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · b3ce5c30
      Linus Torvalds authored
      Pull powerpc fix from Michael Ellerman:
      
       - Allow r30 to be used in vDSO code generation of getrandom
      
      Thanks to Jason A. Donenfeld
      
      * tag 'powerpc-6.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/vdso: allow r30 in vDSO code generation of getrandom
      b3ce5c30
    • Paolo Bonzini's avatar
      Merge tag 'kvmarm-fixes-6.12-1' of... · c8d430db
      Paolo Bonzini authored
      Merge tag 'kvmarm-fixes-6.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
      
      KVM/arm64 fixes for 6.12, take #1
      
      - Fix pKVM error path on init, making sure we do not change critical
        system registers as we're about to fail
      
      - Make sure that the host's vector length is at capped by a value
        common to all CPUs
      
      - Fix kvm_has_feat*() handling of "negative" features, as the current
        code is pretty broken
      
      - Promote Joey to the status of official reviewer, while James steps
        down -- hopefully only temporarly
      c8d430db
    • Paolo Bonzini's avatar
      x86/reboot: emergency callbacks are now registered by common KVM code · 2a5fe5a0
      Paolo Bonzini authored
      Guard them with CONFIG_KVM_X86_COMMON rather than the two vendor modules.
      In practice this has no functional change, because CONFIG_KVM_X86_COMMON
      is set if and only if at least one vendor-specific module is being built.
      However, it is cleaner to specify CONFIG_KVM_X86_COMMON for functions that
      are used in kvm.ko.
      Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Fixes: 590b09b1 ("KVM: x86: Register "emergency disable" callbacks when virt is enabled")
      Fixes: 6d55a942 ("x86/reboot: Unconditionally define cpu_emergency_virt_cb typedef")
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2a5fe5a0
    • Paolo Bonzini's avatar
      KVM: x86: leave kvm.ko out of the build if no vendor module is requested · ea4290d7
      Paolo Bonzini authored
      kvm.ko is nothing but library code shared by kvm-intel.ko and kvm-amd.ko.
      It provides no functionality on its own and it is unnecessary unless one
      of the vendor-specific module is compiled.  In particular, /dev/kvm is
      not created until one of kvm-intel.ko or kvm-amd.ko is loaded.
      
      Use CONFIG_KVM to decide if it is built-in or a module, but use the
      vendor-specific modules for the actual decision on whether to build it.
      
      This also fixes a build failure when CONFIG_KVM_INTEL and CONFIG_KVM_AMD
      are both disabled.  The cpu_emergency_register_virt_callback() function
      is called from kvm.ko, but it is only defined if at least one of
      CONFIG_KVM_INTEL and CONFIG_KVM_AMD is provided.
      
      Fixes: 590b09b1 ("KVM: x86: Register "emergency disable" callbacks when virt is enabled")
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ea4290d7
  2. 05 Oct, 2024 23 commits
  3. 04 Oct, 2024 12 commits
    • Baokun Li's avatar
      ext4: fix off by one issue in alloc_flex_gd() · 6121258c
      Baokun Li authored
      Wesley reported an issue:
      
      ==================================================================
      EXT4-fs (dm-5): resizing filesystem from 7168 to 786432 blocks
      ------------[ cut here ]------------
      kernel BUG at fs/ext4/resize.c:324!
      CPU: 9 UID: 0 PID: 3576 Comm: resize2fs Not tainted 6.11.0+ #27
      RIP: 0010:ext4_resize_fs+0x1212/0x12d0
      Call Trace:
       __ext4_ioctl+0x4e0/0x1800
       ext4_ioctl+0x12/0x20
       __x64_sys_ioctl+0x99/0xd0
       x64_sys_call+0x1206/0x20d0
       do_syscall_64+0x72/0x110
       entry_SYSCALL_64_after_hwframe+0x76/0x7e
      ==================================================================
      
      While reviewing the patch, Honza found that when adjusting resize_bg in
      alloc_flex_gd(), it was possible for flex_gd->resize_bg to be bigger than
      flexbg_size.
      
      The reproduction of the problem requires the following:
      
       o_group = flexbg_size * 2 * n;
       o_size = (o_group + 1) * group_size;
       n_group: [o_group + flexbg_size, o_group + flexbg_size * 2)
       o_size = (n_group + 1) * group_size;
      
      Take n=0,flexbg_size=16 as an example:
      
                    last:15
      |o---------------|--------------n-|
      o_group:0    resize to      n_group:30
      
      The corresponding reproducer is:
      
      img=test.img
      rm -f $img
      truncate -s 600M $img
      mkfs.ext4 -F $img -b 1024 -G 16 8M
      dev=`losetup -f --show $img`
      mkdir -p /tmp/test
      mount $dev /tmp/test
      resize2fs $dev 248M
      
      Delete the problematic plus 1 to fix the issue, and add a WARN_ON_ONCE()
      to prevent the issue from happening again.
      
      [ Note: another reproucer which this commit fixes is:
      
        img=test.img
        rm -f $img
        truncate -s 25MiB $img
        mkfs.ext4 -b 4096 -E nodiscard,lazy_itable_init=0,lazy_journal_init=0 $img
        truncate -s 3GiB $img
        dev=`losetup -f --show $img`
        mkdir -p /tmp/test
        mount $dev /tmp/test
        resize2fs $dev 3G
        umount $dev
        losetup -d $dev
      
        -- TYT ]
      Reported-by: default avatarWesley Hershberger <wesley.hershberger@canonical.com>
      Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2081231Reported-by: default avatarStéphane Graber <stgraber@stgraber.org>
      Closes: https://lore.kernel.org/all/20240925143325.518508-1-aleksandr.mikhalitsyn@canonical.com/Tested-by: default avatarAlexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
      Tested-by: default avatarEric Sandeen <sandeen@redhat.com>
      Fixes: 665d3e0a ("ext4: reduce unnecessary memory allocation in alloc_flex_gd()")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarBaokun Li <libaokun1@huawei.com>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Link: https://patch.msgid.link/20240927133329.1015041-1-libaokun@huaweicloud.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      6121258c
    • Luis Henriques (SUSE)'s avatar
      ext4: mark fc as ineligible using an handle in ext4_xattr_set() · 04e6ce8f
      Luis Henriques (SUSE) authored
      Calling ext4_fc_mark_ineligible() with a NULL handle is racy and may result
      in a fast-commit being done before the filesystem is effectively marked as
      ineligible.  This patch moves the call to this function so that an handle
      can be used.  If a transaction fails to start, then there's not point in
      trying to mark the filesystem as ineligible, and an error will eventually be
      returned to user-space.
      Suggested-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarLuis Henriques (SUSE) <luis.henriques@linux.dev>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Link: https://patch.msgid.link/20240923104909.18342-3-luis.henriques@linux.devSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@kernel.org
      04e6ce8f
    • Luis Henriques (SUSE)'s avatar
      ext4: use handle to mark fc as ineligible in __track_dentry_update() · faab35a0
      Luis Henriques (SUSE) authored
      Calling ext4_fc_mark_ineligible() with a NULL handle is racy and may result
      in a fast-commit being done before the filesystem is effectively marked as
      ineligible.  This patch fixes the calls to this function in
      __track_dentry_update() by adding an extra parameter to the callback used in
      ext4_fc_track_template().
      Suggested-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarLuis Henriques (SUSE) <luis.henriques@linux.dev>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Link: https://patch.msgid.link/20240923104909.18342-2-luis.henriques@linux.devSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@kernel.org
      faab35a0
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · ac308609
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
       "A couple of build/config issues and expanding the speculative SSBS
        workaround to more CPUs:
      
         - Expand the speculative SSBS workaround to cover Cortex-A715,
           Neoverse-N3 and Microsoft Azure Cobalt 100
      
         - Force position-independent veneers - in some kernel configurations,
           the LLD linker generates position-dependent veneers for otherwise
           position-independent code, resulting in early boot-time failures
      
         - Fix Kconfig selection of HAVE_DYNAMIC_FTRACE_WITH_ARGS so that it
           is not enabled when not supported by the combination of clang and
           GNU ld"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: Subscribe Microsoft Azure Cobalt 100 to erratum 3194386
        arm64: fix selection of HAVE_DYNAMIC_FTRACE_WITH_ARGS
        arm64: errata: Expand speculative SSBS workaround once more
        arm64: cputype: Add Neoverse-N3 definitions
        arm64: Force position-independent veneers
      ac308609
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 7943f06c
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - PERF_TYPE_BREAKPOINT now returns -EOPNOTSUPP instead of -ENOENT,
         which aligns to other ports and is a saner value
      
       - The KASAN-related stack size increasing logic has been moved to a C
         header, to avoid dependency issues
      
      * tag 'riscv-for-linus-6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: Fix kernel stack size when KASAN is enabled
        drivers/perf: riscv: Align errno for unsupported perf event
      7943f06c
    • Linus Torvalds's avatar
      Merge tag 'trace-v6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · 622a3ed1
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
      
       - Fix tp_printk command line option crashing the kernel
      
         With the code that can handle a buffer from a previous boot, the
         trace_check_vprintf() needed access to the delta of the address space
         used by the old buffer and the current buffer. To do so, the
         trace_array (tr) parameter was used. But when tp_printk is enabled on
         the kernel command line, no trace buffer is used and the trace event
         is sent directly to printk(). That meant the tr field of the iterator
         descriptor was NULL, and since tp_printk still uses
         trace_check_vprintf() it caused a NULL dereference.
      
       - Add ptrace.h include to x86 ftrace file for completeness
      
       - Fix rtla installation when done with out-of-tree build
      
       - Fix the help messages in rtla that were incorrect
      
       - Several fixes to fix races with the timerlat and hwlat code
      
         Several locking issues were discovered with the coordination between
         timerlat kthread creation and hotplug. As timerlat has callbacks from
         hotplug code to start kthreads when CPUs come online. There are also
         locking issues with grabbing the cpu_read_lock() and the locks within
         timerlat.
      
      * tag 'trace-v6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        tracing/hwlat: Fix a race during cpuhp processing
        tracing/timerlat: Fix a race during cpuhp processing
        tracing/timerlat: Drop interface_lock in stop_kthread()
        tracing/timerlat: Fix duplicated kthread creation due to CPU online/offline
        x86/ftrace: Include <asm/ptrace.h>
        rtla: Fix the help text in osnoise and timerlat top tools
        tools/rtla: Fix installation from out-of-tree build
        tracing: Fix trace_check_vprintf() when tp_printk is used
      622a3ed1
    • Linus Torvalds's avatar
      Merge tag 'slab-for-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab · f6785e0c
      Linus Torvalds authored
      Pull slab fixes from Vlastimil Babka:
       "Fixes for issues introduced in this merge window: kobject memory leak,
        unsupressed warning and possible lockup in new slub_kunit tests,
        misleading code in kvfree_rcu_queue_batch()"
      
      * tag 'slab-for-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab:
        slub/kunit: skip test_kfree_rcu when the slub kunit test is built-in
        mm, slab: suppress warnings in test_leak_destroy kunit test
        rcu/kvfree: Refactor kvfree_rcu_queue_batch()
        mm, slab: fix use of SLAB_SUPPORTS_SYSFS in kmem_cache_release()
      f6785e0c
    • Linus Torvalds's avatar
      Merge tag 'acpi-6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · e1043b67
      Linus Torvalds authored
      Pull ACPI fixes from Rafael Wysocki:
       "These fix up the ACPI IRQ override quirk list and add two new entries
        to it, add a new quirk to the ACPI backlight (video) driver, and fix
        the ACPI battery driver.
      
        Specifics:
      
         - Add a quirk for Dell OptiPlex 5480 AIO to the ACPI backlight
           (video) driver (Hans de Goede)
      
         - Prevent the ACPI battery driver from crashing when unregistering a
           battery hook and simplify battery hook locking in it (Armin Wolf)
      
         - Fix up the ACPI IRQ override quirk list and add quirks for Asus
           Vivobook X1704VAP and Asus ExpertBook B2502CVA to it (Hans de
           Goede)"
      
      * tag 'acpi-6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        ACPI: battery: Fix possible crash when unregistering a battery hook
        ACPI: battery: Simplify battery hook locking
        ACPI: video: Add backlight=native quirk for Dell OptiPlex 5480 AIO
        ACPI: resource: Add Asus ExpertBook B2502CVA to irq1_level_low_skip_override[]
        ACPI: resource: Add Asus Vivobook X1704VAP to irq1_level_low_skip_override[]
        ACPI: resource: Loosen the Asus E1404GAB DMI match to also cover the E1404GA
        ACPI: resource: Remove duplicate Asus E1504GAB IRQ override
      e1043b67
    • Linus Torvalds's avatar
      Merge tag 'pm-6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 5d18081d
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix two cpufreq issues, one in the core and one in the
        intel_pstate driver:
      
         - Fix CPU device node reference counting in the cpufreq core (Miquel
           Sabaté Solà)
      
         - Turn the spinlock used by the intel_pstate driver in hard IRQ
           context into a raw one to prevent the driver from crashing when
           PREEMPT_RT is enabled (Uwe Kleine-König)"
      
      * tag 'pm-6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        cpufreq: Avoid a bad reference count on CPU node
        cpufreq: intel_pstate: Make hwp_notify_lock a raw spinlock
      5d18081d
    • Linus Torvalds's avatar
      Merge tag 'gpio-fixes-for-v6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · cc70ce8f
      Linus Torvalds authored
      Pull gpio fixes from Bartosz Golaszewski:
      
       - fix a potential NULL-pointer dereference in gpiolib core
      
       - fix a probe() regression from the v6.12 merge window and an older bug
         leading to missed interrupts in gpio-davinci
      
      * tag 'gpio-fixes-for-v6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpiolib: Fix potential NULL pointer dereference in gpiod_get_label()
        gpio: davinci: Fix condition for irqchip registration
        gpio: davinci: fix lazy disable
      cc70ce8f
    • Linus Torvalds's avatar
      Merge tag 'sound-6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 2f91ff27
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "Slightly high amount of changes in this round, partly because of my
        vacation in the last weeks. But all changes are small and nothing
        looks worrisome.
      
        The biggest LOCs is MAINTAINERS updates, and there is a core change
        for card-ID string creation for non-ASCII inputs. Others are rather
        device-specific, such as new quirks and device IDs for ASoC, usual
        HD-audio and USB-audio quirks and fixes, as well as regression fixes
        in HD-audio HDMI audio and Conexant codec"
      
      * tag 'sound-6.12-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (39 commits)
        ALSA: hda/conexant: Fix conflicting quirk for System76 Pangolin
        ALSA: line6: add hw monitor volume control to POD HD500X
        ALSA: gus: Fix some error handling paths related to get_bpos() usage
        ALSA: hda: Add missing parameter description for snd_hdac_stream_timecounter_init()
        ALSA: usb-audio: Add native DSD support for Luxman D-08u
        ALSA: core: add isascii() check to card ID generator
        MAINTAINERS: ALSA: use linux-sound@vger.kernel.org list
        Revert "ALSA: hda: Conditionally use snooping for AMD HDMI"
        ASoC: intel: sof_sdw: Add check devm_kasprintf() returned value
        ASoC: imx-card: Set card.owner to avoid a warning calltrace if SND=m
        ASoC: dt-bindings: davinci-mcasp: Fix interrupts property
        ASoC: qcom: sm8250: add qrb4210-rb2-sndcard compatible string
        ASoC: dt-bindings: qcom,sm8250: add qrb4210-rb2-sndcard
        ALSA: hda: fix trigger_tstamp_latched
        ALSA: hda/realtek: Add a quirk for HP Pavilion 15z-ec200
        ALSA: hda/generic: Drop obsoleted obey_preferred_dacs flag
        ALSA: hda/generic: Unconditionally prefer preferred_dacs pairs
        ALSA: silence integer wrapping warning
        ASoC: Intel: soc-acpi: arl: Fix some missing empty terminators
        ASoC: Intel: soc-acpi-intel-rpl-match: add missing empty item
        ...
      2f91ff27
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2024-10-04' of https://gitlab.freedesktop.org/drm/kernel · fe6fcece
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Weekly fixes, xe and amdgpu lead the way, with panthor, and few core
        components getting various fixes. Nothing seems too out of the
        ordinary.
      
        atomic:
         - Use correct type when reading damage rectangles
      
        display:
         - Fix kernel docs
      
        dp-mst:
         - Fix DSC decompression detection
      
        hdmi:
         - Fix infoframe size
      
        sched:
         - Update maintainers
         - Fix race condition whne queueing up jobs
         - Fix locking in drm_sched_entity_modify_sched()
         - Fix pointer deref if entity queue changes
      
        sysfb:
         - Disable sysfb if framebuffer parent device is unknown
      
        amdgpu:
         - DML2 fix
         - DSC fix
         - Dispclk fix
         - eDP HDR fix
         - IPS fix
         - TBT fix
      
        i915:
         - One fix for bitwise and logical "and" mixup in PM code
      
        xe:
         - Restore pci state on resume
         - Fix locking on submission, queue and vm
         - Fix UAF on queue destruction
         - Fix resource release on freq init error path
         - Use rw_semaphore to reduce contention on ASID->VM lookup
         - Fix steering for media on Xe2_HPM
         - Tuning updates to Xe2
         - Resume TDR after GT reset to prevent jobs running forever
         - Move id allocation to avoid userspace using a guessed number to
           trigger UAF
         - Fix OA stream close preventing pbatch buffers to complete
         - Fix NPD when migrating memory on LNL
         - Fix memory leak when aborting binds
      
        panthor:
         - Fix locking
         - Set FOP_UNSIGNED_OFFSET in fops instance
         - Acquire lock in panthor_vm_prepare_map_op_ctx()
         - Avoid uninitialized variable in tick_ctx_cleanup()
         - Do not block scheduler queue if work is pending
         - Do not add write fences to the shared BOs
      
        vbox:
         - Fix VLA handling"
      
      * tag 'drm-fixes-2024-10-04' of https://gitlab.freedesktop.org/drm/kernel: (41 commits)
        drm/xe: Fix memory leak when aborting binds
        drm/xe: Prevent null pointer access in xe_migrate_copy
        drm/xe/oa: Don't reset OAC_CONTEXT_ENABLE on OA stream close
        drm/xe/queue: move xa_alloc to prevent UAF
        drm/xe/vm: move xa_alloc to prevent UAF
        drm/xe: Clean up VM / exec queue file lock usage.
        drm/xe: Resume TDR after GT reset
        drm/xe/xe2: Add performance tuning for L3 cache flushing
        drm/xe/xe2: Extend performance tuning to media GT
        drm/xe/mcr: Use Xe2_LPM steering tables for Xe2_HPM
        drm/xe: Use helper for ASID -> VM in GPU faults and access counters
        drm/xe: Convert to USM lock to rwsem
        drm/xe: use devm_add_action_or_reset() helper
        drm/xe: fix UAF around queue destruction
        drm/xe/guc_submit: add missing locking in wedged_fini
        drm/xe: Restore pci state upon resume
        drm/amd/display: Fix system hang while resume with TBT monitor
        drm/amd/display: Enable idle workqueue for more IPS modes
        drm/amd/display: Add HDR workaround for specific eDP
        drm/amd/display: avoid set dispclk to 0
        ...
      fe6fcece