Changelog in Linux kernel 6.6.140

 
ACPI: CPPC: Fix related_cpus inconsistency during CPU hotplug [+ + +]
Author: Jinjie Ruan <[email protected]>
Date:   Fri Apr 17 12:01:12 2026 +0800

    ACPI: CPPC: Fix related_cpus inconsistency during CPU hotplug
    
    commit 75141a770f4f8225d316f6c7e146723a32e9720e upstream.
    
    When concurrently bringing up and down two SMT threads of a physical
    core, many warning call traces occur as below:
    
    The issue timeline is as follows:
    
     1. When the system starts,
        cpufreq: CPU: 220, policy->related_cpus: 220-221, policy->cpus: 220-221
    
     2. Offline CPU 220 and CPU 221.
    
     3. Online CPU 220
        - CPU 221 is now offline, as acpi_get_psd_map() use
          for_each_online_cpu(), so the cpu_data->shared_cpu_map,
          policy->cpus, and related_cpus has only CPU 220.
    
        cpufreq: CPU: 220, policy->related_cpus: 220, policy->cpus: 220
    
     4. Offline CPU 220
    
     5. Online CPU 221, the below call trace occurs:
        - Since CPU 220 and CPU 221 share one policy, and
          policy->related_cpus = 220 after step 3, so CPU 221
          is not in policy->related_cpus but
          per_cpu(cpufreq_cpu_data, cpu221) is not NULL.
    
    After reverting commit 56eb0c0ed345 ("ACPI: CPPC: Fix remaining
    for_each_possible_cpu() to use online CPUs"), the issue disappeared.
    
    The _PSD (P-State Dependency) defines the hardware-level dependency of
    frequency control across CPU cores. Since this relationship is a physical
    attribute of the hardware topology, it remains constant regardless of the
    online or offline status of the CPUs.
    
    Using for_each_online_cpu() in acpi_get_psd_map() is problematic. If a
    CPU is offline, it will be excluded from the shared_cpu_map.
    Consequently, if that CPU is brought online later, the kernel will fail
    to recognize it as part of any shared frequency domain.
    
    Switch back to for_each_possible_cpu() to ensure that all cores defined
    in the ACPI tables are correctly mapped into their respective performance
    domains from the start. This aligns with the logic of policy->related_cpus,
    which must encompass all potentially available cores in the domain to
    prevent logic gaps during CPU hotplug operations.
    
    To resolve the original issue regarding the "nosmt" or "nosmt=force"
    boot parameter, as send_pcc_cmd() function already does if (!desc)
    continue, so reverting that loop back to for_each_possible_cpu() is ok,
    only need to change the match_cpc_ptr NULL case in acpi_get_psd_map() to
    continue as Sean suggested.
    
    How to reproduce, on arm64 machine with SMT support which use acpi cppc
    cpufreq driver:
    
            bash test.sh 220 & bash test.sh 221 &
    
            The test.sh is as below:
                    while true
                            do
                            echo 0 > /sys/devices/system/cpu/cpu${1}/online
                            sleep 0.5
                            cat /sys/devices/system/cpu/cpu${1}/cpufreq/related_cpus
                            echo 1 >  /sys/devices/system/cpu/cpu${1}/online
                            cat /sys/devices/system/cpu/cpu${1}/cpufreq/related_cpus
                    done
    
            CPU: 221 PID: 1119 Comm: cpuhp/221 Kdump: loaded Not tainted 6.6.0debug+ #5
            Hardware name: To be filled by O.E.M. S920X20/BC83AMDA01-7270Z, BIOS 20.39 09/04/2024
            pstate: a1400009 (NzCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
            pc : cpufreq_online+0x8ac/0xa90
            lr : cpuhp_cpufreq_online+0x18/0x30
            sp : ffff80008739bce0
            x29: ffff80008739bce0 x28: 0000000000000000 x27: ffff28400ca32200
            x26: 0000000000000000 x25: 0000000000000003 x24: ffffd483503ff000
            x23: ffffd483504051a0 x22: ffffd48350024a00 x21: 00000000000000dd
            x20: 000000000000001d x19: ffff28400ca32000 x18: 0000000000000000
            x17: 0000000000000020 x16: ffffd4834e6a3fc8 x15: 0000000000000020
            x14: 0000000000000008 x13: 0000000000000001 x12: 00000000ffffffff
            x11: 0000000000000040 x10: ffffd48350430728 x9 : ffffd4834f087c78
            x8 : 0000000000000001 x7 : ffff2840092bdf00 x6 : ffffd483504264f0
            x5 : ffffd48350405000 x4 : ffff283f7f95cc60 x3 : 0000000000000000
            x2 : ffff53bc2f94b000 x1 : 00000000000000dd x0 : 0000000000000000
            Call trace:
             cpufreq_online+0x8ac/0xa90
             cpuhp_cpufreq_online+0x18/0x30
             cpuhp_invoke_callback+0x128/0x580
             cpuhp_thread_fun+0x110/0x1b0
             smpboot_thread_fn+0x140/0x190
             kthread+0xec/0x100
             ret_from_fork+0x10/0x20
            ---[ end trace 0000000000000000 ]---
    
    Cc: All applicable <[email protected]>
    Fixes: 56eb0c0ed345 ("ACPI: CPPC: Fix remaining for_each_possible_cpu() to use online CPUs")
    Co-developed-by: Sean Kelley <[email protected]>
    Signed-off-by: Sean Kelley <[email protected]>
    Signed-off-by: Jinjie Ruan <[email protected]>
    [ rjw: Changelog edits ]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ACPI: scan: Use acpi_dev_put() in object add error paths [+ + +]
Author: Guangshuo Li <[email protected]>
Date:   Mon Apr 13 21:53:43 2026 +0800

    ACPI: scan: Use acpi_dev_put() in object add error paths
    
    commit 9c0acc169ac71535477caedea8315f7041c5f07c upstream.
    
    After acpi_init_device_object(), the lifetime of struct acpi_device is
    managed by the driver core through reference counting.
    
    Both acpi_add_power_resource() and acpi_add_single_object() call
    acpi_init_device_object() and then invoke acpi_device_add(). If that
    fails, their error paths call the release callback directly instead of
    dropping the device reference through acpi_dev_put().
    
    This bypasses the normal device lifetime rules and frees the object
    without releasing the reference acquired by device_initialize(), which
    may lead to a refcount leak.
    
    The issue was identified by a static analysis tool I developed and
    confirmed by manual review.
    
    Fix both error paths by using acpi_dev_put() and let the release
    callback handle the final cleanup.
    
    Fixes: 781d737c7466 ("ACPI: Drop power resources driver")
    Fixes: 718fb0de8ff88 ("ACPI: fix NULL bug for HID/UID string")
    Cc: All applicable <[email protected]>
    Signed-off-by: Guangshuo Li <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ACPI: video: force native backlight on HP OMEN 16 (8A44) [+ + +]
Author: Shivam Kalra <[email protected]>
Date:   Sun Apr 26 19:38:41 2026 +0530

    ACPI: video: force native backlight on HP OMEN 16 (8A44)
    
    commit 4b506ea5351a1f5937ac632a4a5c35f6f796cc41 upstream.
    
    The HP OMEN 16 Gaming Laptop (board name 8A44) has a mux-less hybrid
    GPU configuration with AMD Rembrandt (Radeon 680M) and NVIDIA GA104
    (RTX 3070 Ti). The internal eDP panel is wired to the AMD iGPU.
    
    When Nouveau loads without GSP firmware, the ACPI video backlight
    device (acpi_video0) gets registered alongside the native AMD
    backlight (amdgpu_bl2). In this state, writes to amdgpu_bl2 update
    the software brightness value but fail to change the physical panel
    brightness.
    
    Force native backlight to prevent acpi_video0 from registering.
    Confirmed that booting with acpi_backlight=native resolves the
    issue.
    
    Cc: All applicable <[email protected]>
    Signed-off-by: Shivam Kalra <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
af_unix: Reject SIOCATMARK on non-stream sockets [+ + +]
Author: Jiexun Wang <[email protected]>
Date:   Wed May 6 22:08:23 2026 +0800

    af_unix: Reject SIOCATMARK on non-stream sockets
    
    commit d119775f2bad827edc28071c061fdd4a91f889a5 upstream.
    
    SIOCATMARK reports whether the receive queue is at the urgent mark for
    MSG_OOB.
    
    In AF_UNIX, MSG_OOB is supported only for SOCK_STREAM sockets.
    SOCK_DGRAM and SOCK_SEQPACKET reject MSG_OOB in sendmsg() and recvmsg(),
    so they should not support SIOCATMARK either.
    
    Return -EOPNOTSUPP for non-stream sockets before checking the receive
    queue.
    
    Fixes: 314001f0bf92 ("af_unix: Add OOB support")
    Cc: [email protected]
    Reported-by: Yuan Tan <[email protected]>
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Reported-by: Xin Liu <[email protected]>
    Suggested-by: Kuniyuki Iwashima <[email protected]>
    Signed-off-by: Jiexun Wang <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Reviewed-by: Kuniyuki Iwashima <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ALSA: 6fire: Fix input volume change detection [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Thu Apr 16 10:24:40 2026 -0300

    ALSA: 6fire: Fix input volume change detection
    
    commit dc88eef8f55e85e92d016cdf7e291f5560efd79b upstream.
    
    usb6fire_control_input_vol_put() stores the analog capture volume
    as a signed offset in rt->input_vol[] (-15..+15), but it compares
    the cached value against the user-visible mixer value (0..30)
    before subtracting 15.
    
    This mixes two domains in the change detection path. Since the
    runtime is zero-initialized, the visible default is 15; writing 0
    right after probe is ignored, while writing 15 is reported as a
    change even though the cached value remains 0.
    
    Normalize the user value before comparing it with the cached offset.
    
    Fixes: 06bb4e743501 ("ALSA: snd-usb-6fire: add analog input volume control")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/20260416-alsa-6fire-input-volume-change-detection-v1-1-ec78299168df@gmail.com
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: aoa: i2sbus: clear stale prepared state [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Fri May 1 11:54:21 2026 -0400

    ALSA: aoa: i2sbus: clear stale prepared state
    
    [ Upstream commit 5ed060d5491597490fb53ec69da3edc4b1e8c165 ]
    
    The i2sbus PCM code uses pi->active to constrain the sibling stream to
    an already prepared duplex format and rate in i2sbus_pcm_open().
    
    That state is set from i2sbus_pcm_prepare(), but the current code only
    clears it on close. As a result, the sibling stream can inherit stale
    constraints after the prepared state has been torn down.
    
    Clear pi->active when hw_params() or hw_free() tears down the prepared
    state, and set it again only after prepare succeeds.
    
    Replace the stale FIXME in the duplex constraint comment with a description
    of the current driver behavior: i2sbus still programs a single shared
    transport configuration for both directions, so mixed formats are not
    supported in duplex mode.
    
    Reported-by: kernel test robot <[email protected]>
    Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
    Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/20260331-aoa-i2sbus-clear-stale-active-v2-1-3764ae2889a1@gmail.com
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: aoa: i2sbus: fix OF node lifetime handling [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Mon Mar 30 01:00:34 2026 -0300

    ALSA: aoa: i2sbus: fix OF node lifetime handling
    
    commit 4ec93f070eda6b765b62efcaed9241c3b3b0b6ad upstream.
    
    i2sbus_add_dev() keeps the matched "sound" child pointer after
    for_each_child_of_node() has dropped the iterator reference. Take an
    extra reference before saving that node and drop it after the
    layout-id/device-id lookup is complete.
    
    The function also stores np in dev->sound.ofdev.dev.of_node without
    taking a reference for the embedded soundbus device. Since i2sbus
    overrides the embedded platform device release callback, balance that
    reference explicitly in the local error path and in i2sbus_release_dev().
    
    Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: aoa: Skip devices with no codecs in i2sbus_resume() [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Fri May 1 13:27:47 2026 -0400

    ALSA: aoa: Skip devices with no codecs in i2sbus_resume()
    
    [ Upstream commit fd7df93013c5118812e63a52635dc6c3a805a1de ]
    
    In i2sbus_resume(), skip devices with an empty codec list, which avoids
    using an uninitialized 'sysclock_factor' in the 32-bit format path in
    i2sbus_pcm_prepare().
    
    In i2sbus_pcm_prepare(), replace two list_for_each_entry() loops with a
    single list_first_entry() now that the codec list is guaranteed to be
    non-empty by all callers.
    
    Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa")
    Cc: [email protected]
    Signed-off-by: Thorsten Blum <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: aoa: Use guard() for mutex locks [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Fri May 1 11:54:20 2026 -0400

    ALSA: aoa: Use guard() for mutex locks
    
    [ Upstream commit 1cb6ecbb372002ef9e531c5377e5f60122411e40 ]
    
    Replace the manual mutex lock/unlock pairs with guard() for code
    simplification.
    
    Only code refactoring, and no behavior change.
    
    Signed-off-by: Takashi Iwai <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Stable-dep-of: 5ed060d54915 ("ALSA: aoa: i2sbus: clear stale prepared state")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: caiaq: Don't abort when no input device is available [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Mon Apr 27 16:56:15 2026 +0200

    ALSA: caiaq: Don't abort when no input device is available
    
    commit b32ae47a2b0a1fb4bd4942242847966d9b178222 upstream.
    
    The previous fix to handle the error from setup_card() caused a
    regression for the models that have no dedicated input device;
    snd_usb_caiaq_input_init() just returns -EINVAL, and we treat it as a
    fatal error although it should be ignored.
    
    As a regression fix, change the error code to -ENODEV, and ignore this
    error in the callee, to continue probing.
    
    Fixes: 28abd224db4a ("ALSA: caiaq: Handle probe errors properly")
    Cc: <[email protected]>
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=221423
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: caiaq: Fix control_put() result and cache rollback [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Fri Apr 17 10:41:33 2026 -0300

    ALSA: caiaq: Fix control_put() result and cache rollback
    
    commit a3542d1b30f92307f545f2def14e8d988dffdff0 upstream.
    
    control_put() always returns 1 and updates cdev->control_state[]
    before sending the USB command. It also ignores transport errors
    from usb_bulk_msg(), snd_usb_caiaq_send_command(), and
    snd_usb_caiaq_send_command_bank().
    
    That breaks the ALSA .put() contract and can leave control_get()
    reporting a cached value the device never accepted.
    
    Return 0 for unchanged values, propagate transport failures,
    and restore the cached byte when the write fails.
    
    Fixes: 8e3cd08ed8e59 ("[ALSA] caiaq - add control API and more input features")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: caiaq: Fix potentially leftover ep1_in_urb at error path [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Mon Apr 27 14:37:53 2026 +0200

    ALSA: caiaq: Fix potentially leftover ep1_in_urb at error path
    
    commit 0a7b5221b5b51cc798fcfc3be00d02eade149d69 upstream.
    
    The previous fix for handling the error from setup_card() missed that
    an internal URB cdev->ep1_in_urb might have been already submitted
    beforehand.  In the normal case, this URB gets killed at the
    disconnection, but in the error path, we didn't do it, hence there can
    be a potential leak.
    
    Fix it in the error path for setup_card(), too.
    
    Fixes: 28abd224db4a ("ALSA: caiaq: Handle probe errors properly")
    Cc: <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: caiaq: fix usb_dev refcount leak on probe failure [+ + +]
Author: Deepanshu Kartikey <[email protected]>
Date:   Sun Apr 26 05:49:34 2026 +0530

    ALSA: caiaq: fix usb_dev refcount leak on probe failure
    
    commit 7a5f1cd22d47f8ca4b760b6334378ae42c1bd24b upstream.
    
    create_card() takes a reference on the USB device with usb_get_dev()
    and stores the matching usb_put_dev() in card_free(), which is
    installed as the snd_card's ->private_free destructor.
    
    However, ->private_free is only assigned near the end of init_card(),
    after several failure points (usb_set_interface(), EP type checks,
    usb_submit_urb(), the EP1_CMD_GET_DEVICE_INFO exchange, and its
    timeout). When any of those fail, init_card() returns an error to
    snd_probe(), which calls snd_card_free(card). Because ->private_free
    is still NULL, card_free() never runs, the usb_get_dev() reference
    is not dropped, and the struct usb_device leaks along with its
    descriptor allocations and device_private.
    
    syzbot reproduces this with a malformed UAC3 device whose only valid
    altsetting is 0; init_card()'s usb_set_interface(usb_dev, 0, 1) call
    fails with -EIO and triggers the leak.
    
    Move the ->private_free assignment into create_card(), immediately
    after usb_get_dev(), so that every error path reaching snd_card_free()
    balances the reference. card_free()'s callees (snd_usb_caiaq_input_free,
    free_urbs, kfree) already tolerate the partially-initialized state
    because the chip private area is zero-initialized by snd_card_new().
    
    Fixes: 80bb50e2d459 ("ALSA: caiaq: take a reference on the USB device in create_card()")
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=2afd7e71155c7e241560
    Tested-by: [email protected]
    Cc: [email protected]
    Signed-off-by: Deepanshu Kartikey <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: caiaq: Handle probe errors properly [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Tue Apr 14 12:59:00 2026 +0200

    ALSA: caiaq: Handle probe errors properly
    
    commit 28abd224db4a49560b452115bca3672a20e45b2f upstream.
    
    The probe procedure of setup_card() in caiaq driver doesn't treat the
    error cases gracefully, e.g. the error from snd_card_register() calls
    snd_card_free() but continues.  This would lead to a UAF for the
    further calls like snd_usb_caiaq_control_init(), as Berk suggested in
    another patch in the link below.
    
    However, the problem is not only that; in general, this function drops
    the all error handlings (as it's a void function) although its caller
    can propagate an error to snd_probe(), which eventually calls
    snd_card_free() as a proper error path.  That said, we should treat
    each error case in setup_card(), and just return the error code
    promptly, which is then handled later as a fatal error in snd_probe().
    
    This patch achieves it by changing the setup_card() to return an error
    code.  Also, the superfluous snd_card_free() call is removed, too.
    
    Note that card->private_free can be set still safely at returning an
    error.  All called functions in card_free() have checks of the
    unassigned resources or NULL checks.
    
    Fixes: 8e3cd08ed8e5 ("[ALSA] caiaq - add control API and more input features")
    Cc: [email protected]
    Link: https://lore.kernel.org/[email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: control: Validate buf_len before strnlen() in snd_ctl_elem_init_enum_names() [+ + +]
Author: Ziqing Chen <[email protected]>
Date:   Tue Apr 14 21:24:37 2026 +0800

    ALSA: control: Validate buf_len before strnlen() in snd_ctl_elem_init_enum_names()
    
    commit e0da8a8cac74f4b9f577979d131f0d2b88a84487 upstream.
    
    snd_ctl_elem_init_enum_names() advances pointer p through the names
    buffer while decrementing buf_len. If buf_len reaches zero but items
    remain, the next iteration calls strnlen(p, 0).
    
    While strnlen(p, 0) returns 0 and would hit the existing name_len == 0
    error path, CONFIG_FORTIFY_SOURCE's fortified strnlen() first checks
    maxlen against __builtin_dynamic_object_size(). When Clang loses track
    of p's object size inside the loop, this triggers a BRK exception panic
    before the return value is examined.
    
    Add a buf_len == 0 guard at the loop entry to prevent calling fortified
    strnlen() on an exhausted buffer.
    
    Found by kernel fuzz testing through Xiaomi Smartphone.
    
    Fixes: 8d448162bda5 ("ALSA: control: add support for ENUMERATED user space controls")
    Cc: [email protected]
    Signed-off-by: Ziqing Chen <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: core: Fix potential data race at fasync handling [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Mon Apr 20 08:17:20 2026 +0200

    ALSA: core: Fix potential data race at fasync handling
    
    commit 8146cd333d235ed32d48bb803fdf743472d7c783 upstream.
    
    In snd_fasync_work_fn(), which is the offload work for traversing and
    processing the pending fasync list, the call of kill_fasync() is done
    outside the snd_fasync_lock for avoiding deadlocks.  The problem is
    that its the references of fasync->on, fasync->signal and fasync->poll
    are done there also outside the lock.  Since these may be modified by
    snd_kill_fasync() call concurrently from other process, inconsistent
    values might be passed to kill_fasync().  Although there shouldn't be
    critical UAF, it's still better to be addressed.
    
    This patch moves the kill_fasync() argument evaluations inside the
    snd_fasync_lock for avoiding the data races above.  The handling in
    fasync->on flag is optimized in the loop to skip directly.
    
    Also, for more clarity, snd_fasync_free() takes the lock and unlink
    the pending entry more directly instead of clearing fasync->on flag.
    
    Reported-by: Jake Lamberson <[email protected]>
    Fixes: ef34a0ae7a26 ("ALSA: core: Add async signal helpers")
    Cc: <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: core: Serialize deferred fasync state checks [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Wed May 13 10:10:25 2026 -0400

    ALSA: core: Serialize deferred fasync state checks
    
    [ Upstream commit 5337213381df578058e2e41da93cbd0e4639935f ]
    
    snd_fasync_helper() updates fasync->on under snd_fasync_lock, and
    snd_fasync_work_fn() now also evaluates fasync->on under the same
    lock. snd_kill_fasync() still tests the flag before taking the lock,
    leaving an unsynchronized read against FASYNC enable/disable updates.
    
    Move the enabled-state check into the locked section.
    
    Also clear fasync->on under snd_fasync_lock in snd_fasync_free()
    before unlinking the pending entry. Together with the locked sender-side
    check, this publishes teardown before flushing the deferred work and
    prevents a racing sender from requeueing the entry after free has
    started.
    
    Fixes: ef34a0ae7a26 ("ALSA: core: Add async signal helpers")
    Fixes: 8146cd333d23 ("ALSA: core: Fix potential data race at fasync handling")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: ctxfi: Add fallback to default RSR for S/PDIF [+ + +]
Author: Harin Lee <[email protected]>
Date:   Mon Apr 6 16:49:13 2026 +0900

    ALSA: ctxfi: Add fallback to default RSR for S/PDIF
    
    commit 7d61662197ecdc458e33e475b6ada7f6da61d364 upstream.
    
    spdif_passthru_playback_get_resources() uses atc->pll_rate as the RSR
    for the MSR calculation loop. However, pll_rate is only updated in
    atc_pll_init() and not in hw_pll_init(), so it remains 0 after the
    card init.
    
    When spdif_passthru_playback_setup() skips atc_pll_init() for
    32000 Hz, (rsr * desc.msr) always becomes 0, causing the loop to spin
    indefinitely.
    
    Add fallback to use atc->rsr when atc->pll_rate is 0. This reflects
    the hardware state, since hw_card_init() already configures the PLL
    to the default RSR.
    
    Fixes: 8cc72361481f ("ALSA: SB X-Fi driver merge")
    Cc: [email protected]
    Signed-off-by: Harin Lee <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: firewire-tascam: Do not drop unread control events [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Sun May 3 21:55:52 2026 -0300

    ALSA: firewire-tascam: Do not drop unread control events
    
    commit 0749daa8eb5ab90334aaad3b0671efd7150d43b1 upstream.
    
    tscm_hwdep_read_queue() copies as many queued control events as fit in
    the userspace buffer. When the buffer is smaller than the current
    contiguous queue segment, length is rounded down to the number of bytes
    that can be copied.
    
    However, after copying that shortened length, the code advances pull_pos
    to the original tail_pos, marking the whole contiguous segment as
    consumed. Any events between the copied portion and tail_pos are lost.
    
    Limit tail_pos to the position after the entries actually copied before
    updating pull_pos. When the whole segment fits, this is equivalent to the
    old tail_pos update; when the buffer is smaller, the remaining events
    stay queued for the next read.
    
    Fixes: a8c0d13267a4 ("ALSA: firewire-tascam: notify events of change of state for userspace applications")
    Cc: [email protected]
    Suggested-by: Takashi Sakamoto <[email protected]>
    Signed-off-by: Cássio Gabriel <[email protected]>
    Reviewed-by: Takashi Sakamoto <[email protected]>
    Co-developed-by: Takashi Sakamoto <[email protected]>
    Signed-off-by: Takashi Sakamoto <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Link: https://patch.msgid.link/20260503-alsa-firewire-tascam-read-queue-v2-1-126c6efd7642@gmail.com
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: hda: cs35l56: Propagate ASP TX source control errors [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Wed May 13 09:53:59 2026 -0400

    ALSA: hda: cs35l56: Propagate ASP TX source control errors
    
    [ Upstream commit 0faacc0841d66f3cf51989c10a83f3a82d52ff2c ]
    
    cs35l56_hda_mixer_get() ignores regmap_read() and
    cs35l56_hda_mixer_put() ignores regmap_update_bits_check().
    
    This makes the ASP TX source controls report success when a regmap
    access fails. The write path returns no change instead of an error,
    and the read path continues after a failed read instead of aborting
    the control callback.
    
    Propagate the regmap errors, matching the posture and volume controls
    in this driver.
    
    Fixes: 73cfbfa9caea ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Reviewed-by: Richard Fitzgerald <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Link: https://patch.msgid.link/20260423-alsa-cs35l56-asp-tx-source-errors-v1-1-17ea7c62ec31@gmail.com
    [ adjusted path to sound/pci/hda/ and dropped cs35l56_hda_wait_dsp_ready() context ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: misc: Use guard() for spin locks [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Wed May 13 10:10:23 2026 -0400

    ALSA: misc: Use guard() for spin locks
    
    [ Upstream commit b8e1684163ae52db90f428965bd9aaff7205c02e ]
    
    Clean up the code using guard() for spin locks.
    
    Merely code refactoring, and no behavior change.
    
    Signed-off-by: Takashi Iwai <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Stable-dep-of: 5337213381df ("ALSA: core: Serialize deferred fasync state checks")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: pcmtest: fix reference leak on failed device registration [+ + +]
Author: Guangshuo Li <[email protected]>
Date:   Thu Apr 16 03:31:38 2026 +0800

    ALSA: pcmtest: fix reference leak on failed device registration
    
    commit 4ff036f95238f02c87e5d7c0a9d93748582a8950 upstream.
    
    When platform_device_register() fails in mod_init(), the embedded struct
    device in pcmtst_pdev has already been initialized by
    device_initialize(), but the failure path returns the error without
    dropping the device reference for the current platform device:
    
      mod_init()
        -> platform_device_register(&pcmtst_pdev)
           -> device_initialize(&pcmtst_pdev.dev)
           -> setup_pdev_dma_masks(&pcmtst_pdev)
           -> platform_device_add(&pcmtst_pdev)
    
    This leads to a reference leak when platform_device_register() fails.
    Fix this by calling platform_device_put() before returning the error.
    
    The issue was identified by a static analysis tool I developed and
    confirmed by manual review.
    
    Fixes: 315a3d57c64c5 ("ALSA: Implement the new Virtual PCM Test Driver")
    Cc: [email protected]
    Signed-off-by: Guangshuo Li <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: pcmtest: Fix resource leaks in module init error paths [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Tue Apr 21 10:03:06 2026 -0300

    ALSA: pcmtest: Fix resource leaks in module init error paths
    
    commit d5d5f80416a3a749906c04d56575e2290792654b upstream.
    
    pcmtest allocates its pattern buffers and creates its debugfs tree
    before registering the platform device and driver, but mod_init()
    does not release those resources when a later init step fails.
    
    As a result, a debugfs directory creation failure leaks the pattern
    buffers, while platform_device_register() and
    platform_driver_register() failures leave both the pattern buffers
    and the debugfs tree behind. The recent fix for failed device
    registration only dropped the embedded device reference.
    
    Add the missing cleanup for the debugfs tree and pattern buffers in
    the remaining module init error paths.
    
    Fixes: 315a3d57c64c ("ALSA: Implement the new Virtual PCM Test Driver")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: seq: Fix UMP group 16 filtering [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Wed May 13 10:34:30 2026 -0400

    ALSA: seq: Fix UMP group 16 filtering
    
    [ Upstream commit 92429ca999db99febced82f23362a71b2ba4c1d8 ]
    
    The sequencer UAPI defines group_filter as an unsigned int bitmap.
    Bit 0 filters groupless messages and bits 1-16 filter UMP groups 1-16.
    
    The internal snd_seq_client storage is only unsigned short, so bit 16
    is truncated when userspace sets the filter. The same truncation affects
    the automatic UMP client filter used to avoid delivery to inactive
    groups, so events for group 16 cannot be filtered.
    
    Store the internal bitmap as unsigned int and keep both userspace-provided
    and automatically generated values limited to the defined UAPI bits.
    
    Fixes: d2b706077792 ("ALSA: seq: Add UMP group filter")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: seq: Notify client and port info changes [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Wed May 13 10:34:29 2026 -0400

    ALSA: seq: Notify client and port info changes
    
    [ Upstream commit b8e49e24cdba27a0810a0988e810e2c68f2033cb ]
    
    It was supposed to be notified when a sequencer client info and a port
    info has changed (via SNDRV_SEQ_EVENT_CLIENT_CHANGE and
    SNDRV_SEQ_EVENT_PORT_CHANGE event, respectively), and there are
    already helper functions.  But those aren't really sent from the
    driver so far, except for the recent support of UMP, simply due to the
    lack of implementations.
    
    This patch adds the missing notifications at updating the client and
    the port info.  The formerly added notification for UMP is dropped
    because it's handled now in the port info side.
    
    Reported-by: Mark Lentczner <[email protected]>
    Link: https://lore.kernel.org/CAPnksqRok7xGa4bxq9WWimVV=28-7_j628OmrWLS=S0=hzaTHQ@mail.gmail.com
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Stable-dep-of: 92429ca999db ("ALSA: seq: Fix UMP group 16 filtering")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: seq_oss: return full count for successful SEQ_FULLSIZE writes [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Tue Mar 24 16:59:41 2026 -0300

    ALSA: seq_oss: return full count for successful SEQ_FULLSIZE writes
    
    commit bbc6c0dda54fc0ad8f8aed0b796c23e186e1a188 upstream.
    
    snd_seq_oss_write() currently returns the raw load_patch() callback
    result for SEQ_FULLSIZE events.
    
    That callback is documented as returning 0 on success and -errno on
    failure, but snd_seq_oss_write() is the file write path and should
    report the number of user bytes consumed on success. Some in-tree
    backends also return backend-specific positive values, which can still
    be shorter than the original write size.
    
    Return the full byte count for successful SEQ_FULLSIZE writes.
    Preserve negative errors and convert any nonnegative completion to the
    original count.
    
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/20260324-alsa-seq-oss-fullsize-write-return-v1-1-66d448510538@gmail.com
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: usb-audio: Avoid false E-MU sample-rate notifications [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Tue Apr 21 21:53:52 2026 -0300

    ALSA: usb-audio: Avoid false E-MU sample-rate notifications
    
    commit fca9c850042a7ab4828ce3a9caa8bc40ea09856a upstream.
    
    snd_emuusb_set_samplerate() unconditionally notifies the E-MU
    SampleRate Extension Unit control after issuing SET_CUR.
    
    If snd_usb_mixer_set_ctl_value() fails, the control value has not
    changed, yet snd_usb_mixer_notify_id() still invalidates the cache and
    emits a value-change event to userspace.
    
    Notify the control only after a successful write.
    
    Fixes: 7d2b451e65d2 ("ALSA: usb-audio - Added functionality for E-mu 0404USB/0202USB/TrackerPre")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/20260421-alsa-emuusb-samplerate-notify-v1-1-8b63bbc1d7f1@gmail.com
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: usb-audio: Avoid potential endless loop in convert_chmap_v3() [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Mon Apr 27 17:22:15 2026 +0200

    ALSA: usb-audio: Avoid potential endless loop in convert_chmap_v3()
    
    commit 6e7247d8f5fefeceb0bb9cc80a5388a636b219cd upstream.
    
    The convert_chmap_v3() has a loop with its increment size of
    cs_desc->wLength, but we forgot to validate cs_desc->wLength itself,
    which may lead to potential endless loop by a malformed descriptor.
    
    Add a proper size check to abort the loop for plugging the hole.
    
    Fixes: ecfd41166b72 ("ALSA: usb-audio: Validate UAC3 cluster segment descriptors")
    Cc: <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: usb-audio: Evaluate packsize caps at the right place [+ + +]
Author: Takashi Iwai <[email protected]>
Date:   Fri Apr 10 16:32:19 2026 +0200

    ALSA: usb-audio: Evaluate packsize caps at the right place
    
    commit 52521e8398839105ef8eb22b3f0993f9b0d11a57 upstream.
    
    We introduced the upper bound checks of the packet sizes by the
    ep->maxframesize for avoiding the URB submission errors.  However, the
    check was applied at an incorrect place in the function
    snd_usb_endpoint_set_params() where ep->maxframesize isn't defined
    yet; the value is defined at a bit later position.  So this ended up
    with a failure at the first run while the second run works.
    
    For fixing it, move the check at the correct place, right after the
    calculation of ep->maxframesize in the same function.
    
    Fixes: 7fe8dec3f628 ("ALSA: usb-audio: Cap the packet size pre-calculations")
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=221292
    Cc: <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: usb-audio: Fix Audio Advantage Micro II SPDIF switch [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Tue Apr 21 22:07:41 2026 -0300

    ALSA: usb-audio: Fix Audio Advantage Micro II SPDIF switch
    
    commit a9224f26b754b5034719248891ff3c2ea0d11144 upstream.
    
    snd_microii_spdif_switch_put() returns 0 when the requested
    vendor register value differs from the cached one.
    
    This comparison was inverted by the resume-support conversion,
    so real SPDIF switch toggles are ignored while no-op writes still
    issue SET_CUR and report success.
    
    Return early only when the requested value matches the cached one.
    
    Fixes: 288673beae6c ("ALSA: usb-audio: Add resume support for MicroII SPDIF ctls")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: usb-audio: Fix UAC3 cluster descriptor size check [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Fri Apr 24 18:50:10 2026 -0300

    ALSA: usb-audio: Fix UAC3 cluster descriptor size check
    
    commit 26265dd69da32d88a88d21987853cec899d9e21f upstream.
    
    The UAC3 cluster descriptor length check in
    snd_usb_get_audioformat_uac3()was added to
    make sure that the buffer is large enough for
    a struct uac3_cluster_header_descriptor before the
    returned data is cast and used.
    
    However, the check uses sizeof(cluster), where cluster
    is a pointer, not the size of the descriptor header.
    This makes the validation depend on the architecture
    pointer size and does not match the intended object size.
    
    Check against sizeof(*cluster) instead.
    
    Fixes: fb4e2a6e8f28 ("ALSA: usb-audio: Fix out-of-bounds read in snd_usb_get_audioformat_uac3()")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: usb-audio: midi2: Restart output URBs on resume [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Mon May 4 11:08:45 2026 -0300

    ALSA: usb-audio: midi2: Restart output URBs on resume
    
    commit f3c57c9c2a49a21d784b7c04a2c883bffc070659 upstream.
    
    USB MIDI 2.0 suspend saves the endpoint running state, clears it and
    kills all endpoint URBs. Resume restores the running state, but only
    restarts input endpoints.
    
    For a running output endpoint, this leaves the endpoint marked running
    with an empty URB queue. Output transfer progress depends on either the
    rawmidi trigger path starting the queue or an output completion refilling
    it. After suspend there is no completion left, and output data that
    remains queued in the raw UMP or legacy rawmidi buffer can stay stalled
    until userspace happens to trigger the stream again.
    
    Restore the saved state with atomic accessors, keep input endpoints
    restarted as before, and restart output endpoints that were running before
    suspend. Clear the saved suspend state after restoring it.
    
    Fixes: ff49d1df79ae ("ALSA: usb-audio: USB MIDI 2.0 UMP support")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ALSA: usb-audio: stop parsing UAC2 rates at MAX_NR_RATES [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Wed Apr 15 12:04:53 2026 -0300

    ALSA: usb-audio: stop parsing UAC2 rates at MAX_NR_RATES
    
    commit 3c318f97dcc50b2e0556a1813bd6958678e881fd upstream.
    
    parse_uac2_sample_rate_range() caps the number of enumerated
    rates at MAX_NR_RATES, but it only breaks out of the current
    rate loop. A malformed UAC2 RANGE response with additional
    triplets continues parsing the remaining triplets and repeatedly
    prints "invalid uac2 rates" while probe still holds
    register_mutex.
    
    Stop the whole parse once the cap is reached and return the
    number of rates collected so far.
    
    Fixes: 4fa0e81b8350 ("ALSA: usb-audio: fix possible hang and overflow in parse_uac2_sample_rate_range()")
    Cc: [email protected]
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=d56178c27a4710960820
    Signed-off-by: Cássio Gabriel <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
 
arm64/mm: Enable batched TLB flush in unmap_hotplug_range() [+ + +]
Author: Anshuman Khandual <[email protected]>
Date:   Tue Apr 28 11:24:00 2026 -0400

    arm64/mm: Enable batched TLB flush in unmap_hotplug_range()
    
    [ Upstream commit 48478b9f791376b4b89018d7afdfd06865498f65 ]
    
    During a memory hot remove operation, both linear and vmemmap mappings for
    the memory range being removed, get unmapped via unmap_hotplug_range() but
    mapped pages get freed only for vmemmap mapping. This is just a sequential
    operation where each table entry gets cleared, followed by a leaf specific
    TLB flush, and then followed by memory free operation when applicable.
    
    This approach was simple and uniform both for vmemmap and linear mappings.
    But linear mapping might contain CONT marked block memory where it becomes
    necessary to first clear out all entire in the range before a TLB flush.
    This is as per the architecture requirement. Hence batch all TLB flushes
    during the table tear down walk and finally do it in unmap_hotplug_range().
    
    Prior to this fix, it was hypothetically possible for a speculative access
    to a higher address in the contiguous block to fill the TLB with shattered
    entries for the entire contiguous range after a lower address had already
    been cleared and invalidated. Due to the table entries being shattered, the
    subsequent TLB invalidation for the higher address would not then clear the
    TLB entries for the lower address, meaning stale TLB entries could persist.
    
    Besides it also helps in improving the performance via TLBI range operation
    along with reduced synchronization instructions. The time spent executing
    unmap_hotplug_range() improved 97% measured over a 2GB memory hot removal
    in KVM guest.
    
    This scheme is not applicable during vmemmap mapping tear down where memory
    needs to be freed and hence a TLB flush is required after clearing out page
    table entry.
    
    Cc: Will Deacon <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Closes: https://lore.kernel.org/all/aWZYXhrT6D2M-7-N@willie-the-truck/
    Fixes: bbd6ec605c0f ("arm64/mm: Enable memory hot remove")
    Cc: [email protected]
    Reviewed-by: David Hildenbrand (Arm) <[email protected]>
    Reviewed-by: Ryan Roberts <[email protected]>
    Signed-off-by: Ryan Roberts <[email protected]>
    Signed-off-by: Anshuman Khandual <[email protected]>
    Signed-off-by: Catalin Marinas <[email protected]>
    [ replaced `__pte_clear()` with `pte_clear()` ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
arm64: dts: ti: am62-verdin: Enable pullup for eMMC data pins [+ + +]
Author: Francesco Dolcini <[email protected]>
Date:   Fri Mar 20 08:30:30 2026 +0100

    arm64: dts: ti: am62-verdin: Enable pullup for eMMC data pins
    
    commit d5325810814ee995debfa0b6c4a22e0391598bef upstream.
    
    Verdin AM62 board does not have external pullups on eMMC DAT1-DAT7 pins.
    Enable internal pullups on DAT1-DAT7 considering:
    
     - without a host-side pullup, these lines rely solely on the eMMC
       device's internal pullup (R_int, 10kohm-150kohm per JEDEC), which may
       exceed the recommended 50kohm max for 1.8V VCCQ
     - JEDEC JESD84-B51 Table 200 requires host-side pullups (R_DAT,
       10kohm-100kohm) on all data lines to prevent bus floating
    
    Fixes: 316b80246b16 ("arm64: dts: ti: add verdin am62")
    Cc: [email protected]
    Signed-off-by: Francesco Dolcini <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Vignesh Raghavendra <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ASoC: amd: yc: Add HP OMEN Gaming Laptop 16-ap0xxx product line in quirk table [+ + +]
Author: Tommaso Soncin <[email protected]>
Date:   Wed Apr 29 18:08:57 2026 +0200

    ASoC: amd: yc: Add HP OMEN Gaming Laptop 16-ap0xxx product line in quirk table
    
    commit d63c219b7ff39f897da10c160a2edef76320f16c upstream.
    
    Add a DMI quirk for the HP OMEN Gaming Laptop 16-ap0xxx line fixing the
    issue where the internal microphone was not detected.
    
    Cc: [email protected]
    Signed-off-by: Tommaso Soncin <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ASoC: fsl_easrc: fix comment typo [+ + +]
Author: Joseph Salisbury <[email protected]>
Date:   Mon Mar 16 14:05:45 2026 -0400

    ASoC: fsl_easrc: fix comment typo
    
    commit 804dce6c73fdfa44184ee4e8b09abad7f5da408f upstream.
    
    The file contains a spelling error in a source comment (funciton).
    
    Typos in comments reduce readability and make text searches less reliable
    for developers and maintainers.
    
    Replace 'funciton' with 'function' in the affected comment. This is a
    comment-only cleanup and does not change behavior.
    
    Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers")
    Cc: [email protected]
    Signed-off-by: Joseph Salisbury <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ASoC: Intel: bytcr_wm5102: Fix MCLK leak on platform_clock_control error [+ + +]
Author: Cássio Gabriel <[email protected]>
Date:   Mon Apr 27 23:38:41 2026 -0300

    ASoC: Intel: bytcr_wm5102: Fix MCLK leak on platform_clock_control error
    
    commit 13d30682e8dee191ac04e93642f0372a723e8b0c upstream.
    
    If byt_wm5102_prepare_and_enable_pll1() fails in the
    SND_SOC_DAPM_EVENT_ON() path, platform_clock_control() returns after
    clk_prepare_enable(priv->mclk) without disabling the clock again.
    
    This leaks an MCLK enable reference on failed power-up attempts. Add the
    missing clk_disable_unprepare() on the error path, matching the unwind
    used by the other Intel platform_clock_control() implementations.
    
    Fixes: 9a87fc1e0619 ("ASoC: Intel: bytcr_wm5102: Add machine driver for BYT/WM5102")
    Cc: [email protected]
    Signed-off-by: Cássio Gabriel <[email protected]>
    Reviewed-by: Cezary Rojewski <[email protected]>
    Reviewed-by: Hans de Goede <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ASoC: qcom: q6apm-dai: reset queue ptr on trigger stop [+ + +]
Author: Srinivas Kandagatla <[email protected]>
Date:   Thu Apr 2 08:11:10 2026 +0000

    ASoC: qcom: q6apm-dai: reset queue ptr on trigger stop
    
    commit cab45ab95ce7600fc0ff84585c77fd45b7b0d67c upstream.
    
    Reset queue pointer on SNDRV_PCM_TRIGGER_STOP event to be inline
    with resetting appl_ptr. Without this we will end up with a queue_ptr
    out of sync and driver could try to send data that is not ready yet.
    
    Fix this by resetting the queue_ptr.
    
    Fixes: 3d4a4411aa8bb ("ASoC: q6apm-dai: schedule all available frames to avoid dsp under-runs")
    Cc: [email protected]
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ASoC: qcom: q6apm-lpass-dai: Fix multiple graph opens [+ + +]
Author: Srinivas Kandagatla <[email protected]>
Date:   Thu Apr 2 08:11:09 2026 +0000

    ASoC: qcom: q6apm-lpass-dai: Fix multiple graph opens
    
    commit 69acc488aaf39d0ddf6c3cf0e47c1873d39919a2 upstream.
    
    As prepare can be called mulitple times, this can result in multiple
    graph opens for playback path.
    
    This will result in a memory leaks, fix this by adding a check before
    opening.
    
    Fixes: be1fae62cf25 ("ASoC: q6apm-lpass-dai: close graph on prepare errors")
    Cc: [email protected]
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ASoC: qcom: q6apm: remove child devices when apm is removed [+ + +]
Author: Srinivas Kandagatla <[email protected]>
Date:   Thu Apr 2 08:11:07 2026 +0000

    ASoC: qcom: q6apm: remove child devices when apm is removed
    
    commit 4a0e1bcc98f7281d1605768bd2fe71eacc34f9b7 upstream.
    
    looks like q6apm driver does not remove the child driver q6apm-dai and
    q6apm-bedais when the this driver is removed.
    
    Fix this by depopulating them in remove callback.
    
    With this change when the dsp is shutdown all the devices associated with
    q6apm will now be removed.
    
    Fixes: 5477518b8a0e ("ASoC: qdsp6: audioreach: add q6apm support")
    Cc: [email protected]
    Signed-off-by: Srinivas Kandagatla <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ASoC: SOF: Don't allow pointer operations on unconfigured streams [+ + +]
Author: Mark Brown <[email protected]>
Date:   Thu Mar 26 14:52:41 2026 +0000

    ASoC: SOF: Don't allow pointer operations on unconfigured streams
    
    commit c5b6285aae050ff1c3ea824ca3d88ac4be1e69c8 upstream.
    
    When reporting the pointer for a compressed stream we report the current
    I/O frame position by dividing the position by the number of channels
    multiplied by the number of container bytes. These values default to 0 and
    are only configured as part of setting the stream parameters so this allows
    a divide by zero to be configured. Validate that they are non zero,
    returning an error if not
    
    Fixes: c1a731c71359 ("ASoC: SOF: compress: Add support for computing timestamps")
    Cc: [email protected]
    Link: https://patch.msgid.link/20260326-asoc-compress-tstamp-params-v1-1-3dc735b3d599@kernel.org
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
batman-adv: bla: only purge non-released claims [+ + +]
Author: Sven Eckelmann <[email protected]>
Date:   Wed May 6 22:20:51 2026 +0200

    batman-adv: bla: only purge non-released claims
    
    commit cf6b604011591865ae39ac82de8978c1120d17af upstream.
    
    When batadv_bla_purge_claims() goes through the list of claims, it is only
    traversing the hash list with an rcu_read_lock(). Due to a potential
    parallel batadv_claim_put(), it can happen that it encounters a claim which
    was actually in the process of being released+freed by
    batadv_claim_release(). In this case, backbone_gw is set to NULL before the
    delayed RCU kfree is started. Calling batadv_bla_claim_get_backbone_gw() is
    then no longer allowed because it would cause a NULL-ptr derefence.
    
    To avoid this, only claims with a valid reference counter must be purged.
    All others are already taken care of.
    
    Cc: [email protected]
    Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code")
    Signed-off-by: Sven Eckelmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

batman-adv: bla: prevent use-after-free when deleting claims [+ + +]
Author: Sven Eckelmann <[email protected]>
Date:   Wed May 6 22:20:50 2026 +0200

    batman-adv: bla: prevent use-after-free when deleting claims
    
    commit 4ae1709a314060a196981b344610d023ea841e57 upstream.
    
    When batadv_bla_del_backbone_claims() removes all claims for a backbone, it
    does this by dropping the link entry in the hash list. This list entry
    itself was one of the references which need to be dropped at the same time
    via batadv_claim_put().
    
    But the batadv_claim_put() must not be done before the last access to the
    claim object in this function. Otherwise the claim might be freed already
    by the batadv_claim_release() function before the list entry was dropped.
    
    Cc: [email protected]
    Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code")
    Signed-off-by: Sven Eckelmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

batman-adv: bla: put backbone reference on failed claim hash insert [+ + +]
Author: Sven Eckelmann <[email protected]>
Date:   Wed May 6 22:20:52 2026 +0200

    batman-adv: bla: put backbone reference on failed claim hash insert
    
    commit ba9d20ee9076dac32c371116bacbe72480eb356c upstream.
    
    When batadv_bla_add_claim() fails to insert a new claim into the hash, it
    leaked a reference to the backbone_gw for which the claim was intended.
    Call batadv_backbone_gw_put() on the error path to release the reference
    and avoid leaking the backbone_gw object.
    
    Cc: [email protected]
    Fixes: 3db0decf1185 ("batman-adv: Fix non-atomic bla_claim::backbone_gw access")
    Signed-off-by: Sven Eckelmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

batman-adv: fix integer overflow on buff_pos [+ + +]
Author: Lyes Bourennani <[email protected]>
Date:   Wed Apr 22 00:20:22 2026 +0200

    batman-adv: fix integer overflow on buff_pos
    
    commit 0799e5943611006b346b8813c7daf7dd5aa26bfd upstream.
    
    Fixing an integer overflow present in batadv_iv_ogm_send_to_if. The size
    check is done using the int type in batadv_iv_ogm_aggr_packet whereas the
    buff_pos variable uses the s16 type. This could lead to an out-of-bound
    read.
    
    Cc: [email protected]
    Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol")
    Signed-off-by: Lyes Bourennani <[email protected]>
    Signed-off-by: Alexis Pinson <[email protected]>
    Signed-off-by: Sven Eckelmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

batman-adv: reject new tp_meter sessions during teardown [+ + +]
Author: Jiexun Wang <[email protected]>
Date:   Mon Apr 27 14:43:33 2026 +0800

    batman-adv: reject new tp_meter sessions during teardown
    
    commit 3243543592425beec83d453793e9d27caa0d8e66 upstream.
    
    Prevent tp_meter from starting new sender or receiver sessions after
    mesh_state has left BATADV_MESH_ACTIVE.
    
    Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation")
    Cc: [email protected]
    Reported-by: Yuan Tan <[email protected]>
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Reported-by: Xin Liu <[email protected]>
    Co-developed-by: Luxing Yin <[email protected]>
    Signed-off-by: Luxing Yin <[email protected]>
    Signed-off-by: Jiexun Wang <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Signed-off-by: Sven Eckelmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

batman-adv: stop caching unowned originator pointers in BAT IV [+ + +]
Author: Jiexun Wang <[email protected]>
Date:   Sun May 3 12:28:58 2026 +0800

    batman-adv: stop caching unowned originator pointers in BAT IV
    
    commit f03e8583532941b07761c5429de7d50766fa3110 upstream.
    
    BAT IV keeps the last-hop neighbor address in each neigh_node, but some
    paths also cache an originator pointer derived from a temporary lookup.
    That pointer is not owned by the neigh_node and may no longer refer to a
    live originator entry after purge handling runs.
    
    Stop storing the auxiliary originator pointer in the BAT IV neighbor
    state. When BAT IV needs the neighbor originator data, resolve it from
    the stored neighbor address and drop the reference again after use.
    
    Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol")
    Cc: [email protected]
    Reported-by: Yuan Tan <[email protected]>
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Reported-by: Xin Liu <[email protected]>
    Signed-off-by: Jiexun Wang <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    [sven: avoid bonding logic for outgoing OGM]
    Signed-off-by: Sven Eckelmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

batman-adv: stop tp_meter sessions during mesh teardown [+ + +]
Author: Jiexun Wang <[email protected]>
Date:   Fri May 15 12:56:49 2026 +0200

    batman-adv: stop tp_meter sessions during mesh teardown
    
    commit 3d3cf6a7314aca4df0a6dde28ce784a2a30d0166 upstream.
    
    TP meter sessions remain linked on bat_priv->tp_list after the netlink
    request has already finished. When the mesh interface is removed,
    batadv_mesh_free() currently tears down the mesh without first draining
    these sessions.
    
    A running sender thread or a late incoming tp_meter packet can then keep
    processing against a mesh instance which is already shutting down.
    Synchronize tp_meter with the mesh lifetime by stopping all active
    sessions from batadv_mesh_free() and waiting for sender threads to exit
    before teardown continues.
    
    Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation")
    Cc: [email protected]
    Reported-by: Yuan Tan <[email protected]>
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Reported-by: Xin Liu <[email protected]>
    Co-developed-by: Luxing Yin <[email protected]>
    Signed-off-by: Luxing Yin <[email protected]>
    Signed-off-by: Jiexun Wang <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    [ Context ]
    Signed-off-by: Sven Eckelmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

batman-adv: tp_meter: fix tp_num leak on kmalloc failure [+ + +]
Author: Sven Eckelmann <[email protected]>
Date:   Fri May 15 13:49:53 2026 +0200

    batman-adv: tp_meter: fix tp_num leak on kmalloc failure
    
    commit ce425dd05d0fe7594930a0fb103634f35ac47bb6 upstream.
    
    When batadv_tp_start() or batadv_tp_init_recv() fail to allocate a new
    tp_vars object, the previously incremented bat_priv->tp_num counter is
    never decremented. This causes tp_num to drift upward on each allocation
    failure. Since only BATADV_TP_MAX_NUM sessions can be started and the count
    is never reduced for these failed allocations, it causes to an exhaustion
    of throughput meter sessions. In worst case, no new throughput meter
    session can be started until the mesh interface is removed.
    
    The error handling must decrement tp_num releasing the lock and aborting
    the creation of an throughput meter session
    
    Cc: [email protected]
    Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation")
    [ Context ]
    Signed-off-by: Sven Eckelmann <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
block: add pgmap check to biovec_phys_mergeable [+ + +]
Author: Naman Jain <[email protected]>
Date:   Fri Apr 10 15:34:13 2026 +0000

    block: add pgmap check to biovec_phys_mergeable
    
    commit 13920e4b7b784b40cf4519ff1f0f3e513476a499 upstream.
    
    biovec_phys_mergeable() is used by the request merge, DMA mapping,
    and integrity merge paths to decide if two physically contiguous
    bvec segments can be coalesced into one. It currently has no check
    for whether the segments belong to different dev_pagemaps.
    
    When zone device memory is registered in multiple chunks, each chunk
    gets its own dev_pagemap. A single bio can legitimately contain
    bvecs from different pgmaps -- iov_iter_extract_bvecs() breaks at
    pgmap boundaries but the outer loop in bio_iov_iter_get_pages()
    continues filling the same bio. If such bvecs are physically
    contiguous, biovec_phys_mergeable() will coalesce them, making it
    impossible to recover the correct pgmap for the merged segment
    via page_pgmap().
    
    Add a zone_device_pages_have_same_pgmap() check to prevent merging
    bvec segments that span different pgmaps.
    
    Fixes: 49580e690755 ("block: add check when merging zone device pages")
    Cc: [email protected]
    Reviewed-by: Christoph Hellwig <[email protected]>
    Signed-off-by: Naman Jain <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

block: relax pgmap check in bio_add_page for compatible zone device pages [+ + +]
Author: Naman Jain <[email protected]>
Date:   Sat May 2 19:57:59 2026 -0400

    block: relax pgmap check in bio_add_page for compatible zone device pages
    
    [ Upstream commit 41c665aae2b5dbecddddcc8ace344caf630cc7a4 ]
    
    bio_add_page() and bio_integrity_add_page() reject pages from different
    dev_pagemaps entirely, returning 0 even when those pages have compatible
    DMA mapping requirements. This forces callers to start a new bio when
    buffers span pgmap boundaries, even though the pages could safely coexist
    as separate bvec entries.
    
    This matters for guests where memory is registered through
    devm_memremap_pages() with MEMORY_DEVICE_GENERIC in multiple calls,
    creating separate dev_pagemaps for each chunk. When a direct I/O buffer
    spans two such chunks, bio_add_page() rejects the second page, forcing an
    unnecessary bio split or I/O failure.
    
    Introduce zone_device_pages_compatible() in blk.h to check whether two
    pages can coexist in the same bio as separate bvec entries. The block DMA
    iterator (blk_dma_map_iter_start) caches the P2PDMA mapping state from the
    first segment and applies it to all others, so P2PDMA pages from different
    pgmaps must not be mixed, and neither must P2PDMA and non-P2PDMA pages.
    All other combinations (MEMORY_DEVICE_GENERIC pages from different pgmaps,
    or MEMORY_DEVICE_GENERIC with normal RAM) use the same dma_map_phys path
    and are safe.
    
    Replace the blanket zone_device_pages_have_same_pgmap() rejection with
    zone_device_pages_compatible(), while keeping
    zone_device_pages_have_same_pgmap() as a merge guard.
    Pages from different pgmaps can be added as separate bvec entries but
    must not be coalesced into the same segment, as that would make
    it impossible to recover the correct pgmap via page_pgmap().
    
    Fixes: 49580e690755 ("block: add check when merging zone device pages")
    Cc: [email protected]
    Signed-off-by: Naman Jain <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jens Axboe <[email protected]>
    [ restructured combined `if` into explicit `bv` block ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Bluetooth: hci_conn: fix potential UAF in create_big_sync [+ + +]
Author: David Carlier <[email protected]>
Date:   Wed May 13 13:31:46 2026 -0400

    Bluetooth: hci_conn: fix potential UAF in create_big_sync
    
    [ Upstream commit 0beddb0c380bed5f5b8e61ddbe14635bb73d0b41 ]
    
    Add hci_conn_valid() check in create_big_sync() to detect stale
    connections before proceeding with BIG creation. Handle the
    resulting -ECANCELED in create_big_complete() and re-validate the
    connection under hci_dev_lock() before dereferencing, matching the
    pattern used by create_le_conn_complete() and create_pa_complete().
    
    Keep the hci_conn object alive across the async boundary by taking
    a reference via hci_conn_get() when queueing create_big_sync(), and
    dropping it in the completion callback. The refcount and the lock
    are complementary: the refcount keeps the object allocated, while
    hci_dev_lock() serializes hci_conn_hash_del()'s list_del_rcu() on
    hdev->conn_hash, as required by hci_conn_del().
    
    hci_conn_put() is called outside hci_dev_unlock() so the final put
    (which resolves to kfree() via bt_link_release) does not run under
    hdev->lock, though the release path would be safe either way.
    
    Without this, create_big_complete() would unconditionally
    dereference the conn pointer on error, causing a use-after-free
    via hci_connect_cfm() and hci_conn_del().
    
    Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
    Cc: [email protected]
    Co-developed-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: David Carlier <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    [ kept stable's `qos->bcast.out.phy == 0x02` context line instead of upstream's renamed `qos->bcast.out.phys == BIT(1)` ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: hci_event: Fix OOB read and infinite loop in hci_le_create_big_complete_evt [+ + +]
Author: Luiz Augusto von Dentz <[email protected]>
Date:   Fri Apr 10 15:29:52 2026 -0400

    Bluetooth: hci_event: Fix OOB read and infinite loop in hci_le_create_big_complete_evt
    
    commit 5ddb8014261137cadaf83ab5617a588d80a22586 upstream.
    
    hci_le_create_big_complete_evt() iterates over BT_BOUND connections for
    a BIG handle using a while loop, accessing ev->bis_handle[i++] on each
    iteration.  However, there is no check that i stays within ev->num_bis
    before the array access.
    
    When a controller sends a LE_Create_BIG_Complete event with fewer
    bis_handle entries than there are BT_BOUND connections for that BIG,
    or with num_bis=0, the loop reads beyond the valid bis_handle[] flex
    array into adjacent heap memory.  Since the out-of-bounds values
    typically exceed HCI_CONN_HANDLE_MAX (0x0EFF), hci_conn_set_handle()
    rejects them and the connection remains in BT_BOUND state.  The same
    connection is then found again by hci_conn_hash_lookup_big_state(),
    creating an infinite loop with hci_dev_lock held.
    
    Fix this by terminating the BIG if in case not all BIS could be setup
    properly.
    
    Fixes: a0bfde167b50 ("Bluetooth: ISO: Add support for connecting multiple BISes")
    Cc: [email protected]
    Signed-off-by: ZhiTao Ou <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: hci_event: fix potential UAF in SSP passkey handlers [+ + +]
Author: Shuvam Pandey <[email protected]>
Date:   Thu Apr 9 00:32:30 2026 +0545

    Bluetooth: hci_event: fix potential UAF in SSP passkey handlers
    
    commit 85fa3512048793076eef658f66489112dcc91993 upstream.
    
    hci_conn lookup and field access must be covered by hdev lock in
    hci_user_passkey_notify_evt() and hci_keypress_notify_evt(), otherwise
    the connection can be freed concurrently.
    
    Extend the hci_dev_lock critical section to cover all conn usage in both
    handlers.
    
    Keep the existing keypress notification behavior unchanged by routing
    the early exits through a common unlock path.
    
    Fixes: 92a25256f142 ("Bluetooth: mgmt: Implement support for passkey notification")
    Cc: [email protected]
    Signed-off-by: Shuvam Pandey <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_get_sndtimeo_cb() [+ + +]
Author: Siwei Zhang <[email protected]>
Date:   Wed Apr 15 16:53:36 2026 -0400

    Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_get_sndtimeo_cb()
    
    commit 78a88d43dab8d23aeef934ed8ce34d40e6b3d613 upstream.
    
    Add the same NULL guard already present in
    l2cap_sock_resume_cb() and l2cap_sock_ready_cb().
    
    Fixes: 8d836d71e222 ("Bluetooth: Access sk_sndtimeo indirectly in l2cap_core.c")
    Cc: [email protected]
    Signed-off-by: Siwei Zhang <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_new_connection_cb() [+ + +]
Author: Siwei Zhang <[email protected]>
Date:   Wed Apr 15 16:49:59 2026 -0400

    Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_new_connection_cb()
    
    commit 0a120d96166301d7a95be75b52f843837dbd1219 upstream.
    
    Add the same NULL guard already present in
    l2cap_sock_resume_cb() and l2cap_sock_ready_cb().
    
    Fixes: 80808e431e1e ("Bluetooth: Add l2cap_chan_ops abstraction")
    Cc: [email protected]
    Signed-off-by: Siwei Zhang <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_state_change_cb() [+ + +]
Author: Siwei Zhang <[email protected]>
Date:   Wed Apr 15 16:51:36 2026 -0400

    Bluetooth: L2CAP: Fix null-ptr-deref in l2cap_sock_state_change_cb()
    
    commit 2ff1a41a912de8517b4482e946dd951b7d80edbf upstream.
    
    Add the same NULL guard already present in
    l2cap_sock_resume_cb() and l2cap_sock_ready_cb().
    
    Fixes: 89bc500e41fc ("Bluetooth: Add state tracking to struct l2cap_chan")
    Cc: [email protected]
    Signed-off-by: Siwei Zhang <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: MGMT: Fix dangling pointer on mgmt_add_adv_patterns_monitor_complete [+ + +]
Author: Luiz Augusto von Dentz <[email protected]>
Date:   Mon Mar 16 15:03:27 2026 -0400

    Bluetooth: MGMT: Fix dangling pointer on mgmt_add_adv_patterns_monitor_complete
    
    commit 5f5fa4cd35f707344f65ce9e225b6528691dbbaa upstream.
    
    This fixes the condition checking so mgmt_pending_valid is executed
    whenever status != -ECANCELED otherwise calling mgmt_pending_free(cmd)
    would kfree(cmd) without unlinking it from the list first, leaving a
    dangling pointer. Any subsequent list traversal (e.g.,
    mgmt_pending_foreach during __mgmt_power_off, or another
    mgmt_pending_valid call) would dereference freed memory.
    
    Link: https://lore.kernel.org/linux-bluetooth/[email protected]/T/#m1418f9c82eeff8510c1beaa21cf53af20db96c06
    Fixes: 302a1f674c00 ("Bluetooth: MGMT: Fix possible UAFs")
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Reviewed-by: Paul Menzel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: MGMT: Fix memory leak in set_ssp_complete [+ + +]
Author: Jianpeng Chang <[email protected]>
Date:   Wed Jan 21 13:29:26 2026 +0800

    Bluetooth: MGMT: Fix memory leak in set_ssp_complete
    
    commit 1b9c17fd0a7fdcbe69ec5d6fe8e50bc5ed7f01f2 upstream.
    
    Fix memory leak in set_ssp_complete() where mgmt_pending_cmd structures
    are not freed after being removed from the pending list.
    
    Commit 302a1f674c00 ("Bluetooth: MGMT: Fix possible UAFs") replaced
    mgmt_pending_foreach() calls with individual command handling but missed
    adding mgmt_pending_free() calls in both error and success paths of
    set_ssp_complete(). Other completion functions like set_le_complete()
    were fixed correctly in the same commit.
    
    This causes a memory leak of the mgmt_pending_cmd structure and its
    associated parameter data for each SSP command that completes.
    
    Add the missing mgmt_pending_free(cmd) calls in both code paths to fix
    the memory leak. Also fix the same issue in set_advertising_complete().
    
    Fixes: 302a1f674c00 ("Bluetooth: MGMT: Fix possible UAFs")
    Signed-off-by: Jianpeng Chang <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: MGMT: Fix possible UAFs [+ + +]
Author: Luiz Augusto von Dentz <[email protected]>
Date:   Mon Apr 27 11:38:16 2026 +0800

    Bluetooth: MGMT: Fix possible UAFs
    
    [ Upstream commit 302a1f674c00dd5581ab8e493ef44767c5101aab ]
    
    This attemps to fix possible UAFs caused by struct mgmt_pending being
    freed while still being processed like in the following trace, in order
    to fix mgmt_pending_valid is introduce and use to check if the
    mgmt_pending hasn't been removed from the pending list, on the complete
    callbacks it is used to check and in addtion remove the cmd from the list
    while holding mgmt_pending_lock to avoid TOCTOU problems since if the cmd
    is left on the list it can still be accessed and freed.
    
    BUG: KASAN: slab-use-after-free in mgmt_add_adv_patterns_monitor_sync+0x35/0x50 net/bluetooth/mgmt.c:5223
    Read of size 8 at addr ffff8880709d4dc0 by task kworker/u11:0/55
    
    CPU: 0 UID: 0 PID: 55 Comm: kworker/u11:0 Not tainted 6.16.4 #2 PREEMPT(full)
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
    Workqueue: hci0 hci_cmd_sync_work
    Call Trace:
     <TASK>
     dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
     print_address_description mm/kasan/report.c:378 [inline]
     print_report+0xca/0x240 mm/kasan/report.c:482
     kasan_report+0x118/0x150 mm/kasan/report.c:595
     mgmt_add_adv_patterns_monitor_sync+0x35/0x50 net/bluetooth/mgmt.c:5223
     hci_cmd_sync_work+0x210/0x3a0 net/bluetooth/hci_sync.c:332
     process_one_work kernel/workqueue.c:3238 [inline]
     process_scheduled_works+0xade/0x17b0 kernel/workqueue.c:3321
     worker_thread+0x8a0/0xda0 kernel/workqueue.c:3402
     kthread+0x711/0x8a0 kernel/kthread.c:464
     ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148
     ret_from_fork_asm+0x1a/0x30 home/kwqcheii/source/fuzzing/kernel/kasan/linux-6.16.4/arch/x86/entry/entry_64.S:245
     </TASK>
    
    Allocated by task 12210:
     kasan_save_stack mm/kasan/common.c:47 [inline]
     kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
     poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
     __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394
     kasan_kmalloc include/linux/kasan.h:260 [inline]
     __kmalloc_cache_noprof+0x230/0x3d0 mm/slub.c:4364
     kmalloc_noprof include/linux/slab.h:905 [inline]
     kzalloc_noprof include/linux/slab.h:1039 [inline]
     mgmt_pending_new+0x65/0x1e0 net/bluetooth/mgmt_util.c:269
     mgmt_pending_add+0x35/0x140 net/bluetooth/mgmt_util.c:296
     __add_adv_patterns_monitor+0x130/0x200 net/bluetooth/mgmt.c:5247
     add_adv_patterns_monitor+0x214/0x360 net/bluetooth/mgmt.c:5364
     hci_mgmt_cmd+0x9c9/0xef0 net/bluetooth/hci_sock.c:1719
     hci_sock_sendmsg+0x6ca/0xef0 net/bluetooth/hci_sock.c:1839
     sock_sendmsg_nosec net/socket.c:714 [inline]
     __sock_sendmsg+0x219/0x270 net/socket.c:729
     sock_write_iter+0x258/0x330 net/socket.c:1133
     new_sync_write fs/read_write.c:593 [inline]
     vfs_write+0x5c9/0xb30 fs/read_write.c:686
     ksys_write+0x145/0x250 fs/read_write.c:738
     do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
     do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    Freed by task 12221:
     kasan_save_stack mm/kasan/common.c:47 [inline]
     kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
     kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576
     poison_slab_object mm/kasan/common.c:247 [inline]
     __kasan_slab_free+0x62/0x70 mm/kasan/common.c:264
     kasan_slab_free include/linux/kasan.h:233 [inline]
     slab_free_hook mm/slub.c:2381 [inline]
     slab_free mm/slub.c:4648 [inline]
     kfree+0x18e/0x440 mm/slub.c:4847
     mgmt_pending_free net/bluetooth/mgmt_util.c:311 [inline]
     mgmt_pending_foreach+0x30d/0x380 net/bluetooth/mgmt_util.c:257
     __mgmt_power_off+0x169/0x350 net/bluetooth/mgmt.c:9444
     hci_dev_close_sync+0x754/0x1330 net/bluetooth/hci_sync.c:5290
     hci_dev_do_close net/bluetooth/hci_core.c:501 [inline]
     hci_dev_close+0x108/0x200 net/bluetooth/hci_core.c:526
     sock_do_ioctl+0xd9/0x300 net/socket.c:1192
     sock_ioctl+0x576/0x790 net/socket.c:1313
     vfs_ioctl fs/ioctl.c:51 [inline]
     __do_sys_ioctl fs/ioctl.c:907 [inline]
     __se_sys_ioctl+0xf9/0x170 fs/ioctl.c:893
     do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
     do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    Fixes: cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED")
    Fixes: 2bd1b237616b ("Bluetooth: hci_sync: Convert MGMT_OP_SET_DISCOVERABLE to use cmd_sync")
    Fixes: f056a65783cc ("Bluetooth: hci_sync: Convert MGMT_OP_SET_CONNECTABLE to use cmd_sync")
    Fixes: 3244845c6307 ("Bluetooth: hci_sync: Convert MGMT_OP_SSP")
    Fixes: d81a494c43df ("Bluetooth: hci_sync: Convert MGMT_OP_SET_LE")
    Fixes: b338d91703fa ("Bluetooth: Implement support for Mesh")
    Fixes: 6f6ff38a1e14 ("Bluetooth: hci_sync: Convert MGMT_OP_SET_LOCAL_NAME")
    Fixes: 71efbb08b538 ("Bluetooth: hci_sync: Convert MGMT_OP_SET_PHY_CONFIGURATION")
    Fixes: b747a83690c8 ("Bluetooth: hci_sync: Refactor add Adv Monitor")
    Fixes: abfeea476c68 ("Bluetooth: hci_sync: Convert MGMT_OP_START_DISCOVERY")
    Fixes: 26ac4c56f03f ("Bluetooth: hci_sync: Convert MGMT_OP_SET_ADVERTISING")
    Reported-by: cen zhang <[email protected]>
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Charles Xu <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

Bluetooth: virtio_bt: clamp rx length before skb_put [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Tue Apr 21 13:08:44 2026 -0400

    Bluetooth: virtio_bt: clamp rx length before skb_put
    
    commit 21bd244b6de5d2fe1063c23acc93fbdd2b20d112 upstream.
    
    virtbt_rx_work() calls skb_put(skb, len) where len comes directly
    from virtqueue_get_buf() with no validation against the buffer we
    posted to the device. The RX skb is allocated in virtbt_add_inbuf()
    and exposed to virtio as exactly 1000 bytes via sg_init_one().
    
    Checking len against skb_tailroom(skb) is not sufficient because
    alloc_skb() can leave more tailroom than the 1000 bytes actually
    handed to the device. A malicious or buggy backend can therefore
    report used.len between 1001 and skb_tailroom(skb), causing skb_put()
    to include uninitialized kernel heap bytes that were never written by
    the device.
    
    The same path also accepts len == 0, in which case skb_put(skb, 0)
    leaves the skb empty but virtbt_rx_handle() still reads the pkt_type
    byte from skb->data, consuming uninitialized memory.
    
    Define VIRTBT_RX_BUF_SIZE once and reuse it in alloc_skb() and
    sg_init_one(), and gate virtbt_rx_work() on that same constant so
    the bound checked matches the buffer actually exposed to the device.
    Reject used.len == 0 in the same gate so an empty completion can
    no longer reach virtbt_rx_handle().
    
    Use bt_dev_err_ratelimited() because the length value comes from an
    untrusted backend that can otherwise flood the kernel log.
    
    Same class of bug as commit c04db81cd028 ("net/9p: Fix buffer
    overflow in USB transport layer"), which hardened the USB 9p
    transport against unchecked device-reported length.
    
    Fixes: 160fbcf3bfb9 ("Bluetooth: virtio_bt: Use skb_put to set length")
    Cc: [email protected]
    Cc: Soenke Huster <[email protected]>
    Signed-off-by: Michael Bommarito <[email protected]>
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Bluetooth: virtio_bt: validate rx pkt_type header length [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Tue Apr 21 13:08:45 2026 -0400

    Bluetooth: virtio_bt: validate rx pkt_type header length
    
    commit daf23014e5d975e72ea9c02b5160d3fcf070ea47 upstream.
    
    virtbt_rx_handle() reads the leading pkt_type byte from the RX skb
    and forwards the remainder to hci_recv_frame() for every
    event/ACL/SCO/ISO type, without checking that the remaining payload
    is at least the fixed HCI header for that type.
    
    After the preceding patch bounds the backend-supplied used.len to
    [1, VIRTBT_RX_BUF_SIZE], a one-byte completion still reaches
    hci_recv_frame() with skb->len already pulled to 0. If the byte
    happened to be HCI_ACLDATA_PKT, the ACL-vs-ISO classification
    fast-path in hci_dev_classify_pkt_type() dereferences
    hci_acl_hdr(skb)->handle whenever the HCI device has an active
    CIS_LINK, BIS_LINK, or PA_LINK connection, reading two bytes of
    uninitialized RX-buffer data. The same hazard exists for every
    packet type the driver accepts because none of the switch cases in
    virtbt_rx_handle() check skb->len against the per-type minimum HCI
    header size before handing the frame to the core.
    
    After stripping pkt_type, require skb->len to cover the fixed
    header size for the selected type (event 2, ACL 4, SCO 3, ISO 4)
    before calling hci_recv_frame(); drop ratelimited otherwise.
    Unknown pkt_type values still take the original kfree_skb() default
    path.
    
    Use bt_dev_err_ratelimited() because both the length and pkt_type
    values come from an untrusted backend that can otherwise flood the
    kernel log.
    
    Fixes: 160fbcf3bfb9 ("Bluetooth: virtio_bt: Use skb_put to set length")
    Cc: [email protected]
    Cc: Soenke Huster <[email protected]>
    Signed-off-by: Michael Bommarito <[email protected]>
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Luiz Augusto von Dentz <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
bonding: fix use-after-free due to enslave fail after slave array update [+ + +]
Author: Nikolay Aleksandrov <[email protected]>
Date:   Fri Jan 23 14:06:59 2026 +0200

    bonding: fix use-after-free due to enslave fail after slave array update
    
    commit e9acda52fd2ee0cdca332f996da7a95c5fd25294 upstream.
    
    Fix a use-after-free which happens due to enslave failure after the new
    slave has been added to the array. Since the new slave can be used for Tx
    immediately, we can use it after it has been freed by the enslave error
    cleanup path which frees the allocated slave memory. Slave update array is
    supposed to be called last when further enslave failures are not expected.
    Move it after xdp setup to avoid any problems.
    
    It is very easy to reproduce the problem with a simple xdp_pass prog:
     ip l add bond1 type bond mode balance-xor
     ip l set bond1 up
     ip l set dev bond1 xdp object xdp_pass.o sec xdp_pass
     ip l add dumdum type dummy
    
    Then run in parallel:
     while :; do ip l set dumdum master bond1 1>/dev/null 2>&1; done;
     mausezahn bond1 -a own -b rand -A rand -B 1.1.1.1 -c 0 -t tcp "dp=1-1023, flags=syn"
    
    The crash happens almost immediately:
     [  605.602850] Oops: general protection fault, probably for non-canonical address 0xe0e6fc2460000137: 0000 [#1] SMP KASAN NOPTI
     [  605.602916] KASAN: maybe wild-memory-access in range [0x07380123000009b8-0x07380123000009bf]
     [  605.602946] CPU: 0 UID: 0 PID: 2445 Comm: mausezahn Kdump: loaded Tainted: G    B               6.19.0-rc6+ #21 PREEMPT(voluntary)
     [  605.602979] Tainted: [B]=BAD_PAGE
     [  605.602998] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
     [  605.603032] RIP: 0010:netdev_core_pick_tx+0xcd/0x210
     [  605.603063] Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 3e 01 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 6b 08 49 8d 7d 30 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 25 01 00 00 49 8b 45 30 4c 89 e2 48 89 ee 48 89
     [  605.603111] RSP: 0018:ffff88817b9af348 EFLAGS: 00010213
     [  605.603145] RAX: dffffc0000000000 RBX: ffff88817d28b420 RCX: 0000000000000000
     [  605.603172] RDX: 00e7002460000137 RSI: 0000000000000008 RDI: 07380123000009be
     [  605.603199] RBP: ffff88817b541a00 R08: 0000000000000001 R09: fffffbfff3ed8c0c
     [  605.603226] R10: ffffffff9f6c6067 R11: 0000000000000001 R12: 0000000000000000
     [  605.603253] R13: 073801230000098e R14: ffff88817d28b448 R15: ffff88817b541a84
     [  605.603286] FS:  00007f6570ef67c0(0000) GS:ffff888221dfa000(0000) knlGS:0000000000000000
     [  605.603319] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     [  605.603343] CR2: 00007f65712fae40 CR3: 000000011371b000 CR4: 0000000000350ef0
     [  605.603373] Call Trace:
     [  605.603392]  <TASK>
     [  605.603410]  __dev_queue_xmit+0x448/0x32a0
     [  605.603434]  ? __pfx_vprintk_emit+0x10/0x10
     [  605.603461]  ? __pfx_vprintk_emit+0x10/0x10
     [  605.603484]  ? __pfx___dev_queue_xmit+0x10/0x10
     [  605.603507]  ? bond_start_xmit+0xbfb/0xc20 [bonding]
     [  605.603546]  ? _printk+0xcb/0x100
     [  605.603566]  ? __pfx__printk+0x10/0x10
     [  605.603589]  ? bond_start_xmit+0xbfb/0xc20 [bonding]
     [  605.603627]  ? add_taint+0x5e/0x70
     [  605.603648]  ? add_taint+0x2a/0x70
     [  605.603670]  ? end_report.cold+0x51/0x75
     [  605.603693]  ? bond_start_xmit+0xbfb/0xc20 [bonding]
     [  605.603731]  bond_start_xmit+0x623/0xc20 [bonding]
    
    Fixes: 9e2ee5c7e7c3 ("net, bonding: Add XDP support to the bonding driver")
    Signed-off-by: Nikolay Aleksandrov <[email protected]>
    Reported-by: Chen Zhen <[email protected]>
    Closes: https://lore.kernel.org/netdev/[email protected]/
    CC: Jussi Maki <[email protected]>
    CC: Daniel Borkmann <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Tested-by: Yunseong Kim <[email protected]>
    Signed-off-by: Yunseong Kim <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
bpf: Don't mark STACK_INVALID as STACK_MISC in mark_stack_slot_misc [+ + +]
Author: Kumar Kartikeya Dwivedi <[email protected]>
Date:   Tue Dec 3 20:47:53 2024 -0800

    bpf: Don't mark STACK_INVALID as STACK_MISC in mark_stack_slot_misc
    
    [ Upstream commit 69772f509e084ec6bca12dbcdeeeff41b0103774 ]
    
    Inside mark_stack_slot_misc, we should not upgrade STACK_INVALID to
    STACK_MISC when allow_ptr_leaks is false, since invalid contents
    shouldn't be read unless the program has the relevant capabilities.
    The relaxation only makes sense when env->allow_ptr_leaks is true.
    
    However, such conversion in privileged mode becomes unnecessary, as
    invalid slots can be read without being upgraded to STACK_MISC.
    
    Currently, the condition is inverted (i.e. checking for true instead of
    false), simply remove it to restore correct behavior.
    
    Fixes: eaf18febd6eb ("bpf: preserve STACK_ZERO slots on partial reg spills")
    Acked-by: Andrii Nakryiko <[email protected]>
    Reported-by: Tao Lyu <[email protected]>
    Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

bpf: handle fake register spill to stack with BPF_ST_MEM instruction [+ + +]
Author: Andrii Nakryiko <[email protected]>
Date:   Mon May 11 18:25:08 2026 +0200

    bpf: handle fake register spill to stack with BPF_ST_MEM instruction
    
    [ Upstream commit 482d548d40b0af9af730e4869903d4433e44f014 ]
    
    When verifier validates BPF_ST_MEM instruction that stores known
    constant to stack (e.g., *(u64 *)(r10 - 8) = 123), it effectively spills
    a fake register with a constant (but initially imprecise) value to
    a stack slot. Because read-side logic treats it as a proper register
    fill from stack slot, we need to mark such stack slot initialization as
    INSN_F_STACK_ACCESS instruction to stop precision backtracking from
    missing it.
    
    Fixes: 41f6f64e6999 ("bpf: support non-r10 register spill/fill to/from stack in precision tracking")
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Acked-by: Eduard Zingerman <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Paul Chaignon <[email protected]>
    Acked-by: Shung-Hsi Yu <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

bpf: preserve constant zero when doing partial register restore [+ + +]
Author: Andrii Nakryiko <[email protected]>
Date:   Mon May 11 18:24:13 2026 +0200

    bpf: preserve constant zero when doing partial register restore
    
    [ Upstream commit e322f0bcb8d371f4606eaf141c7f967e1a79bcb7 ]
    
    Similar to special handling of STACK_ZERO, when reading 1/2/4 bytes from
    stack from slot that has register spilled into it and that register has
    a constant value zero, preserve that zero and mark spilled register as
    precise for that. This makes spilled const zero register and STACK_ZERO
    cases equivalent in their behavior.
    
    Acked-by: Eduard Zingerman <[email protected]>
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Paul Chaignon <[email protected]>
    Acked-by: Shung-Hsi Yu <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

bpf: preserve STACK_ZERO slots on partial reg spills [+ + +]
Author: Andrii Nakryiko <[email protected]>
Date:   Mon May 11 18:23:50 2026 +0200

    bpf: preserve STACK_ZERO slots on partial reg spills
    
    [ Upstream commit eaf18febd6ebc381aeb61543705148b3e28c7c47 ]
    
    Instead of always forcing STACK_ZERO slots to STACK_MISC, preserve it in
    situations where this is possible. E.g., when spilling register as
    1/2/4-byte subslots on the stack, all the remaining bytes in the stack
    slot do not automatically become unknown. If we knew they contained
    zeroes, we can preserve those STACK_ZERO markers.
    
    Add a helper mark_stack_slot_misc(), similar to scrub_spilled_slot(),
    but that doesn't overwrite either STACK_INVALID nor STACK_ZERO. Note
    that we need to take into account possibility of being in unprivileged
    mode, in which case STACK_INVALID is forced to STACK_MISC for correctness,
    as treating STACK_INVALID as equivalent STACK_MISC is only enabled in
    privileged mode.
    
    Acked-by: Eduard Zingerman <[email protected]>
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Paul Chaignon <[email protected]>
    Acked-by: Shung-Hsi Yu <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

bpf: support non-r10 register spill/fill to/from stack in precision tracking [+ + +]
Author: Andrii Nakryiko <[email protected]>
Date:   Mon May 11 18:22:35 2026 +0200

    bpf: support non-r10 register spill/fill to/from stack in precision tracking
    
    [ Upstream commit 41f6f64e6999a837048b1bd13a2f8742964eca6b ]
    
    Use instruction (jump) history to record instructions that performed
    register spill/fill to/from stack, regardless if this was done through
    read-only r10 register, or any other register after copying r10 into it
    *and* potentially adjusting offset.
    
    To make this work reliably, we push extra per-instruction flags into
    instruction history, encoding stack slot index (spi) and stack frame
    number in extra 10 bit flags we take away from prev_idx in instruction
    history. We don't touch idx field for maximum performance, as it's
    checked most frequently during backtracking.
    
    This change removes basically the last remaining practical limitation of
    precision backtracking logic in BPF verifier. It fixes known
    deficiencies, but also opens up new opportunities to reduce number of
    verified states, explored in the subsequent patches.
    
    There are only three differences in selftests' BPF object files
    according to veristat, all in the positive direction (less states).
    
    File                                    Program        Insns (A)  Insns (B)  Insns  (DIFF)  States (A)  States (B)  States (DIFF)
    --------------------------------------  -------------  ---------  ---------  -------------  ----------  ----------  -------------
    test_cls_redirect_dynptr.bpf.linked3.o  cls_redirect        2987       2864  -123 (-4.12%)         240         231    -9 (-3.75%)
    xdp_synproxy_kern.bpf.linked3.o         syncookie_tc       82848      82661  -187 (-0.23%)        5107        5073   -34 (-0.67%)
    xdp_synproxy_kern.bpf.linked3.o         syncookie_xdp      85116      84964  -152 (-0.18%)        5162        5130   -32 (-0.62%)
    
    Note, I avoided renaming jmp_history to more generic insn_hist to
    minimize number of lines changed and potential merge conflicts between
    bpf and bpf-next trees.
    
    Notice also cur_hist_entry pointer reset to NULL at the beginning of
    instruction verification loop. This pointer avoids the problem of
    relying on last jump history entry's insn_idx to determine whether we
    already have entry for current instruction or not. It can happen that we
    added jump history entry because current instruction is_jmp_point(), but
    also we need to add instruction flags for stack access. In this case, we
    don't want to entries, so we need to reuse last added entry, if it is
    present.
    
    Relying on insn_idx comparison has the same ambiguity problem as the one
    that was fixed recently in [0], so we avoid that.
    
      [0] https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/
    
    Acked-by: Eduard Zingerman <[email protected]>
    Reported-by: Tao Lyu <[email protected]>
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    [ Note: Adapted the expected log format for selftests as the map format
      in verifier logs was changed in commits 1db747d75b1d and
      0c95c9fdb696. ]
    Signed-off-by: Paul Chaignon <[email protected]>
    Acked-by: Shung-Hsi Yu <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

bpf: track aligned STACK_ZERO cases as imprecise spilled registers [+ + +]
Author: Andrii Nakryiko <[email protected]>
Date:   Mon May 11 18:24:37 2026 +0200

    bpf: track aligned STACK_ZERO cases as imprecise spilled registers
    
    [ Upstream commit 18a433b62061e3d787bfc3e670fa711fecbd7cb4 ]
    
    Now that precision backtracing is supporting register spill/fill to/from
    stack, there is another oportunity to be exploited here: minimizing
    precise STACK_ZERO cases. With a simple code change we can rely on
    initially imprecise register spill tracking for cases when register
    spilled to stack was a known zero.
    
    This is a very common case for initializing on the stack variables,
    including rather large structures. Often times zero has no special
    meaning for the subsequent BPF program logic and is often overwritten
    with non-zero values soon afterwards. But due to STACK_ZERO vs
    STACK_MISC tracking, such initial zero initialization actually causes
    duplication of verifier states as STACK_ZERO is clearly different than
    STACK_MISC or spilled SCALAR_VALUE register.
    
    The effect of this (now) trivial change is huge, as can be seen below.
    These are differences between BPF selftests, Cilium, and Meta-internal
    BPF object files relative to previous patch in this series. You can see
    improvements ranging from single-digit percentage improvement for
    instructions and states, all the way to 50-60% reduction for some of
    Meta-internal host agent programs, and even some Cilium programs.
    
    For Meta-internal ones I left only the differences for largest BPF
    object files by states/instructions, as there were too many differences
    in the overall output. All the differences were improvements, reducting
    number of states and thus instructions validated.
    
    Note, Meta-internal BPF object file names are not printed below.
    Many copies of balancer_ingress are actually many different
    configurations of Katran, so they are different BPF programs, which
    explains state reduction going from -16% all the way to 31%, depending
    on BPF program logic complexity.
    
    I also tooked a closer look at a few small-ish BPF programs to validate
    the behavior. Let's take bpf_iter_netrlink.bpf.o (first row below).
    While it's just 8 vs 5 states, verifier log is still pretty long to
    include it here. But the reduction in states is due to the following
    piece of C code:
    
            unsigned long ino;
    
            ...
    
            sk = s->sk_socket;
            if (!sk) {
                    ino = 0;
            } else {
                    inode = SOCK_INODE(sk);
                    bpf_probe_read_kernel(&ino, sizeof(ino), &inode->i_ino);
            }
            BPF_SEQ_PRINTF(seq, "%-8u %-8lu\n", s->sk_drops.counter, ino);
            return 0;
    
    You can see that in some situations `ino` is zero-initialized, while in
    others it's unknown value filled out by bpf_probe_read_kernel(). Before
    this change code after if/else branches have to be validated twice. Once
    with (precise) ino == 0, due to eager STACK_ZERO logic, and then again
    for when ino is just STACK_MISC. But BPF_SEQ_PRINTF() doesn't care about
    precise value of ino, so with the change in this patch verifier is able
    to prune states from after one of the branches, reducing number of total
    states (and instructions) required for successful validation.
    
    Similar principle applies to bigger real-world applications, just at
    a much larger scale.
    
    SELFTESTS
    =========
    File                                     Program                  Insns (A)  Insns (B)  Insns    (DIFF)  States (A)  States (B)  States (DIFF)
    ---------------------------------------  -----------------------  ---------  ---------  ---------------  ----------  ----------  -------------
    bpf_iter_netlink.bpf.linked3.o           dump_netlink                   148        104    -44 (-29.73%)           8           5   -3 (-37.50%)
    bpf_iter_unix.bpf.linked3.o              dump_unix                     8474       8404     -70 (-0.83%)         151         147    -4 (-2.65%)
    bpf_loop.bpf.linked3.o                   stack_check                    560        324   -236 (-42.14%)          42          24  -18 (-42.86%)
    local_storage_bench.bpf.linked3.o        get_local                      120         77    -43 (-35.83%)           9           6   -3 (-33.33%)
    loop6.bpf.linked3.o                      trace_virtqueue_add_sgs      10167       9868    -299 (-2.94%)         226         206   -20 (-8.85%)
    pyperf600_bpf_loop.bpf.linked3.o         on_event                      4872       3423  -1449 (-29.74%)         322         229  -93 (-28.88%)
    strobemeta.bpf.linked3.o                 on_event                    180697     176036   -4661 (-2.58%)        4780        4734   -46 (-0.96%)
    test_cls_redirect.bpf.linked3.o          cls_redirect                 65594      65401    -193 (-0.29%)        4230        4212   -18 (-0.43%)
    test_global_func_args.bpf.linked3.o      test_cls                       145        136      -9 (-6.21%)          10           9   -1 (-10.00%)
    test_l4lb.bpf.linked3.o                  balancer_ingress              4760       2612  -2148 (-45.13%)         113         102   -11 (-9.73%)
    test_l4lb_noinline.bpf.linked3.o         balancer_ingress              4845       4877     +32 (+0.66%)         219         221    +2 (+0.91%)
    test_l4lb_noinline_dynptr.bpf.linked3.o  balancer_ingress              2072       2087     +15 (+0.72%)          97          98    +1 (+1.03%)
    test_seg6_loop.bpf.linked3.o             __add_egr_x                  12440       9975  -2465 (-19.82%)         364         353   -11 (-3.02%)
    test_tcp_hdr_options.bpf.linked3.o       estab                         2558       2572     +14 (+0.55%)         179         180    +1 (+0.56%)
    test_xdp_dynptr.bpf.linked3.o            _xdp_tx_iptunnel               645        596     -49 (-7.60%)          26          24    -2 (-7.69%)
    test_xdp_noinline.bpf.linked3.o          balancer_ingress_v6           3520       3516      -4 (-0.11%)         216         216    +0 (+0.00%)
    xdp_synproxy_kern.bpf.linked3.o          syncookie_tc                 82661      81241   -1420 (-1.72%)        5073        5155   +82 (+1.62%)
    xdp_synproxy_kern.bpf.linked3.o          syncookie_xdp                84964      82297   -2667 (-3.14%)        5130        5157   +27 (+0.53%)
    
    META-INTERNAL
    =============
    Program                                 Insns (A)  Insns (B)  Insns      (DIFF)  States (A)  States (B)  States   (DIFF)
    --------------------------------------  ---------  ---------  -----------------  ----------  ----------  ---------------
    balancer_ingress                            27925      23608    -4317 (-15.46%)        1488        1482      -6 (-0.40%)
    balancer_ingress                            31824      27546    -4278 (-13.44%)        1658        1652      -6 (-0.36%)
    balancer_ingress                            32213      27935    -4278 (-13.28%)        1689        1683      -6 (-0.36%)
    balancer_ingress                            32213      27935    -4278 (-13.28%)        1689        1683      -6 (-0.36%)
    balancer_ingress                            31824      27546    -4278 (-13.44%)        1658        1652      -6 (-0.36%)
    balancer_ingress                            38647      29562    -9085 (-23.51%)        2069        1835   -234 (-11.31%)
    balancer_ingress                            38647      29562    -9085 (-23.51%)        2069        1835   -234 (-11.31%)
    balancer_ingress                            40339      30792    -9547 (-23.67%)        2193        1934   -259 (-11.81%)
    balancer_ingress                            37321      29055    -8266 (-22.15%)        1972        1795    -177 (-8.98%)
    balancer_ingress                            38176      29753    -8423 (-22.06%)        2008        1831    -177 (-8.81%)
    balancer_ingress                            29193      20910    -8283 (-28.37%)        1599        1422   -177 (-11.07%)
    balancer_ingress                            30013      21452    -8561 (-28.52%)        1645        1447   -198 (-12.04%)
    balancer_ingress                            28691      24290    -4401 (-15.34%)        1545        1531     -14 (-0.91%)
    balancer_ingress                            34223      28965    -5258 (-15.36%)        1984        1875    -109 (-5.49%)
    balancer_ingress                            35481      26158    -9323 (-26.28%)        2095        1806   -289 (-13.79%)
    balancer_ingress                            35481      26158    -9323 (-26.28%)        2095        1806   -289 (-13.79%)
    balancer_ingress                            35868      26455    -9413 (-26.24%)        2140        1827   -313 (-14.63%)
    balancer_ingress                            35868      26455    -9413 (-26.24%)        2140        1827   -313 (-14.63%)
    balancer_ingress                            35481      26158    -9323 (-26.28%)        2095        1806   -289 (-13.79%)
    balancer_ingress                            35481      26158    -9323 (-26.28%)        2095        1806   -289 (-13.79%)
    balancer_ingress                            34844      29485    -5359 (-15.38%)        2036        1918    -118 (-5.80%)
    fbflow_egress                                3256       2652     -604 (-18.55%)         218         192    -26 (-11.93%)
    fbflow_ingress                               1026        944       -82 (-7.99%)          70          63     -7 (-10.00%)
    sslwall_tc_egress                            8424       7360    -1064 (-12.63%)         498         458     -40 (-8.03%)
    syar_accept_protect                         15040       9539    -5501 (-36.58%)         364         220   -144 (-39.56%)
    syar_connect_tcp_v6                         15036       9535    -5501 (-36.59%)         360         216   -144 (-40.00%)
    syar_connect_udp_v4                         15039       9538    -5501 (-36.58%)         361         217   -144 (-39.89%)
    syar_connect_connect4_protect4              24805      15833    -8972 (-36.17%)         756         480   -276 (-36.51%)
    syar_lsm_file_open                         167772     151813    -15959 (-9.51%)        1836        1667    -169 (-9.20%)
    syar_namespace_create_new                   14805       9304    -5501 (-37.16%)         353         209   -144 (-40.79%)
    syar_python3_detect                         17531      12030    -5501 (-31.38%)         391         247   -144 (-36.83%)
    syar_ssh_post_fork                          16412      10911    -5501 (-33.52%)         405         261   -144 (-35.56%)
    syar_enter_execve                           14728       9227    -5501 (-37.35%)         345         201   -144 (-41.74%)
    syar_enter_execveat                         14728       9227    -5501 (-37.35%)         345         201   -144 (-41.74%)
    syar_exit_execve                            16622      11121    -5501 (-33.09%)         376         232   -144 (-38.30%)
    syar_exit_execveat                          16622      11121    -5501 (-33.09%)         376         232   -144 (-38.30%)
    syar_syscalls_kill                          15288       9787    -5501 (-35.98%)         398         254   -144 (-36.18%)
    syar_task_enter_pivot_root                  14898       9397    -5501 (-36.92%)         357         213   -144 (-40.34%)
    syar_syscalls_setreuid                      16678      11177    -5501 (-32.98%)         429         285   -144 (-33.57%)
    syar_syscalls_setuid                        16678      11177    -5501 (-32.98%)         429         285   -144 (-33.57%)
    syar_syscalls_process_vm_readv              14959       9458    -5501 (-36.77%)         364         220   -144 (-39.56%)
    syar_syscalls_process_vm_writev             15757      10256    -5501 (-34.91%)         390         246   -144 (-36.92%)
    do_uprobe                                   15519      10018    -5501 (-35.45%)         373         229   -144 (-38.61%)
    edgewall                                   179715      55783  -123932 (-68.96%)       12607        3999  -8608 (-68.28%)
    bictcp_state                                 7570       4131    -3439 (-45.43%)         496         269   -227 (-45.77%)
    cubictcp_state                               7570       4131    -3439 (-45.43%)         496         269   -227 (-45.77%)
    tcp_rate_skb_delivered                        447        272     -175 (-39.15%)          29          18    -11 (-37.93%)
    kprobe__bbr_set_state                        4566       2615    -1951 (-42.73%)         209         124    -85 (-40.67%)
    kprobe__bictcp_state                         4566       2615    -1951 (-42.73%)         209         124    -85 (-40.67%)
    inet_sock_set_state                          1501       1337     -164 (-10.93%)          93          85      -8 (-8.60%)
    tcp_retransmit_skb                           1145        981     -164 (-14.32%)          67          59     -8 (-11.94%)
    tcp_retransmit_synack                        1183        951     -232 (-19.61%)          67          55    -12 (-17.91%)
    bpf_tcptuner                                 1459       1187     -272 (-18.64%)          99          80    -19 (-19.19%)
    tw_egress                                     801        776       -25 (-3.12%)          69          66      -3 (-4.35%)
    tw_ingress                                    795        770       -25 (-3.14%)          69          66      -3 (-4.35%)
    ttls_tc_ingress                             19025      19383      +358 (+1.88%)         470         465      -5 (-1.06%)
    ttls_nat_egress                               490        299     -191 (-38.98%)          33          20    -13 (-39.39%)
    ttls_nat_ingress                              448        285     -163 (-36.38%)          32          21    -11 (-34.38%)
    tw_twfw_egress                             511127     212071  -299056 (-58.51%)       16733        8504  -8229 (-49.18%)
    tw_twfw_ingress                            500095     212069  -288026 (-57.59%)       16223        8504  -7719 (-47.58%)
    tw_twfw_tc_eg                              511113     212064  -299049 (-58.51%)       16732        8504  -8228 (-49.18%)
    tw_twfw_tc_in                              500095     212069  -288026 (-57.59%)       16223        8504  -7719 (-47.58%)
    tw_twfw_egress                              12632      12435      -197 (-1.56%)         276         260     -16 (-5.80%)
    tw_twfw_ingress                             12631      12454      -177 (-1.40%)         278         261     -17 (-6.12%)
    tw_twfw_tc_eg                               12595      12435      -160 (-1.27%)         274         259     -15 (-5.47%)
    tw_twfw_tc_in                               12631      12454      -177 (-1.40%)         278         261     -17 (-6.12%)
    tw_xdp_dump                                   266        209      -57 (-21.43%)           9           8     -1 (-11.11%)
    
    CILIUM
    =========
    File           Program                           Insns (A)  Insns (B)  Insns     (DIFF)  States (A)  States (B)  States  (DIFF)
    -------------  --------------------------------  ---------  ---------  ----------------  ----------  ----------  --------------
    bpf_host.o     cil_to_netdev                          6047       4578   -1469 (-24.29%)         362         249  -113 (-31.22%)
    bpf_host.o     handle_lxc_traffic                     2227       1585    -642 (-28.83%)         156         103   -53 (-33.97%)
    bpf_host.o     tail_handle_ipv4_from_netdev           2244       1458    -786 (-35.03%)         163         106   -57 (-34.97%)
    bpf_host.o     tail_handle_nat_fwd_ipv4              21022      10479  -10543 (-50.15%)        1289         670  -619 (-48.02%)
    bpf_host.o     tail_handle_nat_fwd_ipv6              15433      11375   -4058 (-26.29%)         905         643  -262 (-28.95%)
    bpf_host.o     tail_ipv4_host_policy_ingress          2219       1367    -852 (-38.40%)         161          96   -65 (-40.37%)
    bpf_host.o     tail_nodeport_nat_egress_ipv4         22460      19862   -2598 (-11.57%)        1469        1293  -176 (-11.98%)
    bpf_host.o     tail_nodeport_nat_ingress_ipv4         5526       3534   -1992 (-36.05%)         366         243  -123 (-33.61%)
    bpf_host.o     tail_nodeport_nat_ingress_ipv6         5132       4256    -876 (-17.07%)         241         219    -22 (-9.13%)
    bpf_host.o     tail_nodeport_nat_ipv6_egress          3702       3542     -160 (-4.32%)         215         205    -10 (-4.65%)
    bpf_lxc.o      tail_handle_nat_fwd_ipv4              21022      10479  -10543 (-50.15%)        1289         670  -619 (-48.02%)
    bpf_lxc.o      tail_handle_nat_fwd_ipv6              15433      11375   -4058 (-26.29%)         905         643  -262 (-28.95%)
    bpf_lxc.o      tail_ipv4_ct_egress                    5073       3374   -1699 (-33.49%)         262         172   -90 (-34.35%)
    bpf_lxc.o      tail_ipv4_ct_ingress                   5093       3385   -1708 (-33.54%)         262         172   -90 (-34.35%)
    bpf_lxc.o      tail_ipv4_ct_ingress_policy_only       5093       3385   -1708 (-33.54%)         262         172   -90 (-34.35%)
    bpf_lxc.o      tail_ipv6_ct_egress                    4593       3878    -715 (-15.57%)         194         151   -43 (-22.16%)
    bpf_lxc.o      tail_ipv6_ct_ingress                   4606       3891    -715 (-15.52%)         194         151   -43 (-22.16%)
    bpf_lxc.o      tail_ipv6_ct_ingress_policy_only       4606       3891    -715 (-15.52%)         194         151   -43 (-22.16%)
    bpf_lxc.o      tail_nodeport_nat_ingress_ipv4         5526       3534   -1992 (-36.05%)         366         243  -123 (-33.61%)
    bpf_lxc.o      tail_nodeport_nat_ingress_ipv6         5132       4256    -876 (-17.07%)         241         219    -22 (-9.13%)
    bpf_overlay.o  tail_handle_nat_fwd_ipv4              20524      10114  -10410 (-50.72%)        1271         638  -633 (-49.80%)
    bpf_overlay.o  tail_nodeport_nat_egress_ipv4         22718      19490   -3228 (-14.21%)        1475        1275  -200 (-13.56%)
    bpf_overlay.o  tail_nodeport_nat_ingress_ipv4         5526       3534   -1992 (-36.05%)         366         243  -123 (-33.61%)
    bpf_overlay.o  tail_nodeport_nat_ingress_ipv6         5132       4256    -876 (-17.07%)         241         219    -22 (-9.13%)
    bpf_overlay.o  tail_nodeport_nat_ipv6_egress          3638       3548      -90 (-2.47%)         209         203     -6 (-2.87%)
    bpf_overlay.o  tail_rev_nodeport_lb4                  4368       3820    -548 (-12.55%)         248         215   -33 (-13.31%)
    bpf_overlay.o  tail_rev_nodeport_lb6                  2867       2428    -439 (-15.31%)         167         140   -27 (-16.17%)
    bpf_sock.o     cil_sock6_connect                      1718       1703      -15 (-0.87%)         100          99     -1 (-1.00%)
    bpf_xdp.o      tail_handle_nat_fwd_ipv4              12917      12443     -474 (-3.67%)         875         849    -26 (-2.97%)
    bpf_xdp.o      tail_handle_nat_fwd_ipv6              13515      13264     -251 (-1.86%)         715         702    -13 (-1.82%)
    bpf_xdp.o      tail_lb_ipv4                          39492      36367    -3125 (-7.91%)        2430        2251   -179 (-7.37%)
    bpf_xdp.o      tail_lb_ipv6                          80441      78058    -2383 (-2.96%)        3647        3523   -124 (-3.40%)
    bpf_xdp.o      tail_nodeport_ipv6_dsr                 1038        901    -137 (-13.20%)          61          55     -6 (-9.84%)
    bpf_xdp.o      tail_nodeport_nat_egress_ipv4         13027      12096     -931 (-7.15%)         868         809    -59 (-6.80%)
    bpf_xdp.o      tail_nodeport_nat_ingress_ipv4         7617       5900   -1717 (-22.54%)         522         413  -109 (-20.88%)
    bpf_xdp.o      tail_nodeport_nat_ingress_ipv6         7575       7395     -180 (-2.38%)         383         374     -9 (-2.35%)
    bpf_xdp.o      tail_rev_nodeport_lb4                  6808       6739      -69 (-1.01%)         403         396     -7 (-1.74%)
    bpf_xdp.o      tail_rev_nodeport_lb6                 16173      15847     -326 (-2.02%)        1010         990    -20 (-1.98%)
    
    Acked-by: Eduard Zingerman <[email protected]>
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Paul Chaignon <[email protected]>
    Acked-by: Shung-Hsi Yu <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
btrfs: fix btrfs_ioctl_space_info() slot_count TOCTOU which can lead to info-leak [+ + +]
Author: Yochai Eisenrich <[email protected]>
Date:   Fri May 15 08:06:20 2026 -0400

    btrfs: fix btrfs_ioctl_space_info() slot_count TOCTOU which can lead to info-leak
    
    [ Upstream commit 973e57c726c1f8e77259d1c8e519519f1e9aea77 ]
    
    btrfs_ioctl_space_info() has a TOCTOU race between two passes over the
    block group RAID type lists. The first pass counts entries to determine
    the allocation size, then the second pass fills the buffer. The
    groups_sem rwlock is released between passes, allowing concurrent block
    group removal to reduce the entry count.
    
    When the second pass fills fewer entries than the first pass counted,
    copy_to_user() copies the full alloc_size bytes including trailing
    uninitialized kmalloc bytes to userspace.
    
    Fix by copying only total_spaces entries (the actually-filled count from
    the second pass) instead of alloc_size bytes, and switch to kzalloc so
    any future copy size mismatch cannot leak heap data.
    
    Fixes: 7fde62bffb57 ("Btrfs: buffer results in the space_info ioctl")
    CC: [email protected] # 3.0
    Signed-off-by: Yochai Eisenrich <[email protected]>
    Reviewed-by: David Sterba <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    [ adapted upstream's `return -EFAULT;` to stable's `ret = -EFAULT;` fall-through to existing `out:` cleanup label ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

btrfs: fix double free in create_space_info() error path [+ + +]
Author: Guangshuo Li <[email protected]>
Date:   Wed Apr 1 18:56:19 2026 +0800

    btrfs: fix double free in create_space_info() error path
    
    commit 3f487be81292702a59ea9dbc4088b3360a50e837 upstream.
    
    When kobject_init_and_add() fails, the call chain is:
    
    create_space_info()
    -> btrfs_sysfs_add_space_info_type()
    -> kobject_init_and_add()
    -> failure
    -> kobject_put(&space_info->kobj)
    -> space_info_release()
    -> kfree(space_info)
    
    Then control returns to create_space_info():
    
    btrfs_sysfs_add_space_info_type() returns error
    -> goto out_free
    -> kfree(space_info)
    
    This causes a double free.
    
    Keep the direct kfree(space_info) for the earlier failure path, but
    after btrfs_sysfs_add_space_info_type() has called kobject_put(), let
    the kobject release callback handle the cleanup.
    
    Fixes: a11224a016d6d ("btrfs: fix memory leaks in create_space_info() error paths")
    CC: [email protected] # 6.19+
    Reviewed-by: Qu Wenruo <[email protected]>
    Signed-off-by: Guangshuo Li <[email protected]>
    Signed-off-by: David Sterba <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
can: ucan: fix devres lifetime [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Mar 27 11:45:20 2026 +0100

    can: ucan: fix devres lifetime
    
    commit fed4626501c871890da287bec62a96e52da1af89 upstream.
    
    USB drivers bind to USB interfaces and any device managed resources
    should have their lifetime tied to the interface rather than parent USB
    device. This avoids issues like memory leaks when drivers are unbound
    without their devices being physically disconnected (e.g. on probe
    deferral or configuration changes).
    
    Fix the control message buffer lifetime so that it is released on driver
    unbind.
    
    Fixes: 9f2d3eae88d2 ("can: ucan: add driver for Theobroma Systems UCAN devices")
    Cc: [email protected]      # 4.19
    Cc: Jakob Unterwurzacher <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Marc Kleine-Budde <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ceph: only d_add() negative dentries when they are unhashed [+ + +]
Author: Max Kellermann <[email protected]>
Date:   Sat May 9 10:22:16 2026 -0400

    ceph: only d_add() negative dentries when they are unhashed
    
    [ Upstream commit 803447f93d75ab6e40c85e6d12b5630d281d70d6 ]
    
    Ceph can call d_add(dentry, NULL) on a negative dentry that is already
    present in the primary dcache hash.
    
    In the current VFS that is not safe.  d_add() goes through __d_add()
    to __d_rehash(), which unconditionally reinserts dentry->d_hash into
    the hlist_bl bucket.  If the dentry is already hashed, reinserting the
    same node can corrupt the bucket, including creating a self-loop.
    Once that happens, __d_lookup() can spin forever in the hlist_bl walk,
    typically looping only on the d_name.hash mismatch check and
    eventually triggering RCU stall reports like this one:
    
     rcu: INFO: rcu_sched self-detected stall on CPU
     rcu:         87-....: (2100 ticks this GP) idle=3a4c/1/0x4000000000000000 softirq=25003319/25003319 fqs=829
     rcu:         (t=2101 jiffies g=79058445 q=698988 ncpus=192)
     CPU: 87 UID: 2952868916 PID: 3933303 Comm: php-cgi8.3 Not tainted 6.18.17-i1-amd #950 NONE
     Hardware name: Dell Inc. PowerEdge R7615/0G9DHV, BIOS 1.6.6 09/22/2023
     RIP: 0010:__d_lookup+0x46/0xb0
     Code: c1 e8 07 48 8d 04 c2 48 8b 00 49 89 fc 49 89 f5 48 89 c3 48 83 e3 fe 48 83 f8 01 77 0f eb 2d 0f 1f 44 00 00 48 8b 1b 48 85 db <74> 20 39 6b 18 75 f3 48 8d 7b 78 e8 ba 85 d0 00 4c 39 63 10 74 1f
     RSP: 0018:ff745a70c8253898 EFLAGS: 00000282
     RAX: ff26e470054cb208 RBX: ff26e470054cb208 RCX: 000000006e958966
     RDX: ff26e48267340000 RSI: ff745a70c82539b0 RDI: ff26e458f74655c0
     RBP: 000000006e958966 R08: 0000000000000180 R09: 9cd08d909b919a89
     R10: ff26e458f74655c0 R11: 0000000000000000 R12: ff26e458f74655c0
     R13: ff745a70c82539b0 R14: d0d0d0d0d0d0d0d0 R15: 2f2f2f2f2f2f2f2f
     FS:  00007f5770896980(0000) GS:ff26e482c5d88000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 00007f5764de50c0 CR3: 000000a72abb5001 CR4: 0000000000771ef0
     PKRU: 55555554
     Call Trace:
      <TASK>
      lookup_fast+0x9f/0x100
      walk_component+0x1f/0x150
      link_path_walk+0x20e/0x3d0
      path_lookupat+0x68/0x180
      filename_lookup+0xdc/0x1e0
      vfs_statx+0x6c/0x140
      vfs_fstatat+0x67/0xa0
      __do_sys_newfstatat+0x24/0x60
      do_syscall_64+0x6a/0x230
      entry_SYSCALL_64_after_hwframe+0x76/0x7e
    
    This is reachable with reused cached negative dentries.  A Ceph lookup
    or atomic_open can be handed a negative dentry that is already hashed,
    and fs/ceph/dir.c then hits one of two paths that incorrectly assume
    "negative" also means "unhashed":
    
      - ceph_finish_lookup():
          MDS reply is -ENOENT with no trace
          -> d_add(dentry, NULL)
    
      - ceph_lookup():
          local ENOENT fast path for a complete directory with shared caps
          -> d_add(dentry, NULL)
    
    Both paths can therefore re-add an already-hashed negative dentry.
    
    Ceph already uses the correct pattern elsewhere: ceph_fill_trace() only
    calls d_add(dn, NULL) for a negative null-dentry reply when d_unhashed(dn)
    is true.
    
    Fix both fs/ceph/dir.c sites the same way: only call d_add() for a
    negative dentry when it is actually unhashed.  If the negative dentry
    is already hashed, leave it in place and reuse it as-is.
    
    This preserves the existing behavior for unhashed dentries while
    avoiding d_hash list corruption for reused hashed negatives.
    
    Cc: [email protected]
    Fixes: 2817b000b02c ("ceph: directory operations")
    Signed-off-by: Max Kellermann <[email protected]>
    Reviewed-by: Viacheslav Dubeyko <[email protected]>
    Signed-off-by: Ilya Dryomov <[email protected]>
    [ kept existing dout() debug call instead of upstream's doutc() form when adding the d_unhashed() guard around d_add() ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
cifs: abort open_cached_dir if we don't request leases [+ + +]
Author: Shyam Prasad N <[email protected]>
Date:   Tue Apr 28 21:37:47 2026 +0530

    cifs: abort open_cached_dir if we don't request leases
    
    commit d68ce834f8cf6cb2e77f3331df65166b35466b53 upstream.
    
    It is possible that SMB2_open_init may not set lease context based
    on the requested oplock level. This can happen when leases have been
    temporarily or permanently disabled. When this happens, we will have
    open_cached_dir making an open without lease context and the response
    will anyway be rejected by open_cached_dir (thereby forcing a close to
    discard this open). That's unnecessary two round-trips to the server.
    
    This change adds a check before making the open request to the server
    to make sure that SMB2_open_init did add the expected lease context
    to the open in open_cached_dir.
    
    Cc: <[email protected]>
    Reviewed-by: Bharath SM <[email protected]>
    Signed-off-by: Shyam Prasad N <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

cifs: change_conf needs to be called for session setup [+ + +]
Author: Shyam Prasad N <[email protected]>
Date:   Mon Mar 30 16:19:59 2026 +0530

    cifs: change_conf needs to be called for session setup
    
    commit c208a2b95811d6e1ebae65d0d2fc13f73707f8e7 upstream.
    
    Today we skip calling change_conf for negotiates and session setup
    requests. This can be a problem for mchan as the immediate next call
    after session setup could be due to an I/O that is made on the
    mount point. For single channel, this is not a problem as
    there will be several calls after setting up session.
    
    This change enforces calling change_conf when the total credits contain
    enough for reservations for echoes and oplocks. We expect this to happen
    during the last session setup response. This way, echoes and oplocks are
    not disabled before the first request to the server. So if that first
    request is an open, it does not need to disable requesting leases.
    
    Cc: <[email protected]>
    Reviewed-by: Bharath SM <[email protected]>
    Signed-off-by: Shyam Prasad N <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
clk: imx: imx8-acm: fix flags for acm clocks [+ + +]
Author: Stefan Eichenberger <[email protected]>
Date:   Thu Feb 12 16:57:50 2026 +0800

    clk: imx: imx8-acm: fix flags for acm clocks
    
    commit f2c2fc93b4a3efdfcf3805ab74741826d343ff2c upstream.
    
    Currently, the flags for the ACM clocks are set to 0. This configuration
    causes the fsl-sai audio driver to fail when attempting to set the
    sysclk, returning an EINVAL error. The following error messages
    highlight the issue:
    fsl-sai 59090000.sai: ASoC: error at snd_soc_dai_set_sysclk on 59090000.sai: -22
    imx-hdmi sound-hdmi: failed to set cpu sysclk: -22
    
    By setting the flag CLK_SET_RATE_NO_REPARENT, we signal that the ACM
    driver does not support reparenting and instead relies on the clock tree
    as defined in the device tree. This change resolves the issue with the
    fsl-sai audio driver.
    
    CC: [email protected]
    Fixes: d3a0946d7ac9 ("clk: imx: imx8: add audio clock mux driver")
    Signed-off-by: Stefan Eichenberger <[email protected]>
    Signed-off-by: Shengjiu Wang <[email protected]>
    Reviewed-by: Peng Fan <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Abel Vesa <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: microchip: mpfs-ccc: fix out of bounds access during output registration [+ + +]
Author: Conor Dooley <[email protected]>
Date:   Tue Feb 24 09:35:25 2026 +0000

    clk: microchip: mpfs-ccc: fix out of bounds access during output registration
    
    commit 2f7ae8ab6aa73daaf080d5332110357c29df9c36 upstream.
    
    UBSAN reported an out of bounds access during registration of the last
    two outputs. This out of bounds access occurs because space is only
    allocated in the hws array for two PLLs and the four output dividers
    that each has, but the defined IDs contain two DLLS and their two
    outputs each, which are not supported by the driver. The ID order is
    PLLs -> DLLs -> PLL outputs -> DLL outputs. Decrement the PLL output IDs
    by two while adding them to the array to avoid the problem.
    
    Fixes: d39fb172760e ("clk: microchip: add PolarFire SoC fabric clock support")
    CC: [email protected]
    Reviewed-by: Brian Masney <[email protected]>
    Signed-off-by: Conor Dooley <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

clk: rk808: fix OF node reference imbalance [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Tue Apr 7 11:50:27 2026 +0200

    clk: rk808: fix OF node reference imbalance
    
    commit de019f203b0d472c98ead4081ad4f05d92c9b826 upstream.
    
    The driver reuses the OF node of the parent multi-function device but
    fails to take another reference to balance the one dropped by the
    platform bus code when unbinding the MFD and deregistering the child
    devices.
    
    Fix this by using the intended helper for reusing OF nodes.
    
    Fixes: 2dc51ca822e4 ("clk: RK808: Reduce 'struct rk808' usage")
    Cc: [email protected]      # 6.5
    Cc: Sebastian Reichel <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Reviewed-by: Sebastian Reichel <[email protected]>
    Reviewed-by: Brian Masney <[email protected]>
    Reviewed-by: Heiko Stuebner <[email protected]>
    Signed-off-by: Stephen Boyd <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
cpuidle: powerpc: avoid double clear when breaking snooze [+ + +]
Author: Shrikanth Hegde <[email protected]>
Date:   Wed Mar 11 11:47:09 2026 +0530

    cpuidle: powerpc: avoid double clear when breaking snooze
    
    commit 64ed1e3e728afb57ba9acb59e69de930ead847d9 upstream.
    
    snooze_loop is done often in any system which has fair bit of
    idle time. So it qualifies for even micro-optimizations.
    
    When breaking the snooze due to timeout, TIF_POLLING_NRFLAG is cleared
    twice. Clearing the bit invokes atomics. Avoid double clear and thereby
    avoid one atomic write.
    
    dev->poll_time_limit indicates whether the loop was broken due to
    timeout. Use that instead of defining a new variable.
    
    Fixes: 7ded429152e8 ("cpuidle: powerpc: no memory barrier after break from idle")
    Cc: [email protected]
    Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <[email protected]>
    Signed-off-by: Shrikanth Hegde <[email protected]>
    Signed-off-by: Madhavan Srinivasan <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
crypto: arm64/aes - Fix 32-bit aes_mac_update() arg treated as 64-bit [+ + +]
Author: Eric Biggers <[email protected]>
Date:   Wed Feb 18 13:34:49 2026 -0800

    crypto: arm64/aes - Fix 32-bit aes_mac_update() arg treated as 64-bit
    
    commit f8f08d7cc43237e91e3aedf7b67d015d24c38fcc upstream.
    
    Since the 'enc_after' argument to neon_aes_mac_update() and
    ce_aes_mac_update() has type 'int', it needs to be accessed using the
    corresponding 32-bit register, not the 64-bit register.  The upper half
    of the corresponding 64-bit register may contain garbage.
    
    Fixes: 4860620da7e5 ("crypto: arm64/aes - add NEON/Crypto Extensions CBCMAC/CMAC/XCBC driver")
    Cc: [email protected]
    Reviewed-by: Ard Biesheuvel <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Eric Biggers <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: atmel-aes - Fix 3-page memory leak in atmel_aes_buff_cleanup [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Wed Mar 11 03:07:35 2026 +0100

    crypto: atmel-aes - Fix 3-page memory leak in atmel_aes_buff_cleanup
    
    commit 3fcfff4ed35f963380a68741bcd52742baff7f76 upstream.
    
    atmel_aes_buff_init() allocates 4 pages using __get_free_pages() with
    ATMEL_AES_BUFFER_ORDER, but atmel_aes_buff_cleanup() frees only the
    first page using free_page(), leaking the remaining 3 pages. Use
    free_pages() with ATMEL_AES_BUFFER_ORDER to fix the memory leak.
    
    Fixes: bbe628ed897d ("crypto: atmel-aes - improve performances of data transfer")
    Cc: [email protected]
    Signed-off-by: Thorsten Blum <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: atmel-ecc - Release client on allocation failure [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Fri Feb 20 15:03:13 2026 +0100

    crypto: atmel-ecc - Release client on allocation failure
    
    commit 095d50008d55d13f8fcf1bbeb7c6eba51779bc85 upstream.
    
    Call atmel_ecc_i2c_client_free() to release the I2C client reserved by
    atmel_ecc_i2c_client_alloc() when crypto_alloc_kpp() fails. Otherwise
    ->tfm_count will be out of sync.
    
    Fixes: 11105693fa05 ("crypto: atmel-ecc - introduce Microchip / Atmel ECC driver")
    Cc: [email protected]
    Signed-off-by: Thorsten Blum <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: atmel-sha204a - Fix potential UAF and memory leak in remove path [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Sat Mar 14 20:36:29 2026 +0100

    crypto: atmel-sha204a - Fix potential UAF and memory leak in remove path
    
    commit bab1adf3b87e4bfac92c4f5963c63db434d561c1 upstream.
    
    Unregister the hwrng to prevent new ->read() calls and flush the Atmel
    I2C workqueue before teardown to prevent a potential UAF if a queued
    callback runs while the device is being removed.
    
    Drop the early return to ensure sysfs entries are removed and
    ->hwrng.priv is freed, preventing a memory leak.
    
    Fixes: da001fb651b0 ("crypto: atmel-i2c - add support for SHA204A random number generator")
    Cc: [email protected]
    Signed-off-by: Thorsten Blum <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: atmel-tdes - fix DMA sync direction [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Sat Mar 7 16:31:10 2026 +0100

    crypto: atmel-tdes - fix DMA sync direction
    
    commit c8a9a647532f5c2a04180352693215e24e9dba03 upstream.
    
    Before DMA output is consumed by the CPU, ->dma_addr_out must be synced
    with dma_sync_single_for_cpu() instead of dma_sync_single_for_device().
    Using the wrong direction can return stale cache data on non-coherent
    platforms.
    
    Fixes: 13802005d8f2 ("crypto: atmel - add Atmel DES/TDES driver")
    Fixes: 1f858040c2f7 ("crypto: atmel-tdes - add support for latest release of the IP (0x700)")
    Cc: [email protected]
    Signed-off-by: Thorsten Blum <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: authencesn - reject short ahash digests during instance creation [+ + +]
Author: Yucheng Lu <[email protected]>
Date:   Wed Apr 22 21:45:04 2026 +0800

    crypto: authencesn - reject short ahash digests during instance creation
    
    commit 5db6ef9847717329f12c5ea8aba7e9f588a980c0 upstream.
    
    authencesn requires either a zero authsize or an authsize of at least
    4 bytes because the ESN encrypt/decrypt paths always move 4 bytes of
    high-order sequence number data at the end of the authenticated data.
    
    While crypto_authenc_esn_setauthsize() already rejects explicit
    non-zero authsizes in the range 1..3, crypto_authenc_esn_create()
    still copied auth->digestsize into inst->alg.maxauthsize without
    validating it.  The AEAD core then initialized the tfm's default
    authsize from that value.
    
    As a result, selecting an ahash with digest size 1..3, such as
    cbcmac(cipher_null), exposed authencesn instances whose default
    authsize was invalid even though setauthsize() would have rejected the
    same value.  AF_ALG could then trigger the ESN tail handling with a
    too-short tag and hit an out-of-bounds access.
    
    Reject authencesn instances whose ahash digest size is in the invalid
    non-zero range 1..3 so that no tfm can inherit an unsupported default
    authsize.
    
    Fixes: f15f05b0a5de ("crypto: ccm - switch to separate cbcmac driver")
    Cc: [email protected]
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Co-developed-by: Yuan Tan <[email protected]>
    Signed-off-by: Yuan Tan <[email protected]>
    Suggested-by: Xin Liu <[email protected]>
    Tested-by: Yuhang Zheng <[email protected]>
    Reviewed-by: Eric Biggers <[email protected]>
    Signed-off-by: Yucheng Lu <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: caam - guard HMAC key hex dumps in hash_digest_key [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Sun May 10 09:15:08 2026 -0400

    crypto: caam - guard HMAC key hex dumps in hash_digest_key
    
    [ Upstream commit 177730a273b18e195263ed953853273e901b5064 ]
    
    Use print_hex_dump_devel() for dumping sensitive HMAC key bytes in
    hash_digest_key() to avoid leaking secrets at runtime when
    CONFIG_DYNAMIC_DEBUG is enabled.
    
    Fixes: 045e36780f11 ("crypto: caam - ahash hmac support")
    Fixes: 3f16f6c9d632 ("crypto: caam/qi2 - add support for ahash algorithms")
    Cc: [email protected]
    Signed-off-by: Thorsten Blum <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: ccree - fix a memory leak in cc_mac_digest() [+ + +]
Author: Haoxiang Li <[email protected]>
Date:   Mon Mar 30 11:34:02 2026 +0800

    crypto: ccree - fix a memory leak in cc_mac_digest()
    
    commit 02c64052fad03699b9c6d1df2f9b444d17e4ac50 upstream.
    
    Add cc_unmap_result() if cc_map_hash_request_final()
    fails to prevent potential memory leak.
    
    Fixes: 63893811b0fc ("crypto: ccree - add ahash support")
    Cc: [email protected]
    Signed-off-by: Haoxiang Li <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: hisilicon - Fix dma_unmap_single() direction [+ + +]
Author: Thomas Fourier <[email protected]>
Date:   Mon Mar 30 17:19:32 2026 +0200

    crypto: hisilicon - Fix dma_unmap_single() direction
    
    commit 1ee57ab93b75eb59f426aef37b5498a7ffc28278 upstream.
    
    The direction used to map the buffer skreq->iv is DMA_TO_DEVICE but it is
    unmapped with direction DMA_BIDIRECTIONAL in the error path.
    
    Change the unmap to match the mapping.
    
    Fixes: 915e4e8413da ("crypto: hisilicon - SEC security accelerator driver")
    Cc: <[email protected]>
    Signed-off-by: Thomas Fourier <[email protected]>
    Reviewed-by: Thorsten Blum <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: nx - Avoid -Wflex-array-member-not-at-end warning [+ + +]
Author: Gustavo A. R. Silva <[email protected]>
Date:   Fri May 8 23:31:48 2026 -0400

    crypto: nx - Avoid -Wflex-array-member-not-at-end warning
    
    [ Upstream commit 1e6b251ce1759392666856908113dd5d7cea044d ]
    
    -Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
    ready to enable it globally. So, we are deprecating flexible-array
    members in the middle of another structure.
    
    There is currently an object (`header`) in `struct nx842_crypto_ctx`
    that contains a flexible structure (`struct nx842_crypto_header`):
    
    struct nx842_crypto_ctx {
            ...
            struct nx842_crypto_header header;
            struct nx842_crypto_header_group group[NX842_CRYPTO_GROUP_MAX];
            ...
    };
    
    So, in order to avoid ending up with a flexible-array member in the
    middle of another struct, we use the `struct_group_tagged()` helper to
    separate the flexible array from the rest of the members in the flexible
    structure:
    
    struct nx842_crypto_header {
            struct_group_tagged(nx842_crypto_header_hdr, hdr,
    
                    ... the rest of the members
    
            );
            struct nx842_crypto_header_group group[];
    } __packed;
    
    With the change described above, we can now declare an object of the
    type of the tagged struct, without embedding the flexible array in the
    middle of another struct:
    
    struct nx842_crypto_ctx {
            ...
            struct nx842_crypto_header_hdr header;
            struct nx842_crypto_header_group group[NX842_CRYPTO_GROUP_MAX];
            ...
     } __packed;
    
    We also use `container_of()` whenever we need to retrieve a pointer to
    the flexible structure, through which we can access the flexible
    array if needed.
    
    So, with these changes, fix the following warning:
    
    In file included from drivers/crypto/nx/nx-842.c:55:
    drivers/crypto/nx/nx-842.h:174:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
      174 |         struct nx842_crypto_header header;
          |                                    ^~~~~~
    
    Signed-off-by: Gustavo A. R. Silva <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Stable-dep-of: adb3faf2db1a ("crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Fri May 8 23:31:50 2026 -0400

    crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx
    
    [ Upstream commit adb3faf2db1a66d0f015b44ac909a32dfc7f2f9c ]
    
    The bounce buffers are allocated with __get_free_pages() using
    BOUNCE_BUFFER_ORDER (order 2 = 4 pages), but both the allocation error
    path and nx842_crypto_free_ctx() release the buffers with free_page().
    Use free_pages() with the matching order instead.
    
    Fixes: ed70b479c2c0 ("crypto: nx - add hardware 842 crypto comp alg")
    Cc: [email protected]
    Signed-off-by: Thorsten Blum <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: nx - fix context leak in nx842_crypto_free_ctx [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Wed Mar 11 16:56:49 2026 +0100

    crypto: nx - fix context leak in nx842_crypto_free_ctx
    
    commit 344e6a4f7ff4756b9b3f75e0eb7eaec297e35540 upstream.
    
    Since the scomp conversion, nx842_crypto_alloc_ctx() allocates the
    context separately, but nx842_crypto_free_ctx() never releases it. Add
    the missing kfree(ctx) to nx842_crypto_free_ctx(), and reuse
    nx842_crypto_free_ctx() in the allocation error path.
    
    Fixes: 980b5705f4e7 ("crypto: nx - Migrate to scomp API")
    Cc: [email protected]
    Signed-off-by: Thorsten Blum <[email protected]>
    Reviewed-by: Ard Biesheuvel <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: nx - Migrate to scomp API [+ + +]
Author: Ard Biesheuvel <[email protected]>
Date:   Fri May 8 23:31:49 2026 -0400

    crypto: nx - Migrate to scomp API
    
    [ Upstream commit 980b5705f4e73f567e405cd18337cc32fd51cf79 ]
    
    The only remaining user of 842 compression has been migrated to the
    acomp compression API, and so the NX hardware driver has to follow suit,
    given that no users of the obsolete 'comp' API remain, and it is going
    to be removed.
    
    So migrate the NX driver code to scomp. These will be wrapped and
    exposed as acomp implementation via the crypto subsystem's
    acomp-to-scomp adaptation layer.
    
    Signed-off-by: Ard Biesheuvel <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Stable-dep-of: adb3faf2db1a ("crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: pcrypt - Fix handling of MAY_BACKLOG requests [+ + +]
Author: Herbert Xu <[email protected]>
Date:   Thu Apr 16 17:00:50 2026 +0800

    crypto: pcrypt - Fix handling of MAY_BACKLOG requests
    
    commit 915b692e6cb723aac658c25eb82c58fd81235110 upstream.
    
    MAY_BACKLOG requests can return EBUSY.  Handle them by checking
    for that value and filtering out EINPROGRESS notifications.
    
    Reported-by: Yiming Qian <[email protected]>
    Fixes: 5a1436beec57 ("crypto: pcrypt - call the complete function on error")
    Signed-off-by: Herbert Xu <[email protected]>
    Cc: Eric Biggers <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: talitos - fix SEC1 32k ahash request limitation [+ + +]
Author: Paul Louvel <[email protected]>
Date:   Mon Mar 30 12:28:18 2026 +0200

    crypto: talitos - fix SEC1 32k ahash request limitation
    
    commit 655ef638a2bc3cd0a9eff99a02f83cab94a3a917 upstream.
    
    Since commit c662b043cdca ("crypto: af_alg/hash: Support
    MSG_SPLICE_PAGES"), the crypto core may pass large scatterlists spanning
    multiple pages to drivers supporting ahash operations. As a result, a
    driver can now receive large ahash requests.
    
    The SEC1 engine has a limitation where a single descriptor cannot
    process more than 32k of data. The current implementation attempts to
    handle the entire request within a single descriptor, which leads to
    failures raised by the driver:
    
      "length exceeds h/w max limit"
    
    Address this limitation by splitting large ahash requests into multiple
    descriptors, each respecting the 32k hardware limit. This allows
    processing arbitrarily large requests.
    
    Cc: [email protected]
    Fixes: c662b043cdca ("crypto: af_alg/hash: Support MSG_SPLICE_PAGES")
    Signed-off-by: Paul Louvel <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: talitos - rename first/last to first_desc/last_desc [+ + +]
Author: Paul Louvel <[email protected]>
Date:   Mon Mar 30 12:28:19 2026 +0200

    crypto: talitos - rename first/last to first_desc/last_desc
    
    commit a1b80018b8cec27fc06a8b04a7f8b5f6cfe86eae upstream.
    
    Previous commit introduces a new last_request variable in the context
    structure.
    
    Renaming the first/last existing member variable in the context
    structure to improve readability.
    
    Cc: [email protected]
    Signed-off-by: Paul Louvel <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
device property: Make modifications of fwnode "flags" thread safe [+ + +]
Author: Douglas Anderson <[email protected]>
Date:   Tue Mar 17 09:01:20 2026 -0700

    device property: Make modifications of fwnode "flags" thread safe
    
    commit f72e77c33e4b5657af35125e75bab249256030f3 upstream.
    
    In various places in the kernel, we modify the fwnode "flags" member
    by doing either:
      fwnode->flags |= SOME_FLAG;
      fwnode->flags &= ~SOME_FLAG;
    
    This type of modification is not thread-safe. If two threads are both
    mucking with the flags at the same time then one can clobber the
    other.
    
    While flags are often modified while under the "fwnode_link_lock",
    this is not universally true.
    
    Create some accessor functions for setting, clearing, and testing the
    FWNODE flags and move all users to these accessor functions. New
    accessor functions use set_bit() and clear_bit(), which are
    thread-safe.
    
    Cc: [email protected]
    Fixes: c2c724c868c4 ("driver core: Add fw_devlink_parse_fwtree()")
    Reviewed-by: Andy Shevchenko <[email protected]>
    Acked-by: Mark Brown <[email protected]>
    Reviewed-by: Wolfram Sang <[email protected]>
    Signed-off-by: Douglas Anderson <[email protected]>
    Reviewed-by: Rafael J. Wysocki (Intel) <[email protected]>
    Reviewed-by: Saravana Kannan <[email protected]>
    Link: https://patch.msgid.link/20260317090112.v2.1.I0a4d03104ecd5103df3d76f66c8d21b1d15a2e38@changeid
    [ Fix fwnode_clear_flag() argument alignment, restore dropped blank
      line in fwnode_dev_initialized(), and remove unnecessary parentheses
      around fwnode_test_flag() calls. - Danilo ]
    Signed-off-by: Danilo Krummrich <[email protected]>
    Signed-off-by: Douglas Anderson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
dm mirror: fix integer overflow in create_dirty_log() [+ + +]
Author: Junrui Luo <[email protected]>
Date:   Sun Mar 1 21:10:58 2026 +0800

    dm mirror: fix integer overflow in create_dirty_log()
    
    commit 4c788c6f921b22f9b6c3f316c4a071c05683e7de upstream.
    
    The argument count calculation in create_dirty_log() performs
    `*args_used = 2 + param_count` before validating against argc. When a
    user provides a param_count close to UINT_MAX via the device mapper
    table string, this unsigned addition wraps around to a small value,
    causing the subsequent `argc < *args_used` check to be bypassed.
    
    The overflowed param_count is then passed as argc to dm_dirty_log_create(),
    where it can cause out-of-bounds reads on the argv array.
    
    Fix by comparing param_count against argc - 2 before performing the
    addition, following the same pattern used by parse_features() in the
    same file. Since argc >= 2 is already guaranteed, the subtraction is
    safe.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: [email protected]
    Reported-by: Yuhao Jiang <[email protected]>
    Signed-off-by: Junrui Luo <[email protected]>
    Reviewed-by: Benjamin Marzinski <[email protected]>
    Signed-off-by: Mikulas Patocka <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
dm-thin: fix metadata refcount underflow [+ + +]
Author: Mikulas Patocka <[email protected]>
Date:   Mon Apr 20 19:56:44 2026 +0200

    dm-thin: fix metadata refcount underflow
    
    commit 09a65adc7d8bbfce06392cb6d375468e2728ead5 upstream.
    
    There's a bug in dm-thin in the function rebalance_children. If the
    internal btree node has one entry, the code tries to copy all btree
    entries from the node's child to the node itself and then decrement the
    child's reference count.
    
    If the child node is shared (it has reference count > 1), we won't free
    it, so there would be two pointers to each of the grandchildren nodes.
    But the reference counts of the grandchildren is not increased, thus the
    reference count doesn't match the number of pointers that point to the
    grandchildren. This results in "device mapper: space map common: unable
    to decrement block" errors.
    
    Fix this bug by incrementing reference counts on the grandchildren if the
    btree node is shared.
    
    Signed-off-by: Mikulas Patocka <[email protected]>
    Fixes: 3241b1d3e0aa ("dm: add persistent data library")
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
dm-verity-fec: correctly reject too-small FEC devices [+ + +]
Author: Eric Biggers <[email protected]>
Date:   Thu Feb 5 20:59:20 2026 -0800

    dm-verity-fec: correctly reject too-small FEC devices
    
    commit 2b14e0bb63cc671120e7791658f5c494fc66d072 upstream.
    
    Fix verity_fec_ctr() to reject too-small FEC devices by correctly
    computing the number of parity blocks as 'f->rounds * f->roots'.
    Previously it incorrectly used 'div64_u64(f->rounds * f->roots,
    v->fec->roots << SECTOR_SHIFT)' which is a much smaller value.
    
    Note that the units of 'rounds' are blocks, not bytes.  This matches the
    units of the value returned by dm_bufio_get_device_size(), which are
    also blocks.  A later commit will give 'rounds' a clearer name.
    
    Fixes: a739ff3f543a ("dm verity: add support for forward error correction")
    Cc: [email protected]
    Signed-off-by: Eric Biggers <[email protected]>
    Signed-off-by: Mikulas Patocka <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

dm-verity-fec: correctly reject too-small hash devices [+ + +]
Author: Eric Biggers <[email protected]>
Date:   Thu Feb 5 20:59:21 2026 -0800

    dm-verity-fec: correctly reject too-small hash devices
    
    commit 4355142245f7e55336dcc005ec03592df4d546f8 upstream.
    
    Fix verity_fec_ctr() to reject too-small hash devices by correctly
    taking hash_start into account.
    
    Note that this is necessary because dm-verity doesn't call
    dm_bufio_set_sector_offset() on the hash device's bufio client
    (v->bufio).  Thus, dm_bufio_get_device_size(v->bufio) returns a size
    relative to 0 rather than hash_start.  An alternative fix would be to
    call dm_bufio_set_sector_offset() on v->bufio, but then all the code
    that reads from the hash device would have to be adjusted accordingly.
    
    Fixes: a739ff3f543a ("dm verity: add support for forward error correction")
    Cc: [email protected]
    Signed-off-by: Eric Biggers <[email protected]>
    Signed-off-by: Mikulas Patocka <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
dm: don't report warning when doing deferred remove [+ + +]
Author: Mikulas Patocka <[email protected]>
Date:   Mon Mar 16 15:04:15 2026 +0100

    dm: don't report warning when doing deferred remove
    
    commit b7cce3e2cca9cd78418f3c3784474b778e7996fe upstream.
    
    If dm_hash_remove_all was called from dm_deferred_remove, it would write
    a warning "remove_all left %d open device(s)" if there are some other
    devices active.
    
    The warning is bogus, so let's disable it in this case.
    
    Signed-off-by: Mikulas Patocka <[email protected]>
    Reported-by: Zdenek Kabelac <[email protected]>
    Cc: [email protected]
    Fixes: 2c140a246dc0 ("dm: allow remove to be deferred")
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

dm: fix a buffer overflow in ioctl processing [+ + +]
Author: Mikulas Patocka <[email protected]>
Date:   Thu Apr 9 17:49:58 2026 +0200

    dm: fix a buffer overflow in ioctl processing
    
    commit 2fa49cc884f6496a915c35621ba4da35649bf159 upstream.
    
    Tony Asleson (using Claude) found a buffer overflow in dm-ioctl in the
    function retrieve_status:
    
    1. The code in retrieve_status checks that the output string fits into
       the output buffer and writes the output string there
    2. Then, the code aligns the "outptr" variable to the next 8-byte
       boundary:
            outptr = align_ptr(outptr);
    3. The alignment doesn't check overflow, so outptr could point past the
       buffer end
    4. The "for" loop is iterated again, it executes:
            remaining = len - (outptr - outbuf);
    5. If "outptr" points past "outbuf + len", the arithmetics wraps around
       and the variable "remaining" contains unusually high number
    6. With "remaining" being high, the code writes more data past the end of
       the buffer
    
    Luckily, this bug has no security implications because:
    1. Only root can issue device mapper ioctls
    2. The commonly used libraries that communicate with device mapper
       (libdevmapper and devicemapper-rs) use buffer size that is aligned to
       8 bytes - thus, "outptr = align_ptr(outptr)" can't overshoot the input
       buffer and the bug can't happen accidentally
    
    Reported-by: Tony Asleson <[email protected]>
    Signed-off-by: Mikulas Patocka <[email protected]>
    Reviewed-by: Bryn M. Reeves <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
dmaengine: idxd: Fix crash when the event log is disabled [+ + +]
Author: Vinicius Costa Gomes <[email protected]>
Date:   Sat May 9 15:48:21 2026 +0800

    dmaengine: idxd: Fix crash when the event log is disabled
    
    [ Upstream commit 52d2edea0d63c935e82631e4b9e4a94eccf97b5b ]
    
    If reporting errors to the event log is not supported by the hardware,
    and an error that causes Function Level Reset (FLR) is received, the
    driver will try to restore the event log even if it was not allocated.
    
    Also, only try to free the event log if it was properly allocated.
    
    Fixes: 6078a315aec1 ("dmaengine: idxd: Add idxd_device_config_save() and idxd_device_config_restore() helpers")
    Reviewed-by: Dave Jiang <[email protected]>
    Signed-off-by: Vinicius Costa Gomes <[email protected]>
    Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-2-7ed70658a9d1@intel.com
    Signed-off-by: Vinod Koul <[email protected]>
    [ Only the idxd_device_evl_free() NULL check portion was backported in v6.6.
    idxd_device_config_restore() does not exist in v6.6. It was introduced
    in 6.14. ]
    Signed-off-by: Wenshan Lan <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

dmaengine: idxd: Fix leaking event log memory [+ + +]
Author: Vinicius Costa Gomes <[email protected]>
Date:   Sat May 9 15:48:22 2026 +0800

    dmaengine: idxd: Fix leaking event log memory
    
    [ Upstream commit ee66bc29578391c9b48523dc9119af67bd5c7c0f ]
    
    During the device remove process, the device is reset, causing the
    configuration registers to go back to their default state, which is
    zero. As the driver is checking if the event log support was enabled
    before deallocating, it will fail if a reset happened before.
    
    Do not check if the support was enabled, the check for 'idxd->evl'
    being valid (only allocated if the HW capability is available) is
    enough.
    
    Fixes: 244da66cda35 ("dmaengine: idxd: setup event log configuration")
    Reviewed-by: Dave Jiang <[email protected]>
    Signed-off-by: Vinicius Costa Gomes <[email protected]>
    Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-10-7ed70658a9d1@intel.com
    Signed-off-by: Vinod Koul <[email protected]>
    Signed-off-by: Wenshan Lan <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
driver core: Add kernel-doc for DEV_FLAG_COUNT enum value [+ + +]
Author: Douglas Anderson <[email protected]>
Date:   Mon Apr 13 19:59:11 2026 -0700

    driver core: Add kernel-doc for DEV_FLAG_COUNT enum value
    
    commit 5b484311507b5d403c1f7a45f6aa3778549e268b upstream.
    
    Even though nobody should use this value (except when declaring the
    "flags" bitmap), kernel-doc still gets upset that it's not documented.
    It reports:
    
      WARNING: ../include/linux/device.h:519
      Enum value 'DEV_FLAG_COUNT' not described in enum 'struct_device_flags'
    
    Add the description of DEV_FLAG_COUNT.
    
    Fixes: a2225b6e834a ("driver core: Don't let a device probe until it's ready")
    Reported-by: Randy Dunlap <[email protected]>
    Closes: https://lore.kernel.org/[email protected]
    Signed-off-by: Douglas Anderson <[email protected]>
    Tested-by: Randy Dunlap <[email protected]>
    Reviewed-by: Randy Dunlap <[email protected]>
    Link: https://patch.msgid.link/20260413195910.1.I23aca74fe2d3636a47df196a80920fecb2643220@changeid
    Signed-off-by: Danilo Krummrich <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

driver core: Don't let a device probe until it's ready [+ + +]
Author: Douglas Anderson <[email protected]>
Date:   Mon Apr 27 09:52:41 2026 -0700

    driver core: Don't let a device probe until it's ready
    
    [ Upstream commit a2225b6e834a838ae3c93709760edc0a169eb2f2 ]
    
    The moment we link a "struct device" into the list of devices for the
    bus, it's possible probe can happen. This is because another thread
    can load the driver at any time and that can cause the device to
    probe. This has been seen in practice with a stack crawl that looks
    like this [1]:
    
      really_probe()
      __driver_probe_device()
      driver_probe_device()
      __driver_attach()
      bus_for_each_dev()
      driver_attach()
      bus_add_driver()
      driver_register()
      __platform_driver_register()
      init_module() [some module]
      do_one_initcall()
      do_init_module()
      load_module()
      __arm64_sys_finit_module()
      invoke_syscall()
    
    As a result of the above, it was seen that device_links_driver_bound()
    could be called for the device before "dev->fwnode->dev" was
    assigned. This prevented __fw_devlink_pickup_dangling_consumers() from
    being called which meant that other devices waiting on our driver's
    sub-nodes were stuck deferring forever.
    
    It's believed that this problem is showing up suddenly for two
    reasons:
    1. Android has recently (last ~1 year) implemented an optimization to
       the order it loads modules [2]. When devices opt-in to this faster
       loading, modules are loaded one-after-the-other very quickly. This
       is unlike how other distributions do it. The reproduction of this
       problem has only been seen on devices that opt-in to Android's
       "parallel module loading".
    2. Android devices typically opt-in to fw_devlink, and the most
       noticeable issue is the NULL "dev->fwnode->dev" in
       device_links_driver_bound(). fw_devlink is somewhat new code and
       also not in use by all Linux devices.
    
    Even though the specific symptom where "dev->fwnode->dev" wasn't
    assigned could be fixed by moving that assignment higher in
    device_add(), other parts of device_add() (like the call to
    device_pm_add()) are also important to run before probe. Only moving
    the "dev->fwnode->dev" assignment would likely fix the current
    symptoms but lead to difficult-to-debug problems in the future.
    
    Fix the problem by preventing probe until device_add() has run far
    enough that the device is ready to probe. If somehow we end up trying
    to probe before we're allowed, __driver_probe_device() will return
    -EPROBE_DEFER which will make certain the device is noticed.
    
    In the race condition that was seen with Android's faster module
    loading, we will temporarily add the device to the deferred list and
    then take it off immediately when device_add() probes the device.
    
    Instead of adding another flag to the bitfields already in "struct
    device", instead add a new "flags" field and use that. This allows us
    to freely change the bit from different thread without worrying about
    corrupting nearby bits (and means threads changing other bit won't
    corrupt us).
    
    [1] Captured on a machine running a downstream 6.6 kernel
    [2] https://cs.android.com/android/platform/superproject/main/+/main:system/core/libmodprobe/libmodprobe.cpp?q=LoadModulesParallel
    
    Cc: [email protected]
    Fixes: 2023c610dc54 ("Driver core: add new device to bus's list before probing")
    Reviewed-by: Alan Stern <[email protected]>
    Reviewed-by: Rafael J. Wysocki (Intel) <[email protected]>
    Reviewed-by: Danilo Krummrich <[email protected]>
    Acked-by: Greg Kroah-Hartman <[email protected]>
    Acked-by: Marek Szyprowski <[email protected]>
    Signed-off-by: Douglas Anderson <[email protected]>
    Link: https://patch.msgid.link/20260406162231.v5.1.Id750b0fbcc94f23ed04b7aecabcead688d0d8c17@changeid
    Signed-off-by: Danilo Krummrich <[email protected]>
    Signed-off-by: Douglas Anderson <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/amd/display: Do not skip unrelated mode changes in DSC validation [+ + +]
Author: Yussuf Khalil <[email protected]>
Date:   Thu May 7 15:07:29 2026 +0800

    drm/amd/display: Do not skip unrelated mode changes in DSC validation
    
    [ Upstream commit aed3d041ab061ec8a64f50a3edda0f4db7280025 ]
    
    Starting with commit 17ce8a6907f7 ("drm/amd/display: Add dsc pre-validation in
    atomic check"), amdgpu resets the CRTC state mode_changed flag to false when
    recomputing the DSC configuration results in no timing change for a particular
    stream.
    
    However, this is incorrect in scenarios where a change in MST/DSC configuration
    happens in the same KMS commit as another (unrelated) mode change. For example,
    the integrated panel of a laptop may be configured differently (e.g., HDR
    enabled/disabled) depending on whether external screens are attached. In this
    case, plugging in external DP-MST screens may result in the mode_changed flag
    being dropped incorrectly for the integrated panel if its DSC configuration
    did not change during precomputation in pre_validate_dsc().
    
    At this point, however, dm_update_crtc_state() has already created new streams
    for CRTCs with DSC-independent mode changes. In turn,
    amdgpu_dm_commit_streams() will never release the old stream, resulting in a
    memory leak. amdgpu_dm_atomic_commit_tail() will never acquire a reference to
    the new stream either, which manifests as a use-after-free when the stream gets
    disabled later on:
    
    BUG: KASAN: use-after-free in dc_stream_release+0x25/0x90 [amdgpu]
    Write of size 4 at addr ffff88813d836524 by task kworker/9:9/29977
    
    Workqueue: events drm_mode_rmfb_work_fn
    Call Trace:
     <TASK>
     dump_stack_lvl+0x6e/0xa0
     print_address_description.constprop.0+0x88/0x320
     ? dc_stream_release+0x25/0x90 [amdgpu]
     print_report+0xfc/0x1ff
     ? srso_alias_return_thunk+0x5/0xfbef5
     ? __virt_addr_valid+0x225/0x4e0
     ? dc_stream_release+0x25/0x90 [amdgpu]
     kasan_report+0xe1/0x180
     ? dc_stream_release+0x25/0x90 [amdgpu]
     kasan_check_range+0x125/0x200
     dc_stream_release+0x25/0x90 [amdgpu]
     dc_state_destruct+0x14d/0x5c0 [amdgpu]
     dc_state_release.part.0+0x4e/0x130 [amdgpu]
     dm_atomic_destroy_state+0x3f/0x70 [amdgpu]
     drm_atomic_state_default_clear+0x8ee/0xf30
     ? drm_mode_object_put.part.0+0xb1/0x130
     __drm_atomic_state_free+0x15c/0x2d0
     atomic_remove_fb+0x67e/0x980
    
    Since there is no reliable way of figuring out whether a CRTC has unrelated
    mode changes pending at the time of DSC validation, remember the value of the
    mode_changed flag from before the point where a CRTC was marked as potentially
    affected by a change in DSC configuration. Reset the mode_changed flag to this
    earlier value instead in pre_validate_dsc().
    
    Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/5004
    Fixes: 17ce8a6907f7 ("drm/amd/display: Add dsc pre-validation in atomic check")
    Signed-off-by: Yussuf Khalil <[email protected]>
    Reviewed-by: Harry Wentland <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit cc7c7121ae082b7b82891baa7280f1ff2608f22b)
    Signed-off-by: Fang Wang <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
drm/amdgpu/gfx9: drop unnecessary 64-bit fence flag check in KIQ [+ + +]
Author: John B. Moore <[email protected]>
Date:   Tue Apr 28 11:35:12 2026 -0500

    drm/amdgpu/gfx9: drop unnecessary 64-bit fence flag check in KIQ
    
    commit 7bbfb2559bcec39d1a4e1182d931a2046112c352 upstream.
    
    Remove the BUG_ON(flags & AMDGPU_FENCE_FLAG_64BIT) assertion from
    gfx_v9_0_ring_emit_fence_kiq().  The KIQ hardware supports 64-bit
    fence writes; the 32-bit writeback address constraint is an
    upper-layer convention, not a hardware limitation.  The check serves
    no purpose and should not be present.
    
    Found by code inspection while investigating related BUG_ON
    assertions in the GFX and compute ring emission paths.
    
    Reviewed-by: Christian König <[email protected]>
    Signed-off-by: John B. Moore <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit 1b1101a46a426bb4328116bb5273c326a2780389)
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amdgpu/pm: add missing revision check for CI [+ + +]
Author: Alex Deucher <[email protected]>
Date:   Mon Apr 27 11:38:58 2026 -0400

    drm/amdgpu/pm: add missing revision check for CI
    
    commit 2a561b361b7681509710f3cfc3d95d54c87ac69f upstream.
    
    The ci_populate_all_memory_levels() workaround only
    applies to revision 0 SKUs.
    
    Link: https://gitlab.freedesktop.org/drm/amd/-/work_items/1816
    Fixes: 9f4b35411cfe ("drm/amd/powerplay: add CI asics support to smumgr (v3)")
    Reviewed-by: Timur Kristóf <[email protected]>
    Reviewed-by: Kent Russell <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit 1db15ba8f72f400bbad8ae0ce24fafc43429d4bd)
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amdgpu/pm: align Hawaii mclk workaround with radeon [+ + +]
Author: Alex Deucher <[email protected]>
Date:   Tue Apr 28 10:42:49 2026 -0400

    drm/amdgpu/pm: align Hawaii mclk workaround with radeon
    
    commit 1987c79b4fe5789dfa14423e78b5c25f6acf3e9d upstream.
    
    Align the hawaii mclk workaround with radeon and windows.
    
    Link: https://gitlab.freedesktop.org/drm/amd/-/work_items/1816
    Fixes: 9f4b35411cfe ("drm/amd/powerplay: add CI asics support to smumgr (v3)")
    Reviewed-by: Timur Kristóf <[email protected]>
    Reviewed-by: Kent Russell <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit 9649528b637f668c5af9f2b83ca4ad8576ae2121)
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amdgpu/sdma4: replace BUG_ON with WARN_ON in fence emission [+ + +]
Author: John B. Moore <[email protected]>
Date:   Mon Apr 27 16:06:28 2026 -0500

    drm/amdgpu/sdma4: replace BUG_ON with WARN_ON in fence emission
    
    commit 78d2e624fa073c14970aa097adcf3ea31c157a66 upstream.
    
    sdma_v4_0_ring_emit_fence() contains two BUG_ON(addr & 0x3) assertions
    that verify fence writeback addresses are dword-aligned.  These
    assertions can be reached from unprivileged userspace via crafted
    DRM_IOCTL_AMDGPU_CS submissions, causing a fatal kernel panic in a
    scheduler worker thread.
    
    Replace both BUG_ON() calls with WARN_ON() to log the condition without
    crashing the kernel.  A misaligned fence address at this point indicates
    a driver bug, but crashing the kernel is never the correct response when
    the assertion is reachable from userspace.
    
    The CS IOCTL path is the correct place to filter invalid submissions;
    the ring emission callback is too late to do anything about it.
    
    Fixes: 2130f89ced2c ("drm/amdgpu: add SDMA v4.0 implementation (v2)")
    Reviewed-by: Christian König <[email protected]>
    Signed-off-by: John B. Moore <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit b90250bd933afd1ba94d86d6b13821997b22b18e)
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amdgpu/vce: Prevent partial address patches [+ + +]
Author: Benjamin Cheng <[email protected]>
Date:   Mon Mar 30 15:01:27 2026 -0400

    drm/amdgpu/vce: Prevent partial address patches
    
    commit de2a02cc28d6d5d37db07d00a9a684c754a5fd74 upstream.
    
    In the case that only one of lo/hi is valid, the patching could result
    in a bad address written to in FW.
    
    Signed-off-by: Benjamin Cheng <[email protected]>
    Reviewed-by: Alex Deucher <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amdgpu/vcn3: Avoid overflow on msg bound check [+ + +]
Author: Benjamin Cheng <[email protected]>
Date:   Mon Apr 13 09:22:15 2026 -0400

    drm/amdgpu/vcn3: Avoid overflow on msg bound check
    
    commit e6e9faba8100628990cccd13f0f044a648c303cf upstream.
    
    As pointed out by SDL, the previous condition may be vulnerable to
    overflow.
    
    Fixes: b193019860d6 ("drm/amdgpu/vcn3: Prevent OOB reads when parsing dec msg")
    Cc: SDL <[email protected]>
    Signed-off-by: Benjamin Cheng <[email protected]>
    Reviewed-by: Ruijing Dong <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit db00257ac9e4a51eb2515aaea161a019f7125e10)
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amdgpu/vcn3: Prevent OOB reads when parsing dec msg [+ + +]
Author: Benjamin Cheng <[email protected]>
Date:   Tue Mar 24 16:25:56 2026 -0400

    drm/amdgpu/vcn3: Prevent OOB reads when parsing dec msg
    
    commit b193019860d61e92da395eae2011f2f6716b182f upstream.
    
    Check bounds against the end of the BO whenever we access the msg.
    
    Signed-off-by: Benjamin Cheng <[email protected]>
    Reviewed-by: Christian König <[email protected]>
    Reviewed-by: Ruijing Dong <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amdgpu/vcn4: Avoid overflow on msg bound check [+ + +]
Author: Benjamin Cheng <[email protected]>
Date:   Mon Apr 13 09:22:15 2026 -0400

    drm/amdgpu/vcn4: Avoid overflow on msg bound check
    
    commit 65bce27ea6192320448c30267ffc17ffa094e713 upstream.
    
    As pointed out by SDL, the previous condition may be vulnerable to
    overflow.
    
    Fixes: 0a78f2bac142 ("drm/amdgpu/vcn4: Prevent OOB reads when parsing dec msg")
    Cc: SDL <[email protected]>
    Signed-off-by: Benjamin Cheng <[email protected]>
    Reviewed-by: Ruijing Dong <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit 3c5367d950140d4ec7af830b2268a5a6fdaa3885)
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amdgpu/vcn4: Prevent OOB reads when parsing dec msg [+ + +]
Author: Benjamin Cheng <[email protected]>
Date:   Wed Mar 25 09:09:27 2026 -0400

    drm/amdgpu/vcn4: Prevent OOB reads when parsing dec msg
    
    commit 0a78f2bac1424deb7c9d5e09c6b8e849d8e8b648 upstream.
    
    Check bounds against the end of the BO whenever we access the msg.
    
    Signed-off-by: Benjamin Cheng <[email protected]>
    Reviewed-by: Christian König <[email protected]>
    Reviewed-by: Ruijing Dong <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amdgpu/vcn4: Prevent OOB reads when parsing IB [+ + +]
Author: Benjamin Cheng <[email protected]>
Date:   Tue Mar 24 16:42:05 2026 -0400

    drm/amdgpu/vcn4: Prevent OOB reads when parsing IB
    
    commit 2444eb0ec8283f4a3845eb7febad378476e1ba3c upstream.
    
    Rewrite the IB parsing to use amdgpu_ib_get_value() which handles the
    bounds checks.
    
    Signed-off-by: Benjamin Cheng <[email protected]>
    Acked-by: Christian König <[email protected]>
    Reviewed-by: Ruijing Dong <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amdgpu: Add bounds checking to ib_{get,set}_value [+ + +]
Author: Benjamin Cheng <[email protected]>
Date:   Wed Mar 25 08:39:19 2026 -0400

    drm/amdgpu: Add bounds checking to ib_{get,set}_value
    
    commit 66085e206431ef88ce36f53c1f53d570790ccc9e upstream.
    
    The uvd/vce/vcn code accesses the IB at predefined offsets without
    checking that the IB is large enough. Check the bounds here. The caller
    is responsible for making sure it can handle arbitrary return values.
    
    Also make the idx a uint32_t to prevent overflows causing the condition
    to fail.
    
    Signed-off-by: Benjamin Cheng <[email protected]>
    Reviewed-by: Christian König <[email protected]>
    Reviewed-by: Ruijing Dong <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amdgpu: fix zero-size GDS range init on RDNA4 [+ + +]
Author: Arjan van de Ven <[email protected]>
Date:   Mon Apr 20 14:57:15 2026 -0700

    drm/amdgpu: fix zero-size GDS range init on RDNA4
    
    commit 095a8b0ad3c3b5cdc3850d961adb8a8f735220bb upstream.
    
    RDNA4 (GFX 12) hardware removes the GDS, GWS, and OA on-chip memory
    resources. The gfx_v12_0 initialisation code correctly leaves
    adev->gds.gds_size, adev->gds.gws_size, and adev->gds.oa_size at
    zero to reflect this.
    
    amdgpu_ttm_init() unconditionally calls amdgpu_ttm_init_on_chip() for
    each of these resources regardless of size. When the size is zero,
    amdgpu_ttm_init_on_chip() forwards the call to ttm_range_man_init(),
    which calls drm_mm_init(mm, 0, 0). drm_mm_init() immediately fires
    DRM_MM_BUG_ON(start + size <= start) -- trivially true when size is
    zero -- crashing the kernel during modprobe of amdgpu on an RX 9070 XT.
    
    Guard against this by returning 0 early from
    amdgpu_ttm_init_on_chip() when size_in_page is zero. This skips TTM
    resource manager registration for hardware resources that are absent,
    without affecting any other GPU type.
    
    DRM_MM_BUG_ON() only asserts if CONFIG_DRM_DEBUG_MM is enabled in
    the kernel config.  This is apparently rarely enabled as these chips
    have been in the market for over a year and this issue was only reported
    now.
    
    Link: https://lore.kernel.org/all/[email protected]%2F/
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=221376
    Oops-Analysis: http://oops.fenrus.org/reports/bugzilla.korg/221376/report.html
    Assisted-by: GitHub Copilot:Claude Sonnet 4.6 linux-kernel-oops-x86.
    Signed-off-by: Arjan van de Ven <[email protected]>
    Cc: Alex Deucher <[email protected]>
    Cc: "Christian König" <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected]
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit 5719ce5865279cad4fd5f01011fe037168503f2d)
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amdgpu: Limit BO list entry count to prevent resource exhaustion [+ + +]
Author: Jesse.Zhang <[email protected]>
Date:   Mon Apr 27 14:53:54 2026 +0800

    drm/amdgpu: Limit BO list entry count to prevent resource exhaustion
    
    [ Upstream commit 6270b1a5dab94665d7adce3dc78bc9066ed28bdd ]
    
    Userspace can pass an arbitrary number of BO list entries via the
    bo_number field. Although the previous multiplication overflow check
    prevents out-of-bounds allocation, a large number of entries could still
    cause excessive memory allocation (up to potentially gigabytes) and
    unnecessarily long list processing times.
    
    Introduce a hard limit of 128k entries per BO list, which is more than
    sufficient for any realistic use case (e.g., a single list containing all
    buffers in a large scene). This prevents memory exhaustion attacks and
    ensures predictable performance.
    
    Return -EINVAL if the requested entry count exceeds the limit
    
    Reviewed-by: Christian König <[email protected]>
    Suggested-by: Christian König <[email protected]>
    Signed-off-by: Jesse Zhang <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit 688b87d39e0aa8135105b40dc167d74b5ada5332)
    Cc: [email protected]
    Signed-off-by: Fang Wang <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array [+ + +]
Author: Tvrtko Ursulin <[email protected]>
Date:   Mon Apr 27 14:53:18 2026 +0800

    drm/amdgpu: Use vmemdup_array_user in amdgpu_bo_create_list_entry_array
    
    [ Upstream commit c4ac100e9ae252b09986766ad23b1f83ca3a369d ]
    
    Replace kvmalloc_array() + copy_from_user() with vmemdup_array_user() on
    the fast path.
    
    This shrinks the source code and improves separation between the kernel
    and userspace slabs.
    
    Signed-off-by: Tvrtko Ursulin <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Signed-off-by: Fang Wang <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

drm/amdgpu: zero-initialize GART table on allocation [+ + +]
Author: Philip Yang <[email protected]>
Date:   Mon Apr 27 09:30:23 2026 -0400

    drm/amdgpu: zero-initialize GART table on allocation
    
    commit e6c2e6c2e1fa066968a16aca1cb66cd1bdde7741 upstream.
    
    GART TLB is flushed after unmapping but not after mapping. Since
    amdgpu_bo_create_kernel() does not zero-initialize the buffer, when a
    single PTE is written the TLB may speculatively load other uninitialized
    entries from the same cacheline. Those garbage entries can appear valid,
    and a subsequent write to another PTE in the same cacheline may cause the
    GPU to use a stale garbage PTE from the TLB.
    
    Fix this by calling memset_io() to zero-initialize the GART table with
    gart_pte_flags immediately after allocation.
    
    Using AMDGPU_GEM_CREATE_VRAM_CLEARED, SDMA-based clear will not work
    since SDMA needs GART to be initialized to work.
    
    Suggested-by: Felix Kuehling <[email protected]>
    Signed-off-by: Philip Yang <[email protected]>
    Reviewed-by: Christian König <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit d9af8263b82b6eaa60c5718e0c6631c5037e4b24)
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/amdkfd: Add upper bound check for num_of_nodes [+ + +]
Author: Alysa Liu <[email protected]>
Date:   Mon Mar 30 10:50:07 2026 -0400

    drm/amdkfd: Add upper bound check for num_of_nodes
    
    commit 74b73fa56a395d46745e4f245225963e9f8be7f1 upstream.
    
    drm/amdkfd: Add upper bound check for num_of_nodes
    in kfd_ioctl_get_process_apertures_new.
    
    Reviewed-by: Harish Kasiviswanathan <[email protected]>
    Signed-off-by: Alysa Liu <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit 98ff46a5ea090c14d2cdb4f5b993b05d74f3949f)
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amdkfd: Clear VRAM on allocation to prevent stale data exposure [+ + +]
Author: Amir Shetaia <[email protected]>
Date:   Fri Apr 10 10:38:13 2026 -0400

    drm/amdkfd: Clear VRAM on allocation to prevent stale data exposure
    
    commit ad52d61d82181dbdb7f05826de38352d5e550cc2 upstream.
    
    KFD VRAM allocations set AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE
    but not AMDGPU_GEM_CREATE_VRAM_CLEARED, leaving freshly allocated
    VRAM with stale data from prior use observable by compute kernels.
    
    The GEM ioctl path already sets VRAM_CLEARED for all userspace
    allocations via amdgpu_gem_create_ioctl() and
    amdgpu_mode_dumb_create(). The KFD path was missing this flag,
    allowing stale page table remnants to leak into user buffers.
    
    This causes crashes in RCCL P2P transport where non-zero data in
    ptrExchange/head/tail fields corrupts the protocol handshake.
    
    Signed-off-by: Amir Shetaia <[email protected]>
    Reviewed-by: Christian König <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

drm/amdkfd: validate SVM ioctl nattr against buffer size [+ + +]
Author: Alysa Liu <[email protected]>
Date:   Tue Apr 21 10:18:28 2026 -0400

    drm/amdkfd: validate SVM ioctl nattr against buffer size
    
    commit 045e0ff208f0838a246c10204105126611b267a1 upstream.
    
    Validate nattr field against the buffer size, preventing
    out-of-bounds buffer access via user-controlled attribute count.
    
    Reviewed-by: Amir Shetaia <[email protected]>
    Signed-off-by: Alysa Liu <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit 5eca8bfdfa456c3304ca77523718fe24254c172f)
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/arcpgu: fix device node leak [+ + +]
Author: Luca Ceresoli <[email protected]>
Date:   Thu Apr 2 18:42:20 2026 +0200

    drm/arcpgu: fix device node leak
    
    commit ad3ac32a3893a2bbcad545efc005a8e4e7ecf10c upstream.
    
    This function gets a device_node reference via
    of_graph_get_remote_port_parent() and stores it in encoder_node, but never
    puts that reference. Add it.
    
    There used to be a of_node_put(encoder_node) but it has been removed by
    mistake during a rework in commit 3ea66a794fdc ("drm/arc: Inline
    arcpgu_drm_hdmi_init").
    
    Fixes: 3ea66a794fdc ("drm/arc: Inline arcpgu_drm_hdmi_init")
    Cc: [email protected]
    Reviewed-by: Louis Chauvet <[email protected]>
    Link: https://patch.msgid.link/20260402-drm-arcgpu-fix-device-node-leak-v2-1-d773cf754ae5@bootlin.com
    Signed-off-by: Luca Ceresoli <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/gem: Fix inconsistent plane dimension calculation in drm_gem_fb_init_with_funcs() [+ + +]
Author: Ashutosh Desai <[email protected]>
Date:   Mon Apr 20 01:36:37 2026 +0000

    drm/gem: Fix inconsistent plane dimension calculation in drm_gem_fb_init_with_funcs()
    
    commit 3d4c2268bd7243c3780fe32bf24ff876da272acf upstream.
    
    drm_gem_fb_init_with_funcs() computes sub-sampled plane dimensions
    using plain integer division:
    
      unsigned int width  = mode_cmd->width  / (i ? info->hsub : 1);
      unsigned int height = mode_cmd->height / (i ? info->vsub : 1);
    
    However, the ioctl-level framebuffer_check() in drm_framebuffer.c uses
    drm_format_info_plane_width/height() which round up dimensions via
    DIV_ROUND_UP(). This inconsistency corrupts the subsequent GEM object
    size check for certain pixel format and dimension combinations.
    
    For example, with NV12 (vsub=2) and a 1-pixel-tall framebuffer the
    GEM size validation path sees height=0 instead of height=1. The
    expression (height - 1) then wraps to UINT_MAX as an unsigned int,
    causing min_size to overflow and wrap back to a small value. A tiny
    GEM object therefore passes the size guard, yet when the GPU accesses
    the chroma plane it will read or write memory beyond the object's
    bounds.
    
    Fix by replacing the open-coded divisions with drm_format_info_plane_width()
    and drm_format_info_plane_height(), which use DIV_ROUND_UP() and match
    the calculation already used in framebuffer_check().
    
    Fixes: 4c3dbb2c312c ("drm: Add GEM backed framebuffer library")
    Cc: [email protected] # v4.14+
    Reviewed-by: Thomas Zimmermann <[email protected]>
    Signed-off-by: Ashutosh Desai <[email protected]>
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/nouveau: fix u32 overflow in pushbuf reloc bounds check [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Mon Apr 20 21:16:09 2026 +0200

    drm/nouveau: fix u32 overflow in pushbuf reloc bounds check
    
    commit 2fc87d37be1b730a149b035f9375fdb8cc5333a5 upstream.
    
    nouveau_gem_pushbuf_reloc_apply() validates each relocation with
    
        if (r->reloc_bo_offset + 4 > nvbo->bo.base.size)
    
    but reloc_bo_offset is __u32 (uapi/drm/nouveau_drm.h) and the integer
    literal 4 promotes to unsigned int, so the addition is performed in 32
    bits and wraps before the comparison against the size_t bo size.
    
    Cast to u64 so the addition happens in 64-bit arithmetic.
    
    Cc: Lyude Paul <[email protected]>
    Cc: Danilo Krummrich <[email protected]>
    Cc: Maarten Lankhorst <[email protected]>
    Cc: Maxime Ripard <[email protected]>
    Cc: Thomas Zimmermann <[email protected]>
    Cc: David Airlie <[email protected]>
    Cc: Simona Vetter <[email protected]>
    Reported-by: Anthropic
    Cc: stable <[email protected]>
    Assisted-by: gkh_clanker_t1000
    Fixes: a1606a9596e5 ("drm/nouveau: new gem pushbuf interface, bump to 0.0.16")
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    [ Add Fixes: tag. - Danilo ]
    Signed-off-by: Danilo Krummrich <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
drm/radeon: add missing revision check for CI [+ + +]
Author: Alex Deucher <[email protected]>
Date:   Mon Apr 27 11:40:25 2026 -0400

    drm/radeon: add missing revision check for CI
    
    commit 17223816498f7b117d138d18eb0eba63604dc74e upstream.
    
    The memory level workarounds only apply to revision 0 SKUs.
    
    Link: https://gitlab.freedesktop.org/drm/amd/-/work_items/1816
    Fixes: 127e056e2a82 ("drm/radeon: fix mclk vddc configuration for cards for hawaii")
    Fixes: 21b8a369046f ("drm/radeon: fix dram timing for certain hawaii boards")
    Fixes: 90b2fee35cb9 ("drm/radeon: fix dpm mc init for certain hawaii boards")
    Reviewed-by: Timur Kristóf <[email protected]>
    Reviewed-by: Kent Russell <[email protected]>
    Signed-off-by: Alex Deucher <[email protected]>
    (cherry picked from commit 4d8dcc14311515077062b5740f39f427075de5c9)
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
erofs: fix the out-of-bounds nameoff handling for trailing dirents [+ + +]
Author: Gao Xiang <[email protected]>
Date:   Tue Apr 21 15:59:52 2026 +0800

    erofs: fix the out-of-bounds nameoff handling for trailing dirents
    
    commit d18a3b5d337fa412a38e776e6b4b857a58836575 upstream.
    
    Currently we already have boundary-checks for nameoffs, but the trailing
    dirents are special since the namelens are calculated with strnlen()
    with unchecked nameoffs.
    
    If a crafted EROFS has a trailing dirent with nameoff >= maxsize,
    maxsize - nameoff can underflow, causing strnlen() to read past the
    directory block.
    
    nameoff0 should also be verified to be a multiple of
    `sizeof(struct erofs_dirent)` as well [1].
    
    [1] https://sashiko.dev/#/patchset/20260416063511.3173774-1-hsiangkao%40linux.alibaba.com
    
    Fixes: 3aa8ec716e52 ("staging: erofs: add directory operations")
    Fixes: 33bac912840f ("staging: erofs: keep corrupted fs from crashing kernel in erofs_readdir()")
    Reported-by: Yuhao Jiang <[email protected]>
    Reported-by: Junrui Luo <[email protected]>
    Closes: https://lore.kernel.org/r/[email protected]
    Cc: [email protected]
    Signed-off-by: Gao Xiang <[email protected]>
    Reviewed-by: Chao Yu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

erofs: fix unsigned underflow in z_erofs_lz4_handle_overlap() [+ + +]
Author: Junrui Luo <[email protected]>
Date:   Fri May 8 23:54:21 2026 -0400

    erofs: fix unsigned underflow in z_erofs_lz4_handle_overlap()
    
    [ Upstream commit 21e161de2dc660b1bb70ef5b156ab8e6e1cca3ab ]
    
    Some crafted images can have illegal (!partial_decoding &&
    m_llen < m_plen) extents, and the LZ4 inplace decompression path
    can be wrongly hit, but it cannot handle (outpages < inpages)
    properly: "outpages - inpages" wraps to a large value and
    the subsequent rq->out[] access reads past the decompressed_pages
    array.
    
    However, such crafted cases can correctly result in a corruption
    report in the normal LZ4 non-inplace path.
    
    Let's add an additional check to fix this for backporting.
    
    Reproducible image (base64-encoded gzipped blob):
    
    H4sIAJGR12kCA+3SPUoDQRgG4MkmkkZk8QRbRFIIi9hbpEjrHQI5ghfwCN5BLCzTGtLbBI+g
    dilSJo1CnIm7GEXFxhT6PDDwfrs73/ywIQD/1ePD4r7Ou6ETsrq4mu7XcWfj++Pb58nJU/9i
    PNtbjhan04/9GtX4qVYc814WDqt6FaX5s+ZwXXeq52lndT6IuVvlblytLMvh4Gzwaf90nsvz
    2DF/21+20T/ldgp5s1jXRaN4t/8izsy/OUB6e/Qa79r+JwAAAAAAAL52vQVuGQAAAP6+my1w
    ywAAAAAAAADwu14ATsEYtgBQAAA=
    
    $ mount -t erofs -o cache_strategy=disabled foo.erofs /mnt
    $ dd if=/mnt/data of=/dev/null bs=4096 count=1
    
    Fixes: 598162d05080 ("erofs: support decompress big pcluster for lz4 backend")
    Reported-by: Yuhao Jiang <[email protected]>
    Cc: [email protected]
    Signed-off-by: Junrui Luo <[email protected]>
    Reviewed-by: Gao Xiang <[email protected]>
    Signed-off-by: Gao Xiang <[email protected]>
    [ inverted condition to early-out `goto docopy` form and used `ctx->inpages`/`ctx->outpages` instead of `rq->` ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
eventfs: Hold eventfs_mutex and SRCU when remount walks events [+ + +]
Author: David Carlier <[email protected]>
Date:   Sat Apr 18 20:17:37 2026 +0100

    eventfs: Hold eventfs_mutex and SRCU when remount walks events
    
    commit 07004a8c4b572171934390148ee48c4175c77eed upstream.
    
    Commit 340f0c7067a9 ("eventfs: Update all the eventfs_inodes from the
    events descriptor") had eventfs_set_attrs() recurse through ei->children
    on remount.  The walk only holds the rcu_read_lock() taken by
    tracefs_apply_options() over tracefs_inodes, which is wrong:
    
      - list_for_each_entry over ei->children races with the list_del_rcu()
        in eventfs_remove_rec() -- LIST_POISON1 deref, same shape as
        d2603279c7d6.
      - eventfs_inodes are freed via call_srcu(&eventfs_srcu, ...).
        rcu_read_lock() does not extend an SRCU grace period, so ti->private
        can be reclaimed under the walk.
      - The writes to ei->attr race with eventfs_set_attr(), which holds
        eventfs_mutex.
    
    Reproducer:
    
      while :; do mount -o remount,uid=$((RANDOM%1000)) /sys/kernel/tracing; done &
      while :; do
          echo "p:kp submit_bio" > /sys/kernel/tracing/kprobe_events
          echo > /sys/kernel/tracing/kprobe_events
      done
    
    Wrap the events portion of tracefs_apply_options() in
    eventfs_remount_lock()/_unlock() that take eventfs_mutex and
    srcu_read_lock(&eventfs_srcu).  eventfs_set_attrs() doesn't sleep so the
    nested rcu_read_lock() is fine; lockdep_assert_held() pins the contract.
    
    Comment in tracefs_drop_inode() said "RCU cycle" -- it is SRCU.
    
    Fixes: 340f0c7067a9 ("eventfs: Update all the eventfs_inodes from the events descriptor")
    Cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: David Carlier <[email protected]>
    Signed-off-by: Steven Rostedt <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
exit: prevent preemption of oopsing TASK_DEAD task [+ + +]
Author: Jann Horn <[email protected]>
Date:   Mon May 11 08:55:11 2026 -0700

    exit: prevent preemption of oopsing TASK_DEAD task
    
    commit c1fa0bb633e4a6b11e83ffc57fa5abe8ebb87891 upstream.
    
    When an already-exiting task oopses, make_task_dead() currently calls
    do_task_dead() with preemption enabled.  That is forbidden:
    do_task_dead() calls __schedule(), which has a comment saying "WARNING:
    must be called with preemption disabled!".
    
    If an oopsing task is preempted in do_task_dead(), between becoming
    TASK_DEAD and entering the scheduler explicitly, bad things happen:
    finish_task_switch() assumes that once the scheduler has switched away
    from a TASK_DEAD task, the task can never run again and its stack is no
    longer needed; but that assumption apparently doesn't hold if the dead
    task was preempted (the SM_PREEMPT case).
    
    This means that the scheduler ends up repeatedly dropping references on
    the dead task's stack, which can lead to use-after-free or double-free
    of the entire task stack; in other words, two tasks can end up running
    on the same stack, resulting in various kinds of memory corruption.
    
    (This does not just affect "recursively oopsing" tasks; it is enough to
    oops once during task exit, for example in a file_operations::release
    handler)
    
    Fixes: 7f80a2fd7db9 ("exit: Stop poorly open coding do_task_dead in make_task_dead")
    Cc: [email protected]
    Signed-off-by: Jann Horn <[email protected]>
    Acked-by: Peter Zijlstra <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

exit: Sleep at TASK_IDLE when waiting for application core dump [+ + +]
Author: Paul E. McKenney <[email protected]>
Date:   Wed Jul 24 16:51:52 2024 -0700

    exit: Sleep at TASK_IDLE when waiting for application core dump
    
    commit b8e753128ed074fcb48e9ceded940752f6b1c19f upstream.
    
    Currently, the coredump_task_exit() function sets the task state
    to TASK_UNINTERRUPTIBLE|TASK_FREEZABLE, which usually works well.
    But a combination of large memory and slow (and/or highly contended)
    mass storage can cause application core dumps to take more than
    two minutes, which can cause check_hung_task(), which is invoked by
    check_hung_uninterruptible_tasks(), to produce task-blocked splats.
    There does not seem to be any reasonable benefit to getting these splats.
    
    Furthermore, as Oleg Nesterov points out, TASK_UNINTERRUPTIBLE could
    be misleading because the task sleeping in coredump_task_exit() really
    is killable, albeit indirectly.  See the check of signal->core_state
    in prepare_signal() and the check of fatal_signal_pending()
    in dump_interrupted(), which bypass the normal unkillability of
    TASK_UNINTERRUPTIBLE, resulting in coredump_finish() invoking
    wake_up_process() on any threads sleeping in coredump_task_exit().
    
    Therefore, change that TASK_UNINTERRUPTIBLE to TASK_IDLE.
    
    Reported-by: Anhad Jai Singh <[email protected]>
    Signed-off-by: Paul E. McKenney <[email protected]>
    Acked-by: Oleg Nesterov <[email protected]>
    Cc: Jens Axboe <[email protected]>
    Cc: Christian Brauner <[email protected]>
    Cc: Andrew Morton <[email protected]>
    Cc: "Matthew Wilcox (Oracle)" <[email protected]>
    Cc: Chris Mason <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Paul Menzel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ext2: reject inodes with zero i_nlink and valid mode in ext2_iget() [+ + +]
Author: Vasiliy Kovalev <[email protected]>
Date:   Sat Apr 4 18:20:11 2026 +0300

    ext2: reject inodes with zero i_nlink and valid mode in ext2_iget()
    
    commit 25947cc5b2374cd5bf627fe3141496444260d04f upstream.
    
    ext2_iget() already rejects inodes with i_nlink == 0 when i_mode is
    zero or i_dtime is set, treating them as deleted. However, the case of
    i_nlink == 0 with a non-zero mode and zero dtime slips through. Since
    ext2 has no orphan list, such a combination can only result from
    filesystem corruption - a legitimate inode deletion always sets either
    i_dtime or clears i_mode before freeing the inode.
    
    A crafted image can exploit this gap to present such an inode to the
    VFS, which then triggers WARN_ON inside drop_nlink() (fs/inode.c) via
    ext2_unlink(), ext2_rename() and ext2_rmdir():
    
    WARNING: CPU: 3 PID: 609 at fs/inode.c:336 drop_nlink+0xad/0xd0 fs/inode.c:336
    CPU: 3 UID: 0 PID: 609 Comm: syz-executor Not tainted 6.12.77+ #1
    Call Trace:
     <TASK>
     inode_dec_link_count include/linux/fs.h:2518 [inline]
     ext2_unlink+0x26c/0x300 fs/ext2/namei.c:295
     vfs_unlink+0x2fc/0x9b0 fs/namei.c:4477
     do_unlinkat+0x53e/0x730 fs/namei.c:4541
     __x64_sys_unlink+0xc6/0x110 fs/namei.c:4587
     do_syscall_64+0xf5/0x220 arch/x86/entry/common.c:78
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
     </TASK>
    
    WARNING: CPU: 0 PID: 646 at fs/inode.c:336 drop_nlink+0xad/0xd0 fs/inode.c:336
    CPU: 0 UID: 0 PID: 646 Comm: syz.0.17 Not tainted 6.12.77+ #1
    Call Trace:
     <TASK>
     inode_dec_link_count include/linux/fs.h:2518 [inline]
     ext2_rename+0x35e/0x850 fs/ext2/namei.c:374
     vfs_rename+0xf2f/0x2060 fs/namei.c:5021
     do_renameat2+0xbe2/0xd50 fs/namei.c:5178
     __x64_sys_rename+0x7e/0xa0 fs/namei.c:5223
     do_syscall_64+0xf5/0x220 arch/x86/entry/common.c:78
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
     </TASK>
    
    WARNING: CPU: 0 PID: 634 at fs/inode.c:336 drop_nlink+0xad/0xd0 fs/inode.c:336
    CPU: 0 UID: 0 PID: 634 Comm: syz-executor Not tainted 6.12.77+ #1
    Call Trace:
     <TASK>
     inode_dec_link_count include/linux/fs.h:2518 [inline]
     ext2_rmdir+0xca/0x110 fs/ext2/namei.c:311
     vfs_rmdir+0x204/0x690 fs/namei.c:4348
     do_rmdir+0x372/0x3e0 fs/namei.c:4407
     __x64_sys_unlinkat+0xf0/0x130 fs/namei.c:4577
     do_syscall_64+0xf5/0x220 arch/x86/entry/common.c:78
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
     </TASK>
    
    Extend the existing i_nlink == 0 check to also catch this case,
    reporting the corruption via ext2_error() and returning -EFSCORRUPTED.
    This rejects the inode at load time and prevents it from reaching any
    of the namei.c paths.
    
    Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: [email protected]
    Signed-off-by: Vasiliy Kovalev <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jan Kara <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ext4: fix bounds check in check_xattrs() to prevent out-of-bounds access [+ + +]
Author: Deepanshu Kartikey <[email protected]>
Date:   Sat Mar 28 20:30:38 2026 +0530

    ext4: fix bounds check in check_xattrs() to prevent out-of-bounds access
    
    commit eceafc31ea7b42c984ece10d79d505c0bb6615d5 upstream.
    
    The bounds check for the next xattr entry in check_xattrs() uses
    (void *)next >= end, which allows next to point within sizeof(u32)
    bytes of end. On the next loop iteration, IS_LAST_ENTRY() reads 4
    bytes via *(__u32 *)(entry), which can overrun the valid xattr region.
    
    For example, if next lands at end - 1, the check passes since
    next < end, but IS_LAST_ENTRY() reads 4 bytes starting at end - 1,
    accessing 3 bytes beyond the valid region.
    
    Fix this by changing the check to (void *)next + sizeof(u32) > end,
    ensuring there is always enough space for the IS_LAST_ENTRY() read
    on the subsequent iteration.
    
    Fixes: 3478c83cf26b ("ext4: improve xattr consistency checking and error reporting")
    Cc: [email protected]
    Link: https://lore.kernel.org/all/[email protected]/T/ [v1]
    Signed-off-by: Deepanshu Kartikey <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ext4: fix missing brelse() in ext4_xattr_inode_dec_ref_all() [+ + +]
Author: Sohei Koyama <[email protected]>
Date:   Mon Apr 6 16:48:30 2026 +0900

    ext4: fix missing brelse() in ext4_xattr_inode_dec_ref_all()
    
    commit 77d059519382bd66283e6a4e83ee186e87e7708f upstream.
    
    The commit c8e008b60492 ("ext4: ignore xattrs past end")
    introduced a refcount leak in when block_csum is false.
    
    ext4_xattr_inode_dec_ref_all() calls ext4_get_inode_loc() to
    get iloc.bh, but never releases it with brelse().
    
    Fixes: c8e008b60492 ("ext4: ignore xattrs past end")
    Signed-off-by: Sohei Koyama <[email protected]>
    Reviewed-by: Andreas Dilger <[email protected]>
    Reviewed-by: Ritesh Harjani (IBM) <[email protected]>
    Cc: [email protected]
    Reviewed-by: Zhang Yi <[email protected]>
    Reviewed-by: Baokun Li <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Theodore Ts'o <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ext4: validate p_idx bounds in ext4_ext_correct_indexes [+ + +]
Author: Tejas Bharambe <[email protected]>
Date:   Fri May 8 14:58:45 2026 +0800

    ext4: validate p_idx bounds in ext4_ext_correct_indexes
    
    [ Upstream commit 2acb5c12ebd860f30e4faf67e6cc8c44ddfe5fe8 ]
    
    ext4_ext_correct_indexes() walks up the extent tree correcting
    index entries when the first extent in a leaf is modified. Before
    accessing path[k].p_idx->ei_block, there is no validation that
    p_idx falls within the valid range of index entries for that
    level.
    
    If the on-disk extent header contains a corrupted or crafted
    eh_entries value, p_idx can point past the end of the allocated
    buffer, causing a slab-out-of-bounds read.
    
    Fix this by validating path[k].p_idx against EXT_LAST_INDEX() at
    both access sites: before the while loop and inside it. Return
    -EFSCORRUPTED if the index pointer is out of range, consistent
    with how other bounds violations are handled in the ext4 extent
    tree code.
    
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=04c4e65cab786a2e5b7e
    Signed-off-by: Tejas Bharambe <[email protected]>
    Link: https://patch.msgid.link/JH0PR06MB66326016F9B6AD24097D232B897CA@JH0PR06MB6632.apcprd06.prod.outlook.com
    Signed-off-by: Theodore Ts'o <[email protected]>
    Cc: [email protected]
    [ Minor conflict resolved. ]
    Signed-off-by: Jianqiang kang <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
extcon: ptn5150: handle pending IRQ events during system resume [+ + +]
Author: Xu Yang <[email protected]>
Date:   Sat Nov 15 10:59:05 2025 +0800

    extcon: ptn5150: handle pending IRQ events during system resume
    
    commit 4652fefcda3c604c83d1ae28ede94544e2142f06 upstream.
    
    When the system is suspended and ptn5150 wakeup interrupt is disabled,
    any changes on ptn5150 will only be record in interrupt status
    registers and won't fire an IRQ since its trigger type is falling
    edge. So the HW interrupt line will keep at low state and any further
    changes won't trigger IRQ anymore. To fix it, this will schedule a
    work to check whether any IRQ are pending and handle it accordingly.
    
    Fixes: 4ed754de2d66 ("extcon: Add support for ptn5150 extcon driver")
    Cc: [email protected]
    Reviewed-by: Krzysztof Kozlowski <[email protected]>
    Acked-by: MyungJoo Ham <[email protected]>
    Signed-off-by: Xu Yang <[email protected]>
    Signed-off-by: Chanwoo Choi <[email protected]>
    Link: https://lore.kernel.org/lkml/[email protected]/
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
extract-cert: Wrap key_pass with '#ifdef USE_PKCS11_ENGINE' [+ + +]
Author: Nathan Chancellor <[email protected]>
Date:   Wed Mar 25 18:19:15 2026 -0700

    extract-cert: Wrap key_pass with '#ifdef USE_PKCS11_ENGINE'
    
    commit 4f96b7c68a9904e01049ef610d701b382dca9574 upstream.
    
    A recent strengthening of -Wunused-but-set-variable (enabled with -Wall)
    in clang under a new subwarning, -Wunused-but-set-global, points out an
    unused static global variable in certs/extract-cert.c:
    
      certs/extract-cert.c:46:20: error: variable 'key_pass' set but not used [-Werror,-Wunused-but-set-global]
         46 | static const char *key_pass;
            |                    ^
    
    After commit 558bdc45dfb2 ("sign-file,extract-cert: use pkcs11 provider
    for OPENSSL MAJOR >= 3"), key_pass is only used with the OpenSSL engine
    API, not the new provider API. Wrap key_pass's declaration and
    assignment with '#ifdef USE_PKCS11_ENGINE' so that it is only included
    with its use to clear up the warning. While this is a little uglier than
    just marking key_pass with the unused attribute, this will make it
    easier to clean up all code associated with the use of the engine API if
    it were ever removed in the future. While in the area, use a tab for
    the key_pass assignment line to match the rest of the file.
    
    Cc: [email protected]
    Fixes: 558bdc45dfb2 ("sign-file,extract-cert: use pkcs11 provider for OPENSSL MAJOR >= 3")
    Reviewed-by: Nick Desaulniers <[email protected]>
    Tested-by: Nick Desaulniers <[email protected]>
    Link: https://patch.msgid.link/20260325-certs-extract-cert-key_pass-unused-but-set-global-v1-1-ecf94326d532@kernel.org
    Signed-off-by: Nathan Chancellor <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
f2fs: add READ_ONCE() for i_blocks in f2fs_update_inode() [+ + +]
Author: Cen Zhang <[email protected]>
Date:   Wed Mar 18 15:32:53 2026 +0800

    f2fs: add READ_ONCE() for i_blocks in f2fs_update_inode()
    
    commit 5471834a96fb697874be2ca0b052e74bcf3c23d1 upstream.
    
    f2fs_update_inode() reads inode->i_blocks without holding i_lock to
    serialize it to the on-disk inode, while concurrent truncate or
    allocation paths may modify i_blocks under i_lock.  Since blkcnt_t is
    u64, this risks torn reads on 32-bit architectures.
    
    Following the approach in ext4_inode_blocks_set(), add READ_ONCE() to prevent
    potential compiler-induced tearing.
    
    Fixes: 19f99cee206c ("f2fs: add core inode operations")
    Cc: [email protected]
    Signed-off-by: Cen Zhang <[email protected]>
    Reviewed-by: Chao Yu <[email protected]>
    Signed-off-by: Jaegeuk Kim <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

f2fs: fix fiemap boundary handling when read extent cache is incomplete [+ + +]
Author: Yongpeng Yang <[email protected]>
Date:   Mon Mar 23 20:06:24 2026 +0800

    f2fs: fix fiemap boundary handling when read extent cache is incomplete
    
    commit 95e159ad3e52f7478cfd22e44ec37c9f334f8993 upstream.
    
    f2fs_fiemap() calls f2fs_map_blocks() to obtain the block mapping a
    file, and then merges contiguous mappings into extents. If the mapping
    is found in the read extent cache, node blocks do not need to be read.
    However, in the following scenario, a contiguous extent can be split
    into two extents:
    
    $ dd if=/dev/zero of=data.128M bs=1M count=128
    $ losetup -f data.128M
    $ mkfs.f2fs /dev/loop0 -f
    $ mount -o mode=lfs /dev/loop0 /mnt/f2fs/
    $ cd /mnt/f2fs/
    $ dd if=/dev/zero of=data.72M bs=1M count=72 && sync
    $ dd if=/dev/zero of=data.4M bs=1M count=4 && sync
    $ dd if=/dev/zero of=data.4M bs=1M count=2 seek=2 conv=notrunc && sync
    $ echo 3 > /proc/sys/vm/drop_caches
    $ dd if=/dev/zero of=data.4M bs=1M count=2 seek=0 conv=notrunc && sync
    $ dd if=/dev/zero of=data.4M bs=1M count=2 seek=0 conv=notrunc && sync
    $ f2fs_io fiemap 0 1024 data.4M
    Fiemap: offset = 0 len = 1024
    logical addr.    physical addr.   length           flags
    0       0000000000000000 0000000006400000 0000000000200000 00001000
    1       0000000000200000 0000000006600000 0000000000200000 00001001
    
    Although the physical addresses of the ranges 0~2MB and 2M~4MB are
    contiguous, the mapping for the 2M~4MB range is not present in memory.
    When the physical addresses for the 0~2MB range are updated, no merge
    happens because the adjacent mapping is missing from the in-memory
    cache. As a result, fiemap reports two separate extents instead of a
    single contiguous one.
    
    The root cause is that the read extent cache does not guarantee that all
    blocks of an extent are present in memory. Therefore, when the extent
    length returned by f2fs_map_blocks_cached() is smaller than maxblocks,
    the remaining mappings are retrieved via f2fs_get_dnode_of_data() to
    ensure correct fiemap extent boundary handling.
    
    Cc: [email protected]
    Fixes: cd8fc5226bef ("f2fs: remove the create argument to f2fs_map_blocks")
    Signed-off-by: Yongpeng Yang <[email protected]>
    Reviewed-by: Chao Yu <[email protected]>
    Signed-off-by: Jaegeuk Kim <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

f2fs: fix incorrect multidevice info in trace_f2fs_map_blocks() [+ + +]
Author: Yongpeng Yang <[email protected]>
Date:   Mon Mar 23 20:06:22 2026 +0800

    f2fs: fix incorrect multidevice info in trace_f2fs_map_blocks()
    
    commit eb2ca3ca983551a80e16a4a25df5a4ce59df8484 upstream.
    
    When f2fs_map_blocks()->f2fs_map_blocks_cached() hits the read extent
    cache, map->m_multidev_dio is not updated, which leads to incorrect
    multidevice information being reported by trace_f2fs_map_blocks().
    
    This patch updates map->m_multidev_dio in f2fs_map_blocks_cached() when
    the read extent cache is hit.
    
    Cc: [email protected]
    Fixes: 0094e98bd147 ("f2fs: factor a f2fs_map_blocks_cached helper")
    Signed-off-by: Yongpeng Yang <[email protected]>
    Reviewed-by: Chao Yu <[email protected]>
    Signed-off-by: Jaegeuk Kim <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

f2fs: fix node_cnt race between extent node destroy and writeback [+ + +]
Author: Yongpeng Yang <[email protected]>
Date:   Fri Apr 3 22:40:17 2026 +0800

    f2fs: fix node_cnt race between extent node destroy and writeback
    
    commit ed78aeebef05212ef7dca93bd931e4eff67c113f upstream.
    
    f2fs_destroy_extent_node() does not set FI_NO_EXTENT before clearing
    extent nodes. When called from f2fs_drop_inode() with I_SYNC set,
    concurrent kworker writeback can insert new extent nodes into the same
    extent tree, racing with the destroy and triggering f2fs_bug_on() in
    __destroy_extent_node(). The scenario is as follows:
    
    drop inode                            writeback
     - iput
      - f2fs_drop_inode  // I_SYNC set
       - f2fs_destroy_extent_node
        - __destroy_extent_node
         - while (node_cnt) {
            write_lock(&et->lock)
            __free_extent_tree
            write_unlock(&et->lock)
                                           - __writeback_single_inode
                                            - f2fs_outplace_write_data
                                             - f2fs_update_read_extent_cache
                                              - __update_extent_tree_range
                                               // FI_NO_EXTENT not set,
                                               // insert new extent node
           } // node_cnt == 0, exit while
         - f2fs_bug_on(node_cnt)  // node_cnt > 0
    
    Additionally, __update_extent_tree_range() only checks FI_NO_EXTENT for
    EX_READ type, leaving EX_BLOCK_AGE updates completely unprotected.
    
    This patch set FI_NO_EXTENT under et->lock in __destroy_extent_node(),
    consistent with other callers (__update_extent_tree_range and
    __drop_extent_tree) and check FI_NO_EXTENT for both EX_READ and
    EX_BLOCK_AGE tree.
    
    Fixes: 3fc5d5a182f6 ("f2fs: fix to shrink read extent node in batches")
    Cc: [email protected]
    Signed-off-by: Yongpeng Yang <[email protected]>
    Reviewed-by: Chao Yu <[email protected]>
    Signed-off-by: Jaegeuk Kim <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

f2fs: fix to detect potential corrupted nid in free_nid_list [+ + +]
Author: Chao Yu <[email protected]>
Date:   Thu Apr 30 13:45:10 2026 +0800

    f2fs: fix to detect potential corrupted nid in free_nid_list
    
    [ Upstream commit 8fc6056dcf79937c46c97fa4996cda65956437a9 ]
    
    As reported, on-disk footer.ino and footer.nid is the same and
    out-of-range, let's add sanity check on f2fs_alloc_nid() to detect
    any potential corruption in free_nid_list.
    
    Signed-off-by: Chao Yu <[email protected]>
    Signed-off-by: Jaegeuk Kim <[email protected]>
    Signed-off-by: Robert Garcia <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

f2fs: fix to do sanity check on dcc->discard_cmd_cnt conditionally [+ + +]
Author: Chao Yu <[email protected]>
Date:   Sat Apr 25 07:18:05 2026 -0400

    f2fs: fix to do sanity check on dcc->discard_cmd_cnt conditionally
    
    [ Upstream commit 6af249c996f7d73a3435f9e577956fa259347d18 ]
    
    Syzbot reported a f2fs bug as below:
    
    ------------[ cut here ]------------
    kernel BUG at fs/f2fs/segment.c:1900!
    Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
    CPU: 1 UID: 0 PID: 6527 Comm: syz.5.110 Not tainted syzkaller #0 PREEMPT_{RT,(full)}
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
    RIP: 0010:f2fs_issue_discard_timeout+0x59b/0x5a0 fs/f2fs/segment.c:1900
    Code: d9 80 e1 07 80 c1 03 38 c1 0f 8c d6 fe ff ff 48 89 df e8 a8 5e fa fd e9 c9 fe ff ff e8 4e 46 94 fd 90 0f 0b e8 46 46 94 fd 90 <0f> 0b 0f 1f 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3
    RSP: 0018:ffffc9000494f940 EFLAGS: 00010283
    RAX: ffffffff843009ca RBX: 0000000000000001 RCX: 0000000000080000
    RDX: ffffc9001ca78000 RSI: 00000000000029f3 RDI: 00000000000029f4
    RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
    R10: dffffc0000000000 R11: ffffed100893a431 R12: 1ffff1100893a430
    R13: 1ffff1100c2b702c R14: dffffc0000000000 R15: ffff8880449d2160
    FS:  00007ffa35fed6c0(0000) GS:ffff88812643d000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00007f2b68634000 CR3: 0000000039f62000 CR4: 00000000003526f0
    Call Trace:
     <TASK>
     __f2fs_remount fs/f2fs/super.c:2960 [inline]
     f2fs_reconfigure+0x108a/0x1710 fs/f2fs/super.c:5443
     reconfigure_super+0x227/0x8a0 fs/super.c:1080
     do_remount fs/namespace.c:3391 [inline]
     path_mount+0xdc5/0x10e0 fs/namespace.c:4151
     do_mount fs/namespace.c:4172 [inline]
     __do_sys_mount fs/namespace.c:4361 [inline]
     __se_sys_mount+0x31d/0x420 fs/namespace.c:4338
     do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
     do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    RIP: 0033:0x7ffa37dbda0a
    
    The root cause is there will be race condition in between f2fs_ioc_fitrim()
    and f2fs_remount():
    
    - f2fs_remount                  - f2fs_ioc_fitrim
     - f2fs_issue_discard_timeout
      - __issue_discard_cmd
      - __drop_discard_cmd
      - __wait_all_discard_cmd
                                     - f2fs_trim_fs
                                      - f2fs_write_checkpoint
                                       - f2fs_clear_prefree_segments
                                        - f2fs_issue_discard
                                         - __issue_discard_async
                                          - __queue_discard_cmd
                                           - __update_discard_tree_range
                                            - __insert_discard_cmd
                                             - __create_discard_cmd
                                             : atomic_inc(&dcc->discard_cmd_cnt);
      - sanity check on dcc->discard_cmd_cnt (expect discard_cmd_cnt to be zero)
    
    This will only happen when fitrim races w/ remount rw, if we remount to
    readonly filesystem, remount will wait until mnt_pcp.mnt_writers to zero,
    that means fitrim is not in process at that time.
    
    Cc: [email protected]
    Fixes: 2482c4325dfe ("f2fs: detect bug_on in f2fs_wait_discard_bios")
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/linux-f2fs-devel/[email protected]
    Signed-off-by: Chao Yu <[email protected]>
    Signed-off-by: Jaegeuk Kim <[email protected]>
    [ dereferenced flags pointer (`*flags & SB_RDONLY`) to match `int *flags` remount signature ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

f2fs: fix UAF caused by decrementing sbi->nr_pages[] in f2fs_write_end_io() [+ + +]
Author: Yongpeng Yang <[email protected]>
Date:   Fri Apr 24 09:28:50 2026 -0400

    f2fs: fix UAF caused by decrementing sbi->nr_pages[] in f2fs_write_end_io()
    
    [ Upstream commit 2d9c4a4ed4eef1f82c5b16b037aee8bad819fd53 ]
    
    The xfstests case "generic/107" and syzbot have both reported a NULL
    pointer dereference.
    
    The concurrent scenario that triggers the panic is as follows:
    
    F2FS_WB_CP_DATA write callback          umount
                                            - f2fs_write_checkpoint
                                             - f2fs_wait_on_all_pages(sbi, F2FS_WB_CP_DATA)
    - blk_mq_end_request
     - bio_endio
      - f2fs_write_end_io
       : dec_page_count(sbi, F2FS_WB_CP_DATA)
       : wake_up(&sbi->cp_wait)
                                            - kill_f2fs_super
                                             - kill_block_super
                                              - f2fs_put_super
                                               : iput(sbi->node_inode)
                                               : sbi->node_inode = NULL
       : f2fs_in_warm_node_list
        - is_node_folio // sbi->node_inode is NULL and panic
    
    The root cause is that f2fs_put_super() calls iput(sbi->node_inode) and
    sets sbi->node_inode to NULL after sbi->nr_pages[F2FS_WB_CP_DATA] is
    decremented to zero. As a result, f2fs_in_warm_node_list() may
    dereference a NULL node_inode when checking whether a folio belongs to
    the node inode, leading to a panic.
    
    This patch fixes the issue by calling f2fs_in_warm_node_list() before
    decrementing sbi->nr_pages[F2FS_WB_CP_DATA], thus preventing the
    use-after-free condition.
    
    Cc: [email protected]
    Fixes: 50fa53eccf9f ("f2fs: fix to avoid broken of dnode block list")
    Reported-by: [email protected]
    Signed-off-by: Yongpeng Yang <[email protected]>
    Reviewed-by: Chao Yu <[email protected]>
    Signed-off-by: Jaegeuk Kim <[email protected]>
    [ folio => page ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
fanotify: fix false positive on permission events [+ + +]
Author: Miklos Szeredi <[email protected]>
Date:   Fri Apr 10 16:49:47 2026 +0200

    fanotify: fix false positive on permission events
    
    commit 7746e3bd4cc19b5092e00d32d676e329bfcb6900 upstream.
    
    fsnotify_get_mark_safe() may return false for a mark on an unrelated group,
    which results in bypassing the permission check.
    
    Fix by skipping over detached marks that are not in the current group.
    
    CC: [email protected]
    Fixes: abc77577a669 ("fsnotify: Provide framework for dropping SRCU lock in ->handle_event")
    Signed-off-by: Miklos Szeredi <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jan Kara <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
fbcon: Avoid OOB font access if console rotation fails [+ + +]
Author: Thomas Zimmermann <[email protected]>
Date:   Thu May 14 21:26:17 2026 -0400

    fbcon: Avoid OOB font access if console rotation fails
    
    [ Upstream commit e4ef723d8975a2694cc90733a6b888a5e2841842 ]
    
    Clear the font buffer if the reallocation during console rotation fails
    in fbcon_rotate_font(). The putcs implementations for the rotated buffer
    will return early in this case. See [1] for an example.
    
    Currently, fbcon_rotate_font() keeps the old buffer, which is too small
    for the rotated font. Printing to the rotated console with a high-enough
    character code will overflow the font buffer.
    
    v2:
    - fix typos in commit message
    
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Fixes: 6cc50e1c5b57 ("[PATCH] fbcon: Console Rotation - Add support to rotate font bitmap")
    Cc: [email protected] # v2.6.15+
    Link: https://elixir.bootlin.com/linux/v6.19/source/drivers/video/fbdev/core/fbcon_ccw.c#L144 # [1]
    Signed-off-by: Helge Deller <[email protected]>
    [ renamed `par` to `ops` to match the 6.12 local pointer name ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
fbdev: defio: Disconnect deferred I/O from the lifetime of struct fb_info [+ + +]
Author: Thomas Zimmermann <[email protected]>
Date:   Tue May 5 02:00:00 2026 -0400

    fbdev: defio: Disconnect deferred I/O from the lifetime of struct fb_info
    
    [ Upstream commit 9ded47ad003f09a94b6a710b5c47f4aa5ceb7429 ]
    
    Hold state of deferred I/O in struct fb_deferred_io_state. Allocate an
    instance as part of initializing deferred I/O and remove it only after
    the final mapping has been closed. If the fb_info and the contained
    deferred I/O meanwhile goes away, clear struct fb_deferred_io_state.info
    to invalidate the mapping. Any access will then result in a SIGBUS
    signal.
    
    Fixes a long-standing problem, where a device hot-unplug happens while
    user space still has an active mapping of the graphics memory. The hot-
    unplug frees the instance of struct fb_info. Accessing the memory will
    operate on undefined state.
    
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Fixes: 60b59beafba8 ("fbdev: mm: Deferred IO support")
    Cc: Helge Deller <[email protected]>
    Cc: [email protected]
    Cc: [email protected]
    Cc: [email protected] # v2.6.22+
    Signed-off-by: Helge Deller <[email protected]>
    [ replaced `kzalloc_obj` with `kzalloc`, and dropped `mutex_destroy(&fbdefio->lock)` ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

fbdev: udlfb: add vm_ops to dlfb_ops_mmap to prevent use-after-free [+ + +]
Author: Rajat Gupta <[email protected]>
Date:   Sun May 3 20:51:10 2026 -0700

    fbdev: udlfb: add vm_ops to dlfb_ops_mmap to prevent use-after-free
    
    commit 8de779dc40d35d39fa07387b6f921eb11df0f511 upstream.
    
    dlfb_ops_mmap() uses remap_pfn_range() to map vmalloc framebuffer pages
    to userspace but sets no vm_ops on the VMA. This means the kernel cannot
    track active mmaps. When dlfb_realloc_framebuffer() replaces the backing
    buffer via FBIOPUT_VSCREENINFO, existing mmap PTEs are not invalidated.
    On USB disconnect, dlfb_ops_destroy() calls vfree() on the old pages
    while userspace PTEs still reference them, resulting in a use-after-free:
    the process retains read/write access to freed kernel pages.
    
    Add vm_operations_struct with open/close callbacks that maintain an
    atomic mmap_count on struct dlfb_data. In dlfb_realloc_framebuffer(),
    check mmap_count and return -EBUSY if the buffer is currently mapped,
    preventing buffer replacement while userspace holds stale PTEs.
    
    Tested with PoC using dummy_hcd + raw_gadget USB device emulation.
    
    Signed-off-by: Rajat Gupta <[email protected]>
    Acked-by: Greg Kroah-Hartman <[email protected]>
    Cc: [email protected]
    Signed-off-by: Helge Deller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
firmware: google: framebuffer: Do not mark framebuffer as busy [+ + +]
Author: Thomas Zimmermann <[email protected]>
Date:   Tue Feb 17 16:56:12 2026 +0100

    firmware: google: framebuffer: Do not mark framebuffer as busy
    
    commit f3850d399de3b6142b02315227ef9e772ed0c302 upstream.
    
    Remove the flag IORESOURCE_BUSY flag from coreboot's framebuffer
    resource. It prevents simpledrm from successfully requesting the
    range for its own use; resulting in errors such as
    
    [    2.775430] simple-framebuffer simple-framebuffer.0: [drm] could not acquire memory region [mem 0x80000000-0x80407fff flags 0x80000200]
    
    As with other uses of simple-framebuffer, the simple-framebuffer
    device should only declare it's I/O resources, but not actively use
    them.
    
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Fixes: 851b4c14532d ("firmware: coreboot: Add coreboot framebuffer driver")
    Acked-by: Tzung-Bi Shih <[email protected]>
    Acked-by: Julius Werner <[email protected]>
    Cc: Samuel Holland <[email protected]>
    Cc: Greg Kroah-Hartman <[email protected]>
    Cc: Tzung-Bi Shih <[email protected]>
    Cc: Brian Norris <[email protected]>
    Cc: Julius Werner <[email protected]>
    Cc: [email protected]
    Cc: <[email protected]> # v4.18+
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

firmware: google: framebuffer: Do not unregister platform device [+ + +]
Author: Thomas Zimmermann <[email protected]>
Date:   Tue May 5 08:01:31 2026 -0400

    firmware: google: framebuffer: Do not unregister platform device
    
    [ Upstream commit 5cd28bd28c8ce426b56ce4230dbd17537181d5ad ]
    
    The native driver takes over the framebuffer aperture by removing the
    system- framebuffer platform device. Afterwards the pointer in drvdata
    is dangling. Remove the entire logic around drvdata and let the kernel's
    aperture helpers handle this. The platform device depends on the native
    hardware device instead of the coreboot device anyway.
    
    When commit 851b4c14532d ("firmware: coreboot: Add coreboot framebuffer
    driver") added the coreboot framebuffer code, the kernel did not support
    device-based aperture management. Instead native driviers only removed
    the conflicting fbdev device. At that point, unregistering the framebuffer
    device most likely worked correctly. It was definitely broken after
    commit d9702b2a2171 ("fbdev/simplefb: Do not use struct
    fb_info.apertures"). So take this commit for the Fixes tag. Earlier
    releases might work depending on the native hardware driver.
    
    Signed-off-by: Thomas Zimmermann <[email protected]>
    Fixes: d9702b2a2171 ("fbdev/simplefb: Do not use struct fb_info.apertures")
    Acked-by: Tzung-Bi Shih <[email protected]>
    Acked-by: Julius Werner <[email protected]>
    Cc: Thomas Zimmermann <[email protected]>
    Cc: Javier Martinez Canillas <[email protected]>
    Cc: Hans de Goede <[email protected]>
    Cc: [email protected]
    Cc: <[email protected]> # v6.3+
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
flow_dissector: do not dissect PPPoE PFC frames [+ + +]
Author: Qingfang Deng <[email protected]>
Date:   Wed Apr 15 10:24:50 2026 +0800

    flow_dissector: do not dissect PPPoE PFC frames
    
    [ Upstream commit d6c19b31a3c1d519fabdcf0aa239e6b6109b9473 ]
    
    RFC 2516 Section 7 states that Protocol Field Compression (PFC) is NOT
    RECOMMENDED for PPPoE. In practice, pppd does not support negotiating
    PFC for PPPoE sessions, and the flow dissector driver has assumed an
    uncompressed frame until the blamed commit.
    
    During the review process of that commit [1], support for PFC is
    suggested. However, having a compressed (1-byte) protocol field means
    the subsequent PPP payload is shifted by one byte, causing 4-byte
    misalignment for the network header and an unaligned access exception
    on some architectures.
    
    The exception can be reproduced by sending a PPPoE PFC frame to an
    ethernet interface of a MIPS board, with RPS enabled, even if no PPPoE
    session is active on that interface:
    
    $ 0   : 00000000 80c40000 00000000 85144817
    $ 4   : 00000008 00000100 80a75758 81dc9bb8
    $ 8   : 00000010 8087ae2c 0000003d 00000000
    $12   : 000000e0 00000039 00000000 00000000
    $16   : 85043240 80a75758 81dc9bb8 00006488
    $20   : 0000002f 00000007 85144810 80a70000
    $24   : 81d1bda0 00000000
    $28   : 81dc8000 81dc9aa8 00000000 805ead08
    Hi    : 00009d51
    Lo    : 2163358a
    epc   : 805e91f0 __skb_flow_dissect+0x1b0/0x1b50
    ra    : 805ead08 __skb_get_hash_net+0x74/0x12c
    Status: 11000403        KERNEL EXL IE
    Cause : 40800010 (ExcCode 04)
    BadVA : 85144817
    PrId  : 0001992f (MIPS 1004Kc)
    Call Trace:
    [<805e91f0>] __skb_flow_dissect+0x1b0/0x1b50
    [<805ead08>] __skb_get_hash_net+0x74/0x12c
    [<805ef330>] get_rps_cpu+0x1b8/0x3fc
    [<805fca70>] netif_receive_skb_list_internal+0x324/0x364
    [<805fd120>] napi_complete_done+0x68/0x2a4
    [<8058de5c>] mtk_napi_rx+0x228/0xfec
    [<805fd398>] __napi_poll+0x3c/0x1c4
    [<805fd754>] napi_threaded_poll_loop+0x234/0x29c
    [<805fd848>] napi_threaded_poll+0x8c/0xb0
    [<80053544>] kthread+0x104/0x12c
    [<80002bd8>] ret_from_kernel_thread+0x14/0x1c
    
    Code: 02d51821  1060045b  00000000 <8c640000> 3084000f  2c820005  144001a2  00042080  8e220000
    
    To reduce the attack surface and maintain performance, do not process
    PPPoE PFC frames.
    
    [1] https://lore.kernel.org/r/[email protected]
    Fixes: 46126db9c861 ("flow_dissector: Add PPPoE dissectors")
    Signed-off-by: Qingfang Deng <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
gpio: of: clear OF_POPULATED on hog nodes in remove path [+ + +]
Author: Bartosz Golaszewski <[email protected]>
Date:   Mon Mar 9 13:42:37 2026 +0100

    gpio: of: clear OF_POPULATED on hog nodes in remove path
    
    commit bbee90e750262bfb406d66dc65c46d616d2b6673 upstream.
    
    The previously set OF_POPULATED flag should be cleared on the hog nodes
    when removing the chip.
    
    Cc: [email protected]
    Fixes: 63636d956c455 ("gpio: of: Add DT overlay support for GPIO hogs")
    Acked-by: Linus Walleij <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Bartosz Golaszewski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
hfsplus: fix held lock freed on hfsplus_fill_super() [+ + +]
Author: Zilin Guan <[email protected]>
Date:   Fri May 8 20:48:54 2026 -0400

    hfsplus: fix held lock freed on hfsplus_fill_super()
    
    [ Upstream commit 90c500e4fd83fa33c09bc7ee23b6d9cc487ac733 ]
    
    hfsplus_fill_super() calls hfs_find_init() to initialize a search
    structure, which acquires tree->tree_lock. If the subsequent call to
    hfsplus_cat_build_key() fails, the function jumps to the out_put_root
    error label without releasing the lock. The later cleanup path then
    frees the tree data structure with the lock still held, triggering a
    held lock freed warning.
    
    Fix this by adding the missing hfs_find_exit(&fd) call before jumping
    to the out_put_root error label. This ensures that tree->tree_lock is
    properly released on the error path.
    
    The bug was originally detected on v6.13-rc1 using an experimental
    static analysis tool we are developing, and we have verified that the
    issue persists in the latest mainline kernel. The tool is specifically
    designed to detect memory management issues. It is currently under active
    development and not yet publicly available.
    
    We confirmed the bug by runtime testing under QEMU with x86_64 defconfig,
    lockdep enabled, and CONFIG_HFSPLUS_FS=y. To trigger the error path, we
    used GDB to dynamically shrink the max_unistr_len parameter to 1 before
    hfsplus_asc2uni() is called. This forces hfsplus_asc2uni() to naturally
    return -ENAMETOOLONG, which propagates to hfsplus_cat_build_key() and
    exercises the faulty error path. The following warning was observed
    during mount:
    
            =========================
            WARNING: held lock freed!
            7.0.0-rc3-00016-gb4f0dd314b39 #4 Not tainted
            -------------------------
            mount/174 is freeing memory ffff888103f92000-ffff888103f92fff, with a lock still held there!
            ffff888103f920b0 (&tree->tree_lock){+.+.}-{4:4}, at: hfsplus_find_init+0x154/0x1e0
            2 locks held by mount/174:
            #0: ffff888103f960e0 (&type->s_umount_key#42/1){+.+.}-{4:4}, at: alloc_super.constprop.0+0x167/0xa40
            #1: ffff888103f920b0 (&tree->tree_lock){+.+.}-{4:4}, at: hfsplus_find_init+0x154/0x1e0
    
            stack backtrace:
            CPU: 2 UID: 0 PID: 174 Comm: mount Not tainted 7.0.0-rc3-00016-gb4f0dd314b39 #4 PREEMPT(lazy)
            Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014
            Call Trace:
            <TASK>
            dump_stack_lvl+0x82/0xd0
            debug_check_no_locks_freed+0x13a/0x180
            kfree+0x16b/0x510
            ? hfsplus_fill_super+0xcb4/0x18a0
            hfsplus_fill_super+0xcb4/0x18a0
            ? __pfx_hfsplus_fill_super+0x10/0x10
            ? srso_return_thunk+0x5/0x5f
            ? bdev_open+0x65f/0xc30
            ? srso_return_thunk+0x5/0x5f
            ? pointer+0x4ce/0xbf0
            ? trace_contention_end+0x11c/0x150
            ? __pfx_pointer+0x10/0x10
            ? srso_return_thunk+0x5/0x5f
            ? bdev_open+0x79b/0xc30
            ? srso_return_thunk+0x5/0x5f
            ? srso_return_thunk+0x5/0x5f
            ? vsnprintf+0x6da/0x1270
            ? srso_return_thunk+0x5/0x5f
            ? __mutex_unlock_slowpath+0x157/0x740
            ? __pfx_vsnprintf+0x10/0x10
            ? srso_return_thunk+0x5/0x5f
            ? srso_return_thunk+0x5/0x5f
            ? mark_held_locks+0x49/0x80
            ? srso_return_thunk+0x5/0x5f
            ? srso_return_thunk+0x5/0x5f
            ? irqentry_exit+0x17b/0x5e0
            ? trace_irq_disable.constprop.0+0x116/0x150
            ? __pfx_hfsplus_fill_super+0x10/0x10
            ? __pfx_hfsplus_fill_super+0x10/0x10
            get_tree_bdev_flags+0x302/0x580
            ? __pfx_get_tree_bdev_flags+0x10/0x10
            ? vfs_parse_fs_qstr+0x129/0x1a0
            ? __pfx_vfs_parse_fs_qstr+0x3/0x10
            vfs_get_tree+0x89/0x320
            fc_mount+0x10/0x1d0
            path_mount+0x5c5/0x21c0
            ? __pfx_path_mount+0x10/0x10
            ? trace_irq_enable.constprop.0+0x116/0x150
            ? trace_irq_enable.constprop.0+0x116/0x150
            ? srso_return_thunk+0x5/0x5f
            ? srso_return_thunk+0x5/0x5f
            ? kmem_cache_free+0x307/0x540
            ? user_path_at+0x51/0x60
            ? __x64_sys_mount+0x212/0x280
            ? srso_return_thunk+0x5/0x5f
            __x64_sys_mount+0x212/0x280
            ? __pfx___x64_sys_mount+0x10/0x10
            ? srso_return_thunk+0x5/0x5f
            ? trace_irq_enable.constprop.0+0x116/0x150
            ? srso_return_thunk+0x5/0x5f
            do_syscall_64+0x111/0x680
            entry_SYSCALL_64_after_hwframe+0x77/0x7f
            RIP: 0033:0x7ffacad55eae
            Code: 48 8b 0d 85 1f 0f 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 49 89 ca b8 a5 00 00 8
            RSP: 002b:00007fff1ab55718 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
            RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007ffacad55eae
            RDX: 000055740c64e5b0 RSI: 000055740c64e630 RDI: 000055740c651ab0
            RBP: 000055740c64e380 R08: 0000000000000000 R09: 0000000000000001
            R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
            R13: 000055740c64e5b0 R14: 000055740c651ab0 R15: 000055740c64e380
            </TASK>
    
    After applying this patch, the warning no longer appears.
    
    Fixes: 89ac9b4d3d1a ("hfsplus: fix longname handling")
    CC: [email protected]
    Signed-off-by: Zilin Guan <[email protected]>
    Reviewed-by: Viacheslav Dubeyko <[email protected]>
    Tested-by: Viacheslav Dubeyko <[email protected]>
    Signed-off-by: Viacheslav Dubeyko <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

hfsplus: fix uninit-value by validating catalog record size [+ + +]
Author: Deepanshu Kartikey <[email protected]>
Date:   Fri May 8 20:48:53 2026 -0400

    hfsplus: fix uninit-value by validating catalog record size
    
    [ Upstream commit b6b592275aeff184aa82fcf6abccd833fb71b393 ]
    
    Syzbot reported a KMSAN uninit-value issue in hfsplus_strcasecmp(). The
    root cause is that hfs_brec_read() doesn't validate that the on-disk
    record size matches the expected size for the record type being read.
    
    When mounting a corrupted filesystem, hfs_brec_read() may read less data
    than expected. For example, when reading a catalog thread record, the
    debug output showed:
    
      HFSPLUS_BREC_READ: rec_len=520, fd->entrylength=26
      HFSPLUS_BREC_READ: WARNING - entrylength (26) < rec_len (520) - PARTIAL READ!
    
    hfs_brec_read() only validates that entrylength is not greater than the
    buffer size, but doesn't check if it's less than expected. It successfully
    reads 26 bytes into a 520-byte structure and returns success, leaving 494
    bytes uninitialized.
    
    This uninitialized data in tmp.thread.nodeName then gets copied by
    hfsplus_cat_build_key_uni() and used by hfsplus_strcasecmp(), triggering
    the KMSAN warning when the uninitialized bytes are used as array indices
    in case_fold().
    
    Fix by introducing hfsplus_brec_read_cat() wrapper that:
    1. Calls hfs_brec_read() to read the data
    2. Validates the record size based on the type field:
       - Fixed size for folder and file records
       - Variable size for thread records (depends on string length)
    3. Returns -EIO if size doesn't match expected
    
    For thread records, check against HFSPLUS_MIN_THREAD_SZ before reading
    nodeName.length to avoid reading uninitialized data at call sites that
    don't zero-initialize the entry structure.
    
    Also initialize the tmp variable in hfsplus_find_cat() as defensive
    programming to ensure no uninitialized data even if validation is
    bypassed.
    
    Reported-by: [email protected]
    Closes: https://syzkaller.appspot.com/bug?extid=d80abb5b890d39261e72
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Tested-by: [email protected]
    Reviewed-by: Viacheslav Dubeyko <[email protected]>
    Tested-by: Viacheslav Dubeyko <[email protected]>
    Suggested-by: Charalampos Mitrodimas <[email protected]>
    Link: https://lore.kernel.org/all/[email protected]/ [v1]
    Link: https://lore.kernel.org/all/[email protected]/ [v2]
    Link: https://lore.kernel.org/all/[email protected]/ [v3]
    Link: https://lore.kernel.org/all/[email protected]/T/ [v4]
    Link: https://lore.kernel.org/all/[email protected]/T/ [v5]
    Signed-off-by: Deepanshu Kartikey <[email protected]>
    Signed-off-by: Viacheslav Dubeyko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Viacheslav Dubeyko <[email protected]>
    Stable-dep-of: 90c500e4fd83 ("hfsplus: fix held lock freed on hfsplus_fill_super()")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
HID: playstation: Clamp num_touch_reports [+ + +]
Author: T.J. Mercier <[email protected]>
Date:   Fri Apr 17 08:47:02 2026 -0700

    HID: playstation: Clamp num_touch_reports
    
    commit cac61b58a3b6340c52afa06bb15eac033158db2f upstream.
    
    A device would never lie about the number of touch reports would it?
    
    If it does the loop in dualshock4_parse_report will read off the end of
    the touch_reports array, up to about 2 KiB for the maximum number of 256
    loop iteraions. The data that is read is emitted via evdev if the
    DS4_TOUCH_POINT_INACTIVE bit happens to be set. Protect against this by
    clamping the num_touch_reports value provided by the device to the
    maximum size of the touch_reports array.
    
    Fixes: 752038248808 ("HID: playstation: add DualShock4 touchpad support.")
    Cc: [email protected]
    Reported-by: Xingyu Jin <[email protected]>
    Signed-off-by: T.J. Mercier <[email protected]>
    Signed-off-by: Jiri Kosina <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
hv_sock: fix ARM64 support [+ + +]
Author: Hamza Mahfooz <[email protected]>
Date:   Tue Apr 28 08:53:39 2026 -0400

    hv_sock: fix ARM64 support
    
    commit b31681206e3f527970a7c7ed807fbf6a028fc25b upstream.
    
    VMBUS ring buffers must be page aligned. Therefore, the current value of
    24K presents a challenge on ARM64 kernels (with 64K pages). So, use
    VMBUS_RING_SIZE() to ensure they are always aligned and large enough to
    hold all of the relevant data.
    
    Cc: [email protected]
    Fixes: 77ffe33363c0 ("hv_sock: use HV_HYP_PAGE_SIZE for Hyper-V communication")
    Tested-by: Dexuan Cui <[email protected]>
    Reviewed-by: Dexuan Cui <[email protected]>
    Signed-off-by: Hamza Mahfooz <[email protected]>
    Acked-by: Stefano Garzarella <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
hwmon: (corsair-psu) Close HID device on probe errors [+ + +]
Author: Myeonghun Pak <[email protected]>
Date:   Fri Apr 24 22:50:51 2026 +0900

    hwmon: (corsair-psu) Close HID device on probe errors
    
    commit 174606451fbb17db506ebaacdd5e203e57773d5f upstream.
    
    corsairpsu_probe() opens the HID device before sending the device init
    and firmware-info commands. If either command fails, the error path jumps
    directly to fail_and_stop and skips hid_hw_close().
    
    Use the existing fail_and_close label for those post-open failures so the
    open count and low-level close callback are balanced before hid_hw_stop().
    
    Fixes: d115b51e0e56 ("hwmon: add Corsair PSU HID controller driver")
    Cc: [email protected]
    Signed-off-by: Myeonghun Pak <[email protected]>
    Reviewed-by: Wilken Gottwalt <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

hwmon: (ltc2992) Clamp threshold writes to hardware range [+ + +]
Author: Sanman Pradhan <[email protected]>
Date:   Thu Apr 16 21:59:30 2026 +0000

    hwmon: (ltc2992) Clamp threshold writes to hardware range
    
    commit d6cc7c99bf1f73eda7d565d224d791d16239bb41 upstream.
    
    ltc2992_set_voltage(), ltc2992_set_current(), and ltc2992_set_power()
    do not validate the user-supplied value before converting it to a
    register value. This can result in:
    
    1. Negative input values wrapping to large positive register values.
       For power, the negative long is implicitly cast to u64 in
       mul_u64_u32_div(), producing an incorrect value. For voltage and
       current, the negative converted value wraps when passed to
       ltc2992_write_reg() as a u32.
    
    2. Intermediate arithmetic exceeding the range representable in u64 on
       64-bit platforms. In ltc2992_set_voltage(), (u64)val * 1000 can
       exceed U64_MAX when val is a large positive long. In
       ltc2992_set_current(), (u64)val * r_sense_uohm can overflow
       similarly. In ltc2992_set_power(), the computed value may not fit
       in u64.
    
    3. Register values exceeding the hardware field width. Voltage and
       current threshold registers are 12-bit (stored left-justified in
       16 bits), and power threshold registers are 24-bit. Without
       clamping, bits above the field width are truncated in
       ltc2992_write_reg().
    
    Fix by clamping negative values to zero, clamping positive values to
    the rounded hardware-representable maximum (the value returned by the
    read path for a full-scale register) to prevent intermediate overflow,
    and clamping the converted register value to the hardware field width
    before writing. The existing conversion formula and rounding behavior
    are preserved.
    
    In the power write path, cancel the factor of 1000 from both the
    numerator (r_sense_uohm * 1000) and the denominator
    (VADC_UV_LSB * IADC_NANOV_LSB) to also eliminate a u32 overflow of
    r_sense_uohm * 1000 when r_sense_uohm exceeds about 4.29 ohms.
    
    Fixes: b0bd407e94b03 ("hwmon: (ltc2992) Add support")
    Cc: [email protected]
    Signed-off-by: Sanman Pradhan <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

hwmon: (ltc2992) Fix u32 overflow in power read path [+ + +]
Author: Sanman Pradhan <[email protected]>
Date:   Thu Apr 16 21:59:40 2026 +0000

    hwmon: (ltc2992) Fix u32 overflow in power read path
    
    commit 2da0c1fd01dbd6b22844e8676585153dfc660cbe upstream.
    
    ltc2992_get_power() computes the divisor for mul_u64_u32_div() as
    r_sense_uohm * 1000. This multiplication overflows u32 when
    r_sense_uohm exceeds about 4.29 ohms (4294967 micro-ohms), producing
    a truncated divisor and an incorrect power reading.
    
    Cancel the factor of 1000 from both the numerator
    (VADC_UV_LSB * IADC_NANOV_LSB = 312500000) and the divisor
    (r_sense_uohm * 1000), giving (VADC_UV_LSB / 1000) * IADC_NANOV_LSB
    = 312500 as the numerator and plain r_sense_uohm as the divisor.
    The cancellation is exact because LTC2992_VADC_UV_LSB (25000) is
    divisible by 1000.
    
    This is the read-path counterpart of the write-path fix applied in
    the preceding patch.
    
    Fixes: b0bd407e94b03 ("hwmon: (ltc2992) Add support")
    Cc: [email protected]
    Signed-off-by: Sanman Pradhan <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Guenter Roeck <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
IB/core: Fix zero dmac race in neighbor resolution [+ + +]
Author: Chen Zhao <[email protected]>
Date:   Sun Apr 5 18:44:55 2026 +0300

    IB/core: Fix zero dmac race in neighbor resolution
    
    commit 5e6de34d82b49cab9d8a42063e9cd0f22a4f31e5 upstream.
    
    dst_fetch_ha() checks nud_state without holding the neighbor lock, then
    copies ha under the seqlock. A race in __neigh_update() where nud_state
    is set to NUD_REACHABLE before ha is written allows dst_fetch_ha() to
    read a zero MAC address while the seqlock reports no concurrent writer.
    
    netevent_callback amplifies this by waking ALL pending addr_req workers
    when ANY neighbor becomes NUD_VALID. At scale (N peers resolving ARP
    concurrently), the hit probability scales as N^2, making it near-certain
    for large RDMA workloads.
    
    N(A): neigh_update(A)                   W(A): addr_resolve(A)
     |                                       [sleep]
     | write_lock_bh(&A->lock)               |
     | A->nud_state = NUD_REACHABLE          |
     | // A->ha is still 0                   |
     |                                       [woken by netevent_cb() of
     |                                         another neighbour]
     |                                       | dst_fetch_ha(A)
     |                                       |   A->nud_state & NUD_VALID
     |                                       |   read_seqbegin(&A->ha_lock)
     |                                       |   snapshot = A->ha  /* 0 */
     |                                       |   read_seqretry(&A->ha_lock)
     |                                       |   return snapshot
     | seqlock(&A->ha_lock)
     | A->ha = mac_A     /* too late */
     | sequnlock(&A->ha_lock)
     | write_unlock_bh(&A->lock)
    
    The incorrect/zero mac is read and programmed in the device QP while it
    was not yet updated. This causes silent packet loss and eventual
    RETRY_EXC_ERR.
    
    Fix by holding the neighbor read lock across the nud_state check and
    ha copy in dst_fetch_ha(), ensuring it synchronizes with
    __neigh_update() which is updating while holding the write lock.
    
    Cc: [email protected]
    Fixes: 92ebb6a0a13a ("IB/cm: Remove now useless rcu_lock in dst_fetch_ha")
    Link: https://patch.msgid.link/r/[email protected]
    Signed-off-by: Chen Zhao <[email protected]>
    Reviewed-by: Parav Pandit <[email protected]>
    Signed-off-by: Leon Romanovsky <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ibmasm: fix heap over-read in ibmasm_send_i2o_message() [+ + +]
Author: Tyllis Xu <[email protected]>
Date:   Sat Mar 14 11:58:05 2026 -0500

    ibmasm: fix heap over-read in ibmasm_send_i2o_message()
    
    commit 9aad71144fa3682cca3837a06c8623016790e7ec upstream.
    
    The ibmasm_send_i2o_message() function uses get_dot_command_size() to
    compute the byte count for memcpy_toio(), but this value is derived from
    user-controlled fields in the dot_command_header (command_size: u8,
    data_size: u16) and is never validated against the actual allocation size.
    A root user can write a small buffer with inflated header fields, causing
    memcpy_toio() to read up to ~65 KB past the end of the allocation into
    adjacent kernel heap, which is then forwarded to the service processor
    over MMIO.
    
    Silently clamping the copy size is not sufficient: if the header fields
    claim a larger size than the buffer, the SP receives a dot command whose
    own header is inconsistent with the I2O message length, which can cause
    the SP to desynchronize. Reject such commands outright by returning
    failure.
    
    Validate command_size before calling get_mfa_inbound() to avoid leaking
    an I2O message frame: reading INBOUND_QUEUE_PORT dequeues a hardware
    frame from the controller's free pool, and returning without a
    corresponding set_mfa_inbound() call would permanently exhaust it.
    
    Additionally, clamp command_size to I2O_COMMAND_SIZE before the
    memcpy_toio() so the MMIO write stays within the I2O message frame,
    consistent with the clamping already performed by outgoing_message_size()
    for the header field.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Reported-by: Yuhao Jiang <[email protected]>
    Cc: [email protected]
    Signed-off-by: Tyllis Xu <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ibmasm: fix OOB reads in command_file_write due to missing size checks [+ + +]
Author: Tyllis Xu <[email protected]>
Date:   Sat Mar 14 11:53:54 2026 -0500

    ibmasm: fix OOB reads in command_file_write due to missing size checks
    
    commit 0eb09f737428e482a32a2e31e5e223f2b35a71d3 upstream.
    
    The command_file_write() handler allocates a kernel buffer of exactly
    count bytes and copies user data into it, but does not validate the
    buffer against the dot command protocol before passing it to
    get_dot_command_size() and get_dot_command_timeout().
    
    Since both the allocation size (count) and the header fields (command_size,
    data_size) are independently user-controlled, an attacker can cause
    get_dot_command_size() to return a value exceeding the allocation,
    triggering OOB reads in get_dot_command_timeout() and an out-of-bounds
    memcpy_toio() that leaks kernel heap memory to the service processor.
    
    Fix with two guards: reject writes smaller than sizeof(struct
    dot_command_header) before allocation, then after copying user data
    reject commands where the buffer is smaller than the total size declared
    by the header (sizeof(header) + command_size + data_size). This ensures
    all subsequent header and payload field accesses stay within the buffer.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Reported-by: Yuhao Jiang <[email protected]>
    Cc: [email protected]
    Signed-off-by: Tyllis Xu <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ibmveth: Disable GSO for packets with small MSS [+ + +]
Author: Mingming Cao <[email protected]>
Date:   Fri Apr 24 09:29:17 2026 -0700

    ibmveth: Disable GSO for packets with small MSS
    
    commit cc427d24ac6442ffdeafd157a63c7c5b73ed4de4 upstream.
    
    Some physical adapters on Power systems do not support segmentation
    offload when the MSS is less than 224 bytes. Attempting to send such
    packets causes the adapter to freeze, stopping all traffic until
    manually reset.
    
    Implement ndo_features_check to disable GSO for packets with small MSS
    values. The network stack will perform software segmentation instead.
    
    The 224-byte minimum matches ibmvnic
    commit <f10b09ef687f> ("ibmvnic: Enforce stronger sanity checks
    on GSO packets")
    which uses the same physical adapters in SEA configurations.
    
    The issue occurs specifically when the hardware attempts to perform
    segmentation (gso_segs > 1) with a small MSS. Single-segment GSO packets
    (gso_segs == 1) do not trigger the problematic LSO code path and are
    transmitted normally without segmentation.
    
    Add an ndo_features_check callback to disable GSO when MSS < 224 bytes.
    Also call vlan_features_check() to ensure proper handling of VLAN packets,
    particularly QinQ (802.1ad) configurations where the hardware parser may
    not support certain offload features.
    
    Validated using iptables to force small MSS values. Without the fix,
    the adapter freezes. With the fix, packets are segmented in software
    and transmission succeeds. Comprehensive regression testing completedd
    (MSS tests, performance, stability).
    
    Fixes: 8641dd85799f ("ibmveth: Add support for TSO")
    Cc: [email protected]
    Reviewed-by: Brian King <[email protected]>
    Tested-by: Shaik Abdulla <[email protected]>
    Tested-by: Naveed Ahmed <[email protected]>
    Signed-off-by: Mingming Cao <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
iio: adc: ad7768-1: fix one-shot mode data acquisition [+ + +]
Author: Jonathan Santos <[email protected]>
Date:   Mon Feb 23 08:59:26 2026 -0300

    iio: adc: ad7768-1: fix one-shot mode data acquisition
    
    commit 8be19e233744961db6069da9c9ab63eb085a0447 upstream.
    
    According to the datasheet, one-shot mode requires a SYNC_IN pulse to
    trigger a new sample conversion. In the current implementation, No sync
    pulse was sent after switching to one-shot mode and reinit_completion()
    was called before mode switching, creating a race condition where spurious
    interrupts during mode change could trigger completion prematurely.
    
    Fix by sending a sync pulse after configuring one-shot mode and
    reinit_completion() to ensure it only waits for the actual conversion
    completion.
    
    Fixes: a5f8c7da3dbe ("iio: adc: Add AD7768-1 ADC basic support")
    Signed-off-by: Jonathan Santos <[email protected]>
    Reviewed-by: David Lechner <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

iio: adc: ti-ads7950: use iio_push_to_buffers_with_ts_unaligned() [+ + +]
Author: David Lechner <[email protected]>
Date:   Sat Mar 14 16:12:24 2026 -0500

    iio: adc: ti-ads7950: use iio_push_to_buffers_with_ts_unaligned()
    
    commit 7806c060cceb2d6895efbb6cff2f2f17cf1ec5de upstream.
    
    Use iio_push_to_buffers_with_ts_unaligned() to avoid unaligned access
    when writing the timestamp in the rx_buf.
    
    The previous implementation would have been fine on architectures that
    support 4-byte alignment of 64-bit integers but could cause issues on
    architectures that require 8-byte alignment.
    
    Fixes: 902c4b2446d4 ("iio: adc: New driver for TI ADS7950 chips")
    Signed-off-by: David Lechner <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
inotify: fix watch count leak when fsnotify_add_inode_mark_locked() fails [+ + +]
Author: Chia-Ming Chang <[email protected]>
Date:   Tue Feb 24 17:34:42 2026 +0800

    inotify: fix watch count leak when fsnotify_add_inode_mark_locked() fails
    
    commit 6a320935fa4293e9e599ec9f85dc9eb3be7029f8 upstream.
    
    When fsnotify_add_inode_mark_locked() fails in inotify_new_watch(),
    the error path calls inotify_remove_from_idr() but does not call
    dec_inotify_watches() to undo the preceding inc_inotify_watches().
    This leaks a watch count, and repeated failures can exhaust the
    max_user_watches limit with -ENOSPC even when no watches are active.
    
    Prior to commit 1cce1eea0aff ("inotify: Convert to using per-namespace
    limits"), the watch count was incremented after fsnotify_add_mark_locked()
    succeeded, so this path was not affected. The conversion moved
    inc_inotify_watches() before the mark insertion without adding the
    corresponding rollback.
    
    Add the missing dec_inotify_watches() call in the error path.
    
    Fixes: 1cce1eea0aff ("inotify: Convert to using per-namespace limits")
    Cc: [email protected]
    Signed-off-by: Chia-Ming Chang <[email protected]>
    Signed-off-by: robbieko <[email protected]>
    Reviewed-by: Nikolay Borisov <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jan Kara <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
io_uring/poll: ensure EPOLL_ONESHOT is propagated for EPOLL_URING_WAKE [+ + +]
Author: Jens Axboe <[email protected]>
Date:   Tue Apr 21 13:24:33 2026 -0600

    io_uring/poll: ensure EPOLL_ONESHOT is propagated for EPOLL_URING_WAKE
    
    commit 1967f0b1cafdde37aa9e08e6021c14bcc484b7a5 upstream.
    
    Commit:
    
    aacf2f9f382c ("io_uring: fix req->apoll_events")
    
    fixed an issue where poll->events and req->apoll_events weren't
    synchronized, but then when the commit referenced in Fixes got added,
    it didn't ensure the same thing.
    
    If we mask in EPOLLONESHOT in the regular EPOLL_URING_WAKE path, then
    ensure it's done for both. Including a link to the original report
    below, even though it's mostly nonsense. But it includes a reproducer
    that does show that IORING_CQE_F_MORE is set in the previous CQE,
    while no more CQEs will be generated for this request. Just ignore
    anything that pretends this is security related in any way, it's just
    the typical AI nonsense.
    
    Cc: [email protected]
    Link: https://lore.kernel.org/io-uring/CAM0zi7yQzF3eKncgHo4iVM5yFLAjsiob_ucqyWKs=hyd_GqiMg@mail.gmail.com/
    Reported-by: Azizcan Daştan <[email protected]>
    Fixes: 4464853277d0 ("io_uring: pass in EPOLL_URING_WAKE for eventfd signaling and wakeups")
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

io_uring/poll: fix multishot recv missing EOF on wakeup race [+ + +]
Author: Jens Axboe <[email protected]>
Date:   Sat May 2 01:51:55 2026 +0300

    io_uring/poll: fix multishot recv missing EOF on wakeup race
    
    [ Upstream commit a68ed2df72131447d131531a08fe4dfcf4fa4653 ]
    
    When a socket send and shutdown() happen back-to-back, both fire
    wake-ups before the receiver's task_work has a chance to run. The first
    wake gets poll ownership (poll_refs=1), and the second bumps it to 2.
    When io_poll_check_events() runs, it calls io_poll_issue() which does a
    recv that reads the data and returns IOU_RETRY. The loop then drains all
    accumulated refs (atomic_sub_return(2) -> 0) and exits, even though only
    the first event was consumed. Since the shutdown is a persistent state
    change, no further wakeups will happen, and the multishot recv can hang
    forever.
    
    Check specifically for HUP in the poll loop, and ensure that another
    loop is done to check for status if more than a single poll activation
    is pending. This ensures we don't lose the shutdown event.
    
    Backport notes for linux-6.6.y:
      - In 6.6.y the do-while masks v in the while-condition itself
        (`atomic_sub_return(v & IO_POLL_REF_MASK, ...) & IO_POLL_REF_MASK`),
        so v can carry IO_POLL_RETRY_FLAG / IO_POLL_CANCEL_FLAG bits when
        we reach the multishot branch.  The HUP check therefore compares
        `(v & IO_POLL_REF_MASK) != 1` rather than the upstream
        `v != 1`, to avoid reacting to flag bits.
      - io_poll_issue takes `ts` (struct io_tw_state *) here.
    
    CVE: CVE-2026-23473
    Cc: [email protected] # 6.6.y
    Fixes: dbc2564cfe0f ("io_uring: let fast poll support multishot")
    Reported-by: Francis Brosseau <[email protected]>
    Link: https://github.com/axboe/liburing/issues/1549
    Signed-off-by: Jens Axboe <[email protected]>
    [backport for linux-6.6.y, verified 2026-05-01]
    Signed-off-by: Sasha Levin <[email protected]>

io_uring/poll: fix signed comparison in io_poll_get_ownership() [+ + +]
Author: Longxuan Yu <[email protected]>
Date:   Sun Apr 12 16:38:20 2026 +0800

    io_uring/poll: fix signed comparison in io_poll_get_ownership()
    
    commit 326941b22806cbf2df1fbfe902b7908b368cce42 upstream.
    
    io_poll_get_ownership() uses a signed comparison to check whether
    poll_refs has reached the threshold for the slowpath:
    
        if (unlikely(atomic_read(&req->poll_refs) >= IO_POLL_REF_BIAS))
    
    atomic_read() returns int (signed). When IO_POLL_CANCEL_FLAG
    (BIT(31)) is set in poll_refs, the value becomes negative in
    signed arithmetic, so the >= 128 comparison always evaluates to
    false and the slowpath is never taken.
    
    Fix this by casting the atomic_read() result to unsigned int
    before the comparison, so that the cancel flag is treated as a
    large positive value and correctly triggers the slowpath.
    
    Fixes: a26a35e9019f ("io_uring: make poll refs more robust")
    Cc: [email protected]
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Co-developed-by: Yuan Tan <[email protected]>
    Signed-off-by: Yuan Tan <[email protected]>
    Suggested-by: Xin Liu <[email protected]>
    Tested-by: Zhengchuan Liang <[email protected]>
    Signed-off-by: Longxuan Yu <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Reviewed-by: Pavel Begunkov <[email protected]>
    Link: https://patch.msgid.link/3a3508b08bcd7f1bc3beff848ae6e1d73d355043.1775965597.git.ylong030@ucr.edu
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
io_uring/timeout: check unused sqe fields [+ + +]
Author: Pavel Begunkov <[email protected]>
Date:   Mon Mar 2 13:10:34 2026 +0000

    io_uring/timeout: check unused sqe fields
    
    commit 484ae637a3e3d909718de7c07afd3bb34b6b8504 upstream.
    
    Zero check unused SQE fields addr3 and pad2 for timeout and timeout
    update requests. They're not needed now, but could be used sometime
    in the future.
    
    Cc: [email protected]
    Signed-off-by: Pavel Begunkov <[email protected]>
    Signed-off-by: Jens Axboe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
iommu/amd: serialize sequence allocation under concurrent TLB invalidations [+ + +]
Author: Ankit Soni <[email protected]>
Date:   Thu Jan 22 15:30:38 2026 +0000

    iommu/amd: serialize sequence allocation under concurrent TLB invalidations
    
    commit 9e249c48412828e807afddc21527eb734dc9bd3d upstream.
    
    With concurrent TLB invalidations, completion wait randomly gets timed out
    because cmd_sem_val was incremented outside the IOMMU spinlock, allowing
    CMD_COMPL_WAIT commands to be queued out of sequence and breaking the
    ordering assumption in wait_on_sem().
    Move the cmd_sem_val increment under iommu->lock so completion sequence
    allocation is serialized with command queuing.
    And remove the unnecessary return.
    
    Fixes: d2a0cac10597 ("iommu/amd: move wait_on_sem() out of spinlock")
    
    Tested-by: Srikanth Aithal <[email protected]>
    Reported-by: Srikanth Aithal <[email protected]>
    Signed-off-by: Ankit Soni <[email protected]>
    Reviewed-by: Vasant Hegde <[email protected]>
    Signed-off-by: Joerg Roedel <[email protected]>
    [Salvatore Bonaccorso: Backport to v6.12.y where f32fe7cb0198
    ("iommu/amd: Add support to remap/unmap IOMMU buffers for kdump") is not
    present]
    Signed-off-by: Salvatore Bonaccorso <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

iommu/amd: Use atomic64_inc_return() in iommu.c [+ + +]
Author: Uros Bizjak <[email protected]>
Date:   Mon Oct 7 10:43:31 2024 +0200

    iommu/amd: Use atomic64_inc_return() in iommu.c
    
    commit 5ce73c524f5fb5abd7b1bfed0115474b4fb437b4 upstream.
    
    Use atomic64_inc_return(&ref) instead of atomic64_add_return(1, &ref)
    to use optimized implementation and ease register pressure around
    the primitive for targets that implement optimized variant.
    
    Signed-off-by: Uros Bizjak <[email protected]>
    Cc: Joerg Roedel <[email protected]>
    Cc: Suravee Suthikulpanit <[email protected]>
    Cc: Will Deacon <[email protected]>
    Cc: Robin Murphy <[email protected]>
    Reviewed-by: Jason Gunthorpe <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Joerg Roedel <[email protected]>
    Signed-off-by: Salvatore Bonaccorso <[email protected]>
    Stable-dep-of: 9e249c48412828e807afddc21527eb734dc9bd3d ("iommu/amd: serialize sequence allocation under concurrent TLB invalidations")
    Signed-off-by: Sasha Levin <[email protected]>

 
iommufd: Fix a race with concurrent allocation and unmap [+ + +]
Author: Sina Hassani <[email protected]>
Date:   Fri Apr 10 11:32:44 2026 -0700

    iommufd: Fix a race with concurrent allocation and unmap
    
    commit 8602018b1f17fbdaa5e5d79f4c8603ad20640c12 upstream.
    
    iopt_unmap_iova_range() releases the lock on iova_rwsem inside the loop
    body when getting to the more expensive unmap operations. This is fine on
    its own, except the loop condition is based on the first area that matches
    the unmap address range. If a concurrent call to map picks an area that
    was unmapped in previous iterations, the loop mistakenly tries to unmap
    it.
    
    This is reproducible by having one userspace thread map buffers and pass
    them to another thread that unmaps them. The problem manifests as EBUSY
    errors with single page mappings.
    
    Fix this by advancing the start pointer after unmapping an area. This
    ensures each iteration only examines the IOVA range that remains mapped,
    which is guaranteed not to have overlaps.
    
    Cc: [email protected]
    Fixes: 51fe6141f0f6 ("iommufd: Data structure to provide IOVA to PFN mapping")
    Link: https://patch.msgid.link/r/CAAJpGJSR4r_ds1JOjmkqHtsBPyxu8GntoeW08Sk5RNQPmgi+tg@mail.gmail.com
    Signed-off-by: Sina Hassani <[email protected]>
    Reviewed-by: Kevin Tian <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ip6_gre: Use cached t->net in ip6erspan_changelink(). [+ + +]
Author: Maoyi Xie <[email protected]>
Date:   Thu Apr 30 18:33:18 2026 +0800

    ip6_gre: Use cached t->net in ip6erspan_changelink().
    
    commit 1d324c2f43f70c965f25c58cc3611c779adbe47e upstream.
    
    After commit 5e72ce3e3980 ("net: ipv6: Use link netns in newlink() of
    rtnl_link_ops"), ip6erspan_newlink() correctly resolves the per-netns
    ip6gre hash via link_net. ip6erspan_changelink() was not converted in
    that series and still uses dev_net(dev), which diverges from the
    device's creation netns after IFLA_NET_NS_FD migration.
    
    This re-inserts the tunnel into the wrong per-netns hash. The
    original netns keeps a stale entry. When that netns is later
    destroyed, ip6gre_exit_rtnl_net() walks the stale entry, producing a
    slab-use-after-free reported by KASAN, followed by a kernel BUG at
    net/core/dev.c (LIST_POISON1) in unregister_netdevice_many_notify().
    
    Reachable from an unprivileged user namespace (unshare --user
    --map-root-user --net).
    
    ip6gre_changelink() earlier in the same file already uses the cached
    t->net; only ip6erspan_changelink() has the wrong shape.
    
    Fixes: 2d665034f239 ("net: ip6_gre: Fix ip6erspan hlen calculation")
    Cc: [email protected] # v5.15+
    Signed-off-by: Maoyi Xie <[email protected]>
    Reviewed-by: Eric Dumazet <[email protected]>
    Reviewed-by: Kuniyuki Iwashima <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ipmi: Add limits to event and receive message requests [+ + +]
Author: Corey Minyard <[email protected]>
Date:   Mon Apr 20 12:39:51 2026 -0500

    ipmi: Add limits to event and receive message requests
    
    commit c4cca236968683eb0d59abfb12d5c7e4d8514227 upstream.
    
    The driver would just fetch events and receive messages until the
    BMC said it was done.  To avoid issues with BMCs that never say they are
    done, add a limit of 10 fetches at a time.
    
    In addition, an si interface has an attn state it can return from the
    hardware which is supposed to cause a flag fetch to see if the driver
    needs to fetch events or message or a few other things.  If the attn
    bit gets stuck, it's a similar problem.  So allow messages in between
    flag fetches so the driver itself doesn't get stuck.
    
    This is a more general fix than the previous fix for the specific bad
    BMC, but should fix the more general issue of a BMC that won't stop
    saying it has data.
    
    This has been there from the beginning of the driver.  It's not a bug
    per-se, but it is accounting for bugs in BMCs.
    
    Reported-by: Matt Fleming <[email protected]>
    Closes: https://lore.kernel.org/lkml/[email protected]/
    Fixes: <1da177e4c3f4> ("Linux-2.6.12-rc2")
    Cc: [email protected]
    Signed-off-by: Corey Minyard <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ipmi: Check event message buffer response for bad data [+ + +]
Author: Corey Minyard <[email protected]>
Date:   Mon Apr 20 12:50:09 2026 -0500

    ipmi: Check event message buffer response for bad data
    
    commit 36920f30e78e69df01f9691c470b6f3ba8aebf98 upstream.
    
    The event message buffer response data size got checked later when
    processing, but check it right after the response comes back.  It
    appears some BMCs may return an empty message instead of an error
    when fetching events.
    
    There are apparently some new BMCs that make this error, so we need to
    compensate.
    
    Reported-by: Matt Fleming <[email protected]>
    Closes: https://lore.kernel.org/lkml/[email protected]/
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: <[email protected]>
    Signed-off-by: Corey Minyard <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Linux: ipmi:si: Return state to normal if message allocation fails [+ + +]
Author: Corey Minyard <[email protected]>
Date:   Mon Apr 20 13:02:18 2026 -0500

    ipmi:si: Return state to normal if message allocation fails
    
    commit 09dd798270ff582d7309f285d4aaf5dbebae01cb upstream.
    
    There were places where nothing would get started if a message
    allocation failed, so the driver needs to return to normal state.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: <[email protected]>
    Signed-off-by: Corey Minyard <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Linux: ipmi:ssif: Clean up kthread on errors [+ + +]
Author: Corey Minyard <[email protected]>
Date:   Fri May 1 09:06:58 2026 -0500

    ipmi:ssif: Clean up kthread on errors
    
    If an error occurs after the ssif kthread is created, but before the
    main IPMI code starts the ssif interface, the ssif kthread will not
    be stopped.
    
    So make sure the kthread is stopped on an error condition if it is
    running.
    
    Fixes: 259307074bfc ("ipmi: Add SMBus interface driver (SSIF)")
    Reported-by: Li Xiao <<[email protected]>
    Cc: [email protected]
    Reviewed-by: Li Xiao <[email protected]>
    Signed-off-by: Corey Minyard <[email protected]>
    (cherry picked from commit 75c486cb1bcaa1a3ec3a6438498176a3a4998ae4)
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

Linux: ipmi:ssif: Fix a shutdown race [+ + +]
Author: Corey Minyard <[email protected]>
Date:   Fri May 1 09:06:57 2026 -0500

    ipmi:ssif: Fix a shutdown race
    
    It was possible for the SSIF thread to stop and quit before the
    kthread_stop() call because ssif->stopping was set before the
    stop.  So only exit the SSIF thread is kthread_should_stop()
    returns true.
    
    There is no need to wake the thread, as the wait will be interrupted
    by kthread_stop().
    
    Signed-off-by: Corey Minyard <[email protected]>
    (cherry picked from commit 6bd0eb6d759b9a22c5509ea04e19c2e8407ba418)
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ipv4: icmp: validate reply type before using icmp_pointers [+ + +]
Author: Ruide Cao <[email protected]>
Date:   Tue Apr 21 12:16:31 2026 +0800

    ipv4: icmp: validate reply type before using icmp_pointers
    
    commit 67bf002a2d7387a6312138210d0bd06e3cf4879b upstream.
    
    Extended echo replies use ICMP_EXT_ECHOREPLY as the outbound reply type.
    That value is outside the range covered by icmp_pointers[], which only
    describes the traditional ICMP types up to NR_ICMP_TYPES.
    
    Avoid consulting icmp_pointers[] for reply types outside that range, and
    use array_index_nospec() for the remaining in-range lookup. Normal ICMP
    replies keep their existing behavior unchanged.
    
    Fixes: d329ea5bd884 ("icmp: add response to RFC 8335 PROBE messages")
    Cc: [email protected]
    Reported-by: Yuan Tan <[email protected]>
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Reported-by: Xin Liu <[email protected]>
    Signed-off-by: Ruide Cao <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/0dace90c01a5978e829ca741ef684dbd7304ce62.1776628519.git.caoruide123@gmail.com
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ipv6: rpl: reserve mac_len headroom when recompressed SRH grows [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Tue Apr 21 15:16:33 2026 +0200

    ipv6: rpl: reserve mac_len headroom when recompressed SRH grows
    
    commit 9e6bf146b55999a095bb14f73a843942456d1adc upstream.
    
    ipv6_rpl_srh_rcv() decompresses an RFC 6554 Source Routing Header, swaps
    the next segment into ipv6_hdr->daddr, recompresses, then pulls the old
    header and pushes the new one plus the IPv6 header back.  The
    recompressed header can be larger than the received one when the swap
    reduces the common-prefix length the segments share with daddr (CmprI=0,
    CmprE>0, seg[0][0] != daddr[0] gives the maximum +8 bytes).
    
    pskb_expand_head() was gated on segments_left == 0, so on earlier
    segments the push consumed unchecked headroom.  Once skb_push() leaves
    fewer than skb->mac_len bytes in front of data,
    skb_mac_header_rebuild()'s call to:
    
            skb_set_mac_header(skb, -skb->mac_len);
    
    will store (data - head) - mac_len into the u16 mac_header field, which
    wraps to ~65530, and the following memmove() writes mac_len bytes ~64KiB
    past skb->head.
    
    A single AF_INET6/SOCK_RAW/IPV6_HDRINCL packet over lo with a two
    segment type-3 SRH (CmprI=0, CmprE=15) reaches headroom 8 after one
    pass; KASAN reports a 14-byte OOB write in ipv6_rthdr_rcv.
    
    Fix this by expanding the head whenever the remaining room is less than
    the push size plus mac_len, and request that much extra so the rebuilt
    MAC header fits afterwards.
    
    Fixes: 8610c7c6e3bd ("net: ipv6: add support for rpl sr exthdr")
    Cc: stable <[email protected]>
    Reported-by: Anthropic
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Link: https://patch.msgid.link/2026042133-gout-unvented-1bd9@gregkh
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ipv6: xfrm6: release dst on error in xfrm6_rcv_encap() [+ + +]
Author: Yilin Zhu <[email protected]>
Date:   Sun Apr 12 13:07:54 2026 +0800

    ipv6: xfrm6: release dst on error in xfrm6_rcv_encap()
    
    commit bc0fcb9823cd0894934cf968b525c575833d7078 upstream.
    
    xfrm6_rcv_encap() performs an IPv6 route lookup when the skb does not
    already have a dst attached. ip6_route_input_lookup() returns a
    referenced dst entry even when the lookup resolves to an error route.
    
    If dst->error is set, xfrm6_rcv_encap() drops the skb without attaching
    the dst to the skb and without releasing the reference returned by the
    lookup. Repeated packets hitting this path therefore leak dst entries.
    
    Release the dst before jumping to the drop path.
    
    Fixes: 0146dca70b87 ("xfrm: add support for UDPv6 encapsulation of ESP")
    Cc: [email protected]
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Co-developed-by: Yuan Tan <[email protected]>
    Signed-off-by: Yuan Tan <[email protected]>
    Suggested-by: Xin Liu <[email protected]>
    Tested-by: Ruide Cao <[email protected]>
    Signed-off-by: Yilin Zhu <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Signed-off-by: Steffen Klassert <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
isofs: validate block number from NFS file handle in isofs_export_iget [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Sun Apr 19 17:21:55 2026 -0400

    isofs: validate block number from NFS file handle in isofs_export_iget
    
    commit 24376458138387fb251e782e624c7776e9826796 upstream.
    
    isofs_fh_to_dentry() and isofs_fh_to_parent() pass an attacker-
    controlled block number (ifid->block or ifid->parent_block) from
    the NFS file handle to isofs_export_iget(), which only rejects
    block == 0 before calling isofs_iget() and ultimately sb_bread().
    A crafted file handle with fh_len sufficient to pass the check
    added by commit 0405d4b63d08 ("isofs: Prevent the use of too small
    fid") can still drive the server to read any in-range block on the
    backing device as if it were an iso_directory_record.  That earlier
    fix was assigned CVE-2025-37780.
    
    sb_bread() on an out-of-range block returns NULL cleanly via the
    EIO path, so there is no memory-safety violation.  For in-range
    reads of adjacent-partition data on the same block device, the
    unrelated bytes end up in iso_inode_info fields that reach the NFS
    client as dentry metadata.  The deployment surface (isofs exported
    over NFS from loop-mounted images) is narrow and requires an
    authenticated NFS peer, but the malformed-file-handle class is
    reportable as hardening next to the existing CVE-2025-37780 fix.
    
    Reject block >= ISOFS_SB(sb)->s_nzones in isofs_export_iget() so
    the check covers both isofs_fh_to_dentry() and isofs_fh_to_parent()
    call sites with a single line.
    
    Fixes: 0405d4b63d08 ("isofs: Prevent the use of too small fid")
    Cc: [email protected]
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jan Kara <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

isofs: validate Rock Ridge CE continuation extent against volume size [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Sun Apr 19 17:21:54 2026 -0400

    isofs: validate Rock Ridge CE continuation extent against volume size
    
    commit a36d990f591320e9dd379ab30063ebfe91d47e1f upstream.
    
    rock_continue() reads rs->cont_extent verbatim from the Rock Ridge CE
    record and passes it to sb_bread() without checking that the block
    number is within the mounted ISO 9660 volume.  commit e595447e177b
    ("[PATCH] rock.c: handle corrupted directories") added cont_offset
    and cont_size rejection for the CE continuation but did not validate
    the extent block number itself.  commit f54e18f1b831 ("isofs: Fix
    infinite looping over CE entries") later capped the CE chain length
    at RR_MAX_CE_ENTRIES = 32 but again left the block number unchecked.
    
    With a crafted ISO mounted via udisks2 (desktop optical auto-mount)
    or via CAP_SYS_ADMIN mount, rs->cont_extent can therefore point at
    an out-of-range block or at blocks belonging to an adjacent
    filesystem on the same block device.  sb_bread() on an out-of-range
    block returns NULL cleanly via the block layer EIO path, so there
    is no memory-safety violation.  For in-range reads of adjacent-
    filesystem data, the CE buffer is parsed as Rock Ridge records and
    only the text of SL sub-records reaches userspace through
    readlink(), which makes the info-leak channel narrow and difficult
    to exploit; still, rejecting the malformed CE outright matches the
    rejection shape already present in the same function for
    cont_offset and cont_size.
    
    Add an ISOFS_SB(sb)->s_nzones bounds check to rock_continue() next
    to the existing offset/size rejection, printing the same
    corrupted-directory-entry notice.
    
    Fixes: f54e18f1b831 ("isofs: Fix infinite looping over CE entries")
    Cc: [email protected]
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jan Kara <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ksmbd: fix use-after-free in __ksmbd_close_fd() via durable scavenger [+ + +]
Author: Namjae Jeon <[email protected]>
Date:   Sat Apr 4 21:09:02 2026 +0900

    ksmbd: fix use-after-free in __ksmbd_close_fd() via durable scavenger
    
    commit 235e32320a470fcd3998fb3774f2290a0eb302a1 upstream.
    
    When a durable file handle survives session disconnect (TCP close without
    SMB2_LOGOFF), session_fd_check() sets fp->conn = NULL to preserve the
    handle for later reconnection. However, it did not clean up the byte-range
    locks on fp->lock_list.
    
    Later, when the durable scavenger thread times out and calls
    __ksmbd_close_fd(NULL, fp), the lock cleanup loop did:
    
        spin_lock(&fp->conn->llist_lock);
    
    This caused a slab use-after-free because fp->conn was NULL and the
    original connection object had already been freed by
    ksmbd_tcp_disconnect().
    
    The root cause is asymmetric cleanup: lock entries (smb_lock->clist) were
    left dangling on the freed conn->lock_list while fp->conn was nulled out.
    
    To fix this issue properly, we need to handle the lifetime of
    smb_lock->clist across three paths:
     - Safely skip clist deletion when list is empty and fp->conn is NULL.
     - Remove the lock from the old connection's lock_list in
       session_fd_check()
     - Re-add the lock to the new connection's lock_list in
       ksmbd_reopen_durable_fd().
    
    Fixes: c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
    Co-developed-by: munan Huang <[email protected]>
    Signed-off-by: munan Huang <[email protected]>
    Reviewed-by: ChenXiaoSong <[email protected]>
    Signed-off-by: Namjae Jeon <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    [ Minor context conflict resolved. ]
    Signed-off-by: Alva Lan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ksmbd: replace connection list with hash table [+ + +]
Author: Namjae Jeon <[email protected]>
Date:   Sat Apr 25 05:11:29 2026 -0400

    ksmbd: replace connection list with hash table
    
    [ Upstream commit 0bcc831be535269556f59cb70396f7e34f03a276 ]
    
    Replace connection list with hash table to improve lookup performance.
    
    Signed-off-by: Namjae Jeon <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Stable-dep-of: def036ef87f8 ("ksmbd: reset rcount per connection in ksmbd_conn_wait_idle_sess_id()")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ksmbd: require minimum ACE size in smb_check_perm_dacl() [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Fri Apr 24 09:04:01 2026 -0400

    ksmbd: require minimum ACE size in smb_check_perm_dacl()
    
    [ Upstream commit d07b26f39246a82399661936dd0c853983cfade7 ]
    
    Both ACE-walk loops in smb_check_perm_dacl() only guard against an
    under-sized remaining buffer, not against an ACE whose declared
    `ace->size` is smaller than the struct it claims to describe:
    
      if (offsetof(struct smb_ace, access_req) > aces_size)
          break;
      ace_size = le16_to_cpu(ace->size);
      if (ace_size > aces_size)
          break;
    
    The first check only requires the 4-byte ACE header to be in bounds;
    it does not require access_req (4 bytes at offset 4) to be readable.
    An attacker who has set a crafted DACL on a file they own can declare
    ace->size == 4 with aces_size == 4, pass both checks, and then
    
      granted |= le32_to_cpu(ace->access_req);               /* upper loop */
      compare_sids(&sid, &ace->sid);                         /* lower loop */
    
    reads access_req at offset 4 (OOB by up to 4 bytes) and ace->sid at
    offset 8 (OOB by up to CIFS_SID_BASE_SIZE + SID_MAX_SUB_AUTHORITIES
    * 4 bytes).
    
    Tighten both loops to require
    
      ace_size >= offsetof(struct smb_ace, sid) + CIFS_SID_BASE_SIZE
    
    which is the smallest valid on-wire ACE layout (4-byte header +
    4-byte access_req + 8-byte sid base with zero sub-auths).  Also
    reject ACEs whose sid.num_subauth exceeds SID_MAX_SUB_AUTHORITIES
    before letting compare_sids() dereference sub_auth[] entries.
    
    parse_sec_desc() already enforces an equivalent check (lines 441-448);
    smb_check_perm_dacl() simply grew weaker validation over time.
    
    Reachability: authenticated SMB client with permission to set an ACL
    on a file.  On a subsequent CREATE against that file, the kernel
    walks the stored DACL via smb_check_perm_dacl() and triggers the
    OOB read.  Not pre-auth, and the OOB read is not reflected to the
    attacker, but KASAN reports and kernel state corruption are
    possible.
    
    Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
    Cc: [email protected]
    Assisted-by: Claude:claude-opus-4-6
    Assisted-by: Codex:gpt-5-4
    Signed-off-by: Michael Bommarito <[email protected]>
    Acked-by: Namjae Jeon <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ksmbd: reset rcount per connection in ksmbd_conn_wait_idle_sess_id() [+ + +]
Author: DaeMyung Kang <[email protected]>
Date:   Sat Apr 25 05:11:30 2026 -0400

    ksmbd: reset rcount per connection in ksmbd_conn_wait_idle_sess_id()
    
    [ Upstream commit def036ef87f8641c1c525d5ae17438d7a1006491 ]
    
    rcount is intended to be connection-specific: 2 for curr_conn, 1 for
    every other connection sharing the same session.  However, it is
    initialised only once before the hash iteration and is never reset.
    After the loop visits curr_conn, later sibling connections are also
    checked against rcount == 2, so a sibling with req_running == 1 is
    incorrectly treated as idle.  This makes the outcome depend on the
    hash iteration order: whether a given sibling is checked against the
    loose (< 2) or the strict (< 1) threshold is decided by whether it
    happens to be visited before or after curr_conn.
    
    The function's contract is "wait until every connection sharing this
    session is idle" so that destroy_previous_session() can safely tear
    the session down.  The latched rcount violates that contract and
    reopens the teardown race window the wait logic was meant to close:
    destroy_previous_session() may proceed before sibling channels have
    actually quiesced, overlapping session teardown with in-flight work
    on those connections.
    
    Recompute rcount inside the loop so each connection is compared
    against its own threshold regardless of iteration order.
    
    This is a code-inspection fix for an iteration-order-dependent logic
    error; a targeted reproducer would require SMB3 multichannel with
    in-flight work on a sibling channel landing after curr_conn in hash
    order, which is not something that can be triggered reliably.
    
    Fixes: 76e98a158b20 ("ksmbd: fix race condition between destroy_previous_session() and smb2 operations()")
    Cc: [email protected]
    Signed-off-by: DaeMyung Kang <[email protected]>
    Acked-by: Namjae Jeon <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ksmbd: use msleep instaed of schedule_timeout_interruptible() [+ + +]
Author: Namjae Jeon <[email protected]>
Date:   Sat Apr 25 05:11:28 2026 -0400

    ksmbd: use msleep instaed of schedule_timeout_interruptible()
    
    [ Upstream commit f75f8bdd4ff4830abe31a1b94892eb12b85b9535 ]
    
    use msleep instaed of schedule_timeout_interruptible()
    to guarantee the task delays as expected.
    
    Signed-off-by: Namjae Jeon <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Stable-dep-of: def036ef87f8 ("ksmbd: reset rcount per connection in ksmbd_conn_wait_idle_sess_id()")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ktest: Fix the month in the name of the failure directory [+ + +]
Author: Steven Rostedt <[email protected]>
Date:   Mon Apr 20 14:24:26 2026 -0400

    ktest: Fix the month in the name of the failure directory
    
    commit 768059ede35f197575a38b10797b52402d9d4d2f upstream.
    
    The Perl localtime() function returns the month starting at 0 not 1. This
    caused the date produced to create the directory for saving files of a
    failed run to have the month off by one.
    
      machine-test-useconfig-fail-20260314073628
    
    The above happened in April, not March. The correct name should have been:
    
      machine-test-useconfig-fail-20260414073628
    
    This was somewhat confusing.
    
    Cc: [email protected]
    Cc: John 'Warthog9' Hawley <[email protected]>
    Link: https://patch.msgid.link/20260420142426.33ad0293@fedora
    Fixes: 7faafbd69639b ("ktest: Add open and close console and start stop monitor")
    Signed-off-by: Steven Rostedt <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
KVM: arm64: Fix initialisation order in __pkvm_init_finalise() [+ + +]
Author: Quentin Perret <[email protected]>
Date:   Fri Apr 24 09:49:08 2026 +0100

    KVM: arm64: Fix initialisation order in __pkvm_init_finalise()
    
    commit 5bb0aed57ba944f8c201e4e82ec066e0187e0f85 upstream.
    
    fix_host_ownership() walks the hypervisor's stage-1 page-table to
    adjust the host's stage-2 accordingly. Any such adjustment that
    requires cache maintenance operations depends on the per-CPU hyp
    fixmap being present. However, fix_host_ownership() is currently
    called before fix_hyp_pgtable_refcnt() and hyp_create_fixmap(), so
    the fixmap does not yet exist when it runs.
    
    This is benign today because the host stage-2 starts empty and no
    CMOs are needed, but it becomes a latent crash as soon as
    fix_host_ownership() is extended to operate on a non-empty
    page-table.
    
    Reorder the calls so that fix_hyp_pgtable_refcnt() and
    hyp_create_fixmap() complete before fix_host_ownership() is invoked.
    
    Fixes: 0d16d12eb26e ("KVM: arm64: Fix-up hyp stage-1 refcounts for all pages mapped at EL2")
    Signed-off-by: Quentin Perret <[email protected]>
    Signed-off-by: Fuad Tabba <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Marc Zyngier <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: arm64: vgic: Fix IIDR revision field extracted from wrong value [+ + +]
Author: David Woodhouse <[email protected]>
Date:   Tue Apr 7 21:27:02 2026 +0100

    KVM: arm64: vgic: Fix IIDR revision field extracted from wrong value
    
    commit a0e6ae45af17e8b27958830595799c702ffbab8d upstream.
    
    The uaccess write handlers for GICD_IIDR in both GICv2 and GICv3
    extract the revision field from 'reg' (the current IIDR value read back
    from the emulated distributor) instead of 'val' (the value userspace is
    trying to write). This means userspace can never actually change the
    implementation revision — the extracted value is always the current one.
    
    Fix the FIELD_GET to use 'val' so that userspace can select a different
    revision for migration compatibility.
    
    Fixes: 49a1a2c70a7f ("KVM: arm64: vgic-v3: Advertise GICR_CTLR.{IR, CES} as a new GICD_IIDR revision")
    Signed-off-by: David Woodhouse <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Marc Zyngier <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: arm64: Wake-up from WFI when iqrchip is in userspace [+ + +]
Author: Marc Zyngier <[email protected]>
Date:   Tue May 12 15:50:35 2026 +0100

    KVM: arm64: Wake-up from WFI when iqrchip is in userspace
    
    commit 4ce98bf0865c349e7026ad9c14f48da264920953 upstream
    
    It appears that there is nothing in the wake-up path that
    evaluates whether the in-kernel interrupts are pending unless
    we have a vgic.
    
    This means that the userspace irqchip support has been broken for
    about four years, and nobody noticed. It was also broken before
    as we wouldn't wake-up on a PMU interrupt, but hey, who cares...
    
    It is probably time to remove the feature altogether, because it
    was a terrible idea 10 years ago, and it still is.
    
    Fixes: b57de4ffd7c6d ("KVM: arm64: Simplify kvm_cpu_has_pending_timer()")
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Marc Zyngier <[email protected]>
    Cc: [email protected]
    Signed-off-by: Marc Zyngier <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nSVM: Add missing consistency check for EFER, CR0, CR4, and CS [+ + +]
Author: Yosry Ahmed <[email protected]>
Date:   Tue Mar 3 00:34:10 2026 +0000

    KVM: nSVM: Add missing consistency check for EFER, CR0, CR4, and CS
    
    commit 96bd3e76a171a8e21a6387e54e4c420a81968492 upstream.
    
    According to the APM Volume #2, 15.5, Canonicalization and Consistency
    Checks (24593—Rev. 3.42—March 2024), the following condition (among
    others) results in a #VMEXIT with VMEXIT_INVALID (aka SVM_EXIT_ERR):
    
      EFER.LME, CR0.PG, CR4.PAE, CS.L, and CS.D are all non-zero.
    
    In the list of consistency checks done when EFER.LME and CR0.PG are set,
    add a check that CS.L and CS.D are not both set, after the existing
    check that CR4.PAE is set.
    
    This is functionally a nop because the nested VMRUN results in
    SVM_EXIT_ERR in HW, which is forwarded to L1, but KVM makes all
    consistency checks before a VMRUN is actually attempted.
    
    Fixes: 3d6368ef580a ("KVM: SVM: Add VMRUN handler")
    Cc: [email protected]
    Signed-off-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nSVM: Add missing consistency check for nCR3 validity [+ + +]
Author: Yosry Ahmed <[email protected]>
Date:   Tue Mar 3 00:34:09 2026 +0000

    KVM: nSVM: Add missing consistency check for nCR3 validity
    
    commit b71138fcc362c67ebe66747bb22cb4e6b4d6a651 upstream.
    
    From the APM Volume #2, 15.25.4 (24593—Rev. 3.42—March 2024):
    
      When VMRUN is executed with nested paging enabled (NP_ENABLE = 1), the
      following conditions are considered illegal state combinations, in
      addition to those mentioned in “Canonicalization and Consistency Checks”:
          • Any MBZ bit of nCR3 is set.
          • Any G_PAT.PA field has an unsupported type encoding or any
            reserved field in G_PAT has a nonzero value.
    
    Add the consistency check for nCR3 being a legal GPA with no MBZ bits
    set.  Note, the G_PAT.PA check is being handled separately[*].
    
    Link: https://lore.kernel.org/kvm/[email protected] [*]
    Fixes: 4b16184c1cca ("KVM: SVM: Initialize Nested Nested MMU context on VMRUN")
    Cc: [email protected]
    Signed-off-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    [sean: capture everything in CC(), massage changelog formatting]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nSVM: Always inject a #GP if mapping VMCB12 fails on nested VMRUN [+ + +]
Author: Yosry Ahmed <[email protected]>
Date:   Tue Mar 3 00:33:59 2026 +0000

    KVM: nSVM: Always inject a #GP if mapping VMCB12 fails on nested VMRUN
    
    commit 01ddcdc55e097ca38c28ae656711b8e6d1df71f8 upstream.
    
    nested_svm_vmrun() currently only injects a #GP if kvm_vcpu_map() fails
    with -EINVAL. But it could also fail with -EFAULT if creating a host
    mapping failed. Inject a #GP in all cases, no reason to treat failure
    modes differently.
    
    Fixes: 8c5fbf1a7231 ("KVM/nSVM: Use the new mapping API for mapping guest memory")
    CC: [email protected]
    Co-developed-by: Sean Christopherson <[email protected]>
    Signed-off-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nSVM: Clear EVENTINJ fields in vmcb12 on nested #VMEXIT [+ + +]
Author: Yosry Ahmed <[email protected]>
Date:   Tue Mar 3 00:34:05 2026 +0000

    KVM: nSVM: Clear EVENTINJ fields in vmcb12 on nested #VMEXIT
    
    commit 69b721a86d0dcb026f6db7d111dcde7550442d2e upstream.
    
    According to the APM, from the reference of the VMRUN instruction:
    
      Upon #VMEXIT, the processor performs the following actions in order to
      return to the host execution context:
    
      ...
    
      clear EVENTINJ field in VMCB
    
    KVM already syncs EVENTINJ fields from vmcb02 to cached vmcb12 on every
    L2->L0  #VMEXIT. Since these fields are zeroed by the CPU on #VMEXIT, they
    will mostly be zeroed in vmcb12 on nested #VMEXIT by nested_svm_vmexit().
    
    However, this is not the case when:
    
      1. Consistency checks fail, as nested_svm_vmexit() is not called.
      2. Entering guest mode fails before L2 runs (e.g. due to failed load of
         CR3).
    
    (2) was broken by commit 2d8a42be0e2b ("KVM: nSVM: synchronize VMCB
    controls updated by the processor on every vmexit"), as prior to that
    nested_svm_vmexit() always zeroed EVENTINJ fields.
    
    Explicitly clear the fields in all nested #VMEXIT code paths.
    
    Fixes: 3d6368ef580a ("KVM: SVM: Add VMRUN handler")
    Fixes: 2d8a42be0e2b ("KVM: nSVM: synchronize VMCB controls updated by the processor on every vmexit")
    Cc: [email protected]
    Signed-off-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    [sean: massage changelog formatting]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nSVM: Clear GIF on nested #VMEXIT(INVALID) [+ + +]
Author: Yosry Ahmed <[email protected]>
Date:   Tue Mar 3 00:34:04 2026 +0000

    KVM: nSVM: Clear GIF on nested #VMEXIT(INVALID)
    
    commit f85a6ce06e4a0d49652f57967a649ab09e06287c upstream.
    
    According to the APM, GIF is set to 0 on any #VMEXIT, including
    an #VMEXIT(INVALID) due to failed consistency checks. Clear GIF on
    consistency check failures.
    
    Fixes: 3d6368ef580a ("KVM: SVM: Add VMRUN handler")
    Cc: [email protected]
    Signed-off-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nSVM: Clear tracking of L1->L2 NMI and soft IRQ on nested #VMEXIT [+ + +]
Author: Yosry Ahmed <[email protected]>
Date:   Tue Mar 3 00:34:06 2026 +0000

    KVM: nSVM: Clear tracking of L1->L2 NMI and soft IRQ on nested #VMEXIT
    
    commit 8998e1d012f3f45d0456f16706682cef04c3c436 upstream.
    
    KVM clears tracking of L1->L2 injected NMIs (i.e. nmi_l1_to_l2) and soft
    IRQs (i.e. soft_int_injected) on a synthesized #VMEXIT(INVALID) due to
    failed VMRUN. However, they are not explicitly cleared in other
    synthesized #VMEXITs.
    
    soft_int_injected is always cleared after the first VMRUN of L2 when
    completing interrupts, as any re-injection is then tracked by KVM
    (instead of purely in vmcb02).
    
    nmi_l1_to_l2 is not cleared after the first VMRUN if NMI injection
    failed, as KVM still needs to keep track that the NMI originated from L1
    to avoid blocking NMIs for L1. It is only cleared when the NMI injection
    succeeds.
    
    KVM could synthesize a #VMEXIT to L1 before successfully injecting the
    NMI into L2 (e.g. due to a #NPF on L2's NMI handler in L1's NPTs). In
    this case, nmi_l1_to_l2 will remain true, and KVM may not correctly mask
    NMIs and intercept IRET when injecting an NMI into L1.
    
    Clear both nmi_l1_to_l2 and soft_int_injected in nested_svm_vmexit(), i.e.
    for all #VMEXITs except those that occur due to failed consistency checks,
    as those happen before nmi_l1_to_l2 or soft_int_injected are set.
    
    Fixes: 159fc6fa3b7d ("KVM: nSVM: Transparently handle L1 -> L2 NMI re-injection")
    Cc: [email protected]
    Signed-off-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nSVM: Ensure AVIC is inhibited when restoring a vCPU to guest mode [+ + +]
Author: Yosry Ahmed <[email protected]>
Date:   Tue Feb 24 22:50:17 2026 +0000

    KVM: nSVM: Ensure AVIC is inhibited when restoring a vCPU to guest mode
    
    commit 24f7d36b824b65cf1a2db3db478059187b2a37b0 upstream.
    
    On nested VMRUN, KVM ensures AVIC is inhibited by requesting
    KVM_REQ_APICV_UPDATE, triggering a check of inhibit reasons, finding
    APICV_INHIBIT_REASON_NESTED, and disabling AVIC.
    
    However, when KVM_SET_NESTED_STATE is performed on a vCPU not in guest
    mode with AVIC enabled, KVM_REQ_APICV_UPDATE is not requested, and AVIC
    is not inhibited.
    
    Request KVM_REQ_APICV_UPDATE in the KVM_SET_NESTED_STATE path if AVIC is
    active, similar to the nested VMRUN path.
    
    Fixes: f44509f849fe ("KVM: x86: SVM: allow AVIC to co-exist with a nested guest running")
    Cc: [email protected]
    Signed-off-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nSVM: Mark all of vmcb02 dirty when restoring nested state [+ + +]
Author: Yosry Ahmed <[email protected]>
Date:   Tue Feb 10 01:08:06 2026 +0000

    KVM: nSVM: Mark all of vmcb02 dirty when restoring nested state
    
    commit e63fb1379f4b9300a44739964e69549bebbcdca4 upstream.
    
    When restoring a vCPU in guest mode, any state restored before
    KVM_SET_NESTED_STATE (e.g. KVM_SET_SREGS) will mark the corresponding
    dirty bits in vmcb01, as it is the active VMCB before switching to
    vmcb02 in svm_set_nested_state().
    
    Hence, mark all fields in vmcb02 dirty in svm_set_nested_state() to
    capture any previously restored fields.
    
    Fixes: cc440cdad5b7 ("KVM: nSVM: implement KVM_GET_NESTED_STATE and KVM_SET_NESTED_STATE")
    CC: [email protected]
    Signed-off-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nSVM: Sync interrupt shadow to cached vmcb12 after VMRUN of L2 [+ + +]
Author: Yosry Ahmed <[email protected]>
Date:   Wed Feb 25 00:59:44 2026 +0000

    KVM: nSVM: Sync interrupt shadow to cached vmcb12 after VMRUN of L2
    
    commit 03bee264f8ebfd39e0254c98e112d033a7aa9055 upstream.
    
    After VMRUN in guest mode, nested_sync_control_from_vmcb02() syncs
    fields written by the CPU from vmcb02 to the cached vmcb12. This is
    because the cached vmcb12 is used as the authoritative copy of some of
    the controls, and is the payload when saving/restoring nested state.
    
    int_state is also written by the CPU, specifically bit 0 (i.e.
    SVM_INTERRUPT_SHADOW_MASK) for nested VMs, but it is not sync'd to
    cached vmcb12. This does not cause a problem if KVM_SET_NESTED_STATE
    preceeds KVM_SET_VCPU_EVENTS in the restore path, as an interrupt shadow
    would be correctly restored to vmcb02 (KVM_SET_VCPU_EVENTS overwrites
    what KVM_SET_NESTED_STATE restored in int_state).
    
    However, if KVM_SET_VCPU_EVENTS preceeds KVM_SET_NESTED_STATE, an
    interrupt shadow would be restored into vmcb01 instead of vmcb02. This
    would mostly be benign for L1 (delays an interrupt), but not for L2. For
    L2, the vCPU could hang (e.g. if a wakeup interrupt is delivered before
    a HLT that should have been in an interrupt shadow).
    
    Sync int_state to the cached vmcb12 in nested_sync_control_from_vmcb02()
    to avoid this problem. With that, KVM_SET_NESTED_STATE restores the
    correct interrupt shadow state, and if KVM_SET_VCPU_EVENTS follows it
    would overwrite it with the same value.
    
    Fixes: cc440cdad5b7 ("KVM: nSVM: implement KVM_GET_NESTED_STATE and KVM_SET_NESTED_STATE")
    CC: [email protected]
    Signed-off-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nSVM: Sync NextRIP to cached vmcb12 after VMRUN of L2 [+ + +]
Author: Yosry Ahmed <[email protected]>
Date:   Wed Feb 25 00:59:43 2026 +0000

    KVM: nSVM: Sync NextRIP to cached vmcb12 after VMRUN of L2
    
    commit 778d8c1b2a6ffe622ddcd3bb35b620e6e41f4da0 upstream.
    
    After VMRUN in guest mode, nested_sync_control_from_vmcb02() syncs
    fields written by the CPU from vmcb02 to the cached vmcb12. This is
    because the cached vmcb12 is used as the authoritative copy of some of
    the controls, and is the payload when saving/restoring nested state.
    
    NextRIP is also written by the CPU (in some cases) after VMRUN, but is
    not sync'd to the cached vmcb12. As a result, it is corrupted after
    save/restore (replaced by the original value written by L1 on nested
    VMRUN). This could cause problems for both KVM (e.g. when injecting a
    soft IRQ) or L1 (e.g. when using NextRIP to advance RIP after emulating
    an instruction).
    
    Fix this by sync'ing NextRIP to the cache after VMRUN of L2, but only
    after completing interrupts (not in nested_sync_control_from_vmcb02()),
    as KVM may update NextRIP (e.g. when re-injecting a soft IRQ).
    
    Fixes: cc440cdad5b7 ("KVM: nSVM: implement KVM_GET_NESTED_STATE and KVM_SET_NESTED_STATE")
    CC: [email protected]
    Co-developed-by: Sean Christopherson <[email protected]>
    Signed-off-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: nSVM: Use vcpu->arch.cr2 when updating vmcb12 on nested #VMEXIT [+ + +]
Author: Yosry Ahmed <[email protected]>
Date:   Tue Feb 3 20:10:10 2026 +0000

    KVM: nSVM: Use vcpu->arch.cr2 when updating vmcb12 on nested #VMEXIT
    
    commit 5c247d08bc81bbad4c662dcf5654137a2f8483ec upstream.
    
    KVM currently uses the value of CR2 from vmcb02 to update vmcb12 on
    nested #VMEXIT. This value is incorrect in some cases, causing L1 to run
    L2 with a corrupted CR2. This could lead to segfaults or data corruption
    if L2 is in the middle of handling a #PF and reads a corrupted CR2. Use
    the correct value in vcpu->arch.cr2 instead.
    
    The value in vcpu->arch.cr2 is sync'd to vmcb02 shortly before a VMRUN
    of L2, and sync'd back to vcpu->arch.cr2 shortly after. The value are
    only out-of-sync in two cases: after save+restore, and after a #PF is
    injected into L2. In either case, if a #VMEXIT to L1 is synthesized
    before L2 runs, using the value in vmcb02 would be incorrect.
    
    After save+restore, the value of CR2 is restored by KVM_SET_SREGS into
    vcpu->arch.cr2. It is not reflect in vmcb02 until a VMRUN of L2. Before
    that, it holds whatever was in vmcb02 before restore, which would be
    zero on a new vCPU that never ran nested. If a #VMEXIT to L1 is
    synthesized before L2 ever runs, using vcpu->arch.cr2 to update vmcb12
    is the right thing to do.
    
    The #PF injection case is more nuanced.  Although the APM is a bit
    unclear about when CR2 is written during a #PF, the SDM is more clear:
    
            Processors update CR2 whenever a page fault is detected. If a
            second page fault occurs while an earlier page fault is being
            delivered, the faulting linear address of the second fault will
            overwrite the contents of CR2 (replacing the previous address).
            These updates to CR2 occur even if the page fault results in a
            double fault or occurs during the delivery of a double fault.
    
    KVM injecting the exception surely counts as the #PF being "detected".
    More importantly, when an exception is injected into L2 at the time of a
    synthesized #VMEXIT, KVM updates exit_int_info in vmcb12 accordingly,
    such that an L1 hypervisor can re-inject the exception. If CR2 is not
    written at that point, the L1 hypervisor have no way of correctly
    re-injecting the #PF. Hence, if a #VMEXIT to L1 is synthesized after
    the #PF is injected into L2 but before it actually runs, using
    vcpu->arch.cr2 to update vmcb12 is also the right thing to do.
    
    Note that KVM does _not_ update vcpu->arch.cr2 when a #PF is pending for
    L2, only when it is injected. The distinction is important, because only
    injected (but not intercepted) exceptions are propagated to L1 through
    exit_int_info. It would be incorrect to update CR2 in vmcb12 for a
    pending #PF, as L1 would perceive an updated CR2 value with no #PF.
    
    Cc: [email protected]
    Signed-off-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: SVM: check validity of VMCB controls when returning from SMM [+ + +]
Author: Paolo Bonzini <[email protected]>
Date:   Mon Mar 9 12:40:52 2026 +0100

    KVM: SVM: check validity of VMCB controls when returning from SMM
    
    commit be5fa8737d42c5ba16d2ea72c23681f8abbb07e8 upstream.
    
    The VMCB12 is stored in guest memory and can be mangled while in SMM; it
    is then reloaded by svm_leave_smm(), but it is not checked again for
    validity.
    
    Move the cached vmcb12 control and save consistency checks out of
    svm_set_nested_state() and into a helper, and reuse it in
    svm_leave_smm().
    
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: SVM: Explicitly mark vmcb01 dirty after modifying VMCB intercepts [+ + +]
Author: Sean Christopherson <[email protected]>
Date:   Wed Feb 18 15:09:51 2026 -0800

    KVM: SVM: Explicitly mark vmcb01 dirty after modifying VMCB intercepts
    
    commit d5bde6113aed8315a2bfe708730b721be9c2f48b upstream.
    
    When reacting to an intercept update, explicitly mark vmcb01's intercepts
    dirty, as KVM always initially operates on vmcb01, and nested_svm_vmexit()
    isn't guaranteed to mark VMCB_INTERCEPTS as dirty.  I.e. if L2 is active,
    KVM will modify the intercepts for L1, but might not mark them as dirty
    before the next VMRUN of L1.
    
    Fixes: 116a0a23676e ("KVM: SVM: Add clean-bit for intercetps, tsc-offset and pause filter count")
    Cc: [email protected]
    Reviewed-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: SVM: Inject #UD for INVLPGA if EFER.SVME=0 [+ + +]
Author: Kevin Cheng <[email protected]>
Date:   Sat Feb 28 03:33:26 2026 +0000

    KVM: SVM: Inject #UD for INVLPGA if EFER.SVME=0
    
    commit d99df02ff427f461102230f9c5b90a6c64ee8e23 upstream.
    
    INVLPGA should cause a #UD when EFER.SVME is not set. Add a check to
    properly inject #UD when EFER.SVME=0.
    
    Fixes: ff092385e828 ("KVM: SVM: Implement INVLPGA")
    Cc: [email protected]
    Signed-off-by: Kevin Cheng <[email protected]>
    Reviewed-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    [sean: tag for stable@]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: x86: check for nEPT/nNPT in slow flush hypercalls [+ + +]
Author: Paolo Bonzini <[email protected]>
Date:   Mon Apr 27 14:25:40 2026 +0200

    KVM: x86: check for nEPT/nNPT in slow flush hypercalls
    
    commit 464af6fc2b1dcc74005b7f58ee3812b17777efee upstream.
    
    Checking is_guest_mode(vcpu) is incorrect, because translate_nested_gpa()
    is only valid if an L2 guest is running *with nested EPT/NPT enabled*.
    Instead use the same condition as translate_nested_gpa() itself.
    
    Cc: [email protected]
    Reviewed-by: Sean Christopherson <[email protected]>
    Fixes: aee738236dca ("KVM: x86: Prepare kvm_hv_flush_tlb() to handle L2's GPAs", 2022-11-18)
    Link: https://patch.msgid.link/[email protected]/
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: x86: Defer non-architectural deliver of exception payload to userspace read [+ + +]
Author: Sean Christopherson <[email protected]>
Date:   Tue Feb 17 16:54:38 2026 -0800

    KVM: x86: Defer non-architectural deliver of exception payload to userspace read
    
    commit d0ad1b05bbe6f8da159a4dfb6692b3b7ce30ccc8 upstream.
    
    When attempting to play nice with userspace that hasn't enabled
    KVM_CAP_EXCEPTION_PAYLOAD, defer KVM's non-architectural delivery of the
    payload until userspace actually reads relevant vCPU state, and more
    importantly, force delivery of the payload in *all* paths where userspace
    saves relevant vCPU state, not just KVM_GET_VCPU_EVENTS.
    
    Ignoring userspace save/restore for the moment, delivering the payload
    before the exception is injected is wrong regardless of whether L1 or L2
    is running.  To make matters even more confusing, the flaw *currently*
    being papered over by the !is_guest_mode() check isn't even the same bug
    that commit da998b46d244 ("kvm: x86: Defer setting of CR2 until #PF
    delivery") was trying to avoid.
    
    At the time of commit da998b46d244, KVM didn't correctly handle exception
    intercepts, as KVM would wait until VM-Entry into L2 was imminent to check
    if the queued exception should morph to a nested VM-Exit.  I.e. KVM would
    deliver the payload to L2 and then synthesize a VM-Exit into L1.  But the
    payload was only the most blatant issue, e.g. waiting to check exception
    intercepts would also lead to KVM incorrectly escalating a
    should-be-intercepted #PF into a #DF.
    
    That underlying bug was eventually fixed by commit 7709aba8f716 ("KVM: x86:
    Morph pending exceptions to pending VM-Exits at queue time"), but in the
    interim, commit a06230b62b89 ("KVM: x86: Deliver exception payload on
    KVM_GET_VCPU_EVENTS") came along and subtly added another dependency on
    the !is_guest_mode() check.
    
    While not recorded in the changelog, the motivation for deferring the
    !exception_payload_enabled delivery was to fix a flaw where a synthesized
    MTF (Monitor Trap Flag) VM-Exit would drop a pending #DB and clobber DR6.
    On a VM-Exit, VMX CPUs save pending #DB information into the VMCS, which
    is emulated by KVM in nested_vmx_update_pending_dbg() by grabbing the
    payload from the queue/pending exception.  I.e. prematurely delivering the
    payload would cause the pending #DB to not be recorded in the VMCS, and of
    course, clobber L2's DR6 as seen by L1.
    
    Jumping back to save+restore, the quirked behavior of forcing delivery of
    the payload only works if userspace does KVM_GET_VCPU_EVENTS *before*
    CR2 or DR6 is saved, i.e. before KVM_GET_SREGS{,2} and KVM_GET_DEBUGREGS.
    E.g. if userspace does KVM_GET_SREGS before KVM_GET_VCPU_EVENTS, then the
    CR2 saved by userspace won't contain the payload for the exception save by
    KVM_GET_VCPU_EVENTS.
    
    Deliberately deliver the payload in the store_regs() path, as it's the
    least awful option even though userspace may not be doing save+restore.
    Because if userspace _is_ doing save restore, it could elide KVM_GET_SREGS
    knowing that SREGS were already saved when the vCPU exited.
    
    Link: https://lore.kernel.org/all/[email protected]
    Cc: Yosry Ahmed <[email protected]>
    Cc: [email protected]
    Reviewed-by: Yosry Ahmed <[email protected]>
    Tested-by: Yosry Ahmed <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

KVM: x86: Fix shadow paging use-after-free due to unexpected GFN [+ + +]
Author: Sean Christopherson <[email protected]>
Date:   Tue May 5 09:00:57 2026 +0200

    KVM: x86: Fix shadow paging use-after-free due to unexpected GFN
    
    commit 0cb2af2ea66ad8ff195c156ea690f11216285bdf upstream.
    
    The shadow MMU computes GFNs for direct shadow pages using sp->gfn plus
    the SPTE index. This assumption breaks for shadow paging if the guest
    page tables are modified between VM entries (similar to commit
    aad885e77496, "KVM: x86/mmu: Drop/zap existing present SPTE even
    when creating an MMIO SPTE", 2026-03-27).  The flow is as follows:
    
    - a PDE is installed for a 2MB mapping, and a page in that area is
      accessed.  KVM creates a kvm_mmu_page consisting of 512 4KB pages;
      the kvm_mmu_page is marked by FNAME(fetch) as direct-mapped because
      the guest's mapping is a huge page (and thus contiguous).
    
    - the PDE mapping is changed from outside the guest.
    
    - the guest accesses another page in the same 2MB area.  KVM installs
      a new leaf SPTE and rmap entry; the SPTE uses the "correct" GFN
      (i.e. based on the new mapping, as changed in the previous step) but
      that GFN is outside of the [sp->gfn, sp->gfn + 511] range; therefore
      the rmap entry cannot be found and removed when the kvm_mmu_page
      is zapped.
    
    - the memslot that covers the first 2MB mapping is deleted, and the
      kvm_mmu_page for the now-invalid GPA is zapped.  However, rmap_remove()
      only looks at the [sp->gfn, sp->gfn + 511] range established in step 1,
      and fails to find the rmap entry that was recorded by step 3.
    
    - any operation that causes an rmap walk for the same page accessed
      by step 3 then walks a stale rmap and dereferences a freed kvm_mmu_page.
      This includes dirty logging or MMU notifier invalidations (e.g., from
      MADV_DONTNEED).
    
    The underlying issue is that KVM's walking of shadow PTEs assumes that
    if a SPTE is present when KVM wants to install a non-leaf SPTE, then the
    existing kvm_mmu_page must be for the correct gfn.  Because the only way
    for the gfn to be wrong is if KVM messed up and failed to zap a SPTE...
    which shouldn't happen, but *actually* only happens in response to a
    guest write.
    
    That bug dates back literally forever, as even the first version of KVM
    assumes that the GFN matches and walks into the "wrong" shadow page.
    However, that was only an imprecision until 2032a93d66fa ("KVM: MMU:
    Don't allocate gfns page for direct mmu pages") came along.
    
    Fix it by checking for a target gfn mismatch and zapping the existing
    SPTE.  That way the old SP and rmap entries are gone, KVM installs
    the rmap in the right location, and everyone is happy.
    
    Fixes: 2032a93d66fa ("KVM: MMU: Don't allocate gfns page for direct mmu pages")
    Fixes: 6aa8b732ca01 ("kvm: userspace interface")
    Reported-by: Alexander Bulekov <[email protected]>
    Reported-by: Fred Griffoul <[email protected]>
    Cc: [email protected]
    Signed-off-by: Sean Christopherson <[email protected]>
    Link: https://patch.msgid.link/[email protected]/
    Signed-off-by: Paolo Bonzini <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
leds: qcom-lpg: Check for array overflow when selecting the high resolution [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Thu Feb 19 15:34:35 2026 +0100

    leds: qcom-lpg: Check for array overflow when selecting the high resolution
    
    commit d45963a93c1495e9f1338fde91d0ebba8fd22474 upstream.
    
    When selecting the high resolution values from the array, FIELD_GET() is
    used to pull from a 3 bit register, yet the array being indexed has only
    5 values in it.  Odds are the hardware is sane, but just to be safe,
    properly check before just overflowing and reading random data and then
    setting up chip values based on that.
    
    Cc: stable <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Link: https://patch.msgid.link/2026021934-nearby-playroom-036b@gregkh
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
lib/crypto: mpi: Fix integer underflow in mpi_read_raw_from_sgl() [+ + +]
Author: Lukas Wunner <[email protected]>
Date:   Sun Apr 12 16:19:47 2026 +0200

    lib/crypto: mpi: Fix integer underflow in mpi_read_raw_from_sgl()
    
    commit 8c2f1288250a90a4b5cabed5d888d7e3aeed4035 upstream.
    
    Yiming reports an integer underflow in mpi_read_raw_from_sgl() when
    subtracting "lzeros" from the unsigned "nbytes".
    
    For this to happen, the scatterlist "sgl" needs to occupy more bytes
    than the "nbytes" parameter and the first "nbytes + 1" bytes of the
    scatterlist must be zero.  Under these conditions, the while loop
    iterating over the scatterlist will count more zeroes than "nbytes",
    subtract the number of zeroes from "nbytes" and cause the underflow.
    
    When commit 2d4d1eea540b ("lib/mpi: Add mpi sgl helpers") originally
    introduced the bug, it couldn't be triggered because all callers of
    mpi_read_raw_from_sgl() passed a scatterlist whose length was equal to
    "nbytes".
    
    However since commit 63ba4d67594a ("KEYS: asymmetric: Use new crypto
    interface without scatterlists"), the underflow can now actually be
    triggered.  When invoking a KEYCTL_PKEY_ENCRYPT system call with a
    larger "out_len" than "in_len" and filling the "in" buffer with zeroes,
    crypto_akcipher_sync_prep() will create an all-zero scatterlist used for
    both the "src" and "dst" member of struct akcipher_request and thereby
    fulfil the conditions to trigger the bug:
    
      sys_keyctl()
        keyctl_pkey_e_d_s()
          asymmetric_key_eds_op()
            software_key_eds_op()
              crypto_akcipher_sync_encrypt()
                crypto_akcipher_sync_prep()
                  crypto_akcipher_encrypt()
                    rsa_enc()
                      mpi_read_raw_from_sgl()
    
    To the user this will be visible as a DoS as the kernel spins forever,
    causing soft lockup splats as a side effect.
    
    Fix it.
    
    Reported-by: Yiming Qian <[email protected]> # off-list
    Fixes: 2d4d1eea540b ("lib/mpi: Add mpi sgl helpers")
    Signed-off-by: Lukas Wunner <[email protected]>
    Cc: [email protected] # v4.4+
    Reviewed-by: Ignat Korchagin <[email protected]>
    Reviewed-by: Jarkko Sakkinen <[email protected]>
    Link: https://lore.kernel.org/r/59eca92ff4f87e2081777f1423a0efaaadcfdb39.1776003111.git.lukas@wunner.de
    Signed-off-by: Eric Biggers <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
lib/scatterlist: fix length calculations in extract_kvec_to_sg [+ + +]
Author: Christian A. Ehrhardt <[email protected]>
Date:   Thu Mar 26 22:49:01 2026 +0100

    lib/scatterlist: fix length calculations in extract_kvec_to_sg
    
    commit 07b7d66e65d9cfe6b9c2c34aa22cfcaac37a5c45 upstream.
    
    Patch series "Fix bugs in extract_iter_to_sg()", v3.
    
    Fix bugs in the kvec and user variants of extract_iter_to_sg.  This series
    is growing due to useful remarks made by sashiko.dev.
    
    The main bugs are:
    - The length for an sglist entry when extracting from
      a kvec can exceed the number of bytes in the page. This
      is obviously not intended.
    - When extracting a user buffer the sglist is temporarily
      used as a scratch buffer for extracted page pointers.
      If the sglist already contains some elements this scratch
      buffer could overlap with existing entries in the sglist.
    
    The series adds test cases to the kunit_iov_iter test that demonstrate all
    of these bugs.  Additionally, there is a memory leak fix for the test
    itself.
    
    The bugs were orignally introduced into kernel v6.3 where the function
    lived in fs/netfs/iterator.c.  It was later moved to lib/scatterlist.c in
    v6.5.  Thus the actual fix is only marked for backports to v6.5+.
    
    
    This patch (of 5):
    
    When extracting from a kvec to a scatterlist, do not cross page
    boundaries.  The required length was already calculated but not used as
    intended.
    
    Adjust the copied length if the loop runs out of sglist entries without
    extracting everything.
    
    While there, return immediately from extract_iter_to_sg if there are no
    sglist entries at all.
    
    A subsequent commit will add kunit test cases that demonstrate that the
    patch is necessary.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 018584697533 ("netfs: Add a function to extract an iterator into a scatterlist")
    Signed-off-by: Christian A. Ehrhardt <[email protected]>
    Cc: David Gow <[email protected]>
    Cc: David Howells <[email protected]>
    Cc: Kees Cook <[email protected]>
    Cc: Petr Mladek <[email protected]>
    Cc: <[email protected]>    [v6.5+]
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

lib/scatterlist: fix temp buffer in extract_user_to_sg() [+ + +]
Author: Christian A. Ehrhardt <[email protected]>
Date:   Thu Mar 26 22:49:02 2026 +0100

    lib/scatterlist: fix temp buffer in extract_user_to_sg()
    
    commit 118cf3f55975352ac357fb194405031458186819 upstream.
    
    Instead of allocating a temporary buffer for extracted user pages
    extract_user_to_sg() uses the end of the to be filled scatterlist as a
    temporary buffer.
    
    Fix the calculation of the start address if the scatterlist already
    contains elements.  The unused space starts at sgtable->sgl +
    sgtable->nents not directly at sgtable->nents and the temporary buffer is
    placed at the end of this unused space.
    
    A subsequent commit will add kunit test cases that demonstrate that the
    patch is necessary.
    
    Pointed out by sashiko.dev on a previous iteration of this series.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 018584697533 ("netfs: Add a function to extract an iterator into a scatterlist")
    Signed-off-by: Christian A. Ehrhardt <[email protected]>
    Cc: David Howells <[email protected]>
    Cc: David Gow <[email protected]>
    Cc: Kees Cook <[email protected]>
    Cc: Petr Mladek <[email protected]>
    Cc: <[email protected]>    [v6.5+]
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
lib/ts_kmp: fix integer overflow in pattern length calculation [+ + +]
Author: Josh Law <[email protected]>
Date:   Sun Mar 8 20:20:28 2026 +0000

    lib/ts_kmp: fix integer overflow in pattern length calculation
    
    commit 8cdf30813ea8ce881cecc08664144416dbdb3e16 upstream.
    
    The ts_kmp algorithm stores its prefix_tbl[] table and pattern in a single
    allocation sized from the pattern length.  If the prefix_tbl[] size
    calculation wraps, the resulting allocation can be too small and
    subsequent pattern copies can overflow it.
    
    Fix this by rejecting zero-length patterns and by using overflow helpers
    before calculating the combined allocation size.
    
    
    This fixes a potential heap overflow.  The pattern length calculation can
    wrap during a size_t addition, leading to an undersized allocation.
    Because the textsearch library is reachable from userspace via Netfilter's
    xt_string module, this is a security risk that should be backported to LTS
    kernels.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Josh Law <[email protected]>
    Reviewed-by: Andrew Morton <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
lib: test_hmm: evict device pages on file close to avoid use-after-free [+ + +]
Author: Alistair Popple <[email protected]>
Date:   Tue Apr 28 14:19:44 2026 -0400

    lib: test_hmm: evict device pages on file close to avoid use-after-free
    
    [ Upstream commit 744dd97752ef1076a8d8672bb0d8aa2c7abc1144 ]
    
    Patch series "Minor hmm_test fixes and cleanups".
    
    Two bugfixes a cleanup for the HMM kernel selftests.  These were mostly
    reported by Zenghui Yu with special thanks to Lorenzo for analysing and
    pointing out the problems.
    
    This patch (of 3):
    
    When dmirror_fops_release() is called it frees the dmirror struct but
    doesn't migrate device private pages back to system memory first.  This
    leaves those pages with a dangling zone_device_data pointer to the freed
    dmirror.
    
    If a subsequent fault occurs on those pages (eg.  during coredump) the
    dmirror_devmem_fault() callback dereferences the stale pointer causing a
    kernel panic.  This was reported [1] when running mm/ksft_hmm.sh on arm64,
    where a test failure triggered SIGABRT and the resulting coredump walked
    the VMAs faulting in the stale device private pages.
    
    Fix this by calling dmirror_device_evict_chunk() for each devmem chunk in
    dmirror_fops_release() to migrate all device private pages back to system
    memory before freeing the dmirror struct.  The function is moved earlier
    in the file to avoid a forward declaration.
    
    Link: https://lore.kernel.org/[email protected]
    Link: https://lore.kernel.org/[email protected]
    Fixes: b2ef9f5a5cb3 ("mm/hmm/test: add selftest driver for HMM")
    Signed-off-by: Alistair Popple <[email protected]>
    Reported-by: Zenghui Yu <[email protected]>
    Closes: https://lore.kernel.org/linux-mm/[email protected]/
    Reviewed-by: Balbir Singh <[email protected]>
    Tested-by: Zenghui Yu <[email protected]>
    Cc: David Hildenbrand <[email protected]>
    Cc: Jason Gunthorpe <[email protected]>
    Cc: Leon Romanovsky <[email protected]>
    Cc: Liam Howlett <[email protected]>
    Cc: Lorenzo Stoakes (Oracle) <[email protected]>
    Cc: Michal Hocko <[email protected]>
    Cc: Mike Rapoport <[email protected]>
    Cc: Suren Baghdasaryan <[email protected]>
    Cc: Zenghui Yu <[email protected]>
    Cc: Matthew Brost <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    [ kept the existing simpler `dmirror_device_evict_chunk()` body instead of the upstream compound-folio version ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
libceph: Fix slab-out-of-bounds access in auth message processing [+ + +]
Author: Raphael Zimmer <[email protected]>
Date:   Tue Apr 21 10:27:01 2026 +0200

    libceph: Fix slab-out-of-bounds access in auth message processing
    
    commit 1c439de70b1c3eb3c6bffa8245c16b9fc318f114 upstream.
    
    If a (potentially corrupted) message of type CEPH_MSG_AUTH_REPLY
    contains a positive value in its result field, it is treated as an
    error code by ceph_handle_auth_reply() and returned to
    handle_auth_reply(). Thereafter, an attempt is made to send the
    preallocated message of type CEPH_MSG_AUTH, where the returned value is
    interpreted as the size of the front segment to send. If the result
    value in the message is greater than the size of the memory buffer
    allocated for the front segment, an out-of-bounds access occurs, and
    the content of the memory region beyond this buffer is sent out.
    
    This patch fixes the issue by treating only negative values in the
    result field as errors. Positive values are therefore treated as success
    in the same way as a zero value. Additionally, a BUG_ON is added to
    __send_prepared_auth_request() comparing the len parameter to
    front_alloc_len to prevent sending the message if it exceeds the bounds
    of the allocation and to make it easier to catch any logic flaws leading
    to this.
    
    Cc: [email protected]
    Signed-off-by: Raphael Zimmer <[email protected]>
    Reviewed-by: Ilya Dryomov <[email protected]>
    Signed-off-by: Ilya Dryomov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

libceph: Prevent potential null-ptr-deref in ceph_handle_auth_reply() [+ + +]
Author: Raphael Zimmer <[email protected]>
Date:   Wed Mar 18 18:09:03 2026 +0100

    libceph: Prevent potential null-ptr-deref in ceph_handle_auth_reply()
    
    commit 5199c125d25aeae8615c4fc31652cc0fe624338e upstream.
    
    If a message of type CEPH_MSG_AUTH_REPLY contains a zero value for both
    protocol and result, this is currently not treated as an error. In case
    of ac->negotiating == true and ac->protocol > 0, this leads to setting
    ac->protocol = 0 and ac->ops = NULL. Thereafter, the check for
    ac->protocol != protocol returns false, and init_protocol() is not
    called. Subsequently, ac->ops->handle_reply() is called, which leads to
    a null pointer dereference, because ac->ops is still NULL.
    
    This patch changes the check for ac->protocol != protocol to
    !ac->protocol, as this also includes the case when the protocol was set
    to zero in the message. This causes the message to be treated as
    containing a bad auth protocol.
    
    Cc: [email protected]
    Signed-off-by: Raphael Zimmer <[email protected]>
    Reviewed-by: Ilya Dryomov <[email protected]>
    Signed-off-by: Ilya Dryomov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Linux: Linux 6.6.140 [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Sun May 17 17:13:54 2026 +0200

    Linux 6.6.140
    
    Link: https://lore.kernel.org/r/[email protected]
    Tested-by: Wentao Guan <[email protected]>
    Tested-by: Florian Fainelli <[email protected]>
    Tested-by: Shuah Khan <[email protected]>
    Tested-by: Peter Schneider <[email protected]>
    Tested-by: Miguel Ojeda <[email protected]>
    Tested-by: Mark Brown <[email protected]>
    Tested-by: Pavel Machek (CIP) <[email protected]>
    Tested-by: Brett A C Sheffield <[email protected]>
    Tested-by: Ron Economos <[email protected]>
    Tested-by: Barry K. Nathan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
LoongArch: Add spectre boundry for syscall dispatch table [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Tue Apr 28 05:02:27 2026 -0400

    LoongArch: Add spectre boundry for syscall dispatch table
    
    [ Upstream commit 0c965d2784fbbd7f8e3b96d875c9cfdf7c00da3d ]
    
    The LoongArch syscall number is directly controlled by userspace, but
    does not have a array_index_nospec() boundry to prevent access past the
    syscall function pointer tables.
    
    Cc: [email protected]
    Assisted-by: gkh_clanker_2000
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Huacai Chen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

LoongArch: Fix potential ADE in loongson_gpu_fixup_dma_hang() [+ + +]
Author: Wentao Guan <[email protected]>
Date:   Mon May 4 09:00:20 2026 +0800

    LoongArch: Fix potential ADE in loongson_gpu_fixup_dma_hang()
    
    commit 8dfa2f8780e486d05b9a0ffce70b8f5fbd62053e upstream.
    
    The switch case in loongson_gpu_fixup_dma_hang() may not DC2 or DC3, and
    readl(crtc_reg) will access with random address, because the "device" is
    from "base+PCI_DEVICE_ID", "base" is from "pdev->devfn+1". This is wrong
    when my platform inserts a discrete GPU:
    
    lspci -tv
    -[0000:00]-+-00.0  Loongson Technology LLC Hyper Transport Bridge Controller
    ...
               +-06.0  Loongson Technology LLC LG100 GPU
               +-06.2  Loongson Technology LLC Device 7a37
    ...
    
    Add a default switch case to fix the panic as below:
    
     Kernel ade access[#1]:
     CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.6.136-loong64-desktop-hwe+ #4
     pc 90000000017e5534 ra 90000000017e54c0 tp 90000001002f8000 sp 90000001002fb6c0
     a0 80000efe00003100 a1 0000000000003100 a2 0000000000000000 a3 0000000000000002
     a4 90000001002fb6b4 a5 900000087cdb58fd a6 90000000027af000 a7 0000000000000001
     t0 00000000000085b9 t1 000000000000ffff t2 0000000000000000 t3 0000000000000000
     t4 fffffffffffffffd t5 00000000fffb6d9c t6 0000000000083b00 t7 00000000000070c0
     t8 900000087cdb4d94 u0 900000087cdb58fd s9 90000001002fb826 s0 90000000031c12c8
     s1 7fffffffffffff00 s2 90000000031c12d0 s3 0000000000002710 s4 0000000000000000
     s5 0000000000000000 s6 9000000100053000 s7 7fffffffffffff00 s8 90000000030d4000
        ra: 90000000017e54c0 loongson_gpu_fixup_dma_hang+0x40/0x210
       ERA: 90000000017e5534 loongson_gpu_fixup_dma_hang+0xb4/0x210
      CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
      PRMD: 00000004 (PPLV0 +PIE -PWE)
      EUEN: 00000000 (-FPE -SXE -ASXE -BTE)
      ECFG: 00071c1d (LIE=0,2-4,10-12 VS=7)
     ESTAT: 00480000 [ADEM] (IS= ECode=8 EsubCode=1)
      BADV: 7fffffffffffff00
      PRID: 0014d000 (Loongson-64bit, Loongson-3A6000-HV)
     Modules linked in:
     Process swapper/0 (pid: 1, threadinfo=(____ptrval____), task=(____ptrval____))
     Stack : 0000000000000006 90000001002fb778 90000001002fb704 0000000000000007
             0000000016a65700 90000000017e5690 000000000000ffff ffffffffffffffff
             900000000209f7c0 9000000100053000 900000000209f7a8 9000000000eebc08
             0000000000000000 0000000000000000 0000000000000006 90000001002fb778
             90000001000530b8 90000000027af000 0000000000000000 9000000100054000
             9000000100053000 9000000000ebb70c 9000000100004c00 9000000004000001
             90000001002fb7e4 bae765461f31cb12 0000000000000000 0000000000000000
             0000000000000006 90000000027af000 0000000000000030 90000000027af000
             900000087cd6f800 9000000100053000 0000000000000000 9000000000ebc560
             7a2500147cdaf720 bae765461f31cb12 0000000000000001 0000000000000030
             ...
     Call Trace:
     [<90000000017e5534>] loongson_gpu_fixup_dma_hang+0xb4/0x210
     [<9000000000eebc08>] pci_fixup_device+0x108/0x280
     [<9000000000ebb70c>] pci_setup_device+0x24c/0x690
     [<9000000000ebc560>] pci_scan_single_device+0xe0/0x140
     [<9000000000ebc684>] pci_scan_slot+0xc4/0x280
     [<9000000000ebdd00>] pci_scan_child_bus_extend+0x60/0x3f0
     [<9000000000f5bc94>] acpi_pci_root_create+0x2b4/0x420
     [<90000000017e5e74>] pci_acpi_scan_root+0x2d4/0x440
     [<9000000000f5b02c>] acpi_pci_root_add+0x21c/0x3a0
     [<9000000000f4ee54>] acpi_bus_attach+0x1a4/0x3c0
     [<90000000010e200c>] device_for_each_child+0x6c/0xe0
     [<9000000000f4bbf4>] acpi_dev_for_each_child+0x44/0x70
     [<9000000000f4ef40>] acpi_bus_attach+0x290/0x3c0
     [<90000000010e200c>] device_for_each_child+0x6c/0xe0
     [<9000000000f4bbf4>] acpi_dev_for_each_child+0x44/0x70
     [<9000000000f4ef40>] acpi_bus_attach+0x290/0x3c0
     [<9000000000f5211c>] acpi_bus_scan+0x6c/0x280
     [<900000000189c028>] acpi_scan_init+0x194/0x310
     [<900000000189bc6c>] acpi_init+0xcc/0x140
     [<9000000000220cdc>] do_one_initcall+0x4c/0x310
     [<90000000018618fc>] kernel_init_freeable+0x258/0x2d4
     [<900000000184326c>] kernel_init+0x28/0x13c
     [<9000000000222008>] ret_from_kernel_thread+0xc/0xa4
    
    Cc: [email protected]
    Fixes: 95db0c9f526d ("LoongArch: Workaround LS2K/LS7A GPU DMA hang bug")
    Link: https://gist.github.com/opsiff/ebf2dac51b4013d22462f2124c55f807
    Link: https://gist.github.com/opsiff/a62f2a73db0492b3c49bf223a339b133
    Signed-off-by: Wentao Guan <[email protected]>
    Signed-off-by: Huacai Chen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

LoongArch: Show CPU vulnerabilites correctly [+ + +]
Author: Huacai Chen <[email protected]>
Date:   Wed Apr 22 15:45:12 2026 +0800

    LoongArch: Show CPU vulnerabilites correctly
    
    commit 37e57e8ad96cdec4a57b55fd10bef50f7370a954 upstream.
    
    Most LoongArch processors are vulnerable to Spectre-V1 Proof-of-Concept
    (PoC). And the generic mechanism, __user pointer sanitization, can be
    used as a mitigation. This means to use array_index_nospec() to prevent
    out of boundry access in syscall and other critical paths.
    
    Implement the arch-specific cpu_show_spectre_v1() to show CPU Spectre-V1
    vulnerabilites correctly.
    
    Cc: [email protected]
    Link: https://cc-sw.com/chinese-loongarch-architecture-evaluation-part-3-of-3/
    Signed-off-by: Huacai Chen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

LoongArch: Use per-root-bridge PCIH flag to skip mem resource fixup [+ + +]
Author: Huacai Chen <[email protected]>
Date:   Mon May 4 09:00:20 2026 +0800

    LoongArch: Use per-root-bridge PCIH flag to skip mem resource fixup
    
    commit 49f33840dcc907d21313d369e34872880846b61c upstream.
    
    When firmware enables 64-bit PCI host bridge support, some root bridges
    already provide valid 64-bit mem resource windows through ACPI.
    
    In this case, the LoongArch-specific mem resource high-bits fixup in
    acpi_prepare_root_resources() should not be applied unconditionally.
    Otherwise, the kernel may override the native resource layout derived
    from firmware, and later BAR assignment can fail to place device BARs
    into the intended 64-bit address space correctly.
    
    Add a per-root-bridge ACPI flag, PCIH, and evaluate it from the current
    root bridge device scope. When PCIH is set, skip the mem resource high-
    bits fixup path and let the kernel use the firmware-provided resource
    description directly. When PCIH is absent or cleared, keep the existing
    behavior and continue filling the high address bits from the host bridge
    address.
    
    This makes the behavior per-root-bridge configurable and avoids breaking
    valid 64-bit BAR space allocation on bridges whose 64-bit windows have
    already been fully described by firmware.
    
    Cc: [email protected]
    Suggested-by: Chao Li <[email protected]>
    Tested-by: Dongyan Qian <[email protected]>
    Signed-off-by: Dongyan Qian <[email protected]>
    Signed-off-by: Huacai Chen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
md/raid10: fix deadlock with check operation and nowait requests [+ + +]
Author: Josh Hunt <[email protected]>
Date:   Mon Mar 2 19:56:19 2026 -0500

    md/raid10: fix deadlock with check operation and nowait requests
    
    commit 7d96f3120a7fb7210d21b520c5b6f495da6ba436 upstream.
    
    When an array check is running it will raise the barrier at which point
    normal requests will become blocked and increment the nr_pending value to
    signal there is work pending inside of wait_barrier(). NOWAIT requests
    do not block and so will return immediately with an error, and additionally
    do not increment nr_pending in wait_barrier(). Upstream change commit
    43806c3d5b9b ("raid10: cleanup memleak at raid10_make_request") added a
    call to raid_end_bio_io() to fix a memory leak when NOWAIT requests hit
    this condition. raid_end_bio_io() eventually calls allow_barrier() and
    it will unconditionally do an atomic_dec_and_test(&conf->nr_pending) even
    though the corresponding increment on nr_pending didn't happen in the
    NOWAIT case.
    
    This can be easily seen by starting a check operation while an application
    is doing nowait IO on the same array. This results in a deadlocked state
    due to nr_pending value underflowing and so the md resync thread gets stuck
    waiting for nr_pending to == 0.
    
    Output of r10conf state of the array when we hit this condition:
    
    crash> struct r10conf
            barrier = 1,
            nr_pending = {
              counter = -41
            },
            nr_waiting = 15,
            nr_queued = 0,
    
    Example of md_sync thread stuck waiting on raise_barrier() and other
    requests stuck in wait_barrier():
    
    md1_resync
    [<0>] raise_barrier+0xce/0x1c0
    [<0>] raid10_sync_request+0x1ca/0x1ed0
    [<0>] md_do_sync+0x779/0x1110
    [<0>] md_thread+0x90/0x160
    [<0>] kthread+0xbe/0xf0
    [<0>] ret_from_fork+0x34/0x50
    [<0>] ret_from_fork_asm+0x1a/0x30
    
    kworker/u1040:2+flush-253:4
    [<0>] wait_barrier+0x1de/0x220
    [<0>] regular_request_wait+0x30/0x180
    [<0>] raid10_make_request+0x261/0x1000
    [<0>] md_handle_request+0x13b/0x230
    [<0>] __submit_bio+0x107/0x1f0
    [<0>] submit_bio_noacct_nocheck+0x16f/0x390
    [<0>] ext4_io_submit+0x24/0x40
    [<0>] ext4_do_writepages+0x254/0xc80
    [<0>] ext4_writepages+0x84/0x120
    [<0>] do_writepages+0x7a/0x260
    [<0>] __writeback_single_inode+0x3d/0x300
    [<0>] writeback_sb_inodes+0x1dd/0x470
    [<0>] __writeback_inodes_wb+0x4c/0xe0
    [<0>] wb_writeback+0x18b/0x2d0
    [<0>] wb_workfn+0x2a1/0x400
    [<0>] process_one_work+0x149/0x330
    [<0>] worker_thread+0x2d2/0x410
    [<0>] kthread+0xbe/0xf0
    [<0>] ret_from_fork+0x34/0x50
    [<0>] ret_from_fork_asm+0x1a/0x30
    
    Fixes: 43806c3d5b9b ("raid10: cleanup memleak at raid10_make_request")
    Cc: [email protected]
    Signed-off-by: Josh Hunt <[email protected]>
    Link: https://lore.kernel.org/linux-raid/[email protected]
    Signed-off-by: Yu Kuai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

md/raid10: fix divide-by-zero in setup_geo() with zero far_copies [+ + +]
Author: Junrui Luo <[email protected]>
Date:   Thu Apr 16 11:39:56 2026 +0800

    md/raid10: fix divide-by-zero in setup_geo() with zero far_copies
    
    commit 9aa6d860b0930e2f72795665c42c44252a558a0c upstream.
    
    setup_geo() extracts near_copies (nc) and far_copies (fc) from the
    user-provided layout parameter without checking for zero. When fc=0
    with the "improved" far set layout selected, 'geo->far_set_size =
    disks / fc' triggers a divide-by-zero.
    
    Validate nc and fc immediately after extraction, returning -1 if
    either is zero.
    
    Fixes: 475901aff158 ("MD RAID10: Improve redundancy for 'far' and 'offset' algorithms (part 1)")
    Cc: [email protected]
    Signed-off-by: Junrui Luo <[email protected]>
    Link: https://lore.kernel.org/linux-raid/SYBPR01MB7881A5E2556806CC1D318582AF232@SYBPR01MB7881.ausprd01.prod.outlook.com
    Signed-off-by: Yu Kuai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
md/raid5: fix soft lockup in retry_aligned_read() [+ + +]
Author: Chia-Ming Chang <[email protected]>
Date:   Thu Apr 2 14:14:06 2026 +0800

    md/raid5: fix soft lockup in retry_aligned_read()
    
    commit 7f9f7c697474268d9ef9479df3ddfe7cdcfbbffc upstream.
    
    When retry_aligned_read() encounters an overlapped stripe, it releases
    the stripe via raid5_release_stripe() which puts it on the lockless
    released_stripes llist. In the next raid5d loop iteration,
    release_stripe_list() drains the stripe onto handle_list (since
    STRIPE_HANDLE is set by the original IO), but retry_aligned_read()
    runs before handle_active_stripes() and removes the stripe from
    handle_list via find_get_stripe() -> list_del_init(). This prevents
    handle_stripe() from ever processing the stripe to resolve the
    overlap, causing an infinite loop and soft lockup.
    
    Fix this by using __release_stripe() with temp_inactive_list instead
    of raid5_release_stripe() in the failure path, so the stripe does not
    go through the released_stripes llist. This allows raid5d to break out
    of its loop, and the overlap will be resolved when the stripe is
    eventually processed by handle_stripe().
    
    Fixes: 773ca82fa1ee ("raid5: make release_stripe lockless")
    Cc: [email protected]
    Signed-off-by: FengWei Shih <[email protected]>
    Signed-off-by: Chia-Ming Chang <[email protected]>
    Link: https://lore.kernel.org/linux-raid/[email protected]/
    Signed-off-by: Yu Kuai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

md/raid5: validate payload size before accessing journal metadata [+ + +]
Author: Junrui Luo <[email protected]>
Date:   Sat Apr 4 15:44:35 2026 +0800

    md/raid5: validate payload size before accessing journal metadata
    
    commit b0cc3ae97e893bf54bbce447f4e9fd2e0b88bff9 upstream.
    
    r5c_recovery_analyze_meta_block() and
    r5l_recovery_verify_data_checksum_for_mb() iterate over payloads in a
    journal metadata block using on-disk payload size fields without
    validating them against the remaining space in the metadata block.
    
    A corrupted journal contains payload sizes extending beyond the PAGE_SIZE
    boundary can cause out-of-bounds reads when accessing payload fields or
    computing offsets.
    
    Add bounds validation for each payload type to ensure the full payload
    fits within meta_size before processing.
    
    Fixes: b4c625c67362 ("md/r5cache: r5cache recovery: part 1")
    Cc: [email protected]
    Signed-off-by: Junrui Luo <[email protected]>
    Link: https://lore.kernel.org/linux-raid/SYBPR01MB78815E78D829BB86CD7C8015AF5FA@SYBPR01MB7881.ausprd01.prod.outlook.com/
    Signed-off-by: Yu Kuai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
media: amphion: Fix race between m2m job_abort and device_run [+ + +]
Author: Ming Qian <[email protected]>
Date:   Fri Mar 6 14:59:50 2026 +0800

    media: amphion: Fix race between m2m job_abort and device_run
    
    commit 8cd35ceadcfc8c5da2eb7f7ce24525ce9d4ee62e upstream.
    
    Fix kernel panic caused by race condition where v4l2_m2m_ctx_release()
    frees m2m_ctx while v4l2_m2m_try_run() is about to call device_run
    with the same context.
    
    Race sequence:
      v4l2_m2m_try_run():           v4l2_m2m_ctx_release():
        lock/unlock                   v4l2_m2m_cancel_job()
                                        job_abort()
                                          v4l2_m2m_job_finish()
                                      kfree(m2m_ctx)  <- frees ctx
        device_run()  <- use-after-free crash at 0x538
    
    Crash trace:
      Unable to handle kernel read from unreadable memory at virtual address
      0000000000000538
      v4l2_m2m_try_run+0x78/0x138
      v4l2_m2m_device_run_work+0x14/0x20
    
    The amphion vpu driver does not rely on the m2m framework's device_run
    callback to perform encode/decode operations.
    
    Fix the race by preventing m2m framework job scheduling entirely:
    - Add job_ready callback returning 0 (no jobs ready for m2m framework)
    - Remove job_abort callback to avoid the race condition
    
    Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support")
    Cc: [email protected]
    Signed-off-by: Ming Qian <[email protected]>
    Reviewed-by: Nicolas Dufresne <[email protected]>
    Signed-off-by: Nicolas Dufresne <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: dib8000: avoid division by 0 in dib8000_set_dds() [+ + +]
Author: Sergey Shtylyov <[email protected]>
Date:   Fri Feb 6 17:22:26 2026 +0300

    media: dib8000: avoid division by 0 in dib8000_set_dds()
    
    commit dde3c37af95cd6fa301c4906f33d627bc9dd874c upstream.
    
    In dib8000_set_dds(), 1 << 26 (67108864) divided by e.g. 1 apparently can't
    fit into 16-bit variable unit_khz_dds_val, being truncated to 0; this will
    cause division by 0 while calling dprintk() with debugging enabled (via the
    module parameter).  Use s32 instead of s16 to declare the variable, getting
    rid of the cast to u16 in the *else* branch as well...
    
    Found by Linux Verification Center (linuxtesting.org) with the Svace static
    analysis tool.
    
    Fixes: 173a64cb3fcf ("[media] dib8000: enhancement")
    Cc: [email protected]
    Signed-off-by: Sergey Shtylyov <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: i2c: imx219: Check return value of devm_gpiod_get_optional() in imx219_probe() [+ + +]
Author: Chen Ni <[email protected]>
Date:   Wed Feb 4 10:48:59 2026 +0800

    media: i2c: imx219: Check return value of devm_gpiod_get_optional() in imx219_probe()
    
    commit 943b1f27a3eead21b22e2531a5432ea5910b60eb upstream.
    
    The devm_gpiod_get_optional() function may return an error pointer
    (ERR_PTR) in case of a genuine failure during GPIO acquisition,
    not just NULL which indicates the legitimate absence of an optional
    GPIO.
    
    Add an IS_ERR() check after the function call to catch such errors and
    propagate them to the probe function, ensuring the driver fails to load
    safely rather than proceeding with an invalid pointer.
    
    Fixes: 1283b3b8f82b ("media: i2c: Add driver for Sony IMX219 sensor")
    Cc: [email protected]
    Signed-off-by: Chen Ni <[email protected]>
    Reviewed-by: Dave Stevenson <[email protected]>
    Reviewed-by: Jai Luthra <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: i2c: imx412: Assert reset GPIO during probe [+ + +]
Author: Wenmeng Liu <[email protected]>
Date:   Fri Jan 23 17:19:55 2026 +0800

    media: i2c: imx412: Assert reset GPIO during probe
    
    commit 8467c5ff5acae28513bc1e0af535e06b41b04344 upstream.
    
    Assert the reset GPIO before first power up. This avoids a mismatch where
    the first power up (when the reset GPIO defaults deasserted) differs from
    subsequent cycles.
    
    Signed-off-by: Wenmeng Liu <[email protected]>
    Fixes: 9214e86c0cc1 ("media: i2c: Add imx412 camera sensor driver")
    Cc: [email protected]
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: i2c: ov08d10: fix image vertical start setting [+ + +]
Author: Matthias Fend <[email protected]>
Date:   Tue Mar 24 11:41:36 2026 +0100

    media: i2c: ov08d10: fix image vertical start setting
    
    commit 5d150fa0f16096d736bd24d13e04495da5116fab upstream.
    
    The current settings for the "image vertical start" register appear to be
    incorrect. While this only results in an incorrect start line for native
    modes, this faulty setting causes actual problems in binning mode. At least
    on an i.MX8MP test system, only corrupted frames could be received.
    To correct this, the recommended settings from the reference register sets
    are used for all modes. Since this shifts the start by one line, the Bayer
    pattern also changes, which has also been corrected.
    
    Fixes: 7be91e02ed57 ("media: i2c: Add ov08d10 camera sensor driver")
    Cc: [email protected]
    Signed-off-by: Matthias Fend <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: i2c: ov8856: free control handler on error in ov8856_init_controls() [+ + +]
Author: Alexander Koskovich <[email protected]>
Date:   Thu Mar 12 17:16:20 2026 +0000

    media: i2c: ov8856: free control handler on error in ov8856_init_controls()
    
    commit f75e160745663ce9b13362ae6e90bd439c58df69 upstream.
    
    The control handler wasn't freed if adding controls failed, add an error
    exit label and convert the existing error return to use it.
    
    Fixes: 879347f0c258 ("media: ov8856: Add support for OV8856 sensor")
    Cc: [email protected]
    Signed-off-by: Alexander Koskovich <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: mtk-jpeg: fix use-after-free in release path due to uncancelled work [+ + +]
Author: Fan Wu <[email protected]>
Date:   Wed Mar 4 03:19:34 2026 +0000

    media: mtk-jpeg: fix use-after-free in release path due to uncancelled work
    
    commit 34c519feef3e4fcff1078dc8bdb25fbbbd10303f upstream.
    
    The mtk_jpeg_release() function frees the context structure (ctx) without
    first cancelling any pending or running work in ctx->jpeg_work. This
    creates a race window where the workqueue callback may still be accessing
    the context memory after it has been freed.
    
    Race condition:
    
        CPU 0 (release)                    CPU 1 (workqueue)
        ----------------                   ------------------
        close()
          mtk_jpeg_release()
                                           mtk_jpegenc_worker()
                                             ctx = work->data
                                             // accessing ctx
    
            kfree(ctx)  // freed!
                                             access ctx  // UAF!
    
    The work is queued via queue_work() during JPEG encode/decode operations
    (via mtk_jpeg_device_run). If the device is closed while work is pending
    or running, the work handler will access freed memory.
    
    Fix this by calling cancel_work_sync() BEFORE acquiring the mutex. This
    ordering is critical: if cancel_work_sync() is called after mutex_lock(),
    and the work handler also tries to acquire the same mutex, it would cause
    a deadlock.
    
    Note: The open error path does NOT need cancel_work_sync() because
    INIT_WORK() only initializes the work structure - it does not schedule
    it. Work is only scheduled later during ioctl operations.
    
    Fixes: 5fb1c2361e56 ("mtk-jpegenc: add jpeg encode worker interface")
    Cc: [email protected]
    Signed-off-by: Fan Wu <[email protected]>
    Reviewed-by: Nicolas Dufresne <[email protected]>
    Signed-off-by: Nicolas Dufresne <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: omap3isp: drop the use count of v4l2 pipeline [+ + +]
Author: Haoxiang Li <[email protected]>
Date:   Mon Jan 26 09:44:12 2026 +0800

    media: omap3isp: drop the use count of v4l2 pipeline
    
    commit 9da49bd9d4224035cff39b40d7395310abb10201 upstream.
    
    In isp_video_open(), drop the use count of v4l2
    pipeline if vb2_queue_init() fails.
    
    Fixes: 8fd390b89cc8 ("media: Split v4l2_pipeline_pm_use into v4l2_pipeline_pm_{get, put}")
    Cc: [email protected]
    Signed-off-by: Haoxiang Li <[email protected]>
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: pci: zoran: fix potential memory leak in zoran_probe() [+ + +]
Author: Abdun Nihaal <[email protected]>
Date:   Thu Mar 12 18:02:56 2026 +0530

    media: pci: zoran: fix potential memory leak in zoran_probe()
    
    commit 8ea21435fe36fb853706f4935d78bc11beb63fb4 upstream.
    
    The memory allocated for codec in videocodec_attach() is not freed in
    one of the error paths, due to an incorrect goto label. Fix the label
    to free it on error.
    
    Fixes: 8f7cc5c0b0eb ("media: staging: media: zoran: introduce zoran_i2c_init")
    Cc: [email protected]
    Signed-off-by: Abdun Nihaal <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: rc: igorplugusb: heed coherency rules [+ + +]
Author: Oliver Neukum <[email protected]>
Date:   Fri May 1 17:06:21 2026 -0400

    media: rc: igorplugusb: heed coherency rules
    
    [ Upstream commit eac69475b01fe1e861dfe3960b57fa95671c132e ]
    
    In a control request, the USB request structure
    can be subject to DMA on some HCs. Hence it must obey
    the rules for DMA coherency. Allocate it separately.
    
    Fixes: b1c97193c6437 ("[media] rc: port IgorPlug-USB to rc-core")
    Cc: [email protected]
    Signed-off-by: Oliver Neukum <[email protected]>
    Signed-off-by: Sean Young <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    [ replaced kzalloc_obj(*ir->request, GFP_KERNEL) with kzalloc(sizeof(*ir->request), GFP_KERNEL) ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: rc: streamzap: Error handling in probe [+ + +]
Author: Oliver Neukum <[email protected]>
Date:   Wed Feb 11 19:06:21 2026 +0100

    media: rc: streamzap: Error handling in probe
    
    commit 42844992664f03ef9f930e64f7370fa481e9c267 upstream.
    
    If submitting the URB fails, the device will be unusable.
    Probe() must fail.
    
    Fixes: 7a569f524dd36 ("V4L/DVB: IR/streamzap: functional in-kernel decoding")
    Cc: [email protected]
    Signed-off-by: Oliver Neukum <[email protected]>
    Signed-off-by: Sean Young <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: rc: ttusbir: respect DMA coherency rules [+ + +]
Author: Oliver Neukum <[email protected]>
Date:   Fri May 1 12:59:04 2026 -0400

    media: rc: ttusbir: respect DMA coherency rules
    
    [ Upstream commit 50acaad3d202c064779db8dc3d010007347f59c7 ]
    
    Buffers must not share a cache line with other data structures.
    Allocate separately.
    
    Fixes: 0938069fa0897 ("[media] rc: Add support for the TechnoTrend USB IR Receiver")
    Cc: [email protected]
    Signed-off-by: Oliver Neukum <[email protected]>
    Signed-off-by: Sean Young <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    [ kept kzalloc(sizeof(*tt), GFP_KERNEL) instead of kzalloc_obj() ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: rc: xbox_remote: heed DMA restrictions [+ + +]
Author: Oliver Neukum <[email protected]>
Date:   Wed Feb 11 19:09:44 2026 +0100

    media: rc: xbox_remote: heed DMA restrictions
    
    commit e280d1e5e3f2595bbb43fe6e1bce00c59a43c0ff upstream.
    
    The buffer for IO must not be part of the device structure
    because that violates the DMA coherency rules.
    
    Fixes: 02d32bdad3123 ("media: rc: add driver for Xbox DVD Movie Playback Kit")
    Cc: [email protected]
    Signed-off-by: Oliver Neukum <[email protected]>
    Signed-off-by: Sean Young <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: saa7164: add ioremap return checks and cleanups [+ + +]
Author: Wang Jun <[email protected]>
Date:   Mon Mar 16 20:24:01 2026 +0800

    media: saa7164: add ioremap return checks and cleanups
    
    commit d51c60a498e83c9a79884c8e420f97e3885c9583 upstream.
    
    Add checks for ioremap return values in saa7164_dev_setup(). If
    ioremap for BAR0 or BAR2 fails, release the already allocated PCI
    memory regions, remove the device from the global list, decrement
    the device count, and return -ENODEV.
    
    This prevents potential null pointer dereferences and ensures proper
    cleanup on memory mapping failures.
    
    Fixes: 443c1228d505 ("V4L/DVB (12923): SAA7164: Add support for the NXP SAA7164 silicon")
    Cc: [email protected]
    Signed-off-by: Wang Jun <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: staging: imx: request mbus_config in csi_start [+ + +]
Author: Michael Tretter <[email protected]>
Date:   Fri Nov 7 11:34:33 2025 +0100

    media: staging: imx: request mbus_config in csi_start
    
    commit 9df2aaa64890c0b6226057eb6fcb6352bd2df432 upstream.
    
    Request the upstream mbus_config in csi_start, which starts the stream,
    instead of caching it in link_validate.
    
    This allows to get rid of the mbus_cfg field in the struct csi_priv and
    avoids state in the driver.
    
    Fixes: 4a34ec8e470c ("[media] media: imx: Add CSI subdev driver")
    Cc: [email protected]
    Reviewed-by: Frank Li <[email protected]>
    Signed-off-by: Michael Tretter <[email protected]>
    Reviewed-by: Philipp Zabel <[email protected]>
    Signed-off-by: Frank Li <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: uvcvideo: Enable VB2_DMABUF for metadata stream [+ + +]
Author: Ricardo Ribalda <[email protected]>
Date:   Mon Mar 9 15:01:54 2026 +0000

    media: uvcvideo: Enable VB2_DMABUF for metadata stream
    
    commit fbac03467e53d8d72e5099c03df26d9adae11416 upstream.
    
    The UVC driver has two video streams, one for the frames and another one
    for the metadata. Both streams share most of the codebase, but only the
    data stream declares support for DMABUF transfer mode.
    
    I have tried the DMABUF transfer mode with CONFIG_DMABUF_HEAPS_SYSTEM
    and the frames looked correct.
    
    This patch announces the support for DMABUF for the metadata stream.
    This is useful for apps/HALs that only want to support DMABUF.
    
    Cc: [email protected]
    Fixes: 088ead2552458 ("media: uvcvideo: Add a metadata device node")
    Signed-off-by: Ricardo Ribalda <[email protected]>
    Reviewed-by: Laurent Pinchart <[email protected]>
    Reviewed-by: Hans de Goede <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Laurent Pinchart <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

media: videobuf2: Set vma_flags in vb2_dma_sg_mmap [+ + +]
Author: Janne Grunau <[email protected]>
Date:   Sun Feb 15 18:42:59 2026 +0100

    media: videobuf2: Set vma_flags in vb2_dma_sg_mmap
    
    commit 7254b31a13aaa0c2c0f9ffbc335b718656117ff4 upstream.
    
    vb2_dma_contig sets VMA flags VM_DONTEXPAND and VM_DONTDUMP and I do not
    see a reason why vb2_dma_sg should behave differently. This avoids
    hitting `WARN_ON(!(vma->vm_flags & VM_DONTEXPAND));` in
    drm_gem_mmap_obj() during mmap() of an imported dma-buf from the out of
    tree Apple ISP camera capture driver which uses vb2_dma_sg_memops.
    
    gst-launch-1.0 v4l2src ! gtk4paintablesink
    
    [   38.201528] ------------[ cut here ]------------
    [   38.202135] WARNING: CPU: 7 PID: 2362 at drivers/gpu/drm/drm_gem.c:1144 drm_gem_mmap_obj+0x1f8/0x210
    [   38.203278] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer
    snd_seq snd_seq_device uinput nf_conntrack_netbios_ns
    nf_conntrack_broadcast nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib
    nft_reject_inet nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat
    nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables qrtr bnep
    nls_ascii i2c_dev loop fuse dm_multipath nfnetlink brcmfmac_wcc
    hid_magicmouse hci_bcm4377 brcmfmac brcmutil bluetooth ecdh_generic
    cfg80211 ecc btrfs xor xor_neon rfkill hid_apple raid6_pq joydev
    aop_als apple_nvmem_spmi industrialio snd_soc_aop apple_z2
    snd_soc_cs42l84 tps6598x snd_soc_tas2764 macsmc_reboot spi_nor
    macsmc_hwmon rtc_macsmc gpio_macsmc macsmc_power regmap_spmi
    macsmc_input dockchannel_hid panel_summit appledrm nvme_apple dwc3
    snd_soc_macaudio drm_client_lib nvme_core phy_apple_atc hwmon
    apple_sart apple_dockchannel macsmc apple_rtkit_helper
    spmi_apple_controller aop apple_wdt mfd_core nvmem_apple_efuses
    pinctrl_apple_gpio apple_isp apple_dcp videobuf2_dma_sg mux_core
    spi_apple
    [   38.203300]  videobuf2_memops i2c_pasemi_platform snd_soc_apple_mca videobuf2_v4l2 videodev clk_apple_nco videobuf2_common snd_pcm_dmaengine adpdrm asahi apple_admac adpdrm_mipi drm_dma_helper pwm_apple i2c_pasemi_core drm_display_helper mc cec apple_dart ofpart apple_soc_cpufreq leds_pwm phram
    [   38.217677] CPU: 7 UID: 1000 PID: 2362 Comm: gst-launch-1.0 Tainted: G        W           6.17.6+ #asahi-dev PREEMPT(full)
    [   38.219040] Tainted: [W]=WARN
    [   38.219398] Hardware name: Apple MacBook Pro (13-inch, M2, 2022) (DT)
    [   38.220213] pstate: 21400005 (nzCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
    [   38.221088] pc : drm_gem_mmap_obj+0x1f8/0x210
    [   38.221643] lr : drm_gem_mmap_obj+0x78/0x210
    [   38.222178] sp : ffffc0008dc678e0
    [   38.222579] x29: ffffc0008dc678e0 x28: 0000000000042a97 x27: ffff8000b701b480
    [   38.223465] x26: 00000000000000fb x25: ffffc0008dc67d20 x24: ffffc0008dc67968
    [   38.224402] x23: ffff8000e3ca5600 x22: ffff8000265b7800 x21: ffff80003000c0c0
    [   38.225279] x20: 0000000000000000 x19: ffff8000b68c5200 x18: ffffc0008dc67968
    [   38.226151] x17: 0000000000000000 x16: 0000000000000000 x15: ffffc000810a30a8
    [   38.227042] x14: 00007fff637effff x13: 00005555de91ffff x12: 00007fff63293fff
    [   38.227942] x11: 0000000000000000 x10: ffff8000184ecf08 x9 : ffffc0007a1900c8
    [   38.228824] x8 : ffffc0008dc67968 x7 : 0000000000000012 x6 : ffffc0015cf1c000
    [   38.229703] x5 : ffffc0008dc676a0 x4 : ffffc00081a27dc0 x3 : 0000000000000038
    [   38.230607] x2 : 0000000000000003 x1 : 0000000000000003 x0 : 00000000100000fb
    [   38.231488] Call trace:
    [   38.231806]  drm_gem_mmap_obj+0x1f8/0x210 (P)
    [   38.232342]  drm_gem_mmap+0x140/0x260
    [   38.232813]  __mmap_region+0x488/0x9a0
    [   38.233277]  mmap_region+0xd0/0x148
    [   38.233703]  do_mmap+0x350/0x5c0
    [   38.234148]  vm_mmap_pgoff+0x14c/0x200
    [   38.234612]  ksys_mmap_pgoff+0x150/0x208
    [   38.235107]  __arm64_sys_mmap+0x34/0x50
    [   38.235611]  invoke_syscall+0x50/0x120
    [   38.236075]  el0_svc_common.constprop.0+0x48/0xf0
    [   38.236680]  do_el0_svc+0x24/0x38
    [   38.237113]  el0_svc+0x38/0x168
    [   38.237507]  el0t_64_sync_handler+0xa0/0xe8
    [   38.238034]  el0t_64_sync+0x198/0x1a0
    [   38.238491] ---[ end trace 0000000000000000 ]---
    
    There were discussions in [1] at the end of 2023 that mmap() on imported
    dma-bufs should not be supported but as of v6.17 drm_gem_shmem_mmap() in
    drm_gem_shmem_helper.c still supports it.
    This might affect all gpu or accel drivers using drm_gem_shmem_mmap() or
    the wrapper drm_gem_shmem_object_mmap().
    
    [1] https://lore.kernel.org/dri-devel/[email protected]/
    
    Cc: [email protected]
    Fixes: 5ba3f757f059 ("[media] v4l: videobuf2: add DMA scatter/gather allocator")
    Signed-off-by: Janne Grunau <[email protected]>
    Acked-by: Marek Szyprowski <[email protected]>
    Signed-off-by: Hans Verkuil <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mfd: stpmic1: Attempt system shutdown twice in case PMIC is confused [+ + +]
Author: Marek Vasut <[email protected]>
Date:   Thu Jan 22 12:13:21 2026 +0100

    mfd: stpmic1: Attempt system shutdown twice in case PMIC is confused
    
    commit ffdc5c51f8bcd0e5e8255ca275a0a3b958475d99 upstream.
    
    Attempt to shut down again, in case the first attempt failed.
    The STPMIC1 might get confused and the first regmap_update_bits()
    returns with -ETIMEDOUT / -110 . If that or similar transient
    failure occurs, try to shut down again. If the second attempt
    fails, there is some bigger problem, report it to user.
    
    Cc: [email protected]
    Fixes: 6e9df38f359a ("mfd: stpmic1: Add PMIC poweroff via sys-off handler")
    Signed-off-by: Marek Vasut <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Lee Jones <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
misc: ibmasm: fix OOB MMIO read in ibmasm_handle_mouse_interrupt() [+ + +]
Author: Tyllis Xu <[email protected]>
Date:   Sun Mar 8 00:21:08 2026 -0600

    misc: ibmasm: fix OOB MMIO read in ibmasm_handle_mouse_interrupt()
    
    commit 4b6e6ead556734bdc14024c5f837132b1e7a4b84 upstream.
    
    ibmasm_handle_mouse_interrupt() performs an out-of-bounds MMIO read
    when the queue reader or writer index from hardware exceeds
    REMOTE_QUEUE_SIZE (60).
    
    A compromised service processor can trigger this by writing an
    out-of-range value to the reader or writer MMIO register before
    asserting an interrupt. Since writer is re-read from hardware on
    every loop iteration, it can also be set to an out-of-range value
    after the loop has already started.
    
    The root cause is that get_queue_reader() and get_queue_writer() return
    raw readl() values that are passed directly into get_queue_entry(),
    which computes:
    
      queue_begin + reader * sizeof(struct remote_input)
    
    with no bounds check. This unchecked MMIO address is then passed to
    memcpy_fromio(), reading 8 bytes from unintended device registers.
    For sufficiently large values the address falls outside the PCI BAR
    mapping entirely, triggering a machine check exception.
    
    Fix by checking both indices against REMOTE_QUEUE_SIZE at the top of
    the loop body, before any call to get_queue_entry(). On an out-of-range
    value, reset the reader register to 0 via set_queue_reader() before
    breaking, so that normal queue operation can resume if the corrupted
    hardware state is transient.
    
    Reported-by: Yuhao Jiang <[email protected]>
    Fixes: 278d72ae8803 ("[PATCH] ibmasm driver: redesign handling of remote control events")
    Cc: [email protected]
    Cc: [email protected]
    Signed-off-by: Tyllis Xu <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm/damon/core: disallow time-quota setting zero esz [+ + +]
Author: SeongJae Park <[email protected]>
Date:   Mon Apr 6 17:31:52 2026 -0700

    mm/damon/core: disallow time-quota setting zero esz
    
    commit 8bbde987c2b84f80da0853f739f0a920386f8b99 upstream.
    
    When the throughput of a DAMOS scheme is very slow, DAMOS time quota can
    make the effective size quota smaller than damon_ctx->min_region_sz.  In
    the case, damos_apply_scheme() will skip applying the action, because the
    action is tried at region level, which requires >=min_region_sz size.
    That is, the quota is effectively exceeded for the quota charge window.
    
    Because no action will be applied, the total_charged_sz and
    total_charged_ns are also not updated.  damos_set_effective_quota() will
    try to update the effective size quota before starting the next charge
    window.  However, because the total_charged_sz and total_charged_ns have
    not updated, the throughput and effective size quota are also not changed.
    Since effective size quota can only be decreased, other effective size
    quota update factors including DAMOS quota goals and size quota cannot
    make any change, either.
    
    As a result, the scheme is unexpectedly deactivated until the user notices
    and mitigates the situation.  The users can mitigate this situation by
    changing the time quota online or re-install the scheme.  While the
    mitigation is somewhat straightforward, finding the situation would be
    challenging, because DAMON is not providing good observabilities for that.
    Even if such observability is provided, doing the additional monitoring
    and the mitigation is somewhat cumbersome and not aligned to the intention
    of the time quota.  The time quota was intended to help reduce the user's
    administration overhead.
    
    Fix the problem by setting time quota-modified effective size quota be at
    least min_region_sz always.
    
    The issue was discovered [1] by sashiko.
    
    Link: https://lore.kernel.org/[email protected]
    Link: https://lore.kernel.org/[email protected] [1]
    Fixes: 1cd243030059 ("mm/damon/schemes: implement time quota")
    Signed-off-by: SeongJae Park <[email protected]>
    Cc: <[email protected]> # 5.16.x
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: SeongJae Park <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mm/damon/core: implement damon_kdamond_pid() [+ + +]
Author: SeongJae Park <[email protected]>
Date:   Thu Jan 15 07:20:41 2026 -0800

    mm/damon/core: implement damon_kdamond_pid()
    
    commit 4262c53236977de3ceaa3bf2aefdf772c9b874dd upstream.
    
    Patch series "mm/damon: hide kdamond and kdamond_lock from API callers".
    
    'kdamond' and 'kdamond_lock' fields initially exposed to DAMON API callers
    for flexible synchronization and use cases.  As DAMON API became somewhat
    complicated compared to the early days, Keeping those exposed could only
    encourage the API callers to invent more creative but complicated and
    difficult-to-debug use cases.
    
    Fortunately DAMON API callers didn't invent that many creative use cases.
    There exist only two use cases of 'kdamond' and 'kdamond_lock'.  Finding
    whether the kdamond is actively running, and getting the pid of the
    kdamond.  For the first use case, a dedicated API function, namely
    'damon_is_running()' is provided, and all DAMON API callers are using the
    function for the use case.  Hence only the second use case is where the
    fields are directly being used by DAMON API callers.
    
    To prevent future invention of complicated and erroneous use cases of the
    fields, hide the fields from the API callers.  For that, provide new
    dedicated DAMON API functions for the remaining use case, namely
    damon_kdamond_pid(), migrate DAMON API callers to use the new function,
    and mark the fields as private fields.
    
    
    This patch (of 5):
    
    'kdamond' and 'kdamond_lock' are directly being used by DAMON API callers
    for getting the pid of the corresponding kdamond.  To discourage invention
    of creative but complicated and erroneous new usages of the fields that
    require careful synchronization, implement a new API function that can
    simply be used without the manual synchronizations.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: SeongJae Park <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: SeongJae Park <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mm/damon/core: use time_in_range_open() for damos quota window start [+ + +]
Author: SeongJae Park <[email protected]>
Date:   Sun Mar 29 08:23:05 2026 -0700

    mm/damon/core: use time_in_range_open() for damos quota window start
    
    commit 049a57421dd67a28c45ae7e92c36df758033e5fa upstream.
    
    damos_adjust_quota() uses time_after_eq() to show if it is time to start a
    new quota charge window, comparing the current jiffies and the scheduled
    next charge window start time.  If it is, the next charge window start
    time is updated and the new charge window starts.
    
    The time check and next window start time update is skipped while the
    scheme is deactivated by the watermarks.  Let's suppose the deactivation
    is kept more than LONG_MAX jiffies (assuming CONFIG_HZ of 250, more than
    99 days in 32 bit systems and more than one billion years in 64 bit
    systems), resulting in having the jiffies larger than the next charge
    window start time + LONG_MAX.  Then, the time_after_eq() call can return
    false until another LONG_MAX jiffies are passed.
    
    This means the scheme can continue working after being reactivated by the
    watermarks.  But, soon, the quota will be exceeded and the scheme will
    again effectively stop working until the next charge window starts.
    Because the current charge window is extended to up to LONG_MAX jiffies,
    however, it will look like it stopped unexpectedly and indefinitely, from
    the user's perspective.
    
    Fix this by using !time_in_range_open() instead.
    
    The issue was discovered [1] by sashiko.
    
    Link: https://lore.kernel.org/[email protected]
    Link: https://lore.kernel.org/[email protected] [1]
    Fixes: ee801b7dd782 ("mm/damon/schemes: activate schemes based on a watermarks mechanism")
    Signed-off-by: SeongJae Park <[email protected]>
    Cc: <[email protected]> # 5.16.x
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm/damon/lru_sort: detect and use fresh enabled and kdamond_pid values [+ + +]
Author: SeongJae Park <[email protected]>
Date:   Sun Apr 19 09:10:01 2026 -0700

    mm/damon/lru_sort: detect and use fresh enabled and kdamond_pid values
    
    commit b98b7ff6025ae82570d4915e083f0cbd8d48b3cf upstream.
    
    DAMON_LRU_SORT updates 'enabled' and 'kdamond_pid' parameter values, which
    represents the running status of its kdamond, when the user explicitly
    requests start/stop of the kdamond.  The kdamond can, however, be stopped
    in events other than the explicit user request in the following three
    events.
    
    1. ctx->regions_score_histogram allocation failure at beginning of the
       execution,
    2. damon_commit_ctx() failure due to invalid user input, and
    3. damon_commit_ctx() failure due to its internal allocation failures.
    
    Hence, if the kdamond is stopped by the above three events, the values of
    the status parameters can be stale.  Users could show the stale values and
    be confused.  This is already bad, but the real consequence is worse.
    DAMON_LRU_SORT avoids unnecessary damon_start() and damon_stop() calls
    based on the 'enabled' parameter value.  And the update of 'enabled'
    parameter value depends on the damon_start() and damon_stop() call
    results.  Hence, once the kdamond has stopped by the unintentional events,
    the user cannot restart the kdamond before the system reboot.  For
    example, the issue can be reproduced via below steps.
    
        # cd /sys/module/damon_lru_sort/parameters
        #
        # # start DAMON_LRU_SORT
        # echo Y > enabled
        # ps -ef | grep kdamond
        root         806       2  0 17:53 ?        00:00:00 [kdamond.0]
        root         808     803  0 17:53 pts/4    00:00:00 grep kdamond
        #
        # # commit wrong input to stop kdamond withou explicit stop request
        # echo 3 > addr_unit
        # echo Y > commit_inputs
        bash: echo: write error: Invalid argument
        #
        # # confirm kdamond is stopped
        # ps -ef | grep kdamond
        root         811     803  0 17:53 pts/4    00:00:00 grep kdamond
        #
        # # users casn now show stable status
        # cat enabled
        Y
        # cat kdamond_pid
        806
        #
        # # even after fixing the wrong parameter,
        # # kdamond cannot be restarted.
        # echo 1 > addr_unit
        # echo Y > enabled
        # ps -ef | grep kdamond
        root         815     803  0 17:54 pts/4    00:00:00 grep kdamond
    
    The problem will only rarely happen in real and common setups for the
    following reasons.  The allocation failures are unlikely in such setups
    since those allocations are arguably too small to fail.  Also sane users
    on real production environments may not commit wrong input parameters.
    But once it happens, the consequence is quite bad.  And the bug is a bug.
    
    The issue stems from the fact that there are multiple events that can
    change the status, and following all the events is challenging.
    Dynamically detect and use the fresh status for the parameters when those
    are requested.
    
    Link: https://lore.kernel.org/[email protected]
    Fixes: 40e983cca927 ("mm/damon: introduce DAMON-based LRU-lists Sorting")
    Co-developed-by: Liew Rui Yan <[email protected]>
    Signed-off-by: Liew Rui Yan <[email protected]>
    Signed-off-by: SeongJae Park <[email protected]>
    Cc: <[email protected]> # 6.0.x
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: SeongJae Park <[email protected]>
    (port parts of 42b7491af14c ("mm/damon/core: introduce damon_call()")
    and d2b5be741a50 ("mm/damon/sysfs: use DAMON core API
    damon_is_running()") for damon_is_running() dependency)
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm/damon/reclaim: detect and use fresh enabled and kdamond_pid values [+ + +]
Author: SeongJae Park <[email protected]>
Date:   Sun Apr 19 09:10:00 2026 -0700

    mm/damon/reclaim: detect and use fresh enabled and kdamond_pid values
    
    commit 64a140afa5ed1c6f5ba6d451512cbdbbab1ba339 upstream.
    
    Patch series "mm/damon/modules: detect and use fresh status", v3.
    
    DAMON modules including DAMON_RECLAIM, DAMON_LRU_SORT and DAMON_STAT
    commonly expose the kdamond running status via their parameters.  Under
    certain scenarios including wrong user inputs and memory allocation
    failures, those parameter values can be stale.  It can confuse users.  For
    DAMON_RECLAIM and DAMON_LRU_SORT, it even makes the kdamond unable to be
    restarted before the system reboot.
    
    The problem comes from the fact that there are multiple events for the
    status changes and it is difficult to follow up all the scenarios.  Fix
    the issue by detecting and using the status on demand, instead of using a
    cached status that is difficult to be updated.
    
    Patches 1-3 fix the bugs in DAMON_RECLAIM, DAMON_LRU_SORT and DAMON_STAT
    in the order.
    
    
    This patch (of 3):
    
    DAMON_RECLAIM updates 'enabled' and 'kdamond_pid' parameter values, which
    represents the running status of its kdamond, when the user explicitly
    requests start/stop of the kdamond.  The kdamond can, however, be stopped
    in events other than the explicit user request in the following three
    events.
    
    1. ctx->regions_score_histogram allocation failure at beginning of the
       execution,
    2. damon_commit_ctx() failure due to invalid user input, and
    3. damon_commit_ctx() failure due to its internal allocation failures.
    
    Hence, if the kdamond is stopped by the above three events, the values of
    the status parameters can be stale.  Users could show the stale values and
    be confused.  This is already bad, but the real consequence is worse.
    DAMON_RECLAIM avoids unnecessary damon_start() and damon_stop() calls
    based on the 'enabled' parameter value.  And the update of 'enabled'
    parameter value depends on the damon_start() and damon_stop() call
    results.  Hence, once the kdamond has stopped by the unintentional events,
    the user cannot restart the kdamond before the system reboot.  For
    example, the issue can be reproduced via below steps.
    
        # cd /sys/module/damon_reclaim/parameters
        #
        # # start DAMON_RECLAIM
        # echo Y > enabled
        # ps -ef | grep kdamond
        root         806       2  0 17:53 ?        00:00:00 [kdamond.0]
        root         808     803  0 17:53 pts/4    00:00:00 grep kdamond
        #
        # # commit wrong input to stop kdamond withou explicit stop request
        # echo 3 > addr_unit
        # echo Y > commit_inputs
        bash: echo: write error: Invalid argument
        #
        # # confirm kdamond is stopped
        # ps -ef | grep kdamond
        root         811     803  0 17:53 pts/4    00:00:00 grep kdamond
        #
        # # users casn now show stable status
        # cat enabled
        Y
        # cat kdamond_pid
        806
        #
        # # even after fixing the wrong parameter,
        # # kdamond cannot be restarted.
        # echo 1 > addr_unit
        # echo Y > enabled
        # ps -ef | grep kdamond
        root         815     803  0 17:54 pts/4    00:00:00 grep kdamond
    
    The problem will only rarely happen in real and common setups for the
    following reasons.  The allocation failures are unlikely in such setups
    since those allocations are arguably too small to fail.  Also sane users
    on real production environments may not commit wrong input parameters.
    But once it happens, the consequence is quite bad.  And the bug is a bug.
    
    The issue stems from the fact that there are multiple events that can
    change the status, and following all the events is challenging.
    Dynamically detect and use the fresh status for the parameters when those
    are requested.
    
    Link: https://lore.kernel.org/[email protected]
    Link: https://lore.kernel.org/[email protected]
    Fixes: e035c280f6df ("mm/damon/reclaim: support online inputs update")
    Co-developed-by: Liew Rui Yan <[email protected]>
    Signed-off-by: Liew Rui Yan <[email protected]>
    Signed-off-by: SeongJae Park <[email protected]>
    Cc: <[email protected]> # 5.19.x
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: SeongJae Park <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm/damon/sysfs-schemes: protect memcg_path kfree() with damon_sysfs_lock [+ + +]
Author: SeongJae Park <[email protected]>
Date:   Thu Apr 23 08:02:51 2026 -0700

    mm/damon/sysfs-schemes: protect memcg_path kfree() with damon_sysfs_lock
    
    commit 1e68eb96e8beb1abefd12dd22c5637795d8a877e upstream.
    
    Patch series "mm/damon/sysfs-schemes: fix use-after-free for [memcg_]path".
    
    Reads of 'memcg_path' and 'path' files in DAMON sysfs interface could race
    with their writes, results in use-after-free.  Fix those.
    
    
    This patch (of 2):
    
    damon_sysfs_scheme_filter->mmecg_path can be read and written by users,
    via DAMON sysfs memcg_path file.  It can also be indirectly read, for the
    parameters {on,off}line committing to DAMON.  The reads for parameters
    committing are protected by damon_sysfs_lock to avoid the sysfs files
    being destroyed while any of the parameters are being read.  But the
    user-driven direct reads and writes are not protected by any lock, while
    the write is deallocating the memcg_path-pointing buffer.  As a result,
    the readers could read the already freed buffer (user-after-free).  Note
    that the user-reads don't race when the same open file is used by the
    writer, due to kernfs's open file locking.  Nonetheless, doing the reads
    and writes with separate open files would be common.  Fix it by protecting
    both the user-direct reads and writes with damon_sysfs_lock.
    
    Link: https://lore.kernel.org/[email protected]
    Link: https://lore.kernel.org/[email protected]
    Fixes: 4f489fe6afb3 ("mm/damon/sysfs-schemes: free old damon_sysfs_scheme_filter->memcg_path on write")
    Co-developed-by: Junxi Qian <[email protected]>
    Signed-off-by: Junxi Qian <[email protected]>
    Signed-off-by: SeongJae Park <[email protected]>
    Cc: <[email protected]> # 6.16.x
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm/hugetlb_cma: round up per_node before logging it [+ + +]
Author: Sang-Heon Jeon <[email protected]>
Date:   Thu May 14 09:06:35 2026 -0400

    mm/hugetlb_cma: round up per_node before logging it
    
    [ Upstream commit 8f5ce56b76303c55b78a87af996e2e0f8535f979 ]
    
    When the user requests a total hugetlb CMA size without per-node
    specification, hugetlb_cma_reserve() computes per_node from
    hugetlb_cma_size and the number of nodes that have memory
    
            per_node = DIV_ROUND_UP(hugetlb_cma_size,
                                    nodes_weight(hugetlb_bootmem_nodes));
    
    The reservation loop later computes
    
            size = round_up(min(per_node, hugetlb_cma_size - reserved),
                              PAGE_SIZE << order);
    
    So the actually reserved per_node size is multiple of (PAGE_SIZE <<
    order), but the logged per_node is not rounded up, so it may be smaller
    than the actual reserved size.
    
    For example, as the existing comment describes, if a 3 GB area is
    requested on a machine with 4 NUMA nodes that have memory, 1 GB is
    allocated on the first three nodes, but the printed log is
    
            hugetlb_cma: reserve 3072 MiB, up to 768 MiB per node
    
    Round per_node up to (PAGE_SIZE << order) before logging so that the
    printed log always matches the actual reserved size.  No functional change
    to the actual reservation size, as the following case analysis shows
    
    1. remaining (hugetlb_cma_size - reserved) >= rounded per_node
     - AS-IS: min() picks unrounded per_node;
        round_up() returns rounded per_node
     - TO-BE: min() picks rounded per_node;
        round_up() returns rounded per_node (no-op)
    2. remaining < unrounded per_node
     - AS-IS: min() picks remaining;
        round_up() returns round_up(remaining)
     - TO-BE: min() picks remaining;
        round_up() returns round_up(remaining)
    3. unrounded per_node <= remaining < rounded per_node
     - AS-IS: min() picks unrounded per_node;
        round_up() returns rounded per_node
     - TO-BE: min() picks remaining;
        round_up() returns round_up(remaining) equals rounded per_node
    
    Link: https://lore.kernel.org/[email protected]
    Fixes: cf11e85fc08c ("mm: hugetlb: optionally allocate gigantic hugepages using cma") # 5.7
    Signed-off-by: Sang-Heon Jeon <[email protected]>
    Reviewed-by: Muchun Song <[email protected]>
    Cc: David Hildenbrand <[email protected]>
    Cc: Oscar Salvador <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    [ applied the single-line addition to mm/hugetlb.c since mm/hugetlb_cma.c didn't exist yet in 6.12 ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mmc: block: use single block write in retry [+ + +]
Author: Bin Liu <[email protected]>
Date:   Wed Mar 25 08:49:47 2026 -0500

    mmc: block: use single block write in retry
    
    commit c7c6d4f5103864f73ee3a78bfd6da241f84197dd upstream.
    
    Due to errata i2493[0], multi-block write would still fail in retries.
    
    With i2493, the MMC interface has the potential of write failures when
    issuing multi-block writes operating in HS200 mode with excessive IO
    supply noise.
    
    While the errata provides guidance in hardware design and layout to
    minimize the IO supply noise, in theory the write failure cannot be
    resolved in hardware. The software solution to ensure the data integrity
    is to add minimum 5us delay between block writes. Single-block write is
    the practical way to introduce the delay.
    
    This patch reuses recovery_mode flag, and switches to single-block
    write in retry when multi-block write fails. It covers both CQE and
    non-CQE cases.
    
    [0] https://www.ti.com/lit/pdf/sprz582
    Cc: [email protected]
    Suggested-by: Jens Axboe <[email protected]>
    Signed-off-by: Bin Liu <[email protected]>
    Signed-off-by: Ulf Hansson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mmc: core: Optimize time for secure erase/trim for some Kingston eMMCs [+ + +]
Author: Luke Wang <[email protected]>
Date:   Fri May 8 10:52:22 2026 -0400

    mmc: core: Optimize time for secure erase/trim for some Kingston eMMCs
    
    [ Upstream commit d6bf2e64dec87322f2b11565ddb59c0e967f96e3 ]
    
    Kingston eMMC IY2964 and IB2932 takes a fixed ~2 seconds for each secure
    erase/trim operation regardless of size - that is, a single secure
    erase/trim operation of 1MB takes the same time as 1GB. With default
    calculated 3.5MB max discard size, secure erase 1GB requires ~300 separate
    operations taking ~10 minutes total.
    
    Add a card quirk, MMC_QUIRK_FIXED_SECURE_ERASE_TRIM_TIME, to set maximum
    secure erase size for those devices. This allows 1GB secure erase to
    complete in a single operation, reducing time from 10 minutes to just 2
    seconds.
    
    Signed-off-by: Luke Wang <[email protected]>
    Cc: [email protected]
    Signed-off-by: Ulf Hansson <[email protected]>
    [ adapted `lim->max_secure_erase_sectors =` assignment to `blk_queue_max_secure_erase_sectors(q, ...)` setter and used pre-rename `mmc_can_secure_erase_trim`/`mmc_can_trim` helpers ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mmc: sdhci-of-dwcmshc: Disable clock before DLL configuration [+ + +]
Author: Shawn Lin <[email protected]>
Date:   Wed Apr 8 15:18:49 2026 +0800

    mmc: sdhci-of-dwcmshc: Disable clock before DLL configuration
    
    commit 6546a49bbe656981d99a389195560999058c89c4 upstream.
    
    According to the ASIC design recommendations, the clock must be
    disabled before operating the DLL to prevent glitches that could
    affect the internal digital logic. In extreme cases, failing to
    do so may cause the controller to malfunction completely.
    
    Adds a step to disable the clock before DLL configuration and
    re-enables it at the end.
    
    Fixes: 08f3dff799d4 ("mmc: sdhci-of-dwcmshc: add rockchip platform support")
    Cc: [email protected]
    Signed-off-by: Shawn Lin <[email protected]>
    Acked-by: Adrian Hunter <[email protected]>
    Signed-off-by: Ulf Hansson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mptcp: fastclose msk when linger time is 0 [+ + +]
Author: Matthieu Baerts (NGI0) <[email protected]>
Date:   Mon Apr 27 21:54:35 2026 +0200

    mptcp: fastclose msk when linger time is 0
    
    commit f14d6e9c3678a067f304abba561e0c5446c7e845 upstream.
    
    The SO_LINGER socket option has been supported for a while with MPTCP
    sockets [1], but it didn't cause the equivalent of a TCP reset as
    expected when enabled and its time was set to 0. This was causing some
    behavioural differences with TCP where some connections were not
    promptly stopped as expected.
    
    To fix that, an extra condition is checked at close() time before
    sending an MP_FASTCLOSE, the MPTCP equivalent of a TCP reset.
    
    Note that backporting up to [1] will be difficult as more changes are
    needed to be able to send MP_FASTCLOSE. It seems better to stop at [2],
    which was supposed to already imitate TCP.
    
    Validated with MPTCP packetdrill tests [3].
    
    Fixes: 268b12387460 ("mptcp: setsockopt: support SO_LINGER") [1]
    Fixes: d21f83485518 ("mptcp: use fastclose on more edge scenarios") [2]
    Cc: [email protected]
    Reported-by: Lance Tuller <[email protected]>
    Closes: https://github.com/lance0/xfr/pull/67
    Link: https://github.com/multipath-tcp/packetdrill/pull/196 [3]
    Reviewed-by: Mat Martineau <[email protected]>
    Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
    Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-3-7432b7f279fa@kernel.org
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mptcp: fix scheduling with atomic in timestamp sockopt [+ + +]
Author: Gang Yan <[email protected]>
Date:   Mon Apr 27 21:54:34 2026 +0200

    mptcp: fix scheduling with atomic in timestamp sockopt
    
    commit b5c52908d52c6c8eb8933264aa6087a0600fd892 upstream.
    
    Using lock_sock_fast() (atomic context) around sock_set_timestamp()
    and sock_set_timestamping() is unsafe, as both helpers can sleep.
    
    Replace lock_sock_fast() with sleepable lock_sock()/release_sock()
    to avoid scheduling while atomic panic.
    
    Fixes: 9061f24bf82e ("mptcp: sockopt: propagate timestamp request to subflows")
    Cc: [email protected]
    Reported-by: Sashiko <[email protected]>
    Closes: https://sashiko.dev/#/patchset/[email protected]
    Signed-off-by: Gang Yan <[email protected]>
    Reviewed-by: Matthieu Baerts (NGI0) <[email protected]>
    Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
    Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-2-7432b7f279fa@kernel.org
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mptcp: sockopt: set timestamp flags on subflow socket, not msk [+ + +]
Author: Gang Yan <[email protected]>
Date:   Mon Apr 27 21:54:33 2026 +0200

    mptcp: sockopt: set timestamp flags on subflow socket, not msk
    
    commit 5f95c21fc23a7ef22b4d27d1ed9bb55557ffb926 upstream.
    
    Both mptcp_setsockopt_sol_socket_tstamp() and
    mptcp_setsockopt_sol_socket_timestamping() iterate over subflows,
    acquire the subflow socket lock, but then erroneously pass the MPTCP
    msk socket to sock_set_timestamp() / sock_set_timestamping() instead
    of the subflow ssk. As a result, the timestamp flags are set on the
    wrong socket and have no effect on the actual subflows.
    
    Pass ssk instead of sk to both helpers.
    
    Fixes: 9061f24bf82e ("mptcp: sockopt: propagate timestamp request to subflows")
    Cc: [email protected]
    Signed-off-by: Gang Yan <[email protected]>
    Reviewed-by: Matthieu Baerts (NGI0) <[email protected]>
    Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
    Link: https://patch.msgid.link/20260427-net-mptcp-misc-fixes-7-1-rc2-v1-1-7432b7f279fa@kernel.org
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mptcp: use MPJoinSynAckHMacFailure for SynAck HMAC failure [+ + +]
Author: Shardul Bankar <[email protected]>
Date:   Fri May 1 21:35:34 2026 +0200

    mptcp: use MPJoinSynAckHMacFailure for SynAck HMAC failure
    
    commit c4a99a921949cddc590b22bb14eeb23dffcc3ba6 upstream.
    
    In subflow_finish_connect(), HMAC validation of the server's HMAC
    in SYN/ACK + MP_JOIN increments MPTCP_MIB_JOINACKMAC ("HMAC was
    wrong on ACK + MP_JOIN") on failure. The function processes the
    SYN/ACK, not the ACK; the matching MPTCP_MIB_JOINSYNACKMAC counter
    ("HMAC was wrong on SYN/ACK + MP_JOIN") exists but is not
    incremented anywhere in the tree.
    
    The mirror site on the server, subflow_syn_recv_sock(), already
    uses JOINACKMAC correctly for ACK HMAC failure. Use JOINSYNACKMAC
    at the SYN/ACK validation site so each counter reflects the packet
    whose HMAC actually failed.
    
    Suggested-by: Matthieu Baerts (NGI0) <[email protected]>
    Fixes: fc518953bc9c ("mptcp: add and use MIB counter infrastructure")
    Cc: [email protected]
    Signed-off-by: Shardul Bankar <[email protected]>
    Reviewed-by: Matthieu Baerts (NGI0) <[email protected]>
    Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
    Link: https://patch.msgid.link/20260501-net-mptcp-misc-fixes-7-1-rc3-v1-1-b70118df778e@kernel.org
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mptcp: use MPTCP_RST_EMPTCP for ACK HMAC validation failure [+ + +]
Author: Shardul Bankar <[email protected]>
Date:   Fri May 1 21:35:35 2026 +0200

    mptcp: use MPTCP_RST_EMPTCP for ACK HMAC validation failure
    
    commit a6da02d4c00fdda2417e42ad2b762a9209e6cc49 upstream.
    
    When HMAC validation fails on a received ACK + MP_JOIN in
    subflow_syn_recv_sock(), the subflow is reset with reason
    MPTCP_RST_EPROHIBIT ("Administratively prohibited"). This is
    incorrect: HMAC validation failure is an MPTCP protocol-level
    error, not an administrative policy denial.
    
    The mirror site on the client, in subflow_finish_connect(), already
    uses MPTCP_RST_EMPTCP ("MPTCP-specific error") for the same kind of
    HMAC failure on the SYN/ACK + MP_JOIN. Use the same reason on the
    server side for symmetry and accuracy.
    
    Suggested-by: Matthieu Baerts (NGI0) <[email protected]>
    Fixes: 443041deb5ef ("mptcp: fix NULL pointer in can_accept_new_subflow")
    Cc: [email protected]
    Signed-off-by: Shardul Bankar <[email protected]>
    Reviewed-by: Matthieu Baerts (NGI0) <[email protected]>
    Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
    Link: https://patch.msgid.link/20260501-net-mptcp-misc-fixes-7-1-rc3-v1-2-b70118df778e@kernel.org
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mtd: docg3: Convert to platform remove callback returning void [+ + +]
Author: Uwe Kleine-König <[email protected]>
Date:   Fri May 1 19:27:35 2026 -0400

    mtd: docg3: Convert to platform remove callback returning void
    
    [ Upstream commit eb0cec77d534413a800ec20944a2b1e37cfecdcf ]
    
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is ignored (apart
    from emitting a warning) and this typically results in resource leaks.
    
    To improve here there is a quest to make the remove callback return
    void. In the first step of this quest all drivers are converted to
    .remove_new(), which already returns void. Eventually after all drivers
    are converted, .remove_new() will be renamed to .remove().
    
    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.
    
    Signed-off-by: Uwe Kleine-König <[email protected]>
    Signed-off-by: Miquel Raynal <[email protected]>
    Acked-by: Tudor Ambarus <[email protected]>
    Link: https://lore.kernel.org/linux-mtd/[email protected]
    Stable-dep-of: ca19808bc6fa ("mtd: docg3: fix use-after-free in docg3_release()")
    Signed-off-by: Sasha Levin <[email protected]>

mtd: docg3: fix use-after-free in docg3_release() [+ + +]
Author: James Kim <[email protected]>
Date:   Fri May 1 19:27:36 2026 -0400

    mtd: docg3: fix use-after-free in docg3_release()
    
    [ Upstream commit ca19808bc6fac7e29420d8508df569b346b3e339 ]
    
    In docg3_release(), the docg3 pointer is obtained from
    cascade->floors[0]->priv before the loop that calls
    doc_release_device() on each floor. doc_release_device() frees the
    docg3 struct via kfree(docg3) at line 1881. After the loop,
    docg3->cascade->bch dereferences the already-freed pointer.
    
    Fix this by accessing cascade->bch directly, which is equivalent
    since docg3->cascade points back to the same cascade struct, and
    is already available as a local variable. This also removes the
    now-unused docg3 local variable.
    
    Fixes: c8ae3f744ddc ("lib/bch: Rework a little bit the exported function names")
    Cc: [email protected]
    Signed-off-by: James Kim <[email protected]>
    Signed-off-by: Miquel Raynal <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

mtd: spi-nor: debugfs: fix out-of-bounds read in spi_nor_params_show() [+ + +]
Author: Tudor Ambarus <[email protected]>
Date:   Fri Apr 17 15:24:39 2026 +0000

    mtd: spi-nor: debugfs: fix out-of-bounds read in spi_nor_params_show()
    
    commit e47029b977e747cb3a9174308fd55762cce70147 upstream.
    
    Sashiko noticed an out-of-bounds read [1].
    
    In spi_nor_params_show(), the snor_f_names array is passed to
    spi_nor_print_flags() using sizeof(snor_f_names).
    
    Since snor_f_names is an array of pointers, sizeof() returns the total
    number of bytes occupied by the pointers
            (element_count * sizeof(void *))
    rather than the element count itself. On 64-bit systems, this makes the
    passed length 8x larger than intended.
    
    Inside spi_nor_print_flags(), the 'names_len' argument is used to
    bounds-check the 'names' array access. An out-of-bounds read occurs
    if a flag bit is set that exceeds the array's actual element count
    but is within the inflated byte-size count.
    
    Correct this by using ARRAY_SIZE() to pass the actual number of
    string pointers in the array.
    
    Cc: [email protected]
    Fixes: 0257be79fc4a ("mtd: spi-nor: expose internal parameters via debugfs")
    Closes: https://sashiko.dev/#/patchset/20260417-die-erase-fix-v2-1-73bb7004ebad%40infineon.com [1]
    Signed-off-by: Tudor Ambarus <[email protected]>
    Reviewed-by: Takahiro Kuwano <[email protected]>
    Reviewed-by: Michael Walle <[email protected]>
    Reviewed-by: Pratyush Yadav <[email protected]>
    Signed-off-by: Miquel Raynal <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mtd: spi-nor: sst: Factor out common write operation to `sst_nor_write_data()` [+ + +]
Author: Bence Csókás <[email protected]>
Date:   Wed Jul 10 11:14:01 2024 +0200

    mtd: spi-nor: sst: Factor out common write operation to `sst_nor_write_data()`
    
    commit 18bcb4aa54eab75dce41e5c176a1c2bff94f0f79 upstream.
    
    Writing to the Flash in `sst_nor_write()` is a 3-step process:
    first an optional one-byte write to get 2-byte-aligned, then the
    bulk of the data is written out in vendor-specific 2-byte writes.
    Finally, if there's a byte left over, another one-byte write.
    This was implemented 3 times in the body of `sst_nor_write()`.
    To reduce code duplication, factor out these sub-steps to their
    own function.
    
    Signed-off-by: Csókás, Bence <[email protected]>
    Reviewed-by: Pratyush Yadav <[email protected]>
    [[email protected]: fixup whitespace, use %zu instead of %i in WARN()]
    Signed-off-by: Pratyush Yadav <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mtd: spi-nor: sst: Fix SST write failure [+ + +]
Author: Amit Kumar Mahapatra <[email protected]>
Date:   Thu Feb 13 11:15:46 2025 +0530

    mtd: spi-nor: sst: Fix SST write failure
    
    commit 539bd20352832b9244238a055eb169ccf1c41ff6 upstream.
    
    'commit 18bcb4aa54ea ("mtd: spi-nor: sst: Factor out common write operation
    to `sst_nor_write_data()`")' introduced a bug where only one byte of data
    is written, regardless of the number of bytes passed to
    sst_nor_write_data(), causing a kernel crash during the write operation.
    Ensure the correct number of bytes are written as passed to
    sst_nor_write_data().
    
    Call trace:
    [   57.400180] ------------[ cut here ]------------
    [   57.404842] While writing 2 byte written 1 bytes
    [   57.409493] WARNING: CPU: 0 PID: 737 at drivers/mtd/spi-nor/sst.c:187 sst_nor_write_data+0x6c/0x74
    [   57.418464] Modules linked in:
    [   57.421517] CPU: 0 UID: 0 PID: 737 Comm: mtd_debug Not tainted 6.12.0-g5ad04afd91f9 #30
    [   57.429517] Hardware name: Xilinx Versal A2197 Processor board revA - x-prc-02 revA (DT)
    [   57.437600] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [   57.444557] pc : sst_nor_write_data+0x6c/0x74
    [   57.448911] lr : sst_nor_write_data+0x6c/0x74
    [   57.453264] sp : ffff80008232bb40
    [   57.456570] x29: ffff80008232bb40 x28: 0000000000010000 x27: 0000000000000001
    [   57.463708] x26: 000000000000ffff x25: 0000000000000000 x24: 0000000000000000
    [   57.470843] x23: 0000000000010000 x22: ffff80008232bbf0 x21: ffff000816230000
    [   57.477978] x20: ffff0008056c0080 x19: 0000000000000002 x18: 0000000000000006
    [   57.485112] x17: 0000000000000000 x16: 0000000000000000 x15: ffff80008232b580
    [   57.492246] x14: 0000000000000000 x13: ffff8000816d1530 x12: 00000000000004a4
    [   57.499380] x11: 000000000000018c x10: ffff8000816fd530 x9 : ffff8000816d1530
    [   57.506515] x8 : 00000000fffff7ff x7 : ffff8000816fd530 x6 : 0000000000000001
    [   57.513649] x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000000
    [   57.520782] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0008049b0000
    [   57.527916] Call trace:
    [   57.530354]  sst_nor_write_data+0x6c/0x74
    [   57.534361]  sst_nor_write+0xb4/0x18c
    [   57.538019]  mtd_write_oob_std+0x7c/0x88
    [   57.541941]  mtd_write_oob+0x70/0xbc
    [   57.545511]  mtd_write+0x68/0xa8
    [   57.548733]  mtdchar_write+0x10c/0x290
    [   57.552477]  vfs_write+0xb4/0x3a8
    [   57.555791]  ksys_write+0x74/0x10c
    [   57.559189]  __arm64_sys_write+0x1c/0x28
    [   57.563109]  invoke_syscall+0x54/0x11c
    [   57.566856]  el0_svc_common.constprop.0+0xc0/0xe0
    [   57.571557]  do_el0_svc+0x1c/0x28
    [   57.574868]  el0_svc+0x30/0xcc
    [   57.577921]  el0t_64_sync_handler+0x120/0x12c
    [   57.582276]  el0t_64_sync+0x190/0x194
    [   57.585933] ---[ end trace 0000000000000000 ]---
    
    Cc: [email protected]
    Fixes: 18bcb4aa54ea ("mtd: spi-nor: sst: Factor out common write operation to `sst_nor_write_data()`")
    Signed-off-by: Amit Kumar Mahapatra <[email protected]>
    Reviewed-by: Pratyush Yadav <[email protected]>
    Reviewed-by: Tudor Ambarus <[email protected]>
    Reviewed-by: Bence Csókás <[email protected]>
    [[email protected]: add Cc stable tag]
    Signed-off-by: Pratyush Yadav <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mtd: spi-nor: sst: Fix write enable before AAI sequence [+ + +]
Author: Sanjaikumar V S <[email protected]>
Date:   Wed Mar 11 10:30:56 2026 +0000

    mtd: spi-nor: sst: Fix write enable before AAI sequence
    
    commit a0f64241d3566a49c0a9b33ba7ae458ae22003a9 upstream.
    
    When writing to SST flash starting at an odd address, a single byte is
    first programmed using the byte program (BP) command. After this
    operation completes, the flash hardware automatically clears the Write
    Enable Latch (WEL) bit.
    
    If an AAI (Auto Address Increment) word program sequence follows, it
    requires WEL to be set. Without re-enabling writes, the AAI sequence
    fails.
    
    Add spi_nor_write_enable() after the odd-address byte program when more
    data needs to be written. Use a local boolean for clarity.
    
    Fixes: b199489d37b2 ("mtd: spi-nor: add the framework for SPI NOR")
    Cc: [email protected]
    Signed-off-by: Sanjaikumar V S <[email protected]>
    Tested-by: Hendrik Donner <[email protected]>
    Reviewed-by: Hendrik Donner <[email protected]>
    Signed-off-by: Pratyush Yadav (Google) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
net/rds: handle zerocopy send cleanup before the message is queued [+ + +]
Author: Nan Li <[email protected]>
Date:   Fri May 1 09:08:44 2026 +0800

    net/rds: handle zerocopy send cleanup before the message is queued
    
    commit 44b550d88b267320459d518c0743a241ab2108fa upstream.
    
    A zerocopy send can fail after user pages have been pinned but before
    the message is attached to the sending socket.
    
    The purge path currently infers zerocopy state from rm->m_rs, so an
    unqueued message can be cleaned up as if it owned normal payload pages.
    However, zerocopy ownership is really determined by the presence of
    op_mmp_znotifier, regardless of whether the message has reached the
    socket queue.
    
    Capture op_mmp_znotifier up front in rds_message_purge() and use it as
    the cleanup discriminator. If the message is already associated with a
    socket, keep the existing completion path. Otherwise, drop the pinned
    page accounting directly and release the notifier before putting the
    payload pages.
    
    This keeps early send failure cleanup consistent with the zerocopy
    lifetime rules without changing the normal queued completion path.
    
    Fixes: 0cebaccef3ac ("rds: zerocopy Tx support.")
    Cc: [email protected]
    Reported-by: Yuan Tan <[email protected]>
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Reported-by: Xin Liu <[email protected]>
    Co-developed-by: Xiao Liu <[email protected]>
    Signed-off-by: Xiao Liu <[email protected]>
    Signed-off-by: Nan Li <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Reviewed-by: Allison Henderson <[email protected]>
    Link: https://patch.msgid.link/d2ea98a6313d5467bac00f7c9fef8c7acddb9258.1777550074.git.tonanli66@gmail.com
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
net/sched: sch_red: Replace direct dequeue call with peek and qdisc_dequeue_peeked [+ + +]
Author: Jamal Hadi Salim <[email protected]>
Date:   Thu Apr 30 11:29:55 2026 -0400

    net/sched: sch_red: Replace direct dequeue call with peek and qdisc_dequeue_peeked
    
    commit 458d5615272d3de535748342eb68ca492343048c upstream.
    
    When red qdisc has children (eg qfq qdisc) whose peek() callback is
    qdisc_peek_dequeued(), we could get a kernel panic. When the parent of such
    qdiscs (eg illustrated in patch #3 as tbf) wants to retrieve an skb from
    its child (red in this case), it will do the following:
     1a. do a peek() - and when sensing there's an skb the child can offer, then
         - the child in this case(red) calls its child's (qfq) peek.
            qfq does the right thing and will return the gso_skb queue packet.
            Note: if there wasnt a gso_skb entry then qfq will store it there.
     1b. invoke a dequeue() on the child (red). And herein lies the problem.
         - red will call the child's dequeue() which will essentially just
           try to grab something of qfq's queue.
    
    [   78.667668][  T363] KASAN: null-ptr-deref in range [0x0000000000000048-0x000000000000004f]
    [   78.667927][  T363] CPU: 1 UID: 0 PID: 363 Comm: ping Not tainted 7.1.0-rc1-00033-g46f74a3f7d57-dirty #790 PREEMPT(full)
    [   78.668263][  T363] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    [   78.668486][  T363] RIP: 0010:qfq_dequeue+0x446/0xc90 [sch_qfq]
    [   78.668718][  T363] Code: 54 c0 e8 dd 90 00 f1 48 c7 c7 e0 03 54 c0 48 89 de e8 ce 90 00 f1 48 8d 7b 48 b8 ff ff 37 00 48 89 fa 48 c1 e0 2a 48 c1 ea 03 <80> 3c 02 00 74 05 e8 ef a1 e1 f1 48 8b 7b 48 48 8d 54 24 58 48 8d
    [   78.669312][  T363] RSP: 0018:ffff88810de573e0 EFLAGS: 00010216
    [   78.669533][  T363] RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000
    [   78.669790][  T363] RDX: 0000000000000009 RSI: 0000000000000004 RDI: 0000000000000048
    [   78.670044][  T363] RBP: ffff888110dc4000 R08: ffffffffb1b0885a R09: fffffbfff6ba9078
    [   78.670297][  T363] R10: 0000000000000003 R11: ffff888110e31c80 R12: 0000001880000000
    [   78.670560][  T363] R13: ffff888110dc4150 R14: ffff888110dc42b8 R15: 0000000000000200
    [   78.670814][  T363] FS:  00007f66a8f09c40(0000) GS:ffff888163428000(0000) knlGS:0000000000000000
    [   78.671110][  T363] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [   78.671324][  T363] CR2: 000055db4c6a30a8 CR3: 000000010da67000 CR4: 0000000000750ef0
    [   78.671585][  T363] PKRU: 55555554
    [   78.671713][  T363] Call Trace:
    [   78.671843][  T363]  <TASK>
    [   78.671936][  T363]  ? __pfx_qfq_dequeue+0x10/0x10 [sch_qfq]
    [   78.672148][  T363]  ? __pfx__printk+0x10/0x10
    [   78.672322][  T363]  ? srso_alias_return_thunk+0x5/0xfbef5
    [   78.672496][  T363]  ? lockdep_hardirqs_on_prepare+0xa8/0x1a0
    [   78.672706][  T363]  ? srso_alias_return_thunk+0x5/0xfbef5
    [   78.672875][  T363]  ? trace_hardirqs_on+0x19/0x1a0
    [   78.673047][  T363]  red_dequeue+0x65/0x270 [sch_red]
    [   78.673217][  T363]  ? srso_alias_return_thunk+0x5/0xfbef5
    [   78.673385][  T363]  tbf_dequeue.cold+0xb0/0x70c [sch_tbf]
    [   78.673566][  T363]  __qdisc_run+0x169/0x1900
    
    The right thing to do in #1b is to grab the skb off gso_skb queue.
    This patchset fixes that issue by changing #1b to use qdisc_dequeue_peeked()
    method instead.
    
    Fixes: 77be155cba4e ("pkt_sched: Add peek emulation for non-work-conserving qdiscs.")
    Reported-by: Manas <[email protected]>
    Reported-by: Rakshit Awasthi <[email protected]>
    Signed-off-by: Jamal Hadi Salim <[email protected]>
    Reviewed-by: Eric Dumazet <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
net/smc: avoid early lgr access in smc_clc_wait_msg [+ + +]
Author: Ruijie Li <[email protected]>
Date:   Wed Apr 22 23:40:18 2026 +0800

    net/smc: avoid early lgr access in smc_clc_wait_msg
    
    commit 5a8db80f721deee8e916c2cfdee78decda02ce4f upstream.
    
    A CLC decline can be received while the handshake is still in an early
    stage, before the connection has been associated with a link group.
    
    The decline handling in smc_clc_wait_msg() updates link-group level sync
    state for first-contact declines, but that state only exists after link
    group setup has completed. Guard the link-group update accordingly and
    keep the per-socket peer diagnosis handling unchanged.
    
    This preserves the existing sync_err handling for established link-group
    contexts and avoids touching link-group state before it is available.
    
    Fixes: 0cfdd8f92cac ("smc: connection and link group creation")
    Cc: [email protected]
    Reported-by: Yuan Tan <[email protected]>
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Reported-by: Xin Liu <[email protected]>
    Signed-off-by: Ruijie Li <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Reviewed-by: Dust Li <[email protected]>
    Link: https://patch.msgid.link/08c68a5c817acf198cce63d22517e232e8d60718.1776850759.git.ruijieli51@gmail.com
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
net: bridge: use a stable FDB dst snapshot in RCU readers [+ + +]
Author: Zhengchuan Liang <[email protected]>
Date:   Mon May 4 03:47:18 2026 -0400

    net: bridge: use a stable FDB dst snapshot in RCU readers
    
    [ Upstream commit df4601653201de21b487c3e7fffd464790cab808 ]
    
    Local FDB entries can be rewritten in place by `fdb_delete_local()`, which
    updates `f->dst` to another port or to `NULL` while keeping the entry
    alive. Several bridge RCU readers inspect `f->dst`, including
    `br_fdb_fillbuf()` through the `brforward_read()` sysfs path.
    
    These readers currently load `f->dst` multiple times and can therefore
    observe inconsistent values across the check and later dereference.
    In `br_fdb_fillbuf()`, this means a concurrent local-FDB update can change
    `f->dst` after the NULL check and before the `port_no` dereference,
    leading to a NULL-ptr-deref.
    
    Fix this by taking a single `READ_ONCE()` snapshot of `f->dst` in each
    affected RCU reader and using that snapshot for the rest of the access
    sequence. Also publish the in-place `f->dst` updates in `fdb_delete_local()`
    with `WRITE_ONCE()` so the readers and writer use matching access patterns.
    
    Fixes: 960b589f86c7 ("bridge: Properly check if local fdb entry can be deleted in br_fdb_change_mac_address")
    Cc: [email protected]
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Co-developed-by: Yuan Tan <[email protected]>
    Signed-off-by: Yuan Tan <[email protected]>
    Suggested-by: Xin Liu <[email protected]>
    Tested-by: Ren Wei <[email protected]>
    Signed-off-by: Zhengchuan Liang <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Reviewed-by: Ido Schimmel <[email protected]>
    Acked-by: Nikolay Aleksandrov <[email protected]>
    Link: https://patch.msgid.link/6570fabb85ecadb8baaf019efe856f407711c7b9.1776043229.git.zcliangcn@gmail.com
    Signed-off-by: Paolo Abeni <[email protected]>
    [ kept `*idx < cb->args[2]` instead of `*idx < ctx->fdb_idx` ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: caif: clear client service pointer on teardown [+ + +]
Author: Zhengchuan Liang <[email protected]>
Date:   Sat Apr 11 23:10:26 2026 +0800

    net: caif: clear client service pointer on teardown
    
    commit f7cf8ece8cee3c1ee361991470cdb1eb65ab02e8 upstream.
    
    `caif_connect()` can tear down an existing client after remote shutdown by
    calling `caif_disconnect_client()` followed by `caif_free_client()`.
    `caif_free_client()` releases the service layer referenced by
    `adap_layer->dn`, but leaves that pointer stale.
    
    When the socket is later destroyed, `caif_sock_destructor()` calls
    `caif_free_client()` again and dereferences the freed service pointer.
    
    Clear the client/service links before releasing the service object so
    repeated teardown becomes harmless.
    
    Fixes: 43e369210108 ("caif: Move refcount from service layer to sock and dev.")
    Cc: [email protected]
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Co-developed-by: Yuan Tan <[email protected]>
    Signed-off-by: Yuan Tan <[email protected]>
    Suggested-by: Xin Liu <[email protected]>
    Tested-by: Ren Wei <[email protected]>
    Signed-off-by: Zhengchuan Liang <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Link: https://patch.msgid.link/9f3d37847c0037568aae698ca23cd47c6691acb0.1775897577.git.zcliangcn@gmail.com
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: Fix icmp host relookup triggering ip_rt_bug [+ + +]
Author: Dong Chenchen <[email protected]>
Date:   Wed May 6 09:21:15 2026 +0800

    net: Fix icmp host relookup triggering ip_rt_bug
    
    [ Upstream commit c44daa7e3c73229f7ac74985acb8c7fb909c4e0a ]
    
    arp link failure may trigger ip_rt_bug while xfrm enabled, call trace is:
    
    WARNING: CPU: 0 PID: 0 at net/ipv4/route.c:1241 ip_rt_bug+0x14/0x20
    Modules linked in:
    CPU: 0 UID: 0 PID: 0 Comm: swapper/0 Not tainted 6.12.0-rc6-00077-g2e1b3cc9d7f7
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
    BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
    RIP: 0010:ip_rt_bug+0x14/0x20
    Call Trace:
     <IRQ>
     ip_send_skb+0x14/0x40
     __icmp_send+0x42d/0x6a0
     ipv4_link_failure+0xe2/0x1d0
     arp_error_report+0x3c/0x50
     neigh_invalidate+0x8d/0x100
     neigh_timer_handler+0x2e1/0x330
     call_timer_fn+0x21/0x120
     __run_timer_base.part.0+0x1c9/0x270
     run_timer_softirq+0x4c/0x80
     handle_softirqs+0xac/0x280
     irq_exit_rcu+0x62/0x80
     sysvec_apic_timer_interrupt+0x77/0x90
    
    The script below reproduces this scenario:
    ip xfrm policy add src 0.0.0.0/0 dst 0.0.0.0/0 \
            dir out priority 0 ptype main flag localok icmp
    ip l a veth1 type veth
    ip a a 192.168.141.111/24 dev veth0
    ip l s veth0 up
    ping 192.168.141.155 -c 1
    
    icmp_route_lookup() create input routes for locally generated packets
    while xfrm relookup ICMP traffic.Then it will set input route
    (dst->out = ip_rt_bug) to skb for DESTUNREACH.
    
    For ICMP err triggered by locally generated packets, dst->dev of output
    route is loopback. Generally, xfrm relookup verification is not required
    on loopback interfaces (net.ipv4.conf.lo.disable_xfrm = 1).
    
    Skip icmp relookup for locally generated packets to fix it.
    
    Fixes: 8b7817f3a959 ("[IPSEC]: Add ICMP host relookup support")
    Signed-off-by: Dong Chenchen <[email protected]>
    Reviewed-by: David Ahern <[email protected]>
    Reviewed-by: Eric Dumazet <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Jiayuan Chen <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: ipv4: stop checking crypto_ahash_alignmask [+ + +]
Author: Eric Biggers <[email protected]>
Date:   Wed May 13 12:46:33 2026 -0400

    net: ipv4: stop checking crypto_ahash_alignmask
    
    [ Upstream commit e77f5dd701381cef35b9ea8b6dea6e62c8a7f9f3 ]
    
    Now that the alignmask for ahash and shash algorithms is always 0,
    crypto_ahash_alignmask() always returns 0 and will be removed.  In
    preparation for this, stop checking crypto_ahash_alignmask() in ah4.c.
    
    Signed-off-by: Eric Biggers <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Stable-dep-of: ec54093e6a8f ("xfrm: ah: account for ESN high bits in async callbacks")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: ipv6: fix NOREF dst use in seg6 and rpl lwtunnels [+ + +]
Author: Andrea Mayer <[email protected]>
Date:   Tue Apr 21 11:47:35 2026 +0200

    net: ipv6: fix NOREF dst use in seg6 and rpl lwtunnels
    
    commit f9c52a6ba9780bd27e0bf4c044fd91c13c778b6e upstream.
    
    seg6_input_core() and rpl_input() call ip6_route_input() which sets a
    NOREF dst on the skb, then pass it to dst_cache_set_ip6() invoking
    dst_hold() unconditionally.
    On PREEMPT_RT, ksoftirqd is preemptible and a higher-priority task can
    release the underlying pcpu_rt between the lookup and the caching
    through a concurrent FIB lookup on a shared nexthop.
    Simplified race sequence:
    
      ksoftirqd/X                       higher-prio task (same CPU X)
      -----------                       --------------------------------
      seg6_input_core(,skb)/rpl_input(skb)
        dst_cache_get()
          -> miss
        ip6_route_input(skb)
          -> ip6_pol_route(,skb,flags)
             [RT6_LOOKUP_F_DST_NOREF in flags]
            -> FIB lookup resolves fib6_nh
               [nhid=N route]
            -> rt6_make_pcpu_route()
               [creates pcpu_rt, refcount=1]
                 pcpu_rt->sernum = fib6_sernum
                 [fib6_sernum=W]
               -> cmpxchg(fib6_nh.rt6i_pcpu,
                          NULL, pcpu_rt)
                  [slot was empty, store succeeds]
          -> skb_dst_set_noref(skb, dst)
             [dst is pcpu_rt, refcount still 1]
    
                                        rt_genid_bump_ipv6()
                                          -> bumps fib6_sernum
                                             [fib6_sernum from W to Z]
                                        ip6_route_output()
                                          -> ip6_pol_route()
                                            -> FIB lookup resolves fib6_nh
                                               [nhid=N]
                                            -> rt6_get_pcpu_route()
                                                 pcpu_rt->sernum != fib6_sernum
                                                 [W <> Z, stale]
                                              -> prev = xchg(rt6i_pcpu, NULL)
                                              -> dst_release(prev)
                                                 [prev is pcpu_rt,
                                                  refcount 1->0, dead]
    
        dst = skb_dst(skb)
        [dst is the dead pcpu_rt]
        dst_cache_set_ip6(dst)
          -> dst_hold() on dead dst
          -> WARN / use-after-free
    
    For the race to occur, ksoftirqd must be preemptible (PREEMPT_RT without
    PREEMPT_RT_NEEDS_BH_LOCK) and a concurrent task must be able to release
    the pcpu_rt. Shared nexthop objects provide such a path, as two routes
    pointing to the same nhid share the same fib6_nh and its rt6i_pcpu
    entry.
    
    Fix seg6_input_core() and rpl_input() by calling skb_dst_force() after
    ip6_route_input() to force the NOREF dst into a refcounted one before
    caching.
    The output path is not affected as ip6_route_output() already returns a
    refcounted dst.
    
    Fixes: af4a2209b134 ("ipv6: sr: use dst_cache in seg6_input")
    Fixes: a7a29f9c361f ("net: ipv6: add rpl sr tunnel")
    Cc: [email protected]
    Signed-off-by: Andrea Mayer <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Reviewed-by: Justin Iurman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: ipv6: stop checking crypto_ahash_alignmask [+ + +]
Author: Eric Biggers <[email protected]>
Date:   Wed May 13 12:46:34 2026 -0400

    net: ipv6: stop checking crypto_ahash_alignmask
    
    [ Upstream commit 0a6bfaa0e695facb072f2fedfb55df37c4483b50 ]
    
    Now that the alignmask for ahash and shash algorithms is always 0,
    crypto_ahash_alignmask() always returns 0 and will be removed.  In
    preparation for this, stop checking crypto_ahash_alignmask() in ah6.c.
    
    Signed-off-by: Eric Biggers <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Stable-dep-of: ec54093e6a8f ("xfrm: ah: account for ESN high bits in async callbacks")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: ks8851: Avoid excess softirq scheduling [+ + +]
Author: Marek Vasut <[email protected]>
Date:   Thu Apr 16 01:09:45 2026 +0200

    net: ks8851: Avoid excess softirq scheduling
    
    commit 22230e68b2cf1ab6b027be8cf1198164a949c4fa upstream.
    
    The code injects a packet into netif_rx() repeatedly, which will add
    it to its internal NAPI and schedule a softirq, and process it. It is
    more efficient to queue multiple packets and process them all at the
    local_bh_enable() time.
    
    Reviewed-by: Sebastian Andrzej Siewior <[email protected]>
    Fixes: e0863634bf9f ("net: ks8851: Queue RX packets in IRQ handler instead of disabling BHs")
    Cc: [email protected]
    Signed-off-by: Marek Vasut <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: ks8851: Reinstate disabling of BHs around IRQ handler [+ + +]
Author: Marek Vasut <[email protected]>
Date:   Thu Apr 16 01:09:44 2026 +0200

    net: ks8851: Reinstate disabling of BHs around IRQ handler
    
    commit 5c9fcac3c872224316714d0d8914d9af16c76a6d upstream.
    
    If the driver executes ks8851_irq() AND a TX packet has been sent, then
    the driver enables TX queue via netif_wake_queue() which schedules TX
    softirq to queue packets for this device.
    
    If CONFIG_PREEMPT_RT=y is set AND a packet has also been received by
    the MAC, then ks8851_rx_pkts() calls netdev_alloc_skb_ip_align() to
    allocate SKBs for the received packets. If netdev_alloc_skb_ip_align()
    is called with BH enabled, then local_bh_enable() at the end of
    netdev_alloc_skb_ip_align() will trigger the pending softirq processing,
    which may ultimately call the .xmit callback ks8851_start_xmit_par().
    The ks8851_start_xmit_par() will try to lock struct ks8851_net_par
    .lock spinlock, which is already locked by ks8851_irq() from which
    ks8851_start_xmit_par() was called. This leads to a deadlock, which
    is reported by the kernel, including a trace listed below.
    
    If CONFIG_PREEMPT_RT is not set, then since commit 0913ec336a6c0
    ("net: ks8851: Fix deadlock with the SPI chip variant") the deadlock
    can also be triggered without received packet in the RX FIFO. The
    pending softirqs will be processed on return from
    spin_unlock_bh(&ks->statelock) in ks8851_irq(), which triggers the
    deadlock as well.
    
    Fix the problem by disabling BH around critical sections, including the
    IRQ handler, thus preventing the net_tx_action() softirq from triggering
    during these critical sections. The net_tx_action() softirq is triggered
    once BH are re-enabled and at the end of the IRQ handler, once all the
    other IRQ handler actions have been completed.
    
     __schedule from schedule_rtlock+0x1c/0x34
     schedule_rtlock from rtlock_slowlock_locked+0x548/0x904
     rtlock_slowlock_locked from rt_spin_lock+0x60/0x9c
     rt_spin_lock from ks8851_start_xmit_par+0x74/0x1a8
     ks8851_start_xmit_par from netdev_start_xmit+0x20/0x44
     netdev_start_xmit from dev_hard_start_xmit+0xd0/0x188
     dev_hard_start_xmit from sch_direct_xmit+0xb8/0x25c
     sch_direct_xmit from __qdisc_run+0x1f8/0x4ec
     __qdisc_run from qdisc_run+0x1c/0x28
     qdisc_run from net_tx_action+0x1f0/0x268
     net_tx_action from handle_softirqs+0x1a4/0x270
     handle_softirqs from __local_bh_enable_ip+0xcc/0xe0
     __local_bh_enable_ip from __alloc_skb+0xd8/0x128
     __alloc_skb from __netdev_alloc_skb+0x3c/0x19c
     __netdev_alloc_skb from ks8851_irq+0x388/0x4d4
     ks8851_irq from irq_thread_fn+0x24/0x64
     irq_thread_fn from irq_thread+0x178/0x28c
     irq_thread from kthread+0x12c/0x138
     kthread from ret_from_fork+0x14/0x28
    
    Reviewed-by: Sebastian Andrzej Siewior <[email protected]>
    Fixes: e0863634bf9f ("net: ks8851: Queue RX packets in IRQ handler instead of disabling BHs")
    Cc: [email protected]
    Signed-off-by: Marek Vasut <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: libwx: fix VF illegal register access [+ + +]
Author: Jiawen Wu <[email protected]>
Date:   Wed Apr 29 16:37:42 2026 +0800

    net: libwx: fix VF illegal register access
    
    commit 694de316f607fe2473d52ca0707e3918e72c1562 upstream.
    
    Register WX_CFG_PORT_ST is a PF restricted register. When a VF is
    initialized, attempting to read this register triggers an illegal
    register access, which lead to a system hang.
    
    When the device is VF, the bus function ID can be obtained directly from
    the PCI_FUNC(pdev->devfn).
    
    Fixes: a04ea57aae37 ("net: libwx: fix device bus LAN ID")
    Cc: [email protected]
    Signed-off-by: Jiawen Wu <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: mctp: fix don't require received header reserved bits to be zero [+ + +]
Author: Yuan Zhaoming <[email protected]>
Date:   Mon May 4 04:08:48 2026 -0400

    net: mctp: fix don't require received header reserved bits to be zero
    
    [ Upstream commit a663bac71a2f0b3ac6c373168ca57b2a6e6381aa ]
    
    >From the MCTP Base specification (DSP0236 v1.2.1), the first byte of
    the MCTP header contains a 4 bit reserved field, and 4 bit version.
    
    On our current receive path, we require those 4 reserved bits to be
    zero, but the 9500-8i card is non-conformant, and may set these
    reserved bits.
    
    DSP0236 states that the reserved bits must be written as zero, and
    ignored when read. While the device might not conform to the former,
    we should accept these message to conform to the latter.
    
    Relax our check on the MCTP version byte to allow non-zero bits in the
    reserved field.
    
    Fixes: 889b7da23abf ("mctp: Add initial routing framework")
    Signed-off-by: Yuan Zhaoming <[email protected]>
    Cc: [email protected]
    Acked-by: Jeremy Kerr <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    [ Context ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: qrtr: ns: Fix use-after-free in driver remove() [+ + +]
Author: Manivannan Sadhasivam <[email protected]>
Date:   Thu Apr 9 23:04:16 2026 +0530

    net: qrtr: ns: Fix use-after-free in driver remove()
    
    commit 7809fea20c9404bfcfa6112ec08d1fe1d3520beb upstream.
    
    In the remove callback, if a packet arrives after destroy_workqueue() is
    called, but before sock_release(), the qrtr_ns_data_ready() callback will
    try to queue the work, causing use-after-free issue.
    
    Fix this issue by saving the default 'sk_data_ready' callback during
    qrtr_ns_init() and use it to replace the qrtr_ns_data_ready() callback at
    the start of remove(). This ensures that even if a packet arrives after
    destroy_workqueue(), the work struct will not be dereferenced.
    
    Note that it is also required to ensure that the RX threads are completed
    before destroying the workqueue, because the threads could be using the
    qrtr_ns_data_ready() callback.
    
    Cc: [email protected]
    Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace")
    Signed-off-by: Manivannan Sadhasivam <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: qrtr: ns: Free the node during ctrl_cmd_bye() [+ + +]
Author: Manivannan Sadhasivam <[email protected]>
Date:   Thu Apr 9 23:04:14 2026 +0530

    net: qrtr: ns: Free the node during ctrl_cmd_bye()
    
    commit 68efba36446a7774ea5b971257ade049272a07ac upstream.
    
    A node sends the BYE packet when it is about to go down. So the nameserver
    should advertise the removal of the node to all remote and local observers
    and free the node finally. But currently, the nameserver doesn't free the
    node memory even after processing the BYE packet. This causes the node
    memory to leak.
    
    Hence, remove the node from Xarray list and free the node memory during
    both success and failure case of ctrl_cmd_bye().
    
    Cc: [email protected]
    Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace")
    Signed-off-by: Manivannan Sadhasivam <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: qrtr: ns: Limit the maximum number of lookups [+ + +]
Author: Manivannan Sadhasivam <[email protected]>
Date:   Mon May 4 00:11:11 2026 -0400

    net: qrtr: ns: Limit the maximum number of lookups
    
    [ Upstream commit 5640227d9a21c6a8be249a10677b832e7f40dc55 ]
    
    Current code does no bound checking on the number of lookups a client can
    perform. Though the code restricts the lookups to local clients, there is
    still a possibility of a malicious local client sending a flood of
    NEW_LOOKUP messages over the same socket.
    
    Fix this issue by limiting the maximum number of lookups to 64 globally.
    Since the nameserver allows only atmost one local observer, this global
    lookup count will ensure that the lookups stay within the limit.
    
    Note that, limit of 64 is chosen based on the current platform
    requirements. If requirement changes in the future, this limit can be
    increased.
    
    Cc: [email protected]
    Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace")
    Signed-off-by: Manivannan Sadhasivam <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    [ adapted comment block to only mention QRTR_NS_MAX_LOOKUPS and kept kzalloc() instead of kzalloc_obj() due to missing prerequisite commits ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: qrtr: ns: Limit the maximum server registration per node [+ + +]
Author: Manivannan Sadhasivam <[email protected]>
Date:   Mon May 4 00:11:15 2026 -0400

    net: qrtr: ns: Limit the maximum server registration per node
    
    [ Upstream commit d5ee2ff98322337951c56398e79d51815acbf955 ]
    
    Current code does no bound checking on the number of servers added per
    node. A malicious client can flood NEW_SERVER messages and exhaust memory.
    
    Fix this issue by limiting the maximum number of server registrations to
    256 per node. If the NEW_SERVER message is received for an old port, then
    don't restrict it as it will get replaced. While at it, also rate limit
    the error messages in the failure path of qrtr_ns_worker().
    
    Note that the limit of 256 is chosen based on the current platform
    requirements. If requirement changes in the future, this limit can be
    increased.
    
    Cc: [email protected]
    Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace")
    Reported-by: Yiming Qian <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Signed-off-by: Manivannan Sadhasivam <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: qrtr: ns: Limit the total number of nodes [+ + +]
Author: Manivannan Sadhasivam <[email protected]>
Date:   Mon May 4 04:22:33 2026 -0400

    net: qrtr: ns: Limit the total number of nodes
    
    [ Upstream commit 27d5e84e810b0849d08b9aec68e48570461ce313 ]
    
    Currently, the nameserver doesn't limit the number of nodes it handles.
    This can be an attack vector if a malicious client starts registering
    random nodes, leading to memory exhaustion.
    
    Hence, limit the maximum number of nodes to 64. Note that, limit of 64 is
    chosen based on the current platform requirements. If requirement changes
    in the future, this limit can be increased.
    
    Cc: [email protected]
    Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace")
    Signed-off-by: Manivannan Sadhasivam <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    [ dropped comment/define changes for missing QRTR_NS_MAX_SERVERS/LOOKUPS prereqs and kept plain kzalloc instead of kzalloc_obj ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: rds: fix MR cleanup on copy error [+ + +]
Author: Ao Zhou <[email protected]>
Date:   Wed Apr 22 22:52:07 2026 +0800

    net: rds: fix MR cleanup on copy error
    
    commit 8141a2dc70080eda1aedc0389ed2db2b292af5bd upstream.
    
    __rds_rdma_map() hands sg/pages ownership to the transport after
    get_mr() succeeds. If copying the generated cookie back to user space
    fails after that point, the error path must not free those resources
    again before dropping the MR reference.
    
    Remove the duplicate unpin/free from the put_user() failure branch so
    that MR teardown is handled only through the existing final cleanup
    path.
    
    Fixes: 0d4597c8c5ab ("net/rds: Track user mapped pages through special API")
    Cc: [email protected]
    Reported-by: Yuan Tan <[email protected]>
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Reported-by: Xin Liu <[email protected]>
    Signed-off-by: Ao Zhou <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Reviewed-by: Allison Henderson <[email protected]>
    Link: https://patch.msgid.link/79c8ef73ec8e5844d71038983940cc2943099baf.1776764247.git.draw51280@163.com
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: rtnetlink: zero ifla_vf_broadcast to avoid stack infoleak in rtnl_fill_vfinfo [+ + +]
Author: Kai Zen <[email protected]>
Date:   Thu Apr 30 18:26:48 2026 +0300

    net: rtnetlink: zero ifla_vf_broadcast to avoid stack infoleak in rtnl_fill_vfinfo
    
    commit 4b9e327991815e128ad3af75c3a04630a63ce3e0 upstream.
    
    rtnl_fill_vfinfo() declares struct ifla_vf_broadcast on the stack
    without initialisation:
    
            struct ifla_vf_broadcast vf_broadcast;
    
    The struct contains a single fixed 32-byte field:
    
            /* include/uapi/linux/if_link.h */
            struct ifla_vf_broadcast {
                    __u8 broadcast[32];
            };
    
    The function then copies dev->broadcast into it using dev->addr_len
    as the length:
    
            memcpy(vf_broadcast.broadcast, dev->broadcast, dev->addr_len);
    
    On Ethernet devices (the overwhelming majority of SR-IOV NICs)
    dev->addr_len is 6, so only the first 6 bytes of broadcast[] are
    written. The remaining 26 bytes retain whatever was previously on
    the kernel stack. The full struct is then handed to userspace via:
    
            nla_put(skb, IFLA_VF_BROADCAST,
                    sizeof(vf_broadcast), &vf_broadcast)
    
    leaking up to 26 bytes of uninitialised kernel stack per VF per
    RTM_GETLINK request, repeatable.
    
    The other vf_* structs in the same function are explicitly zeroed
    for exactly this reason - see the memset() calls for ivi,
    vf_vlan_info, node_guid and port_guid a few lines above.
    vf_broadcast was simply missed when it was added.
    
    Reachability: any unprivileged local process can open AF_NETLINK /
    NETLINK_ROUTE without capabilities and send RTM_GETLINK with an
    IFLA_EXT_MASK attribute carrying RTEXT_FILTER_VF. The kernel walks
    each VF and emits IFLA_VF_BROADCAST, leaking 26 bytes of stack per
    VF per request. Stack residue at this call site can include return
    addresses and transient sensitive data; KASAN with stack
    instrumentation, or KMSAN, will flag the nla_put() when reproduced.
    
    Zero the on-stack struct before the partial memcpy, matching the
    existing pattern used for the other vf_* structs in the same
    function.
    
    Fixes: 75345f888f70 ("ipoib: show VF broadcast address")
    Cc: [email protected]
    Signed-off-by: Kai Zen <[email protected]>
    Link: https://patch.msgid.link/3c506e8f936e52b57620269b55c348af05d413a2.1777557228.git.kai.aizen.dev@gmail.com
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: stmmac: avoid shadowing global buf_sz [+ + +]
Author: Russell King (Oracle) <[email protected]>
Date:   Sun May 10 11:10:17 2026 -0400

    net: stmmac: avoid shadowing global buf_sz
    
    [ Upstream commit 876cfb20e8892143c0c967b3657074f9131f9b5f ]
    
    stmmac_rx() declares a local variable named "buf_sz" but there is also
    a global variable for a module parameter which is called the same. To
    avoid confusion, rename the local variable.
    
    Signed-off-by: Russell King (Oracle) <[email protected]>
    Reviewed-by: Furong Xu <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Stable-dep-of: 0bb05e6adfa9 ("net: stmmac: Prevent NULL deref when RX memory exhausted")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: stmmac: Prevent NULL deref when RX memory exhausted [+ + +]
Author: Sam Edwards <[email protected]>
Date:   Sun May 10 11:10:19 2026 -0400

    net: stmmac: Prevent NULL deref when RX memory exhausted
    
    [ Upstream commit 0bb05e6adfa99a2ea1fee1125cc0953409f83ed8 ]
    
    The CPU receives frames from the MAC through conventional DMA: the CPU
    allocates buffers for the MAC, then the MAC fills them and returns
    ownership to the CPU. For each hardware RX queue, the CPU and MAC
    coordinate through a shared ring array of DMA descriptors: one
    descriptor per DMA buffer. Each descriptor includes the buffer's
    physical address and a status flag ("OWN") indicating which side owns
    the buffer: OWN=0 for CPU, OWN=1 for MAC. The CPU is only allowed to set
    the flag and the MAC is only allowed to clear it, and both must move
    through the ring in sequence: thus the ring is used for both
    "submissions" and "completions."
    
    In the stmmac driver, stmmac_rx() bookmarks its position in the ring
    with the `cur_rx` index. The main receive loop in that function checks
    for rx_descs[cur_rx].own=0, gives the corresponding buffer to the
    network stack (NULLing the pointer), and increments `cur_rx` modulo the
    ring size. After the loop exits, stmmac_rx_refill(), which bookmarks its
    position with `dirty_rx`, allocates fresh buffers and rearms the
    descriptors (setting OWN=1). If it fails any allocation, it simply stops
    early (leaving OWN=0) and will retry where it left off when next called.
    
    This means descriptors have a three-stage lifecycle (terms my own):
    - `empty` (OWN=1, buffer valid)
    - `full` (OWN=0, buffer valid and populated)
    - `dirty` (OWN=0, buffer NULL)
    
    But because stmmac_rx() only checks OWN, it confuses `full`/`dirty`. In
    the past (see 'Fixes:'), there was a bug where the loop could cycle
    `cur_rx` all the way back to the first descriptor it dirtied, resulting
    in a NULL dereference when mistaken for `full`. The aforementioned
    commit resolved that *specific* failure by capping the loop's iteration
    limit at `dma_rx_size - 1`, but this is only a partial fix: if the
    previous stmmac_rx_refill() didn't complete, then there are leftover
    `dirty` descriptors that the loop might encounter without needing to
    cycle fully around. The current code therefore panics (see 'Closes:')
    when stmmac_rx_refill() is memory-starved long enough for `cur_rx` to
    catch up to `dirty_rx`.
    
    Fix this by explicitly checking, before advancing `cur_rx`, if the next
    entry is dirty; exit the loop if so. This prevents processing of the
    final, used descriptor until stmmac_rx_refill() succeeds, but
    fully prevents the `cur_rx == dirty_rx` ambiguity as the previous bugfix
    intended: so remove the clamp as well. Since stmmac_rx_zc() is a
    copy-paste-and-tweak of stmmac_rx() and the code structure is identical,
    any fix to stmmac_rx() will also need a corresponding fix for
    stmmac_rx_zc(). Therefore, apply the same check there.
    
    In stmmac_rx() (not stmmac_rx_zc()), a related bug remains: after the
    MAC sets OWN=0 on the final descriptor, it will be unable to send any
    further DMA-complete IRQs until it's given more `empty` descriptors.
    Currently, the driver simply *hopes* that the next stmmac_rx_refill()
    succeeds, risking an indefinite stall of the receive process if not. But
    this is not a regression, so it can be addressed in a future change.
    
    Fixes: b6cb4541853c7 ("net: stmmac: avoid rx queue overrun")
    Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221010
    Cc: [email protected]
    Suggested-by: Russell King <[email protected]>
    Signed-off-by: Sam Edwards <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: stmmac: rename STMMAC_GET_ENTRY() -> STMMAC_NEXT_ENTRY() [+ + +]
Author: Russell King (Oracle) <[email protected]>
Date:   Sun May 10 11:10:18 2026 -0400

    net: stmmac: rename STMMAC_GET_ENTRY() -> STMMAC_NEXT_ENTRY()
    
    [ Upstream commit 6b4286e0550814cdc4b897f881ec1fa8b0313227 ]
    
    STMMAC_GET_ENTRY() doesn't describe what this macro is doing - it is
    incrementing the provided index for the circular array of descriptors.
    Replace "GET" with "NEXT" as this better describes the action here.
    
    Signed-off-by: Russell King (Oracle) <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Stable-dep-of: 0bb05e6adfa9 ("net: stmmac: Prevent NULL deref when RX memory exhausted")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: strparser: fix skb_head leak in strp_abort_strp() [+ + +]
Author: Luxiao Xu <[email protected]>
Date:   Sat Apr 11 23:10:10 2026 +0800

    net: strparser: fix skb_head leak in strp_abort_strp()
    
    commit fe72340daaf1af588be88056faf98965f39e6032 upstream.
    
    When the stream parser is aborted, for example after a message assembly timeout,
    it can still hold a reference to a partially assembled message in
    strp->skb_head.
    
    That skb is not released in strp_abort_strp(), which leaks the partially
    assembled message and can be triggered repeatedly to exhaust memory.
    
    Fix this by freeing strp->skb_head and resetting the parser state in the
    abort path. Leave strp_stop() unchanged so final cleanup still happens in
    strp_done() after the work and timer have been synchronized.
    
    Fixes: 43a0c6751a32 ("strparser: Stream parser for messages")
    Cc: [email protected]
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Co-developed-by: Yuan Tan <[email protected]>
    Signed-off-by: Yuan Tan <[email protected]>
    Suggested-by: Xin Liu <[email protected]>
    Tested-by: Yuan Tan <[email protected]>
    Signed-off-by: Luxiao Xu <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Link: https://patch.msgid.link/ade3857a9404999ce9a1c27ec523efc896072678.1775482694.git.rakukuip@gmail.com
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: txgbe: fix firmware version check [+ + +]
Author: Jiawen Wu <[email protected]>
Date:   Wed Apr 22 15:18:37 2026 +0800

    net: txgbe: fix firmware version check
    
    commit c263f644add3d6ad81f9d62a99284fde408f0caa upstream.
    
    For the device SP, the firmware version is a 32-bit value where the
    lower 20 bits represent the base version number. And the customized
    firmware version populates the upper 12 bits with a specific
    identification number.
    
    For other devices AML 25G and 40G, the upper 12 bits of the firmware
    version is always non-zero, and they have other naming conventions.
    
    Only SP devices need to check this to tell if XPCS will work properly.
    So the judgement of MAC type is added here.
    
    And the original logic compared the entire 32-bit value against 0x20010,
    which caused the outdated base firmwares bypass the version check
    without a warning. Apply a mask 0xfffff to isolate the lower 20 bits for
    an accurate base version comparison.
    
    Fixes: ab928c24e6cd ("net: txgbe: add FW version warning")
    Cc: [email protected]
    Signed-off-by: Jiawen Wu <[email protected]>
    Reviewed-by: Jacob Keller <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

net: txgbe: fix RTNL assertion warning when remove module [+ + +]
Author: Jiawen Wu <[email protected]>
Date:   Wed May 6 14:30:00 2026 +0800

    net: txgbe: fix RTNL assertion warning when remove module
    
    [ Upstream commit e159f05e12cc1111a3103b99375ddf0dfd0e7d63 ]
    
    For the copper NIC with external PHY, the driver called
    phylink_connect_phy() during probe and phylink_disconnect_phy() during
    remove. It caused an RTNL assertion warning in phylink_disconnect_phy()
    upon module remove.
    
    To fix this, add rtnl_lock() and rtnl_unlock() around the
    phylink_disconnect_phy() in remove function.
    
     ------------[ cut here ]------------
     RTNL: assertion failed at drivers/net/phy/phylink.c (2351)
     WARNING: drivers/net/phy/phylink.c:2351 at
    phylink_disconnect_phy+0xd8/0xf0 [phylink], CPU#0: rmmod/4464
     Modules linked in: ...
     CPU: 0 UID: 0 PID: 4464 Comm: rmmod Kdump: loaded Not tainted 7.0.0-rc4+
     Hardware name: Micro-Star International Co., Ltd. MS-7E16/X670E GAMING
    PLUS WIFI (MS-7E16), BIOS 1.90 12/31/2024
     RIP: 0010:phylink_disconnect_phy+0xe4/0xf0 [phylink]
     Code: 5b 41 5c 41 5d 41 5e 41 5f 5d 31 c0 31 d2 31 f6 31 ff e9 3a 38 8f e7
    48 8d 3d 48 87 e2 ff ba 2f 09 00 00 48 c7 c6 c1 22 24 c0 <67> 48 0f b9 3a
    e9 34 ff ff ff 66 90 90 90 90 90 90 90 90 90 90 90
     RSP: 0018:ffffce7288363ac0 EFLAGS: 00010246
     RAX: 0000000000000000 RBX: ffff89654b2a1a00 RCX: 0000000000000000
     RDX: 000000000000092f RSI: ffffffffc02422c1 RDI: ffffffffc0239020
     RBP: ffffce7288363ae8 R08: 0000000000000000 R09: 0000000000000000
     R10: 0000000000000000 R11: 0000000000000000 R12: ffff8964c4022000
     R13: ffff89654fce3028 R14: ffff89654ebb4000 R15: ffffffffc0226348
     FS:  0000795e80d93780(0000) GS:ffff896c52857000(0000)
    knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 00005b528b592000 CR3: 0000000170d0f000 CR4: 0000000000f50ef0
     PKRU: 55555554
     Call Trace:
      <TASK>
      txgbe_remove_phy+0xbb/0xd0 [txgbe]
      txgbe_remove+0x4c/0xb0 [txgbe]
      pci_device_remove+0x41/0xb0
      device_remove+0x43/0x80
      device_release_driver_internal+0x206/0x270
      driver_detach+0x4a/0xa0
      bus_remove_driver+0x83/0x120
      driver_unregister+0x2f/0x60
      pci_unregister_driver+0x40/0x90
      txgbe_driver_exit+0x10/0x850 [txgbe]
      __do_sys_delete_module.isra.0+0x1c3/0x2f0
      __x64_sys_delete_module+0x12/0x20
      x64_sys_call+0x20c3/0x2390
      do_syscall_64+0x11c/0x1500
      ? srso_alias_return_thunk+0x5/0xfbef5
      ? do_syscall_64+0x15a/0x1500
      ? srso_alias_return_thunk+0x5/0xfbef5
      ? do_fault+0x312/0x580
      ? srso_alias_return_thunk+0x5/0xfbef5
      ? __handle_mm_fault+0x9d5/0x1040
      ? srso_alias_return_thunk+0x5/0xfbef5
      ? count_memcg_events+0x101/0x1d0
      ? srso_alias_return_thunk+0x5/0xfbef5
      ? handle_mm_fault+0x1e8/0x2f0
      ? srso_alias_return_thunk+0x5/0xfbef5
      ? do_user_addr_fault+0x2f8/0x820
      ? srso_alias_return_thunk+0x5/0xfbef5
      ? irqentry_exit+0xb2/0x600
      ? srso_alias_return_thunk+0x5/0xfbef5
      ? exc_page_fault+0x92/0x1c0
      entry_SYSCALL_64_after_hwframe+0x76/0x7e
    
    Fixes: 02b2a6f91b90 ("net: txgbe: support copper NIC with external PHY")
    Cc: [email protected]
    Signed-off-by: Jiawen Wu <[email protected]>
    Reviewed-by: Russell King (Oracle) <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

net: wwan: t7xx: validate port_count against message length in t7xx_port_enum_msg_handler [+ + +]
Author: Pavitra Jha <[email protected]>
Date:   Fri May 1 07:07:12 2026 -0400

    net: wwan: t7xx: validate port_count against message length in t7xx_port_enum_msg_handler
    
    commit 0e7c074cfcd9bd93765505f9eb8b42f03ed2a744 upstream.
    
    t7xx_port_enum_msg_handler() uses the modem-supplied port_count field as
    a loop bound over port_msg->data[] without checking that the message buffer
    contains sufficient data. A modem sending port_count=65535 in a 12-byte
    buffer triggers a slab-out-of-bounds read of up to 262140 bytes.
    
    Add a sizeof(*port_msg) check before accessing the port message header
    fields to guard against undersized messages.
    
    Add a struct_size() check after extracting port_count and before the loop.
    
    In t7xx_parse_host_rt_data(), guard the rt_feature header read with a
    remaining-buffer check before accessing data_len, validate feat_data_len
    against the actual remaining buffer to prevent OOB reads and signed
    integer overflow on offset.
    
    Pass msg_len from both call sites: skb->len at the DPMAIF path after
    skb_pull(), and the validated feat_data_len at the handshake path.
    
    Fixes: da45d2566a1d ("net: wwan: t7xx: Add control port")
    Cc: [email protected]
    Signed-off-by: Pavitra Jha <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
netfilter: reject zero shift in nft_bitwise [+ + +]
Author: Kai Ma <[email protected]>
Date:   Wed Apr 22 22:54:18 2026 +0800

    netfilter: reject zero shift in nft_bitwise
    
    commit fe11e5c40817b84abaa5d83bfb6586d8412bfd07 upstream.
    
    Reject zero shift operands for nft_bitwise left and right shift
    expressions during initialization.
    
    The carry propagation logic computes the carry from the adjacent 32-bit
    word using BITS_PER_TYPE(u32) - shift. A zero shift operand turns this
    into a 32-bit shift, which is undefined behaviour.
    
    Reject zero shift operands in the control plane, alongside the existing
    check for values greater than or equal to 32, so malformed rules never
    reach the packet path.
    
    Fixes: 567d746b55bc ("netfilter: bitwise: add support for shifts.")
    Cc: [email protected]
    Reported-by: Yuan Tan <[email protected]>
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Reported-by: Xin Liu <[email protected]>
    Signed-off-by: Kai Ma <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Reviewed-by: Fernando Fernandez Mancera <[email protected]>
    Signed-off-by: Pablo Neira Ayuso <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ntfs3: add buffer boundary checks to run_unpack() [+ + +]
Author: Tobias Gaertner <[email protected]>
Date:   Sun Mar 29 04:17:02 2026 -0700

    ntfs3: add buffer boundary checks to run_unpack()
    
    commit b62567bca47408e6739dee75f02a2113548af875 upstream.
    
    run_unpack() checks `run_buf < run_last` at the top of the while loop
    but then reads size_size and offset_size bytes via run_unpack_s64()
    without verifying they fit within the remaining buffer.  A crafted NTFS
    image with truncated run data in an MFT attribute triggers an OOB heap
    read of up to 15 bytes when the filesystem is mounted.
    
    Add boundary checks before each run_unpack_s64() call to ensure the
    declared field size does not exceed the remaining buffer.
    
    Found by fuzzing with a source-patched harness (LibAFL + QEMU).
    
    Fixes: 82cae269cfa95 ("fs/ntfs3: Add initialization of super block")
    Cc: [email protected]
    Signed-off-by: Tobias Gaertner <[email protected]>
    Signed-off-by: Konstantin Komarov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

ntfs3: fix integer overflow in run_unpack() volume boundary check [+ + +]
Author: Tobias Gaertner <[email protected]>
Date:   Sun Mar 29 04:17:03 2026 -0700

    ntfs3: fix integer overflow in run_unpack() volume boundary check
    
    commit 984a415f019536ea2d24de9010744e5302a9a948 upstream.
    
    The volume boundary check `lcn + len > sbi->used.bitmap.nbits` uses raw
    addition which can wrap around for large lcn and len values, bypassing
    the validation.  Use check_add_overflow() as is already done for the
    adjacent prev_lcn + dlcn and vcn64 + len checks added by commit
    3ac37e100385 ("ntfs3: Fix integer overflow in run_unpack()").
    
    Found by fuzzing with a source-patched harness (LibAFL + QEMU).
    
    Fixes: 82cae269cfa95 ("fs/ntfs3: Add initialization of super block")
    Cc: [email protected]
    Signed-off-by: Tobias Gaertner <[email protected]>
    Signed-off-by: Konstantin Komarov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nvme-apple: drop invalid put of admin queue reference count [+ + +]
Author: Fedor Pchelkin <[email protected]>
Date:   Wed Apr 8 17:18:14 2026 +0300

    nvme-apple: drop invalid put of admin queue reference count
    
    commit ba9d308ccd6732dd97ed8080d834a4a89e758e14 upstream.
    
    Commit 03b3bcd319b3 ("nvme: fix admin request_queue lifetime") moved the
    admin queue reference ->put call into nvme_free_ctrl() - a controller
    device release callback performed for every nvme driver doing
    nvme_init_ctrl().
    
    nvme-apple sets refcount of the admin queue to 1 at allocation during the
    probe function and then puts it twice now:
    
    nvme_free_ctrl()
      blk_put_queue(ctrl->admin_q) // #1
      ->free_ctrl()
        apple_nvme_free_ctrl()
          blk_put_queue(anv->ctrl.admin_q) // #2
    
    Note that there is a commit 941f7298c70c ("nvme-apple: remove an extra
    queue reference") which intended to drop taking an extra admin queue
    reference.  Looks like at that moment it accidentally fixed a refcount
    leak, which existed since the driver's introduction.  There were two ->get
    calls at driver's probe function and a single ->put inside
    apple_nvme_free_ctrl().
    
    However now after commit 03b3bcd319b3 ("nvme: fix admin request_queue
    lifetime") the refcount is imbalanced again.  Fix it by removing extra
    ->put call from apple_nvme_free_ctrl().  anv->dev and ctrl->dev point to
    the same device, so use ctrl->dev directly for simplification.  Compile
    tested only.
    
    Found by Linux Verification Center (linuxtesting.org).
    
    Fixes: 03b3bcd319b3 ("nvme: fix admin request_queue lifetime")
    Cc: [email protected]
    Reviewed-by: Christoph Hellwig <[email protected]>
    Signed-off-by: Fedor Pchelkin <[email protected]>
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nvme-pci: add NVME_QUIRK_DISABLE_WRITE_ZEROES for Kingston OM3SGP4 [+ + +]
Author: Robert Beckett <[email protected]>
Date:   Fri Mar 20 19:22:09 2026 +0000

    nvme-pci: add NVME_QUIRK_DISABLE_WRITE_ZEROES for Kingston OM3SGP4
    
    commit a8eebf9699d69987cc49cec4e4fdb4111ab32423 upstream.
    
    The Kingston OM3SGP42048K2-A00 (PCI ID 2646:502f) firmware has a race
    condition when processing concurrent write zeroes and DSM (discard)
    commands, causing spurious "LBA Out of Range" errors and IOMMU page
    faults at address 0x0.
    
    The issue is reliably triggered by running two concurrent mkfs commands
    on different partitions of the same drive, which generates interleaved
    write zeroes and discard operations.
    
    Disable write zeroes for this device, matching the pattern used for
    other Kingston OM* drives that have similar firmware issues.
    
    Cc: [email protected]
    Signed-off-by: Robert Beckett <[email protected]>
    Assisted-by: claude-opus-4-6-v1
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nvme: respect NVME_QUIRK_DISABLE_WRITE_ZEROES when wzsl is set [+ + +]
Author: Robert Beckett <[email protected]>
Date:   Fri Mar 20 19:22:08 2026 +0000

    nvme: respect NVME_QUIRK_DISABLE_WRITE_ZEROES when wzsl is set
    
    commit 40f0496b617b431f8d2dd94d7f785c1121f8a68a upstream.
    
    The NVM Command Set Identify Controller data may report a non-zero
    Write Zeroes Size Limit (wzsl). When present, nvme_init_non_mdts_limits()
    unconditionally overrides max_zeroes_sectors from wzsl, even if
    NVME_QUIRK_DISABLE_WRITE_ZEROES previously set it to zero.
    
    This effectively re-enables write zeroes for devices that need it
    disabled, defeating the quirk. Several Kingston OM* drives rely on
    this quirk to avoid firmware issues with write zeroes commands.
    
    Check for the quirk before applying the wzsl override.
    
    Fixes: 5befc7c26e5a ("nvme: implement non-mdts command limits")
    Cc: [email protected]
    Signed-off-by: Robert Beckett <[email protected]>
    Assisted-by: claude-opus-4-6-v1
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
nvmet: avoid recursive nvmet-wq flush in nvmet_ctrl_free [+ + +]
Author: Chaitanya Kulkarni <[email protected]>
Date:   Wed Apr 8 17:56:47 2026 -0700

    nvmet: avoid recursive nvmet-wq flush in nvmet_ctrl_free
    
    commit aade8abd8b868b6ffa9697aadaea28ec7f65bee6 upstream.
    
    nvmet_tcp_release_queue_work() runs on nvmet-wq and can drop the
    final controller reference through nvmet_cq_put(). If that triggers
    nvmet_ctrl_free(), the teardown path flushes ctrl->async_event_work on
    the same nvmet-wq.
    
    Call chain:
    
     nvmet_tcp_schedule_release_queue()
       kref_put(&queue->kref, nvmet_tcp_release_queue)
         nvmet_tcp_release_queue()
           queue_work(nvmet_wq, &queue->release_work) <--- nvmet_wq
             process_one_work()
               nvmet_tcp_release_queue_work()
                 nvmet_cq_put(&queue->nvme_cq)
                   nvmet_cq_destroy()
                     nvmet_ctrl_put(cq->ctrl)
                       nvmet_ctrl_free()
                         flush_work(&ctrl->async_event_work) <--- nvmet_wq
    
                          Previously Scheduled by :-
                            nvmet_add_async_event
                              queue_work(nvmet_wq, &ctrl->async_event_work);
    
    This trips lockdep with a possible recursive locking warning.
    
    [ 5223.015876] run blktests nvme/003 at 2026-04-07 20:53:55
    [ 5223.061801] loop0: detected capacity change from 0 to 2097152
    [ 5223.072206] nvmet: adding nsid 1 to subsystem blktests-subsystem-1
    [ 5223.088368] nvmet_tcp: enabling port 0 (127.0.0.1:4420)
    [ 5223.126086] nvmet: Created discovery controller 1 for subsystem nqn.2014-08.org.nvmexpress.discovery for NQN nqn.2014-08.org.nvmexpress:uuid:0f01fb42-9f7f-4856-b0b3-51e60b8de349.
    [ 5223.128453] nvme nvme1: new ctrl: NQN "nqn.2014-08.org.nvmexpress.discovery", addr 127.0.0.1:4420, hostnqn: nqn.2014-08.org.nvmexpress:uuid:0f01fb42-9f7f-4856-b0b3-51e60b8de349
    [ 5233.199447] nvme nvme1: Removing ctrl: NQN "nqn.2014-08.org.nvmexpress.discovery"
    
    [ 5233.227718] ============================================
    [ 5233.231283] WARNING: possible recursive locking detected
    [ 5233.234696] 7.0.0-rc3nvme+ #20 Tainted: G           O     N
    [ 5233.238434] --------------------------------------------
    [ 5233.241852] kworker/u192:6/2413 is trying to acquire lock:
    [ 5233.245429] ffff888111632548 ((wq_completion)nvmet-wq){+.+.}-{0:0}, at: touch_wq_lockdep_map+0x26/0x90
    [ 5233.251438]
                   but task is already holding lock:
    [ 5233.255254] ffff888111632548 ((wq_completion)nvmet-wq){+.+.}-{0:0}, at: process_one_work+0x5cc/0x6e0
    [ 5233.261125]
                   other info that might help us debug this:
    [ 5233.265333]  Possible unsafe locking scenario:
    
    [ 5233.269217]        CPU0
    [ 5233.270795]        ----
    [ 5233.272436]   lock((wq_completion)nvmet-wq);
    [ 5233.275241]   lock((wq_completion)nvmet-wq);
    [ 5233.278020]
                    *** DEADLOCK ***
    
    [ 5233.281793]  May be due to missing lock nesting notation
    
    [ 5233.286195] 3 locks held by kworker/u192:6/2413:
    [ 5233.289192]  #0: ffff888111632548 ((wq_completion)nvmet-wq){+.+.}-{0:0}, at: process_one_work+0x5cc/0x6e0
    [ 5233.294569]  #1: ffffc9000e2a7e40 ((work_completion)(&queue->release_work)){+.+.}-{0:0}, at: process_one_work+0x1c5/0x6e0
    [ 5233.300128]  #2: ffffffff82d7dc40 (rcu_read_lock){....}-{1:3}, at: __flush_work+0x62/0x530
    [ 5233.304290]
                   stack backtrace:
    [ 5233.306520] CPU: 4 UID: 0 PID: 2413 Comm: kworker/u192:6 Tainted: G           O     N  7.0.0-rc3nvme+ #20 PREEMPT(full)
    [ 5233.306524] Tainted: [O]=OOT_MODULE, [N]=TEST
    [ 5233.306525] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 04/01/2014
    [ 5233.306527] Workqueue: nvmet-wq nvmet_tcp_release_queue_work [nvmet_tcp]
    [ 5233.306532] Call Trace:
    [ 5233.306534]  <TASK>
    [ 5233.306536]  dump_stack_lvl+0x73/0xb0
    [ 5233.306552]  print_deadlock_bug+0x225/0x2f0
    [ 5233.306556]  __lock_acquire+0x13f0/0x2290
    [ 5233.306563]  lock_acquire+0xd0/0x300
    [ 5233.306565]  ? touch_wq_lockdep_map+0x26/0x90
    [ 5233.306571]  ? __flush_work+0x20b/0x530
    [ 5233.306573]  ? touch_wq_lockdep_map+0x26/0x90
    [ 5233.306577]  touch_wq_lockdep_map+0x3b/0x90
    [ 5233.306580]  ? touch_wq_lockdep_map+0x26/0x90
    [ 5233.306583]  ? __flush_work+0x20b/0x530
    [ 5233.306585]  __flush_work+0x268/0x530
    [ 5233.306588]  ? __pfx_wq_barrier_func+0x10/0x10
    [ 5233.306594]  ? xen_error_entry+0x30/0x60
    [ 5233.306600]  nvmet_ctrl_free+0x140/0x310 [nvmet]
    [ 5233.306617]  nvmet_cq_put+0x74/0x90 [nvmet]
    [ 5233.306629]  nvmet_tcp_release_queue_work+0x19f/0x360 [nvmet_tcp]
    [ 5233.306634]  process_one_work+0x206/0x6e0
    [ 5233.306640]  worker_thread+0x184/0x320
    [ 5233.306643]  ? __pfx_worker_thread+0x10/0x10
    [ 5233.306646]  kthread+0xf1/0x130
    [ 5233.306648]  ? __pfx_kthread+0x10/0x10
    [ 5233.306651]  ret_from_fork+0x355/0x450
    [ 5233.306653]  ? __pfx_kthread+0x10/0x10
    [ 5233.306656]  ret_from_fork_asm+0x1a/0x30
    [ 5233.306664]  </TASK>
    
    There is also no need to flush async_event_work from controller
    teardown. The admin queue teardown already fails outstanding AER
    requests before the final controller put :-
    
     nvmet_sq_destroy(admin sq)
        nvmet_async_events_failall(ctrl)
    
    The controller has already been removed from the subsystem list before
    nvmet_ctrl_free() quiesces outstanding work.
    
    Replace flush_work() with cancel_work_sync() so a pending
    async_event_work item is canceled and a running instance is waited on
    without recursing into the same workqueue.
    
    Fixes: 06406d81a2d7 ("nvmet: cancel fatal error and flush async work before free controller")
    Cc: [email protected]
    Reviewed-by: Christoph Hellwig <[email protected]>
    Signed-off-by: Chaitanya Kulkarni <[email protected]>
    Signed-off-by: Keith Busch <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
ocfs2: split transactions in dio completion to avoid credit exhaustion [+ + +]
Author: Heming Zhao <[email protected]>
Date:   Thu Apr 2 21:43:27 2026 +0800

    ocfs2: split transactions in dio completion to avoid credit exhaustion
    
    commit d647c5b2fbf81560818dacade360abc8c00a9665 upstream.
    
    During ocfs2 dio operations, JBD2 may report warnings via following
    call trace:
    ocfs2_dio_end_io_write
     ocfs2_mark_extent_written
      ocfs2_change_extent_flag
       ocfs2_split_extent
        ocfs2_try_to_merge_extent
         ocfs2_extend_rotate_transaction
          ocfs2_extend_trans
           jbd2__journal_restart
            start_this_handle
             output: JBD2: kworker/6:2 wants too many credits credits:5450 rsv_credits:0 max:5449
    
    To prevent exceeding the credits limit, modify ocfs2_dio_end_io_write() to
    handle extents in a batch of transaction.
    
    Additionally, relocate ocfs2_del_inode_from_orphan().  The orphan inode
    should only be removed from the orphan list after the extent tree update
    is complete.  This ensures that if a crash occurs in the middle of extent
    tree updates, we won't leave stale blocks beyond EOF.
    
    This patch also changes the logic for updating the inode size and removing
    orphan, making it similar to ext4_dio_write_end_io().  Both operations are
    performed only when everything looks good.
    
    Finally, thanks to Jans and Joseph for providing the bug fix prototype and
    suggestions.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: Heming Zhao <[email protected]>
    Suggested-by: Jan Kara <[email protected]>
    Suggested-by: Joseph Qi <[email protected]>
    Reviewed-by: Jan Kara <[email protected]>
    Reviewed-by: Joseph Qi <[email protected]>
    Cc: Mark Fasheh <[email protected]>
    Cc: Joel Becker <[email protected]>
    Cc: Junxiao Bi <[email protected]>
    Cc: Changwei Ge <[email protected]>
    Cc: Jun Piao <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
of: unittest: fix use-after-free in testdrv_probe() [+ + +]
Author: Wentao Liang <[email protected]>
Date:   Thu Apr 9 03:48:59 2026 +0000

    of: unittest: fix use-after-free in testdrv_probe()
    
    commit 07fd339b2c253205794bea5d9b4b7548a4546c56 upstream.
    
    The function testdrv_probe() retrieves the device_node from the PCI
    device, applies an overlay, and then immediately calls of_node_put(dn).
    This releases the reference held by the PCI core, potentially freeing
    the node if the reference count drops to zero. Later, the same freed
    pointer 'dn' is passed to of_platform_default_populate(), leading to a
    use-after-free.
    
    The reference to pdev->dev.of_node is owned by the device model and
    should not be released by the driver. Remove the erroneous of_node_put()
    to prevent premature freeing.
    
    Fixes: 26409dd04589 ("of: unittest: Add pci_dt_testdrv pci driver")
    Cc: [email protected]
    Signed-off-by: Wentao Liang <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Rob Herring (Arm) <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
openvswitch: vport: fix self-deadlock on release of tunnel ports [+ + +]
Author: Ilya Maximets <[email protected]>
Date:   Fri May 1 01:38:37 2026 +0200

    openvswitch: vport: fix self-deadlock on release of tunnel ports
    
    commit aa69918bd418e700309fdd08509dba324fb24296 upstream.
    
    vports are used concurrently and protected by RCU, so netdev_put()
    must happen after the RCU grace period.  So, either in an RCU call or
    after the synchronize_net().  The rtnl_delete_link() must happen under
    RTNL and so can't be executed in RCU context.  Calling synchronize_net()
    while holding RTNL is not a good idea for performance and system
    stability under load in general, so calling netdev_put() in RCU call
    is the right solution here.
    
    However,
    when the device is deleted, rtnl_unlock() will call netdev_run_todo()
    and block until all the references are gone.  In the current code this
    means that we never reach the call_rcu() and the vport is never freed
    and the reference is never released, causing a self-deadlock on device
    removal.
    
    Fix that by moving the rcu_call() before the rtnl_unlock(), so the
    scheduled RCU callback will be executed when synchronize_net() is
    called from the rtnl_unlock()->netdev_run_todo() while the RTNL itself
    is already released.
    
    Fixes: 6931d21f87bc ("openvswitch: defer tunnel netdev_put to RCU release")
    Cc: [email protected]
    Acked-by: Eelco Chaudron <[email protected]>
    Signed-off-by: Ilya Maximets <[email protected]>
    Acked-by: Aaron Conole <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Paolo Abeni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
padata: Fix pd UAF once and for all [+ + +]
Author: Herbert Xu <[email protected]>
Date:   Mon Apr 27 13:46:42 2026 +0800

    padata: Fix pd UAF once and for all
    
    [ Upstream commit 71203f68c7749609d7fc8ae6ad054bdedeb24f91 ]
    
    There is a race condition/UAF in padata_reorder that goes back
    to the initial commit.  A reference count is taken at the start
    of the process in padata_do_parallel, and released at the end in
    padata_serial_worker.
    
    This reference count is (and only is) required for padata_replace
    to function correctly.  If padata_replace is never called then
    there is no issue.
    
    In the function padata_reorder which serves as the core of padata,
    as soon as padata is added to queue->serial.list, and the associated
    spin lock released, that padata may be processed and the reference
    count on pd would go away.
    
    Fix this by getting the next padata before the squeue->serial lock
    is released.
    
    In order to make this possible, simplify padata_reorder by only
    calling it once the next padata arrives.
    
    Fixes: 16295bec6398 ("padata: Generic parallelization/serialization interface")
    Signed-off-by: Herbert Xu <[email protected]>
    [ Adjust context of padata_find_next(). Replace
    cpumask_next_wrap(cpu, pd->cpumask.pcpu) with
    cpumask_next_wrap(cpu, pd->cpumask.pcpu, -1, false) in padata_reorder() in
    v6.6 according to dc5bb9b769c9 ("cpumask: deprecate cpumask_next_wrap()") and
    f954a2d37637 ("padata: switch padata_find_next() to using cpumask_next_wrap()")
    . ]
    Signed-off-by: Bin Lan <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

padata: Remove comment for reorder_work [+ + +]
Author: Herbert Xu <[email protected]>
Date:   Mon Apr 27 13:46:43 2026 +0800

    padata: Remove comment for reorder_work
    
    [ Upstream commit 82a0302e7167d0b7c6cde56613db3748f8dd806d ]
    
    Remove comment for reorder_work which no longer exists.
    
    Reported-by: Stephen Rothwell <[email protected]>
    Fixes: 71203f68c774 ("padata: Fix pd UAF once and for all")
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Bin Lan <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
parisc: _llseek syscall is only available for 32-bit userspace [+ + +]
Author: Helge Deller <[email protected]>
Date:   Tue Apr 7 23:56:28 2026 +0200

    parisc: _llseek syscall is only available for 32-bit userspace
    
    commit da3680f564bd787ce974f9931e6e924d908b3b2a upstream.
    
    Cc: [email protected]
    Signed-off-by: Helge Deller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

parisc: Fix IRQ leak in LASI driver [+ + +]
Author: Hongling Zeng <[email protected]>
Date:   Sun May 3 12:17:44 2026 +0800

    parisc: Fix IRQ leak in LASI driver
    
    commit 37b0dc5e279f35036fb638d1e187197b6c05a76d upstream.
    
    When request_irq() succeeds but gsc_common_setup() fails later,
    the IRQ is never released. Fix this by adding proper error handling
    with goto labels to ensure resources are released in LIFO order.
    
    Detected by Smatch:
      drivers/parisc/lasi.c:216 lasi_init_chip() warn: 'lasi->gsc_irq.irq'
    from request_irq() not released on lines: 207.
    
    Reported-by: kernel test robot <[email protected]>
    Reported-by: Dan Carpenter <[email protected]>
    Closes: https://lore.kernel.org/r/[email protected]/
    Signed-off-by: Hongling Zeng <[email protected]>
    Cc: [email protected]
    Signed-off-by: Helge Deller <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
PCI/AER: Clear only error bits in PCIe Device Status [+ + +]
Author: Shuai Xue <[email protected]>
Date:   Wed Feb 11 20:46:24 2026 +0800

    PCI/AER: Clear only error bits in PCIe Device Status
    
    commit a8aeea1bf3c80cc87983689e0118770e019bd4f3 upstream.
    
    Currently, pcie_clear_device_status() clears the entire PCIe Device Status
    register (PCI_EXP_DEVSTA) by writing back the value read from the register,
    which affects not only the error status bits but also other writable bits.
    
    According to PCIe r7.0, sec 7.5.3.5, this register contains:
    
      - RW1C error status bits (CED, NFED, FED, URD at bits 0-3): These are the
        four error status bits that need to be cleared.
    
      - Read-only bits (AUXPD at bit 4, TRPND at bit 5): Writing to these has
        no effect.
    
      - Emergency Power Reduction Detected (bit 6): A RW1C non-error bit
        introduced in PCIe r5.0 (2019). This is currently the only writable
        non-error bit in the Device Status register. Unconditionally clearing
        this bit can interfere with other software components that rely on this
        power management indication.
    
      - Reserved bits (RsvdZ): These bits are required to be written as zero.
        Writing 1s to them (as the current implementation may do) violates the
        specification.
    
    To prevent unintended side effects, modify pcie_clear_device_status() to
    only write 1s to the four error status bits (CED, NFED, FED, URD), leaving
    the Emergency Power Reduction Detected bit and reserved bits unaffected.
    
    Fixes: ec752f5d54d7 ("PCI/AER: Clear device status bits during ERR_FATAL and ERR_NONFATAL")
    Suggested-by: Lukas Wunner <[email protected]>
    Signed-off-by: Shuai Xue <[email protected]>
    Signed-off-by: Bjorn Helgaas <[email protected]>
    Reviewed-by: Kuppuswamy Sathyanarayanan <[email protected]>
    Reviewed-by: Lukas Wunner <[email protected]>
    Cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

PCI/AER: Stop ruling out unbound devices as error source [+ + +]
Author: Lukas Wunner <[email protected]>
Date:   Fri Mar 27 10:56:43 2026 +0100

    PCI/AER: Stop ruling out unbound devices as error source
    
    commit 1ab4a3c805084d752ec571efc78272295a9f2f74 upstream.
    
    When searching for the error source, the AER driver rules out devices whose
    enable_cnt is zero.  This was introduced in 2009 by commit 28eb27cf0839
    ("PCI AER: support invalid error source IDs") without providing a
    rationale.
    
    Drivers typically call pci_enable_device() on probe, hence the enable_cnt
    check essentially filters out unbound devices.  At the time of the commit,
    drivers had to opt in to AER by calling pci_enable_pcie_error_reporting()
    and so any AER-enabled device could be assumed to be bound to a driver.
    The check thus made sense because it allowed skipping config space accesses
    to devices which were known not to be the error source.
    
    But since 2022, AER is universally enabled on all devices when they are
    enumerated, cf. commit f26e58bf6f54 ("PCI/AER: Enable error reporting when
    AER is native").
    
    Errors may very well be reported by unbound devices, e.g. due to link
    instability.  By ruling them out as error source, errors reported by them
    are neither logged nor cleared.  When they do get bound and another error
    occurs, the earlier error is reported together with the new error, which
    may confuse users.  Stop doing so.
    
    Fixes: f26e58bf6f54 ("PCI/AER: Enable error reporting when AER is native")
    Signed-off-by: Lukas Wunner <[email protected]>
    Signed-off-by: Bjorn Helgaas <[email protected]>
    Reviewed-by: Stefan Roese <[email protected]>
    Cc: [email protected] # v6.0+
    Link: https://patch.msgid.link/734338c2e8b669db5a5a3b45d34131b55ffebfca.1774605029.git.lukas@wunner.de
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
PCI: endpoint: pci-epf-ntb: Remove duplicate resource teardown [+ + +]
Author: Koichiro Den <[email protected]>
Date:   Thu Feb 26 17:41:39 2026 +0900

    PCI: endpoint: pci-epf-ntb: Remove duplicate resource teardown
    
    commit 3446beddba450c8d6f9aca2f028712ac527fead3 upstream.
    
    epf_ntb_epc_destroy() duplicates the teardown that the caller is
    supposed to do later. This leads to an oops when .allow_link fails or
    when .drop_link is performed. Remove the helper.
    
    Also drop pci_epc_put(). EPC device refcounting is tied to configfs EPC
    group lifetime, and pci_epc_put() in the .drop_link path is sufficient.
    
    Fixes: 8b821cf76150 ("PCI: endpoint: Add EP function driver to provide NTB functionality")
    Signed-off-by: Koichiro Den <[email protected]>
    Signed-off-by: Manivannan Sadhasivam <[email protected]>
    Reviewed-by: Frank Li <[email protected]>
    Cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

PCI: epf-mhi: Return 0, not remaining timeout, when eDMA ops complete [+ + +]
Author: Daniel Hodges <[email protected]>
Date:   Fri May 1 09:13:44 2026 -0400

    PCI: epf-mhi: Return 0, not remaining timeout, when eDMA ops complete
    
    [ Upstream commit 36bfc3642b19a98f1302aed4437c331df9b481f0 ]
    
    pci_epf_mhi_edma_read() and pci_epf_mhi_edma_write() start DMA
    operations and wait for completion with a timeout.
    
    On successful completion, they previously returned the remaining
    timeout, which callers may treat as an error.  In particular,
    mhi_ep_ring_add_element(), which calls pci_epf_mhi_edma_write() via
    mhi_cntrl->write_sync(), interprets any non-zero return value as
    failure.
    
    Return 0 on success instead of the remaining timeout to prevent
    mhi_ep_ring_add_element() from treating successful completion as an
    error.
    
    Fixes: 7b99aaaddabb ("PCI: epf-mhi: Add eDMA support")
    Signed-off-by: Daniel Hodges <[email protected]>
    [mani: changed commit log as per https://lore.kernel.org/linux-pci/20260227191510.GA3904799@bhelgaas]
    Signed-off-by: Manivannan Sadhasivam <[email protected]>
    Reviewed-by: Krishna Chaitanya Chundru <[email protected]>
    Cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
platform/x86: hp-wmi: Ignore backlight and FnLock events [+ + +]
Author: Krishna Chomal <[email protected]>
Date:   Fri Apr 3 13:31:55 2026 +0530

    platform/x86: hp-wmi: Ignore backlight and FnLock events
    
    commit e8c597368b8500a824c639bfb5ed0044068c6870 upstream.
    
    On HP OmniBook 7 the keyboard backlight and FnLock keys are handled
    directly by the firmware. However, they still trigger WMI events which
    results in "Unknown key code" warnings in dmesg.
    
    Add these key codes to the keymap with KE_IGNORE to silence the warnings
    since no software action is needed.
    
    Tested-by: Artem S. Tashkinov <[email protected]>
    Reported-by: Artem S. Tashkinov <[email protected]>
    Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221181
    Signed-off-by: Krishna Chomal <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Reviewed-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Ilpo Järvinen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
power: supply: axp288_charger: Do not cancel work before initializing it [+ + +]
Author: Krzysztof Kozlowski <[email protected]>
Date:   Fri Feb 20 18:49:39 2026 +0100

    power: supply: axp288_charger: Do not cancel work before initializing it
    
    commit 658342fd75b582cbb06544d513171c3d645faead upstream.
    
    Driver registered devm handler to cancel_work_sync() before even the
    work was initialized, thus leading to possible warning from
    kernel/workqueue.c on (!work->func) check, if the error path was hit
    before the initialization happened.
    
    Use devm_work_autocancel() on each work item independently, which
    handles the initialization and handler to cancel work.
    
    Fixes: 165c2357744e ("power: supply: axp288_charger: Properly stop work on probe-error / remove")
    Cc: [email protected]
    Signed-off-by: Krzysztof Kozlowski <[email protected]>
    Reviewed-by: Hans de Goede <[email protected]>
    Reviewed-by: Chen-Yu Tsai <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sebastian Reichel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

power: supply: max17042: avoid overflow when determining health [+ + +]
Author: André Draszik <[email protected]>
Date:   Mon Mar 2 13:32:05 2026 +0000

    power: supply: max17042: avoid overflow when determining health
    
    commit 9a44949da669708f19d29141e65b3ac774d08f5a upstream.
    
    If vmax has the default value of INT_MAX (e.g. because not specified in
    DT), battery health is reported as over-voltage. This is because adding
    any value to vmax (the vmax tolerance in this case) causes it to wrap
    around, making it negative and smaller than the measured battery
    voltage.
    
    Avoid that by using size_add().
    
    Fixes: edd4ab055931 ("power: max17042_battery: add HEALTH and TEMP_* properties support")
    Cc: [email protected]
    Signed-off-by: André Draszik <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sebastian Reichel <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
powerpc/kdump: fix KASAN sanitization flag for core_$(BITS).o [+ + +]
Author: Sourabh Jain <[email protected]>
Date:   Tue Apr 7 18:13:44 2026 +0530

    powerpc/kdump: fix KASAN sanitization flag for core_$(BITS).o
    
    commit b3a97f9484080c6e71db9e803e3cc1bb372a9bc7 upstream.
    
    KASAN instrumentation is intended to be disabled for the kexec core
    code, but the existing Makefile entry misses the object suffix. As a
    result, the flag is not applied correctly to core_$(BITS).o.
    
    So when KASAN is enabled, kexec_copy_flush and copy_segments in
    kexec/core_64.c are instrumented, which can result in accesses to
    shadow memory via normal address translation paths. Since these run
    with the MMU disabled, such accesses may trigger page faults
    (bad_page_fault) that cannot be handled in the kdump path, ultimately
    causing a hang and preventing the kdump kernel from booting. The same
    is true for kexec as well, since the same functions are used there.
    
    Update the entry to include the “.o” suffix so that KASAN
    instrumentation is properly disabled for this object file.
    
    Fixes: 2ab2d5794f14 ("powerpc/kasan: Disable address sanitization in kexec paths")
    Reported-by: Venkat Rao Bagalkote <[email protected]>
    Closes: https://lore.kernel.org/all/[email protected]/
    Cc: [email protected]
    Reviewed-by: Ritesh Harjani (IBM) <[email protected]>
    Tested-by: Venkat Rao Bagalkote <[email protected]>
    Acked-by: Mahesh Salgaonkar <[email protected]>
    Reviewed-by: Aboorva Devarajan <[email protected]>
    Tested-by: Aboorva Devarajan <[email protected]>
    Signed-off-by: Sourabh Jain <[email protected]>
    Signed-off-by: Madhavan Srinivasan <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
printk: add print_hex_dump_devel() [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Sun May 10 09:15:07 2026 -0400

    printk: add print_hex_dump_devel()
    
    [ Upstream commit d134feeb5df33fbf77f482f52a366a44642dba09 ]
    
    Add print_hex_dump_devel() as the hex dump equivalent of pr_devel(),
    which emits output only when DEBUG is enabled, but keeps call sites
    compiled otherwise.
    
    Suggested-by: Herbert Xu <[email protected]>
    Signed-off-by: Thorsten Blum <[email protected]>
    Reviewed-by: John Ogness <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Stable-dep-of: 177730a273b1 ("crypto: caam - guard HMAC key hex dumps in hash_digest_key")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
pwm: imx-tpm: Count the number of enabled channels in probe [+ + +]
Author: Viorel Suman (OSS) <[email protected]>
Date:   Wed Mar 11 14:33:09 2026 +0200

    pwm: imx-tpm: Count the number of enabled channels in probe
    
    commit 3962c24f2d14e8a7f8a23f56b7ce320523947342 upstream.
    
    On a soft reset TPM PWM IP may preserve its internal state from previous
    runtime, therefore on a subsequent OS boot and driver probe
    "enable_count" value and TPM PWM IP internal channels "enabled" states
    may get unaligned. In consequence on a suspend/resume cycle the call "if
    (--tpm->enable_count == 0)" may lead to "enable_count" overflow the
    system being blocked from entering suspend due to:
    
       if (tpm->enable_count > 0)
           return -EBUSY;
    
    Fix the problem by counting the enabled channels in probe function.
    
    Signed-off-by: Viorel Suman (OSS) <[email protected]>
    Fixes: 738a1cfec2ed ("pwm: Add i.MX TPM PWM driver support")
    Link: https://patch.msgid.link/[email protected]
    Cc: [email protected]
    Signed-off-by: Uwe Kleine-König <[email protected]>
    [ukleinek: backport to linux-6.6.y]
    Signed-off-by: Uwe Kleine-König <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
randomize_kstack: Maintain kstack_offset per task [+ + +]
Author: Ryan Roberts <[email protected]>
Date:   Tue Mar 3 15:08:38 2026 +0000

    randomize_kstack: Maintain kstack_offset per task
    
    commit 37beb42560165869838e7d91724f3e629db64129 upstream.
    
    kstack_offset was previously maintained per-cpu, but this caused a
    couple of issues. So let's instead make it per-task.
    
    Issue 1: add_random_kstack_offset() and choose_random_kstack_offset()
    expected and required to be called with interrupts and preemption
    disabled so that it could manipulate per-cpu state. But arm64, loongarch
    and risc-v are calling them with interrupts and preemption enabled. I
    don't _think_ this causes any functional issues, but it's certainly
    unexpected and could lead to manipulating the wrong cpu's state, which
    could cause a minor performance degradation due to bouncing the cache
    lines. By maintaining the state per-task those functions can safely be
    called in preemptible context.
    
    Issue 2: add_random_kstack_offset() is called before executing the
    syscall and expands the stack using a previously chosen random offset.
    choose_random_kstack_offset() is called after executing the syscall and
    chooses and stores a new random offset for the next syscall. With
    per-cpu storage for this offset, an attacker could force cpu migration
    during the execution of the syscall and prevent the offset from being
    updated for the original cpu such that it is predictable for the next
    syscall on that cpu. By maintaining the state per-task, this problem
    goes away because the per-task random offset is updated after the
    syscall regardless of which cpu it is executing on.
    
    Fixes: 39218ff4c625 ("stack: Optionally randomize kernel stack offset each syscall")
    Closes: https://lore.kernel.org/all/[email protected]/
    Cc: [email protected]
    Acked-by: Mark Rutland <[email protected]>
    Signed-off-by: Ryan Roberts <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Kees Cook <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rbd: fix null-ptr-deref when device_add_disk() fails [+ + +]
Author: Dawei Feng <[email protected]>
Date:   Sun Apr 19 17:03:48 2026 +0800

    rbd: fix null-ptr-deref when device_add_disk() fails
    
    commit d1fef92e414433ca7b89abf85cb0df42b8d475eb upstream.
    
    do_rbd_add() publishes the device with device_add() before calling
    device_add_disk(). If device_add_disk() fails after device_add()
    succeeds, the error path calls rbd_free_disk() directly and then later
    falls through to rbd_dev_device_release(), which calls rbd_free_disk()
    again. This double teardown can leave blk-mq cleanup operating on
    invalid state and trigger a null-ptr-deref in
    __blk_mq_free_map_and_rqs(), reached from blk_mq_free_tag_set().
    
    Fix this by following the normal remove ordering: call device_del()
    before rbd_dev_device_release() when device_add_disk() fails after
    device_add(). That keeps the teardown sequence consistent and avoids
    re-entering disk cleanup through the wrong path.
    
    The bug was first flagged by an experimental analysis tool we are
    developing for kernel memory-management bugs while analyzing
    v6.13-rc1. The tool is still under development and is not yet publicly
    available.
    
    We reproduced the bug on v7.0 with a real Ceph backend and a QEMU x86_64
    guest booted with KASAN and CONFIG_FAILSLAB enabled. The reproducer
    confines failslab injections to the __add_disk() range and injects
    fail-nth while mapping an RBD image through
    /sys/bus/rbd/add_single_major.
    
    On the unpatched kernel, fail-nth=4 reliably triggered the fault:
    
            Oops: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] SMP KASAN NOPTI
            KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
            CPU: 0 UID: 0 PID: 273 Comm: bash Not tainted 7.0.0-01247-gd60bc1401583 #6 PREEMPT(lazy)
            Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.15.0-1 04/01/2014
            RIP: 0010:__blk_mq_free_map_and_rqs+0x8c/0x240
            Code: 00 00 48 8b 6b 60 41 89 f4 49 c1 e4 03 4c 01 e5 45 85 ed 0f 85 0a 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 e9 48 c1 e9 03 <80> 3c 01 00 0f 85 31 01 00 00 4c 8b 6d 00 4d 85 ed 0f 84 e2 00 00
            RSP: 0018:ff1100000ab0fac8 EFLAGS: 00000246
            RAX: dffffc0000000000 RBX: ff1100000c4806a0 RCX: 0000000000000000
            RDX: 0000000000000002 RSI: 0000000000000000 RDI: ff1100000c4806f4
            RBP: 0000000000000000 R08: 0000000000000001 R09: ffe21c000189001b
            R10: ff1100000c4800df R11: ff1100006cf37be0 R12: 0000000000000000
            R13: 0000000000000000 R14: ff1100000c480700 R15: ff1100000c480004
            FS:  00007f0fbe8fe740(0000) GS:ff110000e5851000(0000) knlGS:0000000000000000
            CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
            CR2: 00007fe53473b2e0 CR3: 0000000012eef000 CR4: 00000000007516f0
            PKRU: 55555554
            Call Trace:
             <TASK>
             blk_mq_free_tag_set+0x77/0x460
             do_rbd_add+0x1446/0x2b80
             ? __pfx_do_rbd_add+0x10/0x10
             ? lock_acquire+0x18c/0x300
             ? find_held_lock+0x2b/0x80
             ? sysfs_file_kobj+0xb6/0x1b0
             ? __pfx_sysfs_kf_write+0x10/0x10
             kernfs_fop_write_iter+0x2f4/0x4a0
             vfs_write+0x98e/0x1000
             ? expand_files+0x51f/0x850
             ? __pfx_vfs_write+0x10/0x10
             ksys_write+0xf2/0x1d0
             ? __pfx_ksys_write+0x10/0x10
             do_syscall_64+0x115/0x690
             entry_SYSCALL_64_after_hwframe+0x77/0x7f
            RIP: 0033:0x7f0fbea15907
            Code: 10 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b7 0f 1f 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
            RSP: 002b:00007ffe22346ea8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
            RAX: ffffffffffffffda RBX: 0000000000000058 RCX: 00007f0fbea15907
            RDX: 0000000000000058 RSI: 0000563ace6c0ef0 RDI: 0000000000000001
            RBP: 0000563ace6c0ef0 R08: 0000563ace6c0ef0 R09: 6b6435726d694141
            R10: 5250337279762f78 R11: 0000000000000246 R12: 0000000000000058
            R13: 00007f0fbeb1c780 R14: ff1100000c480700 R15: ff1100000c480004
             </TASK>
    
    With this fix applied, rerunning the reproducer over fail-nth=1..256
    yields no KASAN reports.
    
    [ idryomov: rename err_out_device_del -> err_out_device ]
    
    Cc: [email protected]
    Fixes: 27c97abc30e2 ("rbd: add add_disk() error handling")
    Signed-off-by: Zilin Guan <[email protected]>
    Signed-off-by: Dawei Feng <[email protected]>
    Reviewed-by: Ilya Dryomov <[email protected]>
    Signed-off-by: Ilya Dryomov <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
RDMA/hns: Fix unlocked call to hns_roce_qp_remove() [+ + +]
Author: Jason Gunthorpe <[email protected]>
Date:   Tue Apr 28 13:17:48 2026 -0300

    RDMA/hns: Fix unlocked call to hns_roce_qp_remove()
    
    commit 0c99acbc8b6c6dd526ae475a48ee1897b61072fb upstream.
    
    Sashiko points out that hns_roce_qp_remove() requires the caller to hold
    locks.  The error flow in hns_roce_create_qp_common() doesn't hold those
    locks for the error unwind so it risks corrupting memory.
    
    Grab the same locks the other two callers use.
    
    Cc: [email protected]
    Fixes: e088a685eae9 ("RDMA/hns: Support rq record doorbell for the user space")
    Link: https://sashiko.dev/#/patchset/0-v2-1c49eeb88c48%2B91-rdma_udata_rep_jgg%40nvidia.com?part=9
    Link: https://patch.msgid.link/r/[email protected]
    Reviewed-by: Junxian Huang <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
RDMA/mana_ib: Disable RX steering on RSS QP destroy [+ + +]
Author: Long Li <[email protected]>
Date:   Fri May 1 22:59:23 2026 -0400

    RDMA/mana_ib: Disable RX steering on RSS QP destroy
    
    [ Upstream commit dbeb256e8dd87233d891b170c0b32a6466467036 ]
    
    When an RSS QP is destroyed (e.g. DPDK exit), mana_ib_destroy_qp_rss()
    destroys the RX WQ objects but does not disable vPort RX steering in
    firmware. This leaves stale steering configuration that still points to
    the destroyed RX objects.
    
    If traffic continues to arrive (e.g. peer VM is still transmitting) and
    the VF interface is subsequently brought up (mana_open), the firmware
    may deliver completions using stale CQ IDs from the old RX objects.
    These CQ IDs can be reused by the ethernet driver for new TX CQs,
    causing RX completions to land on TX CQs:
    
      WARNING: mana_poll_tx_cq+0x1b8/0x220 [mana]  (is_sq == false)
      WARNING: mana_gd_process_eq_events+0x209/0x290 (cq_table lookup fails)
    
    Fix this by disabling vPort RX steering before destroying RX WQ objects.
    Note that mana_fence_rqs() cannot be used here because the fence
    completion is delivered on the CQ, which is polled by user-mode (e.g.
    DPDK) and not visible to the kernel driver.
    
    Refactor the disable logic into a shared mana_disable_vport_rx() in
    mana_en, exported for use by mana_ib, replacing the duplicate code.
    The ethernet driver's mana_dealloc_queues() is also updated to call
    this common function.
    
    Fixes: 0266a177631d ("RDMA/mana_ib: Add a driver for Microsoft Azure Network Adapter")
    Cc: [email protected]
    Signed-off-by: Long Li <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Leon Romanovsky <[email protected]>
    [ kept early-return error handling and used unquoted NET_MANA namespace in EXPORT_SYMBOL_NS ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
RDMA/mlx4: Fix resource leak on error in mlx4_ib_create_srq() [+ + +]
Author: Jason Gunthorpe <[email protected]>
Date:   Tue Apr 28 13:17:44 2026 -0300

    RDMA/mlx4: Fix resource leak on error in mlx4_ib_create_srq()
    
    commit c54c7e4cb679c0aaa1cb489b9c3f2cd98e63a44c upstream.
    
    Sashiko points out that mlx4_srq_alloc() was not undone during error
    unwind, add the missing call to mlx4_srq_free().
    
    Cc: [email protected]
    Fixes: 225c7b1feef1 ("IB/mlx4: Add a driver Mellanox ConnectX InfiniBand adapters")
    Link: https://sashiko.dev/#/patchset/0-v1-e911b76a94d1%2B65d95-rdma_udata_rep_jgg%40nvidia.com?part=8
    Link: https://patch.msgid.link/r/[email protected]
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
RDMA/mlx5: Fix error path fall-through in mlx5_ib_dev_res_srq_init() [+ + +]
Author: Junrui Luo <[email protected]>
Date:   Fri Apr 24 13:51:02 2026 +0800

    RDMA/mlx5: Fix error path fall-through in mlx5_ib_dev_res_srq_init()
    
    commit c488df06bd552bb8b6e14fa0cfd5ad986c6e9525 upstream.
    
    mlx5_ib_dev_res_srq_init() allocates two SRQs, s0 and s1. When
    ib_create_srq() fails for s1, the error branch destroys s0 but falls
    through and unconditionally assigns the freed s0 and the ERR_PTR s1 to
    devr->s0 and devr->s1.
    
    This leads to several problems: the lock-free fast path checks
    "if (devr->s1) return 0;" and treats the ERR_PTR as already initialised;
    users in mlx5_ib_create_qp() dereference the freed SRQ or ERR_PTR via
    to_msrq(devr->s0)->msrq.srqn; and mlx5_ib_dev_res_cleanup() dereferences
    the ERR_PTR and double-frees s0 on teardown.
    
    Fix by adding the same `goto unlock` in the s1 failure path.
    
    Cc: [email protected]
    Fixes: 5895e70f2e6e ("IB/mlx5: Allocate resources just before first QP/SRQ is created")
    Link: https://patch.msgid.link/r/SYBPR01MB7881E1E0970268BD69C0BA75AF2B2@SYBPR01MB7881.ausprd01.prod.outlook.com
    Reported-by: Yuhao Jiang <[email protected]>
    Signed-off-by: Junrui Luo <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
RDMA/ocrdma: Don't NULL deref uctx on errors in ocrdma_copy_pd_uresp() [+ + +]
Author: Jason Gunthorpe <[email protected]>
Date:   Tue Apr 28 13:17:42 2026 -0300

    RDMA/ocrdma: Don't NULL deref uctx on errors in ocrdma_copy_pd_uresp()
    
    commit 34fbf48cf3b410d2a6e8c586fa952a36331ca5ba upstream.
    
    Sashiko points out that pd->uctx isn't initialized until late in the
    function so all these error flow references are NULL and will crash. Use
    the uctx that isn't NULL.
    
    Cc: [email protected]
    Fixes: fe2caefcdf58 ("RDMA/ocrdma: Add driver for Emulex OneConnect IBoE RDMA adapter")
    Link: https://sashiko.dev/#/patchset/0-v1-e911b76a94d1%2B65d95-rdma_udata_rep_jgg%40nvidia.com?part=4
    Link: https://patch.msgid.link/r/[email protected]
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
RDMA/rxe: Reject non-8-byte ATOMIC_WRITE payloads [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Sat Apr 18 12:21:41 2026 -0400

    RDMA/rxe: Reject non-8-byte ATOMIC_WRITE payloads
    
    commit 1114c87aa6f195cf07da55a27b2122ae26557b26 upstream.
    
    atomic_write_reply() at drivers/infiniband/sw/rxe/rxe_resp.c
    unconditionally dereferences 8 bytes at payload_addr(pkt):
    
        value = *(u64 *)payload_addr(pkt);
    
    check_rkey() previously accepted an ATOMIC_WRITE request with pktlen ==
    resid == 0 because the length validation only compared pktlen against
    resid. A remote initiator that sets the RETH length to 0 therefore reaches
    atomic_write_reply() with a zero-byte logical payload, and the responder
    reads sizeof(u64) bytes from past the logical end of the packet into
    skb->head tailroom, then writes those 8 bytes into the attacker's MR via
    rxe_mr_do_atomic_write(). That is a remote disclosure of 4 bytes of kernel
    tailroom per probe (the other 4 bytes are the packet's own trailing ICRC).
    
    IBA oA19-28 defines ATOMIC_WRITE as exactly 8 bytes. Anything else is
    protocol-invalid. Hoist a strict length check into check_rkey() so the
    responder never reaches the unchecked dereference, and keep the existing
    WRITE-family length logic for the normal RDMA WRITE path.
    
    Reproduced on mainline with an unmodified rxe driver: a sustained
    zero-length ATOMIC_WRITE probe repeatedly leaks adjacent skb head-buffer
    bytes into the attacker's MR, including recognisable kernel strings and
    partial kernel-direct-map pointer words.  With this patch applied the
    responder rejects the PDU and the MR stays all-zero.
    
    Cc: [email protected]
    Fixes: 034e285f8b99 ("RDMA/rxe: Make responder support atomic write on RC service")
    Link: https://patch.msgid.link/r/[email protected]
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <[email protected]>
    Reviewed-by: Zhu Yanjun <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

RDMA/rxe: Reject unknown opcodes before ICRC processing [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Tue Apr 14 07:15:55 2026 -0400

    RDMA/rxe: Reject unknown opcodes before ICRC processing
    
    commit 4c6f86d85d03cdb33addce86aa69aa795ca6c47a upstream.
    
    Even after applying commit 7244491dab34 ("RDMA/rxe: Validate pad and ICRC
    before payload_size() in rxe_rcv"), a single unauthenticated UDP packet
    can still trigger panic.  That patch handled payload_size() underflow only
    for valid opcodes with short packets, not for packets carrying an unknown
    opcode.  The unknown-opcode OOB read described below predates that commit
    and reaches back to the initial Soft RoCE driver.
    
    The check added there reads
    
        pkt->paylen < header_size(pkt) + bth_pad(pkt) + RXE_ICRC_SIZE
    
    where header_size(pkt) expands to rxe_opcode[pkt->opcode].length.  The
    rxe_opcode[] array has 256 entries but is only populated for defined IB
    opcodes; any other entry (for example opcode 0xff) is zero-initialized, so
    length == 0 and the check degenerates to
    
        pkt->paylen < 0 + bth_pad(pkt) + RXE_ICRC_SIZE
    
    which does not constrain pkt->paylen enough.  rxe_icrc_hdr() then computes
    
        rxe_opcode[pkt->opcode].length - RXE_BTH_BYTES
    
    which underflows when length == 0 and passes a huge value to rxe_crc32(),
    causing an out-of-bounds read of the skb payload.
    
    Reproduced on v7.0-rc7 with that fix applied, QEMU/KVM with
    CONFIG_RDMA_RXE=y and CONFIG_KASAN=y, after
    
        rdma link add rxe0 type rxe netdev eth0
    
    A single 48-byte UDP packet to port 4791 with BTH opcode=0xff and
    QPN=IB_MULTICAST_QPN triggers:
    
        BUG: KASAN: slab-out-of-bounds in crc32_le+0x115/0x170
        Read of size 1 at addr ...
        The buggy address is located 0 bytes to the right of
         allocated 704-byte region
        Call Trace:
         crc32_le+0x115/0x170
         rxe_icrc_hdr.isra.0+0x226/0x300
         rxe_icrc_check+0x13f/0x3a0
         rxe_rcv+0x6e1/0x16e0
         rxe_udp_encap_recv+0x20a/0x320
         udp_queue_rcv_one_skb+0x7ed/0x12c0
    
    Subsequent packets with the same shape fault on unmapped memory and panic
    the kernel.  The trigger requires only module load and "rdma link add"; no
    QP, no connection, and no authentication.
    
    Fix this by rejecting packets whose opcode has no rxe_opcode[] entry,
    detected via the zero mask or zero length, before any length arithmetic
    runs.
    
    Cc: [email protected]
    Fixes: 8700e3e7c485 ("Soft RoCE driver")
    Link: https://patch.msgid.link/r/[email protected]
    Assisted-by: Claude:claude-opus-4-6
    Signed-off-by: Michael Bommarito <[email protected]>
    Reviewed-by: Zhu Yanjun <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

RDMA/rxe: Validate pad and ICRC before payload_size() in rxe_rcv [+ + +]
Author: hkbinbin <[email protected]>
Date:   Wed Apr 1 12:19:07 2026 +0000

    RDMA/rxe: Validate pad and ICRC before payload_size() in rxe_rcv
    
    commit 7244491dab347f648e661da96dc0febadd9daec3 upstream.
    
    rxe_rcv() currently checks only that the incoming packet is at least
    header_size(pkt) bytes long before payload_size() is used.
    
    However, payload_size() subtracts both the attacker-controlled BTH pad
    field and RXE_ICRC_SIZE from pkt->paylen:
    
      payload_size = pkt->paylen - offset[RXE_PAYLOAD] - bth_pad(pkt)
                     - RXE_ICRC_SIZE
    
    This means a short packet can still make payload_size() underflow even
    if it includes enough bytes for the fixed headers. Simply requiring
    header_size(pkt) + RXE_ICRC_SIZE is not sufficient either, because a
    packet with a forged non-zero BTH pad can still leave payload_size()
    negative and pass an underflowed value to later receive-path users.
    
    Fix this by validating pkt->paylen against the full minimum length
    required by payload_size(): header_size(pkt) + bth_pad(pkt) +
    RXE_ICRC_SIZE.
    
    Cc: [email protected]
    Fixes: 8700e3e7c485 ("Soft RoCE driver")
    Link: https://patch.msgid.link/r/[email protected]
    Signed-off-by: hkbinbin <[email protected]>
    Reviewed-by: Zhu Yanjun <[email protected]>
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
RDMA/vmw_pvrdma: Fix double free on pvrdma_alloc_ucontext() error path [+ + +]
Author: Jason Gunthorpe <[email protected]>
Date:   Tue Apr 28 13:17:43 2026 -0300

    RDMA/vmw_pvrdma: Fix double free on pvrdma_alloc_ucontext() error path
    
    commit e38e86995df27f1f854063dab1f0c6a513db3faf upstream.
    
    Sashiko points out that pvrdma_uar_free() is already called within
    pvrdma_dealloc_ucontext(), so calling it before triggers a double free.
    
    Cc: [email protected]
    Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
    Link: https://sashiko.dev/#/patchset/0-v1-e911b76a94d1%2B65d95-rdma_udata_rep_jgg%40nvidia.com?part=4
    Link: https://patch.msgid.link/r/[email protected]
    Signed-off-by: Jason Gunthorpe <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
regset: use kvzalloc() for regset_get_alloc() [+ + +]
Author: Douglas Anderson <[email protected]>
Date:   Sat Apr 25 15:14:21 2026 +0800

    regset: use kvzalloc() for regset_get_alloc()
    
    commit 6b839b3b76cf17296ebd4a893841f32cae08229c upstream.
    
    While browsing through ChromeOS crash reports, I found one with an
    allocation failure that looked like this:
    
      chrome: page allocation failure: order:7,
              mode:0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO),
              nodemask=(null),cpuset=urgent,mems_allowed=0
      CPU: 7 PID: 3295 Comm: chrome Not tainted
              5.15.133-20574-g8044615ac35c #1 (HASH:1162 1)
      Hardware name: Google Lazor (rev3 - 8) with KB Backlight (DT)
      Call trace:
      ...
      warn_alloc+0x104/0x174
      __alloc_pages+0x5f0/0x6e4
      kmalloc_order+0x44/0x98
      kmalloc_order_trace+0x34/0x124
      __kmalloc+0x228/0x36c
      __regset_get+0x68/0xcc
      regset_get_alloc+0x1c/0x28
      elf_core_dump+0x3d8/0xd8c
      do_coredump+0xeb8/0x1378
      get_signal+0x14c/0x804
      ...
    
    An order 7 allocation is (1 << 7) contiguous pages, or 512K. It's not
    a surprise that this allocation failed on a system that's been running
    for a while.
    
    More digging showed that it was fairly easy to see the order 7
    allocation by just sending a SIGQUIT to chrome (or other processes) to
    generate a core dump. The actual amount being allocated was 279,584
    bytes and it was for "core_note_type" NT_ARM_SVE.
    
    There was quite a bit of discussion [1] on the mailing lists in
    response to my v1 patch attempting to switch to vmalloc. The overall
    conclusion was that we could likely reduce the 279,584 byte allocation
    by quite a bit and Mark Brown has sent a patch to that effect [2].
    However even with the 279,584 byte allocation gone there are still
    65,552 byte allocations. These are just barely more than the 65,536
    bytes and thus would require an order 5 allocation.
    
    An order 5 allocation is still something to avoid unless necessary and
    nothing needs the memory here to be contiguous. Change the allocation
    to kvzalloc() which should still be efficient for small allocations
    but doesn't force the memory subsystem to work hard (and maybe fail)
    at getting a large contiguous chunk.
    
    [1] https://lore.kernel.org/r/20240201171159.1.Id9ad163b60d21c9e56c2d686b0cc9083a8ba7924@changeid
    [2] https://lore.kernel.org/r/20240203-arm64-sve-ptrace-regset-size-v1-1-2c3ba1386b9e@kernel.org
    
    Link: https://lkml.kernel.org/r/20240205092626.v2.1.Id9ad163b60d21c9e56c2d686b0cc9083a8ba7924@changeid
    Signed-off-by: Douglas Anderson <[email protected]>
    Reviewed-by: Catalin Marinas <[email protected]>
    Cc: Al Viro <[email protected]>
    Cc: Christian Brauner <[email protected]>
    Cc: Dave Martin <[email protected]>
    Cc: Eric Biederman <[email protected]>
    Cc: Jan Kara <[email protected]>
    Cc: Kees Cook <[email protected]>
    Cc: Mark Brown <[email protected]>
    Cc: Matthew Wilcox (Oracle) <[email protected]>
    Cc: Oleg Nesterov <[email protected]>
    Cc: Will Deacon <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Wen Yang <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
regulator: act8945a: fix OF node reference imbalance [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Wed Apr 8 09:30:54 2026 +0200

    regulator: act8945a: fix OF node reference imbalance
    
    commit 0d15ce31375ccef4162f960b34547a821b7619d2 upstream.
    
    The driver reuses the OF node of the parent multi-function device but
    fails to take another reference to balance the one dropped by the
    platform bus code when unbinding the MFD and deregistering the child
    devices.
    
    Fix this by using the intended helper for reusing OF nodes.
    
    Fixes: 38c09961048b ("regulator: act8945a: add regulator driver for ACT8945A")
    Cc: [email protected]      # 4.6
    Cc: Wenyou Yang <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

regulator: bd9571mwv: fix OF node reference imbalance [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Wed Apr 8 09:30:55 2026 +0200

    regulator: bd9571mwv: fix OF node reference imbalance
    
    commit 8498100ee1d00422b8c5b161b3e332278b92a59a upstream.
    
    The driver reuses the OF node of the parent multi-function device but
    fails to take another reference to balance the one dropped by the
    platform bus code when unbinding the MFD and deregistering the child
    devices.
    
    Fix this by using the intended helper for reusing OF nodes.
    
    Fixes: e85c5a153fe2 ("regulator: Add ROHM BD9571MWV-M PMIC regulator driver")
    Cc: [email protected]      # 4.12
    Cc: Marek Vasut <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

regulator: max77650: fix OF node reference imbalance [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Wed Apr 8 09:30:51 2026 +0200

    regulator: max77650: fix OF node reference imbalance
    
    commit 2edaf5f7ada0ab5c9ec1f0836bd19779a8d85262 upstream.
    
    The driver reuses the OF node of the parent multi-function device but
    fails to take another reference to balance the one dropped by the
    platform bus code when unbinding the MFD and deregistering the child
    devices.
    
    Fix this by using the intended helper for reusing OF nodes.
    
    Fixes: bcc61f1c44fd ("regulator: max77650: add regulator support")
    Cc: [email protected]      # 5.1
    Reviewed-by: Bartosz Golaszewski <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

regulator: mt6357: fix OF node reference imbalance [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Wed Apr 8 09:30:52 2026 +0200

    regulator: mt6357: fix OF node reference imbalance
    
    commit 2f38e96c273e15f5e9f5d1fc2c0cbba703751602 upstream.
    
    The driver reuses the OF node of the parent multi-function device but
    fails to take another reference to balance the one dropped by the
    platform bus code when unbinding the MFD and deregistering the child
    devices.
    
    Fix this by using the intended helper for reusing OF nodes.
    
    Fixes: dafc7cde23dc ("regulator: add mt6357 regulator")
    Cc: [email protected]      # 6.2
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

regulator: rk808: fix OF node reference imbalance [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Wed Apr 8 09:30:50 2026 +0200

    regulator: rk808: fix OF node reference imbalance
    
    commit 65290b24d8a5f0b8cd065201e653db824c4a4da6 upstream.
    
    The driver reuses the OF node of the parent multi-function device but
    fails to take another reference to balance the one dropped by the
    platform bus code when unbinding the MFD and deregistering the child
    devices.
    
    Fix this by using the intended helper for reusing OF nodes.
    
    Fixes: 647e57351f8e ("regulator: rk808: reduce 'struct rk808' usage")
    Cc: [email protected]      # 6.2
    Reviewed-by: Sebastian Reichel <[email protected]>
    Reviewed-by: Douglas Anderson <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
remoteproc: xlnx: Only access buffer information if IPI is buffered [+ + +]
Author: Ben Levinsky <[email protected]>
Date:   Tue Mar 3 15:51:27 2026 -0800

    remoteproc: xlnx: Only access buffer information if IPI is buffered
    
    commit 38dd6ccfdfbbe865569a52fe1ba9fa1478f672e6 upstream.
    
    In the receive callback check if message is NULL to prevent
    possibility of crash by NULL pointer dereferencing.
    
    Signed-off-by: Ben Levinsky <[email protected]>
    Signed-off-by: Tanmay Shah <[email protected]>
    Fixes: 5dfb28c257b7 ("remoteproc: xilinx: Add mailbox channels for rpmsg")
    Cc: [email protected]
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Mathieu Poirier <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
Revert "ALSA: usb: Increase volume range that triggers a warning" [+ + +]
Author: Rong Zhang <[email protected]>
Date:   Wed Mar 4 03:47:56 2026 +0800

    Revert "ALSA: usb: Increase volume range that triggers a warning"
    
    commit 41d78cb724f4b40b7548af420ccfe524b14023bb upstream.
    
    UAC uses 2 bytes to store volume values, so the maximum volume range is
    0xFFFF (65535, val = -32768/32767/1).
    
    The reverted commit bumpped the range of triggering the warning to >
    65535, effectively making the range check a no-op. It didn't fix
    anything but covered any potential problems and deviated from the
    original intention of the range check.
    
    This reverts commit 6b971191fcfc9e3c2c0143eea22534f1f48dbb62.
    
    Fixes: 6b971191fcfc ("ALSA: usb: Increase volume range that triggers a warning")
    Cc: [email protected]
    Signed-off-by: Rong Zhang <[email protected]>
    Acked-by: Arun Raghavan <[email protected]>
    Signed-off-by: Takashi Iwai <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rtc: ntxec: fix OF node reference imbalance [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Tue Apr 7 14:27:17 2026 +0200

    rtc: ntxec: fix OF node reference imbalance
    
    commit 30c4d2f26bb3538c328035cea2e6265c8320539e upstream.
    
    The driver reuses the OF node of the parent multi-function device but
    fails to take another reference to balance the one dropped by the
    platform bus code when unbinding the MFD and deregistering the child
    devices.
    
    Fix this by using the intended helper for reusing OF nodes.
    
    Fixes: 435af89786c6 ("rtc: New driver for RTC in Netronix embedded controller")
    Cc: [email protected]      # 5.13
    Cc: Jonathan Neuschäfer <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Alexandre Belloni <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rtmutex: Use waiter::task instead of current in remove_waiter() [+ + +]
Author: Keenan Dong <[email protected]>
Date:   Wed Apr 8 16:46:00 2026 +0800

    rtmutex: Use waiter::task instead of current in remove_waiter()
    
    commit 3bfdc63936dd4773109b7b8c280c0f3b5ae7d349 upstream.
    
    remove_waiter() is used by the slowlock paths, but it is also used for
    proxy-lock rollback in rt_mutex_start_proxy_lock() when invoked from
    futex_requeue().
    
    In the latter case waiter::task is not current, but remove_waiter()
    operates on current for the dequeue operation. That results in several
    problems:
    
      1) the rbtree dequeue happens without waiter::task::pi_lock being held
    
      2) the waiter task's pi_blocked_on state is not cleared, which leaves a
         dangling pointer primed for UAF around.
    
      3) rt_mutex_adjust_prio_chain() operates on the wrong top priority waiter
         task
    
    Use waiter::task instead of current in all related operations in
    remove_waiter() to cure those problems.
    
    [ tglx: Fixup rt_mutex_adjust_prio_chain(), add a comment and amend the
            changelog ]
    
    Fixes: 8161239a8bcc ("rtmutex: Simplify PI algorithm and make highest prio task get lock")
    Reported-by: Yuan Tan <[email protected]>
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Reported-by: Xin Liu <[email protected]>
    Signed-off-by: Keenan Dong <[email protected]>
    Signed-off-by: Thomas Gleixner <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
rxrpc: Also unshare DATA/RESPONSE packets when paged frags are present [+ + +]
Author: Hyunwoo Kim <[email protected]>
Date:   Fri May 8 17:53:09 2026 +0900

    rxrpc: Also unshare DATA/RESPONSE packets when paged frags are present
    
    commit aa54b1d27fe0c2b78e664a34fd0fdf7cd1960d71 upstream.
    
    The DATA-packet handler in rxrpc_input_call_event() and the RESPONSE
    handler in rxrpc_verify_response() copy the skb to a linear one before
    calling into the security ops only when skb_cloned() is true.  An skb
    that is not cloned but still carries externally-owned paged fragments
    (e.g. SKBFL_SHARED_FRAG set by splice() into a UDP socket via
    __ip_append_data, or a chained skb_has_frag_list()) falls through to
    the in-place decryption path, which binds the frag pages directly into
    the AEAD/skcipher SGL via skb_to_sgvec().
    
    Extend the gate to also unshare when skb_has_frag_list() or
    skb_has_shared_frag() is true.  This catches the splice-loopback vector
    and other externally-shared frag sources while preserving the
    zero-copy fast path for skbs whose frags are kernel-private (e.g. NIC
    page_pool RX, GRO).  The OOM/trace handling already in place is reused.
    
    Fixes: d0d5c0cd1e71 ("rxrpc: Use skb_unshare() rather than skb_cow_data()")
    Cc: [email protected]
    Signed-off-by: Hyunwoo Kim <[email protected]>
    Reviewed-by: Jiayuan Chen <[email protected]>
    Acked-by: David Howells <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Wentao Guan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

rxrpc: Fix conn-level packet handling to unshare RESPONSE packets [+ + +]
Author: David Howells <[email protected]>
Date:   Sun May 3 10:33:17 2026 -0400

    rxrpc: Fix conn-level packet handling to unshare RESPONSE packets
    
    [ Upstream commit 24481a7f573305706054c59e275371f8d0fe919f ]
    
    The security operations that verify the RESPONSE packets decrypt bits of it
    in place - however, the sk_buff may be shared with a packet sniffer, which
    would lead to the sniffer seeing an apparently corrupt packet (actually
    decrypted).
    
    Fix this by handing a copy of the packet off to the specific security
    handler if the packet was cloned.
    
    Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
    Closes: https://sashiko.dev/#/patchset/20260408121252.2249051-1-dhowells%40redhat.com
    Signed-off-by: David Howells <[email protected]>
    cc: Marc Dionne <[email protected]>
    cc: Jeffrey Altman <[email protected]>
    cc: Simon Horman <[email protected]>
    cc: [email protected]
    cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

rxrpc: Fix memory leaks in rxkad_verify_response() [+ + +]
Author: David Howells <[email protected]>
Date:   Wed Apr 22 17:14:30 2026 +0100

    rxrpc: Fix memory leaks in rxkad_verify_response()
    
    commit 34f61a07e0cdefaecd3ec03bb5fb22215643678f upstream.
    
    Fix rxkad_verify_response() to free the ticket and the server key under all
    circumstances by initialising the ticket pointer to NULL and then making
    all paths through the function after the first allocation has been done go
    through a single common epilogue that just releases everything - where all
    the releases skip on a NULL pointer.
    
    Fixes: 57af281e5389 ("rxrpc: Tidy up abort generation infrastructure")
    Fixes: ec832bd06d6f ("rxrpc: Don't retain the server key in the connection")
    Closes: https://sashiko.dev/#/patchset/20260408121252.2249051-1-dhowells%40redhat.com
    Signed-off-by: David Howells <[email protected]>
    cc: Marc Dionne <[email protected]>
    cc: Jeffrey Altman <[email protected]>
    cc: Simon Horman <[email protected]>
    cc: [email protected]
    cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

rxrpc: Fix potential UAF after skb_unshare() failure [+ + +]
Author: David Howells <[email protected]>
Date:   Fri May 8 16:31:42 2026 +0800

    rxrpc: Fix potential UAF after skb_unshare() failure
    
    [ Upstream commit 1f2740150f904bfa60e4bad74d65add3ccb5e7f8 ]
    
    If skb_unshare() fails to unshare a packet due to allocation failure in
    rxrpc_input_packet(), the skb pointer in the parent (rxrpc_io_thread())
    will be NULL'd out.  This will likely cause the call to
    trace_rxrpc_rx_done() to oops.
    
    Fix this by moving the unsharing down to where rxrpc_input_call_event()
    calls rxrpc_input_call_packet().  There are a number of places prior to
    that where we ignore DATA packets for a variety of reasons (such as the
    call already being complete) for which an unshare is then avoided.
    
    And with that, rxrpc_input_packet() doesn't need to take a pointer to the
    pointer to the packet, so change that to just a pointer.
    
    Fixes: 2d1faf7a0ca3 ("rxrpc: Simplify skbuff accounting in receive path")
    Closes: https://sashiko.dev/#/patchset/20260408121252.2249051-1-dhowells%40redhat.com
    Signed-off-by: David Howells <[email protected]>
    cc: Marc Dionne <[email protected]>
    cc: Jeffrey Altman <[email protected]>
    cc: Simon Horman <[email protected]>
    cc: [email protected]
    cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    [ Relocated the unshare/skb_copy block from rxrpc_input_call_event()'s rx_queue dequeue loop to existing `if (skb) rxrpc_input_call_packet()` site, and substituted rxrpc_skb_put_call_rx with rxrpc_skb_put_input. ]
    Signed-off-by: Sasha Levin <[email protected]>
    [ Readd rxrpc_skb_put_response_copy() or will cause a build fail with commit 24481a7f5733 ("rxrpc: Fix conn-level packet handling to unshare RESPONSE packets") ]
    Signed-off-by: Wentao Guan <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

rxrpc: Fix re-decryption of RESPONSE packets [+ + +]
Author: David Howells <[email protected]>
Date:   Thu Apr 23 21:09:07 2026 +0100

    rxrpc: Fix re-decryption of RESPONSE packets
    
    commit 0422e7a4883f25101903f3e8105c0808aa5f4ce9 upstream.
    
    If a RESPONSE packet gets a temporary failure during processing, it may end
    up in a partially decrypted state - and then get requeued for a retry.
    
    Fix this by just discarding the packet; we will send another CHALLENGE
    packet and thereby elicit a further response.  Similarly, discard an
    incoming CHALLENGE packet if we get an error whilst generating a RESPONSE;
    the server will send another CHALLENGE.
    
    Fixes: 17926a79320a ("[AF_RXRPC]: Provide secure RxRPC sockets for use by userspace and kernel both")
    Closes: https://sashiko.dev/#/patchset/[email protected]
    Signed-off-by: David Howells <[email protected]>
    cc: Marc Dionne <[email protected]>
    cc: Jeffrey Altman <[email protected]>
    cc: Simon Horman <[email protected]>
    cc: [email protected]
    cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

rxrpc: Fix rxkad crypto unalignment handling [+ + +]
Author: David Howells <[email protected]>
Date:   Wed Apr 22 17:14:31 2026 +0100

    rxrpc: Fix rxkad crypto unalignment handling
    
    commit def304aae2edf321d2671fd6ca766a93c21f877e upstream.
    
    Fix handling of a packet with a misaligned crypto length.  Also handle
    non-ENOMEM errors from decryption by aborting.  Further, remove the
    WARN_ON_ONCE() so that it can't be remotely triggered (a trace line can
    still be emitted).
    
    Fixes: f93af41b9f5f ("rxrpc: Fix missing error checks for rxkad encryption/decryption failure")
    Closes: https://sashiko.dev/#/patchset/20260408121252.2249051-1-dhowells%40redhat.com
    Signed-off-by: David Howells <[email protected]>
    cc: Marc Dionne <[email protected]>
    cc: Jeffrey Altman <[email protected]>
    cc: Simon Horman <[email protected]>
    cc: [email protected]
    cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

rxrpc: Fix rxrpc_input_call_event() to only unshare DATA packets [+ + +]
Author: David Howells <[email protected]>
Date:   Fri May 8 15:40:56 2026 -0400

    rxrpc: Fix rxrpc_input_call_event() to only unshare DATA packets
    
    [ Upstream commit 55b2984c96c37f909bbfe8851f13152693951382 ]
    
    Fix rxrpc_input_call_event() to only unshare DATA packets and not ACK,
    ABORT, etc..
    
    And with that, rxrpc_input_packet() doesn't need to take a pointer to the
    pointer to the packet, so change that to just a pointer.
    
    Fixes: 1f2740150f90 ("rxrpc: Fix potential UAF after skb_unshare() failure")
    Closes: https://sashiko.dev/#/patchset/[email protected]
    Signed-off-by: David Howells <[email protected]>
    cc: Marc Dionne <[email protected]>
    cc: Jeffrey Altman <[email protected]>
    cc: Simon Horman <[email protected]>
    cc: [email protected]
    cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
s390/debug: Reject zero-length input in debug_input_flush_fn() [+ + +]
Author: Vasily Gorbik <[email protected]>
Date:   Fri Apr 17 14:33:43 2026 +0200

    s390/debug: Reject zero-length input in debug_input_flush_fn()
    
    commit e14622a7584f9608927c59a7d6ae4a0999dc545e upstream.
    
    debug_input_flush_fn() always copies one byte from the userspace buffer
    with copy_from_user() regardless of the supplied write length. A
    zero-length write therefore reads one byte beyond the caller's buffer.
    If the stale byte happens to be '-' or a digit the debug log is
    silently flushed. With an unmapped buffer the call returns -EFAULT.
    
    Reject zero-length writes before copying from userspace.
    
    Cc: [email protected] # v5.10+
    Acked-by: Heiko Carstens <[email protected]>
    Signed-off-by: Vasily Gorbik <[email protected]>
    Signed-off-by: Alexander Gordeev <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
sched: Use u64 for bandwidth ratio calculations [+ + +]
Author: Joseph Salisbury <[email protected]>
Date:   Sat May 2 19:30:19 2026 -0400

    sched: Use u64 for bandwidth ratio calculations
    
    [ Upstream commit c6e80201e057dfb7253385e60bf541121bf5dc33 ]
    
    to_ratio() computes BW_SHIFT-scaled bandwidth ratios from u64 period and
    runtime values, but it returns unsigned long.  tg_rt_schedulable() also
    stores the current group limit and the accumulated child sum in unsigned
    long.
    
    On 32-bit builds, large bandwidth ratios can be truncated and the RT
    group sum can wrap when enough siblings are present.  That can let an
    overcommitted RT hierarchy pass the schedulability check, and it also
    narrows the helper result for other callers.
    
    Return u64 from to_ratio() and use u64 for the RT group totals so
    bandwidth ratios are preserved and compared at full width on both 32-bit
    and 64-bit builds.
    
    Fixes: b40b2e8eb521 ("sched: rt: multi level group constraints")
    Assisted-by: Codex:GPT-5
    Signed-off-by: Joseph Salisbury <[email protected]>
    Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
    Cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    [ dropped `extern` keyword from `to_ratio()` declaration ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
scsi: sd: fix missing put_disk() when device_add(&disk_dev) fails [+ + +]
Author: Yang Xiuwei <[email protected]>
Date:   Mon Mar 30 09:49:52 2026 +0800

    scsi: sd: fix missing put_disk() when device_add(&disk_dev) fails
    
    commit 1e111c4b3a726df1254670a5cc4868cedb946d37 upstream.
    
    If device_add(&sdkp->disk_dev) fails, put_device() runs
    scsi_disk_release(), which frees the scsi_disk but leaves the gendisk
    referenced. The device_add_disk() error path in sd_probe() calls
    put_disk(gd); call put_disk(gd) here to mirror that cleanup.
    
    Fixes: 265dfe8ebbab ("scsi: sd: Free scsi_disk device via put_device()")
    Cc: [email protected]
    Reviewed-by: John Garry <[email protected]>
    Signed-off-by: Yang Xiuwei <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

scsi: target: configfs: Bound snprintf() return in tg_pt_gp_members_show() [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Sat Apr 11 14:06:00 2026 +0200

    scsi: target: configfs: Bound snprintf() return in tg_pt_gp_members_show()
    
    commit 772a896a56e0e3ef9424a025cec9176f9d8f4552 upstream.
    
    target_tg_pt_gp_members_show() formats LUN paths with snprintf() into a
    256-byte stack buffer, then will memcpy() cur_len bytes from that
    buffer.  snprintf() returns the length the output would have had, which
    can exceed the buffer size when the fabric WWN is long because iSCSI IQN
    names can be up to 223 bytes.  The check at the memcpy() site only
    guards the destination page write, not the source read, so memcpy() will
    read past the stack buffer and copy adjacent stack contents to the sysfs
    reader, which when CONFIG_FORTIFY_SOURCE is enabled, fortify_panic()
    will be triggered.
    
    Commit 27e06650a5ea ("scsi: target: target_core_configfs: Add length
    check to avoid buffer overflow") added the same bound to the
    target_lu_gp_members_show() but the tg_pt_gp variant was missed so
    resolve that here.
    
    Cc: Martin K. Petersen <[email protected]>
    Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
    Assisted-by: gregkh_clanker_t1000
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Link: https://patch.msgid.link/2026041159-garter-theft-3be0@gregkh
    Signed-off-by: Martin K. Petersen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
sctp: revalidate list cursor after sctp_sendmsg_to_asoc() in SCTP_SENDALL [+ + +]
Author: Ben Morris <[email protected]>
Date:   Thu May 7 17:14:55 2026 -0700

    sctp: revalidate list cursor after sctp_sendmsg_to_asoc() in SCTP_SENDALL
    
    commit abb5f36771cc4c05899b34000829a787572a8817 upstream.
    
    The SCTP_SENDALL path in sctp_sendmsg() iterates ep->asocs with
    list_for_each_entry_safe(), which caches the next entry in @tmp before
    the loop body runs.  The body calls sctp_sendmsg_to_asoc(), which may
    drop the socket lock inside sctp_wait_for_sndbuf().
    
    While the lock is dropped, another thread can SCTP_SOCKOPT_PEELOFF the
    association cached in @tmp, migrating it to a new endpoint via
    sctp_sock_migrate() (list_del_init() + list_add_tail() to
    newep->asocs), and optionally close the new socket which frees the
    association via kfree_rcu().  The cached @tmp can also be freed by a
    network ABORT for that association, processed in softirq while the
    lock is dropped.
    
    sctp_wait_for_sndbuf() revalidates @asoc (the current entry) on re-lock
    via the "sk != asoc->base.sk" and "asoc->base.dead" checks, but nothing
    revalidates @tmp.  After a successful return, the iterator advances to
    the stale @tmp, yielding either a use-after-free (if the peeled socket
    was closed) or a list-walk onto the new endpoint's list head (type
    confusion of &newep->asocs as a struct sctp_association *).
    
    Both are reachable from CapEff=0; the type-confusion path gives
    controlled indirect call via the outqueue.sched->init_sid pointer.
    
    Fix by re-deriving @tmp from @asoc after sctp_sendmsg_to_asoc()
    returns.  @asoc is known to still be on ep->asocs at that point: the
    only callers that list_del an association from ep->asocs are
    sctp_association_free() (which sets asoc->base.dead) and
    sctp_assoc_migrate() (which changes asoc->base.sk), and
    sctp_wait_for_sndbuf() checks both under the lock before any
    successful return; a tripped check propagates as err < 0 and the loop
    bails before the re-derive.
    
    The SCTP_ABORT path in sctp_sendmsg_check_sflags() returns 0 and the
    loop hits 'continue' before sctp_sendmsg_to_asoc() is ever called, so
    the @tmp cached by list_for_each_entry_safe() still covers the
    lock-held free that ba59fb027307 ("sctp: walk the list of asoc
    safely") was added for.
    
    Fixes: 4910280503f3 ("sctp: add support for snd flag SCTP_SENDALL process in sendmsg")
    Cc: [email protected]
    Signed-off-by: Ben Morris <[email protected]>
    Acked-by: Xin Long <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
seg6: fix seg6 lwtunnel output redirect for L2 reduced encap mode [+ + +]
Author: Andrea Mayer <[email protected]>
Date:   Sat Apr 18 18:28:38 2026 +0200

    seg6: fix seg6 lwtunnel output redirect for L2 reduced encap mode
    
    commit ade67d5f588832c7ba131aadd4215a94ce0a15c8 upstream.
    
    When SEG6_IPTUN_MODE_L2ENCAP_RED (L2ENCAP_RED) was introduced, the
    condition in seg6_build_state() that excludes L2 encap modes from
    setting LWTUNNEL_STATE_OUTPUT_REDIRECT was not updated to account for
    the new mode.
    As a consequence, L2ENCAP_RED routes incorrectly trigger seg6_output()
    on the output path, where the packet is silently dropped because
    skb_mac_header_was_set() fails on L3 packets.
    
    Extend the check to also exclude L2ENCAP_RED, consistent with L2ENCAP.
    
    Fixes: 13f0296be8ec ("seg6: add support for SRv6 H.L2Encaps.Red behavior")
    Cc: [email protected]
    Signed-off-by: Andrea Mayer <[email protected]>
    Reviewed-by: Justin Iurman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
selftests/bpf: add stack access precision test [+ + +]
Author: Andrii Nakryiko <[email protected]>
Date:   Mon May 11 18:23:40 2026 +0200

    selftests/bpf: add stack access precision test
    
    [ Upstream commit 876301881c436bf38e83a2c0d276a24b642e4aab ]
    
    Add a new selftests that validates precision tracking for stack access
    instruction, using both r10-based and non-r10-based accesses. For
    non-r10 ones we also make sure to have non-zero var_off to validate that
    final stack offset is tracked properly in instruction history
    information inside verifier.
    
    Acked-by: Eduard Zingerman <[email protected]>
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Paul Chaignon <[email protected]>
    Acked-by: Shung-Hsi Yu <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

selftests/bpf: validate fake register spill/fill precision backtracking logic [+ + +]
Author: Andrii Nakryiko <[email protected]>
Date:   Mon May 11 18:25:19 2026 +0200

    selftests/bpf: validate fake register spill/fill precision backtracking logic
    
    [ Upstream commit 7d8ed51bcb32716a40d71043fcd01c4118858c51 ]
    
    Add two tests validating that verifier's precision backtracking logic
    handles BPF_ST_MEM instructions that produce fake register spill into
    register slot. This is happening when non-zero constant is written
    directly to a slot, e.g., *(u64 *)(r10 -8) = 123.
    
    Add both full 64-bit register spill, as well as 32-bit "sub-spill".
    
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Acked-by: Eduard Zingerman <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    [ Note: Adapted the expected log format for the selftests because it
      changed later on in commits 67d43dfbb42d, 0c95c9fdb696, and
      1db747d75b1d. ]
    Signed-off-by: Paul Chaignon <[email protected]>
    Acked-by: Shung-Hsi Yu <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

selftests/bpf: validate precision logic in partial_stack_load_preserves_zeros [+ + +]
Author: Andrii Nakryiko <[email protected]>
Date:   Mon May 11 18:24:52 2026 +0200

    selftests/bpf: validate precision logic in partial_stack_load_preserves_zeros
    
    [ Upstream commit 064e0bea19b356c5d5f48a4549d80a3c03ce898b ]
    
    Enhance partial_stack_load_preserves_zeros subtest with detailed
    precision propagation log checks. We know expect fp-16 to be spilled,
    initially imprecise, zero const register, which is later marked as
    precise even when partial stack slot load is performed, even if it's not
    a register fill (!).
    
    Acked-by: Eduard Zingerman <[email protected]>
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Paul Chaignon <[email protected]>
    Acked-by: Shung-Hsi Yu <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

selftests/bpf: validate STACK_ZERO is preserved on subreg spill [+ + +]
Author: Andrii Nakryiko <[email protected]>
Date:   Mon May 11 18:24:01 2026 +0200

    selftests/bpf: validate STACK_ZERO is preserved on subreg spill
    
    [ Upstream commit b33ceb6a3d2ee07fdd836373383a6d4783581324 ]
    
    Add tests validating that STACK_ZERO slots are preserved when slot is
    partially overwritten with subregister spill.
    
    Acked-by: Eduard Zingerman <[email protected]>
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Paul Chaignon <[email protected]>
    Acked-by: Shung-Hsi Yu <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

selftests/bpf: validate zero preservation for sub-slot loads [+ + +]
Author: Andrii Nakryiko <[email protected]>
Date:   Mon May 11 18:24:27 2026 +0200

    selftests/bpf: validate zero preservation for sub-slot loads
    
    [ Upstream commit add1cd7f22e61756987865ada9fe95cd86569025 ]
    
    Validate that 1-, 2-, and 4-byte loads from stack slots not aligned on
    8-byte boundary still preserve zero, when loading from all-STACK_ZERO
    sub-slots, or when stack sub-slots are covered by spilled register with
    known constant zero value.
    
    Signed-off-by: Andrii Nakryiko <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alexei Starovoitov <[email protected]>
    Signed-off-by: Paul Chaignon <[email protected]>
    Acked-by: Shung-Hsi Yu <[email protected]>
    Acked-by: Daniel Borkmann <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
selftests/mqueue: Fix incorrectly named file [+ + +]
Author: Simon Liebold <[email protected]>
Date:   Thu Mar 12 14:02:00 2026 +0000

    selftests/mqueue: Fix incorrectly named file
    
    commit 64fac99037689020ad97e472ae898e96ea3616dc upstream.
    
    Commit 85506aca2eb4 ("selftests/mqueue: Set timeout to 180 seconds")
    intended to increase the timeout for mq_perf_tests from the default
    kselftest limit of 45 seconds to 180 seconds.
    
    Unfortunately, the file storing this information was incorrectly named
    `setting` instead of `settings`, causing the kselftest runner not to
    pick up the limit and keep using the default 45 seconds limit.
    
    Fix this by renaming it to `settings` to ensure that the kselftest
    runner uses the increased timeout of 180 seconds for this test.
    
    Fixes: 85506aca2eb4 ("selftests/mqueue: Set timeout to 180 seconds")
    Cc: <[email protected]> # 5.10.y
    Signed-off-by: Simon Liebold <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Shuah Khan <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
selinux: don't reserve xattr slot when we won't fill it [+ + +]
Author: David Windsor <[email protected]>
Date:   Sun Apr 26 19:23:49 2026 -0400

    selinux: don't reserve xattr slot when we won't fill it
    
    commit 1e5a8eed7821e7a43a31b4c1b3675a91be6bc6f6 upstream.
    
    Move lsm_get_xattr_slot() below the SBLABEL_MNT check so we don't leave
    a NULL-named slot in the array when returning -EOPNOTSUPP; filesystem
    initxattrs() callbacks stop iterating at the first NULL ->name, silently
    dropping xattrs installed by later LSMs.
    
    Cc: [email protected]
    Signed-off-by: David Windsor <[email protected]>
    Signed-off-by: Paul Moore <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

selinux: prune /sys/fs/selinux/disable [+ + +]
Author: Stephen Smalley <[email protected]>
Date:   Tue May 5 08:49:49 2026 -0400

    selinux: prune /sys/fs/selinux/disable
    
    commit 19cfa0099024bb9cd40f6d950caa7f47ff8e77f6 upstream.
    
    Commit f22f9aaf6c3d ("selinux: remove the runtime disable
    functionality") removed the underlying SELinux runtime disable
    functionality but left everything else intact and started logging an
    error message to warn any residual users.
    
    Prune it to just log an error message once and to return count
    (i.e. all bytes written successfully) to avoid breaking
    userspace. This also fixes a local DoS from logspam.
    
    Cc: [email protected]
    Signed-off-by: Stephen Smalley <[email protected]>
    Signed-off-by: Paul Moore <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

selinux: shrink critical section in sel_write_load() [+ + +]
Author: Stephen Smalley <[email protected]>
Date:   Thu Apr 30 14:36:52 2026 -0400

    selinux: shrink critical section in sel_write_load()
    
    commit 868f31e4061eca8c3cd607d79d954d5e54f204aa upstream.
    
    Currently sel_write_load() takes the policy mutex earlier than
    necessary. Move the taking of the mutex later. This avoids
    holding it unnecessarily across the vmalloc() and copy_from_user()
    of the policy data.
    
    Cc: [email protected]
    Signed-off-by: Stephen Smalley <[email protected]>
    Signed-off-by: Paul Moore <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
smb/client: fix out-of-bounds read in smb2_compound_op() [+ + +]
Author: Zisen Ye <[email protected]>
Date:   Wed May 6 11:49:08 2026 +0800

    smb/client: fix out-of-bounds read in smb2_compound_op()
    
    commit 8d09328dfda089675e4c049f3f256064a1d1996b upstream.
    
    If a server sends a truncated response but a large OutputBufferLength, and
    terminates the EA list early, check_wsl_eas() returns success without
    validating that the entire OutputBufferLength fits within iov_len.
    
    Then smb2_compound_op() does:
        memcpy(idata->wsl.eas, data[0], size[0]);
    
    Where size[0] is OutputBufferLength. If iov_len is smaller than size[0],
    memcpy can read beyond the end of the rsp_iov allocation and leak adjacent
    kernel heap memory.
    
    Link: https://lore.kernel.org/linux-cifs/[email protected]/
    Fixes: ea41367b2a60 ("smb: client: introduce SMB2_OP_QUERY_WSL_EA")
    Cc: [email protected]
    Signed-off-by: Zisen Ye <[email protected]>
    Reviewed-by: ChenXiaoSong <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

smb/client: fix out-of-bounds read in symlink_data() [+ + +]
Author: Zisen Ye <[email protected]>
Date:   Sat May 2 18:48:36 2026 +0800

    smb/client: fix out-of-bounds read in symlink_data()
    
    commit d62b8d236fab503c6fec1d3e9a38bea71feaca20 upstream.
    
    Since smb2_check_message() returns success without length validation for
    the symlink error response, in symlink_data() it is possible for
    iov->iov_len to be smaller than sizeof(struct smb2_err_rsp). If the buffer
    only contains the base SMB2 header (64 bytes), accessing
    err->ErrorContextCount (at offset 66) or err->ByteCount later in
    symlink_data() will cause an out-of-bounds read.
    
    Link: https://lore.kernel.org/linux-cifs/[email protected]/
    Fixes: 76894f3e2f71 ("cifs: improve symlink handling for smb2+")
    Cc: [email protected]
    Signed-off-by: Zisen Ye <[email protected]>
    Reviewed-by: ChenXiaoSong <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
smb: client: use kzalloc to zero-initialize security descriptor buffer [+ + +]
Author: Bjoern Doebel <[email protected]>
Date:   Thu Apr 30 08:57:17 2026 +0000

    smb: client: use kzalloc to zero-initialize security descriptor buffer
    
    commit 5e489c6c47a2ac15edbaca153b9348e42c1eacab upstream.
    
    Commit 62e7dd0a39c2d ("smb: common: change the data type of num_aces
    to le16") split struct smb_acl's __le32 num_aces field into __le16
    num_aces and __le16 reserved. The reserved field corresponds to Sbz2
    in the MS-DTYP ACL wire format, which must be zero [1].
    
    When building an ACL descriptor in build_sec_desc(), we are using a
    kmalloc()'ed descriptor buffer and writing the fields explicitly using
    le16() writes now. This never writes to the 2 byte reserved field,
    leaving it as uninitialized heap data.
    
    When the reserved field happens to contain non-zero slab garbage,
    Samba rejects the security descriptor with "ndr_pull_security_descriptor
    failed: Range Error", causing chmod to fail with EINVAL.
    
    Change kmalloc() to kzalloc() to ensure the entire buffer is
    zero-initialized.
    
    Fixes: 62e7dd0a39c2d ("smb: common: change the data type of num_aces to le16")
    Cc: [email protected]
    
    Signed-off-by: Bjoern Doebel <[email protected]>
    Assisted-by: Kiro:claude-opus-4.6
    [1] https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/20233ed8-a6c6-4097-aafa-dd545ed24428
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

smb: client: validate dacloffset before building DACL pointers [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Mon Apr 20 10:47:47 2026 -0400

    smb: client: validate dacloffset before building DACL pointers
    
    commit f98b48151cc502ada59d9778f0112d21f2586ca3 upstream.
    
    parse_sec_desc(), build_sec_desc(), and the chown path in
    id_mode_to_cifs_acl() all add the server-supplied dacloffset to pntsd
    before proving a DACL header fits inside the returned security
    descriptor.
    
    On 32-bit builds a malicious server can return dacloffset near
    U32_MAX, wrap the derived DACL pointer below end_of_acl, and then slip
    past the later pointer-based bounds checks. build_sec_desc() and
    id_mode_to_cifs_acl() can then dereference DACL fields from the wrapped
    pointer in the chmod/chown rewrite paths.
    
    Validate dacloffset numerically before building any DACL pointer and
    reuse the same helper at the three DACL entry points.
    
    Fixes: bc3e9dd9d104 ("cifs: Change SIDs in ACEs while transferring file ownership.")
    Cc: [email protected]
    Assisted-by: Claude:claude-opus-4-6
    Signed-off-by: Michael Bommarito <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

smb: client: validate the whole DACL before rewriting it in cifsacl [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Fri Apr 24 10:55:13 2026 -0400

    smb: client: validate the whole DACL before rewriting it in cifsacl
    
    [ Upstream commit 0a8cf165566ba55a39fd0f4de172119dd646d39a ]
    
    build_sec_desc() and id_mode_to_cifs_acl() derive a DACL pointer from a
    server-supplied dacloffset and then use the incoming ACL to rebuild the
    chmod/chown security descriptor.
    
    The original fix only checked that the struct smb_acl header fits before
    reading dacl_ptr->size or dacl_ptr->num_aces.  That avoids the immediate
    header-field OOB read, but the rewrite helpers still walk ACEs based on
    pdacl->num_aces with no structural validation of the incoming DACL body.
    
    A malicious server can return a truncated DACL that still contains a
    header, claims one or more ACEs, and then drive
    replace_sids_and_copy_aces() or set_chmod_dacl() past the validated
    extent while they compare or copy attacker-controlled ACEs.
    
    Factor the DACL structural checks into validate_dacl(), extend them to
    validate each ACE against the DACL bounds, and use the shared validator
    before the chmod/chown rebuild paths.  parse_dacl() reuses the same
    validator so the read-side parser and write-side rewrite paths agree on
    what constitutes a well-formed incoming DACL.
    
    Fixes: bc3e9dd9d104 ("cifs: Change SIDs in ACEs while transferring file ownership.")
    Cc: [email protected]
    Assisted-by: Claude:claude-opus-4-6
    Assisted-by: Codex:gpt-5-4
    Signed-off-by: Michael Bommarito <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    [ no kmalloc_objs ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

smb: common: change the data type of num_aces to le16 [+ + +]
Author: Namjae Jeon <[email protected]>
Date:   Fri Apr 24 09:04:00 2026 -0400

    smb: common: change the data type of num_aces to le16
    
    [ Upstream commit 62e7dd0a39c2d0d7ff03274c36df971f1b3d2d0d ]
    
    2.4.5 in [MS-DTYP].pdf describe the data type of num_aces as le16.
    
    AceCount (2 bytes): An unsigned 16-bit integer that specifies the count
    of the number of ACE records in the ACL.
    
    Change it to le16 and add reserved field to smb_acl struct.
    
    Reported-by: Igor Leite Ladessa <[email protected]>
    Tested-by: Igor Leite Ladessa <[email protected]>
    Signed-off-by: Namjae Jeon <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Stable-dep-of: d07b26f39246 ("ksmbd: require minimum ACE size in smb_check_perm_dacl()")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

smb: move some duplicate definitions to common/smbacl.h [+ + +]
Author: ChenXiaoSong <[email protected]>
Date:   Fri Apr 24 09:03:59 2026 -0400

    smb: move some duplicate definitions to common/smbacl.h
    
    [ Upstream commit b51174da743b6b7cd87c02e882ebe60dcb99f8bf ]
    
    In order to maintain the code more easily, move duplicate definitions
    to new common header file.
    
    Signed-off-by: ChenXiaoSong <[email protected]>
    Acked-by: Namjae Jeon <[email protected]>
    Signed-off-by: Steve French <[email protected]>
    Stable-dep-of: d07b26f39246 ("ksmbd: require minimum ACE size in smb_check_perm_dacl()")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
sound: ua101: fix division by zero at probe [+ + +]
Author: SeungJu Cheon <[email protected]>
Date:   Sun Apr 26 20:12:39 2026 +0900

    sound: ua101: fix division by zero at probe
    
    commit d1f73f169c1014463b5060e3f60813e13ddc7b87 upstream.
    
    Add a missing sanity check for bNrChannels in detect_usb_format()
    to prevent a division by zero in playback_urb_complete() and
    capture_urb_complete().
    
    USB core does not validate class-specific descriptor fields such
    as bNrChannels, so drivers must verify them before use. If a
    device provides bNrChannels = 0, frame_bytes becomes zero and is
    later used as a divisor in the URB completion handlers, leading
    to a kernel crash.
    
    Fixes: 63978ab3e3e9 ("sound: add Edirol UA-101 support")
    Cc: [email protected]
    Signed-off-by: SeungJu Cheon <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Takashi Iwai <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
spi: at91-usart: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu Apr 9 14:04:02 2026 +0200

    spi: at91-usart: fix controller deregistration
    
    commit 9acecc9bcff058eaef40fd7a4c3650e88b06b220 upstream.
    
    Make sure to deregister the controller before disabling and releasing
    underlying resources like clocks and DMA during driver unbind.
    
    Fixes: e1892546ff66 ("spi: at91-usart: Add driver for at91-usart as SPI")
    Cc: [email protected]      # 4.20
    Cc: Radu Pirea <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: atmel: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu Apr 9 14:04:03 2026 +0200

    spi: atmel: fix controller deregistration
    
    commit 8d4de97e83520be89d0ff40610ca633b3963a7de upstream.
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: 754ce4f29937 ("[PATCH] SPI: atmel_spi driver")
    Cc: [email protected]      # 2.6.21
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: bcm63xx: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu Apr 9 14:04:04 2026 +0200

    spi: bcm63xx: fix controller deregistration
    
    commit c39e65a4e3b8e764efed0b2f5152a1a8547b80fd upstream.
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: b42dfed83d95 ("spi: add Broadcom BCM63xx SPI controller driver")
    Cc: [email protected]      # 3.4
    Cc: Florian Fainelli <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: bcmbca-hsspi: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu Apr 9 14:04:06 2026 +0200

    spi: bcmbca-hsspi: fix controller deregistration
    
    commit c3d97c3320b9a1ebbd6119857341be034f7b3efc upstream.
    
    Make sure to deregister the controller before disabling underlying
    resources like interrupts during driver unbind to allow SPI drivers to
    do I/O during deregistration.
    
    Note that clocks were also disabled before the recent commit
    e532e21a246d ("spi: bcm63xx-hsspi: Simplify clock handling with
    devm_clk_get_enabled()").
    
    Fixes: a38a2233f23b ("spi: bcmbca-hsspi: Add driver for newer HSSPI controller")
    Cc: [email protected]      # 6.3: deb269e0394f
    Cc: [email protected]      # 6.3
    Cc: William Zhang <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: cadence: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Tue Apr 14 15:43:12 2026 +0200

    spi: cadence: fix controller deregistration
    
    commit 666fa7e9ca98e71c880086ca24147ae843f1ed6e upstream.
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: c474b3866546 ("spi: Add driver for Cadence SPI controller")
    Cc: [email protected]      # 3.16
    Cc: Harini Katakam <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: cadence: fix unclocked access on unbind [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Tue Apr 21 14:36:12 2026 +0200

    spi: cadence: fix unclocked access on unbind
    
    commit 5b1689a41f02955c5361944f748a4812a6ff9307 upstream.
    
    Make sure that the controller is runtime resumed before disabling it
    during driver unbind to avoid unclocked register access and unbalanced
    clock disable.
    
    Also restore the autosuspend setting.
    
    This issue was flagged by Sashiko when reviewing a controller
    deregistration fix.
    
    Fixes: d36ccd9f7ea4 ("spi: cadence: Runtime pm adaptation")
    Cc: [email protected]      # 4.7
    Cc: Shubhrajyoti Datta <[email protected]>
    Link: https://sashiko.dev/#/patchset/20260414134319.978196-1-johan%40kernel.org?part=1
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: coldfire-qspi: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu Apr 9 14:04:09 2026 +0200

    spi: coldfire-qspi: fix controller deregistration
    
    commit e7c510e192ff2a1264d999575eea39a506424264 upstream.
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks (via runtime pm) during driver unbind.
    
    Fixes: 34b8c6617366 ("spi: Add Freescale/Motorola Coldfire QSPI driver")
    Cc: [email protected]      # 2.6.34
    Cc: Steven King <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: dln2: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu Apr 9 14:04:10 2026 +0200

    spi: dln2: fix controller deregistration
    
    commit c353020fbfa8514ee91a6de2d88de4e5edca5803 upstream.
    
    Make sure to deregister the controller before disabling it to allow
    SPI device drivers to do I/O during deregistration.
    
    Fixes: 3d8c0d749da3 ("spi: add support for DLN-2 USB-SPI adapter")
    Cc: [email protected]      # 4.0
    Cc: Laurentiu Palcu <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: fix resource leaks on device setup failure [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Mon May 4 08:15:56 2026 -0400

    spi: fix resource leaks on device setup failure
    
    [ Upstream commit db357034f7e0cf23f233f414a8508312dfe8fbbe ]
    
    Make sure to call controller cleanup() if spi_setup() fails while
    registering a device to avoid leaking any resources allocated by
    setup().
    
    Fixes: c7299fea6769 ("spi: Fix spi device unregister flow")
    Cc: [email protected]      # 5.13
    Cc: Saravana Kannan <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: fsl-espi: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu Apr 9 14:04:12 2026 +0200

    spi: fsl-espi: fix controller deregistration
    
    commit e506a700a7ad229f5c8f01f4b8350119cccb4158 upstream.
    
    Make sure to deregister the controller before disabling runtime PM
    (which can leave the controller disabled) to allow SPI device drivers to
    do I/O during deregistration.
    
    Fixes: e9abb4db8d10 ("spi: fsl-espi: add runtime PM")
    Cc: [email protected]      # 4.3
    Cc: Heiner Kallweit <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: fsl: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Apr 10 08:47:49 2026 +0200

    spi: fsl: fix controller deregistration
    
    commit 9b7abfed4c3754062d1f3ffd452e65a38667f586 upstream.
    
    Make sure to deregister the controller before releasing underlying
    resources like DMA during driver unbind.
    
    Fixes: 4178b6b1b595 ("spi: fsl-(e)spi: migrate to using devm_ functions to simplify cleanup")
    Cc: [email protected]      # 4.3
    Cc: Heiner Kallweit <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: img-spfi: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu Apr 9 14:04:14 2026 +0200

    spi: img-spfi: fix controller deregistration
    
    commit fc3a83b0d9c16b941c9028f5a8db9541dce4ddf2 upstream.
    
    Make sure to deregister the controller before disabling and releasing
    underlying resources like clocks and DMA during driver unbind.
    
    Fixes: deba25800a12 ("spi: Add driver for IMG SPFI controller")
    Cc: [email protected]      # 3.19
    Cc: Andrew Bresticker <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: imx: fix runtime pm leak on probe deferral [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Tue Apr 21 14:56:32 2026 +0200

    spi: imx: fix runtime pm leak on probe deferral
    
    commit a1d50a37d3b1df84f536a982f692371039df4a48 upstream.
    
    Make sure to balance the runtime PM usage count before returning on
    probe failure (e.g. probe deferral) so that the controller can be
    suspended when a driver is later bound.
    
    Fixes: 43b6bf406cd0 ("spi: imx: fix runtime pm support for !CONFIG_PM")
    Cc: [email protected]      # 5.10
    Cc: Sascha Hauer <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: imx: fix use-after-free on unbind [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Tue Mar 24 09:23:22 2026 +0100

    spi: imx: fix use-after-free on unbind
    
    commit 1c78c2002380a1fe31bfb01a3d5f29809e55a096 upstream.
    
    The SPI subsystem frees the controller and any subsystem allocated
    driver data as part of deregistration (unless the allocation is device
    managed).
    
    Take another reference before deregistering the controller so that the
    driver data is not freed until the driver is done with it.
    
    Fixes: 307c897db762 ("spi: spi-imx: replace struct spi_imx_data::bitbang by pointer to struct spi_controller")
    Cc: [email protected]      # 5.19
    Acked-by: Marc Kleine-Budde <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: lantiq-ssc: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu Apr 9 14:04:15 2026 +0200

    spi: lantiq-ssc: fix controller deregistration
    
    commit b99206710d032c16b7f8b75e4bc18414d8e4b9f4 upstream.
    
    Make sure to deregister the controller before releasing underlying
    resources like clocks during driver unbind.
    
    Fixes: 17f84b793c01 ("spi: lantiq-ssc: add support for Lantiq SSC SPI controller")
    Cc: [email protected]      # 4.11
    Cc: Hauke Mehrtens <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: meson-spicc: Fix double-put in remove path [+ + +]
Author: Felix Gu <[email protected]>
Date:   Thu May 7 16:14:57 2026 +0800

    spi: meson-spicc: Fix double-put in remove path
    
    [ Upstream commit 63542bb402b7013171c9f621c28b609eda4dbf1f ]
    
    meson_spicc_probe() registers the controller with
    devm_spi_register_controller(), so teardown already drops the
    controller reference via devm cleanup.
    
    Calling spi_controller_put() again in meson_spicc_remove()
    causes a double-put.
    
    Fixes: 8311ee2164c5 ("spi: meson-spicc: fix memory leak in meson_spicc_remove")
    Signed-off-by: Felix Gu <[email protected]>
    Reviewed-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    [ In v6.6, commit 68bf3288c7eb ("spi: meson-spicc: switch to use modern name")
    has not been applied, so the driver still uses the legacy spicc->master field
    and spi_master_put() API. The line to remove is spi_master_put(spicc->master)
    rather than spi_controller_put(spicc->host) as in the upstream patch.
    They are functionally identical. ]
    Signed-off-by: Wenshan Lan <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

spi: microchip-core-qspi: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu May 14 14:33:36 2026 -0400

    spi: microchip-core-qspi: fix controller deregistration
    
    [ Upstream commit e6464140d439f2d42f072eb422a5b1fec470c5a6 ]
    
    Make sure to deregister the controller before disabling underlying
    resources like interrupts during driver unbind.
    
    Fixes: 8596124c4c1b ("spi: microchip-core-qspi: Add support for microchip fpga qspi controllers")
    Cc: [email protected]      # 6.1
    Cc: Naga Sureshkumar Relli <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Acked-by: Conor Dooley <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: microchip-core-qspi: Use helper function devm_clk_get_enabled() [+ + +]
Author: Li Zetao <[email protected]>
Date:   Thu May 14 14:33:35 2026 -0400

    spi: microchip-core-qspi: Use helper function devm_clk_get_enabled()
    
    [ Upstream commit e922f3fff21445117e9196bd8e940ad8e15ca8c7 ]
    
    Since commit 7ef9651e9792 ("clk: Provide new devm_clk helpers for prepared
    and enabled clocks"), devm_clk_get() and clk_prepare_enable() can now be
    replaced by devm_clk_get_enabled() when driver enables (and possibly
    prepares) the clocks for the whole lifetime of the device. Moreover, it is
    no longer necessary to unprepare and disable the clocks explicitly.
    
    Reviewed-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Li Zetao <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Stable-dep-of: e6464140d439 ("spi: microchip-core-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: mpc52xx: fix use-after-free on unbind [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Tue Apr 14 15:43:15 2026 +0200

    spi: mpc52xx: fix use-after-free on unbind
    
    commit 706b3dc2ac7a998c55e14b3fd2e8f934c367e6e0 upstream.
    
    The state machine work is scheduled by the interrupt handler and
    therefore needs to be cancelled after disabling interrupts to avoid a
    potential use-after-free.
    
    Fixes: 984836621aad ("spi: mpc52xx: Add cancel_work_sync before module remove")
    Cc: [email protected]
    Cc: Pei Xiao <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: mtk-nor: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Apr 10 10:17:32 2026 +0200

    spi: mtk-nor: fix controller deregistration
    
    commit 76336f24934621db286cabb20b483773ee01dcaa upstream.
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: 881d1ee9fe81 ("spi: add support for mediatek spi-nor controller")
    Cc: [email protected]      # 5.7
    Cc: Chuanhong Guo <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: omap2-mcspi: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Apr 10 10:17:35 2026 +0200

    spi: omap2-mcspi: fix controller deregistration
    
    commit fb45f95c377e4a4bdece2c5e17643b459c9c13e7 upstream.
    
    Make sure to deregister the controller before releasing underlying
    resources like DMA during driver unbind.
    
    Fixes: ccdc7bf92573 ("SPI: omap2_mcspi driver")
    Cc: [email protected]      # 2.6.23
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: orion: fix clock imbalance on registration failure [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Tue Apr 21 15:02:10 2026 +0200

    spi: orion: fix clock imbalance on registration failure
    
    commit 443cde0dc59c5d154156ac9f27a7dadef8ebc0c2 upstream.
    
    Make sure that the controller is not runtime suspended before disabling
    clocks on probe failure.
    
    Also restore the autosuspend setting.
    
    Fixes: 5c6786945b4e ("spi: spi-orion: add runtime PM support")
    Cc: [email protected]      # 3.17
    Cc: Russell King <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: orion: fix runtime pm leak on unbind [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Tue Apr 21 15:02:09 2026 +0200

    spi: orion: fix runtime pm leak on unbind
    
    commit 97b17dd8266d2e26d9ee3c75a0fa34ecde6944f0 upstream.
    
    Make sure to balance the runtime PM usage count on driver unbind so that
    the controller can be suspended when a driver is rebound.
    
    Also restore the autosuspend setting.
    
    This issue was flagged by Sashiko when reviewing a controller
    deregistration fix.
    
    Fixes: 5c6786945b4e ("spi: spi-orion: add runtime PM support")
    Cc: [email protected]      # 3.17
    Cc: Russell King <[email protected]>
    Link: https://sashiko.dev/#/patchset/20260414134319.978196-1-johan%40kernel.org?part=6
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: qup: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Apr 10 10:17:39 2026 +0200

    spi: qup: fix controller deregistration
    
    commit 443e3a0005a4342b218b6dbd4c6387d3c7fed85a upstream.
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: 64ff247a978f ("spi: Add Qualcomm QUP SPI controller support")
    Cc: [email protected]      # 3.15
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: rockchip: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Tue Mar 24 09:23:23 2026 +0100

    spi: rockchip: fix controller deregistration
    
    commit 53e7a16070feb7d1d4d81a583eaac5e25048b9c3 upstream.
    
    Make sure to deregister the controller before freeing underlying
    resources like DMA channels during driver unbind.
    
    Fixes: 64e36824b32b ("spi/rockchip: add driver for Rockchip RK3xxx SoCs integrated SPI")
    Cc: [email protected]      # 3.17
    Cc: addy ke <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: rspi: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Apr 10 10:17:40 2026 +0200

    spi: rspi: fix controller deregistration
    
    commit 9944fa6726afb1e6eb7e2212764e7da0c97f2dcc upstream.
    
    Make sure to deregister the controller before releasing underlying
    resources like DMA during driver unbind.
    
    Fixes: 9e03d05eee4c ("spi: rcar: Use devm_spi_register_master()")
    Cc: [email protected]      # 3.14
    Cc: Jingoo Han <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: s3c64xx: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Apr 10 10:17:41 2026 +0200

    spi: s3c64xx: fix controller deregistration
    
    commit c1446b61e472da24d1547525193467b4bea4a7cb upstream.
    
    Make sure to deregister the controller before releasing underlying
    resources like DMA during driver unbind.
    
    Fixes: 91800f0e9005 ("spi/s3c64xx: Use managed registration")
    Cc: [email protected]      # 3.13: 76fbad410c0f
    Cc: [email protected]      # 3.13
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: s3c64xx: fix NULL-deref on driver unbind [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Apr 10 11:49:25 2026 +0200

    spi: s3c64xx: fix NULL-deref on driver unbind
    
    commit 45daacbead8a009844bd5dba6cfa731332184d17 upstream.
    
    A change moving DMA channel allocation from probe() back to
    s3c64xx_spi_prepare_transfer() failed to remove the corresponding
    deallocation from remove().
    
    Drop the bogus DMA channel release from remove() to avoid triggering a
    NULL-pointer dereference on driver unbind.
    
    This issue was flagged by Sashiko when reviewing a controller
    deregistration fix.
    
    Fixes: f52b03c70744 ("spi: s3c64xx: requests spi-dma channel only during data transfer")
    Cc: [email protected]      # 6.0
    Cc: Adithya K V <[email protected]>
    Link: https://sashiko.dev/#/patchset/20260410081757.503099-1-johan%40kernel.org
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: sh-hspi: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Apr 10 10:17:42 2026 +0200

    spi: sh-hspi: fix controller deregistration
    
    commit e63982e6392e45a6ecd68d6c317a081cc8e70143 upstream.
    
    Make sure to deregister the controller before releasing underlying
    resources like clocks during driver unbind.
    
    Fixes: 49e599b8595f ("spi: sh-hspi: control spi clock more correctly")
    Cc: [email protected]      # 3.4
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: spi-ti-qspi: Convert to platform remove callback returning void [+ + +]
Author: Uwe Kleine-König <[email protected]>
Date:   Wed May 13 14:08:40 2026 -0400

    spi: spi-ti-qspi: Convert to platform remove callback returning void
    
    [ Upstream commit 2f2802d1a59d79a3d00cb429841db502c2bbc3df ]
    
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is ignored (apart
    from emitting a warning) and this typically results in resource leaks.
    
    To improve here there is a quest to make the remove callback return
    void. In the first step of this quest all drivers are converted to
    .remove_new(), which already returns void. Eventually after all drivers
    are converted, .remove_new() will be renamed to .remove().
    
    Add an error message to the error path that returned an error before to
    replace the core's error message with more information. Apart from the
    different wording of the error message, this patch doesn't introduce a
    semantic difference.
    
    Signed-off-by: Uwe Kleine-König <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Stable-dep-of: 0c18a1bacbb1 ("spi: ti-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: spi-ti-qspi: switch to use modern name [+ + +]
Author: Yang Yingliang <[email protected]>
Date:   Wed May 13 14:08:41 2026 -0400

    spi: spi-ti-qspi: switch to use modern name
    
    [ Upstream commit 9d93c8d97b4cdb5edddb4c5530881c90eecb7e44 ]
    
    Change legacy name master to modern name host or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <[email protected]>
    Link: https://msgid.link/r/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Stable-dep-of: 0c18a1bacbb1 ("spi: ti-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: sprd: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Apr 10 10:17:46 2026 +0200

    spi: sprd: fix controller deregistration
    
    commit 123d17dbc5f07059752fa5e616385ca29a8f935a upstream.
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Note that the controller is suspended before disabling and releasing
    resources since commit de082d866cce ("spi: sprd: Add the SPI irq
    function for the SPI DMA mode") which avoids issues like unclocked
    accesses but prevents SPI device drivers from doing I/O during
    deregistration.
    
    Fixes: e7d973a31c24 ("spi: sprd: Add SPI driver for Spreadtrum SC9860")
    Cc: [email protected]      # 4.20
    Cc: Lanqing Liu <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: sun4i: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Wed May 13 13:32:02 2026 -0400

    spi: sun4i: fix controller deregistration
    
    [ Upstream commit 42108a2f03e0fdeabe9d02d085bdb058baa1189f ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: b5f6517948cc ("spi: sunxi: Add Allwinner A10 SPI controller driver")
    Cc: [email protected]      # 3.15
    Cc: Maxime Ripard <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: sun4i: switch to use modern name [+ + +]
Author: Yang Yingliang <[email protected]>
Date:   Wed May 13 13:32:01 2026 -0400

    spi: sun4i: switch to use modern name
    
    [ Upstream commit 6d232cc8a7e59af0c083319827541966a68817a0 ]
    
    Change legacy name master to modern name host or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <[email protected]>
    Link: https://msgid.link/r/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Stable-dep-of: 42108a2f03e0 ("spi: sun4i: fix controller deregistration")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: sun6i: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Wed May 13 19:05:13 2026 -0400

    spi: sun6i: fix controller deregistration
    
    [ Upstream commit d874a1c33aee0d88fb4ba2f8aeadaa9f1965209a ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: 3558fe900e8a ("spi: sunxi: Add Allwinner A31 SPI controller driver")
    Cc: [email protected]      # 3.15
    Cc: Maxime Ripard <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: sun6i: switch to use modern name [+ + +]
Author: Yang Yingliang <[email protected]>
Date:   Wed May 13 19:05:12 2026 -0400

    spi: sun6i: switch to use modern name
    
    [ Upstream commit 9f55bb79893a9dc75982372bee1307bdce48976b ]
    
    Change legacy name master to modern name host or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <[email protected]>
    Link: https://msgid.link/r/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Stable-dep-of: d874a1c33aee ("spi: sun6i: fix controller deregistration")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: syncuacer: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Wed May 13 13:31:54 2026 -0400

    spi: syncuacer: fix controller deregistration
    
    [ Upstream commit 75d849c3452e9611de031db45b3149ba9a99035f ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: b0823ee35cf9 ("spi: Add spi driver for Socionext SynQuacer platform")
    Cc: [email protected]      # 5.3
    Cc: Masahisa Kojima <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: synquacer: switch to use modern name [+ + +]
Author: Yang Yingliang <[email protected]>
Date:   Wed May 13 13:31:53 2026 -0400

    spi: synquacer: switch to use modern name
    
    [ Upstream commit 3524d1b727a66712f02f92807219a3650e5cf910 ]
    
    Change legacy name master to modern name host or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <[email protected]>
    Link: https://msgid.link/r/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Stable-dep-of: 75d849c3452e ("spi: syncuacer: fix controller deregistration")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: tegra114: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu May 14 00:59:22 2026 -0400

    spi: tegra114: fix controller deregistration
    
    [ Upstream commit 9c9c27ff2058142d8f800de3186d6864184958de ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: 5c8096439600 ("spi: tegra114: use devm_spi_register_master()")
    Cc: [email protected]      # 3.13
    Cc: Jingoo Han <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    [ renamed spi_controller/host API calls to spi_master/master equivalents ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: tegra20-sflash: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu May 14 00:59:34 2026 -0400

    spi: tegra20-sflash: fix controller deregistration
    
    [ Upstream commit ad7310e983327f939dd6c4e801eab13238992572 ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: f12f7318c44a ("spi: tegra20-sflash: use devm_spi_register_master()")
    Cc: [email protected]      # 3.13
    Cc: Jingoo Han <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    [ translated spi_controller/host API to legacy spi_master/master naming and dropped devm-managed registration ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: ti-qspi: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Wed May 13 14:08:42 2026 -0400

    spi: ti-qspi: fix controller deregistration
    
    [ Upstream commit 0c18a1bacbb1d8b8aa34d3d004a2cb8226c8b1ea ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Note that the controller is suspended before disabling and releasing
    resources since commit 3ac066e2227c ("spi: spi-ti-qspi: Suspend the
    queue before removing the device") which avoids issues like unclocked
    accesses but prevents SPI device drivers from doing I/O during
    deregistration.
    
    Fixes: 3b3a80019ff1 ("spi: ti-qspi: one only one interrupt handler")
    Cc: [email protected]      # 3.13
    Cc: Sebastian Andrzej Siewior <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: topcliff-pch: fix use-after-free on unbind [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Tue Apr 14 15:43:19 2026 +0200

    spi: topcliff-pch: fix use-after-free on unbind
    
    commit 9d72732fe70c11424bc90ed466c7ccfa58b42a9a upstream.
    
    Give the driver a chance to flush its queue before releasing the DMA
    buffers on driver unbind
    
    Fixes: c37f3c2749b5 ("spi/topcliff_pch: DMA support")
    Cc: [email protected]      # 3.1
    Cc: Tomoya MORINAGA <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: uniphier: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Thu May 14 07:46:35 2026 -0400

    spi: uniphier: fix controller deregistration
    
    [ Upstream commit 0245435f777264ac45945ed2f325dd095a41d1af ]
    
    Make sure to deregister the controller before releasing underlying
    resources like DMA during driver unbind.
    
    Note that clocks were also disabled before the recent commit
    fdca270f8f87 ("spi: uniphier: Simplify clock handling with
    devm_clk_get_enabled()").
    
    Fixes: 5ba155a4d4cc ("spi: add SPI controller driver for UniPhier SoC")
    Cc: [email protected]      # 4.19
    Cc: Keiji Hayashibara <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: uniphier: Simplify clock handling with devm_clk_get_enabled() [+ + +]
Author: Pei Xiao <[email protected]>
Date:   Thu May 14 07:46:34 2026 -0400

    spi: uniphier: Simplify clock handling with devm_clk_get_enabled()
    
    [ Upstream commit fdca270f8f87cae2eb5b619234b9dd11a863ce6b ]
    
    Replace devm_clk_get() followed by clk_prepare_enable() with
    devm_clk_get_enabled() for the clock. This removes the need for
    explicit clock enable and disable calls, as the managed API automatically
    handles clock disabling on device removal or probe failure.
    
    Remove the now-unnecessary clk_disable_unprepare() calls from the probe
    error path and the remove callback. Adjust error labels accordingly.
    
    Signed-off-by: Pei Xiao <[email protected]>
    Reviewed-by: Kunihiko Hayashi <[email protected]>
    Link: https://patch.msgid.link/b2deeefd4ef1a4bce71116aabfcb7e81400f6d37.1775546948.git.xiaopei01@kylinos.cn
    Signed-off-by: Mark Brown <[email protected]>
    Stable-dep-of: 0245435f7772 ("spi: uniphier: fix controller deregistration")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: uniphier: switch to use modern name [+ + +]
Author: Yang Yingliang <[email protected]>
Date:   Thu May 14 07:46:33 2026 -0400

    spi: uniphier: switch to use modern name
    
    [ Upstream commit 4c2ee0991013ca8a32bb093a017d460204790112 ]
    
    Change legacy name master to modern name host or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <[email protected]>
    Link: https://msgid.link/r/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Stable-dep-of: 0245435f7772 ("spi: uniphier: fix controller deregistration")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: zynq-qspi: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Wed May 13 14:33:48 2026 -0400

    spi: zynq-qspi: fix controller deregistration
    
    [ Upstream commit c9c012706c9fa8ca6d129a9161caf92ab625a3fd ]
    
    Make sure to deregister the controller before disabling it during driver
    unbind.
    
    Note that clocks were also disabled before the recent commit
    1f8fd9490e31 ("spi: zynq-qspi: Simplify clock handling with
    devm_clk_get_enabled()").
    
    Fixes: 67dca5e580f1 ("spi: spi-mem: Add support for Zynq QSPI controller")
    Cc: [email protected]      # 5.2: 8eb2fd00f65a
    Cc: [email protected]      # 5.2
    Cc: Naga Sureshkumar Relli <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: zynq-qspi: Simplify clock handling with devm_clk_get_enabled() [+ + +]
Author: Pei Xiao <[email protected]>
Date:   Wed May 13 14:33:47 2026 -0400

    spi: zynq-qspi: Simplify clock handling with devm_clk_get_enabled()
    
    [ Upstream commit 1f8fd9490e3184e9a2394df2e682901a1d57ce71 ]
    
    Replace devm_clk_get() followed by clk_prepare_enable() with
    devm_clk_get_enabled() for both "pclk" and "ref_clk". This removes
    the need for explicit clock enable and disable calls, as the managed
    API automatically disables the clocks on device removal or probe
    failure.
    
    Remove the now-unnecessary clk_disable_unprepare() calls from the
    probe error paths and the remove callback. Simplify error handling
    by jumping directly to the remove_ctlr label.
    
    Signed-off-by: Pei Xiao <[email protected]>
    Acked-by: Michal Simek <[email protected]>
    Link: https://patch.msgid.link/24043625f89376da36feca2408f990a85be7ab36.1775555500.git.xiaopei01@kylinos.cn
    Signed-off-by: Mark Brown <[email protected]>
    Stable-dep-of: c9c012706c9f ("spi: zynq-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: zynq-qspi: switch to use modern name [+ + +]
Author: Yang Yingliang <[email protected]>
Date:   Wed May 13 14:33:46 2026 -0400

    spi: zynq-qspi: switch to use modern name
    
    [ Upstream commit 178ebb0c505b0a35edb4fb2a0e23a1f29e1db14d ]
    
    Change legacy name master/slave to modern name host/target or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <[email protected]>
    Link: https://msgid.link/r/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Stable-dep-of: c9c012706c9f ("spi: zynq-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

spi: zynqmp-gqspi: fix controller deregistration [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Apr 10 10:17:55 2026 +0200

    spi: zynqmp-gqspi: fix controller deregistration
    
    commit 6895fc4faafc9082e15e4e624b23dd5f0c98feb5 upstream.
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: dfe11a11d523 ("spi: Add support for Zynq Ultrascale+ MPSoC GQSPI controller")
    Cc: [email protected]      # 4.2: 64640f6c972e
    Cc: [email protected]      # 4.2
    Cc: Ranjit Waghmode <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Mark Brown <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
staging: media: atomisp: Disallow all private IOCTLs [+ + +]
Author: Sakari Ailus <[email protected]>
Date:   Thu Feb 26 15:10:54 2026 +0200

    staging: media: atomisp: Disallow all private IOCTLs
    
    commit 2b7eb2c5dc72f0fc954ac4aa155f9e285e937f7c upstream.
    
    Disallow all private IOCTLs. These aren't quite as safe as one could
    assume of IOCTL handlers; disable them for now. Instead of removing the
    code, return in the beginning of the function if cmd is non-zero in order
    to keep static checkers happy.
    
    Reported-by: Soufiane Dani <[email protected]>
    Closes: https://lore.kernel.org/linux-staging/[email protected]/
    Cc: [email protected]
    Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
    Fixes: ad85094b293e ("Revert "media: staging: atomisp: Remove driver"")
    Signed-off-by: Sakari Ailus <[email protected]>
    Signed-off-by: Mauro Carvalho Chehab <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

staging: vme_user: fix root device leak on init failure [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Apr 24 12:49:10 2026 +0200

    staging: vme_user: fix root device leak on init failure
    
    commit 32c91e8ee039777d0b95b914633fc6a42607959c upstream.
    
    Make sure to deregister and free the root device in case module
    initialisation fails.
    
    Fixes: 658bcdae9c67 ("vme: Adding Fake VME driver")
    Cc: [email protected]      # 4.9
    Cc: Martyn Welch <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
taskstats: set version in TGID exit notifications [+ + +]
Author: Yiyang Chen <[email protected]>
Date:   Mon Mar 30 03:00:40 2026 +0800

    taskstats: set version in TGID exit notifications
    
    commit 16c4f0211aaa1ec1422b11b59f64f1abe9009fc0 upstream.
    
    delay accounting started populating taskstats records with a valid version
    field via fill_pid() and fill_tgid().
    
    Later, commit ad4ecbcba728 ("[PATCH] delay accounting taskstats interface
    send tgid once") changed the TGID exit path to send the cached
    signal->stats aggregate directly instead of building the outgoing record
    through fill_tgid().  Unlike fill_tgid(), fill_tgid_exit() only
    accumulates accounting data and never initializes stats->version.
    
    As a result, TGID exit notifications can reach userspace with version == 0
    even though PID exit notifications and TASKSTATS_CMD_GET replies carry a
    valid taskstats version.
    
    This is easy to reproduce with `tools/accounting/getdelays.c`.
    
    I have a small follow-up patch for that tool which:
    
    1. increases the receive buffer/message size so the pid+tgid
       combined exit notification is not dropped/truncated
    
    2. prints `stats->version`.
    
    With that patch, the reproducer is:
    
      Terminal 1:
        ./getdelays -d -v -l -m 0
    
      Terminal 2:
        taskset -c 0 python3 -c 'import threading,time; t=threading.Thread(target=time.sleep,args=(0.1,)); t.start(); t.join()'
    
    That produces both PID and TGID exit notifications for the same
    process.  The PID exit record reports a valid taskstats version, while
    the TGID exit record reports `version 0`.
    
    
    This patch (of 2):
    
    Set stats->version = TASKSTATS_VERSION after copying the cached TGID
    aggregate into the outgoing netlink payload so all taskstats records are
    self-describing again.
    
    Link: https://lkml.kernel.org/r/ba83d934e59edd431b693607de573eb9ca059309.1774810498.git.cyyzero16@gmail.com
    Fixes: ad4ecbcba728 ("[PATCH] delay accounting taskstats interface send tgid once")
    Signed-off-by: Yiyang Chen <[email protected]>
    Cc: Balbir Singh <[email protected]>
    Cc: Dr. Thomas Orgis <[email protected]>
    Cc: Fan Yu <[email protected]>
    Cc: Wang Yaxin <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tcp: call sk_data_ready() after listener migration [+ + +]
Author: Zhenzhong Wu <[email protected]>
Date:   Wed Apr 22 10:45:53 2026 +0800

    tcp: call sk_data_ready() after listener migration
    
    commit 3864c6ba1e041bc75342353a70fa2a2c6f909923 upstream.
    
    When inet_csk_listen_stop() migrates an established child socket from
    a closing listener to another socket in the same SO_REUSEPORT group,
    the target listener gets a new accept-queue entry via
    inet_csk_reqsk_queue_add(), but that path never notifies the target
    listener's waiters. A nonblocking accept() still works because it
    checks the queue directly, but poll()/epoll_wait() waiters and
    blocking accept() callers can also remain asleep indefinitely.
    
    Call READ_ONCE(nsk->sk_data_ready)(nsk) after a successful migration
    in inet_csk_listen_stop().
    
    However, after inet_csk_reqsk_queue_add() succeeds, the ref acquired
    in reuseport_migrate_sock() is effectively transferred to
    nreq->rsk_listener. Another CPU can then dequeue nreq via accept()
    or listener shutdown, hit reqsk_put(), and drop that listener ref.
    Since listeners are SOCK_RCU_FREE, wrap the post-queue_add()
    dereferences of nsk in rcu_read_lock()/rcu_read_unlock(), which also
    covers the existing sock_net(nsk) access in that path.
    
    The reqsk_timer_handler() path does not need the same changes for two
    reasons: half-open requests become readable only after the final ACK,
    where tcp_child_process() already wakes the listener; and once nreq is
    visible via inet_ehash_insert(), the success path no longer touches
    nsk directly.
    
    Fixes: 54b92e841937 ("tcp: Migrate TCP_ESTABLISHED/TCP_SYN_RECV sockets in accept queues.")
    Cc: [email protected]
    Suggested-by: Eric Dumazet <[email protected]>
    Reviewed-by: Kuniyuki Iwashima <[email protected]>
    Signed-off-by: Zhenzhong Wu <[email protected]>
    Reviewed-by: Eric Dumazet <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
thermal/drivers/sprd: Fix raw temperature clamping in sprd_thm_rawdata_to_temp [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Sat Mar 7 11:24:21 2026 +0100

    thermal/drivers/sprd: Fix raw temperature clamping in sprd_thm_rawdata_to_temp
    
    commit b3414148bbc1f9cd56217e58a558c6ac4fd1b4a6 upstream.
    
    The raw temperature data was never clamped to SPRD_THM_RAW_DATA_LOW or
    SPRD_THM_RAW_DATA_HIGH because the return value of clamp() was not used.
    Fix this by assigning the clamped value to 'rawdata'.
    
    Casting SPRD_THM_RAW_DATA_LOW and SPRD_THM_RAW_DATA_HIGH to u32 is also
    redundant and can be removed.
    
    Fixes: 554fdbaf19b1 ("thermal: sprd: Add Spreadtrum thermal driver support")
    Signed-off-by: Thorsten Blum <[email protected]>
    Signed-off-by: Daniel Lezcano <[email protected]>
    Reviewed-by: Baolin Wang <[email protected]>
    Cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

thermal/drivers/sprd: Fix temperature clamping in sprd_thm_temp_to_rawdata [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Sat Mar 7 11:24:20 2026 +0100

    thermal/drivers/sprd: Fix temperature clamping in sprd_thm_temp_to_rawdata
    
    commit 83c0f9a5d679a6f8d84fc49b2f62ea434ccab4b6 upstream.
    
    The temperature was never clamped to SPRD_THM_TEMP_LOW or
    SPRD_THM_TEMP_HIGH because the return value of clamp() was not used. Fix
    this by assigning the clamped value to 'temp'.
    
    Casting SPRD_THM_TEMP_LOW and SPRD_THM_TEMP_HIGH to int is also
    redundant and can be removed.
    
    Fixes: 554fdbaf19b1 ("thermal: sprd: Add Spreadtrum thermal driver support")
    Signed-off-by: Thorsten Blum <[email protected]>
    Signed-off-by: Daniel Lezcano <[email protected]>
    Reviewed-by: Baolin Wang <[email protected]>
    Cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
thermal: core: Fix thermal zone governor cleanup issues [+ + +]
Author: Rafael J. Wysocki <[email protected]>
Date:   Thu Apr 30 13:56:55 2026 -0400

    thermal: core: Fix thermal zone governor cleanup issues
    
    [ Upstream commit 41ff66baf81c6541f4f985dd7eac4494d03d9440 ]
    
    If thermal_zone_device_register_with_trips() fails after adding
    a thermal governor to the thermal zone being registered, the
    governor is not removed from it as appropriate which may lead to
    a memory leak.
    
    In turn, thermal_zone_device_unregister() calls thermal_set_governor()
    without acquiring the thermal zone lock beforehand which may race with
    a governor update via sysfs and may lead to a use-after-free in that
    case.
    
    Address these issues by adding two thermal_set_governor() calls, one to
    thermal_release() to remove the governor from the given thermal zone,
    and one to the thermal zone registration error path to cover failures
    preceding the thermal zone device registration.
    
    Fixes: e33df1d2f3a0 ("thermal: let governors have private data for each thermal zone")
    Cc: All applicable <[email protected]>
    Signed-off-by: Rafael J. Wysocki <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    [ kept the `thermal_zone_create_device_groups(tz, mask)` signature when adding the new failure-path cleanup ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tools/accounting: handle truncated taskstats netlink messages [+ + +]
Author: Yiyang Chen <[email protected]>
Date:   Mon Mar 30 03:00:41 2026 +0800

    tools/accounting: handle truncated taskstats netlink messages
    
    commit cc82b3dcc6a8fa259fbda12ab00d6fc00908a49e upstream.
    
    procacct and getdelays use a fixed receive buffer for taskstats generic
    netlink messages.  A multi-threaded process exit can emit a single
    PID+TGID notification large enough to exceed that buffer on newer kernels.
    
    Switch to recvmsg() so MSG_TRUNC is detected explicitly, increase the
    message buffer size, and report truncated datagrams clearly instead of
    misparsing them as fatal netlink errors.
    
    Also print the taskstats version in debug output to make version
    mismatches easier to diagnose while inspecting taskstats traffic.
    
    Link: https://lkml.kernel.org/r/520308bb4cbbaf8dc2c7296b5f60f11e12fb30a5.1774810498.git.cyyzero16@gmail.com
    Signed-off-by: Yiyang Chen <[email protected]>
    Cc: Balbir Singh <[email protected]>
    Cc: Dr. Thomas Orgis <[email protected]>
    Cc: Fan Yu <[email protected]>
    Cc: Wang Yaxin <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tpm: avoid -Wunused-but-set-variable [+ + +]
Author: Arnd Bergmann <[email protected]>
Date:   Fri Mar 22 14:22:48 2024 +0100

    tpm: avoid -Wunused-but-set-variable
    
    commit 6f1d4d2ecfcd1b577dc87350ea965fe81f272e83 upstream.
    
    Outside of the EFI tpm code, the TPM_MEMREMAP()/TPM_MEMUNMAP functions are
    defined as trivial macros, leading to the mapping_size variable ending
    up unused:
    
    In file included from drivers/char/tpm/tpm-sysfs.c:16:
    In file included from drivers/char/tpm/tpm.h:28:
    include/linux/tpm_eventlog.h:167:6: error: variable 'mapping_size' set but not used [-Werror,-Wunused-but-set-variable]
      167 |         int mapping_size;
    
    Turn the stubs into inline functions to avoid this warning.
    
    Cc: [email protected] # v5.3+
    Fixes: c46f3405692d ("tpm: Reserve the TPM final events table")
    Signed-off-by: Arnd Bergmann <[email protected]>
    Reviewed-by: Thorsten Blum <[email protected]>
    Reviewed-by: Jarkko Sakkinen <[email protected]>
    Signed-off-by: Jarkko Sakkinen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

tpm: tpm_tis: add error logging for data transfer [+ + +]
Author: Jacqueline Wong <[email protected]>
Date:   Wed Apr 15 16:00:05 2026 +0000

    tpm: tpm_tis: add error logging for data transfer
    
    commit 0471921e2d1043dcc6de5cffb49dd37709521abe upstream.
    
    Add logging to more easily determine reason for transmit failure
    
    Cc: [email protected] # v6.6+
    Fixes: 280db21e153d8 ("tpm_tis: Resend command to recover from data transfer errors")
    Signed-off-by: Jacqueline Wong <[email protected]>
    Signed-off-by: Jordan Hand <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Jarkko Sakkinen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

tpm: tpm_tis: stop transmit if retries are exhausted [+ + +]
Author: Jacqueline Wong <[email protected]>
Date:   Wed Apr 15 16:00:06 2026 +0000

    tpm: tpm_tis: stop transmit if retries are exhausted
    
    commit 949692da7211572fac419b2986b6abc0cd1aeb76 upstream.
    
    tpm_tis_send_main() will attempt to retry sending data TPM_RETRY times.
    Currently, if those retries are exhausted, the driver will attempt to
    call execute. The TPM will be in the wrong state, leading to the
    operation simply timing out.
    
    Instead, if there is still an error after retries are exhausted, return
    that error immediately.
    
    Cc: [email protected] # v6.6+
    Fixes: 280db21e153d8 ("tpm_tis: Resend command to recover from data transfer errors")
    Signed-off-by: Jacqueline Wong <[email protected]>
    Signed-off-by: Jordan Hand <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Jarkko Sakkinen <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tracepoint: balance regfunc() on func_add() failure in tracepoint_add_func() [+ + +]
Author: David Carlier <[email protected]>
Date:   Sun May 10 15:59:53 2026 -0400

    tracepoint: balance regfunc() on func_add() failure in tracepoint_add_func()
    
    [ Upstream commit fad217e16fded7f3c09f8637b0f6a224d58b5f2e ]
    
    When a tracepoint goes through the 0 -> 1 transition, tracepoint_add_func()
    invokes the subsystem's ext->regfunc() before attempting to install the
    new probe via func_add(). If func_add() then fails (for example, when
    allocate_probes() cannot allocate a new probe array under memory pressure
    and returns -ENOMEM), the function returns the error without calling the
    matching ext->unregfunc(), leaving the side effects of regfunc() behind
    with no installed probe to justify them.
    
    For syscall tracepoints this is particularly unpleasant: syscall_regfunc()
    bumps sys_tracepoint_refcount and sets SYSCALL_TRACEPOINT on every task.
    After a leaked failure, the refcount is stuck at a non-zero value with no
    consumer, and every task continues paying the syscall trace entry/exit
    overhead until reboot. Other subsystems providing regfunc()/unregfunc()
    pairs exhibit similarly scoped persistent state.
    
    Mirror the existing 1 -> 0 cleanup and call ext->unregfunc() in the
    func_add() error path, gated on the same condition used there so the
    unwind is symmetric with the registration.
    
    Fixes: 8cf868affdc4 ("tracing: Have the reg function allow to fail")
    Cc: [email protected]
    Cc: Masami Hiramatsu <[email protected]>
    Cc: Mathieu Desnoyers <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: David Carlier <[email protected]>
    Signed-off-by: Steven Rostedt (Google) <[email protected]>
    [ changed `tp->ext->unregfunc` to `tp->unregfunc` to match older struct layout ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
tracing/probes: Limit size of event probe to 3K [+ + +]
Author: Steven Rostedt <[email protected]>
Date:   Fri May 15 08:06:51 2026 -0400

    tracing/probes: Limit size of event probe to 3K
    
    [ Upstream commit b2aa3b4d64e460ac606f386c24e7d8a873ce6f1a ]
    
    There currently isn't a max limit an event probe can be. One could make an
    event greater than PAGE_SIZE, which makes the event useless because if
    it's bigger than the max event that can be recorded into the ring buffer,
    then it will never be recorded.
    
    A event probe should never need to be greater than 3K, so make that the
    max size. As long as the max is less than the max that can be recorded
    onto the ring buffer, it should be fine.
    
    Cc: [email protected]
    Cc: Mathieu Desnoyers <[email protected]>
    Acked-by: Masami Hiramatsu (Google) <[email protected]>
    Fixes: 93ccae7a22274 ("tracing/kprobes: Support basic types on dynamic events")
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Steven Rostedt <[email protected]>
    [ adjusted context to place MAX_PROBE_EVENT_SIZE near MAX_STRING_SIZE and appended EVENT_TOO_BIG after NEED_STRING_TYPE ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
udf: fix partition descriptor append bookkeeping [+ + +]
Author: Seohyeon Maeng <[email protected]>
Date:   Fri May 8 16:04:44 2026 -0400

    udf: fix partition descriptor append bookkeeping
    
    [ Upstream commit 08841b06fa64d8edbd1a21ca6e613420c90cc4b8 ]
    
    Mounting a crafted UDF image with repeated partition descriptors can
    trigger a heap out-of-bounds write in part_descs_loc[].
    
    handle_partition_descriptor() deduplicates entries by partition number,
    but appended slots never record partnum. As a result duplicate
    Partition Descriptors are appended repeatedly and num_part_descs keeps
    growing.
    
    Once the table is full, the growth path still sizes the allocation from
    partnum even though inserts are indexed by num_part_descs. If partnum is
    already aligned to PART_DESC_ALLOC_STEP, ALIGN(partnum, step) can keep
    the old capacity and the next append writes past the end of the table.
    
    Store partnum in the appended slot and size growth from the next append
    count so deduplication and capacity tracking follow the same model.
    
    Fixes: ee4af50ca94f ("udf: Fix mounting of Win7 created UDF filesystems")
    Cc: [email protected]
    Signed-off-by: Seohyeon Maeng <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jan Kara <[email protected]>
    [ replaced kzalloc_objs() helper with equivalent kcalloc() ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

udf: reject descriptors with oversized CRC length [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Mon Apr 13 17:12:40 2026 -0400

    udf: reject descriptors with oversized CRC length
    
    commit 55d41b0a20128e86b9e960dd2e3f0a2d69a18df7 upstream.
    
    udf_read_tagged() skips CRC verification when descCRCLength +
    sizeof(struct tag) exceeds the block size.  A crafted UDF image can
    set descCRCLength to an oversized value to bypass CRC validation
    entirely; the descriptor is then accepted based solely on the 8-bit
    tag checksum, which is trivially recomputable.
    
    Reject such descriptors instead of silently accepting them.  A
    legitimate single-block descriptor should never have a CRC length that
    exceeds the block.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: [email protected]
    Assisted-by: Claude:claude-opus-4-6
    Assisted-by: Codex:gpt-5-4
    Signed-off-by: Michael Bommarito <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jan Kara <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
um: drivers: call kernel_strrchr() explicitly in cow_user.c [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Wed Apr 8 03:01:02 2026 -0400

    um: drivers: call kernel_strrchr() explicitly in cow_user.c
    
    commit 91e901c65b4da02a6fd543e3f0049829ae9645b7 upstream.
    
    Building ARCH=um on glibc >= 2.43 fails:
    
      arch/um/drivers/cow_user.c: error: implicit declaration of
      function 'strrchr' [-Wimplicit-function-declaration]
    
    glibc 2.43's C23 const-preserving strrchr() macro does not survive
    UML's global -Dstrrchr=kernel_strrchr remap from arch/um/Makefile.
    Call kernel_strrchr() directly in cow_user.c so the source no longer
    depends on the -D rewrite.
    
    Fixes: 2c51a4bc0233 ("um: fix strrchr() problems")
    Suggested-by: Johannes Berg <[email protected]>
    Cc: [email protected]
    Assisted-by: Claude:claude-opus-4-6
    Assisted-by: Codex:gpt-5-4
    Signed-off-by: Michael Bommarito <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    [remove unnecessary 'extern']
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
usb: chipidea: core: allow ci_irq_handler() handle both ID and VBUS change [+ + +]
Author: Xu Yang <[email protected]>
Date:   Thu Apr 2 15:14:56 2026 +0800

    usb: chipidea: core: allow ci_irq_handler() handle both ID and VBUS change
    
    commit b94b631d9f78e653855f7fb58dbcb86c2a856f6f upstream.
    
    For USB role switch-triggered IRQ, ID and VBUS change come together, for
    example when switching from host to device mode. ID indicate a role switch
    and VBUS is required to determine whether the device controller can start
    operating. Currently, ci_irq_handler() handles only a single event per
    invocation. This can cause an issue where switching to device mode results
    in the device controller not working at all. Allowing ci_irq_handler() to
    handle both ID and VBUS change in one call resolves this issue.
    
    Meanwhile, this change also affects the VBUS event handling logic.
    Previously, if an ID event indicated host mode the VBUS IRQ will be
    ignored as the device disable BSE when stop() is called. With the new
    behavior, if ID and VBUS IRQ occur together and the target mode is host,
    the VBUS event is queued and ci_handle_vbus_change() will call
    usb_gadget_vbus_connect(), after which USBMODE is switched to device mode,
    causing host mode to stop working. To prevent this, an additional check is
    added to skip handling VBUS event when current role is not device mode.
    
    Suggested-by: Peter Chen <[email protected]>
    Fixes: e1b5d2bed67c ("usb: chipidea: core: handle usb role switch in a common way")
    Cc: [email protected]
    Signed-off-by: Xu Yang <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usb: chipidea: otg: not wait vbus drop if use role_switch [+ + +]
Author: Xu Yang <[email protected]>
Date:   Thu Apr 2 15:14:57 2026 +0800

    usb: chipidea: otg: not wait vbus drop if use role_switch
    
    commit a4e99587102a83ee911c670752fbca694c7e557f upstream.
    
    The usb role switch will update ID and VBUS states at the same time, and
    vbus will not drop when execute data role swap in Type-C usecase. So lets
    not wait vbus drop in usb role switch case too.
    
    Fixes: e1b5d2bed67c ("usb: chipidea: core: handle usb role switch in a common way")
    Cc: [email protected]
    Acked-by: Peter Chen <[email protected]>
    Reviewed-by: Jun Li <[email protected]>
    Signed-off-by: Xu Yang <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usb: dwc3: Move GUID programming after PHY initialization [+ + +]
Author: Selvarasu Ganesan <[email protected]>
Date:   Wed May 13 09:11:17 2026 -0400

    usb: dwc3: Move GUID programming after PHY initialization
    
    [ Upstream commit aad35f9c926ec220b0742af1ada45666ae667956 ]
    
    The Linux Version Code is currently written to the GUID register before
    PHY initialization. Certain PHY implementations (such as Synopsys eUSB
    PHY performing link_sw_reset) clear the GUID register to its default
    value during initialization, causing the kernel version information to
    be lost.
    
    Move the GUID register programming to occur after PHY initialization
    completes to ensure the Linux version information persists.
    
    Fixes: fa0ea13e9f1c ("usb: dwc3: core: write LINUX_VERSION_CODE to our GUID register")
    Cc: stable <[email protected]>
    Reported-by: Pritam Manohar Sutar <[email protected]>
    Signed-off-by: Selvarasu Ganesan <[email protected]>
    Acked-by: Thinh Nguyen <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    [ adapted dwc3_writel(dwc, ...) to dwc3_writel(dwc->regs, ...) ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
USB: omap_udc: DMA: Don't enable burst 4 mode [+ + +]
Author: Aaro Koskinen <[email protected]>
Date:   Mon Apr 13 21:49:12 2026 +0300

    USB: omap_udc: DMA: Don't enable burst 4 mode
    
    commit 3f91484f6c13c434bd573ca6b6779c26adb0ddab upstream.
    
    Commit 65111084c63d7 ("USB: more omap_udc updates (dma and omap1710)")
    added setting for DMA burst 4 mode. But I think this should be undone for
    two reasons:
    
    - It breaks DMA on 15xx boards - transfers just silently stall.
    
    - On newer OMAP1 boards, like Nokia 770 (omap1710), there is no measurable
    performance impact when testing TCP throughput with g_ether with large
    15000 byte MTU size.
    
    It's also worth noting that when the original change was made, the
    OMAP_DMA_DATA_BURST_4 handling in arch/arm/plat-omap/dma.c was broken, and
    actually resulted in the same as the OMAP_DMA_DATA_BURST_DIS i.e. burst
    disabled. This was fixed not until a couple kernel releases later in an
    unrelated commit 1a8bfa1eb998a ("[ARM] 3142/1: OMAP 2/5: Update files
    common to omap1 and omap2").
    
    So based on this it seems there was never really a very good reason to
    enable this burst mode in omap_udc, so remove it now to allow 15xx DMA
    to work again (it provides 2x throughput compared to PIO mode).
    
    Fixes: 65111084c63d ("[PATCH] USB: more omap_udc updates (dma and omap1710)")
    Cc: stable <[email protected]>
    Signed-off-by: Aaro Koskinen <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

USB: serial: option: add Telit Cinterion LE910Cx compositions [+ + +]
Author: Fabio Porcedda <[email protected]>
Date:   Mon Apr 27 11:17:46 2026 +0200

    USB: serial: option: add Telit Cinterion LE910Cx compositions
    
    commit 100201d349edd226ca3470c894c92dccc67ee7a8 upstream.
    
    Add the following Telit Cinterion LE910Cx compositions:
    
    0x1251: RNDIS + tty (AT/NMEA) + tty (AT) + tty (AT) + tty (SAP)
    T:  Bus=01 Lev=01 Prnt=21 Port=06 Cnt=01 Dev#=108 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=1251 Rev=03.18
    S:  Manufacturer=Android
    S:  Product=LE910C1-EU
    S:  SerialNumber=0123456789ABCDEF
    C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=ff Driver=rndis_host
    E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=88(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8a(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    
    0x1253: ECM + tty (AT/NMEA) + tty (AT) + tty (AT) + tty (SAP)
    T:  Bus=01 Lev=01 Prnt=21 Port=06 Cnt=01 Dev#=121 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=1253 Rev=03.18
    S:  Manufacturer=Android
    S:  Product=LE910C1-EU
    S:  SerialNumber=0123456789ABCDEF
    C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=06 Prot=00 Driver=cdc_ether
    E:  Ad=82(I) Atr=03(Int.) MxPS=  16 Ivl=32ms
    I:  If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=88(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8a(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    
    0x1254: tty (AT) + tty (AT)
    T:  Bus=01 Lev=01 Prnt=21 Port=06 Cnt=01 Dev#=122 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=1254 Rev=03.18
    S:  Manufacturer=Android
    S:  Product=LE910C1-EU
    S:  SerialNumber=0123456789ABCDEF
    C:  #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=82(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    
    0x1255: tty (AT/NMEA) + tty (AT) + tty (AT) + tty (SAP)
    T:  Bus=01 Lev=01 Prnt=21 Port=06 Cnt=01 Dev#=123 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=1255 Rev=03.18
    S:  Manufacturer=Android
    S:  Product=LE910C1-EU
    S:  SerialNumber=0123456789ABCDEF
    C:  #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=82(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=88(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    
    Cc: [email protected]
    Signed-off-by: Fabio Porcedda <[email protected]>
    Signed-off-by: Johan Hovold <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
usb: typec: tcpm: reset internal port states on soft reset AMS [+ + +]
Author: Amit Sunil Dhamne <[email protected]>
Date:   Tue Apr 14 00:58:32 2026 +0000

    usb: typec: tcpm: reset internal port states on soft reset AMS
    
    commit 2909f0d4994fb4306bf116df5ccee797791fce2c upstream.
    
    Reset internal port states (such as vdm_sm_running and
    explicit_contract) on soft reset AMS as the port needs to negotiate a
    new contract. The consequence of leaving the states in as-is cond are as
    follows:
      * port is in SRC power role and an explicit contract is negotiated
        with the port partner (in sink role)
      * port partner sends a Soft Reset AMS while VDM State Machine is
        running
      * port accepts the Soft Reset request and the port advertises src caps
      * port partner sends a Request message but since the explicit_contract
        and vdm_sm_running are true from previous negotiation, the port ends
        up sending Soft Reset instead of Accept msg.
    
    Stub Log:
    [  203.653942] AMS DISCOVER_IDENTITY start
    [  203.653947] PD TX, header: 0x176f
    [  203.655901] PD TX complete, status: 0
    [  203.657470] PD RX, header: 0x124f [1]
    [  203.657477] Rx VDM cmd 0xff008081 type 2 cmd 1 len 1
    [  203.657482] AMS DISCOVER_IDENTITY finished
    [  203.657484] cc:=4
    [  204.155698] PD RX, header: 0x144f [1]
    [  204.155718] Rx VDM cmd 0xeeee8001 type 0 cmd 1 len 1
    [  204.155741] PD TX, header: 0x196f
    [  204.157622] PD TX complete, status: 0
    [  204.160060] PD RX, header: 0x4d [1]
    [  204.160066] state change SRC_READY -> SOFT_RESET [rev2 SOFT_RESET_AMS]
    [  204.160076] PD TX, header: 0x163
    [  204.162486] PD TX complete, status: 0
    [  204.162832] AMS SOFT_RESET_AMS finished
    [  204.162840] cc:=4
    [  204.162891] AMS POWER_NEGOTIATION start
    [  204.162896] state change SOFT_RESET -> AMS_START [rev2 POWER_NEGOTIATION]
    [  204.162908] state change AMS_START -> SRC_SEND_CAPABILITIES [rev2 POWER_NEGOTIATION]
    [  204.162913] PD TX, header: 0x1361
    [  204.165529] PD TX complete, status: 0
    [  204.165571] pending state change SRC_SEND_CAPABILITIES -> SRC_SEND_CAPABILITIES_TIMEOUT @ 60 ms [rev2 POWER_NEGOTIATION]
    [  204.166996] PD RX, header: 0x1242 [1]
    [  204.167009] state change SRC_SEND_CAPABILITIES -> SRC_SOFT_RESET_WAIT_SNK_TX [rev2 POWER_NEGOTIATION]
    [  204.167019] AMS POWER_NEGOTIATION finished
    [  204.167020] cc:=4
    [  204.167083] AMS SOFT_RESET_AMS start
    [  204.167086] state change SRC_SOFT_RESET_WAIT_SNK_TX -> SOFT_RESET_SEND [rev2 SOFT_RESET_AMS]
    [  204.167092] PD TX, header: 0x16d
    [  204.168824] PD TX complete, status: 0
    [  204.168854] pending state change SOFT_RESET_SEND -> HARD_RESET_SEND @ 60 ms [rev2 SOFT_RESET_AMS]
    [  204.171876] PD RX, header: 0x43 [1]
    [  204.171879] AMS SOFT_RESET_AMS finished
    
    This causes COMMON.PROC.PD.11.2 check failure for
    TEST.PD.VDM.SRC.2_Rev2Src test on the PD compliance tester.
    
    Signed-off-by: Amit Sunil Dhamne <[email protected]>
    Fixes: 8d3a0578ad1a ("usb: typec: tcpm: Respond Wait if VDM state machine is running")
    Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")
    Cc: stable <[email protected]>
    Reviewed-by: Badhri Jagan Sridharan <[email protected]>
    Acked-by: Heikki Krogerus <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usb: ulpi: fix memory leak on ulpi_register() error paths [+ + +]
Author: Felix Gu <[email protected]>
Date:   Tue Apr 7 21:21:22 2026 +0800

    usb: ulpi: fix memory leak on ulpi_register() error paths
    
    commit 0b9fcab1b8608d429e5f239afb197de928d4de7d upstream.
    
    Commit 01af542392b5 ("usb: ulpi: fix double free in
    ulpi_register_interface() error path") removed kfree(ulpi) from
    ulpi_register_interface() to fix a double-free when device_register()
    fails.
    
    But when ulpi_of_register() or ulpi_read_id() fail before
    device_register() is called, the ulpi allocation is leaked.
    
    Add kfree(ulpi) on both error paths to properly clean up the allocation.
    
    Fixes: 01af542392b5 ("usb: ulpi: fix double free in ulpi_register_interface() error path")
    Cc: stable <[email protected]>
    Signed-off-by: Felix Gu <[email protected]>
    Reviewed-by: Heikki Krogerus <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usb: usblp: fix heap leak in IEEE 1284 device ID via short response [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Mon Apr 20 18:11:03 2026 +0200

    usb: usblp: fix heap leak in IEEE 1284 device ID via short response
    
    commit 7a400c6fe3617e31e690e3f7ca37bb335e0498f3 upstream.
    
    usblp_ctrl_msg() collapses the usb_control_msg() return value to
    0/-errno, discarding the actual number of bytes transferred.  A broken
    printer can complete the GET_DEVICE_ID control transfer short and the
    driver has no way to know.
    
    usblp_cache_device_id_string() reads the 2-byte big-endian length prefix
    from the response and trusts it (clamped only to the buffer bounds).
    The buffer is kmalloc(1024) at probe time. A device that sends exactly
    two bytes (e.g. 0x03 0xFF, claiming a 1023-byte ID) leaves
    device_id_string[2..1022] holding stale kmalloc heap.
    
    That stale data is then exposed:
      - via the ieee1284_id sysfs attribute (sprintf("%s", buf+2), truncated
        at the first NUL in the stale heap), and
      - via the IOCNR_GET_DEVICE_ID ioctl, which copy_to_user()s the full
        claimed length regardless of NULs, up to 1021 bytes of uninitialized
        heap, with the leak size chosen by the device.
    
    Fix this up by just zapping the buffer with zeros before each request
    sent to the device.
    
    Cc: Pete Zaitcev <[email protected]>
    Assisted-by: gkh_clanker_t1000
    Cc: stable <[email protected]>
    Link: https://patch.msgid.link/2026042002-unicorn-greedily-3c63@gregkh
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usb: usblp: fix uninitialized heap leak via LPGETSTATUS ioctl [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Mon Apr 20 18:11:04 2026 +0200

    usb: usblp: fix uninitialized heap leak via LPGETSTATUS ioctl
    
    commit b38e53cbfb9d84732e5984fbd73e128d592415c5 upstream.
    
    Just like in a previous problem in this driver, usblp_ctrl_msg() will
    collapse the usb_control_msg() return value to 0/-errno, discarding the
    actual number of bytes transferred.
    
    Ideally that short command should be detected and error out, but many
    printers are known to send "incorrect" responses back so we can't just
    do that.
    
    statusbuf is kmalloc(8) at probe time and never filled before the first
    LPGETSTATUS ioctl.
    
    usblp_read_status() requests 1 byte. If a malicious printer responds
    with zero bytes, *statusbuf is one byte of stale kmalloc heap,
    sign-extended into the local int status, which the LPGETSTATUS path then
    copy_to_user()s directly to the ioctl caller.
    
    Fix this all by just zapping out the memory buffer when allocated at
    probe time.  If a later call does a short read, the data will be
    identical to what the device sent it the last time, so there is no
    "leak" of information happening.
    
    Cc: Pete Zaitcev <[email protected]>
    Assisted-by: gkh_clanker_t1000
    Cc: stable <[email protected]>
    Link: https://patch.msgid.link/2026042011-shredder-savage-48c6@gregkh
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

usb: xhci: Make usb_host_endpoint.hcpriv survive endpoint_disable() [+ + +]
Author: Michal Pecio <[email protected]>
Date:   Thu Apr 2 16:13:42 2026 +0300

    usb: xhci: Make usb_host_endpoint.hcpriv survive endpoint_disable()
    
    commit 25e531b422dc2ac90cdae3b6e74b5cdeb081440d upstream.
    
    xHCI hardware maintains its endpoint state between add_endpoint()
    and drop_endpoint() calls followed by successful check_bandwidth().
    So does the driver.
    
    Core may call endpoint_disable() during xHCI endpoint life, so don't
    clear host_ep->hcpriv then, because this breaks endpoint_reset().
    
    If a driver calls usb_set_interface(), submits URBs which make host
    sequence state non-zero and calls usb_clear_halt(), the device clears
    its sequence state but xhci_endpoint_reset() bails out. The next URB
    malfunctions: USB2 loses one packet, USB3 gets Transaction Error or
    may not complete at all on some (buggy?) HCs from ASMedia and AMD.
    This is triggered by uvcvideo on bulk video devices.
    
    The code was copied from ehci_endpoint_disable() but it isn't needed
    here - hcpriv should only be NULL on emulated root hub endpoints.
    It might prevent resetting and inadvertently enabling a disabled and
    dropped endpoint, but core shouldn't try to reset dropped endpoints.
    
    Document xhci requirements regarding hcpriv. They are currently met.
    
    Fixes: 18b74067ac78 ("xhci: Fix use-after-free regression in xhci clear hub TT implementation")
    Cc: [email protected]
    Signed-off-by: Michal Pecio <[email protected]>
    Signed-off-by: Mathias Nyman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
userfaultfd: allow registration of ranges below mmap_min_addr [+ + +]
Author: Denis M. Karpov <[email protected]>
Date:   Thu Apr 9 13:33:45 2026 +0300

    userfaultfd: allow registration of ranges below mmap_min_addr
    
    commit 161ce69c2c89781784b945d8e281ff2da9dede9c upstream.
    
    The current implementation of validate_range() in fs/userfaultfd.c
    performs a hard check against mmap_min_addr.  This is redundant because
    UFFDIO_REGISTER operates on memory ranges that must already be backed by a
    VMA.
    
    Enforcing mmap_min_addr or capability checks again in userfaultfd is
    unnecessary and prevents applications like binary compilers from using
    UFFD for valid memory regions mapped by application.
    
    Remove the redundant check for mmap_min_addr.
    
    We started using UFFD instead of the classic mprotect approach in the
    binary translator to track application writes.  During development, we
    encountered this bug.  The translator cannot control where the translated
    application chooses to map its memory and if the app requires a
    low-address area, UFFD fails, whereas mprotect would work just fine.  I
    believe this is a genuine logic bug rather than an improvement, and I
    would appreciate including the fix in stable.
    
    Link: https://lore.kernel.org/[email protected]
    Fixes: 86039bd3b4e6 ("userfaultfd: add new syscall to provide memory externalization")
    Signed-off-by: Denis M. Karpov <[email protected]>
    Reviewed-by: Lorenzo Stoakes <[email protected]>
    Acked-by: Harry Yoo (Oracle) <[email protected]>
    Reviewed-by: Pedro Falcato <[email protected]>
    Reviewed-by: Liam R. Howlett <[email protected]>
    Reviewed-by: Mike Rapoport (Microsoft) <[email protected]>
    Cc: Alexander Viro <[email protected]>
    Cc: Al Viro <[email protected]>
    Cc: Christian Brauner <[email protected]>
    Cc: Jan Kara <[email protected]>
    Cc: Jann Horn <[email protected]>
    Cc: Peter Xu <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
vsock/virtio: fix accept queue count leak on transport mismatch [+ + +]
Author: Dudu Lu <[email protected]>
Date:   Mon Apr 13 21:14:09 2026 +0800

    vsock/virtio: fix accept queue count leak on transport mismatch
    
    commit 52bcb57a4e8a0865a76c587c2451906342ae1b2d upstream.
    
    virtio_transport_recv_listen() calls sk_acceptq_added() before
    vsock_assign_transport(). If vsock_assign_transport() fails or
    selects a different transport, the error path returns without
    calling sk_acceptq_removed(), permanently incrementing
    sk_ack_backlog.
    
    After approximately backlog+1 such failures, sk_acceptq_is_full()
    returns true, causing the listener to reject all new connections.
    
    Fix by moving sk_acceptq_added() to after the transport validation,
    matching the pattern used by vmci_transport and hyperv_transport.
    
    Fixes: c0cfa2d8a788 ("vsock: add multi-transports support")
    Signed-off-by: Dudu Lu <[email protected]>
    Reviewed-by: Bobby Eshleman <[email protected]>
    Reviewed-by: Luigi Leonardi <[email protected]>
    Reviewed-by: Stefano Garzarella <[email protected]>
    Acked-by: Michael S. Tsirkin <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Paolo Abeni <[email protected]>
    Cc: Luigi Leonardi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

vsock/virtio: fix length and offset in tap skb for split packets [+ + +]
Author: Stefano Garzarella <[email protected]>
Date:   Fri May 8 18:44:10 2026 +0200

    vsock/virtio: fix length and offset in tap skb for split packets
    
    commit 5f344d809e015fba3709e5219428c00b8ac5d7df upstream.
    
    virtio_transport_build_skb() builds a new skb to be delivered to the
    vsockmon tap device. To build the new skb, it uses the original skb
    data length as payload length, but as the comment notes, the original
    packet stored in the skb may have been split in multiple packets, so we
    need to use the length in the header, which is correctly updated before
    the packet is delivered to the tap, and the offset for the data.
    
    This was also similar to what we did before commit 71dc9ec9ac7d
    ("virtio/vsock: replace virtio_vsock_pkt with sk_buff") where we probably
    missed something during the skb conversion.
    
    Also update the comment above, which was left stale by the skb
    conversion and still mentioned a buffer pointer that no longer exists.
    
    Fixes: 71dc9ec9ac7d ("virtio/vsock: replace virtio_vsock_pkt with sk_buff")
    Signed-off-by: Stefano Garzarella <[email protected]>
    Reviewed-by: Bobby Eshleman <[email protected]>
    Reviewed-by: Arseniy Krasnov <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Acked-by: Michael S. Tsirkin <[email protected]>
    Signed-off-by: Paolo Abeni <[email protected]>
    [LL: Fixed conflict since this tree does not use the offset added by commit
     0df7cd3c13e4 ("vsock/virtio/vhost: read data from non-linear skb")]
    Signed-off-by: Luigi Leonardi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
vsock: fix buffer size clamping order [+ + +]
Author: Norbert Szetei <[email protected]>
Date:   Thu Apr 9 18:34:12 2026 +0200

    vsock: fix buffer size clamping order
    
    commit d114bfdc9b76bf93b881e195b7ec957c14227bab upstream.
    
    In vsock_update_buffer_size(), the buffer size was being clamped to the
    maximum first, and then to the minimum. If a user sets a minimum buffer
    size larger than the maximum, the minimum check overrides the maximum
    check, inverting the constraint.
    
    This breaks the intended socket memory boundaries by allowing the
    vsk->buffer_size to grow beyond the configured vsk->buffer_max_size.
    
    Fix this by checking the minimum first, and then the maximum. This
    ensures the buffer size never exceeds the buffer_max_size.
    
    Fixes: b9f2b0ffde0c ("vsock: handle buffer_size sockopts in the core")
    Suggested-by: Stefano Garzarella <[email protected]>
    Signed-off-by: Norbert Szetei <[email protected]>
    Reviewed-by: Stefano Garzarella <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jakub Kicinski <[email protected]>
    Cc: Luigi Leonardi <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
wifi: ath5k: do not access array OOB [+ + +]
Author: Jiri Slaby (SUSE) <[email protected]>
Date:   Tue Dec 9 11:04:59 2025 +0100

    wifi: ath5k: do not access array OOB
    
    commit d748603f12baff112caa3ab7d39f50100f010dbd upstream.
    
    Vincent reports:
    > The ath5k driver seems to do an array-index-out-of-bounds access as
    > shown by the UBSAN kernel message:
    > UBSAN: array-index-out-of-bounds in drivers/net/wireless/ath/ath5k/base.c:1741:20
    > index 4 is out of range for type 'ieee80211_tx_rate [4]'
    > ...
    > Call Trace:
    >  <TASK>
    >  dump_stack_lvl+0x5d/0x80
    >  ubsan_epilogue+0x5/0x2b
    >  __ubsan_handle_out_of_bounds.cold+0x46/0x4b
    >  ath5k_tasklet_tx+0x4e0/0x560 [ath5k]
    >  tasklet_action_common+0xb5/0x1c0
    
    It is real. 'ts->ts_final_idx' can be 3 on 5212, so:
       info->status.rates[ts->ts_final_idx + 1].idx = -1;
    with the array defined as:
       struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES];
    while the size is:
       #define IEEE80211_TX_MAX_RATES  4
    is indeed bogus.
    
    Set this 'idx = -1' sentinel only if the array index is less than the
    array size. As mac80211 will not look at rates beyond the size
    (IEEE80211_TX_MAX_RATES).
    
    Note: The effect of the OOB write is negligible. It just overwrites the
    next member of info->status, i.e. ack_signal.
    
    Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
    Reported-by: Vincent Danjean <[email protected]>
    Link: https://lore.kernel.org/all/[email protected]
    Closes: https://bugs.debian.org/1119093
    Fixes: 6d7b97b23e11 ("ath5k: fix tx status reporting issues")
    Cc: [email protected]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Jeff Johnson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: b43: enforce bounds check on firmware key index in b43_rx() [+ + +]
Author: Tristan Madani <[email protected]>
Date:   Fri Apr 17 11:11:44 2026 +0000

    wifi: b43: enforce bounds check on firmware key index in b43_rx()
    
    commit 1f4f78bf8549e6ac4f04fba4176854f3a6e0c332 upstream.
    
    The firmware-controlled key index in b43_rx() can exceed the dev->key[]
    array size (58 entries). The existing B43_WARN_ON is non-enforcing in
    production builds, allowing an out-of-bounds read.
    
    Make the B43_WARN_ON check enforcing by dropping the frame when the
    firmware returns an invalid key index.
    
    Suggested-by: Jonas Gorski <[email protected]>
    Acked-by: Michael Büsch <[email protected]>
    Fixes: e4d6b7951812 ("[B43]: add mac80211-based driver for modern BCM43xx devices")
    Cc: [email protected]
    Signed-off-by: Tristan Madani <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: b43legacy: enforce bounds check on firmware key index in RX path [+ + +]
Author: Tristan Madani <[email protected]>
Date:   Fri Apr 17 11:11:45 2026 +0000

    wifi: b43legacy: enforce bounds check on firmware key index in RX path
    
    commit a035766f970bde2d4298346a31a80685be5c0205 upstream.
    
    Same fix as b43: the firmware-controlled key index in b43legacy_rx()
    can exceed dev->max_nr_keys. The existing B43legacy_WARN_ON is
    non-enforcing in production builds, allowing an out-of-bounds read of
    dev->key[].
    
    Make the check enforcing by dropping the frame for invalid indices.
    
    Fixes: 75388acd0cd8 ("[B43LEGACY]: add mac80211-based driver for legacy BCM43xx devices")
    Cc: [email protected]
    Signed-off-by: Tristan Madani <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: brcmfmac: Fix potential use-after-free issue when stopping watchdog task [+ + +]
Author: Marek Szyprowski <[email protected]>
Date:   Thu Apr 16 11:33:39 2026 +0200

    wifi: brcmfmac: Fix potential use-after-free issue when stopping watchdog task
    
    commit c623b63580880cc742255eaed3d79804c1b91143 upstream.
    
    Watchdog task might end between send_sig() and kthread_stop() calls, what
    results in the use-after-free issue. Fix this by increasing watchdog task
    reference count before calling send_sig() and dropping it by switching to
    kthread_stop_put().
    
    Cc: [email protected]
    Fixes: 373c83a801f1 ("brcmfmac: stop watchdog before detach and free everything")
    Fixes: a9ffda88be74 ("brcm80211: fmac: abstract bus_stop interface function pointer")
    Signed-off-by: Marek Szyprowski <[email protected]>
    Acked-by: Arend van Spriel <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: mac80211: drop stray 'static' from fast-RX rx_result [+ + +]
Author: Catherine <[email protected]>
Date:   Fri Apr 24 21:14:36 2026 +0800

    wifi: mac80211: drop stray 'static' from fast-RX rx_result
    
    commit 7a5b81e0c87a075afd572f659d8eb68c9c4cd2ba upstream.
    
    ieee80211_invoke_fast_rx() is documented as safe for parallel RX, but
    its per-invocation rx_result is declared static. Concurrent callers then
    share one instance and can overwrite each other's result between
    ieee80211_rx_mesh_data() and the switch on res.
    
    That can make a packet that was queued or consumed by
    ieee80211_rx_mesh_data() fall through into ieee80211_rx_8023(), or make
    a packet that should continue return as queued.
    
    Make res an automatic variable so each invocation keeps its own result.
    
    Fixes: 3468e1e0c639 ("wifi: mac80211: add mesh fast-rx support")
    Cc: [email protected]
    Signed-off-by: Catherine <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: mac80211: remove station if connection prep fails [+ + +]
Author: Johannes Berg <[email protected]>
Date:   Tue May 5 15:15:34 2026 +0200

    wifi: mac80211: remove station if connection prep fails
    
    commit 283fc9e44ff5b5ac967439b4951b80bd4299f4e4 upstream.
    
    If connection preparation fails for MLO connections, then the
    interface is completely reset to non-MLD. In this case, we must
    not keep the station since it's related to the link of the vif
    being removed. Delete an existing station. Any "new_sta" is
    already being removed, so that doesn't need changes.
    
    This fixes a use-after-free/double-free in debugfs if that's
    enabled, because a vif going from MLD (and to MLD, but that's
    not relevant here) recreates its entire debugfs.
    
    Cc: [email protected]
    Fixes: 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link")
    Reviewed-by: Miriam Rachel Korenblit <[email protected]>
    Link: https://patch.msgid.link/20260505151533.c4e52deb06ad.Iafe56cec7de8512626169496b134bce3a6c17010@changeid
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: mt76: connac: introduce helper for mt7925 chipset [+ + +]
Author: Deren Wu <[email protected]>
Date:   Thu Apr 30 13:23:22 2026 -0400

    wifi: mt76: connac: introduce helper for mt7925 chipset
    
    [ Upstream commit 525209262f9c2999f6f5fa0c40b4519cd6acfa2e ]
    
    Introduce is_mt7925() helper for new chipset. mt7925 runs the same
    firmware download and mmio map flow as mt7921.
    
    This is a preliminary patch to support mt7925 driver.
    
    Co-developed-by: Lorenzo Bianconi <[email protected]>
    Signed-off-by: Lorenzo Bianconi <[email protected]>
    Signed-off-by: Deren Wu <[email protected]>
    Signed-off-by: Felix Fietkau <[email protected]>
    Stable-dep-of: 56154fef47d1 ("wifi: mt76: mt792x: fix mt7925u USB WFSYS reset handling")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: mt76: mt7921: fix a potential clc buffer length underflow [+ + +]
Author: Leon Yen <[email protected]>
Date:   Thu Oct 9 10:01:58 2025 +0800

    wifi: mt76: mt7921: fix a potential clc buffer length underflow
    
    commit 5373f8b19e568b5c217832b9bbef165bd2b2df14 upstream.
    
    The buf_len is used to limit the iterations for retrieving the country
    power setting and may underflow under certain conditions due to changes
    in the power table in CLC.
    
    This underflow leads to an almost infinite loop or an invalid power
    setting resulting in driver initialization failure.
    
    Cc: [email protected]
    Fixes: fa6ad88e023d ("wifi: mt76: mt7921: fix country count limitation for CLC")
    Signed-off-by: Leon Yen <[email protected]>
    Signed-off-by: Ming Yen Hsieh <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Felix Fietkau <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: mt76: mt7921: fix ROC abort flow interruption in mt7921_roc_work [+ + +]
Author: Quan Zhou <[email protected]>
Date:   Fri Jan 23 10:16:25 2026 +0800

    wifi: mt76: mt7921: fix ROC abort flow interruption in mt7921_roc_work
    
    commit fdfa39f9f4fbae532b162da913a67b2410caf38f upstream.
    
    The mt7921_set_roc API may be executed concurrently with mt7921_roc_work,
    specifically between the following code paths:
    
    - The check and clear of MT76_STATE_ROC in mt7921_roc_work:
        if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
            return;
    
    - The execution of ieee80211_iterate_active_interfaces.
    
    This race condition can interrupt the ROC abort flow, resulting in
    the ROC process failing to abort as expected.
    
    To address this defect, the modification of MT76_STATE_ROC is now
    protected by mt792x_mutex_acquire(phy->dev). This ensures that
    changes to the ROC state are properly synchronized, preventing
    race conditions and ensuring the ROC abort flow is not interrupted.
    
    Fixes: 034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support")
    Cc: [email protected]
    Signed-off-by: Quan Zhou <[email protected]>
    Reviewed-by: Sean Wang <[email protected]>
    Link: https://patch.msgid.link/2568ece8b557e5dda79391414c834ef3233049b6.1769133724.git.quan.zhou@mediatek.com
    Signed-off-by: Felix Fietkau <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: mt76: mt792x: describe USB WFSYS reset with a descriptor [+ + +]
Author: Sean Wang <[email protected]>
Date:   Thu Apr 30 13:23:23 2026 -0400

    wifi: mt76: mt792x: describe USB WFSYS reset with a descriptor
    
    [ Upstream commit e6f48512c1ceebcd1ce6bb83df3b3d56a261507d ]
    
    Prepare mt792xu_wfsys_reset() for chips that share the same USB WFSYS
    reset flow but use different register definitions.
    
    This is a pure refactor of the current mt7921u path and keeps the reset
    sequence unchanged.
    
    Signed-off-by: Sean Wang <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Felix Fietkau <[email protected]>
    Stable-dep-of: 56154fef47d1 ("wifi: mt76: mt792x: fix mt7925u USB WFSYS reset handling")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: mt76: mt792x: fix mt7925u USB WFSYS reset handling [+ + +]
Author: Sean Wang <[email protected]>
Date:   Thu Apr 30 13:23:24 2026 -0400

    wifi: mt76: mt792x: fix mt7925u USB WFSYS reset handling
    
    [ Upstream commit 56154fef47d104effa9f29ed3db4f805cbc0d640 ]
    
    mt7925u uses different reset/status registers from mt7921u. Reusing the
    mt7921u register set causes the WFSYS reset to fail.
    
    Add a chip-specific descriptor in mt792xu_wfsys_reset() to select the
    correct registers and fix mt7925u failing to initialize after a warm
    reboot.
    
    Fixes: d28e1a48952e ("wifi: mt76: mt792x: introduce mt792x-usb module")
    Cc: [email protected]
    Signed-off-by: Sean Wang <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Felix Fietkau <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: mwifiex: fix use-after-free in mwifiex_adapter_cleanup() [+ + +]
Author: Daniel Hodges <[email protected]>
Date:   Thu Apr 30 12:54:06 2026 -0400

    wifi: mwifiex: fix use-after-free in mwifiex_adapter_cleanup()
    
    [ Upstream commit ae5e95d4157481693be2317e3ffcd84e36010cbb ]
    
    The mwifiex_adapter_cleanup() function uses timer_delete()
    (non-synchronous) for the wakeup_timer before the adapter structure is
    freed. This is incorrect because timer_delete() does not wait for any
    running timer callback to complete.
    
    If the wakeup_timer callback (wakeup_timer_fn) is executing when
    mwifiex_adapter_cleanup() is called, the callback will continue to
    access adapter fields (adapter->hw_status, adapter->if_ops.card_reset,
    etc.) which may be freed by mwifiex_free_adapter() called later in the
    mwifiex_remove_card() path.
    
    Use timer_delete_sync() instead to ensure any running timer callback has
    completed before returning.
    
    Fixes: 4636187da60b ("mwifiex: add wakeup timer based recovery mechanism")
    Cc: [email protected]
    Signed-off-by: Daniel Hodges <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    [ changed `timer_delete_sync()` to `del_timer_sync()` ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: rsi: fix kthread lifetime race between self-exit and external-stop [+ + +]
Author: Jeongjun Park <[email protected]>
Date:   Thu Apr 23 02:38:46 2026 +0900

    wifi: rsi: fix kthread lifetime race between self-exit and external-stop
    
    commit db57a1aa54ff68669781976e4edb045e09e2b65b upstream.
    
    RSI driver use both self-exit(kthread_complete_and_exit) and external-stop
    (kthread_stop) when killing a kthread. Generally, kthread_stop() is called
    first, and in this case, no particular issues occur.
    
    However, in rare instances where kthread_complete_and_exit() is called
    first and then kthread_stop() is called, a UAF occurs because the kthread
    object, which has already exited and been freed, is accessed again.
    
    Therefore, to prevent this with minimal modification, you must remove
    kthread_stop() and change the code to wait until the self-exit operation
    is completed.
    
    Cc: <[email protected]>
    Reported-by: [email protected]
    Closes: https://lore.kernel.org/all/[email protected]/
    Fixes: 4c62764d0fc2 ("rsi: improve kernel thread handling to fix kernel panic")
    Signed-off-by: Jeongjun Park <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Johannes Berg <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: rtl8xxxu: fix potential use of uninitialized value [+ + +]
Author: Yi Cong <[email protected]>
Date:   Fri May 8 20:35:20 2026 -0400

    wifi: rtl8xxxu: fix potential use of uninitialized value
    
    [ Upstream commit f8a2fc809bfeb49130709b31a4d357a049f28547 ]
    
    The local variables 'mcs' and 'nss' in rtl8xxxu_update_ra_report() are
    passed to rtl8xxxu_desc_to_mcsrate() as output parameters. If the helper
    function encounters an unhandled rate index, it may return without setting
    these values, leading to the use of uninitialized stack data.
    
    Remove the helper rtl8xxxu_desc_to_mcsrate() and inline the logic into
    rtl8xxxu_update_ra_report(). This fixes the use of uninitialized 'mcs'
    and 'nss' variables for legacy rates.
    
    The new implementation explicitly handles:
    - Legacy rates: Set bitrate only.
    - HT rates (MCS0-15): Set MCS flags, index, and NSS (1 or 2) directly.
    - Invalid rates: Return early.
    
    Fixes: 7de16123d9e2 ("wifi: rtl8xxxu: Introduce rtl8xxxu_update_ra_report")
    Cc: [email protected]
    Suggested-by: Ping-Ke Shih <[email protected]>
    Signed-off-by: Yi Cong <[email protected]>
    Link: https://lore.kernel.org/all/[email protected]/
    Signed-off-by: Ping-Ke Shih <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

wifi: rtw88: check for PCI upstream bridge existence [+ + +]
Author: Fedor Pchelkin <[email protected]>
Date:   Fri Feb 20 12:47:30 2026 +0300

    wifi: rtw88: check for PCI upstream bridge existence
    
    commit eb101d2abdcccb514ca4fccd3b278dd8267374f6 upstream.
    
    pci_upstream_bridge() returns NULL if the device is on a root bus.  If
    8821CE is installed in the system with such a PCI topology, the probing
    routine will crash.  This has probably been unnoticed as 8821CE is mostly
    supplied in laptops where there is a PCI-to-PCI bridge located upstream
    from the device.  However the card might be installed on a system with
    different configuration.
    
    Check if the bridge does exist for the specific workaround to be applied.
    
    Found by Linux Verification Center (linuxtesting.org) with Svace static
    analysis tool.
    
    Fixes: 24f5e38a13b5 ("rtw88: Disable PCIe ASPM while doing NAPI poll on 8821CE")
    Cc: [email protected]
    Signed-off-by: Fedor Pchelkin <[email protected]>
    Acked-by: Ping-Ke Shih <[email protected]>
    Signed-off-by: Ping-Ke Shih <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
x86/shstk: Prevent deadlock during shstk sigreturn [+ + +]
Author: Rick Edgecombe <[email protected]>
Date:   Thu May 7 16:53:09 2026 -0700

    x86/shstk: Prevent deadlock during shstk sigreturn
    
    [ Upstream commit 9874b2917b9fbc30956fee209d3c4aa47201c64e ]
    
    During sigreturn the shadow stack signal frame is popped. The kernel does
    this by reading the shadow stack using normal read accesses. When it can't
    assume the memory is shadow stack, it takes extra steps to makes sure it is
    reading actual shadow stack memory and not other normal readable memory. It
    does this by holding the mmap read lock while doing the access and checking
    the flags of the VMA.
    
    Unfortunately that is not safe. If the read of the shadow stack sigframe
    hits a page fault, the fault handler will try to recursively grab another
    mmap read lock. This normally works ok, but if a writer on another CPU is
    also waiting, the second read lock could fail and cause a deadlock.
    
    Fix this by doing the read of the userspace memory via gup. Embed it in the
    get_shstk_data() helper.
    
    Currently there is a check that skips the lookup work when the SSP can be
    assumed to be on a shadow stack. While reorganizing the function, remove
    the optimization to make the tricky code flows more common, such that
    issues like this cannot escape detection for so long.
    
    [Due to missing per-vma MM sequence counter, use a simpler GUP based
    solution for the backport]
    Cc: <[email protected]> # Depends on https://lore.kernel.org/all/[email protected]/
    Signed-off-by: Rick Edgecombe <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
x86: shadow stacks: proper error handling for mmap lock [+ + +]
Author: Linus Torvalds <[email protected]>
Date:   Wed Apr 8 13:18:57 2026 -0700

    x86: shadow stacks: proper error handling for mmap lock
    
    [ Upstream commit 52f657e34d7b21b47434d9d8b26fa7f6778b63a0 ]
    
    김영민 reports that shstk_pop_sigframe() doesn't check for errors from
    mmap_read_lock_killable(), which is a silly oversight, and also shows
    that we haven't marked those functions with "__must_check", which would
    have immediately caught it.
    
    So let's fix both issues.
    
    Reported-by: 김영민 <[email protected]>
    Acked-by: Oleg Nesterov <[email protected]>
    Acked-by: Dave Hansen <[email protected]>
    Acked-by: Rick Edgecombe <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
xfrm: ah: account for ESN high bits in async callbacks [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Wed May 13 12:46:35 2026 -0400

    xfrm: ah: account for ESN high bits in async callbacks
    
    [ Upstream commit ec54093e6a8f87e800bb6aa15eb7fc1e33faa524 ]
    
    AH allocates its temporary auth/ICV layout differently when ESN is enabled:
    the async ahash setup appends a 4-byte seqhi slot before the ICV or
    auth_data area, but the async completion callbacks still reconstruct the
    temporary layout as if seqhi were absent.
    
    With an async AH implementation selected, that makes AH copy or compare
    the wrong bytes on both the IPv4 and IPv6 paths. In UML repro on IPv4 AH
    with ESN and forced async hmac(sha1), ping fails with 100% packet loss,
    and the callback logs show the pre-fix drift:
    
      ah4 output_done: esn=1 err=0 icv_off=20 expected_off=24
      ah4 input_done: esn=1 auth_off=20 expected_auth_off=24 icv_off=32 expected_icv_off=36
    
    Reconstruct the callback-side layout the same way the setup path built it
    by skipping the ESN seqhi slot before locating the saved auth_data or ICV.
    Per RFC 4302, the ESN high-order 32 bits participate in the AH ICV
    computation, so the async callbacks must account for the seqhi slot.
    
    Post-fix, the same IPv4 AH+ESN+forced-async-hmac(sha1) UML repro shows
    the corrected offset (ah4 output_done: esn=1 err=0 icv_off=24
    expected_off=24) and ping succeeds; net/ipv4/ah4.o and net/ipv6/ah6.o
    build clean at W=1. IPv6 AH+ESN was not exercised at runtime, and the
    change has not been tested against a real async hardware AH engine.
    
    Fixes: d4d573d0334d ("{IPv4,xfrm} Add ESN support for AH egress part")
    Fixes: d8b2a8600b0e ("{IPv4,xfrm} Add ESN support for AH ingress part")
    Fixes: 26dd70c3fad3 ("{IPv6,xfrm} Add ESN support for AH egress part")
    Fixes: 8d6da6f32557 ("{IPv6,xfrm} Add ESN support for AH ingress part")
    Cc: [email protected]
    Assisted-by: Codex:gpt-5-4
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <[email protected]>
    Signed-off-by: Steffen Klassert <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

xfrm: defensively unhash xfrm_state lists in __xfrm_state_delete [+ + +]
Author: Michal Kosiorek <[email protected]>
Date:   Wed May 13 13:16:28 2026 -0400

    xfrm: defensively unhash xfrm_state lists in __xfrm_state_delete
    
    [ Upstream commit 14acf9652e5690de3c7486c6db5fb8dafd0a32a3 ]
    
    KASAN reproduces a slab-use-after-free in __xfrm_state_delete()'s
    hlist_del_rcu calls under syzkaller load on linux-6.12.y stable
    (reproduced on 6.12.47, also reachable via the same code path on
    torvalds/master and on the ipsec tree). Nine unique signatures cluster
    in the xfrm_state lifecycle, the load-bearing one being:
    
      BUG: KASAN: slab-use-after-free in __hlist_del include/linux/list.h:990 [inline]
      BUG: KASAN: slab-use-after-free in hlist_del_rcu include/linux/rculist.h:516 [inline]
      BUG: KASAN: slab-use-after-free in __xfrm_state_delete net/xfrm/xfrm_state.c
      Write of size 8 at addr ffff8881198bcb70 by task kworker/u8:9/435
    
      Workqueue: netns cleanup_net
      Call Trace:
       __hlist_del / hlist_del_rcu
       __xfrm_state_delete
       xfrm_state_delete
       xfrm_state_flush
       xfrm_state_fini
       ops_exit_list
       cleanup_net
    
    The other observed signatures hit the same slab object from
    __xfrm_state_lookup, xfrm_alloc_spi, __xfrm_state_insert and an OOB
    write variant of __xfrm_state_delete, all on the byseq/byspi
    hash chains.
    
    __xfrm_state_delete() guards its byseq and byspi unhashes with
    value-based predicates:
    
            if (x->km.seq)
                    hlist_del_rcu(&x->byseq);
            if (x->id.spi)
                    hlist_del_rcu(&x->byspi);
    
    while everywhere else in the file (e.g. state_cache, state_cache_input)
    the safer hlist_unhashed() check is used. xfrm_alloc_spi() sets
    x->id.spi = newspi inside xfrm_state_lock and then immediately inserts
    into byspi, but a path that observes x->id.spi != 0 outside of
    xfrm_state_lock can still skip-or-hit the byspi unhash inconsistently
    with whether x is actually on the list. The same holds for x->km.seq
    versus byseq, and the bydst/bysrc unhashes have no predicate at all,
    so a second __xfrm_state_delete() on the same object writes through
    LIST_POISON pprev.
    
    The defensive change here:
    
      - Use hlist_del_init_rcu() instead of hlist_del_rcu() on bydst,
        bysrc, byseq and byspi so a second deletion is a no-op rather
        than a write through LIST_POISON pprev. The byseq/byspi nodes
        are already initialised in xfrm_state_alloc().
      - Test hlist_unhashed() rather than the value predicate for
        byseq/byspi, so the unhash decision tracks list state rather than
        mutable scalar fields.
    
    Empirical verification: applied this patch on top of v6.12.47, rebuilt,
    and re-ran the same syzkaller harness for 1h16m on a previously-crashy
    configuration that produced ~100 hits each of slab-use-after-free
    Read in xfrm_alloc_spi / Read in __xfrm_state_lookup / Write in
    __xfrm_state_delete. After the patch, 7.1M execs across 32 VMs at
    ~1550 exec/sec produced zero xfrm_state UAF/OOB hits. /proc/slabinfo
    confirms the xfrm_state slab is actively allocated and freed during
    the run (~143 KiB resident), so the fuzzer is still exercising those
    code paths -- they just no longer crash.
    
    Reproduction:
    
      - Linux 6.12.47 x86_64 + KASAN_GENERIC + KASAN_INLINE + KCOV
      - syzkaller @ 746545b8b1e4c3a128db8652b340d3df90ce61db
      - 32 QEMU/KVM VMs x 2 vCPU on AWS c5.metal bare metal
      - 9 unique signatures collected in ~9h, all within xfrm_state
        lifecycle
    
    Fixes: fe9f1d8779cb ("xfrm: add state hashtable keyed by seq")
    Fixes: 7b4dc3600e48 ("[XFRM]: Do not add a state whose SPI is zero to the SPI hash.")
    Reported-by: Michal Kosiorek <[email protected]>
    Tested-by: Michal Kosiorek <[email protected]>
    Cc: [email protected]
    Signed-off-by: Michal Kosiorek <[email protected]>
    Signed-off-by: Steffen Klassert <[email protected]>
    [ dropped state_cache/state_cache_input unhash hunks and xfrm_nat_keepalive_state_updated() call ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

xfrm: provide message size for XFRM_MSG_MAPPING [+ + +]
Author: Ruijie Li <[email protected]>
Date:   Wed Apr 29 00:41:43 2026 +0800

    xfrm: provide message size for XFRM_MSG_MAPPING
    
    commit 28465227c80fe417b4013c432be1f3737cb9f9a3 upstream.
    
    The compat 64=>32 translation path handles XFRM_MSG_MAPPING, but
    xfrm_msg_min[] does not provide the native payload size for this
    message type.
    
    Add the missing XFRM_MSG_MAPPING entry so compat translation can size
    and translate mapping notifications correctly.
    
    Fixes: 5461fc0c8d9f ("xfrm/compat: Add 64=>32-bit messages translator")
    Cc: [email protected]
    Reported-by: Yuan Tan <[email protected]>
    Reported-by: Yifan Wu <[email protected]>
    Reported-by: Juefei Pu <[email protected]>
    Reported-by: Xin Liu <[email protected]>
    Signed-off-by: Ruijie Li <[email protected]>
    Signed-off-by: Ren Wei <[email protected]>
    Signed-off-by: Steffen Klassert <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
xfs: fix a resource leak in xfs_alloc_buftarg() [+ + +]
Author: Haoxiang Li <[email protected]>
Date:   Fri May 8 09:22:52 2026 -0400

    xfs: fix a resource leak in xfs_alloc_buftarg()
    
    [ Upstream commit 29a7b2614357393b176ef06ba5bc3ff5afc8df69 ]
    
    In the error path, call fs_put_dax() to drop the DAX
    device reference.
    
    Fixes: 6f643c57d57c ("xfs: implement ->notify_failure() for XFS")
    Cc: [email protected]
    Signed-off-by: Haoxiang Li <[email protected]>
    Reviewed-by: Darrick J. Wong <[email protected]>
    Signed-off-by: Carlos Maiolino <[email protected]>
    [ kept `kmem_free(btp)` and `return NULL` instead of `kfree(btp)`/`ERR_PTR(error)` ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
zram: do not forget to endio for partial discard requests [+ + +]
Author: Sergey Senozhatsky <[email protected]>
Date:   Tue Mar 31 16:42:44 2026 +0900

    zram: do not forget to endio for partial discard requests
    
    commit e3668b371329ea036ff022ce8ecc82f8befcf003 upstream.
    
    As reported by Qu Wenruo and Avinesh Kumar, the following
    
     getconf PAGESIZE
     65536
     blkdiscard -p 4k /dev/zram0
    
    takes literally forever to complete.  zram doesn't support partial
    discards and just returns immediately w/o doing any discard work in such
    cases.  The problem is that we forget to endio on our way out, so
    blkdiscard sleeps forever in submit_bio_wait().  Fix this by jumping to
    end_bio label, which does bio_endio().
    
    Link: https://lore.kernel.org/[email protected]
    Fixes: 0120dd6e4e20 ("zram: make zram_bio_discard more self-contained")
    Signed-off-by: Sergey Senozhatsky <[email protected]>
    Reported-by: Qu Wenruo <[email protected]>
    Closes: https://lore.kernel.org/linux-block/[email protected]
    Tested-by: Qu Wenruo <[email protected]>
    Reported-by: Avinesh Kumar <[email protected]>
    Closes: https://bugzilla.suse.com/show_bug.cgi?id=1256530
    Reviewed-by: Christoph Hellwig <[email protected]>
    Cc: Brian Geffon <[email protected]>
    Cc: Jens Axboe <[email protected]>
    Cc: Minchan Kim <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>