Changelog in Linux kernel 6.12.86

 
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 09:34:23 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:13:33 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 09:34:22 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: 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: 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_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: 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: 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]>
 
amdgpu/jpeg: fix deepsleep register for jpeg 5_0_0 and 5_0_2 [+ + +]
Author: David (Ming Qiang) Wu <[email protected]>
Date:   Mon Mar 9 18:48:37 2026 -0400

    amdgpu/jpeg: fix deepsleep register for jpeg 5_0_0 and 5_0_2
    
    commit e90dc3b2d73986610476b02c29d0074aa4d92fb0 upstream.
    
    PCTL0__MMHUB_DEEPSLEEP_IB is 0x69004 on MMHUB 4,1,0 and
    and 0x60804 on MMHUB 4,2,0. 0x62a04 is on MMHUB 1,8,0/1.
    
    The DS bits are adjusted to cover more JPEG engines and MMHUB
    version.
    
    Signed-off-by: David (Ming Qiang) Wu <[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]>

 
apparmor: use target task's context in apparmor_getprocattr() [+ + +]
Author: Cengiz Can <[email protected]>
Date:   Tue Feb 10 11:17:14 2026 +0300

    apparmor: use target task's context in apparmor_getprocattr()
    
    commit 4afc61702bdcc3b9b519749ef966cf762a6e7051 upstream.
    
    apparmor_getprocattr() incorrectly calls task_ctx(current) instead of
    task_ctx(task) when retrieving prev and exec attributes, returning the
    caller's labels rather than the target's.
    
    Fix by passing task to task_ctx().
    
    The issue can be reproduced when a process with an onexec transition
    (e.g., configured by a container runtime) is inspected via
    /proc/<pid>/attr/apparmor/exec. The reader's own value is returned
    instead of the target's.
    
    Reported-by: Qualys Security Advisory <[email protected]>
    Fixes: 3b529a7600d8 ("apparmor: move task domain change info to task security")
    Cc: [email protected]
    Co-developed-by: Cengiz Can <[email protected]>
    Signed-off-by: Cengiz Can <[email protected]>
    Co-developed-by: John Johansen <[email protected]>
    Signed-off-by: John Johansen <[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:   Mon Mar 9 02:57:24 2026 +0000

    arm64/mm: Enable batched TLB flush in unmap_hotplug_range()
    
    commit 48478b9f791376b4b89018d7afdfd06865498f65 upstream.
    
    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]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
arm64: dts: marvell: uDPU: add ethernet aliases [+ + +]
Author: Robert Marko <[email protected]>
Date:   Tue Jan 27 13:32:15 2026 +0100

    arm64: dts: marvell: uDPU: add ethernet aliases
    
    commit 38f09c97340cd23f976242e6cb1e7aa4c8ed28d0 upstream.
    
    On eDPU plus, which is an updated revision of eDPU which uses an external
    MV88E6361 switch we are relying on U-Boot to detect the board, and then
    enable and disable the required nodes for that revision.
    
    However, it seems that I missed adding the required aliases for ethernet
    controllers, and this worked as in OpenWrt we had added those locally.
    
    Cc: [email protected]
    Fixes: 660b8b2f3944 ("arm64: dts: marvell: eDPU: add support for version with external switch")
    Signed-off-by: Robert Marko <[email protected]>
    Signed-off-by: Gregory CLEMENT <[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]>

 
block: fix zone write plugs refcount handling in disk_zone_wplug_schedule_bio_work() [+ + +]
Author: Damien Le Moal <[email protected]>
Date:   Fri Feb 27 22:19:45 2026 +0900

    block: fix zone write plugs refcount handling in disk_zone_wplug_schedule_bio_work()
    
    commit 0a8b8af896e0ef83e188e1fe20f98f2bbb1c2459 upstream.
    
    The function disk_zone_wplug_schedule_bio_work() always takes a
    reference on the zone write plug of the BIO work being scheduled. This
    ensures that the zone write plug cannot be freed while the BIO work is
    being scheduled but has not run yet. However, this unconditional
    reference taking is fragile since the reference taken is released by the
    BIO work blk_zone_wplug_bio_work() function, which implies that there
    always must be a 1:1 relation between the work being scheduled and the
    work running.
    
    Make sure to drop the reference taken when scheduling the BIO work if
    the work is already scheduled, that is, when queue_work() returns false.
    
    Fixes: 9e78c38ab30b ("block: Hold a reference on zone write plugs to schedule submission")
    Cc: [email protected]
    Signed-off-by: Damien Le Moal <[email protected]>
    Reviewed-by: Christoph Hellwig <[email protected]>
    Reviewed-by: Bart Van Assche <[email protected]>
    Reviewed-by: Johannes Thumshirn <[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:30:00 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_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]>

 
bus: mhi: host: pci_generic: Switch to async power up to avoid boot delays [+ + +]
Author: Qiang Yu <[email protected]>
Date:   Tue Mar 3 01:02:13 2026 -0800

    bus: mhi: host: pci_generic: Switch to async power up to avoid boot delays
    
    commit cfdb41adf1c2822ad1b1791d4d11093edb5582b6 upstream.
    
    Some modem devices can take significant time (up to 20 secs for sdx75) to
    enter mission mode during initialization. Currently, mhi_sync_power_up()
    waits for this entire process to complete, blocking other driver probes
    and delaying system boot.
    
    Switch to mhi_async_power_up() so probe can return immediately while MHI
    initialization continues in the background. This eliminates lengthy boot
    delays and allows other drivers to probe in parallel, improving overall
    system boot performance.
    
    Fixes: 5571519009d0 ("bus: mhi: host: pci_generic: Add SDX75 based modem support")
    Signed-off-by: Qiang Yu <[email protected]>
    Signed-off-by: Manivannan Sadhasivam <[email protected]>
    Cc: [email protected]
    Link: https://patch.msgid.link/[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:   Fri Mar 27 17:23:08 2026 +0100

    ceph: only d_add() negative dentries when they are unhashed
    
    commit 803447f93d75ab6e40c85e6d12b5630d281d70d6 upstream.
    
    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]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
check-uapi: link into shared objects [+ + +]
Author: Arnd Bergmann <[email protected]>
Date:   Fri Mar 6 17:33:07 2026 +0100

    check-uapi: link into shared objects
    
    commit a261f6dff3c1653c19c065c3b3650c625447b8a7 upstream.
    
    While testing ABI changes across all architectures, I found that abidiff
    sometimes produces nonsensical output. Further debugging identified
    missing or broken libelf support for architecture specific relocations
    in ET_REL binaries as the source of the problem[1].
    
    Change the script to no longer produce a relocatable object file but
    instead create a shared library for each header. This makes abidiff
    work for all of the architectures in upstream linux kernels.
    
    Link: https://sourceware.org/bugzilla/show_bug.cgi?id=33869
    Cc: [email protected]
    Signed-off-by: Arnd Bergmann <[email protected]>
    Reviewed-by: Thomas Weißschuh <[email protected]>
    Acked-by: Nathan Chancellor <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Nicolas Schier <[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 error codes in OTP reads [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Sun Feb 15 21:51:53 2026 +0100

    crypto: atmel-sha204a - Fix error codes in OTP reads
    
    commit 094c276da6a0d4971c3faae09a36b51d096659b2 upstream.
    
    Return -EINVAL from atmel_i2c_init_read_otp_cmd() on invalid addresses
    instead of -1. Since the OTP zone is accessed in 4-byte blocks, valid
    addresses range from 0 to OTP_ZONE_SIZE / 4 - 1. Fix the bounds check
    accordingly.
    
    In atmel_sha204a_otp_read(), propagate the actual error code from
    atmel_i2c_init_read_otp_cmd() instead of -1. Also, return -EIO instead
    of -EINVAL when the device is not ready.
    
    Cc: [email protected]
    Fixes: e05ce444e9e5 ("crypto: atmel-sha204a - add reading from otp zone")
    Signed-off-by: Thorsten Blum <[email protected]>
    Reviewed-by: Lothar Rubusch <[email protected]>
    Signed-off-by: Herbert Xu <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

crypto: atmel-sha204a - Fix OTP sysfs read and error handling [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Mon Feb 16 08:45:51 2026 +0100

    crypto: atmel-sha204a - Fix OTP sysfs read and error handling
    
    commit 635c3a757a567b2479639237f5f0d4d9439015f1 upstream.
    
    Fix otp_show() to read and print all 64 bytes of the OTP zone.
    Previously, the loop only printed half of the OTP (32 bytes), and
    partial output was returned on read errors.
    
    Propagate the actual error from atmel_sha204a_otp_read() instead of
    producing partial output.
    
    Replace sprintf() with sysfs_emit_at(), which is preferred for
    formatting sysfs output because it provides safer bounds checking.
    
    Cc: [email protected]
    Fixes: 13909a0c8897 ("crypto: atmel-sha204a - provide the otp content")
    Signed-off-by: Thorsten Blum <[email protected]>
    Reviewed-by: Lothar Rubusch <[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-sha204a - Fix uninitialized data access on OTP read error [+ + +]
Author: Thorsten Blum <[email protected]>
Date:   Fri Feb 20 14:31:36 2026 +0100

    crypto: atmel-sha204a - Fix uninitialized data access on OTP read error
    
    commit de4e66b763d1e81188cb2803ec109466582fc9d1 upstream.
    
    Return early if atmel_i2c_send_receive() fails to avoid checking
    potentially uninitialized data in 'cmd.data'.
    
    Cc: [email protected]
    Fixes: e05ce444e9e5 ("crypto: atmel-sha204a - add reading from otp zone")
    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: 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 - Fix packed layout in struct nx842_crypto_header [+ + +]
Author: Gustavo A. R. Silva <[email protected]>
Date:   Tue Mar 17 17:40:02 2026 -0600

    crypto: nx - Fix packed layout in struct nx842_crypto_header
    
    commit b0bfa49c03e3c65737eafa73d8a698eaf55379a6 upstream.
    
    struct nx842_crypto_header is declared with the __packed attribute,
    however the fields grouped with struct_group_tagged() were not packed.
    This caused the grouped header portion of the structure to lose the
    packed layout guarantees of the containing structure.
    
    Fix this by replacing struct_group_tagged() with __struct_group(...,
    ..., __packed, ...) so the grouped fields are packed, and the original
    layout is preserved, restoring the intended packed layout of the
    structure.
    
    Before changes:
    struct nx842_crypto_header {
            union {
                    struct {
                            __be16     magic;                /*     0     2 */
                            __be16     ignore;               /*     2     2 */
                            u8         groups;               /*     4     1 */
                    };                                       /*     0     6 */
                    struct nx842_crypto_header_hdr hdr;      /*     0     6 */
            };                                               /*     0     6 */
            struct nx842_crypto_header_group group[];        /*     6     0 */
    
            /* size: 6, cachelines: 1, members: 2 */
            /* last cacheline: 6 bytes */
    } __attribute__((__packed__));
    
    After changes:
    struct nx842_crypto_header {
            union {
                    struct {
                            __be16     magic;                /*     0     2 */
                            __be16     ignore;               /*     2     2 */
                            u8         groups;               /*     4     1 */
                    } __attribute__((__packed__));           /*     0     5 */
                    struct nx842_crypto_header_hdr hdr;      /*     0     5 */
            };                                               /*     0     5 */
            struct nx842_crypto_header_group group[];        /*     5     0 */
    
            /* size: 5, cachelines: 1, members: 2 */
            /* last cacheline: 5 bytes */
    } __attribute__((__packed__));
    
    Fixes: 1e6b251ce175 ("crypto: nx - Avoid -Wflex-array-member-not-at-end warning")
    Cc: [email protected]
    Signed-off-by: Gustavo A. R. Silva <[email protected]>
    Reviewed-by: Thorsten Blum <[email protected]>
    Signed-off-by: Herbert Xu <[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]>
    (cherry picked from commit f72e77c33e4b5657af35125e75bab249256030f3)
    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]>

 
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 6 16:22:54 2026 -0700

    driver core: Don't let a device probe until it's ready
    
    commit a2225b6e834a838ae3c93709760edc0a169eb2f2 upstream.
    
    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: 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:51:57 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:51:41 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/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/nouveau: fix nvkm_device leak on aperture removal failure [+ + +]
Author: David Carlier <[email protected]>
Date:   Sat Apr 11 07:29:38 2026 +0100

    drm/nouveau: fix nvkm_device leak on aperture removal failure
    
    commit 6597ff1d8de3f583be169587efeafd8af134e138 upstream.
    
    When aperture_remove_conflicting_pci_devices() fails during probe, the
    error path returns directly without unwinding the nvkm_device that was
    just allocated by nvkm_device_pci_new(). This leaks both the device
    wrapper and the pci_enable_device() reference taken inside it.
    
    Jump to the existing fail_nvkm label so nvkm_device_del() runs and
    balances both. The leak was introduced when the intermediate
    nvkm_device_del() between detection and aperture removal was dropped
    in favor of creating the pci device once.
    
    Fixes: c0bfe34330b5 ("drm/nouveau: create pci device once")
    Cc: [email protected]
    Signed-off-by: David Carlier <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Danilo Krummrich <[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]>

 
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]>

 
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]>

 
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: fix to do sanity check on dcc->discard_cmd_cnt conditionally [+ + +]
Author: Chao Yu <[email protected]>
Date:   Sat Apr 25 06:35:38 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:03:55 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]>

 
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 Feb 17 16:56:11 2026 +0100

    firmware: google: framebuffer: Do not unregister platform device
    
    commit 5cd28bd28c8ce426b56ce4230dbd17537181d5ad upstream.
    
    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: Greg Kroah-Hartman <[email protected]>

 
greybus: gb-beagleplay: bound bootloader receive buffering [+ + +]
Author: Pengpeng Hou <[email protected]>
Date:   Thu Apr 2 13:40:16 2026 +0800

    greybus: gb-beagleplay: bound bootloader receive buffering
    
    commit 1214bf28965ceaf584fb20d357731264dd2e10e1 upstream.
    
    cc1352_bootloader_rx() appends each serdev chunk into the fixed
    rx_buffer before parsing bootloader packets. The helper can keep
    leftover bytes between callbacks and may receive multiple packets in one
    callback, so a single count value is not constrained by one packet
    length.
    
    Check that the incoming chunk fits in the remaining receive buffer space
    before memcpy(). If it does not, drop the staged data and consume the
    bytes instead of overflowing rx_buffer.
    
    Fixes: 0cf7befa3ea2 ("greybus: gb-beagleplay: Add firmware upload API")
    Cc: stable <[email protected]>
    Signed-off-by: Pengpeng Hou <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

greybus: gb-beagleplay: fix sleep in atomic context in hdlc_tx_frames() [+ + +]
Author: Weigang He <[email protected]>
Date:   Mon Mar 30 12:08:00 2026 +0000

    greybus: gb-beagleplay: fix sleep in atomic context in hdlc_tx_frames()
    
    commit 6b526dca0966f2370835765019a54319b78fca8d upstream.
    
    hdlc_append() calls usleep_range() to wait for circular buffer space,
    but it is called with tx_producer_lock (a spinlock) held via
    hdlc_tx_frames() -> hdlc_append_tx_frame()/hdlc_append_tx_u8()/etc.
    Sleeping while holding a spinlock is illegal and can trigger
    "BUG: scheduling while atomic".
    
    Fix this by moving the buffer-space wait out of hdlc_append() and into
    hdlc_tx_frames(), before the spinlock is acquired.  The new flow:
    
     1. Pre-calculate the worst-case encoded frame length.
     2. Wait (with sleep) outside the lock until enough space is available,
        kicking the TX consumer work to drain the buffer.
     3. Acquire the spinlock, re-verify space, and write the entire frame
        atomically.
    
    This ensures that sleeping only happens without any lock held, and
    that frames are either fully enqueued or not written at all.
    
    This bug is found by CodeQL static analysis tool (interprocedural
    sleep-in-atomic query) and my code review.
    
    Fixes: ec558bbfea67 ("greybus: Add BeaglePlay Linux Driver")
    Cc: stable <[email protected]>
    Cc: Ayush Singh <[email protected]>
    Cc: Johan Hovold <[email protected]>
    Cc: Alex Elder <[email protected]>
    Cc: Greg Kroah-Hartman <[email protected]>
    Signed-off-by: Weigang He <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
HID: apple: ensure the keyboard backlight is off if suspending [+ + +]
Author: Aditya Garg <[email protected]>
Date:   Sat Apr 4 15:14:34 2026 +0530

    HID: apple: ensure the keyboard backlight is off if suspending
    
    commit 1f95a6cd5ad78ed27a31a20cbd1facff6f10b33d upstream.
    
    Some users reported that upon suspending their keyboard backlight
    remained on. Fix this by adding the missing LED_CORE_SUSPENDRESUME flag.
    
    Cc: [email protected]
    Fixes: 394ba612f941 ("HID: apple: Add support for magic keyboard backlight on T2 Macs")
    Fixes: 9018eacbe623 ("HID: apple: Add support for keyboard backlight on certain T2 Macs.")
    Reported-by: André Eikmeyer <[email protected]>
    Tested-by: André Eikmeyer <[email protected]>
    Signed-off-by: Aditya Garg <[email protected]>
    Signed-off-by: Jiri Kosina <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
hwmon: (powerz) Fix missing usb_kill_urb() on signal interrupt [+ + +]
Author: Sanman Pradhan <[email protected]>
Date:   Fri Apr 10 00:25:41 2026 +0000

    hwmon: (powerz) Fix missing usb_kill_urb() on signal interrupt
    
    commit b66437cb20a2d9ef201f40b675569f8ea7787c9f upstream.
    
    wait_for_completion_interruptible_timeout() returns -ERESTARTSYS when
    interrupted. This needs to abort the URB and return an error. No data
    has been received from the device so any reads from the transfer
    buffer are invalid.
    
    The original code tests !ret, which only catches the timeout case (0).
    On signal delivery (-ERESTARTSYS), !ret is false so the function skips
    usb_kill_urb() and falls through to read from the unfilled transfer
    buffer.
    
    Fix by capturing the return value into a long (matching the function
    return type) and handling signal (negative) and timeout (zero) cases
    with separate checks that both call usb_kill_urb() before returning.
    
    Fixes: 4381a36abdf1c ("hwmon: add POWER-Z driver")
    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: (pt5161l) Fix bugs in pt5161l_read_block_data() [+ + +]
Author: Sanman Pradhan <[email protected]>
Date:   Fri Apr 10 00:25:55 2026 +0000

    hwmon: (pt5161l) Fix bugs in pt5161l_read_block_data()
    
    commit 24c73e93d6a756e1b8626bb259d2e07c5b89b370 upstream.
    
    Fix two bugs in pt5161l_read_block_data():
    
    1. Buffer overrun: The local buffer rbuf is declared as u8 rbuf[24],
       but i2c_smbus_read_block_data() can return up to
       I2C_SMBUS_BLOCK_MAX (32) bytes. The i2c-core copies the data into
       the caller's buffer before the return value can be checked, so
       the post-read length validation does not prevent a stack overrun
       if a device returns more than 24 bytes. Resize the buffer to
       I2C_SMBUS_BLOCK_MAX.
    
    2. Unexpected positive return on length mismatch: When all three
       retries are exhausted because the device returns data with an
       unexpected length, i2c_smbus_read_block_data() returns a positive
       byte count. The function returns this directly, and callers treat
       any non-negative return as success, processing stale or incomplete
       buffer contents. Return -EIO when retries are exhausted with a
       positive return value, preserving the negative error code on I2C
       failure.
    
    Fixes: 1b2ca93cd0592 ("hwmon: Add driver for Astera Labs PT5161L retimer")
    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]>

 
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]>

iio: frequency: admv1013: add dev variable [+ + +]
Author: Antoniu Miclaus <[email protected]>
Date:   Sun May 3 00:37:46 2026 -0400

    iio: frequency: admv1013: add dev variable
    
    [ Upstream commit e61b5bb0e91390adee41eaddc0a1a7d55d5652b2 ]
    
    Introduce a local struct device pointer in functions that reference
    &spi->dev for device-managed resource calls and device property reads,
    improving code readability.
    
    Signed-off-by: Antoniu Miclaus <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Stable-dep-of: aac0a51b1670 ("iio: frequency: admv1013: fix NULL pointer dereference on str")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

iio: frequency: admv1013: fix NULL pointer dereference on str [+ + +]
Author: Antoniu Miclaus <[email protected]>
Date:   Sun May 3 00:37:47 2026 -0400

    iio: frequency: admv1013: fix NULL pointer dereference on str
    
    [ Upstream commit aac0a51b16700b403a55b67ba495de021db78763 ]
    
    When device_property_read_string() fails, str is left uninitialized
    but the code falls through to strcmp(str, ...), dereferencing a garbage
    pointer. Replace manual read/strcmp with
    device_property_match_property_string() and consolidate the SE mode
    enums into a single sequential enum, mapping to hardware register
    values via a switch consistent with other bitfields in the driver.
    
    Several cleanup patches have been applied to this driver recently so
    this will need a manual backport.
    
    Fixes: da35a7b526d9 ("iio: frequency: admv1013: add support for ADMV1013")
    Reviewed-by: Nuno Sá <[email protected]>
    Signed-off-by: Antoniu Miclaus <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Jonathan Cameron <[email protected]>
    Signed-off-by: Sasha Levin <[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:54 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.12.y:
      - The do-while body in 6.12.y already places `v &= IO_POLL_REF_MASK;`
        just before the while-condition; the upstream patch moves it
        earlier so that `v != 1` in the HUP check refers to the ref-count
        only.  The backport does the same.
      - io_poll_issue takes `ts` (struct io_tw_state *) here.
    
    CVE: CVE-2026-23473
    Cc: [email protected] # 6.12.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.12.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]>

 
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]>

 
jbd2: fix deadlock in jbd2_journal_cancel_revoke() [+ + +]
Author: Zhang Yi <[email protected]>
Date:   Thu Apr 9 19:42:03 2026 +0800

    jbd2: fix deadlock in jbd2_journal_cancel_revoke()
    
    commit 981fcc5674e67158d24d23e841523eccba19d0e7 upstream.
    
    Commit f76d4c28a46a ("fs/jbd2: use sleeping version of
    __find_get_block()") changed jbd2_journal_cancel_revoke() to use
    __find_get_block_nonatomic() which holds the folio lock instead of
    i_private_lock. This breaks the lock ordering (folio -> buffer) and
    causes an ABBA deadlock when the filesystem blocksize < pagesize:
    
         T1                                T2
    ext4_mkdir()
     ext4_init_new_dir()
      ext4_append()
       ext4_getblk()
        lock_buffer()    <- A
                                       sync_blockdev()
                                        blkdev_writepages()
                                         writeback_iter()
                                          writeback_get_folio()
                                           folio_lock()   <- B
         ext4_journal_get_create_access()
          jbd2_journal_cancel_revoke()
           __find_get_block_nonatomic()
            folio_lock()  <- B
                                         block_write_full_folio()
                                          lock_buffer()   <- A
    
    This can occasionally cause generic/013 to hang.
    
    Fix by only calling __find_get_block_nonatomic() when the passed
    buffer_head doesn't belong to the bdev, which is the only case that we
    need to look up its bdev alias. Otherwise, the lookup is redundant since
    the found buffer_head is equal to the one we passed in.
    
    Fixes: f76d4c28a46a ("fs/jbd2: use sleeping version of __find_get_block()")
    Signed-off-by: Zhang Yi <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Theodore Ts'o <[email protected]>
    Cc: [email protected]
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
kbuild: rust: allow `clippy::uninlined_format_args` [+ + +]
Author: Miguel Ojeda <[email protected]>
Date:   Tue Mar 31 22:58:48 2026 +0200

    kbuild: rust: allow `clippy::uninlined_format_args`
    
    commit 10eea3c147141c90cf409b8df56d245c9d7f88d9 upstream.
    
    Clippy in Rust 1.88.0 (only) reports [1]:
    
        warning: variables can be used directly in the `format!` string
           --> rust/macros/module.rs:112:23
            |
        112 |         let content = format!("{param}:{content}", param = param, content = content);
            |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            |
            = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
            = note: `-W clippy::uninlined-format-args` implied by `-W clippy::all`
            = help: to override `-W clippy::all` add `#[allow(clippy::uninlined_format_args)]`
        help: change this to
            |
        112 -         let content = format!("{param}:{content}", param = param, content = content);
        112 +         let content = format!("{param}:{content}");
    
        warning: variables can be used directly in the `format!` string
           --> rust/macros/module.rs:198:14
            |
        198 |         t => panic!("Unsupported parameter type {}", t),
            |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
            |
            = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
            = note: `-W clippy::uninlined-format-args` implied by `-W clippy::all`
            = help: to override `-W clippy::all` add `#[allow(clippy::uninlined_format_args)]`
        help: change this to
            |
        198 -         t => panic!("Unsupported parameter type {}", t),
        198 +         t => panic!("Unsupported parameter type {t}"),
            |
    
    The reason it only triggers in that version is that the lint was moved
    from `pedantic` to `style` in Rust 1.88.0 and then back to `pedantic`
    in Rust 1.89.0 [2][3].
    
    In the first case, the suggestion is fair and a pure simplification, thus
    we will clean it up separately.
    
    To keep the behavior the same across all versions, and since the lint
    does not work for all macros (e.g. custom ones like `pr_info!`), disable
    it globally.
    
    Cc: [email protected] # Needed in 6.12.y and later (Rust is pinned in older LTSs).
    Link: https://lore.kernel.org/rust-for-linux/CANiq72=drAtf3y_DZ-2o4jb6Az9J3Yj4QYwWnbRui4sm4AJD3Q@mail.gmail.com/ [1]
    Link: https://github.com/rust-lang/rust-clippy/pull/15287 [2]
    Link: https://github.com/rust-lang/rust-clippy/issues/15151 [3]
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Miguel Ojeda <[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:07:21 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: reset rcount per connection in ksmbd_conn_wait_idle_sess_id() [+ + +]
Author: DaeMyung Kang <[email protected]>
Date:   Sat Apr 25 05:07:22 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:07:20 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: 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: Always intercept VMMCALL when L2 is active [+ + +]
Author: Sean Christopherson <[email protected]>
Date:   Tue Mar 3 16:22:23 2026 -0800

    KVM: nSVM: Always intercept VMMCALL when L2 is active
    
    commit 33d3617a52f9930d22b2af59f813c2fbdefa6dd5 upstream.
    
    Always intercept VMMCALL now that KVM properly synthesizes a #UD as
    appropriate, i.e. when L1 doesn't want to intercept VMMCALL, to avoid
    putting L2 into an infinite #UD loop if KVM_X86_QUIRK_FIX_HYPERCALL_INSN
    is enabled.
    
    By letting L2 execute VMMCALL natively and thus #UD, for all intents and
    purposes KVM morphs the VMMCALL intercept into a #UD intercept (KVM always
    intercepts #UD).  When the hypercall quirk is enabled, KVM "emulates"
    VMMCALL in response to the #UD by trying to fixup the opcode to the "right"
    vendor, then restarts the guest, without skipping the VMMCALL.  As a
    result, the guest sees an endless stream of #UDs since it's already
    executing the correct vendor hypercall instruction, i.e. the emulator
    doesn't anticipate that the #UD could be due to lack of interception, as
    opposed to a truly undefined opcode.
    
    Fixes: 0d945bd93511 ("KVM: SVM: Don't allow nested guest to VMMCALL into host")
    Cc: [email protected]
    Reviewed-by: Yosry Ahmed <[email protected]>
    Reviewed-by: Vitaly Kuznetsov <[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: Raise #UD if unhandled VMMCALL isn't intercepted by L1 [+ + +]
Author: Kevin Cheng <[email protected]>
Date:   Tue Mar 3 16:22:22 2026 -0800

    KVM: nSVM: Raise #UD if unhandled VMMCALL isn't intercepted by L1
    
    commit c36991c6f8d2ab56ee67aff04e3c357f45cfc76c upstream.
    
    Explicitly synthesize a #UD for VMMCALL if L2 is active, L1 does NOT want
    to intercept VMMCALL, nested_svm_l2_tlb_flush_enabled() is true, and the
    hypercall is something other than one of the supported Hyper-V hypercalls.
    When all of the above conditions are met, KVM will intercept VMMCALL but
    never forward it to L1, i.e. will let L2 make hypercalls as if it were L1.
    
    The TLFS says a whole lot of nothing about this scenario, so go with the
    architectural behavior, which says that VMMCALL #UDs if it's not
    intercepted.
    
    Opportunistically do a 2-for-1 stub trade by stub-ifying the new API
    instead of the helpers it uses.  The last remaining "single" stub will
    soon be dropped as well.
    
    Suggested-by: Sean Christopherson <[email protected]>
    Fixes: 3f4a812edf5c ("KVM: nSVM: hyper-v: Enable L2 TLB flush")
    Cc: Vitaly Kuznetsov <[email protected]>
    Cc: [email protected]
    Signed-off-by: Kevin Cheng <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    [sean: rewrite changelog and comment, tag for stable, remove defunct stubs]
    Reviewed-by: Yosry Ahmed <[email protected]>
    Reviewed-by: Vitaly Kuznetsov <[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: 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: 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]>

 
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/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 11:23:54 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: 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.12.86 [+ + +]
Author: Greg Kroah-Hartman <[email protected]>
Date:   Thu May 7 06:09:48 2026 +0200

    Linux 6.12.86
    
    Link: https://lore.kernel.org/r/[email protected]
    Tested-by: Brett A C Sheffield <[email protected]>
    Tested-by: Peter Schneider <[email protected]>
    Tested-by: Florian Fainelli <[email protected]>
    Tested-by: Salvatore Bonaccorso <[email protected]>
    Tested-by: Francesco Dolcini <[email protected]>
    Tested-by: Ron Economos <[email protected]>
    Tested-by: Miguel Ojeda <[email protected]>
    Tested-by: Mark Brown <[email protected]>
    Tested-by: Shuah Khan <[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:   Wed Apr 22 15:45:12 2026 +0800

    LoongArch: Add spectre boundry for syscall dispatch table
    
    commit 0c965d2784fbbd7f8e3b96d875c9cfdf7c00da3d upstream.
    
    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: 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]>

 
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/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: 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: 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: rc: igorplugusb: heed coherency rules [+ + +]
Author: Oliver Neukum <[email protected]>
Date:   Fri May 1 15:29:27 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: ttusbir: respect DMA coherency rules [+ + +]
Author: Oliver Neukum <[email protected]>
Date:   Fri May 1 11:54:18 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]>

 
mfd: core: Preserve OF node when ACPI handle is present [+ + +]
Author: Brian Mak <[email protected]>
Date:   Wed Mar 25 15:30:24 2026 -0700

    mfd: core: Preserve OF node when ACPI handle is present
    
    commit caa5a5d44d8ae4fd13b744857d66c9313b712d1f upstream.
    
    Switch device_set_node to set_primary_fwnode, so that the ACPI fwnode
    does not overwrite the of_node with NULL.
    
    This allows MFD children with both OF nodes and ACPI handles to have OF
    nodes again.
    
    Cc: [email protected]
    Fixes: 51e3b257099d ("mfd: core: Make use of device_set_node()")
    Signed-off-by: Brian Mak <[email protected]>
    Reviewed-by: Andy Shevchenko <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Lee Jones <[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: 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/memory_hotplug: fix hwpoisoned large folio handling in do_migrate_range() [+ + +]
Author: Jinjiang Tu <[email protected]>
Date:   Thu Apr 30 14:37:31 2026 +0300

    mm/memory_hotplug: fix hwpoisoned large folio handling in do_migrate_range()
    
    commit 397f6d14f9c370e4910e6885294c340f39dedbf5 upstream.
    
    In do_migrate_range(), the hwpoisoned folio may be large folio, which
    can't be handled by unmap_poisoned_folio().
    
    I can reproduce this issue in qemu after adding delay in memory_failure()
    
    BUG: kernel NULL pointer dereference, address: 0000000000000000
    Workqueue: kacpi_hotplug acpi_hotplug_work_fn
    RIP: 0010:try_to_unmap_one+0x16a/0xfc0
      <TASK>
      rmap_walk_anon+0xda/0x1f0
      try_to_unmap+0x78/0x80
      ? __pfx_try_to_unmap_one+0x10/0x10
      ? __pfx_folio_not_mapped+0x10/0x10
      ? __pfx_folio_lock_anon_vma_read+0x10/0x10
      unmap_poisoned_folio+0x60/0x140
      do_migrate_range+0x4d1/0x600
      ? slab_memory_callback+0x6a/0x190
      ? notifier_call_chain+0x56/0xb0
      offline_pages+0x3e6/0x460
      memory_subsys_offline+0x130/0x1f0
      device_offline+0xba/0x110
      acpi_bus_offline+0xb7/0x130
      acpi_scan_hot_remove+0x77/0x290
      acpi_device_hotplug+0x1e0/0x240
      acpi_hotplug_work_fn+0x1a/0x30
      process_one_work+0x186/0x340
    
    Besides, do_migrate_range() may be called between memory_failure set
    hwpoison flag and isolate the folio from lru, so remove WARN_ON(). In other
    places, unmap_poisoned_folio() is called when the folio is isolated, obey
    it in do_migrate_range() too.
    
    [[email protected]: don't abort offlining, fixed typo, add comment]
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: b15c87263a69 ("hwpoison, memory_hotplug: allow hwpoisoned pages to be offlined")
    Signed-off-by: Jinjiang Tu <[email protected]>
    Signed-off-by: David Hildenbrand <[email protected]>
    Acked-by: Zi Yan <[email protected]>
    Reviewed-by: Miaohe Lin <[email protected]>
    Cc: Kefeng Wang <[email protected]>
    Cc: Luis Chamberalin <[email protected]>
    Cc: Matthew Wilcox (Oracle) <[email protected]>
    Cc: Michal Hocko <[email protected]>
    Cc: Oscar Salvador <[email protected]>
    Cc: Pankaj Raghav <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Alexandra Diupina <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>

 
mm/migrate: factor out movable_ops page handling into migrate_movable_ops_page() [+ + +]
Author: David Hildenbrand <[email protected]>
Date:   Tue Apr 28 11:24:10 2026 -0400

    mm/migrate: factor out movable_ops page handling into migrate_movable_ops_page()
    
    [ Upstream commit b9ed00483d4cbacca04edb11984d8daf09e9ae22 ]
    
    Let's factor it out, simplifying the calling code.
    
    Before this change, we would have called flush_dcache_folio() also on
    movable_ops pages.  As documented in Documentation/core-api/cachetlb.rst:
    
            "This routine need only be called for page cache pages which can
             potentially ever be mapped into the address space of a user
             process."
    
    So don't do it for movable_ops pages.  If there would ever be such a
    movable_ops page user, it should do the flushing itself after performing
    the copy.
    
    Note that we can now change folio_mapping_flags() to folio_test_anon() to
    make it clearer, because movable_ops pages will never take that path.
    
    [[email protected]: fix kerneldoc]
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: David Hildenbrand <[email protected]>
    Reviewed-by: Zi Yan <[email protected]>
    Reviewed-by: Lorenzo Stoakes <[email protected]>
    Cc: Alistair Popple <[email protected]>
    Cc: Al Viro <[email protected]>
    Cc: Arnd Bergmann <[email protected]>
    Cc: Brendan Jackman <[email protected]>
    Cc: Byungchul Park <[email protected]>
    Cc: Chengming Zhou <[email protected]>
    Cc: Christian Brauner <[email protected]>
    Cc: Christophe Leroy <[email protected]>
    Cc: Eugenio Pé rez <[email protected]>
    Cc: Greg Kroah-Hartman <[email protected]>
    Cc: Gregory Price <[email protected]>
    Cc: Harry Yoo <[email protected]>
    Cc: "Huang, Ying" <[email protected]>
    Cc: Jan Kara <[email protected]>
    Cc: Jason Gunthorpe <[email protected]>
    Cc: Jason Wang <[email protected]>
    Cc: Jerrin Shaji George <[email protected]>
    Cc: Johannes Weiner <[email protected]>
    Cc: John Hubbard <[email protected]>
    Cc: Jonathan Corbet <[email protected]>
    Cc: Joshua Hahn <[email protected]>
    Cc: Liam Howlett <[email protected]>
    Cc: Madhavan Srinivasan <[email protected]>
    Cc: Mathew Brost <[email protected]>
    Cc: Matthew Wilcox (Oracle) <[email protected]>
    Cc: Miaohe Lin <[email protected]>
    Cc: Michael Ellerman <[email protected]>
    Cc: "Michael S. Tsirkin" <[email protected]>
    Cc: Michal Hocko <[email protected]>
    Cc: Mike Rapoport <[email protected]>
    Cc: Minchan Kim <[email protected]>
    Cc: Naoya Horiguchi <[email protected]>
    Cc: Nicholas Piggin <[email protected]>
    Cc: Oscar Salvador <[email protected]>
    Cc: Peter Xu <[email protected]>
    Cc: Qi Zheng <[email protected]>
    Cc: Rakie Kim <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Sergey Senozhatsky <[email protected]>
    Cc: Shakeel Butt <[email protected]>
    Cc: Suren Baghdasaryan <[email protected]>
    Cc: Vlastimil Babka <[email protected]>
    Cc: Xuan Zhuo <[email protected]>
    Cc: xu xin <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Stable-dep-of: a2e0c0668a34 ("mm: migrate: requeue destination folio on deferred split queue")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mm/migrate: move movable_ops page handling out of move_to_new_folio() [+ + +]
Author: David Hildenbrand <[email protected]>
Date:   Tue Apr 28 11:24:11 2026 -0400

    mm/migrate: move movable_ops page handling out of move_to_new_folio()
    
    [ Upstream commit be4a3e9c185264e9ad0fe02c1c5d81b8386bd50c ]
    
    Let's move that handling directly into migrate_folio_move(), so we can
    simplify move_to_new_folio().  While at it, fixup the documentation a bit.
    
    Note that unmap_and_move_huge_page() does not care, because it only deals
    with actual folios.  (we only support migration of individual movable_ops
    pages)
    
    Link: https://lkml.kernel.org/r/[email protected]
    Signed-off-by: David Hildenbrand <[email protected]>
    Reviewed-by: Zi Yan <[email protected]>
    Reviewed-by: Harry Yoo <[email protected]>
    Reviewed-by: Lorenzo Stoakes <[email protected]>
    Cc: Alistair Popple <[email protected]>
    Cc: Al Viro <[email protected]>
    Cc: Arnd Bergmann <[email protected]>
    Cc: Brendan Jackman <[email protected]>
    Cc: Byungchul Park <[email protected]>
    Cc: Chengming Zhou <[email protected]>
    Cc: Christian Brauner <[email protected]>
    Cc: Christophe Leroy <[email protected]>
    Cc: Eugenio Pé rez <[email protected]>
    Cc: Greg Kroah-Hartman <[email protected]>
    Cc: Gregory Price <[email protected]>
    Cc: "Huang, Ying" <[email protected]>
    Cc: Jan Kara <[email protected]>
    Cc: Jason Gunthorpe <[email protected]>
    Cc: Jason Wang <[email protected]>
    Cc: Jerrin Shaji George <[email protected]>
    Cc: Johannes Weiner <[email protected]>
    Cc: John Hubbard <[email protected]>
    Cc: Jonathan Corbet <[email protected]>
    Cc: Joshua Hahn <[email protected]>
    Cc: Liam Howlett <[email protected]>
    Cc: Madhavan Srinivasan <[email protected]>
    Cc: Mathew Brost <[email protected]>
    Cc: Matthew Wilcox (Oracle) <[email protected]>
    Cc: Miaohe Lin <[email protected]>
    Cc: Michael Ellerman <[email protected]>
    Cc: "Michael S. Tsirkin" <[email protected]>
    Cc: Michal Hocko <[email protected]>
    Cc: Mike Rapoport <[email protected]>
    Cc: Minchan Kim <[email protected]>
    Cc: Naoya Horiguchi <[email protected]>
    Cc: Nicholas Piggin <[email protected]>
    Cc: Oscar Salvador <[email protected]>
    Cc: Peter Xu <[email protected]>
    Cc: Qi Zheng <[email protected]>
    Cc: Rakie Kim <[email protected]>
    Cc: Rik van Riel <[email protected]>
    Cc: Sergey Senozhatsky <[email protected]>
    Cc: Shakeel Butt <[email protected]>
    Cc: Suren Baghdasaryan <[email protected]>
    Cc: Vlastimil Babka <[email protected]>
    Cc: Xuan Zhuo <[email protected]>
    Cc: xu xin <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Stable-dep-of: a2e0c0668a34 ("mm: migrate: requeue destination folio on deferred split queue")
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm/zsmalloc: copy KMSAN metadata in zs_page_migrate() [+ + +]
Author: Shigeru Yoshida <[email protected]>
Date:   Fri May 1 11:54:40 2026 -0400

    mm/zsmalloc: copy KMSAN metadata in zs_page_migrate()
    
    [ Upstream commit 4fb61d95ad21c3b6f1c09f357ff49d70abb0535e ]
    
    zs_page_migrate() uses copy_page() to copy the contents of a zspage page
    during migration.  However, copy_page() is not instrumented by KMSAN, so
    the shadow and origin metadata of the destination page are not updated.
    
    As a result, subsequent accesses to the migrated page are reported as
    use-after-free by KMSAN, despite the data being correctly copied.
    
    Add a kmsan_copy_page_meta() call after copy_page() to propagate the KMSAN
    metadata to the new page, matching what copy_highpage() does internally.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: afb2d666d025 ("zsmalloc: use copy_page for full page copy")
    Signed-off-by: Shigeru Yoshida <[email protected]>
    Reviewed-by: Sergey Senozhatsky <[email protected]>
    Cc: Mark-PK Tsai <[email protected]>
    Cc: Minchan Kim <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    [ translated zpdesc_page(newzpdesc/zpdesc) arguments to newpage/page ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

 
mm: migrate: requeue destination folio on deferred split queue [+ + +]
Author: Usama Arif <[email protected]>
Date:   Tue Apr 28 11:24:12 2026 -0400

    mm: migrate: requeue destination folio on deferred split queue
    
    [ Upstream commit a2e0c0668a3486f96b86c50e02872c8e94fd4f9c ]
    
    During folio migration, __folio_migrate_mapping() removes the source folio
    from the deferred split queue, but the destination folio is never
    re-queued.  This causes underutilized THPs to escape the shrinker after
    NUMA migration, since they silently drop off the deferred split list.
    
    Fix this by recording whether the source folio was on the deferred split
    queue and its partially mapped state before move_to_new_folio() unqueues
    it, and re-queuing the destination folio after a successful migration if
    it was.
    
    By the time migrate_folio_move() runs, partially mapped folios without a
    pin have already been split by migrate_pages_batch().  So only two cases
    remain on the deferred list at this point:
      1. Partially mapped folios with a pin (split failed).
      2. Fully mapped but potentially underused folios.  The recorded
         partially_mapped state is forwarded to deferred_split_folio() so that
         the destination folio is correctly re-queued in both cases.
    
    Because THPs are removed from the deferred_list, THP shinker cannot
    split the underutilized THPs in time.  As a result, users will show
    less free memory than before.
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: dafff3f4c850 ("mm: split underused THPs")
    Signed-off-by: Usama Arif <[email protected]>
    Reported-by: Johannes Weiner <[email protected]>
    Acked-by: Johannes Weiner <[email protected]>
    Acked-by: Zi Yan <[email protected]>
    Acked-by: David Hildenbrand (Arm) <[email protected]>
    Acked-by: SeongJae Park <[email protected]>
    Reviewed-by: Wei Yang <[email protected]>
    Cc: Alistair Popple <[email protected]>
    Cc: Byungchul Park <[email protected]>
    Cc: Gregory Price <[email protected]>
    Cc: "Huang, Ying" <[email protected]>
    Cc: Joshua Hahn <[email protected]>
    Cc: Matthew Brost <[email protected]>
    Cc: Matthew Wilcox (Oracle) <[email protected]>
    Cc: Nico Pache <[email protected]>
    Cc: Rakie Kim <[email protected]>
    Cc: Ying Huang <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

mm: prevent droppable mappings from being locked [+ + +]
Author: Anthony Yznaga <[email protected]>
Date:   Wed Apr 29 00:00:27 2026 -0400

    mm: prevent droppable mappings from being locked
    
    [ Upstream commit d239462787b072c78eb19fc1f155c3d411256282 ]
    
    Droppable mappings must not be lockable.  There is a check for VMAs with
    VM_DROPPABLE set in mlock_fixup() along with checks for other types of
    unlockable VMAs which ensures this when calling mlock()/mlock2().
    
    For mlockall(MCL_FUTURE), the check for unlockable VMAs is different.  In
    apply_mlockall_flags(), if the flags parameter has MCL_FUTURE set, the
    current task's mm's default VMA flag field mm->def_flags has VM_LOCKED
    applied to it.  VM_LOCKONFAULT is also applied if MCL_ONFAULT is also set.
    When these flags are set as default in this manner they are cleared in
    __mmap_complete() for new mappings that do not support mlock.  A check for
    VM_DROPPABLE in __mmap_complete() is missing resulting in droppable
    mappings created with VM_LOCKED set.  To fix this and reduce that chance
    of similar bugs in the future, introduce and use vma_supports_mlock().
    
    Link: https://lkml.kernel.org/r/[email protected]
    Fixes: 9651fcedf7b9 ("mm: add MAP_DROPPABLE for designating always lazily freeable mappings")
    Signed-off-by: Anthony Yznaga <[email protected]>
    Suggested-by: David Hildenbrand <[email protected]>
    Acked-by: David Hildenbrand (Arm) <[email protected]>
    Reviewed-by: Pedro Falcato <[email protected]>
    Reviewed-by: Lorenzo Stoakes (Oracle) <[email protected]>
    Tested-by: Lorenzo Stoakes (Oracle) <[email protected]>
    Cc: Jann Horn <[email protected]>
    Cc: Jason A. Donenfeld <[email protected]>
    Cc: Liam Howlett <[email protected]>
    Cc: Michal Hocko <[email protected]>
    Cc: Mike Rapoport <[email protected]>
    Cc: Shuah Khan <[email protected]>
    Cc: Suren Baghdasaryan <[email protected]>
    Cc: Vlastimil Babka <[email protected]>
    Cc: <[email protected]>
    Signed-off-by: Andrew Morton <[email protected]>
    [ adapted change to `mm/mmap.c::__mmap_region()` instead of `mm/vma.c::__mmap_complete()` ]
    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: 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]>

 
mtd: docg3: fix use-after-free in docg3_release() [+ + +]
Author: James Kim <[email protected]>
Date:   Mon Mar 9 15:05:12 2026 +0900

    mtd: docg3: fix use-after-free in docg3_release()
    
    commit ca19808bc6fac7e29420d8508df569b346b3e339 upstream.
    
    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: 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/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: bonding: fix use-after-free in bond_xmit_broadcast() [+ + +]
Author: Xiang Mei <[email protected]>
Date:   Thu Mar 26 00:55:53 2026 -0700

    net: bonding: fix use-after-free in bond_xmit_broadcast()
    
    commit 2884bf72fb8f03409e423397319205de48adca16 upstream.
    
    bond_xmit_broadcast() reuses the original skb for the last slave
    (determined by bond_is_last_slave()) and clones it for others.
    Concurrent slave enslave/release can mutate the slave list during
    RCU-protected iteration, changing which slave is "last" mid-loop.
    This causes the original skb to be double-consumed (double-freed).
    
    Replace the racy bond_is_last_slave() check with a simple index
    comparison (i + 1 == slaves_count) against the pre-snapshot slave
    count taken via READ_ONCE() before the loop.  This preserves the
    zero-copy optimization for the last slave while making the "last"
    determination stable against concurrent list mutations.
    
    The UAF can trigger the following crash:
    
    ==================================================================
    BUG: KASAN: slab-use-after-free in skb_clone
    Read of size 8 at addr ffff888100ef8d40 by task exploit/147
    
    CPU: 1 UID: 0 PID: 147 Comm: exploit Not tainted 7.0.0-rc3+ #4 PREEMPTLAZY
    Call Trace:
     <TASK>
     dump_stack_lvl (lib/dump_stack.c:123)
     print_report (mm/kasan/report.c:379 mm/kasan/report.c:482)
     kasan_report (mm/kasan/report.c:597)
     skb_clone (include/linux/skbuff.h:1724 include/linux/skbuff.h:1792 include/linux/skbuff.h:3396 net/core/skbuff.c:2108)
     bond_xmit_broadcast (drivers/net/bonding/bond_main.c:5334)
     bond_start_xmit (drivers/net/bonding/bond_main.c:5567 drivers/net/bonding/bond_main.c:5593)
     dev_hard_start_xmit (include/linux/netdevice.h:5325 include/linux/netdevice.h:5334 net/core/dev.c:3871 net/core/dev.c:3887)
     __dev_queue_xmit (include/linux/netdevice.h:3601 net/core/dev.c:4838)
     ip6_finish_output2 (include/net/neighbour.h:540 include/net/neighbour.h:554 net/ipv6/ip6_output.c:136)
     ip6_finish_output (net/ipv6/ip6_output.c:208 net/ipv6/ip6_output.c:219)
     ip6_output (net/ipv6/ip6_output.c:250)
     ip6_send_skb (net/ipv6/ip6_output.c:1985)
     udp_v6_send_skb (net/ipv6/udp.c:1442)
     udpv6_sendmsg (net/ipv6/udp.c:1733)
     __sys_sendto (net/socket.c:730 net/socket.c:742 net/socket.c:2206)
     __x64_sys_sendto (net/socket.c:2209)
     do_syscall_64 (arch/x86/entry/syscall_64.c:63 arch/x86/entry/syscall_64.c:94)
     entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:130)
     </TASK>
    
    Allocated by task 147:
    
    Freed by task 147:
    
    The buggy address belongs to the object at ffff888100ef8c80
     which belongs to the cache skbuff_head_cache of size 224
    The buggy address is located 192 bytes inside of
     freed 224-byte region [ffff888100ef8c80, ffff888100ef8d60)
    
    Memory state around the buggy address:
     ffff888100ef8c00: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
     ffff888100ef8c80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    >ffff888100ef8d00: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                                                        ^
     ffff888100ef8d80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
     ffff888100ef8e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
    ==================================================================
    
    Fixes: 4e5bd03ae346 ("net: bonding: fix bond_xmit_broadcast return value error bug")
    Reported-by: Weiming Shi <[email protected]>
    Signed-off-by: Xiang Mei <[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: Kevin Berry <[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:26:37 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: 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: 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: mctp: fix don't require received header reserved bits to be zero [+ + +]
Author: Yuan Zhaoming <[email protected]>
Date:   Mon May 4 03:46:22 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:   Sun May 3 15:14:19 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:   Sun May 3 15:14:12 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 03:59:19 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: 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]>

 
netconsole: avoid out-of-bounds access on empty string in trim_newline() [+ + +]
Author: Breno Leitao <[email protected]>
Date:   Mon Apr 20 03:18:36 2026 -0700

    netconsole: avoid out-of-bounds access on empty string in trim_newline()
    
    commit 7079c8c13f2d33992bc846240517d88f4ab07781 upstream.
    
    trim_newline() unconditionally dereferences s[len - 1] after computing
    len = strnlen(s, maxlen). When the string is empty, len is 0 and the
    expression underflows to s[(size_t)-1], reading (and potentially
    writing) one byte before the buffer.
    
    The two callers feed trim_newline() with the result of strscpy() from
    configfs store callbacks (dev_name_store, userdatum_value_store).
    configfs guarantees count >= 1 reaches the callback, but the byte
    itself can be NUL: a userspace write(fd, "\0", 1) leaves the
    destination empty after strscpy() and triggers the underflow. The OOB
    write only fires if the adjacent byte happens to be '\n', so this is
    not a security issue, but the access is undefined behaviour either way.
    
    This pattern is commonly flagged by LLM-based code reviewers. While it
    is not a security fix, the underlying access is undefined behaviour and
    the change is small and self-contained, so it is a reasonable candidate
    for the stable trees.
    
    Guard the dereference on a non-zero length.
    
    Fixes: ae001dc67907 ("net: netconsole: move newline trimming to function")
    Cc: [email protected]
    Signed-off-by: Breno Leitao <[email protected]>
    Reviewed-by: Gustavo Luiz Duarte <[email protected]>
    Reviewed-by: Simon Horman <[email protected]>
    Link: https://patch.msgid.link/[email protected]
    Signed-off-by: Paolo Abeni <[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-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]>

 
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 of_unittest_changeset() [+ + +]
Author: Wentao Liang <[email protected]>
Date:   Thu Apr 9 02:22:33 2026 +0000

    of: unittest: fix use-after-free in of_unittest_changeset()
    
    commit faecdd423c27f0d6090156a435ba9dbbac0eaddb upstream.
    
    The variable 'parent' is assigned the value of 'nchangeset' earlier in the
    function, meaning both point to the same struct device_node. The call to
    of_node_put(nchangeset) can decrement the reference count to zero and
    free the node if there are no other holders. After that, the code still
    uses 'parent' to check for the presence of a property and to read a
    string property, leading to a use-after-free.
    
    Fix this by moving the of_node_put() call after the last access to
    'parent', avoiding the UAF.
    
    Fixes: 1c668ea65506 ("of: unittest: Use of_property_present()")
    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]>

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]>

 
padata: Fix pd UAF once and for all [+ + +]
Author: Herbert Xu <[email protected]>
Date:   Sat Apr 25 16:14:29 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.12 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:   Sat Apr 25 16:14:30 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]>

 
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 Feb 6 15:05:29 2026 -0500

    PCI: epf-mhi: Return 0, not remaining timeout, when eDMA ops complete
    
    commit 36bfc3642b19a98f1302aed4437c331df9b481f0 upstream.
    
    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: Greg Kroah-Hartman <[email protected]>

 
perf annotate: Use jump__delete when freeing LoongArch jumps [+ + +]
Author: Rong Bao <[email protected]>
Date:   Fri May 1 20:37:17 2026 +0800

    perf annotate: Use jump__delete when freeing LoongArch jumps
    
    [ Upstream commit a355eefc36c4481188249b067832b40a2c45fa5c ]
    
    Currently, the initialization of loongarch_jump_ops does not contain an
    assignment to its .free field. This causes disasm_line__free() to fall
    through to ins_ops__delete() for LoongArch jump instructions.
    
    ins_ops__delete() will free ins_operands.source.raw and
    ins_operands.source.name, and these fields overlaps with
    ins_operands.jump.raw_comment and ins_operands.jump.raw_func_start.
    Since in loongarch_jump__parse(), these two fields are populated by
    strchr()-ing the same buffer, trying to free them will lead to undefined
    behavior.
    
    This invalid free usually leads to crashes:
    
            Process 1712902 (perf) of user 1000 dumped core.
            Stack trace of thread 1712902:
            #0  0x00007fffef155c58 n/a (libc.so.6 + 0x95c58)
            #1  0x00007fffef0f7a94 raise (libc.so.6 + 0x37a94)
            #2  0x00007fffef0dd6a8 abort (libc.so.6 + 0x1d6a8)
            #3  0x00007fffef145490 n/a (libc.so.6 + 0x85490)
            #4  0x00007fffef1646f4 n/a (libc.so.6 + 0xa46f4)
            #5  0x00007fffef164718 n/a (libc.so.6 + 0xa4718)
            #6  0x00005555583a6764 __zfree (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x106764)
            #7  0x000055555854fb70 disasm_line__free (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x2afb70)
            #8  0x000055555853d618 annotated_source__purge (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x29d618)
            #9  0x000055555852300c __hist_entry__tui_annotate (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x28300c)
            #10 0x0000555558526718 do_annotate (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x286718)
            #11 0x000055555852ed94 evsel__hists_browse (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x28ed94)
            #12 0x000055555831fdd0 cmd_report (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x7fdd0)
            #13 0x000055555839b644 handle_internal_command (/home/csmantle/dist/linux-arch/tools/perf/perf + 0xfb644)
            #14 0x00005555582fe6ac main (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x5e6ac)
            #15 0x00007fffef0ddd90 n/a (libc.so.6 + 0x1dd90)
            #16 0x00007fffef0ddf0c __libc_start_main (libc.so.6 + 0x1df0c)
            #17 0x00005555582fed10 _start (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x5ed10)
            ELF object binary architecture: LoongArch
    
    ... and it can be confirmed with Valgrind:
    
            ==1721834== Invalid free() / delete / delete[] / realloc()
            ==1721834==    at 0x4EA9014: free (in /usr/lib/valgrind/vgpreload_memcheck-loongarch64-linux.so)
            ==1721834==    by 0x4106287: __zfree (zalloc.c:13)
            ==1721834==    by 0x42ADC8F: disasm_line__free (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==    by 0x429B737: annotated_source__purge (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==    by 0x42811EB: __hist_entry__tui_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==    by 0x42848D7: do_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==    by 0x428CF33: evsel__hists_browse (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==  Address 0x7d34303 is 35 bytes inside a block of size 62 alloc'd
            ==1721834==    at 0x4EA59B8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-loongarch64-linux.so)
            ==1721834==    by 0x6B80B6F: strdup (strdup.c:42)
            ==1721834==    by 0x42AD917: disasm_line__new (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==    by 0x42AE5A3: symbol__disassemble_objdump (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==    by 0x42AF0A7: symbol__disassemble (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==    by 0x429B3CF: symbol__annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==    by 0x429C233: symbol__annotate2 (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==    by 0x42804D3: __hist_entry__tui_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==    by 0x42848D7: do_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
            ==1721834==    by 0x428CF33: evsel__hists_browse (in /home/csmantle/dist/linux-arch/tools/perf/perf)
    
    This patch adds the missing free() specialization in loongarch_jump_ops,
    which prevents disasm_line__free() from invoking the default cleanup
    function.
    
    Fixes: fb7fd2a14a503b9a ("perf annotate: Move raw_comment and raw_func_start fields out of 'struct ins_operands'")
    Cc: [email protected]
    Cc: WANG Rui <[email protected]>
    Cc: Huacai Chen <[email protected]>
    Cc: WANG Xuerui <[email protected]>
    Cc: [email protected]
    Signed-off-by: Rong Bao <[email protected]>
    Tested-by: WANG Rui <[email protected]>
    Signed-off-by: Namhyung Kim <[email protected]>
    Signed-off-by: Sasha Levin <[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]>

 
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]>
    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/mana_ib: Disable RX steering on RSS QP destroy [+ + +]
Author: Long Li <[email protected]>
Date:   Fri May 1 22:12:37 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/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]>

 
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]>

 
rust: init: fix `clippy::undocumented_unsafe_blocks` warnings [+ + +]
Author: Miguel Ojeda <[email protected]>
Date:   Mon Apr 27 01:21:13 2026 +0200

    rust: init: fix `clippy::undocumented_unsafe_blocks` warnings
    
    The stable backport in commit acc105db0826 ("rust: pin-init:
    add references to previously initialized fields") introduced some
    `clippy::undocumented_unsafe_blocks` warnings [1], e.g.
    
        error: unsafe block missing a safety comment
            --> rust/kernel/init/macros.rs:1015:25
    
    As well as:
    
        --> rust/kernel/init/macros.rs:1243:45
        --> rust/kernel/init/macros.rs:1286:22
        --> rust/kernel/init/macros.rs:1374:45
    
    After discussing it with Benno and Gary, we decided to clean the build
    log by doing a minimal targeted stable commit.
    
    Thus, depending on the case:
    
      - Reorder the attributes so that the existing `// SAFETY:` comments
        may be seen by Clippy.
    
      - Add a placeholder `// SAFETY: TODO.` comment.
    
    Cc: Benno Lossin <[email protected]>
    Cc: Gary Guo <[email protected]>
    Fixes: acc105db0826 ("rust: pin-init: add references to previously initialized fields")
    Link: https://lore.kernel.org/stable/[email protected]/ [1]
    Signed-off-by: Miguel Ojeda <[email protected]>
    Signed-off-by: Sasha Levin <[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:   Sun May 3 06:59:34 2026 -0400

    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]>
    [ adapted to per-skb rxrpc_input_call_event() signature ]
    Signed-off-by: Sasha Levin <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[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:   Thu Apr 23 21:09:06 2026 +0100

    rxrpc: Fix rxrpc_input_call_event() to only unshare DATA packets
    
    commit 55b2984c96c37f909bbfe8851f13152693951382 upstream.
    
    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: Greg Kroah-Hartman <[email protected]>

 
sched: Use u64 for bandwidth ratio calculations [+ + +]
Author: Joseph Salisbury <[email protected]>
Date:   Fri Apr 3 17:00:14 2026 -0400

    sched: Use u64 for bandwidth ratio calculations
    
    commit c6e80201e057dfb7253385e60bf541121bf5dc33 upstream.
    
    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]
    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]>

 
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/landlock: Fix format warning for __u64 in net_test [+ + +]
Author: Mickaël Salaün <[email protected]>
Date:   Thu Apr 2 21:26:06 2026 +0200

    selftests/landlock: Fix format warning for __u64 in net_test
    
    commit a060ac0b8c3345639f5f4a01e2c435d34adf7e3d upstream.
    
    On architectures where __u64 is unsigned long (e.g. powerpc64), using
    %llx to format a __u64 triggers a -Wformat warning because %llx expects
    unsigned long long.  Cast the argument to unsigned long long.
    
    Cc: Günther Noack <[email protected]>
    Cc: [email protected]
    Fixes: a549d055a22e ("selftests/landlock: Add network tests")
    Reported-by: kernel test robot <[email protected]>
    Closes: https://lore.kernel.org/r/[email protected]/
    Reviewed-by: Günther Noack <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Mickaël Salaün <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[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]>

 
smb: client: validate the whole DACL before rewriting it in cifsacl [+ + +]
Author: Michael Bommarito <[email protected]>
Date:   Fri Apr 24 10:46:09 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]>

 
spi: ch341: fix memory leaks on probe failures [+ + +]
Author: Johan Hovold <[email protected]>
Date:   Fri Mar 27 11:43:04 2026 +0100

    spi: ch341: fix memory leaks on probe failures
    
    commit b99e3ddb91b499d920e63a2daff8880be68cfe9e upstream.
    
    Make sure to deregister the controller, disable pins, and kill and free
    the RX URB on probe failures to mirror disconnect and avoid memory
    leaks and use-after-free.
    
    Also add an explicit URB kill on disconnect for symmetry (even if that
    is not strictly required as USB core would have stopped it in the
    current setup).
    
    Fixes: 8846739f52af ("spi: add ch341a usb2spi driver")
    Cc: [email protected]      # 6.11
    Cc: Johannes Thumshirn <[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 07:32:43 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: 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]>

 
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: core: Fix thermal zone governor cleanup issues [+ + +]
Author: Rafael J. Wysocki <[email protected]>
Date:   Thu Apr 30 12:45:15 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]
    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: Fix auth session leak in tpm2_get_random() error path [+ + +]
Author: Gunnar Kudrjavets <[email protected]>
Date:   Wed Apr 8 12:00:27 2026 +0300

    tpm: Fix auth session leak in tpm2_get_random() error path
    
    commit 666c1a2ca603d8314231200bf8bbb3a81bd64c6b upstream.
    
    When tpm_buf_fill_hmac_session() fails inside the do-while loop in
    tpm2_get_random(), the function returns directly after destroying the
    buffer, without ending the auth session via tpm2_end_auth_session().
    
    This leaks the TPM auth session resource. All other error paths within
    the loop correctly reach the 'out' label which calls both
    tpm_buf_destroy() and tpm2_end_auth_session().
    
    Fix this by replacing the early return with a goto to the existing 'out'
    label, which already handles both cleanup operations. The redundant
    tpm_buf_destroy() call is removed since 'out' takes care of it.
    
    Cc: [email protected] # v6.19+
    Fixes: 6e9722e9a7bf ("tpm2-sessions: Fix out of range indexing in name_size")
    Signed-off-by: Gunnar Kudrjavets <[email protected]>
    Reviewed-by: Justinien Bouron <[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]>

tpm: Use kfree_sensitive() to free auth session in tpm_dev_release() [+ + +]
Author: Gunnar Kudrjavets <[email protected]>
Date:   Thu Apr 9 17:20:54 2026 +0000

    tpm: Use kfree_sensitive() to free auth session in tpm_dev_release()
    
    commit c424d2664f08c77f08b4580b5f0cbaabf7c229b2 upstream.
    
    tpm_dev_release() uses plain kfree() to free chip->auth, which contains
    sensitive cryptographic material including HMAC session keys, nonces,
    and passphrase data (struct tpm2_auth).
    
    Every other code path that frees this structure uses kfree_sensitive()
    to zero the memory before releasing it: both tpm2_end_auth_session()
    and tpm_buf_check_hmac_response() do so. The tpm_dev_release() path
    is the only one that does not, leaving key material in freed slab
    memory until it is eventually overwritten.
    
    Use kfree_sensitive() for consistency with the rest of the driver and
    to ensure session keys are scrubbed during device teardown.
    
    Cc: [email protected] # v6.10+
    Fixes: 699e3efd6c64 ("tpm: Add HMAC session start and end functions")
    Signed-off-by: Gunnar Kudrjavets <[email protected]>
    Reviewed-by: Justinien Bouron <[email protected]>
    Reviewed-by: Jarkko Sakkinen <[email protected]>
    Signed-off-by: Jarkko Sakkinen <[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: 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]>

 
vfio/cdx: Fix NULL pointer dereference in interrupt trigger path [+ + +]
Author: Prasanna Kumar T S M <[email protected]>
Date:   Fri Apr 17 14:27:56 2026 -0600

    vfio/cdx: Fix NULL pointer dereference in interrupt trigger path
    
    commit 5ea5880764cbb164afb17a62e76ca75dc371409d upstream.
    
    Add validation to ensure MSI is configured before accessing cdx_irqs
    array in vfio_cdx_set_msi_trigger(). Without this check, userspace
    can trigger a NULL pointer dereference by calling VFIO_DEVICE_SET_IRQS
    with VFIO_IRQ_SET_DATA_BOOL or VFIO_IRQ_SET_DATA_NONE flags before
    ever setting up interrupts via VFIO_IRQ_SET_DATA_EVENTFD.
    
    The vfio_cdx_msi_enable() function allocates the cdx_irqs array and
    sets config_msi to 1 only when called through the EVENTFD path. The
    trigger loop (for DATA_BOOL/DATA_NONE) assumed this had already been
    done, but there was no enforcement of this call ordering.
    
    This matches the protection used in the PCI VFIO driver where
    vfio_pci_set_msi_trigger() checks irq_is() before the trigger loop.
    
    Fixes: 848e447e000c ("vfio/cdx: add interrupt support")
    Cc: [email protected]
    Signed-off-by: Prasanna Kumar T S M <[email protected]>
    Acked-by: Nipun Gupta <[email protected]>
    Signed-off-by: Alex Williamson <[email protected]>
    Acked-by: Nikhil Agarwal <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alex Williamson <[email protected]>
    Signed-off-by: Greg Kroah-Hartman <[email protected]>

vfio/cdx: Serialize VFIO_DEVICE_SET_IRQS with a per-device mutex [+ + +]
Author: Alex Williamson <[email protected]>
Date:   Fri Apr 17 14:27:57 2026 -0600

    vfio/cdx: Serialize VFIO_DEVICE_SET_IRQS with a per-device mutex
    
    commit 670e8864b1a218d72f08db40d0103adf38fa1d9b upstream.
    
    vfio_cdx_set_msi_trigger() reads vdev->config_msi and operates on the
    vdev->cdx_irqs array based on its value, but provides no serialization
    against concurrent VFIO_DEVICE_SET_IRQS ioctls.  Two callers can race
    such that one observes config_msi as set while another clears it and
    frees cdx_irqs via vfio_cdx_msi_disable(), resulting in a use-after-free
    of the cdx_irqs array.
    
    Add a cdx_irqs_lock mutex to struct vfio_cdx_device and acquire it in
    vfio_cdx_set_msi_trigger(), which is the single chokepoint through
    which all updates to config_msi, cdx_irqs, and msi_count flow, covering
    both the ioctl path and the close-device cleanup path.  This keeps the
    test of config_msi atomic with the subsequent enable, disable, or
    trigger operations.
    
    Drop the pre-call !cdx_irqs test from vfio_cdx_irqs_cleanup() as part
    of this change: the optimization it provided is redundant with the
    !config_msi early-return inside vfio_cdx_msi_disable(), and leaving the
    test in place would be an unsynchronized read of state the new lock is
    meant to protect.
    
    Fixes: 848e447e000c ("vfio/cdx: add interrupt support")
    Cc: [email protected]
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Alex Williamson <[email protected]>
    Acked-by: Nikhil Agarwal <[email protected]>
    Link: https://lore.kernel.org/r/[email protected]
    Signed-off-by: Alex Williamson <[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 12:45:17 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 12:45:18 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:31:55 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: rtl8xxxu: fix potential use of uninitialized value [+ + +]
Author: Yi Cong <[email protected]>
Date:   Fri Mar 6 15:16:27 2026 +0800

    wifi: rtl8xxxu: fix potential use of uninitialized value
    
    commit f8a2fc809bfeb49130709b31a4d357a049f28547 upstream.
    
    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: 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/cpu: Disable FRED when PTI is forced on [+ + +]
Author: Dave Hansen <[email protected]>
Date:   Tue Apr 21 09:31:36 2026 -0700

    x86/cpu: Disable FRED when PTI is forced on
    
    commit 932d922285ef4d0d655a6f5def2779ae86ca0d73 upstream.
    
    FRED and PTI were never intended to work together. No FRED hardware is
    vulnerable to Meltdown and all of it should have LASS anyway.
    Nevertheless, if you boot a system with pti=on and fred=on, the kernel
    tries to do what is asked of it and dies a horrible death on the first
    attempt to run userspace (since it never switches to the user page
    tables).
    
    Disable FRED when PTI is forced on, and print a warning about it.
    
    A quick brain dump about what a FRED+PTI implementation would look like
    is below. I'm not sure it would make any sense to do it, but never say
    never. All I know is that it's way too complicated to be worth it today.
    
    <brain dump>
    The SWITCH_TO_USER/KERNEL_CR3 bits are simple to fix (or at least we
    have the assembly tools to do it already), as is sticking the FRED entry
    text in .entry.text (it's not in there today).
    
    The nasty part is the stacks. Today, the CPU pops into the kernel on
    MSR_IA32_FRED_RSP0 which is normal old kernel memory and not mapped to
    userspace. The hardware pushes gunk on to MSR_IA32_FRED_RSP0, which is
    currently the task stacks. MSR_IA32_FRED_RSP0 would need to point
    elsewhere, probably cpu_entry_stack(). Then, start playing games with
    stacks on entry/exit, including copying gunk to and from the task stack.
    
    While I'd *like* to have PTI everywhere, I'm not sure it's worth mucking
    up the FRED code with PTI kludges. If a user wants fast entry/exit, they
    use FRED. If you want PTI (and sekuritay), you certainly don't care
    about fast entry and FRED isn't going to help you *all* that much, so
    you can just stay with the IDT.
    
    Plus, FRED hardware should have LASS which gives you a similar security
    profile to PTI without the CR3 munging.
    </brain dump>
    
    Reported-by: Gayatri Kammela <[email protected]>
    Signed-off-by: Dave Hansen <[email protected]>
    Reviewed-by: Borislav Petkov (AMD) <[email protected]>
    Tested-by: Maciej Wieczor-Retman <[email protected]>
    Cc:[email protected]
    Link: https://patch.msgid.link/[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:   Wed Apr 1 12:02:41 2026 +0800

    xfs: fix a resource leak in xfs_alloc_buftarg()
    
    commit 29a7b2614357393b176ef06ba5bc3ff5afc8df69 upstream.
    
    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]>
    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]>