Changelog in Linux kernel 6.1.176

 
6lowpan: fix off-by-one in multicast context address compression [+ + +]
Author: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Date:   Wed May 27 16:18:01 2026 +0800

    6lowpan: fix off-by-one in multicast context address compression
    
    [ Upstream commit 2a58899d11009bffc7b4b32a571858f381121837 ]
    
    The second memcpy in lowpan_iphc_mcast_ctx_addr_compress() uses
    &data[1] as destination and &ipaddr->s6_addr[11] as source, but
    both should be offset by one: &data[2] and &ipaddr->s6_addr[12]
    respectively.
    
    This off-by-one has two consequences:
    1. data[1] is overwritten with s6_addr[11], corrupting the RIID
       field in the compressed multicast address
    2. data[5] is never written, so uninitialized kernel stack memory
       is transmitted over the network via lowpan_push_hc_data(),
       leaking kernel stack contents
    
    The correct inline data layout must match what the decompression
    function lowpan_uncompress_multicast_ctx_daddr() expects:
      data[0..1] = s6_addr[1..2]  (flags/scope + RIID)
      data[2..5] = s6_addr[12..15] (group ID)
    
    Also zero-initialize the data array as a defensive measure against
    similar bugs in the future.
    
    Fixes: 5609c185f24d ("6lowpan: iphc: add support for stateful compression")
    Reported-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
    Reported-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
    Reported-by: Ao Wang <wangao@seu.edu.cn>
    Reported-by: Xuewei Feng <fengxw06@126.com>
    Reported-by: Qi Li <qli01@tsinghua.edu.cn>
    Reported-by: Ke Xu <xuke@tsinghua.edu.cn>
    Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
    Acked-by: Alexander Aring <aahringo@redhat.com>
    Link: https://patch.msgid.link/20260527081806.42747-1-zhaoyz24@mails.tsinghua.edu.cn
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ALSA: aoa: i2sbus: clear stale prepared state [+ + +]
Author: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Date:   Fri May 1 12:59:01 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 <lkp@intel.com>
    Closes: https://lore.kernel.org/oe-kbuild-all/202604010125.AvkWBYKI-lkp@intel.com/
    Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa")
    Cc: stable@vger.kernel.org
    Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
    Link: https://patch.msgid.link/20260331-aoa-i2sbus-clear-stale-active-v2-1-3764ae2889a1@gmail.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: aoa: Skip devices with no codecs in i2sbus_resume() [+ + +]
Author: Thorsten Blum <thorsten.blum@linux.dev>
Date:   Fri May 1 13:40:55 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: stable@vger.kernel.org
    Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
    Link: https://patch.msgid.link/20260310102921.210109-3-thorsten.blum@linux.dev
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: aoa: Use guard() for mutex locks [+ + +]
Author: Takashi Iwai <tiwai@suse.de>
Date:   Fri May 1 12:59:00 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 <tiwai@suse.de>
    Link: https://patch.msgid.link/20250829151335.7342-14-tiwai@suse.de
    Stable-dep-of: 5ed060d54915 ("ALSA: aoa: i2sbus: clear stale prepared state")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: firewire-motu: Protect register DSP event queue positions [+ + +]
Author: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Date:   Fri Jun 5 09:00:33 2026 -0400

    ALSA: firewire-motu: Protect register DSP event queue positions
    
    [ Upstream commit 98fb1c1bb11e29eb609b7200a25e136e05aa4498 ]
    
    The register DSP event queue is updated under parser->lock, but
    snd_motu_register_dsp_message_parser_count_event() reads pull_pos and
    push_pos without the lock.
    snd_motu_register_dsp_message_parser_copy_event() also reads both queue
    positions before taking the lock.
    
    Protect these accesses with parser->lock as well. This keeps the hwdep
    poll/read path consistent with the producer side and with the cached
    meter/parameter accessors.
    
    Fixes: 634ec0b2906e ("ALSA: firewire-motu: notify event for parameter change in register DSP model")
    Cc: stable@vger.kernel.org
    Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
    Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Link: https://patch.msgid.link/20260521-alsa-firewire-motu-event-locking-v1-1-708e1c2b5e56@gmail.com
    [ converted copy_event() from manual spin_lock_irqsave/spin_unlock_irqrestore to guard(spinlock_irqsave) ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: hda/hdmi: Add quirk for TUXEDO IBS14G6 [+ + +]
Author: Aaron Erhardt <aer@tuxedocomputers.com>
Date:   Wed Feb 18 22:32:10 2026 +0100

    ALSA: hda/hdmi: Add quirk for TUXEDO IBS14G6
    
    commit d649c58bcad8fb9b749e3837136a201632fa109d upstream.
    
    Depending on the timing during boot, the BIOS might report wrong pin
    capabilities, which can lead to HDMI audio being disabled. Therefore,
    force HDMI audio connection on TUXEDO InfinityBook S 14 Gen6.
    
    Signed-off-by: Aaron Erhardt <aer@tuxedocomputers.com>
    Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
    Link: https://patch.msgid.link/20260218213234.429686-1-wse@tuxedocomputers.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ALSA: PCM: Fix wait queue list corruption in snd_pcm_drain() on linked streams [+ + +]
Author: Ji'an Zhou <eilaimemedsnaimel@gmail.com>
Date:   Thu Jun 4 14:25:59 2026 +0000

    ALSA: PCM: Fix wait queue list corruption in snd_pcm_drain() on linked streams
    
    [ Upstream commit 88fe2e3658726cb21ff2dcf9770bf672f9b9d31b ]
    
    snd_pcm_drain() uses init_waitqueue_entry which does not clear
    entry.prev/next, and add_wait_queue with a conditional
    remove_wait_queue that is skipped when to_check is no longer
    in the group after concurrent UNLINK.  The orphaned wait entry
    remains on the unlinked substream sleep queue.  On the next
    drain iteration, add_wait_queue adds the entry to a new queue
    while still linked on the old one, corrupting both lists.  A
    subsequent wake_up dereferences NULL at the func pointer
    (mapped from the spinlock at offset 0 of the misinterpreted
    wait_queue_head_t), causing a kernel panic.
    
    Replace init_waitqueue_entry/add_wait_queue/conditional
    remove_wait_queue with init_wait_entry/prepare_to_wait/
    finish_wait.  init_wait_entry clears prev/next via
    INIT_LIST_HEAD on each iteration and sets
    autoremove_wake_function which auto-removes the entry on
    wake-up.  finish_wait safely handles both the already-removed
    and still-queued cases.
    
    Fixes: 9b1dbd69ba6f ("ALSA: pcm: fix use-after-free on linked stream runtime in snd_pcm_drain")
    Signed-off-by: Ji'an Zhou <eilaimemedsnaimel@gmail.com>
    Link: https://patch.msgid.link/20260604142559.3840881-1-eilaimemedsnaimel@gmail.com
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ALSA: timer: Fix UAF at snd_timer_user_params() [+ + +]
Author: Takashi Iwai <tiwai@suse.de>
Date:   Sat Jun 6 18:11:41 2026 +0200

    ALSA: timer: Fix UAF at snd_timer_user_params()
    
    commit 053a401b592be424fea9d57c789f66cd5d8cec11 upstream.
    
    At releasing a timer object, e.g. when a userspace timer
    (CONFIG_SND_UTIMER) gets closed and snd_timer_free() is called, it
    tries to detach the timer instances and release the resources.
    However, it's still possible that other in-flight tasks are holding
    the timer instance where the to-be-deleted timer object is associated,
    and this may lead to racy accesses.
    
    Fortunately, most of ioctls dealing with the timer instance list
    already have the protection with register_mutex, and this also avoids
    such races.  But, SNDRV_TIMER_IOCTL_PARAMS isn't protected, hence the
    concurrent ioctl may lead to use-after-free.
    
    This patch just adds the guard with register_mutex to protect
    snd_timer_user_params() for covering the code path as a quick
    workaround.  It's no hot-path but rather a rarely issued ioctl, so the
    performance penalty doesn't matter.
    
    Reported-by: Kyle Zeng <kylebot@openai.com>
    Tested-by: Kyle Zeng <kylebot@openai.com>
    Cc: <stable@vger.kernel.org>
    Link: https://patch.msgid.link/20260606161145.1933447-2-tiwai@suse.de
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
apparmor: validate default DFA states are in bounds [+ + +]
Author: Ben Hutchings <benh@debian.org>
Date:   Thu May 28 17:16:49 2026 +0200

    apparmor: validate default DFA states are in bounds
    
    Some backports of commit 9063d7e2615f ("apparmor: validate DFA start
    states are in bounds in unpack_pdb") limited the bounds checks on DFA
    start states to the case where the start state was explicit in the
    policy.  However, the default DFA start state (DFA_START = 1) could
    also be out-of-bounds.
    
    Move these checks out of the else-branches so that they are applied
    regardless of how the start state was initialised.
    
    Fixes: 5443c027ec16 ("apparmor: validate DFA start states are in bounds in unpack_pdb")
    Signed-off-by: Ben Hutchings <benh@debian.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
arm64/mm: Enable batched TLB flush in unmap_hotplug_range() [+ + +]
Author: Anshuman Khandual <anshuman.khandual@arm.com>
Date:   Tue Apr 28 14:19:49 2026 -0400

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

 
arm64: cputype: Add C1-Premium definitions [+ + +]
Author: Mark Rutland <mark.rutland@arm.com>
Date:   Tue Jun 16 06:20:43 2026 +0100

    arm64: cputype: Add C1-Premium definitions
    
    commit d28413bfc5a255957241f1df5d7fd0c2cd74fe18 upstream.
    
    Add cputype definitions for C1-Premium. These will be used for errata
    detection in subsequent patches.
    
    These values can be found in the C1-Premium TRM:
    
      https://developer.arm.com/documentation/109416/0100/
    
    ... in section A.5.1 ("MIDR_EL1, Main ID Register").
    
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Will Deacon <will@kernel.org>
    [Mark: backport to v6.1.y]
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

arm64: cputype: Add C1-Ultra definitions [+ + +]
Author: Mark Rutland <mark.rutland@arm.com>
Date:   Tue Jun 16 06:20:42 2026 +0100

    arm64: cputype: Add C1-Ultra definitions
    
    commit 60349e64a6c65f9f0aa118af711b3c7e137f07ff upstream.
    
    Add cputype definitions for C1-Ultra. These will be used for errata
    detection in subsequent patches.
    
    These values can be found in the C1-Ultra TRM:
    
      https://developer.arm.com/documentation/108014/0100/
    
    ... in section A.5.1 ("MIDR_EL1, Main ID Register").
    
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Will Deacon <will@kernel.org>
    [Mark: backport to v6.1.y]
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

arm64: cputype: Add NVIDIA Olympus definitions [+ + +]
Author: Shanker Donthineni <sdonthineni@nvidia.com>
Date:   Tue Jun 16 06:20:41 2026 +0100

    arm64: cputype: Add NVIDIA Olympus definitions
    
    commit e185c8a0d84236d14af61faff8147c953a878a77 upstream.
    
    Add cpu part and model macro definitions for NVIDIA Olympus core.
    
    Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com>
    Signed-off-by: Will Deacon <will@kernel.org>
    [Mark: backport to v6.1.y]
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

arm64: errata: Mitigate TLBI errata on Microsoft Azure Cobalt 100 CPU [+ + +]
Author: Will Deacon <will@kernel.org>
Date:   Tue Jun 16 06:20:46 2026 +0100

    arm64: errata: Mitigate TLBI errata on Microsoft Azure Cobalt 100 CPU
    
    commit 1940e70a8144bf75e6df26bf6f600862ea7f7ea1 upstream.
    
    Commit fb091ff39479 ("arm64: Subscribe Microsoft Azure Cobalt 100 to ARM
    Neoverse N2 errata") states that Microsoft Azure Cobalt 100 CPU "is a
    Microsoft implemented CPU based on r0p0 of the ARM Neoverse N2 CPU, and
    therefore suffers from all the same errata.".
    
    So enable the workaround for the latest broadcast TLB invalidation bug
    on these parts.
    
    Signed-off-by: Will Deacon <will@kernel.org>
    [Mark: backport to v6.1.y]
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

arm64: errata: Mitigate TLBI errata on NVIDIA Olympus CPU [+ + +]
Author: Shanker Donthineni <sdonthineni@nvidia.com>
Date:   Tue Jun 16 06:20:45 2026 +0100

    arm64: errata: Mitigate TLBI errata on NVIDIA Olympus CPU
    
    commit ec7216f92e4ebd485b1c6dc6aa3f6064b71a5768 upstream.
    
    NVIDIA Olympus cores are affected by the TLBI completion issue tracked as
    CVE-2025-10263. The existing ARM64_ERRATUM_4118414 handling already uses
    ARM64_WORKAROUND_REPEAT_TLBI to issue an additional broadcast TLBI;DSB
    sequence and ensure affected memory write effects are globally observed.
    
    Add MIDR_NVIDIA_OLYMPUS to the repeat-TLBI match list so the same
    mitigation is enabled on affected Olympus systems. Also document the
    NVIDIA Olympus erratum in the arm64 silicon errata table and list it in
    the Kconfig help text.
    
    Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Acked-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Will Deacon <will@kernel.org>
    [Mark: backport to v6.1.y]
    Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

arm64: errata: Mitigate TLBI errata on various Arm CPUs [+ + +]
Author: Mark Rutland <mark.rutland@arm.com>
Date:   Tue Jun 16 06:20:44 2026 +0100

    arm64: errata: Mitigate TLBI errata on various Arm CPUs
    
    commit cfd391e74134db664feb499d43af286380b10ba8 upstream.
    
    A number of CPUs developed by Arm suffer from errata whereby a broadcast
    TLBI;DSB sequence may complete before the global observation of writes
    which are translated by an affected TLB entry.
    
    These errata ONLY affect the completion of memory accesses which have
    been translated by an invalidated TLB entry, and these errata DO NOT
    affect the actual invalidation of TLB entries. TLB entries are removed
    correctly.
    
    This issue has been assigned CVE ID CVE-2025-10263.
    
    To mitigate this issue, Arm recommends that software follows any
    affected TLBI;DSB sequence with an additional TLBI;DSB, which will
    ensure that all memory write effects affected by the first TLBI have
    been globally observed. The additional TLBI can use any operation that
    is broadcast to affected CPUs, and the additional DSB can use any option
    that is sufficient to complete the additional TLBI.
    
    The ARM64_WORKAROUND_REPEAT_TLBI workaround is sufficient to mitigate
    the issue. Enable this workaround for affected CPUs, and update the
    silicon errata documentation accordingly.
    
    Note that due to the manner in which Arm develops IP and tracks errata,
    some CPUs share a common erratum number.
    
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Will Deacon <will@kernel.org>
    [Mark: backport to v6.1.y]
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

arm64: tlb: Allow XZR argument to TLBI ops [+ + +]
Author: Mark Rutland <mark.rutland@arm.com>
Date:   Thu Jun 11 14:44:50 2026 +0100

    arm64: tlb: Allow XZR argument to TLBI ops
    
    commit bfd9c931d19aa59fb8371d557774fa169b15db9a upstream.
    
    The TLBI instruction accepts XZR as a register argument, and for TLBI
    operations with a register argument, there is no functional difference
    between using XZR or another GPR which contains zeroes. Operations
    without a register argument are encoded as if XZR were used.
    
    Allow the __TLBI_1() macro to use XZR when a register argument is all
    zeroes.
    
    Today this only results in a trivial code saving in
    __do_compat_cache_op()'s workaround for Neoverse-N1 erratum #1542419. In
    subsequent patches this pattern will be used more generally.
    
    There should be no functional change as a result of this patch.
    
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marc Zyngier <maz@kernel.org>
    Cc: Oliver Upton <oupton@kernel.org>
    Cc: Ryan Roberts <ryan.roberts@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    [Mark: Backport to v6.1.y]
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

arm64: tlb: Flush walk cache when unsharing PMD tables [+ + +]
Author: Zeng Heng <zengheng4@huawei.com>
Date:   Sun May 31 21:11:52 2026 -0400

    arm64: tlb: Flush walk cache when unsharing PMD tables
    
    [ Upstream commit c2ff4764e03e7a8d758352f4aceb8fe1be6ac971 ]
    
    When huge_pmd_unshare() is called to unshare a PMD table, the
    tlb_unshare_pmd_ptdesc() function sets tlb->unshared_tables=true
    but the aarch64 tlb_flush() only checked tlb->freed_tables to
    determine whether to use TLBF_NONE (vae1is, invalidates walk
    cache) or TLBF_NOWALKCACHE (vale1is, leaf-only).
    
    This caused the stale PMD page table entry to remain in the walk cache
    after unshare, potentially leading to incorrect page table walks.
    
    Fix by including unshared_tables in the check, so that when
    unsharing tables, TLBF_NONE is used and the walk cache is properly
    invalidated.
    
    Here is the detailed distinction between vae1is and vale1is:
    
    | Instruction Combination  | Actual Invalidation Scope                         |
    | ------------------------ | --------------------------------------------------|
    | `VAE1IS`  + TTL=`0`      | All entries at all levels (full invalidation)     |
    | `VAE1IS`  + TTL=`2` (L2) | Non-leaf at Level 0/1 + leaf at Level 2           |
    | `VALE1IS` + TTL=`0`      | Leaf entries at all levels (non-leaf not cleared) |
    | `VALE1IS` + TTL=`2` (L2) | Leaf entry at Level 2 only                        |
    
    Signed-off-by: Zeng Heng <zengheng4@huawei.com>
    Fixes: 8ce720d5bd91 ("mm/hugetlb: fix excessive IPI broadcasts when unsharing PMD tables using mmu_gather")
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

arm64: tlb: Optimize ARM64_WORKAROUND_REPEAT_TLBI [+ + +]
Author: Mark Rutland <mark.rutland@arm.com>
Date:   Thu Jun 11 14:44:51 2026 +0100

    arm64: tlb: Optimize ARM64_WORKAROUND_REPEAT_TLBI
    
    commit a8f78680ee6bf795086384e8aea159a52814f827 upstream.
    
    The ARM64_WORKAROUND_REPEAT_TLBI workaround is used to mitigate several
    errata where broadcast TLBI;DSB sequences don't provide all the
    architecturally required synchronization. The workaround performs more
    work than necessary, and can have significant overhead. This patch
    optimizes the workaround, as explained below.
    
    The workaround was originally added for Qualcomm Falkor erratum 1009 in
    commit:
    
      d9ff80f83ecb ("arm64: Work around Falkor erratum 1009")
    
    As noted in the message for that commit, the workaround is applied even
    in cases where it is not strictly necessary.
    
    The workaround was later reused without changes for:
    
    * Arm Cortex-A76 erratum #1286807
      SDEN v33: https://developer.arm.com/documentation/SDEN-885749/33-0/
    
    * Arm Cortex-A55 erratum #2441007
      SDEN v16: https://developer.arm.com/documentation/SDEN-859338/1600/
    
    * Arm Cortex-A510 erratum #2441009
      SDEN v19: https://developer.arm.com/documentation/SDEN-1873351/1900/
    
    The important details to note are as follows:
    
    1. All relevant errata only affect the ordering and/or completion of
       memory accesses which have been translated by an invalidated TLB
       entry. The actual invalidation of TLB entries is unaffected.
    
    2. The existing workaround is applied to both broadcast and local TLB
       invalidation, whereas for all relevant errata it is only necessary to
       apply a workaround for broadcast invalidation.
    
    3. The existing workaround replaces every TLBI with a TLBI;DSB;TLBI
       sequence, whereas for all relevant errata it is only necessary to
       execute a single additional TLBI;DSB sequence after any number of
       TLBIs are completed by a DSB.
    
       For example, for a sequence of batched TLBIs:
    
           TLBI <op1>[, <arg1>]
           TLBI <op2>[, <arg2>]
           TLBI <op3>[, <arg3>]
           DSB ISH
    
       ... the existing workaround will expand this to:
    
           TLBI <op1>[, <arg1>]
           DSB ISH                  // additional
           TLBI <op1>[, <arg1>]     // additional
           TLBI <op2>[, <arg2>]
           DSB ISH                  // additional
           TLBI <op2>[, <arg2>]     // additional
           TLBI <op3>[, <arg3>]
           DSB ISH                  // additional
           TLBI <op3>[, <arg3>]     // additional
           DSB ISH
    
       ... whereas it is sufficient to have:
    
           TLBI <op1>[, <arg1>]
           TLBI <op2>[, <arg2>]
           TLBI <op3>[, <arg3>]
           DSB ISH
           TLBI <opX>[, <argX>]     // additional
           DSB ISH                  // additional
    
       Using a single additional TBLI and DSB at the end of the sequence can
       have significantly lower overhead as each DSB which completes a TLBI
       must synchronize with other PEs in the system, with potential
       performance effects both locally and system-wide.
    
    4. The existing workaround repeats each specific TLBI operation, whereas
       for all relevant errata it is sufficient for the additional TLBI to
       use *any* operation which will be broadcast, regardless of which
       translation regime or stage of translation the operation applies to.
    
       For example, for a single TLBI:
    
           TLBI ALLE2IS
           DSB ISH
    
       ... the existing workaround will expand this to:
    
           TLBI ALLE2IS
           DSB ISH
           TLBI ALLE2IS             // additional
           DSB ISH                  // additional
    
       ... whereas it is sufficient to have:
    
           TLBI ALLE2IS
           DSB ISH
           TLBI VALE1IS, XZR        // additional
           DSB ISH                  // additional
    
       As the additional TLBI doesn't have to match a specific earlier TLBI,
       the additional TLBI can be implemented in separate code, with no
       memory of the earlier TLBIs. The additional TLBI can also use a
       cheaper TLBI operation.
    
    5. The existing workaround is applied to both Stage-1 and Stage-2 TLB
       invalidation, whereas for all relevant errata it is only necessary to
       apply a workaround for Stage-1 invalidation.
    
       Architecturally, TLBI operations which invalidate only Stage-2
       information (e.g. IPAS2E1IS) are not required to invalidate TLB
       entries which combine information from Stage-1 and Stage-2
       translation table entries, and consequently may not complete memory
       accesses translated by those combined entries. In these cases,
       completion of memory accesses is only guaranteed after subsequent
       invalidation of Stage-1 information (e.g. VMALLE1IS).
    
    Taking the above points into account, this patch reworks the workaround
    logic to reduce overhead:
    
    * New __tlbi_sync_s1ish() and __tlbi_sync_s1ish_hyp() functions are
      added and used in place of any dsb(ish) which is used to complete
      broadcast Stage-1 TLB maintenance. When the
      ARM64_WORKAROUND_REPEAT_TLBI workaround is enabled, these helpers will
      execute an additional TLBI;DSB sequence.
    
      For consistency, it might make sense to add __tlbi_sync_*() helpers
      for local and stage 2 maintenance. For now I've left those with
      open-coded dsb() to keep the diff small.
    
    * The duplication of TLBIs in __TLBI_0() and __TLBI_1() is removed. This
      is no longer needed as the necessary synchronization will happen in
      __tlbi_sync_s1ish() or __tlbi_sync_s1ish_hyp().
    
    * The additional TLBI operation is chosen to have minimal impact:
    
      - __tlbi_sync_s1ish() uses "TLBI VALE1IS, XZR". This is only used at
        EL1 or at EL2 with {E2H,TGE}=={1,1}, where it will target an unused
        entry for the reserved ASID in the kernel's own translation regime,
        and have no adverse affect.
    
      - __tlbi_sync_s1ish_hyp() uses "TLBI VALE2IS, XZR". This is only used
        in hyp code, where it will target an unused entry in the hyp code's
        TTBR0 mapping, and should have no adverse effect.
    
    * As __TLBI_0() and __TLBI_1() no longer replace each TLBI with a
      TLBI;DSB;TLBI sequence, batching TLBIs is worthwhile, and there's no
      need for arch_tlbbatch_should_defer() to consider
      ARM64_WORKAROUND_REPEAT_TLBI.
    
    When building defconfig with GCC 15.1.0, compared to v6.19-rc1, this
    patch saves ~1KiB of text, makes the vmlinux ~42KiB smaller, and makes
    the resulting Image 64KiB smaller:
    
    | [mark@lakrids:~/src/linux]% size vmlinux-*
    |    text    data     bss     dec     hex filename
    | 21179831        19660919         708216 41548966        279fca6 vmlinux-after
    | 21181075        19660903         708216 41550194        27a0172 vmlinux-before
    | [mark@lakrids:~/src/linux]% ls -l vmlinux-*
    | -rwxr-xr-x 1 mark mark 157771472 Feb  4 12:05 vmlinux-after
    | -rwxr-xr-x 1 mark mark 157815432 Feb  4 12:05 vmlinux-before
    | [mark@lakrids:~/src/linux]% ls -l Image-*
    | -rw-r--r-- 1 mark mark 41007616 Feb  4 12:05 Image-after
    | -rw-r--r-- 1 mark mark 41073152 Feb  4 12:05 Image-before
    
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Marc Zyngier <maz@kernel.org>
    Cc: Oliver Upton <oupton@kernel.org>
    Cc: Ryan Roberts <ryan.roberts@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    [Mark: Backport to v6.1.y]
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ARM: 9474/1: io: avoid KASAN instrumentation of raw halfword I/O [+ + +]
Author: Karl Mehltretter <kmehltretter@gmail.com>
Date:   Sun May 24 06:52:36 2026 +0100

    ARM: 9474/1: io: avoid KASAN instrumentation of raw halfword I/O
    
    commit d59ed803715a71fb9582e139d648ece8d66dc743 upstream.
    
    For CPUs before ARMv6, __raw_readw() and __raw_writew() are implemented
    as C volatile halfword accesses so the compiler can generate an access
    sequence that is safe for those machines. With KASAN enabled, those C
    accesses are instrumented as normal memory accesses.
    
    That is not valid for MMIO. On ARM926/VersatilePB with KASAN enabled,
    PL011 probing traps in __asan_store2() while registering the UART, because
    the instrumented writew() tries to check KASAN shadow for an MMIO address.
    
    Keep the existing volatile halfword access, but move the ARMv5 definitions
    into __no_kasan_or_inline functions so raw MMIO halfword accesses are not
    instrumented by KASAN. The ARMv6-and-newer inline assembly path is
    unchanged.
    
    Fixes: 421015713b30 ("ARM: 9017/2: Enable KASan for ARM")
    Cc: stable@vger.kernel.org # v5.11+
    Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
    Reviewed-by: Linus Walleij <linusw@kernel.org>
    Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ARM: 9475/1: entry: use byte load for KASAN VMAP stack shadow [+ + +]
Author: Karl Mehltretter <kmehltretter@gmail.com>
Date:   Sun May 24 06:52:35 2026 +0100

    ARM: 9475/1: entry: use byte load for KASAN VMAP stack shadow
    
    commit 77a1f6883dc6e837bb2cb30b9b02e2f94338e2c6 upstream.
    
    Commit 44e9a3bb76e5 ("ARM: 9430/1: entry: Do a dummy read from
    VMAP shadow") added a dummy read from the KASAN VMAP stack shadow in
    __switch_to(). The read uses ldr, but the KASAN shadow address is
    byte-granular and is not guaranteed to be word aligned.
    
    ARMv5 faults unaligned word loads. With CONFIG_KASAN_VMALLOC and
    CONFIG_VMAP_STACK enabled, ARM926/VersatilePB crashes in __switch_to()
    with an alignment exception before reaching init.
    
    Use ldrb for the dummy shadow access. The code only needs to fault in the
    shadow mapping if the stack shadow is missing, so a byte load is sufficient
    and matches the granularity of KASAN shadow memory.
    
    Fixes: 44e9a3bb76e5 ("ARM: 9430/1: entry: Do a dummy read from VMAP shadow")
    Cc: stable@vger.kernel.org # v6.13+
    Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
    Reviewed-by: Linus Walleij <linusw@kernel.org>
    Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ARM: socfpga: Fix OF node refcount leak in SMP setup [+ + +]
Author: Yuho Choi <dbgh9129@gmail.com>
Date:   Sun May 24 22:47:09 2026 -0400

    ARM: socfpga: Fix OF node refcount leak in SMP setup
    
    commit 63838c323924fe4a78b2323bd45aa1030f72ca60 upstream.
    
    socfpga_smp_prepare_cpus() looks up the Cortex-A9 SCU node with
    of_find_compatible_node(), which returns a node reference that must be
    released with of_node_put().
    
    The function maps the SCU registers and then returns without dropping
    that reference, leaking the node on both the success path and the
    of_iomap() failure path.
    
    Drop the reference once the mapping attempt is complete. The returned
    MMIO mapping does not depend on keeping the device node reference held.
    
    Fixes: 122694a0c712 ("ARM: socfpga: use of_iomap to map the SCU")
    Cc: stable@vger.kernel.org
    Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
    Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ASoC: codecs: simple-mux: Fix enum control bounds check [+ + +]
Author: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Date:   Wed May 27 09:24:00 2026 -0300

    ASoC: codecs: simple-mux: Fix enum control bounds check
    
    [ Upstream commit f63ad68e18d774a5d15cd7e405ead63f6b322679 ]
    
    simple_mux_control_put() rejects values greater than e->items, but
    enum control values are zero based. For the two-entry mux used by this
    driver, valid values are 0 and 1, so value 2 must be rejected as well.
    
    Accepting e->items can store an invalid mux state, pass it to the GPIO
    setter, and pass it on to the DAPM mux update path where it is used as
    an index into the enum text array.
    
    Use the same >= e->items check used by the ASoC enum helpers.
    
    Fixes: 342fbb7578d1 ("ASoC: add simple-mux")
    Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
    Link: https://patch.msgid.link/20260527-asoc-simple-mux-enum-bounds-v1-1-3f805b9fc671@gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: Intel: bytcht_es8316: Fix MCLK leak on init errors [+ + +]
Author: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Date:   Tue May 19 13:51:47 2026 -0300

    ASoC: Intel: bytcht_es8316: Fix MCLK leak on init errors
    
    [ Upstream commit afb2a3a9d8369d18122a0d7cd294eba9a98259c6 ]
    
    byt_cht_es8316_init() enables MCLK before configuring the codec sysclk
    and creating the headset jack. If either of those later steps fails, the
    function returns without disabling MCLK, leaving the clock enabled after
    card registration fails.
    
    Track whether this driver enabled MCLK and disable it on the init error
    paths. Add the matching DAI link exit callback so the same clock enable
    is also balanced when ASoC cleans up a successfully initialized link.
    
    Fixes: a03bdaa565cb ("ASoC: Intel: add machine driver for BYT/CHT + ES8316")
    Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
    Link: https://patch.msgid.link/20260519-asoc-bytcht-es8316-mclk-leak-v1-1-b4a11cdc2afd@gmail.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ASoC: qcom: q6asm-dai: close stream only when running [+ + +]
Author: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Date:   Mon May 18 09:23:44 2026 +0000

    ASoC: qcom: q6asm-dai: close stream only when running
    
    commit 048c540ee76ded666bda74f9dae1ca3254e0633c upstream.
    
    q6asm_dai_close() and q6asm_dai_compr_free() currently issue CMD_CLOSE
    whenever prtd->state is non-zero.
    
    After prepare() closes an existing stream, the state is updated to
    Q6ASM_STREAM_STOPPED. Since this state is also non-zero, the close and
    free paths can send CMD_CLOSE again for a stream that has already been
    closed.
    
    Restrict CMD_CLOSE to the Q6ASM_STREAM_RUNNING state so the command is
    sent only when the ASM stream is still active.
    
    Fixes: 2a9e92d371db ("ASoC: qdsp6: q6asm: Add q6asm dai driver")
    Cc: Stable@vger.kernel.org
    Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260518092347.3446946-3-srinivas.kandagatla@oss.qualcomm.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ASoC: qcom: q6asm-dai: do not set stream state in event and trigger callbacks [+ + +]
Author: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Date:   Mon May 18 09:23:43 2026 +0000

    ASoC: qcom: q6asm-dai: do not set stream state in event and trigger callbacks
    
    commit cee3e63e7106c3c81b2053371fdf14240bfba2fc upstream.
    
    The q6asm-dai stream state is used by prepare() to decide whether an
    existing stream setup needs to be closed before opening/configuring a new
    one. Updating the state from trigger or asynchronous DSP callbacks can make
    that state stale or incorrect relative to the actual setup lifetime.
    
    In particular, setting Q6ASM_STREAM_STOPPED on STOP or EOS completion can
    make prepare() believe there is no active setup to close, which can result
    in opening/configuring the same stream more than once.
    
    Keep stream state updates tied to prepare(), where the stream is actually
    closed and reopened, and stop changing it from trigger and EOS callbacks.
    
    Fixes: bfbb12dfa144 ("ASoC: qcom: q6asm-dai: perform correct state check before closing")
    Cc: Stable@vger.kernel.org
    Closes: https://lore.kernel.org/all/afS7rTHdc9TyIeLx@rdacayan/
    Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260518092347.3446946-2-srinivas.kandagatla@oss.qualcomm.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ASoC: qcom: q6asm-dai: fix error handling in prepare and set_params [+ + +]
Author: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Date:   Mon May 18 09:23:45 2026 +0000

    ASoC: qcom: q6asm-dai: fix error handling in prepare and set_params
    
    commit 4b4db09f283df65d780bc7cee66cb4a7e9bf4770 upstream.
    
    Fix error handling in q6asm_dai_compr_set_params() and q6asm_dai_prepare()
    for both CMD_CLOSE and q6asm_unmap_memory_regions().
    
    In both the functions, we are doing q6asm_audio_client_free in failure
    cases, which means if prepare or set_params fail, we can never recover.
    Now open and close are done in respective dai_open/close functions.
    
    Fixes: 2a9e92d371db ("ASoC: qdsp6: q6asm: Add q6asm dai driver")
    Cc: Stable@vger.kernel.org
    Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260518092347.3446946-4-srinivas.kandagatla@oss.qualcomm.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ASoC: wm_adsp: Fix NULL dereference when removing firmware controls [+ + +]
Author: Richard Fitzgerald <rf@opensource.cirrus.com>
Date:   Thu Jun 4 11:12:44 2026 +0100

    ASoC: wm_adsp: Fix NULL dereference when removing firmware controls
    
    [ Upstream commit 7d3fb78b550301e43fdc60312aed733069694426 ]
    
    In wm_adsp_control_remove() check that the priv pointer is not NULL
    before attempting to cleanup what it points to.
    
    When cs_dsp creates a control it calls wm_adsp_control_add_cb() so that
    wm_adsp can create its own private control data. There are two cases
    where private data is not created:
    
    1. The control is a SYSTEM control, so an ALSA control is not created.
    
    2. The codec driver has registered a control_add() callback that
       hides the control, so wm_adsp_control_add() is not called.
    
    When cs_dsp_remove destroys its control list it calls
    wm_adsp_control_remove() for each control. But wm_adsp_control_remove()
    was attempting to cleanup the private data pointed to by cs_ctl->priv
    without checking the pointer for NULL.
    
    Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
    Fixes: 0700bc2fb94c ("ASoC: wm_adsp: Separate generic cs_dsp_coeff_ctl handling")
    Link: https://patch.msgid.link/20260604101244.1402862-1-rf@opensource.cirrus.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
auxdisplay: line-display: fix OOB read on zero-length message_store() [+ + +]
Author: Stepan Ionichev <sozdayvek@gmail.com>
Date:   Thu May 14 22:43:42 2026 +0500

    auxdisplay: line-display: fix OOB read on zero-length message_store()
    
    commit a7511dcd9dd4bc55d123f9b800c8a4ed2662e5c6 upstream.
    
    linedisp_display() unconditionally reads msg[count - 1] before
    checking whether count is zero, so a write of zero bytes to the
    message sysfs attribute hits msg[-1]:
    
            write(fd, "", 0);
    
            -> message_store(..., buf, count=0)
               -> linedisp_display(linedisp, buf, count=0)
                  -> msg[count - 1] == '\n'  ; OOB read
    
    The kernfs write buffer for that store is a 1-byte allocation
    (kernfs_fop_write_iter() does kmalloc(len + 1) with len == 0),
    so msg[-1] is a 1-byte read before the slab object. On a
    KASAN-enabled kernel this trips an out-of-bounds report and
    panics; on stock kernels it silently reads adjacent slab data
    and, if that byte happens to be '\n', the following count--
    wraps ssize_t 0 to -1 and is then passed to kmemdup_nul().
    
    linedisp_display() is reached from the message_store() sysfs
    callback (drivers/auxdisplay/line-display.c message attribute,
    mode 0644) and from the in-tree initial-message setup with
    count == -1, so the OOB path is only userspace-triggerable via
    zero-byte writes; vfs_write() does not short-circuit on
    count == 0 and kernfs_fop_write_iter() dispatches the store
    callback regardless.
    
    Guard the trailing-newline trim with a count check. The
    existing if (!count) block then takes the clear-display path
    unchanged.
    
    Affects every auxdisplay driver that registers via
    linedisp_register() / linedisp_attach(): ht16k33, max6959,
    img-ascii-lcd, seg-led-gpio.
    
    Fixes: 7e76aece6f03 ("auxdisplay: Extract character line display core support")
    Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com>
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
batman-adv: bla: avoid double decrement of bla.num_requests [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Fri May 29 21:57:07 2026 +0200

    batman-adv: bla: avoid double decrement of bla.num_requests
    
    commit 83ab69bd12b80f6ea169c8bea6977701b53a043d upstream.
    
    The bla.num_requests is increased when no request_sent was in progress. And
    it is decremented in various places (announcement was received, backbone is
    purged, periodic work). But the check if the request_sent is actually set
    to a specific state and the atomic_dec/_inc are not safe because they are
    not atomic (TOCTOU) and multiple such code portions can run concurrently.
    
    At the same time, it is necessary to modify request_sent (state) and
    bla.num_requests atomically. Otherwise batadv_bla_send_request() might set
    request_sent to 1 and is interrupted.  batadv_handle_announce() can then
    set request_sent back to 0 and decrement num_requests before
    batadv_bla_send_request() incremented it.
    
    The two operations must therefore be locked. And since state (request_sent)
    and wait_periods are only accessed inside this lock, they can be converted
    to simpler datatypes. And to avoid that the bla.num_requests is touched by
    a parallel running context with a valid backbone_gw reference after
    batadv_bla_purge_backbone_gw() ran, a third state "stopped" is required to
    correctly signal that a backbone_gw is in the state of being cleaned up.
    
    Cc: stable@kernel.org
    Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

batman-adv: bla: avoid NULL-ptr deref for claim via dropped interface [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Fri May 29 21:57:36 2026 +0200

    batman-adv: bla: avoid NULL-ptr deref for claim via dropped interface
    
    commit f80d3d98d2ff78d9e2fe5d68b1f45948c4f7bd24 upstream.
    
    Without rtnl_lock held, a hardif might be retrieved as primary interface of
    a meshif, but then (while operating on this interface) getting decoupled
    from the mesh interface. In this case, the meshif still exists but the
    pointer from the primary hardif to the meshif is set to NULL.
    
    The mesh_iface must be checked first to be non-NULL before continuing to
    send an ARP request using meshif.
    
    Cc: stable@kernel.org
    Fixes: 23721387c409 ("batman-adv: add basic bridge loop avoidance code")
    Reported-by: Ido Schimmel <idosch@nvidia.com>
    Reported-by: syzbot+9fdcc9f05a98a540b816@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=9fdcc9f05a98a540b816
    [ switch to old "mesh_iface" name "soft_iface" ]
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

batman-adv: iv: recover OGM scheduling after forward packet error [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Fri May 29 21:56:18 2026 +0200

    batman-adv: iv: recover OGM scheduling after forward packet error
    
    commit aa3153bd139a6c48667dcd02608d3b2c80bff02c upstream.
    
    When batadv_iv_ogm_schedule_buff() fails to allocate and queue a forward
    packet for OGM transmission, the work item that drives periodic OGM
    scheduling is never re-armed. This silently halts transmission of the
    node's own OGMs on the affected interface — only OGMs from other peers
    continue to be aggregated and forwarded.
    
    Fix this by tracking whether batadv_iv_ogm_queue_add() (and transitively
    batadv_iv_ogm_aggregate_new()) successfully scheduled a forward packet.
    When scheduling fails, batadv_iv_ogm_schedule_buff() falls back to queuing
    a dedicated recovery work item (reschedule_work) that fires after one
    originator interval and calls batadv_iv_ogm_schedule() again.
    
    Cc: stable@kernel.org
    Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

batman-adv: stop tp_meter sessions during mesh teardown [+ + +]
Author: Jiexun Wang <wangjiexun2025@gmail.com>
Date:   Mon Apr 27 14:43:34 2026 +0800

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

batman-adv: tp_meter: avoid role confusion in tp_list [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Sat May 16 12:33:41 2026 +0200

    batman-adv: tp_meter: avoid role confusion in tp_list
    
    commit ff24f2ecfd94c07a2b89bac497433e3b23271cac upstream.
    
    Session lookups in tp_list matched only on destination address (and
    optionally session ID), leaving role validation to the caller. If two
    sessions with the same other_end coexisted (one as sender, one as receiver)
    a lookup could silently return the wrong one, causing the caller's role to
    bail out early, potentially skipping necessary cleanup.
    
    Move the role check into the lookup functions themselves so the correct
    entry is always returned, or none at all. Since batadv_tp_start()
    legitimately needs to detect any active session to a destination regardless
    of role, introduce a dedicated helper for that case rather than bending the
    existing lookup semantics.
    
    Cc: stable@kernel.org
    Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

batman-adv: tp_meter: directly shut down timer on cleanup [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Thu May 28 22:25:20 2026 +0200

    batman-adv: tp_meter: directly shut down timer on cleanup
    
    commit d5487249a81ea658717614009c8f46acc5b7101a upstream.
    
    batadv_tp_sender_cleanup() was calling timer_delete_sync() followed by
    timer_delete() to guard against the timer handler re-arming itself between
    the two calls. This double-deletion hack relied on the sending status being
    set to 0 to suppress re-arming.
    
    Replace both calls with a single timer_shutdown_sync(). This function both
    waits for any running timer callback to complete (like timer_delete_sync())
    and permanently disarms the timer so it cannot be re-armed afterwards,
    making re-arming prevention unconditional and self-documenting.
    
    The re-arming property is also required because otherwise:
    
    1. context 0 (batadv_tp_recv_ack()) checks in
       batadv_tp_reset_sender_timer() if sending is still 1 -> it is
    2. context 1 changes in batadv_tp_sender_shutdown() sending to 0 and in
       this process forces the kthread to stop timer in
       batadv_tp_sender_cleanup()
    3. context 0 continues in batadv_tp_reset_sender_timer() and rearms the
       timer -> but the reference for it is already gone
    
    Cc: stable@kernel.org
    Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation")
    [ adapt pre-hunk to old del_timer* names ]
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

batman-adv: tp_meter: fix race condition in send error reporting [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Wed May 13 23:38:54 2026 +0200

    batman-adv: tp_meter: fix race condition in send error reporting
    
    commit 71dce47f0758537fff78fddb5fb0d4632d29b29f upstream.
    
    batadv_tp_sender_shutdown() previously used two separate variables to track
    session state: sending (an atomic flag indicating whether the session was
    active) and reason (a plain enum storing the stop reason). This introduced
    a race window between the two writes: after sending was cleared to 0,
    batadv_tp_send() could observe the stopped state and call
    batadv_tp_sender_end() before reason was written, causing the wrong stop
    reason to be reported to the caller.
    
    Fix this by consolidating both variables into a single atomic send_result,
    which holds 0 while the session is running and the stop reason once it
    ends.
    
    Cc: stable@kernel.org
    Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

batman-adv: tp_meter: fix tp_num leak on kmalloc failure [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Wed May 6 22:20:49 2026 +0200

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

batman-adv: tp_meter: fix tp_vars reference leak in receiver shutdown [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Sun May 10 11:31:03 2026 +0200

    batman-adv: tp_meter: fix tp_vars reference leak in receiver shutdown
    
    commit 77098e4bea37af51d3962efa88a5af2ea5e1ac57 upstream.
    
    The receiver shutdown timer handler, batadv_tp_receiver_shutdown(), is
    responsible for releasing the tp_vars reference it holds. However, the
    existing logic for coordinating this release with batadv_tp_stop_all() was
    flawed.
    
    timer_shutdown_sync() guarantees the timer will not fire again after it
    returns, but it returns non-zero only when the timer was pending at the
    time of the call. If the timer had already expired (and
    batadv_tp_stop_all() would unsucessfully try to  rearm itself),
    batadv_tp_stop_all() skips its batadv_tp_vars_put(), and
    batadv_tp_receiver_shutdown() fails to put its own reference as well.
    
    Fix this by introducing a new atomic variable receiving that is set to 1
    when the receiver is initialized and cleared atomically with atomic_xchg()
    by whichever side claims it first. Only the side that observes the
    transition from 1 to 0 is responsible for releasing the tp_vars timer
    reference, eliminating the uncertainty.
    
    Cc: stable@kernel.org
    Fixes: 3d3cf6a7314a ("batman-adv: stop tp_meter sessions during mesh teardown")
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

batman-adv: tt: avoid empty VLAN responses [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Fri May 29 21:44:38 2026 +0200

    batman-adv: tt: avoid empty VLAN responses
    
    commit fa1bd704940b5bcbc32c0b28db9167405c8ee5e0 upstream.
    
    The commit 16116dac2339 ("batman-adv: prevent TT request storms by not
    sending inconsistent TT TLVLs") added checks to the local (direct) TT
    response code. But the response can also be done indirectly by another node
    using the global TT state. To avoid such inconsistency states reported in
    the original fix, also avoid sending empty VLANs for replies from the
    global TT state.
    
    Cc: stable@kernel.org
    Fixes: 7ea7b4a14275 ("batman-adv: make the TT CRC logic VLAN specific")
    [ Context, drop flex array dependency ]
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

batman-adv: tt: fix TOCTOU race for reported vlans [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Thu May 28 23:02:13 2026 +0200

    batman-adv: tt: fix TOCTOU race for reported vlans
    
    commit 94d27005016be15ffc638b2ecbc4d58805ad7b48 upstream.
    
    The local TT based TVLV is generated by first checking the number of VLANs
    which have at least one TT entry. A new buffer with the correct size for
    the VLANs is then allocated. Only then, the list of VLANs s used to fill
    the VLAN entries in the buffer. During this time, the meshif_vlan_list_lock
    is held. But the actual number of TT entries of each VLAN can still
    increase during this time - just not the number of VLANs in the list.
    
    But the prefilter used in the buffer size calculation might still cause an
    increase of the number of VLANs which need to be stored. Simply because a
    VLAN might now suddenly have at least one entry when it had none in the
    pre-alloc check - and then needs to occupy space which was not allocated.
    
    It is better to overestimate the buffer size at the beginning and then fill
    the buffer only with the VLANs which are not empty.
    
    Cc: stable@kernel.org
    Fixes: 16116dac2339 ("batman-adv: prevent TT request storms by not sending inconsistent TT TLVLs")
    [ Context, drop flex array dependency ]
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

batman-adv: tt: reject oversized local TVLV buffers [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Fri May 29 21:43:08 2026 +0200

    batman-adv: tt: reject oversized local TVLV buffers
    
    commit 1e9fab756f8395096d5bba7be0c373c4c8f5d165 upstream.
    
    The commit 3a359bf5c61d ("batman-adv: reject oversized global TT response
    buffers") added a check to ensure that a global return buffer size can be
    stored in an u16. The same buffer handling also exists for the local data
    buffer but was not touched.
    
    A similar check should be also be in place for the local TVLV buffer. It
    doesn't have the similar attack surface because it is only generated from
    locally discovered MAC addresses but the dynamic nature could still cause
    temporarily to large buffers.
    
    Cc: stable@kernel.org
    Fixes: 7ea7b4a14275 ("batman-adv: make the TT CRC logic VLAN specific")
    [ Context ]
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

batman-adv: tvlv: abort OGM send on tvlv append failure [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Thu May 28 21:51:13 2026 +0200

    batman-adv: tvlv: abort OGM send on tvlv append failure
    
    commit 501368506563e151b322c8c3f228b796e615b90d upstream.
    
    batadv_tvlv_container_ogm_append() could fail in two ways: a memory
    allocation failure when resizing the packet buffer, or the tvlv data
    exceeding U16_MAX bytes. In both cases the function previously returned the
    old (now stale) tvlv_value_len rather than signalling an error, causing the
    OGM/OGM2 send path to transmit a packet whose TVLV length field no longer
    matched the actual buffer contents. And because it also didn't fill in the
    new TVLV data, sending either uninitialized or corrupted data on the wire.
    
    All errors in batadv_tvlv_container_ogm_append() must be forwarded to the
    caller. And the caller must abort the send of the OGM2. For B.A.T.M.A.N.
    IV, it is currently not allowed to abort the send. The non-TVLV part of the
    OGM must be queued up instead.
    
    Cc: stable@kernel.org
    Fixes: ef26157747d4 ("batman-adv: tvlv - basic infrastructure")
    [ Context ]
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

batman-adv: tvlv: reject oversized TVLV packets [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Fri May 29 21:47:23 2026 +0200

    batman-adv: tvlv: reject oversized TVLV packets
    
    commit f50487e3566358b2b982b7801945e858c78ad9ab upstream.
    
    batadv_tvlv_container_ogm_append() builds a TVLV packet section from
    the tvlv.container_list. The total size of this section is computed by
    batadv_tvlv_container_list_size(), which sums the sizes of all registered
    containers.
    
    The return type and accumulator in batadv_tvlv_container_list_size() were
    u16. If the accumulated size exceeds U16_MAX, the value wraps around,
    causing the subsequent allocation in batadv_tvlv_container_ogm_append()
    to be undersized. The memcpy-style copy that follows would then write
    beyond the end of the allocated buffer, corrupting kernel memory.
    
    Fix this by widening the return type of batadv_tvlv_container_list_size()
    to size_t. In batadv_tvlv_container_ogm_append(), check the computed length
    against U16_MAX before proceeding, and bail out as if the allocation had
    failed when the limit is exceeded.
    
    Cc: stable@kernel.org
    Fixes: ef26157747d4 ("batman-adv: tvlv - basic infrastructure")
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Reviewed-by: Yuan Tan <yuantan098@gmail.com>
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

batman-adv: v: stop OGMv2 on disabled interface [+ + +]
Author: Sven Eckelmann <sven@narfation.org>
Date:   Thu May 28 21:32:39 2026 +0200

    batman-adv: v: stop OGMv2 on disabled interface
    
    commit f8ce8b8331a1bc44ad4905886a482214d428b253 upstream.
    
    When a batadv_hard_iface is disabled, its mesh_iface pointer is set to
    NULL. However, batadv_v_ogm_send_meshif() may still dispatch OGMs via
    batadv_v_ogm_queue_on_if() for interfaces that have since lost their
    mesh_iface association. This results in a NULL pointer dereference when
    batadv_v_ogm_queue_on_if() unconditionally calls netdev_priv() on the
    now NULL hard_iface->mesh_iface to retrieve the batadv_priv.
    
    It is necessary to ensure that the batadv_v_ogm_queue_on_if() checks that
    it is using the same mesh_iface for which batadv_v_ogm_send_meshif() was
    called.
    
    Cc: stable@kernel.org
    Fixes: 0da0035942d4 ("batman-adv: OGMv2 - add basic infrastructure")
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Reviewed-by: Yuan Tan <yuantan098@gmail.com>
    [ switch to old "mesh_iface" name "soft_iface" ]
    Signed-off-by: Sven Eckelmann <sven@narfation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
blk-cgroup: Fix NULL deref caused by blkg_policy_data being installed before init [+ + +]
Author: Tejun Heo <tj@kernel.org>
Date:   Wed Aug 16 09:56:23 2023 -1000

    blk-cgroup: Fix NULL deref caused by blkg_policy_data being installed before init
    
    commit ec14a87ee1999b19d8b7ed0fa95fea80644624ae upstream.
    
    blk-iocost sometimes causes the following crash:
    
      BUG: kernel NULL pointer dereference, address: 00000000000000e0
      ...
      RIP: 0010:_raw_spin_lock+0x17/0x30
      Code: be 01 02 00 00 e8 79 38 39 ff 31 d2 89 d0 5d c3 0f 1f 00 0f 1f 44 00 00 55 48 89 e5 65 ff 05 48 d0 34 7e b9 01 00 00 00 31 c0 <f0> 0f b1 0f 75 02 5d c3 89 c6 e8 ea 04 00 00 5d c3 0f 1f 84 00 00
      RSP: 0018:ffffc900023b3d40 EFLAGS: 00010046
      RAX: 0000000000000000 RBX: 00000000000000e0 RCX: 0000000000000001
      RDX: ffffc900023b3d20 RSI: ffffc900023b3cf0 RDI: 00000000000000e0
      RBP: ffffc900023b3d40 R08: ffffc900023b3c10 R09: 0000000000000003
      R10: 0000000000000064 R11: 000000000000000a R12: ffff888102337000
      R13: fffffffffffffff2 R14: ffff88810af408c8 R15: ffff8881070c3600
      FS:  00007faaaf364fc0(0000) GS:ffff88842fdc0000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00000000000000e0 CR3: 00000001097b1000 CR4: 0000000000350ea0
      Call Trace:
       <TASK>
       ioc_weight_write+0x13d/0x410
       cgroup_file_write+0x7a/0x130
       kernfs_fop_write_iter+0xf5/0x170
       vfs_write+0x298/0x370
       ksys_write+0x5f/0xb0
       __x64_sys_write+0x1b/0x20
       do_syscall_64+0x3d/0x80
       entry_SYSCALL_64_after_hwframe+0x46/0xb0
    
    This happens because iocg->ioc is NULL. The field is initialized by
    ioc_pd_init() and never cleared. The NULL deref is caused by
    blkcg_activate_policy() installing blkg_policy_data before initializing it.
    
    blkcg_activate_policy() was doing the following:
    
    1. Allocate pd's for all existing blkg's and install them in blkg->pd[].
    2. Initialize all pd's.
    3. Online all pd's.
    
    blkcg_activate_policy() only grabs the queue_lock and may release and
    re-acquire the lock as allocation may need to sleep. ioc_weight_write()
    grabs blkcg->lock and iterates all its blkg's. The two can race and if
    ioc_weight_write() runs during #1 or between #1 and #2, it can encounter a
    pd which is not initialized yet, leading to crash.
    
    The crash can be reproduced with the following script:
    
      #!/bin/bash
    
      echo +io > /sys/fs/cgroup/cgroup.subtree_control
      systemd-run --unit touch-sda --scope dd if=/dev/sda of=/dev/null bs=1M count=1 iflag=direct
      echo 100 > /sys/fs/cgroup/system.slice/io.weight
      bash -c "echo '8:0 enable=1' > /sys/fs/cgroup/io.cost.qos" &
      sleep .2
      echo 100 > /sys/fs/cgroup/system.slice/io.weight
    
    with the following patch applied:
    
    > diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
    > index fc49be622e05..38d671d5e10c 100644
    > --- a/block/blk-cgroup.c
    > +++ b/block/blk-cgroup.c
    > @@ -1553,6 +1553,12 @@ int blkcg_activate_policy(struct gendisk *disk, const struct blkcg_policy *pol)
    >               pd->online = false;
    >       }
    >
    > +       if (system_state == SYSTEM_RUNNING) {
    > +               spin_unlock_irq(&q->queue_lock);
    > +               ssleep(1);
    > +               spin_lock_irq(&q->queue_lock);
    > +       }
    > +
    >       /* all allocated, init in the same order */
    >       if (pol->pd_init_fn)
    >               list_for_each_entry_reverse(blkg, &q->blkg_list, q_node)
    
    I don't see a reason why all pd's should be allocated, initialized and
    onlined together. The only ordering requirement is that parent blkgs to be
    initialized and onlined before children, which is guaranteed from the
    walking order. Let's fix the bug by allocating, initializing and onlining pd
    for each blkg and holding blkcg->lock over initialization and onlining. This
    ensures that an installed blkg is always fully initialized and onlined
    removing the the race window.
    
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Reported-by: Breno Leitao <leitao@debian.org>
    Fixes: 9d179b865449 ("blkcg: Fix multiple bugs in blkcg_activate_policy()")
    Link: https://lore.kernel.org/r/ZN0p5_W-Q9mAHBVY@slm.duckdns.org
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Signed-off-by: Robert Garcia <rob_garcia@163.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Bluetooth: 6lowpan: check skb_clone() return value in send_mcast_pkt() [+ + +]
Author: Zhao Dongdong <zhaodongdong@kylinos.cn>
Date:   Tue May 26 11:21:39 2026 +0800

    Bluetooth: 6lowpan: check skb_clone() return value in send_mcast_pkt()
    
    [ Upstream commit 3c40d381ce04f9575a5d8b542898183c3b4b38dc ]
    
    The skb_clone() function can return NULL if memory allocation fails.
    send_mcast_pkt() calls skb_clone() without checking the return value, which
    can lead to a NULL pointer dereference in send_pkt() when it dereferences
    skb->data.
    Add a NULL check after skb_clone() and skip the peer if the clone fails.
    
    Fixes: 18722c247023 ("Bluetooth: Enable 6LoWPAN support for BT LE devices")
    Signed-off-by: Zhao Dongdong <zhaodongdong@kylinos.cn>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: bnep: fix incorrect length parsing in bnep_rx_frame() extension handling [+ + +]
Author: Dudu Lu <phx0fer@gmail.com>
Date:   Wed Apr 15 17:39:53 2026 +0800

    Bluetooth: bnep: fix incorrect length parsing in bnep_rx_frame() extension handling
    
    [ Upstream commit 72b8deccff17a7644e0367e1aaf1a36cfb014324 ]
    
    In bnep_rx_frame(), the BNEP_FILTER_NET_TYPE_SET and
    BNEP_FILTER_MULTI_ADDR_SET extension header parsing has two bugs:
    
    1) The 2-byte length field is read with *(u16 *)(skb->data + 1), which
       performs a native-endian read. The BNEP protocol specifies this field
       in big-endian (network byte order), and the same file correctly uses
       get_unaligned_be16() for the identical fields in
       bnep_ctrl_set_netfilter() and bnep_ctrl_set_mcfilter().
    
    2) The length is multiplied by 2, but unlike BNEP_SETUP_CONN_REQ where
       the length byte counts UUID pairs (requiring * 2 for two UUIDs per
       entry), the filter extension length field already represents the total
       data size in bytes. This is confirmed by bnep_ctrl_set_netfilter()
       which reads the same field as a byte count and divides by 4 to get
       the number of filter entries.
    
       The bogus * 2 means skb_pull advances twice as far as it should,
       either dropping valid data from the next header or causing the pull
       to fail entirely when the doubled length exceeds the remaining skb.
    
    Fix by splitting the pull into two steps: first use skb_pull_data() to
    safely pull and validate the 3-byte fixed header (ctrl type + length),
    then pull the variable-length data using the properly decoded length.
    
    Fixes: bf8b9a9cb77b ("Bluetooth: bnep: Add support to extended headers of control frames")
    Signed-off-by: Dudu Lu <phx0fer@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: bnep: reject short frames before parsing [+ + +]
Author: Zhang Cen <rollkingzzc@gmail.com>
Date:   Fri May 29 11:22:09 2026 +0800

    Bluetooth: bnep: reject short frames before parsing
    
    [ Upstream commit 6770d3a8acdf9151769180cc3710346c4cfbe6f0 ]
    
    A BNEP peer can send a short BNEP SDU. bnep_rx_frame() reads the
    packet type byte immediately and, for control packets, reads the control
    opcode and setup UUID-size byte before proving that those bytes are
    present. bnep_rx_control() also dereferences the control opcode without
    rejecting an empty control payload.
    
    Use skb_pull_data() for the fixed fields in bnep_rx_frame() so a NULL
    return gates each dereference. Split the control handler so the frame
    path can pass an opcode that has already been pulled, and keep the
    byte-buffer wrapper for extension control payloads.
    
    For BNEP_SETUP_CONN_REQ, name the UUID-size byte before pulling the
    setup payload. struct bnep_setup_conn_req carries destination and source
    service UUIDs after that byte, each uuid_size bytes, so the parser now
    documents that tuple explicitly instead of leaving the pull length as an
    opaque multiplication.
    
    Validation reproduced this kernel report:
    KASAN slab-out-of-bounds in bnep_rx_frame.isra.0+0x130c/0x1790
    The buggy address belongs to the object at ffff88800c0f7908 which belongs
    to the cache kmalloc-8 of size 8
    The buggy address is located 0 bytes to the right of allocated 1-byte
    region [ffff88800c0f7908, ffff88800c0f7909)
    Read of size 1
    Call trace:
      dump_stack_lvl+0xb3/0x140 (?:?)
      print_address_description+0x57/0x3a0 (?:?)
      bnep_rx_frame+0x130c/0x1790 (net/bluetooth/bnep/core.c:306)
      print_report+0xb9/0x2b0 (?:?)
      __virt_addr_valid+0x1ba/0x3a0 (?:?)
      srso_alias_return_thunk+0x5/0xfbef5 (?:?)
      kasan_addr_to_slab+0x21/0x60 (?:?)
      kasan_report+0xe0/0x110 (?:?)
      process_one_work+0xfce/0x17e0 (kernel/workqueue.c:3200)
      worker_thread+0x65c/0xe40 (?:?)
      __kthread_parkme+0x184/0x230 (?:?)
      kthread+0x35e/0x470 (?:?)
      _raw_spin_unlock_irq+0x28/0x50 (?:?)
      ret_from_fork+0x586/0x870 (?:?)
      __switch_to+0x74f/0xdc0 (?:?)
      ret_from_fork_asm+0x1a/0x30 (?:?)
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Assisted-by: Codex:gpt-5.5
    Signed-off-by: Zhang Cen <rollkingzzc@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: btusb: Allow firmware re-download when version matches [+ + +]
Author: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
Date:   Thu May 21 13:25:47 2026 +0800

    Bluetooth: btusb: Allow firmware re-download when version matches
    
    commit 82855073c1081732656734b74d7d1d5e4cfd0da7 upstream.
    
    The Bluetooth host decides whether to download firmware by reading the
    controller firmware download completion flag and firmware version
    information.
    
    If a USB error occurs during the firmware download process (for example
    due to a USB disconnect), the download is aborted immediately. An
    incomplete firmware transfer does not cause the controller to set the
    download completion flag, but the firmware version information may be
    updated at an early stage of the download process.
    
    In this case, after USB reconnection, the host attempts to re-download
    the firmware because the download completion flag is not set. However,
    since the controller reports the same firmware version as the target
    firmware, the download is skipped. This ultimately results in the
    firmware not being properly updated on the controller.
    
    This change removes the restriction that skips firmware download when
    the versions are equal. It covers scenarios where the USB connection
    can be disconnected at any time and ensures that firmware download can
    be retriggered after USB reconnection, allowing the Bluetooth firmware
    to be correctly and completely updated.
    
    Fixes: 3267c884cefa ("Bluetooth: btusb: Add support for QCA ROME chipset family")
    Cc: stable@vger.kernel.org
    Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: fix memory leak in error path of hci_alloc_dev() [+ + +]
Author: Bharath Reddy <kbreddy.rpbc@gmail.com>
Date:   Mon Jun 1 08:54:26 2026 +0530

    Bluetooth: fix memory leak in error path of hci_alloc_dev()
    
    [ Upstream commit 37b3009bf5976e8ab77c8b9a9bc3bbd7ff49e37f ]
    
    Early failures in Bluetooth HCI UART configuration leak SRCU percpu
    memory.
    
    When device initialization fails before hci_register_dev() completes,
    the HCI_UNREGISTER flag is never set. As a result, when the device
    reference count reaches zero, bt_host_release() evaluates this flag as
    false and falls back to a direct kfree(hdev).
    
    Because hci_release_dev() is bypassed, the SRCU struct initialized
    early in hci_alloc_dev() is never cleaned up, resulting in a leak of
    percpu memory.
    
    Fix the leak by explicitly calling cleanup_srcu_struct() in the
    fallback (unregistered) branch of bt_host_release() before freeing
    the device.
    
    Reported-by: syzbot+535ecc844591e50588a5@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=535ecc844591e50588a5
    Tested-by: syzbot+535ecc844591e50588a5@syzkaller.appspotmail.com
    Fixes: 1d6123102e9f ("Bluetooth: hci_core: Fix use-after-free in vhci_flush()")
    Signed-off-by: Bharath Reddy <kbreddy.rpbc@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: hci_qca: Convert timeout from jiffies to ms [+ + +]
Author: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
Date:   Fri May 29 17:42:32 2026 -0400

    Bluetooth: hci_qca: Convert timeout from jiffies to ms
    
    [ Upstream commit 375ba7484132662a4a8c7547d088fb6275c00282 ]
    
    Since the timer uses jiffies as its unit rather than ms, the timeout value
    must be converted from ms to jiffies when configuring the timer. Otherwise,
    the intended 8s timeout is incorrectly set to approximately 33s.
    
    To improve readability, embed msecs_to_jiffies() directly in the macro
    definitions and drop the _MS suffix from macros that now yield jiffies
    values: MEMDUMP_TIMEOUT, FW_DOWNLOAD_TIMEOUT, IBS_DISABLE_SSR_TIMEOUT,
    CMD_TRANS_TIMEOUT, and IBS_BTSOC_TX_IDLE_TIMEOUT.
    
    IBS_WAKE_RETRANS_TIMEOUT_MS and IBS_HOST_TX_IDLE_TIMEOUT_MS are
    intentionally left unchanged. Their values are stored in the struct fields
    wake_retrans and tx_idle_delay, which hold ms values at runtime and can be
    modified via debugfs. The msecs_to_jiffies() conversion happens at each
    call site against the field value, so it cannot be embedded in the macro.
    
    Wake timer depends on commit c347ca17d62a
    
    Cc: stable@vger.kernel.org
    Fixes: d841502c79e3 ("Bluetooth: hci_qca: Collect controller memory dump during SSR")
    Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
    Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
    Signed-off-by: Shuai Zhang <shuai.zhang@oss.qualcomm.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    [ adapted to `vmalloc`-based memdump path and older `qca_serdev_shutdown(struct device *dev)` signature ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: hci_sync: reject oversized Broadcast Announcement prepend [+ + +]
Author: Yuqi Xu <xuyq21@lenovo.com>
Date:   Fri May 29 16:54:23 2026 +0800

    Bluetooth: hci_sync: reject oversized Broadcast Announcement prepend
    
    commit 5c65b96b549ea2dcfde497436bf9e048deb87758 upstream.
    
    Existing advertising instances can already hold the maximum extended
    advertising payload. When hci_adv_bcast_annoucement() prepends the
    Broadcast Announcement service data to that payload, the combined data
    may no longer fit in the temporary buffer used to rebuild the
    advertising data.
    
    Reject that case before copying the existing payload and report the
    failure through the device log. This keeps the existing advertising
    data intact and avoids overrunning the temporary buffer.
    
    Fixes: 5725bc608252 ("Bluetooth: hci_sync: Fix broadcast/PA when using an existing instance")
    Cc: stable@kernel.org
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Assisted-by: Codex:GPT-5.4
    Signed-off-by: Yuqi Xu <xuyq21@lenovo.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: HIDP: fix missing length checks in hidp_input_report() [+ + +]
Author: Muhammad Bilal <meatuni001@gmail.com>
Date:   Wed May 20 18:56:43 2026 -0400

    Bluetooth: HIDP: fix missing length checks in hidp_input_report()
    
    commit 2a3ac9ee11dbb9845f3947cef4a79dba658cf6f6 upstream.
    
    hidp_input_report() reads keyboard and mouse payload data from an skb
    without first verifying that skb->len contains enough data.
    
    hidp_recv_intr_frame() pulls the 1-byte HIDP header before dispatching
    to hidp_input_report(). If a paired device sends a truncated packet,
    the handler reads beyond the valid skb data, resulting in an
    out-of-bounds read of skb data. The OOB bytes may be interpreted as
    phantom key presses or spurious mouse movement.
    
    Replace the open-coded length tracking and pointer arithmetic with
    skb_pull_data() calls. skb_pull_data() returns NULL if the requested
    bytes are not present, eliminating the need for a manual size variable
    and the separate skb->len guard.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: Init sk_peer_* on bt_sock_alloc [+ + +]
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date:   Fri May 29 19:21:52 2026 -0400

    Bluetooth: Init sk_peer_* on bt_sock_alloc
    
    [ Upstream commit 464c702fb9374ff8f3f816f24fb7ac719dd20e1e ]
    
    This makes sure peer information is always available via sock when using
    bt_sock_alloc.
    
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Stable-dep-of: e83f5e24da74 ("Bluetooth: serialize accept_q access")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: ISO: fix UAF in iso_recv_frame [+ + +]
Author: Muhammad Bilal <meatuni001@gmail.com>
Date:   Wed May 27 04:59:17 2026 +0000

    Bluetooth: ISO: fix UAF in iso_recv_frame
    
    commit 47f23a259517abbdb8032c057a1e8a6bf3734878 upstream.
    
    iso_recv_frame reads conn->sk under iso_conn_lock but releases the lock
    before using sk, with no reference held. A concurrent iso_sock_kill()
    can free sk in that window, causing use-after-free on sk->sk_state and
    sock_queue_rcv_skb().
    
    Fix by replacing the bare pointer read with iso_sock_hold(conn), which
    calls sock_hold() while the spinlock is held, atomically elevating the
    refcount before the lock drops. Add a drop_put label so sock_put() is
    called on all exit paths where the hold succeeded.
    
    Fixes: ccf74f2390d60a2f9a75ef496d2564abb478f46a ("Bluetooth: Add BTPROTO_ISO socket type")
    Cc: stable@vger.kernel.org
    Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: ISO: serialize iso_sock_clear_timer with socket lock [+ + +]
Author: Muhammad Bilal <meatuni001@gmail.com>
Date:   Wed May 27 04:59:18 2026 +0000

    Bluetooth: ISO: serialize iso_sock_clear_timer with socket lock
    
    commit 4b5f8e608749b7e8fa386c6e4301cf9272595859 upstream.
    
    iso_sock_close() calls iso_sock_clear_timer() before acquiring
    lock_sock(sk).
    
    iso_sock_clear_timer() reads iso_pi(sk)->conn twice without the
    socket lock held:
    
        if (!iso_pi(sk)->conn)
            return;
        cancel_delayed_work(&iso_pi(sk)->conn->timeout_work);
    
    Concurrently, iso_conn_del() executes under lock_sock(sk) and calls
    iso_chan_del(), which sets iso_pi(sk)->conn to NULL and may result in
    the final reference to the connection being dropped:
    
        CPU0                         CPU1
        ----                         ----
        iso_sock_clear_timer()
          if (conn != NULL) ...      lock_sock(sk)
                                       iso_chan_del()
                                       iso_pi(sk)->conn = NULL
          cancel_delayed_work(conn)  /* NULL deref or UAF */
    
    iso_pi(sk)->conn is not stable across the unlock window, causing a
    NULL pointer dereference or use-after-free.
    
    Serialize iso_sock_clear_timer() with the socket lock by moving it
    inside lock_sock()/release_sock(), matching the pattern used in
    iso_conn_del() and all other call sites.
    
    Fixes: ccf74f2390d60a2f9a75ef496d2564abb478f46a ("Bluetooth: Add BTPROTO_ISO socket type")
    Cc: stable@vger.kernel.org
    Signed-off-by: Muhammad Bilal <meatuni001@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: l2cap: clear chan->ident on ECRED reconfiguration success [+ + +]
Author: Zhenghang Xiao <kipreyyy@gmail.com>
Date:   Tue May 26 18:51:52 2026 +0800

    Bluetooth: l2cap: clear chan->ident on ECRED reconfiguration success
    
    [ Upstream commit 00e1950716c6ed67d74777b2db286b0fa23b4be9 ]
    
    l2cap_ecred_reconf_rsp() returns early on success without clearing
    chan->ident. Every other L2CAP response handler (l2cap_ecred_conn_rsp,
    l2cap_le_connect_rsp, l2cap_config_rsp) clears chan->ident after a
    successful transaction to prevent the channel from matching subsequent
    responses with the recycled ident value.
    
    A remote attacker that completed a reconfiguration as the peer can
    replay a failure response with the stale ident, causing the kernel to
    match and destroy the already-established channel via
    l2cap_chan_del(chan, ECONNRESET).
    
    Clear chan->ident for all matching channels on success, and harden the
    failure path by using l2cap_chan_hold_unless_zero() consistent with
    other L2CAP handlers (l2cap_le_command_rej, __l2cap_get_chan_by_ident).
    
    Fixes: 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
    Signed-off-by: Zhenghang Xiao <kipreyyy@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: L2CAP: fix chan ref leak in l2cap_chan_timeout() on !conn [+ + +]
Author: Siwei Zhang <oss@fourdim.xyz>
Date:   Wed May 20 22:30:36 2026 -0400

    Bluetooth: L2CAP: fix chan ref leak in l2cap_chan_timeout() on !conn
    
    commit 9dbd84990394c51f5cee1e8871bb5ff8af5ed939 upstream.
    
    __set_chan_timer() takes a l2cap_chan reference via l2cap_chan_hold()
    before scheduling the delayed work.  The normal path in
    l2cap_chan_timeout() drops this reference with l2cap_chan_put() at the
    end, but the early return when chan->conn is NULL skips the put,
    leaking the reference.
    
    Add the missing l2cap_chan_put() before the early return.
    
    Fixes: adf0398cee86 ("Bluetooth: l2cap: fix null-ptr-deref in l2cap_chan_timeout")
    Cc: stable@vger.kernel.org
    Signed-off-by: Siwei Zhang <oss@fourdim.xyz>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: L2CAP: Fix possible crash on l2cap_ecred_conn_rsp [+ + +]
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date:   Mon May 11 12:09:42 2026 -0400

    Bluetooth: L2CAP: Fix possible crash on l2cap_ecred_conn_rsp
    
    [ Upstream commit 41c2713b204e6cb6a94587bc6bf6935107df5479 ]
    
    If dcid is received for an already-assigned destination CID the spec
    requires that both channels to be discarded, but calling l2cap_chan_del
    may invalidate the tmp cursor created by list_for_each_entry_safe and
    in fact it is the wrong procedure as the chan->dcid may be assigned
    previously it really needs to be disconnected.
    
    Calling l2cap_chan_clone directly may still lead to l2cap_chan_del so
    instead schedule l2cap_chan_timeout with delay 0 to close the channel
    asynchronously.
    
    Fixes: 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: L2CAP: reject BR/EDR signaling packets over MTUsig [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Thu May 21 10:45:17 2026 -0400

    Bluetooth: L2CAP: reject BR/EDR signaling packets over MTUsig
    
    commit dd214733544427587a95f66dbf3adff072568990 upstream.
    
    net/bluetooth/l2cap_core.c:l2cap_sig_channel() accepts BR/EDR
    signaling packets up to the channel MTU and dispatches each command
    without enforcing the signaling MTU (MTUsig). A Bluetooth BR/EDR peer
    within radio range can send a fixed-channel CID 0x0001 packet that is
    larger than MTUsig and contains many L2CAP_ECHO_REQ commands before
    pairing. In a real-radio stock-kernel run, one 681-byte signaling
    packet containing 168 zero-length ECHO_REQ commands made the target
    transmit 168 ECHO_RSP frames over about 220 ms.
    
    Impact: a Bluetooth BR/EDR peer within radio range, before pairing, can
    force 168 ECHO_RSP frames from one 681-byte fixed-channel signaling
    packet containing packed ECHO_REQ commands.
    
    Define Linux's BR/EDR signaling MTU as the spec minimum of 48 bytes and
    reject any larger signaling packet with one L2CAP_COMMAND_REJECT_RSP
    carrying L2CAP_REJ_MTU_EXCEEDED before any command is dispatched.
    
    The Bluetooth Core spec wording for MTUExceeded says the reject
    identifier shall match the first request command in the packet, and
    that packets containing only responses shall be silently discarded.
    Linux intentionally deviates from that prescription: silently
    discarding desynchronizes the peer because the remote stack never
    learns its responses were dropped, and locating the first request
    command requires walking command headers past MTUsig, i.e. processing
    bytes from a packet we have already decided is too large to process.
    We therefore always emit one reject and use the identifier from the
    first command header, a single fixed-offset byte read.
    
    The unrestricted BR/EDR signaling parser and ECHO_REQ response path both
    trace to the initial git import; no later introducing commit is
    available for a Fixes tag.
    
    Cc: stable@vger.kernel.org
    Suggested-by: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
    Link: https://lore.kernel.org/r/20260518002800.1361430-1-michael.bommarito@gmail.com
    Link: https://lore.kernel.org/r/20260520135034.1060859-1-michael.bommarito@gmail.com
    Link: https://lore.kernel.org/r/20260521000555.3712030-1-michael.bommarito@gmail.com
    Assisted-by: Claude:claude-opus-4-7
    Assisted-by: Codex:gpt-5-5-xhigh
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: L2CAP: use chan timer to close channels in cleanup_listen() [+ + +]
Author: Siwei Zhang <oss@fourdim.xyz>
Date:   Wed May 20 22:12:20 2026 -0400

    Bluetooth: L2CAP: use chan timer to close channels in cleanup_listen()
    
    commit 8c8e620467a7b51562dbcefbd1f09f288d7d710d upstream.
    
    l2cap_chan_close() removes the channel from conn->chan_l, which
    must be done under conn->lock.  cleanup_listen() runs under the
    parent sk_lock, so acquiring conn->lock would invert the
    established conn->lock -> chan->lock -> sk_lock order.
    
    Instead of calling l2cap_chan_close() directly, schedule
    l2cap_chan_timeout with delay 0 to close the channel
    asynchronously.  The timeout handler already acquires conn->lock
    and chan->lock in the correct order.
    
    The timer is only armed when chan->conn is still set: if it is
    already NULL, l2cap_conn_del() has already processed this channel
    (l2cap_chan_del + l2cap_sock_teardown_cb + l2cap_sock_close_cb),
    so there is nothing left to do.  If l2cap_conn_del() races in
    after the timer is armed, __clear_chan_timer() inside
    l2cap_chan_del() cancels it; if the timer has already fired, the
    handler returns harmlessly because chan->conn was cleared.
    
    Fixes: 3df91ea20e74 ("Bluetooth: Revert to mutexes from RCU list")
    Cc: <stable@vger.kernel.org> # 0b58004: Bluetooth: fix UAF in l2cap_sock_cleanup_listen() vs l2cap_conn_del()
    Signed-off-by: Siwei Zhang <oss@fourdim.xyz>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bluetooth: MGMT: Fix backward compatibility with userspace [+ + +]
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date:   Tue Jun 2 16:48:34 2026 -0400

    Bluetooth: MGMT: Fix backward compatibility with userspace
    
    [ Upstream commit 149324fc762c2a7acef9c26790566f81f475e51f ]
    
    bluetoothd has a bug with makes it send extra bytes as part of
    MGMT_OP_ADD_EXT_ADV_DATA which are now being checked to be the
    exact the expected length, relax this so only when the expected
    length is greater than the data length to cause an error since
    that would result in accessing invalid memory, otherwise just
    ignore the extra bytes.
    
    Link: https://lore.kernel.org/linux-bluetooth/20260602204749.210857-1-luiz.dentz@gmail.com/T/#u
    Fixes: d3f7d17960ed ("Bluetooth: MGMT: validate Add Extended Advertising Data length")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: MGMT: validate advertising TLV before type checks [+ + +]
Author: Zhang Cen <rollkingzzc@gmail.com>
Date:   Thu May 28 17:45:06 2026 +0800

    Bluetooth: MGMT: validate advertising TLV before type checks
    
    [ Upstream commit de23fb62259aa01d294f77238ae3b835eb674413 ]
    
    tlv_data_is_valid() reads each advertising data field length from
    data[i], then inspects data[i + 1] for managed EIR types before
    checking that the current field still fits inside the supplied buffer.
    
    A malformed field whose length byte is the last byte of the buffer can
    therefore make the parser read one byte past the advertising data.
    
    KASAN reported the following when a malformed MGMT_OP_ADD_ADVERTISING
    request reached that path:
    
      BUG: KASAN: vmalloc-out-of-bounds in tlv_data_is_valid()
      Read of size 1
      Call trace:
        tlv_data_is_valid()
        add_advertising()
        hci_mgmt_cmd()
        hci_sock_sendmsg()
    
    Move the existing element-length check before any type-octet inspection
    so each non-empty element is proven to contain its type byte before the
    parser looks at data[i + 1].
    
    Fixes: 2bb36870e8cb ("Bluetooth: Unify advertising instance flags check")
    Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
    Signed-off-by: Zhang Cen <rollkingzzc@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: RFCOMM: hold listener socket in rfcomm_connect_ind() [+ + +]
Author: Zhang Cen <rollkingzzc@gmail.com>
Date:   Thu May 28 15:56:41 2026 +0800

    Bluetooth: RFCOMM: hold listener socket in rfcomm_connect_ind()
    
    [ Upstream commit 43c441edacf953b39517a44f5e5e10a93618b226 ]
    
    rfcomm_get_sock_by_channel() scans rfcomm_sk_list under the list lock,
    but returns the selected listener after dropping that lock without
    taking a reference. rfcomm_connect_ind() then locks the listener,
    queues a child socket on it, and may notify it after unlocking it.
    
    The buggy scenario involves two paths, with each column showing the
    order within that path:
    
    rfcomm_connect_ind():            listener close:
      1. Find parent in              1. close() enters
         rfcomm_get_sock_by_channel()   rfcomm_sock_release().
      2. Drop rfcomm_sk_list.lock    2. rfcomm_sock_shutdown()
         without pinning parent.        closes the listener.
      3. Call lock_sock(parent) and  3. rfcomm_sock_kill()
         bt_accept_enqueue(parent,      unlinks and puts parent.
         sk, true).
      4. Read parent flags and may   4. parent can be freed.
         call sk_state_change().
    
    If close wins the race, parent can be freed before
    rfcomm_connect_ind() reaches lock_sock(), bt_accept_enqueue(), or the
    deferred-setup callback.
    
    Take a reference on the listener before leaving rfcomm_sk_list.lock.
    After lock_sock() succeeds, recheck that it is still in BT_LISTEN
    before queueing a child, cache the deferred-setup bit while the parent
    is locked, and drop the reference after the last parent use.
    
    KASAN reported a slab-use-after-free in lock_sock_nested() from
    rfcomm_connect_ind(), with the freeing stack going through
    rfcomm_sock_kill() and rfcomm_sock_release().
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Zhang Cen <rollkingzzc@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: RFCOMM: validate skb length in MCC handlers [+ + +]
Author: SeungJu Cheon <suunj1331@gmail.com>
Date:   Mon May 25 20:04:43 2026 +0900

    Bluetooth: RFCOMM: validate skb length in MCC handlers
    
    [ Upstream commit 23882b828c3c8c51d0c946446a396b10abb3b16b ]
    
    The RFCOMM MCC handlers cast skb->data to protocol-specific structs
    without validating skb->len first. A malicious remote device can send
    truncated MCC frames and trigger out-of-bounds reads in these handlers.
    
    Fix this by using skb_pull_data() to validate and access the required
    data before dereferencing it.
    
    rfcomm_recv_rpn() requires special handling since ETSI TS 07.10 allows
    1-byte RPN requests. Handle this by validating only the DLCI byte first,
    and validating the full struct only when len > 1.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Suggested-by: Muhammad Bilal <meatuni001@gmail.com>
    Signed-off-by: SeungJu Cheon <suunj1331@gmail.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: serialize accept_q access [+ + +]
Author: Jiexun Wang <wangjiexun2025@gmail.com>
Date:   Fri May 29 19:21:53 2026 -0400

    Bluetooth: serialize accept_q access
    
    [ Upstream commit e83f5e24da741fa9405aeeff00b08c5ee7c37b88 ]
    
    bt_sock_poll() walks the accept queue without synchronization, while
    child teardown can unlink the same socket and drop its last reference.
    The unsynchronized accept queue walk has existed since the initial
    Bluetooth import.
    
    Protect accept_q with a dedicated lock for queue updates and polling.
    Also rework bt_accept_dequeue() to take temporary child references under
    the queue lock before dropping it and locking the child socket.
    
    Fixes: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Reported-by: Jann Horn <jannh@google.com>
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Signed-off-by: Jiexun Wang <wangjiexun2025@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Signed-off-by: Jiexun Wang <wangjiexun2025@gmail.com>
    Reviewed-by: Jann Horn <jannh@google.com>
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
bnxt_en: Fix NULL pointer dereference [+ + +]
Author: Kyle Meyer <kyle.meyer@hpe.com>
Date:   Fri Jun 5 17:25:24 2026 -0500

    bnxt_en: Fix NULL pointer dereference
    
    commit d930276f2cddd0b7294cac7a8fe7b877f6d9e08d upstream.
    
    PCIe errors detected by a Root Port or Downstream Port cause error
    recovery services to run on all subordinate devices regardless of
    administrative state.
    
    The .error_detected() callback, bnxt_io_error_detected(), disables
    and synchronizes IRQs via bnxt_disable_int_sync(), which calls
    bnxt_cp_num_to_irq_num() to map completion rings to IRQs using
    bp->bnapi.
    
    Since bp->bnapi is allocated on NIC open and freed on NIC close, PCIe
    error recovery on a closed NIC can dereference a NULL pointer.
    
    Check if bp->bnapi is NULL before disabling and synchronizing IRQs.
    
    Fixes: e5811b8c09df ("bnxt_en: Add IRQ remapping logic.")
    Cc: stable@vger.kernel.org
    Signed-off-by: Kyle Meyer <kyle.meyer@hpe.com>
    Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
    Link: https://patch.msgid.link/aiNM1CY2-StPilxW@hpe.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
bonding: refuse to enslave CAN devices [+ + +]
Author: Oliver Hartkopp <socketcan@hartkopp.net>
Date:   Tue May 26 21:33:19 2026 +0200

    bonding: refuse to enslave CAN devices
    
    [ Upstream commit 8ba68464e4787b6a7ec938826e16124df20fd23d ]
    
    syzbot reported a kernel paging request crash in
    can_rx_unregister() inside net/can/af_can.c. The crash occurs
    because a virtual CAN device (vxcan) is being enslaved to a
    bonding master.
    
    During the enslavement process, the bonding driver mutates
    and modifies the network device states to fit an Ethernet-like
    aggregation model. However, CAN devices operate on a completely
    different Layer 2 architecture, relying on the CAN mid-layer
    private data structure (can_ml_priv) instead of standard
    Ethernet structures. Since bonding does not initialize or
    maintain these CAN structures, subsequent operations on the
    half-enslaved interface (such as closing associated sockets
    via isotp_release) lead to a null-pointer dereference when
    accessing the CAN receiver lists.
    
    Bonding CAN interfaces is architecturally invalid as CAN lacks
    MAC addresses, ARP capabilities, and standard Ethernet
    link-layer mechanisms. While generic loopback devices are
    blocked globally in net/core/dev.c, virtual CAN devices
    bypass this check because they do not carry the IFF_LOOPBACK
    flag, despite acting as local software-loopbacks.
    
    Fix this by explicitly blocking network devices of type
    ARPHRD_CAN from being enslaved at the very beginning of
    bond_enslave(). This prevents illegal state mutations,
    eliminates the resulting KASAN crashes, and avoids potential
    memory leaks from incomplete socket cleanups.
    
    As the CAN support has been added a long time after bonding
    the Fixes-tag points to the introduction of ARPHRD_CAN that
    would have needed a specific handling in bonding_main.c.
    
    Fixes: cd05acfe65ed ("[CAN]: Allocate protocol numbers for PF_CAN")
    Reported-by: syzbot+8ed98cbd0161632bce95@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=8ed98cbd0161632bce95
    Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Acked-by: Jay Vosburgh <jv@jvosburgh.net>
    Link: https://patch.msgid.link/20260526-bonding-candev-v1-1-ba1df400918a@hartkopp.net
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
bootconfig: Fix negative seeks on 32-bit with LFS enabled [+ + +]
Author: Ben Hutchings <benh@debian.org>
Date:   Sun Aug 17 16:21:46 2025 +0200

    bootconfig: Fix negative seeks on 32-bit with LFS enabled
    
    commit 729dc340a4ed1267774fc8518284e976e2210bdc upstream.
    
    Commit 26dda5769509 "tools/bootconfig: Cleanup bootconfig footer size
    calculations" replaced some expressions of type int with the
    BOOTCONFIG_FOOTER_SIZE macro, which expands to an expression of type
    size_t, which is unsigned.
    
    On 32-bit architectures with LFS enabled (i.e. off_t is 64-bit), the
    seek offset of -BOOTCONFIG_FOOTER_SIZE now turns into a positive
    value.
    
    Fix this by casting the size to off_t before negating it.
    
    Just in case someone changes BOOTCONFIG_MAGIC_LEN to have type size_t
    later, do the same thing to the seek offset of -BOOTCONFIG_MAGIC_LEN.
    
    Link: https://lore.kernel.org/all/aKHlevxeg6Y7UQrz@decadent.org.uk/
    
    Fixes: 26dda5769509 ("tools/bootconfig: Cleanup bootconfig footer size calculations")
    Signed-off-by: Ben Hutchings <benh@debian.org>
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
bpf/bonding: reject vlan+srcmac xmit_hash_policy change when XDP is loaded [+ + +]
Author: Jiayuan Chen <jiayuan.chen@shopee.com>
Date:   Fri Jun 5 14:07:44 2026 +0800

    bpf/bonding: reject vlan+srcmac xmit_hash_policy change when XDP is loaded
    
    [ Upstream commit 479d589b40b836442bbdadc3fdb37f001bb67f26 ]
    
    bond_option_mode_set() already rejects mode changes that would make a
    loaded XDP program incompatible via bond_xdp_check().  However,
    bond_option_xmit_hash_policy_set() has no such guard.
    
    For 802.3ad and balance-xor modes, bond_xdp_check() returns false when
    xmit_hash_policy is vlan+srcmac, because the 802.1q payload is usually
    absent due to hardware offload.  This means a user can:
    
    1. Attach a native XDP program to a bond in 802.3ad/balance-xor mode
       with a compatible xmit_hash_policy (e.g. layer2+3).
    2. Change xmit_hash_policy to vlan+srcmac while XDP remains loaded.
    
    This leaves bond->xdp_prog set but bond_xdp_check() now returning false
    for the same device.  When the bond is later destroyed, dev_xdp_uninstall()
    calls bond_xdp_set(dev, NULL, NULL) to remove the program, which hits
    the bond_xdp_check() guard and returns -EOPNOTSUPP, triggering:
    
    WARN_ON(dev_xdp_install(dev, mode, bpf_op, NULL, 0, NULL))
    
    Fix this by rejecting xmit_hash_policy changes to vlan+srcmac when an
    XDP program is loaded on a bond in 802.3ad or balance-xor mode.
    
    commit 39a0876d595b ("net, bonding: Disallow vlan+srcmac with XDP")
    introduced bond_xdp_check() which returns false for 802.3ad/balance-xor
    modes when xmit_hash_policy is vlan+srcmac.  The check was wired into
    bond_xdp_set() to reject XDP attachment with an incompatible policy, but
    the symmetric path -- preventing xmit_hash_policy from being changed to an
    incompatible value after XDP is already loaded -- was left unguarded in
    bond_option_xmit_hash_policy_set().
    
    Note:
    commit 094ee6017ea0 ("bonding: check xdp prog when set bond mode")
    later added a similar guard to bond_option_mode_set(), but
    bond_option_xmit_hash_policy_set() remained unprotected.
    
    Reported-by: syzbot+5a287bcdc08104bc3132@syzkaller.appspotmail.com
    Closes: https://lore.kernel.org/all/6995aff6.050a0220.2eeac1.014e.GAE@google.com/T/
    Fixes: 39a0876d595b ("net, bonding: Disallow vlan+srcmac with XDP")
    Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com>
    Link: https://patch.msgid.link/20260226080306.98766-2-jiayuan.chen@linux.dev
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Rajani Kantha <681739313@139.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
bpf: Fix a few selftest failures due to llvm18 change [+ + +]
Author: Yonghong Song <yonghong.song@linux.dev>
Date:   Tue Jun 2 21:41:17 2026 +0200

    bpf: Fix a few selftest failures due to llvm18 change
    
    [ Upstream commit b16904fd9f01b580db357ef2b1cc9e86d89576c2 ]
    
    With latest upstream llvm18, the following test cases failed:
    
      $ ./test_progs -j
      #13/2    bpf_cookie/multi_kprobe_link_api:FAIL
      #13/3    bpf_cookie/multi_kprobe_attach_api:FAIL
      #13      bpf_cookie:FAIL
      #77      fentry_fexit:FAIL
      #78/1    fentry_test/fentry:FAIL
      #78      fentry_test:FAIL
      #82/1    fexit_test/fexit:FAIL
      #82      fexit_test:FAIL
      #112/1   kprobe_multi_test/skel_api:FAIL
      #112/2   kprobe_multi_test/link_api_addrs:FAIL
      [...]
      #112     kprobe_multi_test:FAIL
      #356/17  test_global_funcs/global_func17:FAIL
      #356     test_global_funcs:FAIL
    
    Further analysis shows llvm upstream patch [1] is responsible for the above
    failures. For example, for function bpf_fentry_test7() in net/bpf/test_run.c,
    without [1], the asm code is:
    
      0000000000000400 <bpf_fentry_test7>:
         400: f3 0f 1e fa                   endbr64
         404: e8 00 00 00 00                callq   0x409 <bpf_fentry_test7+0x9>
         409: 48 89 f8                      movq    %rdi, %rax
         40c: c3                            retq
         40d: 0f 1f 00                      nopl    (%rax)
    
    ... and with [1], the asm code is:
    
      0000000000005d20 <bpf_fentry_test7.specialized.1>:
        5d20: e8 00 00 00 00                callq   0x5d25 <bpf_fentry_test7.specialized.1+0x5>
        5d25: c3                            retq
    
    ... and <bpf_fentry_test7.specialized.1> is called instead of <bpf_fentry_test7>
    and this caused test failures for #13/#77 etc. except #356.
    
    For test case #356/17, with [1] (progs/test_global_func17.c)), the main prog
    looks like:
    
      0000000000000000 <global_func17>:
           0:       b4 00 00 00 2a 00 00 00 w0 = 0x2a
           1:       95 00 00 00 00 00 00 00 exit
    
    ... which passed verification while the test itself expects a verification
    failure.
    
    Let us add 'barrier_var' style asm code in both places to prevent function
    specialization which caused selftests failure.
    
      [1] https://github.com/llvm/llvm-project/pull/72903
    
    Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/bpf/20231127050342.1945270-1-yonghong.song@linux.dev
    [ Note: The change to test_run.c conflicted and was dropped. The related
      tests are not failing anyway. ]
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

bpf: Free reuseport cBPF prog after RCU grace period. [+ + +]
Author: Kuniyuki Iwashima <kuniyu@google.com>
Date:   Sun Apr 26 01:26:43 2026 +0000

    bpf: Free reuseport cBPF prog after RCU grace period.
    
    [ Upstream commit 18fc650ccd7fe3376eca89203668cfb8268f60df ]
    
    Eulgyu Kim reported the splat below with a repro. [0]
    
    The repro sets up a UDP reuseport group with a cBPF prog and
    replaces it with a new one while another thread is sending
    a UDP packet to the group.
    
    The reuseport prog is freed by sk_reuseport_prog_free().
    bpf_prog_put() is called for "e"BPF prog to destruct through
    multiple stages while cBPF prog is freed immediately by
    bpf_release_orig_filter() and bpf_prog_free().
    
    If a reuseport prog is detached from the setsockopt() path
    (reuseport_attach_prog() or reuseport_detach_prog()),
    sk_reuseport_prog_free() is called without waiting for RCU
    readers to complete, resulting in various bugs.
    
    Let's defer freeing the reuseport cBPF prog after one RCU
    grace period.
    
    Note "e"BPF prog is safe as is unless the fast path starts
    to touch fields destroyed in bpf_prog_put_deferred() and
    __bpf_prog_put_noref().
    
    [0]:
    BUG: KASAN: vmalloc-out-of-bounds in reuseport_select_sock+0xedc/0x1220 net/core/sock_reuseport.c:596
    Read of size 4 at addr ffffc9000051e004 by task slowme/10208
    CPU: 6 UID: 1000 PID: 10208 Comm: slowme Not tainted 7.0.0-geb7ac95ff75e #32 PREEMPT(full)
    Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
    Call Trace:
     <IRQ>
     dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
     print_address_description mm/kasan/report.c:378 [inline]
     print_report+0xca/0x240 mm/kasan/report.c:482
     kasan_report+0x118/0x150 mm/kasan/report.c:595
     reuseport_select_sock+0xedc/0x1220 net/core/sock_reuseport.c:596
     udp4_lib_lookup2+0x3bc/0x950 net/ipv4/udp.c:495
     __udp4_lib_lookup+0x768/0xe20 net/ipv4/udp.c:723
     __udp4_lib_lookup_skb+0x297/0x390 net/ipv4/udp.c:752
     __udp4_lib_rcv+0x1312/0x2620 net/ipv4/udp.c:2752
     ip_protocol_deliver_rcu+0x282/0x440 net/ipv4/ip_input.c:207
     ip_local_deliver_finish+0x3bb/0x6f0 net/ipv4/ip_input.c:241
     NF_HOOK+0x30c/0x3a0 include/linux/netfilter.h:318
     NF_HOOK+0x30c/0x3a0 include/linux/netfilter.h:318
     __netif_receive_skb_one_core net/core/dev.c:6181 [inline]
     __netif_receive_skb net/core/dev.c:6294 [inline]
     process_backlog+0xaa4/0x1960 net/core/dev.c:6645
     __napi_poll+0xae/0x340 net/core/dev.c:7709
     napi_poll net/core/dev.c:7772 [inline]
     net_rx_action+0x5d7/0xf50 net/core/dev.c:7929
     handle_softirqs+0x22b/0x870 kernel/softirq.c:622
     do_softirq+0x76/0xd0 kernel/softirq.c:523
     </IRQ>
     <TASK>
     __local_bh_enable_ip+0xf8/0x130 kernel/softirq.c:450
     local_bh_enable include/linux/bottom_half.h:33 [inline]
     rcu_read_unlock_bh include/linux/rcupdate.h:924 [inline]
     __dev_queue_xmit+0x1dd7/0x3710 net/core/dev.c:4890
     neigh_output include/net/neighbour.h:556 [inline]
     ip_finish_output2+0xca9/0x1070 net/ipv4/ip_output.c:237
     NF_HOOK_COND include/linux/netfilter.h:307 [inline]
     ip_output+0x29f/0x450 net/ipv4/ip_output.c:438
     ip_send_skb+0x45/0xc0 net/ipv4/ip_output.c:1508
     udp_send_skb+0xb04/0x1510 net/ipv4/udp.c:1195
     udp_sendmsg+0x1a71/0x2350 net/ipv4/udp.c:1485
     sock_sendmsg_nosec net/socket.c:727 [inline]
     __sock_sendmsg net/socket.c:742 [inline]
     __sys_sendto+0x554/0x680 net/socket.c:2206
     __do_sys_sendto net/socket.c:2213 [inline]
     __se_sys_sendto net/socket.c:2209 [inline]
     __x64_sys_sendto+0xde/0x100 net/socket.c:2209
     do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
     do_syscall_64+0x160/0xf80 arch/x86/entry/syscall_64.c:94
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    RIP: 0033:0x415a2d
    Code: b3 66 2e 0f 1f 84 00 00 00 00 00 66 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
    RSP: 002b:00007f6bc31e41e8 EFLAGS: 00000212 ORIG_RAX: 000000000000002c
    RAX: ffffffffffffffda RBX: 00007f6bc31e4cdc RCX: 0000000000415a2d
    RDX: 0000000000000001 RSI: 00007f6bc31e421f RDI: 0000000000000003
    RBP: 00007f6bc31e4240 R08: 00007f6bc31e4220 R09: 0000000000000010
    R10: 0000000000000000 R11: 0000000000000212 R12: 00007f6bc31e46c0
    R13: ffffffffffffffb8 R14: 0000000000000000 R15: 00007ffc9b0d70b0
     </TASK>
    
    Fixes: 538950a1b752 ("soreuseport: setsockopt SO_ATTACH_REUSEPORT_[CE]BPF")
    Reported-by: Eulgyu Kim <eulgyukim@snu.ac.kr>
    Reported-by: Taeyang Lee <0wn@theori.io>
    Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/bpf/20260426012647.3233119-1-kuniyu@google.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

bpf: sockmap: fix tail fragment offset in bpf_msg_push_data [+ + +]
Author: Yuqi Xu <xuyq21@lenovo.com>
Date:   Wed May 27 11:48:15 2026 +0800

    bpf: sockmap: fix tail fragment offset in bpf_msg_push_data
    
    commit f72eed9b84fb771019a955908132410a9ba9ea3f upstream.
    
    When bpf_msg_push_data() inserts data in the middle of a scatterlist
    entry, it splits the original entry into a left fragment and a right
    fragment.
    
    The right fragment offset is page-local, but the code advances it with
    `start`, which is the message-global insertion point. For inserts into a
    non-first SG entry, this over-advances the offset and leaves the split
    layout inconsistent.
    
    Advance the right fragment offset by the fragment-local delta,
    `start - offset`, which matches the length removed from the front of the
    original entry.
    
    Fixes: 6fff607e2f14 ("bpf: sk_msg program helper bpf_msg_push_data")
    Cc: stable@kernel.org
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Signed-off-by: Yuqi Xu <xuyq21@lenovo.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Link: https://patch.msgid.link/8b129d10566aa3eb43f61a8f9757bcf51707d324.1779636774.git.xuyq21@lenovo.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
btrfs: fix btrfs_ioctl_space_info() slot_count TOCTOU which can lead to info-leak [+ + +]
Author: Yochai Eisenrich <yochaie@sweet.security>
Date:   Fri May 15 08:15:04 2026 -0400

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

btrfs: fix double free in create_space_info_sub_group() error path [+ + +]
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Fri May 15 11:07:28 2026 -0400

    btrfs: fix double free in create_space_info_sub_group() error path
    
    [ Upstream commit a7449edf96143f192606ec8647e3167e1ecbd728 ]
    
    When kobject_init_and_add() fails, the call chain is:
    
    create_space_info_sub_group()
    -> btrfs_sysfs_add_space_info_type()
    -> kobject_init_and_add()
    -> failure
    -> kobject_put(&sub_group->kobj)
    -> space_info_release()
    -> kfree(sub_group)
    
    Then control returns to create_space_info_sub_group(), where:
    
    btrfs_sysfs_add_space_info_type() returns error
    -> kfree(sub_group)
    
    Thus, sub_group is freed twice.
    
    Keep parent->sub_group[index] = NULL for the failure path, but after
    btrfs_sysfs_add_space_info_type() has called kobject_put(), let the
    kobject release callback handle the cleanup.
    
    Fixes: f92ee31e031c ("btrfs: introduce btrfs_space_info sub-group")
    CC: stable@vger.kernel.org # 6.18+
    Reviewed-by: Qu Wenruo <wqu@suse.com>
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

btrfs: fix missing last_unlink_trans update when removing a directory [+ + +]
Author: Filipe Manana <fdmanana@suse.com>
Date:   Sun May 17 11:52:35 2026 -0400

    btrfs: fix missing last_unlink_trans update when removing a directory
    
    [ Upstream commit 999757231c49376cd1a37308d2c8c4c9932571e1 ]
    
    When removing a directory we are not updating its last_unlink_trans field,
    which can result in incorrect fsync behaviour in case some one fsyncs the
    directory after it was removed because it's holding a file descriptor on
    it.
    
    Example scenario:
    
       mkdir /mnt/dir1
       mkdir /mnt/dir1/dir2
       mkdir /mnt/dir3
    
       sync -f /mnt
    
       # Do some change to the directory and fsync it.
       chmod 700 /mnt/dir1
       xfs_io -c fsync /mnt/dir1
    
       # Move dir2 out of dir1 so that dir1 becomes empty.
       mv /mnt/dir1/dir2 /mnt/dir3/
    
       open fd on /mnt/dir1
       call rmdir(2) on path "/mnt/dir1"
       fsync fd
    
       <trigger power failure>
    
    When attempting to mount the filesystem, the log replay will fail with
    an -EIO error and dmesg/syslog has the following:
    
       [445771.626482] BTRFS info (device dm-0): first mount of filesystem 0368bbea-6c5e-44b5-b409-09abe496e650
       [445771.626486] BTRFS info (device dm-0): using crc32c checksum algorithm
       [445771.627912] BTRFS info (device dm-0): start tree-log replay
       [445771.628335] page: refcount:2 mapcount:0 mapping:0000000061443ddc index:0x1d00 pfn:0x7072a5
       [445771.629453] memcg:ffff89f400351b00
       [445771.629892] aops:btree_aops [btrfs] ino:1
       [445771.630737] flags: 0x17fffc00000402a(uptodate|lru|private|writeback|node=0|zone=2|lastcpupid=0x1ffff)
       [445771.632359] raw: 017fffc00000402a fffff47284d950c8 fffff472907b7c08 ffff89f458e412b8
       [445771.633713] raw: 0000000000001d00 ffff89f6c51d1a90 00000002ffffffff ffff89f400351b00
       [445771.635029] page dumped because: eb page dump
       [445771.635825] BTRFS critical (device dm-0): corrupt leaf: root=5 block=30408704 slot=10 ino=258, invalid nlink: has 2 expect no more than 1 for dir
       [445771.638088] BTRFS info (device dm-0): leaf 30408704 gen 10 total ptrs 17 free space 14878 owner 5
       [445771.638091] BTRFS info (device dm-0): refs 4 lock_owner 0 current 3581087
       [445771.638094]      item 0 key (256 INODE_ITEM 0) itemoff 16123 itemsize 160
       [445771.638097]              inode generation 3 transid 9 size 16 nbytes 16384
       [445771.638098]              block group 0 mode 40755 links 1 uid 0 gid 0
       [445771.638100]              rdev 0 sequence 2 flags 0x0
       [445771.638102]              atime 1775744884.0
       [445771.660056]              ctime 1775744885.645502983
       [445771.660058]              mtime 1775744885.645502983
       [445771.660060]              otime 1775744884.0
       [445771.660062]      item 1 key (256 INODE_REF 256) itemoff 16111 itemsize 12
       [445771.660064]              index 0 name_len 2
       [445771.660066]      item 2 key (256 DIR_ITEM 1843588421) itemoff 16077 itemsize 34
       [445771.660068]              location key (259 1 0) type 2
       [445771.660070]              transid 9 data_len 0 name_len 4
       [445771.660075]      item 3 key (256 DIR_ITEM 2363071922) itemoff 16043 itemsize 34
       [445771.660076]              location key (257 1 0) type 2
       [445771.660077]              transid 9 data_len 0 name_len 4
       [445771.660078]      item 4 key (256 DIR_INDEX 2) itemoff 16009 itemsize 34
       [445771.660079]              location key (257 1 0) type 2
       [445771.660080]              transid 9 data_len 0 name_len 4
       [445771.660081]      item 5 key (256 DIR_INDEX 3) itemoff 15975 itemsize 34
       [445771.660082]              location key (259 1 0) type 2
       [445771.660083]              transid 9 data_len 0 name_len 4
       [445771.660084]      item 6 key (257 INODE_ITEM 0) itemoff 15815 itemsize 160
       [445771.660086]              inode generation 9 transid 9 size 8 nbytes 0
       [445771.660087]              block group 0 mode 40777 links 1 uid 0 gid 0
       [445771.660088]              rdev 0 sequence 2 flags 0x0
       [445771.660089]              atime 1775744885.641174097
       [445771.660090]              ctime 1775744885.645502983
       [445771.660091]              mtime 1775744885.645502983
       [445771.660105]              otime 1775744885.641174097
       [445771.660106]      item 7 key (257 INODE_REF 256) itemoff 15801 itemsize 14
       [445771.660107]              index 2 name_len 4
       [445771.660108]      item 8 key (257 DIR_ITEM 2676584006) itemoff 15767 itemsize 34
       [445771.660109]              location key (258 1 0) type 2
       [445771.660110]              transid 9 data_len 0 name_len 4
       [445771.660111]      item 9 key (257 DIR_INDEX 2) itemoff 15733 itemsize 34
       [445771.660112]              location key (258 1 0) type 2
       [445771.660113]              transid 9 data_len 0 name_len 4
       [445771.660114]      item 10 key (258 INODE_ITEM 0) itemoff 15573 itemsize 160
       [445771.660115]              inode generation 9 transid 10 size 0 nbytes 0
       [445771.660116]              block group 0 mode 40755 links 2 uid 0 gid 0
       [445771.660117]              rdev 0 sequence 0 flags 0x0
       [445771.660118]              atime 1775744885.645502983
       [445771.660119]              ctime 1775744885.645502983
       [445771.660120]              mtime 1775744885.645502983
       [445771.660121]              otime 1775744885.645502983
       [445771.660122]      item 11 key (258 INODE_REF 257) itemoff 15559 itemsize 14
       [445771.660123]              index 2 name_len 4
       [445771.660124]      item 12 key (258 INODE_REF 259) itemoff 15545 itemsize 14
       [445771.660125]              index 2 name_len 4
       [445771.660126]      item 13 key (259 INODE_ITEM 0) itemoff 15385 itemsize 160
       [445771.660127]              inode generation 9 transid 10 size 8 nbytes 0
       [445771.660128]              block group 0 mode 40755 links 1 uid 0 gid 0
       [445771.660129]              rdev 0 sequence 1 flags 0x0
       [445771.660130]              atime 1775744885.645502983
       [445771.660130]              ctime 1775744885.645502983
       [445771.660131]              mtime 1775744885.645502983
       [445771.660132]              otime 1775744885.645502983
       [445771.660133]      item 14 key (259 INODE_REF 256) itemoff 15371 itemsize 14
       [445771.660134]              index 3 name_len 4
       [445771.660135]      item 15 key (259 DIR_ITEM 2676584006) itemoff 15337 itemsize 34
       [445771.660136]              location key (258 1 0) type 2
       [445771.660137]              transid 10 data_len 0 name_len 4
       [445771.660138]      item 16 key (259 DIR_INDEX 2) itemoff 15303 itemsize 34
       [445771.660139]              location key (258 1 0) type 2
       [445771.660140]              transid 10 data_len 0 name_len 4
       [445771.660144] BTRFS error (device dm-0): block=30408704 write time tree block corruption detected
       [445771.661650] ------------[ cut here ]------------
       [445771.662358] WARNING: fs/btrfs/disk-io.c:326 at btree_csum_one_bio+0x217/0x230 [btrfs], CPU#8: mount/3581087
       [445771.663588] Modules linked in: btrfs f2fs xfs (...)
       [445771.671229] CPU: 8 UID: 0 PID: 3581087 Comm: mount Tainted: G        W           7.0.0-rc6-btrfs-next-230+ #2 PREEMPT(full)
       [445771.672575] Tainted: [W]=WARN
       [445771.672987] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014
       [445771.674460] RIP: 0010:btree_csum_one_bio+0x217/0x230 [btrfs]
       [445771.675222] Code: 89 44 24 (...)
       [445771.677364] RSP: 0018:ffffd23882247660 EFLAGS: 00010246
       [445771.678029] RAX: 0000000000000000 RBX: ffff89f6c51d1a90 RCX: 0000000000000000
       [445771.678975] RDX: 0000000000000000 RSI: 0000000000000001 RDI: ffff89f406020000
       [445771.679983] RBP: ffff89f821204000 R08: 0000000000000000 R09: 00000000ffefffff
       [445771.680905] R10: ffffd23882247448 R11: 0000000000000003 R12: ffffd23882247668
       [445771.681978] R13: ffff89f458e40fc0 R14: ffff89f737f4f500 R15: ffff89f737f4f500
       [445771.682912] FS:  00007f0447a98840(0000) GS:ffff89fb9771d000(0000) knlGS:0000000000000000
       [445771.684393] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       [445771.685230] CR2: 00007f0447bf1330 CR3: 000000017cb02002 CR4: 0000000000370ef0
       [445771.686273] Call Trace:
       [445771.686646]  <TASK>
       [445771.686969]  btrfs_submit_bbio+0x83f/0x860 [btrfs]
       [445771.687750]  ? write_one_eb+0x28f/0x340 [btrfs]
       [445771.688428]  btree_writepages+0x2e3/0x550 [btrfs]
       [445771.689180]  ? kmem_cache_alloc_noprof+0x12a/0x490
       [445771.689963]  ? alloc_extent_state+0x19/0x120 [btrfs]
       [445771.690801]  ? kmem_cache_free+0x135/0x380
       [445771.691328]  ? preempt_count_add+0x69/0xa0
       [445771.691831]  ? set_extent_bit+0x252/0x8e0 [btrfs]
       [445771.692468]  ? xas_load+0x9/0xc0
       [445771.692873]  ? xas_find+0x14d/0x1a0
       [445771.693304]  do_writepages+0xc6/0x160
       [445771.693756]  filemap_writeback+0xb8/0xe0
       [445771.694274]  btrfs_write_marked_extents+0x61/0x170 [btrfs]
       [445771.694999]  btrfs_write_and_wait_transaction+0x4e/0xc0 [btrfs]
       [445771.695818]  btrfs_commit_transaction+0x5c8/0xd10 [btrfs]
       [445771.696530]  ? kmem_cache_free+0x135/0x380
       [445771.697120]  ? release_extent_buffer+0x34/0x160 [btrfs]
       [445771.697786]  btrfs_recover_log_trees+0x7be/0x7e0 [btrfs]
       [445771.698525]  ? __pfx_replay_one_buffer+0x10/0x10 [btrfs]
       [445771.699206]  open_ctree+0x11e5/0x1810 [btrfs]
       [445771.699776]  btrfs_get_tree.cold+0xb/0x162 [btrfs]
       [445771.700463]  ? fscontext_read+0x165/0x180
       [445771.701146]  ? rw_verify_area+0x50/0x180
       [445771.701866]  vfs_get_tree+0x25/0xd0
       [445771.702491]  vfs_cmd_create+0x59/0xe0
       [445771.703125]  __do_sys_fsconfig+0x303/0x610
       [445771.703603]  do_syscall_64+0xe9/0xf20
       [445771.703974]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
       [445771.704700] RIP: 0033:0x7f0447cbd4aa
       [445771.705108] Code: 73 01 c3 (...)
       [445771.707263] RSP: 002b:00007ffc4e528318 EFLAGS: 00000246 ORIG_RAX: 00000000000001af
       [445771.708107] RAX: ffffffffffffffda RBX: 00005561585d8c20 RCX: 00007f0447cbd4aa
       [445771.708931] RDX: 0000000000000000 RSI: 0000000000000006 RDI: 0000000000000003
       [445771.709744] RBP: 00005561585d9120 R08: 0000000000000000 R09: 0000000000000000
       [445771.710674] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
       [445771.711477] R13: 00007f0447e4f580 R14: 00007f0447e5126c R15: 00007f0447e36a23
       [445771.712277]  </TASK>
       [445771.712541] ---[ end trace 0000000000000000 ]---
       [445771.713382] BTRFS error (device dm-0): error while writing out transaction: -5
       [445771.714679] BTRFS warning (device dm-0): Skipping commit of aborted transaction.
       [445771.715562] BTRFS error (device dm-0 state A): Transaction aborted (error -5)
       [445771.716459] BTRFS: error (device dm-0 state A) in cleanup_transaction:2068: errno=-5 IO failure
       [445771.717936] BTRFS error (device dm-0 state EA): failed to recover log trees with error: -5
       [445771.719681] BTRFS error (device dm-0 state EA): open_ctree failed: -5
    
    The problem is that such a fsync should have result in a fallback to a
    transaction commit, but that did not happen because through the
    btrfs_rmdir() we never update the directory's last_unlink_trans field.
    Any inode that had a link removed must have its last_unlink_trans updated
    to the ID of transaction used for the operation, otherwise fsync and log
    replay will not work correctly.
    
    btrfs_rmdir() calls btrfs_unlink_inode() and through that call chain we
    never call btrfs_record_unlink_dir() in order to update last_unlink_trans.
    However btrfs_unlink(), which is used for unlinking regular files, calls
    btrfs_record_unlink_dir() and then calls btrfs_unlink_inode(). So fix
    this by moving the call to btrfs_record_unlink_dir() from btrfs_unlink()
    to btrfs_unlink_inode().
    
    A test case for fstests will follow soon.
    
    Reported-by: Slava0135 <slava.kovalevskiy.2014@gmail.com>
    Link: https://lore.kernel.org/linux-btrfs/CAAJYhww5ov62Hm+n+tmhcL-e_4cBobg+OWogKjOJxVUXivC=MQ@mail.gmail.com/
    CC: stable@vger.kernel.org
    Signed-off-by: Filipe Manana <fdmanana@suse.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    [ wrapped dir and inode arguments with BTRFS_I() since 6.1 btrfs_rmdir() uses struct inode * instead of struct btrfs_inode * ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

btrfs: remove fs_info argument from btrfs_sysfs_add_space_info_type() [+ + +]
Author: Filipe Manana <fdmanana@suse.com>
Date:   Fri May 15 11:07:27 2026 -0400

    btrfs: remove fs_info argument from btrfs_sysfs_add_space_info_type()
    
    [ Upstream commit 771af6ff72e0ed0eb8bf97e5ae4fa5094e0c5d1d ]
    
    We don't need it since we can grab fs_info from the given space_info.
    So remove the fs_info argument.
    
    Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
    Signed-off-by: Filipe Manana <fdmanana@suse.com>
    Reviewed-by: David Sterba <dsterba@suse.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Stable-dep-of: a7449edf9614 ("btrfs: fix double free in create_space_info_sub_group() error path")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ceph: only d_add() negative dentries when they are unhashed [+ + +]
Author: Max Kellermann <max.kellermann@ionos.com>
Date:   Sat May 9 10:53:07 2026 -0400

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

 
cgroup/cpuset: Reset DL migration state on can_attach() failure [+ + +]
Author: Guopeng Zhang <zhangguopeng@kylinos.cn>
Date:   Fri May 22 16:51:17 2026 -0400

    cgroup/cpuset: Reset DL migration state on can_attach() failure
    
    [ Upstream commit 4a39eda5fdd867fc39f3c039714dd432cee00268 ]
    
    cpuset_can_attach() accumulates temporary SCHED_DEADLINE migration
    state in the destination cpuset while walking the taskset.
    
    If a later task_can_attach() or security_task_setscheduler() check
    fails, cgroup_migrate_execute() treats cpuset as the failing subsystem
    and does not call cpuset_cancel_attach() for it. The partially
    accumulated state is then left behind and can be consumed by a later
    attach, corrupting cpuset DL task accounting and pending DL bandwidth
    accounting.
    
    Reset the pending DL migration state from the common error exit when
    ret is non-zero. Successful can_attach() keeps the state for
    cpuset_attach() or cpuset_cancel_attach().
    
    Fixes: 2ef269ef1ac0 ("cgroup/cpuset: Free DL BW in case can_attach() fails")
    Cc: stable@vger.kernel.org # v6.10+
    Signed-off-by: Guopeng Zhang <zhangguopeng@kylinos.cn>
    Signed-off-by: Tejun Heo <tj@kernel.org>
    Reviewed-by: Chen Ridong <chenridong@huaweicloud.com>
    Reviewed-by: Waiman Long <longman@redhat.com>
    [ omitted upstream context line `cs->dl_bw_cpu = cpu;` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
comedi: comedi_test: fix check for valid scan_begin_src in waveform_ai_cmdtest() [+ + +]
Author: Ian Abbott <abbotti@mev.co.uk>
Date:   Wed Apr 22 17:21:19 2026 +0100

    comedi: comedi_test: fix check for valid scan_begin_src in waveform_ai_cmdtest()
    
    commit 542f5248cb481073203e0dadab5bcbd28aeae308 upstream.
    
    Commit 783ddaebd397 ("staging: comedi: comedi_test: support
    scan_begin_src == TRIG_FOLLOW") neglected to add a test that
    `scan_begin_src` has only one bit set.  The allowed values are
    `TRIG_FOLLOW` and `TRIG_TIMER`, but the code incorrectly also allows
    `TRIG_FOLLOW | TRIG_TIMER`.  Add a call to
    `comedi_check_trigger_is_unique()` to check that only one trigger source
    bit is set.
    
    Fixes: 783ddaebd397 ("staging: comedi: comedi_test: support scan_begin_src == TRIG_FOLLOW")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
    Link: https://patch.msgid.link/20260422162138.36003-1-abbotti@mev.co.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

comedi: comedi_test: Fix limiting of convert_arg in waveform_ai_cmdtest() [+ + +]
Author: Ian Abbott <abbotti@mev.co.uk>
Date:   Wed Apr 22 15:46:37 2026 +0100

    comedi: comedi_test: Fix limiting of convert_arg in waveform_ai_cmdtest()
    
    commit 8a3bee801d420be8a7a0bae4a26547b353b8fe22 upstream.
    
    The function checks and possibly modifies the description of an
    asynchronous command to be run on the analog input subdevice of a comedi
    device attached to the "comedi_test" driver, returning 0 if no
    modifications were required, or a positive value that indicates which
    step of the checking process it failed on.  Step 4 fixes up various
    argument values for various trigger sources.
    
    There are two bugs in the fixing up of the `convert_arg` value to keep
    the `scan_begin_arg` value within the range of `unsigned int` when
    `scan_begin_src` and `convert_src` both have the value `TRIG_TIMER`,
    which indicates that the corresponding `_arg` values hold a time period
    in nanoseconds.  The code also uses `scan_end_arg` which hold the number
    of "conversions" within each "scan".  The goal is to end up with the
    scan period being less than or equal to the convert period multiplied by
    the number of conversions per scan.  It intends to do that by clamping
    the `convert_arg` value to a maximum value of `UINT_MAX / scan_end_arg`
    rounded down to a multiple of 1000 (`NSEC_PER_USEC`).
    
    (The rounding from nanoseconds to microseconds is because the driver is
    modelling a device that uses a 1 MHz clock for timing.  This is partly
    because that is a more typical timing base for real hardware devices
    driven by comedi, and partly because the driver used to use `struct
    timeval` internally.)
    
    The first bug is that the code checks if `scan_begin_arg == TRIG_TIMER`
    when it should be checking if `scan_begin_src == TRIG_TIMER`.  The
    bugged check will always fail because if `scan_begin_src == TRIG_TIMER`,
    then `scan_begin_arg` will be at least 1000 (`NSEC_PER_USEC`), otherwise
    `scan_begin_src == TRIG_FOLLOW` and `scan_begin_arg` will be 0.  (N.B
    `TRIG_TIMER` is defined as `0x10`.)  The second bug is that is rounding
    the maximum value down to a multiple of 1000000000 (`NSEC_PER_SEC`)
    instead of 1000 (`NSEC_PER_USEC`), however this bug is not reached due
    to the first bug.  This patch fixes both bugs.
    
    Fixes: 783ddaebd397 ("staging: comedi: comedi_test: support scan_begin_src == TRIG_FOLLOW")
    Fixes: 5afdcad2f818 ("staging: comedi: comedi_test: limit maximum convert_arg")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
    Link: https://patch.msgid.link/20260422144637.27692-1-abbotti@mev.co.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
counter: Fix refcount leak in counter_alloc() error path [+ + +]
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Mon Apr 13 21:46:04 2026 +0800

    counter: Fix refcount leak in counter_alloc() error path
    
    commit d9eeb0ea0d2de658663bfaa9c26eccdd8fd64440 upstream.
    
    After device_initialize(), the lifetime of the embedded struct device
    is expected to be managed through the device core reference counting.
    
    In counter_alloc(), if dev_set_name() fails after device_initialize(),
    the error path removes the chrdev, frees the ID, and frees the backing
    allocation directly instead of releasing the device reference with
    put_device(). This bypasses the normal device lifetime rules and may
    leave the reference count of the embedded struct device unbalanced,
    resulting in a refcount leak.
    
    The issue was identified by a static analysis tool I developed and
    confirmed by manual review.
    
    Fix this by using put_device() in the dev_set_name() failure path and
    let counter_device_release() handle the final cleanup.
    
    Fixes: 4da08477ea1f ("counter: Set counter device name")
    Cc: stable@vger.kernel.org
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Link: https://lore.kernel.org/r/20260413134604.2861772-1-lgs201920130244@gmail.com
    Signed-off-by: William Breathitt Gray <wbg@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
crypto: caam - guard HMAC key hex dumps in hash_digest_key [+ + +]
Author: Thorsten Blum <thorsten.blum@linux.dev>
Date:   Sun May 10 10:22:50 2026 -0400

    crypto: caam - guard HMAC key hex dumps in hash_digest_key
    
    [ Upstream commit 177730a273b18e195263ed953853273e901b5064 ]
    
    Use print_hex_dump_devel() for dumping sensitive HMAC key bytes in
    hash_digest_key() to avoid leaking secrets at runtime when
    CONFIG_DYNAMIC_DEBUG is enabled.
    
    Fixes: 045e36780f11 ("crypto: caam - ahash hmac support")
    Fixes: 3f16f6c9d632 ("crypto: caam/qi2 - add support for ahash algorithms")
    Cc: stable@vger.kernel.org
    Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Linux: Disable -Wattribute-alias for clang-23 and newer [+ + +]
Author: Nathan Chancellor <nathan@kernel.org>
Date:   Sat May 16 04:34:14 2026 +0900

    Disable -Wattribute-alias for clang-23 and newer
    
    commit 175db11786bde9061db526bf1ac5107d915f5163 upstream.
    
    Clang recently added support for -Wattribute-alias [1], which results in
    the same warnings that necessitated commit bee20031772a ("disable
    -Wattribute-alias warning for SYSCALL_DEFINEx()") for GCC.
    
      kernel/time/itimer.c:325:1: error: alias and aliasee have different types 'long (unsigned int)' and 'long (typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof ((unsigned int)0), typeof (0LL)) || __builtin_types_compatible_p(typeof ((unsigned int)0), typeof (0ULL))), 0LL, 0L)))' (aka 'long (long)') [-Werror,-Wattribute-alias]
        325 | SYSCALL_DEFINE1(alarm, unsigned int, seconds)
            | ^
      include/linux/syscalls.h:225:36: note: expanded from macro 'SYSCALL_DEFINE1'
        225 | #define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
            |                                    ^
      include/linux/syscalls.h:236:2: note: expanded from macro 'SYSCALL_DEFINEx'
        236 |         __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
            |         ^
      include/linux/syscalls.h:251:18: note: expanded from macro '__SYSCALL_DEFINEx'
        251 |                 __attribute__((alias(__stringify(__se_sys##name))));    \
            |                                ^
      kernel/time/itimer.c:325:1: note: aliasee is declared here
      include/linux/syscalls.h:225:36: note: expanded from macro 'SYSCALL_DEFINE1'
        225 | #define SYSCALL_DEFINE1(name, ...) SYSCALL_DEFINEx(1, _##name, __VA_ARGS__)
            |                                    ^
      include/linux/syscalls.h:236:2: note: expanded from macro 'SYSCALL_DEFINEx'
        236 |         __SYSCALL_DEFINEx(x, sname, __VA_ARGS__)
            |         ^
      include/linux/syscalls.h:255:18: note: expanded from macro '__SYSCALL_DEFINEx'
        255 |         asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__))  \
            |                         ^
      <scratch space>:16:1: note: expanded from here
         16 | __se_sys_alarm
            | ^
    
    Disable the warnings in the same way for clang-23 and newer. Disable the
    warning about unknown warning options to avoid breaking the build for
    versions of clang-23 that do not have -Wattribute-alias, such as ones
    deployed by vendors like Android or CI systems or when bisecting LLVM
    between llvmorg-23-init and release/23.x.
    
    Cc: stable@vger.kernel.org
    Closes: https://github.com/ClangBuiltLinux/linux/issues/2163
    Link: https://github.com/llvm/llvm-project/commit/40da6920a0d71d49dfa2392b09153600b0759f5e [1]
    Link: https://patch.msgid.link/20260515-syscall-disable-attribute-alias-for-clang-v1-1-9a9d95d41df6@kernel.org
    [nathan: Drop arch/riscv hunk in older trees and address conflicts]
    Signed-off-by: Nathan Chancellor <nathan@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
dm cache policy smq: check allocation under invalidate lock [+ + +]
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Fri May 29 23:57:45 2026 +0800

    dm cache policy smq: check allocation under invalidate lock
    
    [ Upstream commit d3f0a606b9f278ece8a0df626ded9c4044071235 ]
    
    commit 2d1f7b65f5de ("dm cache policy smq: fix missing locks in
    invalidating cache blocks") added mq->lock around the destructive part of
    smq_invalidate_mapping(), but left the e->allocated check outside the
    critical section.
    
    That leaves a check-then-act race. Two concurrent invalidators can both
    observe e->allocated as true before either of them takes mq->lock. The
    first invalidator that acquires the lock removes the entry from the
    queues and hash table and then calls free_entry(), which clears
    e->allocated and puts the entry back on the free list. The second
    invalidator can then acquire mq->lock and continue with the stale result
    of the unlocked check.
    
    This can corrupt the SMQ queues or hash table by deleting an entry that
    is no longer on those structures. It can also hit the allocation check in
    free_entry() when the same entry is freed again.
    
    Move the allocation check under mq->lock so the predicate and the
    destructive operations are serialized by the same lock.
    
    Fixes: 2d1f7b65f5de ("dm cache policy smq: fix missing locks in invalidating cache blocks")
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
dmaengine: idxd: Fix not releasing workqueue on .release() [+ + +]
Author: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Date:   Mon Jun 8 17:55:10 2026 +0800

    dmaengine: idxd: Fix not releasing workqueue on .release()
    
    [ Upstream commit 3d33de353b1ff9023d5ec73b9becf80ea87af695 ]
    
    The workqueue associated with an DSA/IAA device is not released when
    the object is freed.
    
    Fixes: 47c16ac27d4c ("dmaengine: idxd: fix idxd conf_dev 'struct device' lifetime")
    Reviewed-by: Dave Jiang <dave.jiang@intel.com>
    Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
    Link: https://patch.msgid.link/20260121-idxd-fix-flr-on-kernel-queues-v3-v3-7-7ed70658a9d1@intel.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    [ Remove destroy_workqueue(idxd->wq) from the function idxd_remove() to
    avoid the workqueue is released twice. ]
    Signed-off-by: Wenshan Lan <jetlan9@163.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/amd/display: Clamp HDMI HDCP2 rx_id_list read to buffer size [+ + +]
Author: Harry Wentland <harry.wentland@amd.com>
Date:   Thu May 7 15:38:37 2026 -0400

    drm/amd/display: Clamp HDMI HDCP2 rx_id_list read to buffer size
    
    commit f0f3981c43b32cadfe373d636d9e9ca522bb3702 upstream.
    
    [Why & How]
    During HDCP 2.x repeater authentication over HDMI, the driver reads the
    sink's RxStatus register and extracts a 10-bit message size field (max
    value 1023). This value is used as the read length for the ReceiverID
    list without being clamped to the size of the destination buffer
    rx_id_list[177]. A malicious HDMI repeater could advertise a message
    size larger than the buffer, causing an out-of-bounds write during the
    I2C read.
    
    Clamp the read length in mod_hdcp_read_rx_id_list() to the size of the
    rx_id_list buffer, matching the approach already used in the DP branch.
    
    Fixes: eff682f83c9c ("drm/amd/display: Add DDC handles for HDCP2.2")
    Assisted-by: Copilot:claude-opus-4.6
    Reviewed-by: Alex Hung <alex.hung@amd.com>
    Signed-off-by: Harry Wentland <harry.wentland@amd.com>
    Signed-off-by: Ray Wu <ray.wu@amd.com>
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 229212219e4247d9486f8ba41ef087358490be09)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: Clamp VBIOS HDMI retimer register count to array size [+ + +]
Author: Harry Wentland <harry.wentland@amd.com>
Date:   Mon May 4 15:51:13 2026 -0400

    drm/amd/display: Clamp VBIOS HDMI retimer register count to array size
    
    commit fb0707ce00eef4e2d60c3020e1c0432739703e4a upstream.
    
    [Why & How]
    The VBIOS integrated info tables (v1_11 and v2_1) contain HdmiRegNum and
    Hdmi6GRegNum fields that are used as loop bounds when copying retimer I2C
    register settings into fixed-size arrays (dp*_ext_hdmi_reg_settings[9]
    and dp*_ext_hdmi_6g_reg_settings[3]). These u8 fields are not validated
    before use, so a malformed VBIOS can specify values up to 255, causing an
    out-of-bounds heap write during driver probe.
    
    Clamp each register count to the destination array size using min_t()
    before the copy loops, in both get_integrated_info_v11() and
    get_integrated_info_v2_1().
    
    Assisted-by: GitHub Copilot:claude-opus-4.6
    Reviewed-by: Alex Hung <alex.hung@amd.com>
    Signed-off-by: Harry Wentland <harry.wentland@amd.com>
    Signed-off-by: Ray Wu <ray.wu@amd.com>
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 5a7f0ef90195940c54b0f5bb85b87da55f038c69)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: Fix NULL deref and buffer over-read in SDP debugfs [+ + +]
Author: Harry Wentland <harry.wentland@amd.com>
Date:   Mon May 11 16:46:25 2026 -0400

    drm/amd/display: Fix NULL deref and buffer over-read in SDP debugfs
    
    commit adf67034b1f61f7119295208085bfd43f85f56af upstream.
    
    [Why & How]
    dp_sdp_message_debugfs_write() dereferences connector->base.state->crtc
    without checking for NULL. A connector can be connected but not bound to
    any CRTC (e.g. after hot-plug before the next atomic commit), causing a
    kernel crash when writing to the sdp_message debugfs node.
    
    The function also ignores the user-provided size argument and always
    passes 36 bytes to copy_from_user(), reading past the user buffer when
    size < 36.
    
    Fix both issues by:
    - Returning -ENODEV when connector->base.state or state->crtc is NULL
    - Clamping write_size to min(size, sizeof(data))
    
    Fixes: c7ba3653e977 ("drm/amd/display: Generic SDP message access in amdgpu")
    Assisted-by: Copilot:claude-opus-4.6
    Reviewed-by: Alex Hung <alex.hung@amd.com>
    Signed-off-by: Harry Wentland <harry.wentland@amd.com>
    Signed-off-by: Ray Wu <ray.wu@amd.com>
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 6ab4c36a522842ff70474a1c0af2e40e50fc8300)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: Reject gpio_bitshift >= 32 in bios_parser_get_gpio_pin_info() [+ + +]
Author: Harry Wentland <harry.wentland@amd.com>
Date:   Tue May 5 11:50:07 2026 -0400

    drm/amd/display: Reject gpio_bitshift >= 32 in bios_parser_get_gpio_pin_info()
    
    commit 49c3da65961fe9857c831d47fa1989084e87514a upstream.
    
    [Why & How]
    gpio_bitshift is a uint8_t read directly from the VBIOS GPIO pin table.
    If the value is >= 32, the expression "1 << gpio_bitshift" triggers
    undefined behaviour in C (shift count exceeds type width). On x86 the
    shift is silently masked to 5 bits, producing an incorrect GPIO mask
    that may cause wrong MMIO register bits to be toggled.
    
    Validate gpio_bitshift before use and return BP_RESULT_BADBIOSTABLE for
    out-of-range values.
    
    Fixes: ae79c310b1a6 ("drm/amd/display: Add DCE12 bios parser support")
    Assisted-by: Copilot:claude-opus-4.6
    Reviewed-by: Alex Hung <alex.hung@amd.com>
    Signed-off-by: Harry Wentland <harry.wentland@amd.com>
    Signed-off-by: Ray Wu <ray.wu@amd.com>
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit eadf438ab8d370b9d19acee9359918c85afeb80d)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: Use krealloc_array() in dal_vector_reserve() [+ + +]
Author: Harry Wentland <harry.wentland@amd.com>
Date:   Tue May 5 11:52:15 2026 -0400

    drm/amd/display: Use krealloc_array() in dal_vector_reserve()
    
    commit da48bc4461b8a5ebfb9264c9b191a701d8e99009 upstream.
    
    [Why & How]
    dal_vector_reserve() computes the allocation size as
    "capacity * vector->struct_size" using uint32_t arithmetic, which can
    silently wrap to a small value on overflow. This would cause krealloc to
    return a smaller buffer than expected, leading to heap overflows on
    subsequent vector appends.
    
    Replace krealloc() with krealloc_array() which performs an internal
    overflow check and returns NULL on wrap, preventing the issue.
    
    Fixes: 2004f45ef83f ("drm/amd/display: Use kernel alloc/free")
    Assisted-by: Copilot:claude-opus-4.6
    Reviewed-by: Alex Hung <alex.hung@amd.com>
    Signed-off-by: Harry Wentland <harry.wentland@amd.com>
    Signed-off-by: Ray Wu <ray.wu@amd.com>
    Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 37668568641ccc4cc1dbca4923d0a16609dd5707)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amd/pm/si: Disregard vblank time when no displays are connected [+ + +]
Author: Timur Kristóf <timur.kristof@gmail.com>
Date:   Tue May 19 10:41:54 2026 +0200

    drm/amd/pm/si: Disregard vblank time when no displays are connected
    
    commit dd4f3ee535b3b0ac027f75dbf9dc5fc88733c765 upstream.
    
    When no displays are connected, there is no vblank
    happening so the power management code shouldn't
    worry about it.
    
    This fixes a regression that caused the memory clock
    to be stuck at maximum when there were no displays
    connected to a SI GPU.
    
    Fixes: 9003a0746864 ("drm/amd/pm: Treat zero vblank time as too short in si_dpm (v3)")
    Fixes: 9d73b107a61b ("drm/amd/pm: Use pm_display_cfg in legacy DPM (v2)")
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Tested-by: Jeremy Klarenbeek <jeremy.klarenbeek99@gmail.com>
    Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 6d87e0199f7b83735b56e422d59f170a201897a8)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amdgpu: restart the CS if some parts of the VM are still invalidated [+ + +]
Author: Christian König <christian.koenig@amd.com>
Date:   Wed Feb 25 15:12:02 2026 +0100

    drm/amdgpu: restart the CS if some parts of the VM are still invalidated
    
    commit 40396ffdf6120e2380706c59e1a84d7e765a37b6 upstream.
    
    Make sure that we only submit work with full up to date VM page tables.
    
    Backport to 7.1 and older.
    
    Signed-off-by: Christian König <christian.koenig@amd.com>
    Reviewed-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
    Tested-by: Vitaly Prosyak <vitaly.prosyak@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 59720bfd8c6dbebeb8d5a7ab64241b007efd9213)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amdkfd: Check for pdd drm file first in CRIU restore path [+ + +]
Author: David Francis <David.Francis@amd.com>
Date:   Thu May 14 10:31:20 2026 -0400

    drm/amdkfd: Check for pdd drm file first in CRIU restore path
    
    commit 6842b6a4b72da9b2906ffc5ca9d846ace2c54c14 upstream.
    
    CRIU restore ioctls are meant to be called by CRIU with no
    existing drm file. There's an error path
    for if the drm file unexpectedly exists. It was positioned so
    it was missing a fput(drm_file).
    
    Do that check earlier, as soon as we have the pdd.
    
    Signed-off-by: David Francis <David.Francis@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 2bab781dac78916c5cc8de76345a4102449267d7)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amdkfd: fix NULL pointer bug in svm_range_set_attr [+ + +]
Author: Eric Huang <jinhuieric.huang@amd.com>
Date:   Thu May 7 15:51:49 2026 -0400

    drm/amdkfd: fix NULL pointer bug in svm_range_set_attr
    
    commit e984d61d92e702096058f0f828f4b2b8563b88ce upstream.
    
    The process_info could be NULL if user doesn't call kfd_ioctl_acquire_vm
    before calling kfd_ioctl_svm.
    
    Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 83a26c812e0529eb040d31a76f73e33e637243d4)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/dp: Add eDP 1.5 bit definition [+ + +]
Author: Suraj Kandpal <suraj.kandpal@intel.com>
Date:   Fri May 29 11:41:56 2026 +0300

    drm/dp: Add eDP 1.5 bit definition
    
    commit 5dfc37a6b77bf6beedbd30d70184b54e1a08ccac upstream.
    
    Add the eDP revision bit value for 1.5.
    
    Spec: eDPv1.5 Table 16-5
    Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
    Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com>
    Tested-by: Ben Kao <ben.kao@intel.com>
    Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20250206063253.2827017-2-suraj.kandpal@intel.com
    Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/hyperv: validate resolution_count and fix WIN8 fallback [+ + +]
Author: Berkant Koc <me@berkoc.com>
Date:   Tue May 19 22:08:17 2026 +0200

    drm/hyperv: validate resolution_count and fix WIN8 fallback
    
    commit 13d33b9ef67066c77c84273fac5a1d3fde3533d1 upstream.
    
    A SYNTHVID_RESOLUTION_RESPONSE with resolution_count > 64 walks past
    the supported_resolution[SYNTHVID_MAX_RESOLUTION_COUNT] array in the
    parse loop. Bound resolution_count against the array size, folded
    into the existing zero-check.
    
    When the WIN10 resolution probe fails, the caller in
    hyperv_connect_vsp() left hv->screen_*_max / preferred_* unpopulated,
    which sets mode_config.max_width / max_height to 0 and makes
    drm_internal_framebuffer_create() reject every userspace framebuffer
    with -EINVAL. The pre-WIN10 branch had the same gap for
    preferred_width / preferred_height. Use a single post-probe fallback
    guarded by screen_width_max == 0 so both paths converge on the WIN8
    defaults.
    
    Signed-off-by: Berkant Koc <me@berkoc.com>
    Assisted-by: Claude:claude-opus-4-7 berkoc-pipeline
    Fixes: 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video device")
    Cc: stable@vger.kernel.org # 5.14+
    Reviewed-by: Michael Kelley <mhklinux@outlook.com>
    Tested-by: Michael Kelley <mhklinux@outlook.com>
    Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
    Link: https://patch.msgid.link/6945b22419c7d404b4954a113de2ac9c900dba93.1779542874.git.me@berkoc.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/hyperv: validate VMBus packet size in receive callback [+ + +]
Author: Berkant Koc <me@berkoc.com>
Date:   Sat May 23 15:27:47 2026 +0200

    drm/hyperv: validate VMBus packet size in receive callback
    
    commit 7f87763f47a3c22fb50265a00619ef10f2394b18 upstream.
    
    hyperv_receive_sub() reads msg->vid_hdr.type and dispatches into one
    of four message-type branches without knowing how many bytes the host
    wrote into hv->recv_buf. The completion path then runs
    memcpy(hv->init_buf, msg, VMBUS_MAX_PACKET_SIZE), so the consumer that
    wakes on wait_for_completion_timeout() can read up to 16 KiB of
    residue from a prior message as if it were the response payload.
    
    Pass bytes_recvd into hyperv_receive_sub() and reject any packet that
    does not cover the pipe + synthvid header. A single switch on
    msg->vid_hdr.type then computes the type-specific payload size: the
    three completion-driving types (SYNTHVID_VERSION_RESPONSE,
    SYNTHVID_RESOLUTION_RESPONSE, SYNTHVID_VRAM_LOCATION_ACK) fall through
    to a shared exit that requires that size before memcpy/complete, while
    SYNTHVID_FEATURE_CHANGE validates its own payload and returns before
    reading is_dirt_needed. Unknown types are dropped.
    
    SYNTHVID_RESOLUTION_RESPONSE is variable length: the host fills
    resolution_count entries, not the full SYNTHVID_MAX_RESOLUTION_COUNT
    array. Validate the fixed prefix first so resolution_count can be
    read, bound it against the array, then require only the count-sized
    array, so the shorter responses the host actually sends are accepted.
    
    Only run the sub-handler when vmbus_recvpacket() returned success. The
    memcpy length is bytes_recvd, which is bounded by VMBUS_MAX_PACKET_SIZE
    only on a successful receive; on -ENOBUFS vmbus_recvpacket() instead
    reports the required length, which can exceed hv->recv_buf, so copying
    bytes_recvd would read and write past the 16 KiB buffers. Gating on the
    success return keeps the copy bounded. The nonzero-return path is itself
    a malformed-message case and is now logged rather than silently skipped;
    channel recovery is not attempted.
    
    Rejected packets are reported via drm_err_ratelimited() rather than
    silently dropped, matching the CoCo-hardened pattern in
    hv_kvp_onchannelcallback().
    
    Fixes: 76c56a5affeb ("drm/hyperv: Add DRM driver for hyperv synthetic video device")
    Cc: stable@vger.kernel.org # 5.14+
    Signed-off-by: Berkant Koc <me@berkoc.com>
    Assisted-by: Claude:claude-opus-4-7 berkoc-pipeline
    Reviewed-by: Michael Kelley <mhklinux@outlook.com>
    Tested-by: Michael Kelley <mhklinux@outlook.com>
    Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
    Link: https://patch.msgid.link/8200dbc199c7a9b75ac7e8af6c748d2189b5ebd5.1779542874.git.me@berkoc.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/i915/gem: Fix phys BO pread/pwrite with offset [+ + +]
Author: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Date:   Wed Jun 10 09:03:14 2026 +0300

    drm/i915/gem: Fix phys BO pread/pwrite with offset
    
    commit d21ad938398bca695a511307de38a65889e3b354 upstream.
    
    sg_page() returns struct page pointer not (void *) so the scaling
    of pread/pwrite is wrong for phys BO and wrong parts of BO would be
    accessed if non-zero offset is used.
    
    Last impacted platform with overlay or cursor planes using phys
    mapping was Gen3/945G/Lakeport.
    
    Reported-by: Matthew Wilcox (Oracle) <willy@infradead.org>
    Fixes: c6790dc22312 ("drm/i915: Wean off drm_pci_alloc/drm_pci_free")
    Cc: <stable@vger.kernel.org> # v4.5+
    Cc: Tvrtko Ursulin <tursulin@ursulin.net>
    Cc: Simona Vetter <simona@ffwll.ch>
    Cc: Jani Nikula <jani.nikula@linux.intel.com>
    Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
    Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
    Link: https://patch.msgid.link/20260610060314.26111-1-joonas.lahtinen@linux.intel.com
    (cherry picked from commit 3e49a2f85070b2fb672c1e0fdba281a4ea3aebe6)
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/i915/psr: Add defininitions for INTEL_WA_REGISTER_CAPS DPCD register [+ + +]
Author: Jouni Högander <jouni.hogander@intel.com>
Date:   Fri May 29 11:41:58 2026 +0300

    drm/i915/psr: Add defininitions for INTEL_WA_REGISTER_CAPS DPCD register
    
    commit fbceb39b536e40c2f7cc47ab42037bb7c2b7ced9 upstream.
    
    EDP specification says:
    
    "If either VSC SDP is unable to be transmitted 100 ns before the SU region,
    the Source device may optionally transmit the VSC SDP during the prior
    video scan line’s HBlank period There is a Intel specific drm dp register
    currently containing bits related how TCON can support PSR2 with SDP on
    prior line."
    
    Unfortunately many panels are having problems in implementing this. So
    there is a custom Intel specific DPCD register (INTEL_WA_REGISTER_CAPS) to
    figure out if this is properly implemented on a panel or if panel doesn't
    require that 100 ns delay before the SU region. Here are the definitions in
    this custom DPCD address:
    
    0 = Panel doesn't support SDP on prior line
    1 = Panel supports SDP on prior line
    2 = Panel doesn't have 100ns requirement
    3 = Reserved
    
    Add definitions for this new register and it's values into new header
    intel_dpcd.h.
    
    v2: add INTEL_DPCD_ prefix to definitions
    
    Bspec: 74741
    Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
    Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
    Link: https://patch.msgid.link/20260515095756.2799483-2-jouni.hogander@intel.com
    (cherry picked from commit 1da1c9294825f08f622c473480d185680c2a3b75)
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

drm/i915/psr: Apply Intel DPCD workaround when SDP on prior line used [+ + +]
Author: Jouni Högander <jouni.hogander@intel.com>
Date:   Fri May 29 11:41:55 2026 +0300

    drm/i915/psr: Apply Intel DPCD workaround when SDP on prior line used
    
    commit 4703049f768fc1c1caac754134118bee1a3af189 upstream.
    
    There is Intel specific workaround DPCD address containing workaround for
    case where SDP is on prior line. Apply this workaround according to values
    in the offset.
    
    Fixes: 61e887329e33 ("drm/i915/xelpd: Handle PSR2 SDP indication in the prior scanline")
    Cc: <stable@vger.kernel.org> # v5.15+
    Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
    Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
    Link: https://patch.msgid.link/20260515095756.2799483-4-jouni.hogander@intel.com
    (cherry picked from commit c3fe899fbeac86ea4a5ca9dd845b2cbc0da46249)
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

drm/i915/psr: Read Intel DPCD workaround register [+ + +]
Author: Jouni Högander <jouni.hogander@intel.com>
Date:   Fri May 29 11:41:57 2026 +0300

    drm/i915/psr: Read Intel DPCD workaround register
    
    commit f30bece421a4ae34359254e1dc2a187a42b6af9b upstream.
    
    Read Intel DPCD workaround register and store it into
    intel_connector->dp.psr_caps. psr_caps was chosen as currently it contains
    only PSR workaround for PSR2 SDP on prior scanline implementation.
    
    Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
    Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
    Link: https://patch.msgid.link/20260515095756.2799483-3-jouni.hogander@intel.com
    (cherry picked from commit c48ff24d0f4ab7ad696b2d35ad64ce7e049c668c)
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/i915: Fix potential UAF in TTM object purge [+ + +]
Author: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Date:   Fri May 8 14:23:51 2026 +0200

    drm/i915: Fix potential UAF in TTM object purge
    
    commit 5c4063c87a619e4df954c179d24628636f5db15f upstream.
    
    TLDR: The bo->ttm object might be changed by calling ttm_bo_validate(),
          move casting it to an i915_tt object later to actually get the right
          pointer.
    
    A user reported hitting the following bug under heavy use on DG2:
    
    [26620.095550] Oops: general protection fault, probably for non-canonical address 0xa56b6b6b6b6b6b8b: 0000 1 SMP NOPTI
    [26620.095556] CPU: 2 UID: 0 PID: 631 Comm: Xorg Not tainted 6.18.8 #1 PREEMPT(lazy)
    [26620.095558] Hardware name: ASRock B850M Steel Legend WiFi/B850M Steel Legend WiFi, BIOS 3.50 09/18/2025
    [26620.095559] RIP: 0010:i915_ttm_purge+0x84/0x100 [i915]
    [26620.095604] Code: 00 00 00 48 8d 54 24 10 48 89 e6 48 89 fb e8 83 aa ae ff 85 c0 75 6f 48 83 bb a8 01 00 00 00 74 2c 48 8b 45 78 48 85 c0 74 23 <48> 8b 78 20 48 c7 c2 ff ff ff ff 31 f6 e8 7a 73 e3 e0 48 8b 7d 78
    [26620.095605] RSP: 0018:ffffc90005fd7430 EFLAGS: 00010282
    [26620.095607] RAX: a56b6b6b6b6b6b6b RBX: ffff8881f46c3dc0 RCX: 0000000000000000
    [26620.095608] RDX: 0000000000000000 RSI: 0000000000000246 RDI: 00000000ffffffff
    [26620.095609] RBP: ffff888289610f00 R08: 0000000000000001 R09: ffff88823b022000
    [26620.095609] R10: ffff888103029b28 R11: ffff8881fc7f3800 R12: ffff88810b6150d0
    [26620.095609] R13: ffff888289610f00 R14: 0000000000000000 R15: ffff8881f46c3dc0
    [26620.095610] FS: 00007f1004d86900(0000) GS:ffff88901c858000(0000) knlGS:0000000000000000
    [26620.095611] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [26620.095611] CR2: 00007f0fdf489000 CR3: 000000035b0c1000 CR4: 0000000000750ef0
    [26620.095612] PKRU: 55555554
    [26620.095612] Call Trace:
    [26620.095615] <TASK>
    [26620.095615] i915_ttm_move+0x2b9/0x420 [i915]
    [26620.095642] ? ttm_tt_init+0x65/0x80 [ttm]
    [26620.095644] ? i915_ttm_tt_create+0xc6/0x150 [i915]
    [26620.095667] ttm_bo_handle_move_mem+0xb6/0x160 [ttm]
    [26620.095669] ttm_bo_evict+0x100/0x150 [ttm]
    [26620.095671] ? preempt_count_add+0x64/0xa0
    [26620.095673] ? _raw_spin_lock+0xe/0x30
    [26620.095675] ? _raw_spin_unlock+0xd/0x30
    [26620.095675] ? i915_gem_object_evictable+0xb7/0xd0 [i915]
    [26620.095704] ttm_bo_evict_cb+0x6e/0xd0 [ttm]
    [26620.095705] ttm_lru_walk_for_evict+0xa6/0x200 [ttm]
    [26620.095708] ttm_bo_alloc_resource+0x185/0x4f0 [ttm]
    [26620.095709] ? init_object+0x62/0xd0
    [26620.095712] ttm_bo_validate+0x7a/0x180 [ttm]
    [26620.095713] ? _raw_spin_unlock_irqrestore+0x16/0x30
    [26620.095714] __i915_ttm_get_pages+0xb0/0x170 [i915]
    [26620.095737] i915_ttm_get_pages+0x9f/0x150 [i915]
    [26620.095759] ? i915_gem_do_execbuffer+0xedc/0x2b40 [i915]
    [26620.095786] ? alloc_debug_processing+0xd0/0x100
    [26620.095787] ? _raw_spin_unlock_irqrestore+0x16/0x30
    [26620.095788] ? i915_vma_instance+0xa0/0x4e0 [i915]
    [26620.095822] __i915_gem_object_get_pages+0x2f/0x40 [i915]
    [26620.095848] i915_vma_pin_ww+0x706/0x980 [i915]
    [26620.095875] ? i915_gem_do_execbuffer+0xedc/0x2b40 [i915]
    [26620.095904] eb_validate_vmas+0x170/0xa00 [i915]
    [26620.095930] i915_gem_do_execbuffer+0x1201/0x2b40 [i915]
    [26620.095953] ? alloc_debug_processing+0xd0/0x100
    [26620.095954] ? _raw_spin_unlock_irqrestore+0x16/0x30
    [26620.095955] ? i915_gem_execbuffer2_ioctl+0xc9/0x240 [i915]
    [26620.095977] ? __wake_up_sync_key+0x32/0x50
    [26620.095979] ? i915_gem_execbuffer2_ioctl+0xc9/0x240 [i915]
    [26620.096001] ? __slab_alloc.isra.0+0x67/0xc0
    [26620.096003] i915_gem_execbuffer2_ioctl+0x11a/0x240 [i915]
    
    Results from decode_stacktrace.sh pointed to dereference of a file pointer
    field of a i915 TTM page vector container associated with an object being
    purged on eviction.  That path is taken when the object is marked as no
    longer needed.
    
    Code analysis revealed a possibility of the i915 TTM page vector container
    being replaced with a new instance inside a function that purges content
    of the object, should it be still busy.  That function is called,
    indirectly via a more general function that changes the object's placement
    and caching policy, before the problematic dereference, but still after
    a pointer to the container is captured, rendering the pointer no longer
    valid.
    
    Fix the issue by capturing the pointer to the container only after its
    potential replacement.
    
    v2: Move the container_of() inside the if block (Sebastian),
      - a simplified version of the commit description that explains briefly
        why the change is necessary (Christian).
    
    Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/14882
    Fixes: 7ae034590ceae ("drm/i915/ttm: add tt shmem backend")
    Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
    Cc: stable@vger.kernel.org # v5.17+
    Cc: Matthew Auld <matthew.auld@intel.com>
    Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Cc: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
    Cc: Christian König <christian.koenig@amd.com>
    Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
    Link: https://lore.kernel.org/r/20260508122612.469227-2-janusz.krzysztofik@linux.intel.com
    (cherry picked from commit 4462966a93eb185849b7f174f0d0de53476d00a4)
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/imx: Fix three kernel-doc warnings in dcss-scaler.c [+ + +]
Author: Yicong Hui <yiconghui@gmail.com>
Date:   Mon Apr 6 19:00:13 2026 +0100

    drm/imx: Fix three kernel-doc warnings in dcss-scaler.c
    
    [ Upstream commit ae0383e5a9a4b12d68c76c4769857def4665deff ]
    
    Fix the following W=1 kerneldoc warnings by adding the missing parameter
    descriptions for @phase0_identity and @nn_interpolation in
    dcss_scaler_filter_design() and @phase0_identity in
    dcss_scaler_gaussian_filter()
    
    Warning: drivers/gpu/drm/imx/dcss/dcss-scaler.c:173 function parameter 'phase0_identity' not described in 'dcss_scaler_gaussian_filter'
    Warning: drivers/gpu/drm/imx/dcss/dcss-scaler.c:270 function parameter 'phase0_identity' not described in 'dcss_scaler_filter_design'
    Warning: drivers/gpu/drm/imx/dcss/dcss-scaler.c:270 function parameter 'nn_interpolation' not described in 'dcss_scaler_filter_design'
    
    Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
    Signed-off-by: Yicong Hui <yiconghui@gmail.com>
    Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
    Link: https://patch.msgid.link/20260406180013.2442096-1-yiconghui@gmail.com
    Signed-off-by: Liu Ying <victor.liu@nxp.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/v3d: Reject empty multisync extension to prevent infinite loop [+ + +]
Author: Ashutosh Desai <ashutoshdesai993@gmail.com>
Date:   Wed Apr 15 05:00:00 2026 +0000

    drm/v3d: Reject empty multisync extension to prevent infinite loop
    
    commit fb44d589bf3148e13452185a6e772a7efbf2d684 upstream.
    
    v3d_get_extensions() walks a userspace-provided singly-linked list of
    ioctl extensions without any bound on the chain length. A local user
    can craft a self-referential extension (ext->next == &ext) with zero
    in_sync_count and out_sync_count, which bypasses the existing duplicate-
    extension guard:
    
        if (se->in_sync_count || se->out_sync_count)
                return -EINVAL;
    
    The guard never fires because v3d_get_multisync_post_deps() returns
    immediately when count is zero, leaving both fields at zero on every
    iteration. The result is an infinite loop in kernel context, blocking
    the calling thread and pegging a CPU core indefinitely.
    
    Fix this by rejecting a multisync extension where both in_sync_count
    and out_sync_count are zero in v3d_get_multisync_submit_deps(). An
    empty multisync carries no synchronization information and serves no
    useful purpose, so returning -EINVAL for such an extension is the
    correct defense against this attack vector.
    
    Fixes: e4165ae8304e ("drm/v3d: add multiple syncobjs support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Ashutosh Desai <ashutoshdesai993@gmail.com>
    Link: https://patch.msgid.link/20260415050000.3816128-1-ashutoshdesai993@gmail.com
    Signed-off-by: Maíra Canal <mcanal@igalia.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/vc4: fix krealloc() memory leak [+ + +]
Author: Alexander A. Klimov <grandmaster@al2klimov.de>
Date:   Sat Jun 6 14:38:10 2026 +0200

    drm/vc4: fix krealloc() memory leak
    
    [ Upstream commit 5d563a5da8717629ae72f9eadf1e0e340bd1658b ]
    
    Don't just overwrite the original pointer passed to krealloc()
    with its return value without checking latter:
    
        MEM = krealloc(MEM, SZ, GFP);
    
    If krealloc() returns NULL, that erases the pointer
    to the still allocated memory, hence leaks this memory.
    Instead, use a temporary variable, check it's not NULL
    and only then assign it to the original pointer:
    
        TMP = krealloc(MEM, SZ, GFP);
        if (!TMP) return;
        MEM = TMP;
    
    While on it, use krealloc_array().
    
    Fixes: 6d45c81d229d ("drm/vc4: Add support for branching in shader validation.")
    Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
    Signed-off-by: Maíra Canal <mcanal@igalia.com>
    Link: https://patch.msgid.link/20260606123817.37222-1-grandmaster@al2klimov.de
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm: Remove plane hsub/vsub alignment requirement for core helpers [+ + +]
Author: Carlos Eduardo Gallo Filho <gcarlos@disroot.org>
Date:   Tue Sep 26 11:15:18 2023 -0300

    drm: Remove plane hsub/vsub alignment requirement for core helpers
    
    [ Upstream commit f2f455981a34ce8ca88a41458c09494b387d344f ]
    
    The drm_format_info_plane_{height,width} functions was implemented using
    regular division for the plane size calculation, which cause issues [1][2]
    when used on contexts where the dimensions are misaligned with relation
    to the subsampling factors. So, replace the regular division by the
    DIV_ROUND_UP macro.
    
    This allows these functions to be used in more drivers, making further
    work to bring more core presence on them possible.
    
    [1] http://patchwork.freedesktop.org/patch/msgid/20170321181218.10042-3-ville.syrjala@linux.intel.com
    [2] https://patchwork.freedesktop.org/patch/msgid/20211026225105.2783797-2-imre.deak@intel.com
    
    Signed-off-by: Carlos Eduardo Gallo Filho <gcarlos@disroot.org>
    Reviewed-by: André Almeida <andrealmeid@igalia.com>
    Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230926141519.9315-2-gcarlos@disroot.org
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
erofs: fix unsigned underflow in z_erofs_lz4_handle_overlap() [+ + +]
Author: Junrui Luo <moonafterrain@outlook.com>
Date:   Sat May 9 08:26:09 2026 -0400

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

 
ethtool: eeprom: add more safeties to EEPROM Netlink fallback [+ + +]
Author: Jakub Kicinski <kuba@kernel.org>
Date:   Tue May 26 08:35:33 2026 -0700

    ethtool: eeprom: add more safeties to EEPROM Netlink fallback
    
    [ Upstream commit 67cfdd9210b99f260b3e0afeb9525e0acc7be31e ]
    
    The Netlink fallback path for reading module EEPROM
    (fallback_set_params()) validates that offset < eeprom_len,
    but does not check that offset + length stays within eeprom_len.
    The ioctl equivalent (ethtool_get_any_eeprom() in ioctl.c) has
    always enforced both bounds:
    
      if (eeprom.offset + eeprom.len > total_len)
          return -EINVAL;
    
    This could lead to surprises in both drivers and device FW.
    Add the missing offset + length validation to fallback_set_params(),
    mirroring the ioctl.
    
    Similarly - ethtool core in general, and ethtool_get_any_eeprom()
    in particular tries to zero-init all buffers passed to the drivers
    to avoid any extra work of zeroing things out. eeprom_fallback()
    uses a plain kmalloc(), change it to zalloc.
    
    Fixes: 96d971e307cc ("ethtool: Add fallback to get_module_eeprom from netlink command")
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Link: https://patch.msgid.link/20260526153533.2779187-11-kuba@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
f2fs: fix false alarm of lockdep on cp_global_sem lock [+ + +]
Author: Chao Yu <chao@kernel.org>
Date:   Wed May 20 07:29:17 2026 -0400

    f2fs: fix false alarm of lockdep on cp_global_sem lock
    
    [ Upstream commit 6a5e3de9c2bb0b691d16789a5d19e9276a09b308 ]
    
    lockdep reported a potential deadlock:
    
    a) TCMU device removal context:
     - call del_gendisk() to get q->q_usage_counter
     - call start_flush_work() to get work_completion of wb->dwork
    b) f2fs writeback context:
     - in wb_workfn(), which holds work_completion of wb->dwork
     - call f2fs_balance_fs() to get sbi->gc_lock
    c) f2fs vfs_write context:
     - call f2fs_gc() to get sbi->gc_lock
     - call f2fs_write_checkpoint() to get sbi->cp_global_sem
    d) f2fs mount context:
     - call recover_fsync_data() to get sbi->cp_global_sem
     - call f2fs_check_and_fix_write_pointer() to call blkdev_report_zones()
       that goes down to blk_mq_alloc_request and get q->q_usage_counter
    
    Original callstack is in Closes tag.
    
    However, I think this is a false alarm due to before mount returns
    successfully (context d), we can not access file therein via vfs_write
    (context c).
    
    Let's introduce per-sb cp_global_sem_key, and assign the key for
    cp_global_sem, so that lockdep can recognize cp_global_sem from
    different super block correctly.
    
    A lot of work are done by Shin'ichiro Kawasaki, thanks a lot for
    the work.
    
    Fixes: c426d99127b1 ("f2fs: Check write pointer consistency of open zones")
    Cc: stable@kernel.org
    Reported-and-tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
    Closes: https://lore.kernel.org/linux-f2fs-devel/20260218125237.3340441-1-shinichiro.kawasaki@wdc.com
    Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
    Signed-off-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
    [ re-anchored lockdep_register_key after init_f2fs_rwsem and placed lockdep_unregister_key before kfree(sbi) in f2fs_put_super instead of kill_f2fs_super ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

f2fs: fix incorrect file address mapping when inline inode is unwritten [+ + +]
Author: Yongpeng Yang <yangyongpeng@xiaomi.com>
Date:   Wed May 20 07:16:27 2026 -0400

    f2fs: fix incorrect file address mapping when inline inode is unwritten
    
    [ Upstream commit 68a0178981a0f493295afa29f8880246e561494c ]
    
    When `fileinfo->fi_flags` does not have the `FIEMAP_FLAG_SYNC` bit set
    and inline data has not been persisted yet, the physical address of the
    extent is calculated incorrectly for unwritten inline inodes.
    
    root@vm:/mnt/f2fs# dd if=/dev/zero of=data.3k bs=3k count=1
    root@vm:/mnt/f2fs# f2fs_io fiemap 0 100 data.3k
    Fiemap: offset = 0 len = 100
            logical addr.    physical addr.   length           flags
    0       0000000000000000 00000ffffffff16c 0000000000000c00 00000301
    
    This patch fixes the issue by checking if the inode's address is valid.
    If the inline inode is unwritten, set the physical address to 0 and
    mark the extent with `FIEMAP_EXTENT_UNKNOWN | FIEMAP_EXTENT_DELALLOC`
    flags.
    
    Cc: stable@kernel.org
    Fixes: 67f8cf3cee6f ("f2fs: support fiemap for inline_data")
    Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
    [ renamed `ifolio` to `ipage` in `inline_data_addr()` and `F2FS_INODE()` calls ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

f2fs: fix to do sanity check on dcc->discard_cmd_cnt conditionally [+ + +]
Author: Chao Yu <chao@kernel.org>
Date:   Fri Apr 24 09:03:33 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: stable@kernel.org
    Fixes: 2482c4325dfe ("f2fs: detect bug_on in f2fs_wait_discard_bios")
    Reported-by: syzbot+62538b67389ee582837a@syzkaller.appspotmail.com
    Closes: https://lore.kernel.org/linux-f2fs-devel/69b07d7c.050a0220.8df7.09a1.GAE@google.com
    Signed-off-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
    [ adapted `f2fs_remount` call to pass `*flags & SB_RDONLY` for the old mount API ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

f2fs: fix UAF caused by decrementing sbi->nr_pages[] in f2fs_write_end_io() [+ + +]
Author: Yongpeng Yang <yangyongpeng@xiaomi.com>
Date:   Fri Apr 24 09:33:38 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: stable@kernel.org
    Fixes: 50fa53eccf9f ("f2fs: fix to avoid broken of dnode block list")
    Reported-by: syzbot+6e4cb1cac5efc96ea0ca@syzkaller.appspotmail.com
    Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
    [ folio => page ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

f2fs: use kfree() instead of kvfree() to free some memory [+ + +]
Author: Jiazi Li <jqqlijiazi@gmail.com>
Date:   Fri Apr 24 09:03:32 2026 -0400

    f2fs: use kfree() instead of kvfree() to free some memory
    
    [ Upstream commit e9705c61b1dbe7bac9dc189de434994d8a76b191 ]
    
    options in f2fs_fill_super is alloc by kstrdup:
            options = kstrdup((const char *)data, GFP_KERNEL)
    sit_bitmap[_mir], nat_bitmap[_mir] are alloc by kmemdup:
            sit_i->sit_bitmap = kmemdup(src_bitmap, sit_bitmap_size, GFP_KERNEL);
            sit_i->sit_bitmap_mir = kmemdup(src_bitmap,
                                            sit_bitmap_size, GFP_KERNEL);
            nm_i->nat_bitmap = kmemdup(version_bitmap, nm_i->bitmap_size,
                                            GFP_KERNEL);
            nm_i->nat_bitmap_mir = kmemdup(version_bitmap, nm_i->bitmap_size,
                                            GFP_KERNEL);
    write_io is alloc by f2fs_kmalloc:
            sbi->write_io[i] = f2fs_kmalloc(sbi,
                            array_size(n, sizeof(struct f2fs_bio_info))
    
    Use kfree is more efficient.
    
    Signed-off-by: Jiazi Li <jqqlijiazi@gmail.com>
    Signed-off-by: peixuan.qiu <peixuan.qiu@transsion.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
    Stable-dep-of: 6af249c996f7 ("f2fs: fix to do sanity check on dcc->discard_cmd_cnt conditionally")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
fbcon: Avoid OOB font access if console rotation fails [+ + +]
Author: Thomas Zimmermann <tzimmermann@suse.de>
Date:   Fri May 15 07:31:45 2026 -0400

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

 
fbdev: defio: Disconnect deferred I/O from the lifetime of struct fb_info [+ + +]
Author: Thomas Zimmermann <tzimmermann@suse.de>
Date:   Tue May 5 03:31:29 2026 -0400

    fbdev: defio: Disconnect deferred I/O from the lifetime of struct fb_info
    
    [ Upstream commit 9ded47ad003f09a94b6a710b5c47f4aa5ceb7429 ]
    
    Hold state of deferred I/O in struct fb_deferred_io_state. Allocate an
    instance as part of initializing deferred I/O and remove it only after
    the final mapping has been closed. If the fb_info and the contained
    deferred I/O meanwhile goes away, clear struct fb_deferred_io_state.info
    to invalidate the mapping. Any access will then result in a SIGBUS
    signal.
    
    Fixes a long-standing problem, where a device hot-unplug happens while
    user space still has an active mapping of the graphics memory. The hot-
    unplug frees the instance of struct fb_info. Accessing the memory will
    operate on undefined state.
    
    Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
    Fixes: 60b59beafba8 ("fbdev: mm: Deferred IO support")
    Cc: Helge Deller <deller@gmx.de>
    Cc: linux-fbdev@vger.kernel.org
    Cc: dri-devel@lists.freedesktop.org
    Cc: stable@vger.kernel.org # v2.6.22+
    Signed-off-by: Helge Deller <deller@gmx.de>
    [ context + _obj() conversion ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

fbdev: vt8500lcdfb: Fix dma_free_coherent() cpu_addr parameter [+ + +]
Author: Ben Hutchings <benh@debian.org>
Date:   Thu May 28 14:59:37 2026 +0200

    fbdev: vt8500lcdfb: Fix dma_free_coherent() cpu_addr parameter
    
    Before commit 63a11adaceb8 "fbdev/vt8500lcdfb: Initialize fb_ops with
    fbdev macros", the virtual address of the screen buffer was stored in
    the fb_info::screen_base field and not fb_info::screen_buffer.  The
    backport of commit 88b3b9924337 ("fbdev: vt8500lcdfb: fix missing
    dma_free_coherent()") did not take that into account.
    
    Change the cpu_addr parameter to dma_free_coherent() accordingly.
    
    Fixes: 778f31be5b8c ("fbdev: vt8500lcdfb: fix missing dma_free_coherent()")
    Signed-off-by: Ben Hutchings <benh@debian.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
fs/fcntl: fix SOFTIRQ-unsafe lock order in fasync signaling [+ + +]
Author: Mingyu Wang <25181214217@stu.xidian.edu.cn>
Date:   Sat May 23 21:52:10 2026 +0800

    fs/fcntl: fix SOFTIRQ-unsafe lock order in fasync signaling
    
    commit 00633c4683828acd5256fa8d5163f440d74bbe71 upstream.
    
    A SOFTIRQ-safe to SOFTIRQ-unsafe lock order deadlock can occur in
    send_sigio() and send_sigurg() when a process group receives a signal.
    
    When FASYNC is configured for a process group (PIDTYPE_PGID), both
    functions use read_lock(&tasklist_lock) to traverse the task list.
    However, they are frequently called from softirq context:
    - send_sigio() via input_inject_event -> kill_fasync
    - send_sigurg() via tcp_check_urg -> sk_send_sigurg (NET_RX_SOFTIRQ)
    
    The deadlock is caused by the rwlock writer fairness mechanism:
    1. CPU 0 (process context) holds read_lock(&tasklist_lock) in do_wait().
    2. CPU 1 (process context) attempts write_lock(&tasklist_lock) in
       fork() or exit() and spins, which blocks all new readers.
    3. CPU 0 is interrupted by a softirq (e.g., TCP URG packet reception).
    4. The softirq calls send_sigurg() and attempts to acquire
       read_lock(&tasklist_lock), deadlocking because CPU 1 is waiting.
    
    Since PID hashing and do_each_pid_task() traversals are already
    RCU-protected, the read_lock on tasklist_lock is no longer strictly
    required for safe traversal. Fix this by replacing tasklist_lock with
    rcu_read_lock(), aligning the process group signaling path with the
    single-PID path. This also mitigates a potential remote denial of
    service vector via TCP URG packets.
    
    Lockdep splat:
    =====================================================
    WARNING: SOFTIRQ-safe -> SOFTIRQ-unsafe lock order detected
    [...]
    Chain exists of:
      &dev->event_lock --> &f_owner->lock --> tasklist_lock
    
    Possible interrupt unsafe locking scenario:
           CPU0                    CPU1
           ----                    ----
      lock(tasklist_lock);
                               local_irq_disable();
                               lock(&dev->event_lock);
                               lock(&f_owner->lock);
      <Interrupt>
        lock(&dev->event_lock);
    
    *** DEADLOCK ***
    
    Reviewed-by: Jeff Layton <jlayton@kernel.org>
    Signed-off-by: Mingyu Wang <25181214217@stu.xidian.edu.cn>
    Link: https://patch.msgid.link/20260523135210.590928-1-w15303746062@163.com
    Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
fs/ntfs3: Return error for inconsistent extended attributes [+ + +]
Author: Edward Lo <loyuantsung@gmail.com>
Date:   Fri Mar 17 18:23:03 2023 +0800

    fs/ntfs3: Return error for inconsistent extended attributes
    
    [ Upstream commit c9db0ff04649aa0b45f497183c957fe260f229f6 ]
    
    ntfs_read_ea is called when we want to read extended attributes. There
    are some sanity checks for the validity of the EAs. However, it fails to
    return a proper error code for the inconsistent attributes, which might
    lead to unpredicted memory accesses after return.
    
    [  138.916927] BUG: KASAN: use-after-free in ntfs_set_ea+0x453/0xbf0
    [  138.923876] Write of size 4 at addr ffff88800205cfac by task poc/199
    [  138.931132]
    [  138.933016] CPU: 0 PID: 199 Comm: poc Not tainted 6.2.0-rc1+ #4
    [  138.938070] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014
    [  138.947327] Call Trace:
    [  138.949557]  <TASK>
    [  138.951539]  dump_stack_lvl+0x4d/0x67
    [  138.956834]  print_report+0x16f/0x4a6
    [  138.960798]  ? ntfs_set_ea+0x453/0xbf0
    [  138.964437]  ? kasan_complete_mode_report_info+0x7d/0x200
    [  138.969793]  ? ntfs_set_ea+0x453/0xbf0
    [  138.973523]  kasan_report+0xb8/0x140
    [  138.976740]  ? ntfs_set_ea+0x453/0xbf0
    [  138.980578]  __asan_store4+0x76/0xa0
    [  138.984669]  ntfs_set_ea+0x453/0xbf0
    [  138.988115]  ? __pfx_ntfs_set_ea+0x10/0x10
    [  138.993390]  ? kernel_text_address+0xd3/0xe0
    [  138.998270]  ? __kernel_text_address+0x16/0x50
    [  139.002121]  ? unwind_get_return_address+0x3e/0x60
    [  139.005659]  ? __pfx_stack_trace_consume_entry+0x10/0x10
    [  139.010177]  ? arch_stack_walk+0xa2/0x100
    [  139.013657]  ? filter_irq_stacks+0x27/0x80
    [  139.017018]  ntfs_setxattr+0x405/0x440
    [  139.022151]  ? __pfx_ntfs_setxattr+0x10/0x10
    [  139.026569]  ? kvmalloc_node+0x2d/0x120
    [  139.030329]  ? kasan_save_stack+0x41/0x60
    [  139.033883]  ? kasan_save_stack+0x2a/0x60
    [  139.037338]  ? kasan_set_track+0x29/0x40
    [  139.040163]  ? kasan_save_alloc_info+0x1f/0x30
    [  139.043588]  ? __kasan_kmalloc+0x8b/0xa0
    [  139.047255]  ? __kmalloc_node+0x68/0x150
    [  139.051264]  ? kvmalloc_node+0x2d/0x120
    [  139.055301]  ? vmemdup_user+0x2b/0xa0
    [  139.058584]  __vfs_setxattr+0x121/0x170
    [  139.062617]  ? __pfx___vfs_setxattr+0x10/0x10
    [  139.066282]  __vfs_setxattr_noperm+0x97/0x300
    [  139.070061]  __vfs_setxattr_locked+0x145/0x170
    [  139.073580]  vfs_setxattr+0x137/0x2a0
    [  139.076641]  ? __pfx_vfs_setxattr+0x10/0x10
    [  139.080223]  ? __kasan_check_write+0x18/0x20
    [  139.084234]  do_setxattr+0xce/0x150
    [  139.087768]  setxattr+0x126/0x140
    [  139.091250]  ? __pfx_setxattr+0x10/0x10
    [  139.094948]  ? __virt_addr_valid+0xcb/0x140
    [  139.097838]  ? __call_rcu_common.constprop.0+0x1c7/0x330
    [  139.102688]  ? debug_smp_processor_id+0x1b/0x30
    [  139.105985]  ? kasan_quarantine_put+0x5b/0x190
    [  139.109980]  ? putname+0x84/0xa0
    [  139.113886]  ? __kasan_slab_free+0x11e/0x1b0
    [  139.117961]  ? putname+0x84/0xa0
    [  139.121316]  ? preempt_count_sub+0x1c/0xd0
    [  139.124427]  ? __mnt_want_write+0xae/0x100
    [  139.127836]  ? mnt_want_write+0x8f/0x150
    [  139.130954]  path_setxattr+0x164/0x180
    [  139.133998]  ? __pfx_path_setxattr+0x10/0x10
    [  139.137853]  ? __pfx_ksys_pwrite64+0x10/0x10
    [  139.141299]  ? debug_smp_processor_id+0x1b/0x30
    [  139.145714]  ? fpregs_assert_state_consistent+0x6b/0x80
    [  139.150796]  __x64_sys_setxattr+0x71/0x90
    [  139.155407]  do_syscall_64+0x3f/0x90
    [  139.159035]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
    [  139.163843] RIP: 0033:0x7f108cae4469
    [  139.166481] Code: 00 f3 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 088
    [  139.183764] RSP: 002b:00007fff87588388 EFLAGS: 00000286 ORIG_RAX: 00000000000000bc
    [  139.190657] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f108cae4469
    [  139.196586] RDX: 00007fff875883b0 RSI: 00007fff875883d1 RDI: 00007fff875883b6
    [  139.201716] RBP: 00007fff8758c530 R08: 0000000000000001 R09: 00007fff8758c618
    [  139.207940] R10: 0000000000000006 R11: 0000000000000286 R12: 00000000004004c0
    [  139.214007] R13: 00007fff8758c610 R14: 0000000000000000 R15: 0000000000000000
    
    Signed-off-by: Edward Lo <loyuantsung@gmail.com>
    Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
fuse: reject fuse_notify() pagecache ops on directories [+ + +]
Author: Jann Horn <jannh@google.com>
Date:   Tue May 19 16:29:38 2026 +0200

    fuse: reject fuse_notify() pagecache ops on directories
    
    commit 9c954499d43aefac01c5dfb57a82b13d2dcf4b94 upstream.
    
    The operations FUSE_NOTIFY_STORE and FUSE_NOTIFY_RETRIEVE allow the
    FUSE daemon to actively write/read pagecache contents.
    
    For directories with FOPEN_CACHE_DIR, the pagecache is used as
    kernel-internal cache storage, and userspace is not supposed to have
    direct access to this cache - in particular, fuse_parse_cache() will hit
    WARN_ON() if the cache contains bogus data.
    
    Reject FUSE_NOTIFY_STORE and FUSE_NOTIFY_RETRIEVE on anything other than
    regular files with -EINVAL.
    
    Fixes: 5d7bc7e8680c ("fuse: allow using readdir cache")
    Cc: stable@vger.kernel.org
    Signed-off-by: Jann Horn <jannh@google.com>
    Link: https://patch.msgid.link/20260519-fuse-dir-pagecache-v2-1-5428fa48e175@google.com
    Acked-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
genetlink: Use internal flags for multicast groups [+ + +]
Author: Ido Schimmel <idosch@nvidia.com>
Date:   Fri May 29 13:06:09 2026 -0400

    genetlink: Use internal flags for multicast groups
    
    [ Upstream commit cd4d7263d58ab98fd4dee876776e4da6c328faa3 ]
    
    As explained in commit e03781879a0d ("drop_monitor: Require
    'CAP_SYS_ADMIN' when joining "events" group"), the "flags" field in the
    multicast group structure reuses uAPI flags despite the field not being
    exposed to user space. This makes it impossible to extend its use
    without adding new uAPI flags, which is inappropriate for internal
    kernel checks.
    
    Solve this by adding internal flags (i.e., "GENL_MCAST_*") and convert
    the existing users to use them instead of the uAPI flags.
    
    Tested using the reproducers in commit 44ec98ea5ea9 ("psample: Require
    'CAP_NET_ADMIN' when joining "packets" group") and commit e03781879a0d
    ("drop_monitor: Require 'CAP_SYS_ADMIN' when joining "events" group").
    
    No functional changes intended.
    
    Signed-off-by: Ido Schimmel <idosch@nvidia.com>
    Reviewed-by: Mat Martineau <martineau@kernel.org>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Stable-dep-of: d1ebfce2c1d1 ("smb: client: require net admin for CIFS SWN netlink")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
gpio: rockchip: convert bank->clk to devm_clk_get_enabled() [+ + +]
Author: Marco Scardovi <scardracs@disroot.org>
Date:   Tue May 26 19:02:45 2026 +0200

    gpio: rockchip: convert bank->clk to devm_clk_get_enabled()
    
    [ Upstream commit 3e46c18d5d87f063a93ae0fe7662fbf6660459d5 ]
    
    The bank->clk was previously obtained via of_clk_get() and manually
    prepared/enabled. However, it was missing a corresponding clk_put() in
    both the error paths and the remove function, leading to a reference leak.
    
    Convert the allocation to devm_clk_get_enabled(), which also properly
    propagates failures from clk_prepare_enable() that were previously ignored.
    
    The GPIO bank device uses the same OF node as the previous of_clk_get()
    call, so devm_clk_get_enabled(dev, NULL) correctly resolves the same
    clock provider entry.
    
    Fix the reference leak and simplify the code by removing the manual
    clk_disable_unprepare() calls in the probe error paths and in the
    remove function.
    
    Fixes: 936ee2675eee ("gpio/rockchip: add driver for rockchip gpio")
    Assisted-by: Antigravity:gemini-3.5-flash
    Signed-off-by: Marco Scardovi <scardracs@disroot.org>
    Link: https://patch.msgid.link/20260526171050.12785-2-scardracs@disroot.org
    Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
hfsplus: fix held lock freed on hfsplus_fill_super() [+ + +]
Author: Zilin Guan <zilin@seu.edu.cn>
Date:   Fri May 8 20:58:08 2026 -0400

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

hfsplus: fix uninit-value by validating catalog record size [+ + +]
Author: Deepanshu Kartikey <kartikey406@gmail.com>
Date:   Fri May 8 20:58:07 2026 -0400

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

 
HID: core: Add printk_ratelimited variants to hid_warn() etc [+ + +]
Author: Vicki Pfau <vi@endrift.com>
Date:   Wed Jun 3 17:30:12 2026 +0100

    HID: core: Add printk_ratelimited variants to hid_warn() etc
    
    [ Upstream commit 1d64624243af8329b4b219d8c39e28ea448f9929 ]
    
    hid_warn_ratelimited() is needed. Add the others as part of the block.
    
    Signed-off-by: Vicki Pfau <vi@endrift.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Signed-off-by: Lee Jones <lee@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

HID: core: Fix size_t specifier in hid_report_raw_event() [+ + +]
Author: Nathan Chancellor <nathan@kernel.org>
Date:   Wed Jun 3 17:30:14 2026 +0100

    HID: core: Fix size_t specifier in hid_report_raw_event()
    
    [ Upstream commit 4d3a2a466b8d68d852a1f3bbf11204b718428dc4 ]
    
    When building for 32-bit platforms, for which 'size_t' is
    'unsigned int', there are warnings around using the incorrect format
    specifier to print bsize in hid_report_raw_event():
    
      drivers/hid/hid-core.c:2054:29: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
       2053 |                 hid_warn_ratelimited(hid, "Event data for report %d is incorrect (%d vs %ld)\n",
            |                                                                                         ~~~
            |                                                                                         %zu
       2054 |                                      report->id, csize, bsize);
            |                                                         ^~~~~
      drivers/hid/hid-core.c:2076:29: error: format specifies type 'long' but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
       2075 |                 hid_warn_ratelimited(hid, "Event data for report %d was too short (%d vs %ld)\n",
            |                                                                                          ~~~
            |                                                                                          %zu
       2076 |                                      report->id, rsize, bsize);
            |                                                         ^~~~~
    
    Use the proper 'size_t' format specifier, '%zu', to clear up the
    warnings.
    
    Cc: stable@vger.kernel.org
    Fixes: 2c85c61d1332 ("HID: pass the buffer size to hid_report_raw_event")
    Reported-by: Miguel Ojeda <ojeda@kernel.org>
    Closes: https://lore.kernel.org/20260516020430.110135-1-ojeda@kernel.org/
    Signed-off-by: Nathan Chancellor <nathan@kernel.org>
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: Lee Jones <lee@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

HID: pass the buffer size to hid_report_raw_event [+ + +]
Author: Benjamin Tissoires <bentiss@kernel.org>
Date:   Wed Jun 3 17:30:13 2026 +0100

    HID: pass the buffer size to hid_report_raw_event
    
    [ Upstream commit 2c85c61d1332e1e16f020d76951baf167dcb6f7a ]
    
    commit 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing
    bogus memset()") enforced the provided data to be at least the size of
    the declared buffer in the report descriptor to prevent a buffer
    overflow. However, we can try to be smarter by providing both the buffer
    size and the data size, meaning that hid_report_raw_event() can make
    better decision whether we should plaining reject the buffer (buffer
    overflow attempt) or if we can safely memset it to 0 and pass it to the
    rest of the stack.
    
    Fixes: 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()")
    Cc: stable@vger.kernel.org
    Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
    Acked-by: Johan Hovold <johan@kernel.org>
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>
    Stable-dep-of: 206342541fc8 ("HID: core: introduce hid_safe_input_report()")
    [Lee: Backported to linux-6.12.y and beyond]
    Signed-off-by: Lee Jones <lee@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

HID: quirks: Add ALWAYS_POLL quirk for SIGMACHIP USB mouse [+ + +]
Author: hlleng <a909204013@gmail.com>
Date:   Tue May 12 09:57:37 2026 +0800

    HID: quirks: Add ALWAYS_POLL quirk for SIGMACHIP USB mouse
    
    commit 07466fc91c55532edcfb5c6a7ccd2ea52728d6bd upstream.
    
    The SIGMACHIP USB mouse with VID/PID 1c4f:0034 can disconnect and
    re-enumerate repeatedly after it has been enumerated if its interrupt
    endpoint is not continuously polled.
    
    This was observed with the device reporting itself as "SIGMACHIP Usb
    Mouse". Keeping the input event device open avoids the disconnects.
    
    Add HID_QUIRK_ALWAYS_POLL for this device so the HID core keeps polling
    it even when there is no userspace input consumer.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: hlleng <a909204013@gmail.com>
    Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

HID: wacom: Fix OOB write in wacom_hid_set_device_mode() [+ + +]
Author: Lee Jones <lee@kernel.org>
Date:   Wed May 27 17:05:26 2026 +0100

    HID: wacom: Fix OOB write in wacom_hid_set_device_mode()
    
    commit c0a8899e02ddebd51e2589835182c239c2e224ae upstream.
    
    wacom_hid_set_device_mode() currently assumes that the HID_DG_INPUTMODE
    usage is always located in the first field (field[0]) of the feature report.
    However, a device can specify HID_DG_INPUTMODE in a different field.
    
    If HID_DG_INPUTMODE is in a field other than the first one and the first
    field has a report_count smaller than the usage_index of HID_DG_INPUTMODE,
    this leads to an out-of-bounds write to r->field[0]->value.
    
    Fix this by storing the field index of HID_DG_INPUTMODE in 'struct
    hid_data' during feature mapping.  In wacom_hid_set_device_mode(), use
    this stored field index to access the correct field and add bounds
    checks to ensure both the field index and the value index are within
    valid ranges before writing.
    
    Cc: stable@vger.kernel.org
    Fixes: 5ae6e89f7409 ("HID: wacom: implement the finger part of the HID generic handling")
    Tested-by: Ping Cheng <ping.cheng@wacom.com>
    Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
    Signed-off-by: Lee Jones <lee@kernel.org>
    Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
hpfs: fix a crash if hpfs_map_dnode_bitmap fails [+ + +]
Author: Mikulas Patocka <mpatocka@redhat.com>
Date:   Mon May 25 14:48:58 2026 +0200

    hpfs: fix a crash if hpfs_map_dnode_bitmap fails
    
    commit 974820a59efde7c1a7e1260bcfe9bb81f833cc9f upstream.
    
    If hpfs_map_dnode_bitmap fails, the code would call hpfs_brelse4 on
    uninitialized quad buffer head, causing a crash.
    
    Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
    Reported-by: Farhad Alemi <farhad.alemi@berkeley.edu>
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
hv_netvsc: use kmap_local_page in netvsc_copy_to_send_buf [+ + +]
Author: Anton Leontev <leontyevantony@gmail.com>
Date:   Mon Jun 15 14:13:00 2026 -0400

    hv_netvsc: use kmap_local_page in netvsc_copy_to_send_buf
    
    [ Upstream commit 004e9ecfe6c5384f9e0b2f6f6389d42ec22789af ]
    
    netvsc_copy_to_send_buf() copies page buffer entries into the VMBus
    send buffer using phys_to_virt() on the entry PFN. Entries for the
    RNDIS header and the skb linear data come from kmalloc'd memory and
    are always in the kernel direct map, but entries for skb fragments
    reference page cache or user pages, which on 32-bit x86 with
    CONFIG_HIGHMEM=y can live above the LOWMEM boundary. For such a page
    phys_to_virt() returns an address outside the direct map and the
    subsequent memcpy() faults on the transmit softirq path, which is
    fatal.
    
    Map the pages with kmap_local_page() instead, handling two properties
    of the page buffer entries:
    
     - pb[i].pfn is a Hyper-V PFN at HV_HYP_PAGE_SIZE (4K) granularity,
       not a native PFN. Reconstruct the physical address first and derive
       the native page from it, so the mapping stays correct where
       PAGE_SIZE > HV_HYP_PAGE_SIZE (e.g. arm64 with 64K pages).
    
     - Since commit 41a6328b2c55 ("hv_netvsc: Preserve contiguous PFN
       grouping in the page buffer array"), an entry describes a full
       physically contiguous fragment and pb[i].len can exceed PAGE_SIZE,
       while kmap_local_page() maps a single page. Copy page by page,
       splitting at native page boundaries.
    
    The copy path only handles packets smaller than the send section size
    (6144 bytes by default); larger packets take the cp_partial path where
    only the RNDIS header is copied. So entries here are bounded by the
    section size and a copy is split at most once on 4K-page systems. On
    !CONFIG_HIGHMEM configs kmap_local_page() folds to page_address() and
    no mapping work is added.
    
    Fixes: c25aaf814a63 ("hyperv: Enable sendbuf mechanism on the send path")
    Cc: stable@vger.kernel.org
    Signed-off-by: Anton Leontev <leontyevantony@gmail.com>
    Link: https://patch.msgid.link/20260604165938.32033-1-leontyevantony@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    [ adapted `phys_to_page(paddr)` to `pfn_to_page(PHYS_PFN(paddr))` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
hwmon: (pmbus/adm1266) serialize GPIO PMBus accesses with pmbus_lock [+ + +]
Author: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Date:   Mon Jun 1 22:05:08 2026 -0400

    hwmon: (pmbus/adm1266) serialize GPIO PMBus accesses with pmbus_lock
    
    [ Upstream commit bab8c6fb5af8df7e753d196c1262cb78e92ca872 ]
    
    adm1266_gpio_get(), adm1266_gpio_get_multiple(), and
    adm1266_gpio_dbg_show() all issue PMBus reads against the device but
    none of them take pmbus_lock.  The pmbus_core framework holds
    pmbus_lock around its own multi-transaction sequences (notably the
    "set PAGE, then read paged register" pattern used by hwmon
    attributes), so an unlocked GPIO accessor can land between a PAGE
    write and the subsequent paged read in another thread and corrupt
    either side's view of the device state machine.
    
    Take pmbus_lock at the top of each of the three accessors via the
    scope-based guard().  The lock is uncontended in the common case and
    adds only a single mutex round-trip per call.
    
    Fixes: d98dfad35c38 ("hwmon: (pmbus/adm1266) Add support for GPIOs")
    Cc: stable@vger.kernel.org
    Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
    Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    Link: https://lore.kernel.org/r/20260518-adm1266-gpio-fixes-v3-6-e425e4f88139@nexthop.ai
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    [ open-coded each `guard(pmbus_lock)(data->client)` as explicit `pmbus_lock_interruptible()`/`pmbus_unlock()` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (pmbus/adm1266) serialize NVMEM blackbox read with pmbus_lock [+ + +]
Author: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Date:   Tue Jun 2 07:18:25 2026 -0400

    hwmon: (pmbus/adm1266) serialize NVMEM blackbox read with pmbus_lock
    
    [ Upstream commit 9f1dd8f9491eb840cbea7ffdf4cad031e25f8ae0 ]
    
    adm1266_nvmem_read() is the reg_read callback the NVMEM core invokes
    when userspace reads /sys/bus/nvmem/devices/.../nvmem on this chip.
    On the first byte of every read it does a memset of data->dev_mem,
    walks the device blackbox through adm1266_nvmem_read_blackbox()
    (which issues a chain of PMBus block transactions), and then memcpys
    the refreshed buffer out to userspace.  None of that runs under
    pmbus_lock today.
    
    Two consequences:
    
      - The PMBus traffic the refresh issues is not serialised against
        pmbus_core's own multi-step PAGE+register sequences.  A paged
        hwmon attribute read from another thread can land between a
        PAGE write and the paged read in either direction and corrupt
        one side's view of the device state machine.
    
      - The NVMEM core does not serialise concurrent reg_read calls, so
        two userspace readers racing at offset 0 can interleave the
        memset of data->dev_mem with another reader's
        adm1266_nvmem_read_blackbox() refill or memcpy out, returning
        torn data to userspace.
    
    Take pmbus_lock at the top of adm1266_nvmem_read() via the
    scope-based guard().  Patch 5 of this series moves
    adm1266_config_nvmem() past pmbus_do_probe() so the lock is
    guaranteed to be live before the callback is reachable from
    userspace.
    
    Fixes: 15609d189302 ("hwmon: (pmbus/adm1266) read blackbox")
    Cc: stable@vger.kernel.org
    Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
    Link: https://lore.kernel.org/r/20260518-adm1266-gpio-fixes-v3-7-e425e4f88139@nexthop.ai
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    [ adapted `guard(pmbus_lock)(data->client)` to manual `pmbus_lock_interruptible()`/`pmbus_unlock()` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hwmon: (pmbus/adm1266) serialize sequencer_state debugfs read with pmbus_lock [+ + +]
Author: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Date:   Mon Jun 1 22:05:43 2026 -0400

    hwmon: (pmbus/adm1266) serialize sequencer_state debugfs read with pmbus_lock
    
    [ Upstream commit 4e4af55aaca7f6d7673d5f9889ad0529db86a048 ]
    
    adm1266_state_read() backs the sequencer_state debugfs entry and
    issues an i2c_smbus_read_word_data(client, ADM1266_READ_STATE)
    against the device without taking pmbus_lock.  pmbus_core holds
    pmbus_lock around its own multi-transaction sequences (notably the
    "set PAGE, then read paged register" pattern used by hwmon
    attributes), so an unlocked debugfs reader can land between a PAGE
    write and the subsequent paged read in another thread.  READ_STATE
    itself is not paged, so it cannot corrupt PAGE in flight, but the
    same defensive serialisation that applies to the GPIO accessors
    applies here: any direct device access from outside pmbus_core
    should be ordered with respect to pmbus_core's own.
    
    Take pmbus_lock at the top of adm1266_state_read() via the
    scope-based guard().
    
    Fixes: ed1ff457e187 ("hwmon: (pmbus/adm1266) add debugfs for states")
    Cc: stable@vger.kernel.org
    Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
    Link: https://lore.kernel.org/r/20260518-adm1266-gpio-fixes-v3-8-e425e4f88139@nexthop.ai
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    [ open-coded `guard(pmbus_lock)(client)` as `pmbus_lock_interruptible()`/`pmbus_unlock()` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
i2c: dev: prevent integer overflow in I2C_TIMEOUT ioctl [+ + +]
Author: Mingyu Wang <25181214217@stu.xidian.edu.cn>
Date:   Mon Apr 27 10:57:45 2026 +0800

    i2c: dev: prevent integer overflow in I2C_TIMEOUT ioctl
    
    commit 617eb7c0961a8dfcfc811844a6396e406b2923ea upstream.
    
    While fuzzing with Syzkaller, a persistent `schedule_timeout: wrong
    timeout value` warning was observed, accompanied by SMBus controller
    state machine corruption.
    
    The I2C_TIMEOUT ioctl accepts a user-provided timeout in multiples of
    10 ms. The user argument is checked against INT_MAX, but it is
    subsequently multiplied by 10 before being passed to msecs_to_jiffies().
    
    A malicious user can pass a large value (e.g., 429496729) that passes
    the `arg > INT_MAX` check but overflows when multiplied by 10. This
    results in a truncated 32-bit unsigned value that bypasses the
    internal `(int)m < 0` check in `msecs_to_jiffies()`.
    
    The truncated value is then assigned to `client->adapter->timeout`
    (a signed 32-bit int), which is reinterpreted as a negative number.
    When passed to wait_for_completion_timeout(), this negative value
    undergoes sign extension to a 64-bit unsigned long, triggering the
    `schedule_timeout` warning and causing premature returns. This leaves
    the SMBus state machine in an unrecoverable state, constituting a
    local Denial of Service (DoS).
    
    Fix this by bounding the user argument to `INT_MAX / 10`.
    
    Signed-off-by: Mingyu Wang <25181214217@stu.xidian.edu.cn>
    [wsa: move the comment as well]
    Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

i2c: qcom-cci: Fix NULL pointer dereference in cci_remove() [+ + +]
Author: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
Date:   Sat May 16 02:41:18 2026 +0300

    i2c: qcom-cci: Fix NULL pointer dereference in cci_remove()
    
    commit 729ac5a4b966aac42e08a94dea966f4429008548 upstream.
    
    On all modern platforms Qualcomm CCI controller provides two I2C masters,
    and on particular boards only one I2C master may be initialized, and in
    such cases the device unbinding or driver removal causes a NULL pointer
    dereference, because cci_halt() is called for all two I2C masters, but
    a completion is initialized only for the single enabled master:
    
        % rmmod i2c-qcom-cci
        Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
        <snip>
        Call trace:
        __wait_for_common+0x194/0x1a8 (P)
        wait_for_completion_timeout+0x20/0x2c
        cci_remove+0xc4/0x138 [i2c_qcom_cci]
        platform_remove+0x20/0x30
        device_remove+0x4c/0x80
        device_release_driver_internal+0x1c8/0x224
        driver_detach+0x50/0x98
        bus_remove_driver+0x6c/0xbc
        driver_unregister+0x30/0x60
        platform_driver_unregister+0x14/0x20
        qcom_cci_driver_exit+0x18/0x1008 [i2c_qcom_cci]
        ....
    
    Fixes: e517526195de ("i2c: Add Qualcomm CCI I2C driver")
    Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
    Cc: <stable@vger.kernel.org> # v5.8+
    Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/20260515234121.1607425-2-vladimir.zapolskiy@linaro.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

i2c: stm32f7: fix timing computation ignoring i2c-analog-filter [+ + +]
Author: Guillermo Rodríguez <guille.rodriguez@gmail.com>
Date:   Tue May 26 11:12:09 2026 +0200

    i2c: stm32f7: fix timing computation ignoring i2c-analog-filter
    
    commit a124579c0763da7bc408f4cd7e8f606cadc94855 upstream.
    
    stm32f7_i2c_compute_timing() uses i2c_dev->analog_filter to pick
    the analog filter delay, but i2c_dev->analog_filter is parsed from
    the "i2c-analog-filter" DT property only after the compute_timing
    loop in stm32f7_i2c_setup_timing(), so in practice the timing
    calculations always ignore the analog filter. On an STM32MP1 board
    with clock-frequency = <400000> and i2c-analog-filter set, measured
    SCL frequency was ~382 kHz.
    
    This also affects (widens) the computed SDADEL range. At high bus
    clock speeds, this can select an SDADEL value that violates tVD;DAT
    (data valid time).
    
    Fix by parsing "i2c-analog-filter" before the compute_timing loop.
    
    Fixes: 83c3408f7b9c ("i2c: stm32f7: support DT binding i2c-analog-filter")
    Signed-off-by: Guillermo Rodríguez <guille.rodriguez@gmail.com>
    Cc: <stable@vger.kernel.org> # v5.13+
    Acked-by: Alain Volmat <alain.volmat@foss.st.com>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/20260526091210.20383-1-guille.rodriguez@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

i2c: tegra: Fix NOIRQ suspend/resume [+ + +]
Author: Akhil R <akhilrajeev@nvidia.com>
Date:   Mon May 18 17:10:13 2026 +0530

    i2c: tegra: Fix NOIRQ suspend/resume
    
    commit 656646b3847ac6a21b074a813223feef2aadd6e2 upstream.
    
    The Tegra I2C driver relies on runtime PM to wake up the controller before
    each transfer. However, runtime PM is disabled between the system suspend
    and NOIRQ suspend. If an I2C device initiates a transfer during this
    window, the I2C controller fails to wake up and the transfer fails. To
    handle this, the controller must be kept available for this period to
    allow transfers.
    
    Rework the I2C controller's system PM callbacks such that the controller
    is resumed from runtime suspend during system suspend and it stays
    RPM_ACTIVE throughout the suspend-resume cycle until it is runtime
    suspended back in the system resume. The clocks are disabled in NOIRQ
    suspend and enabled back in NOIRQ resume by calling the controller's
    runtime PM functions directly.
    
    Fixes: 8ebf15e9c869 ("i2c: tegra: Move suspend handling to NOIRQ phase")
    Assisted-by: Cursor:claude-4.6-opus
    Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
    Cc: <stable@vger.kernel.org> # v5.4+
    Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/20260518114013.62065-5-akhilrajeev@nvidia.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
IB/isert: Reject login PDUs shorter than ISER_HEADERS_LEN [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Tue Jun 2 15:46:42 2026 -0400

    IB/isert: Reject login PDUs shorter than ISER_HEADERS_LEN
    
    commit 29e7b925ae6df64894e82ab6419994dc25580a8a upstream.
    
    In drivers/infiniband/ulp/isert/ib_isert.c, isert_login_recv_done()
    computes the login request payload length as wc->byte_len minus
    ISER_HEADERS_LEN with no lower bound, and login_req_len is a signed int.
    A remote iSER initiator can post a login Send work request carrying
    fewer than ISER_HEADERS_LEN (76) bytes, so the subtraction underflows
    and login_req_len becomes negative.
    
    isert_rx_login_req() then reads that negative length back into a signed
    int, takes size = min(rx_buflen, MAX_KEY_VALUE_PAIRS), and because the
    min() is signed it keeps the negative value; the value is then passed as
    the memcpy() length and sign-extended to a multi-gigabyte size_t. The
    copy into the 8192-byte login->req_buf runs far out of bounds and
    faults, crashing the target node. The login phase precedes iSCSI
    authentication, so no credentials are required to reach this path.
    
    Reject any login PDU shorter than ISER_HEADERS_LEN before the
    subtraction, mirroring the existing early return on a failed work
    completion, so login_req_len can never go negative. The upper bound was
    already safe: a posted login buffer cannot deliver more than
    ISER_RX_PAYLOAD_SIZE, so the difference stays at or below
    MAX_KEY_VALUE_PAIRS and the existing min() clamps it; only the missing
    lower bound needs to be added.
    
    Fixes: b8d26b3be8b3 ("iser-target: Add iSCSI Extensions for RDMA (iSER) target driver")
    Link: https://patch.msgid.link/r/20260602194642.2273217-1-michael.bommarito@gmail.com
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ice: fix VF queue configuration with low MTU values [+ + +]
Author: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Date:   Fri May 29 21:23:43 2026 -0400

    ice: fix VF queue configuration with low MTU values
    
    [ Upstream commit 3ba4dd024d26372733d1c02e13e076c6016e3320 ]
    
    The ice driver's VF queue configuration validation rejects
    databuffer_size values below 1024 bytes, which prevents VFs from
    using MTU values below 871 bytes.
    
    The iavf driver calculates databuffer_size based on the MTU using:
      databuffer_size = ALIGN(MTU + LIBETH_RX_LL_LEN, 128)
    
    where LIBETH_RX_LL_LEN = 26 (ETH_HLEN + 2*VLAN_HLEN + ETH_FCS_LEN).
    
    For MTU values below 871:
      MTU 870: 870 + 26 = 896, aligned to 128 = 896 (< 1024, rejected)
      MTU 871: 871 + 26 = 897, aligned to 128 = 1024 (>= 1024, accepted)
    
    The 1024-byte minimum seems unnecessarily restrictive, because the hardware
    supports databuffer_size as low as 128 bytes (the alignment boundary),
    which should allow MTU values down to the standard minimum of 68 bytes.
    
    I haven't found the reason why the limit was configured in the commit
    9c7dd7566d18 ("ice: add validation in OP_CONFIG_VSI_QUEUES VF message"), so
    with no more information and since it is working, change the minimum
    databuffer_size validation from 1024 to 128 bytes to allow standard low
    MTU values while still preventing invalid configurations.
    
    Fixes: 9c7dd7566d18 ("ice: add validation in OP_CONFIG_VSI_QUEUES VF message")
    cc: stable@vger.kernel.org
    Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
    Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
    Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Link: https://patch.msgid.link/20260515182419.1597859-3-anthony.l.nguyen@intel.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [ applied the change to ice_virtchnl.c ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ieee802154: 6lowpan: only accept IPv6 packets in lowpan_xmit() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Wed Jun 3 07:29:55 2026 +0000

    ieee802154: 6lowpan: only accept IPv6 packets in lowpan_xmit()
    
    [ Upstream commit 3a5f3f7aff18bcc36a57839cf50cf0cc8de707f3 ]
    
    The aoe driver (or similar) generates a non-IPv6 packet
    (e.g., ETH_P_AOE) and queues it for transmission via dev_queue_xmit()
    on a 6LoWPAN interface (configured by the user or test case).
    
    Since the packet is not IPv6, the 6LoWPAN header_ops->create function
    (lowpan_header_create or header_create) returns early without initializing
    the lowpan_addr_info structure in the skb headroom.
    
    In the transmit function (lowpan_xmit), the driver calls lowpan_header
    (or setup_header) which unconditionally copies and uses the lowpan_addr_info
    from the headroom, which contains uninitialized data.
    
    Fix this by dropping non IPv6 packets.
    
    A similar fix is needed in net/bluetooth/6lowpan.c bt_xmit().
    
    Fixes: 4dc315e267fe ("ieee802154: 6lowpan: move transmit functionality")
    Reported-by: syzbot+f13c19f75e1097abd116@syzkaller.appspotmail.com
    Closes: https://lore.kernel.org/netdev/6a1fd763.278b5b03.2bcf39.0049.GAE@google.com/T/#u
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://patch.msgid.link/20260603072955.4032221-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
iio: adc: fix the return value handle for platform_get_irq() [+ + +]
Author: Ruan Jinjie <ruanjinjie@huawei.com>
Date:   Thu Jun 4 09:54:45 2026 -0400

    iio: adc: fix the return value handle for platform_get_irq()
    
    [ Upstream commit c09ddcdd4dd32ee9768dc233ead4b3d726f26d38 ]
    
    There is no possible for platform_get_irq() to return 0
    and the return value of platform_get_irq() is more sensible
    to show the error reason.
    
    Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
    Link: https://lore.kernel.org/r/20230727131607.2897937-1-ruanjinjie@huawei.com
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Stable-dep-of: 0d42e2c0bd6c ("iio: adc: npcm: fix unbalanced clk_disable_unprepare()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: adc: npcm: Convert to platform remove callback returning void [+ + +]
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date:   Thu Jun 4 09:54:46 2026 -0400

    iio: adc: npcm: Convert to platform remove callback returning void
    
    [ Upstream commit 5253a5cc7709688b9a000f7928bfaa3366d0af98 ]
    
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is ignored (apart
    from emitting a warning) and this typically results in resource leaks.
    To improve here there is a quest to make the remove callback return
    void. In the first step of this quest all drivers are converted to
    .remove_new() which already returns void. Eventually after all drivers
    are converted, .remove_new() will be renamed to .remove().
    
    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.
    
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Link: https://lore.kernel.org/r/20230919174931.1417681-18-u.kleine-koenig@pengutronix.de
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Stable-dep-of: 0d42e2c0bd6c ("iio: adc: npcm: fix unbalanced clk_disable_unprepare()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: adc: npcm: fix unbalanced clk_disable_unprepare() [+ + +]
Author: David Carlier <devnexen@gmail.com>
Date:   Thu Jun 4 09:54:47 2026 -0400

    iio: adc: npcm: fix unbalanced clk_disable_unprepare()
    
    [ Upstream commit 0d42e2c0bd6ceb89e44c6e065f9bdf9b1df3ef0c ]
    
    The driver acquired the ADC clock with devm_clk_get() and read its
    rate, but never called clk_prepare_enable(). The probe error path and
    npcm_adc_remove() both called clk_disable_unprepare() unconditionally,
    causing the clk framework's enable/prepare counts to underflow on
    probe failure or module unbind.
    
    The issue went unnoticed because NPCM BMC firmware leaves the ADC
    clock enabled at boot, so the driver happened to work in practice.
    
    Switch to devm_clk_get_enabled() so the clock is properly enabled
    during probe and automatically released by the device-managed
    cleanup, and drop the now-redundant clk_disable_unprepare() from
    both the probe error path and remove().
    
    While at it, drop the duplicate error message on devm_request_irq()
    failure since the IRQ core already logs it.
    
    Fixes: 9bf85fbc9d8f ("iio: adc: add NPCM ADC driver")
    Signed-off-by: David Carlier <devnexen@gmail.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: adc: viperboard: Fix error handling in vprbrd_iio_read_raw [+ + +]
Author: Salah Triki <salah.triki@gmail.com>
Date:   Thu May 7 20:07:51 2026 +0100

    iio: adc: viperboard: Fix error handling in vprbrd_iio_read_raw
    
    commit 422b5bbf333f75fb486855ad0eedc23cf21f3277 upstream.
    
    The driver proceeds to the reception phase even if the preceding
    transmission fails.
    
    This uses a goto error label for an early bail out and ensures the mutex is
    properly unlocked in case of failure.
    
    Fixes: ffd8a6e7a778 ("iio: adc: Add viperboard adc driver")
    Signed-off-by: Salah Triki <salah.triki@gmail.com>
    Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
    Reviewed-by: Maxwell Doose <m32285159@gmail.com>
    Reviewed-by: Nuno Sá <nuno.sa@analog.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: adc: xilinx-xadc: Fix sequencer mode in postdisable for dual mux [+ + +]
Author: Christofer Jonason <christofer.jonason@guidelinegeo.com>
Date:   Wed Mar 4 10:07:27 2026 +0100

    iio: adc: xilinx-xadc: Fix sequencer mode in postdisable for dual mux
    
    commit 852534744c2d35626a604f128ff0b8ec12805591 upstream.
    
    xadc_postdisable() unconditionally sets the sequencer to continuous
    mode. For dual external multiplexer configurations this is incorrect:
    simultaneous sampling mode is required so that ADC-A samples through
    the mux on VAUX[0-7] while ADC-B simultaneously samples through the
    mux on VAUX[8-15]. In continuous mode only ADC-A is active, so
    VAUX[8-15] channels return incorrect data.
    
    Since postdisable is also called from xadc_probe() to set the initial
    idle state, the wrong sequencer mode is active from the moment the
    driver loads.
    
    The preenable path already uses xadc_get_seq_mode() which returns
    SIMULTANEOUS for dual mux. Fix postdisable to do the same.
    
    Fixes: bdc8cda1d010 ("iio:adc: Add Xilinx XADC driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Christofer Jonason <christofer.jonason@guidelinegeo.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
    Reviewed-by: Nuno Sá <nuno.sa@analog.com>
    Reviewed-by: Salih Erim <salih.erim@amd.com>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: buffer: hw-consumer: fix use-after-free in error path [+ + +]
Author: Felix Gu <ustc.gu@gmail.com>
Date:   Thu Apr 30 21:29:06 2026 +0800

    iio: buffer: hw-consumer: fix use-after-free in error path
    
    commit 6f5ed4f2c7c83f33344e0ba179f72a12e5dad4a4 upstream.
    
    In the err_put_buffers cleanup path of iio_hw_consumer_alloc(), the code
    was using list_for_each_entry() to iterate through buffers while calling
    iio_buffer_put() which can free the current buffer if refcount drops to 0.
    The list_for_each_entry() loop macro then evaluates buf->head.next to
    continue iteration, accessing the freed buffer.
    
    Fix this by using list_for_each_entry_safe().
    
    Fixes: 48b66f8f936f ("iio: Add hardware consumer buffer support")
    Reported-by: sashiko <sashiko-bot@kernel.org>
    Closes: https://sashiko.dev/#/patchset/20260427-iio_buf-v1-1-2bbdac844647%40gmail.com
    Signed-off-by: Felix Gu <ustc.gu@gmail.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
    Reviewed-by: Nuno Sá <nuno.sa@analog.com>
    Reviewed-by: Maxwell Doose <m32285159@gmail.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: chemical: scd30: fix division by zero in write_raw [+ + +]
Author: Antoniu Miclaus <antoniu.miclaus@analog.com>
Date:   Thu Jun 4 15:17:50 2026 -0400

    iio: chemical: scd30: fix division by zero in write_raw
    
    [ Upstream commit 5aba4f94b225617a55fed442a70329b2ee19c0a5 ]
    
    Add a zero check for val2 before using it as a divisor when setting the
    sampling frequency. A user writing a zero fractional part to the
    sampling_frequency sysfs attribute triggers a division by zero in the
    kernel.
    
    Fixes: 64b3d8b1b0f5 ("iio: chemical: scd30: add core driver")
    Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: chemical: scd30: Use guard(mutex) to allow early returns [+ + +]
Author: Jonathan Cameron <jic23@kernel.org>
Date:   Thu Jun 4 15:17:49 2026 -0400

    iio: chemical: scd30: Use guard(mutex) to allow early returns
    
    [ Upstream commit 5feb5532870fbced5d6f450b8061a33f461b88ca ]
    
    Auto cleanup based release of the lock allows for simpler code flow in a
    few functions with large multiplexing style switch statements and no
    common operations following the switch.
    
    Suggested-by: David Lechner <dlechner@baylibre.com>
    Cc: Tomasz Duszynski <tomasz.duszynski@octakon.com>
    Reviewed-by: David Lechner <dlechner@baylibre.com>
    Link: https://patch.msgid.link/20250209180624.701140-3-jic23@kernel.org
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Stable-dep-of: 5aba4f94b225 ("iio: chemical: scd30: fix division by zero in write_raw")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: dac: ad5686: acquire lock when doing powerdown control [+ + +]
Author: Rodrigo Alencar <rodrigo.alencar@analog.com>
Date:   Tue May 5 13:35:04 2026 +0100

    iio: dac: ad5686: acquire lock when doing powerdown control
    
    commit 5237c3175cae5ab05f18878cec3301a04403859e upstream.
    
    Protect access of pwr_down_mode and pwr_down_mask fields with existing
    mutex lock. Each channel exposes their own attributes for controlling
    powerdown modes and powerdown state. This fixes potential race conditions
    as those the write functions perform non-atomic read-modify-write
    operations to those pwr_down_* fields. This issue exists since the ad5686
    driver was first introduced.
    
    Fixes: c2f37c8dcadc ("iio: dac: New driver for AD5686R, AD5685R, AD5684R Digital to analog converters")
    Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: dac: ad5686: fix input raw value check [+ + +]
Author: Rodrigo Alencar <rodrigo.alencar@analog.com>
Date:   Fri May 1 10:14:55 2026 +0100

    iio: dac: ad5686: fix input raw value check
    
    commit d01220ee5e43c65a206df827b39bf5cf5f7b9dce upstream.
    
    Fix range check for input raw value, which is off by one, i.e., for a
    10-bit DAC the max valid value is 1023, but 1 << 10 equals 1024, which
    passes the previous check, allowing an out-of-range write. The issue
    exists since the ad5686 driver was first introduced.
    
    Fixes: c2f37c8dcadc ("iio: dac: New driver for AD5686R, AD5685R, AD5684R Digital to analog converters")
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
    Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: dac: ad5686: fix ref bit initialization for single-channel parts [+ + +]
Author: Rodrigo Alencar <rodrigo.alencar@analog.com>
Date:   Thu Jun 4 20:59:16 2026 -0400

    iio: dac: ad5686: fix ref bit initialization for single-channel parts
    
    [ Upstream commit ecae2ae606d493cf11457946436335bd0e726663 ]
    
    The reference bit position was ignored when writing the register at the
    probe() function (!!val was used). When such bit is 1, internal voltage
    reference is disabled so that an external one can be used. For
    multi-channel devices, bit 0 of the Internal Reference Setup command
    behaves the same way, so AD5686_REF_BIT_MSK is created. The issue exists
    since support for single-channel devices were first introduced.
    
    Fixes: be1b24d24541 ("iio:dac:ad5686: Add AD5691R/AD5692R/AD5693/AD5693R support")
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
    Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    [ adapted `has_external_vref` to the in-tree equivalent `voltage_uv` variable in the `val =` computation ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: dac: max5821: fix return value check in powerdown sync [+ + +]
Author: Salah Triki <salah.triki@gmail.com>
Date:   Mon Apr 27 22:33:19 2026 +0100

    iio: dac: max5821: fix return value check in powerdown sync
    
    commit d0a228d903425e653f18a4341e60c0538afb6d41 upstream.
    
    The function max5821_sync_powerdown_mode() returned the result of
    i2c_master_send() directly. If a partial transfer occurred, it would
    be incorrectly treated as a success by the caller.
    
    While the caller currently handles the positive return value of 2 as
    success, this patch refactors the function to return 0 on full success
    and -EIO on short writes. This ensures robust error handling for
    incomplete transfers and improves code maintainability by using
    sizeof(outbuf).
    
    Fixes: 472988972737 ("iio: add support of the max5821")
    Signed-off-by: Salah Triki <salah.triki@gmail.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: gyro: adis16260: fix division by zero in write_raw [+ + +]
Author: Antoniu Miclaus <antoniu.miclaus@analog.com>
Date:   Thu Jun 4 14:57:19 2026 -0400

    iio: gyro: adis16260: fix division by zero in write_raw
    
    [ Upstream commit 761e8b489e6cf166c574034b70637f8a7eadd0ee ]
    
    Add a validation check for the sampling frequency value before using it
    as a divisor. A user writing zero to the sampling_frequency sysfs
    attribute triggers a division by zero in the kernel.
    
    Fixes: 089a41985c6c ("staging: iio: adis16260 digital gyro driver")
    Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
    Reviewed-by: Nuno Sá <nuno.sa@analog.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: gyro: itg3200: fix i2c read into the wrong stack location [+ + +]
Author: David Carlier <devnexen@gmail.com>
Date:   Tue May 5 14:37:48 2026 +0100

    iio: gyro: itg3200: fix i2c read into the wrong stack location
    
    commit 6bdc3023d62ed5c7d591f0eb27a5adb37fb892ae upstream.
    
    itg3200_read_all_channels() takes `__be16 *buf' as a parameter and
    fills the i2c_msg destination as `(char *)&buf'. Since `buf' is the
    parameter (a pointer), `&buf' is the address of the local pointer
    slot on the stack of itg3200_read_all_channels(), not the address
    of the caller's scan buffer. The (char *) cast hides the type
    mismatch.
    
    i2c_transfer() therefore writes ITG3200_SCAN_ELEMENTS * sizeof(s16)
    = 8 bytes into the parameter's stack slot, which is discarded when
    the function returns. The caller's scan buffer in
    itg3200_trigger_handler() is never written to, so
    iio_push_to_buffers_with_timestamp() pushes uninitialised stack
    contents to userspace via /dev/iio:deviceX every scan -- both a
    functional bug (no actual gyroscope or temperature data is
    delivered through the triggered buffer) and an information leak.
    
    The non-buffered read_raw() path is unaffected: it goes through
    itg3200_read_reg_s16() which uses `&out' on a local s16 value,
    where that is correct.
    
    Drop the spurious `&' so the i2c read writes into the caller's
    buffer.
    
    Fixes: 9dbf091da080 ("iio: gyro: Add itg3200")
    Cc: stable@vger.kernel.org
    Signed-off-by: David Carlier <devnexen@gmail.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: imu: st_lsm6dsx: fix stack leak in tagged FIFO buffer [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Thu Apr 9 15:40:48 2026 +0200

    iio: imu: st_lsm6dsx: fix stack leak in tagged FIFO buffer
    
    commit c9d8e9adaa63150ef7e833480b799d0bab83a276 upstream.
    
    The tagged FIFO path declares iio_buff on the stack with __aligned(8)
    but no initializer, but there is a hole in the structure, which will
    then leak to userspace as ST_LSM6DSX_SAMPLE_SIZE bytes (6) will be
    copied, but the space between that and the timestamp are not
    initialized.
    
    Commit c14edb4d0bdc ("iio:imu:st_lsm6dsx Fix alignment and data leak
    issues") moved the untagged FIFO path to a kzalloc'd buffer in hw->scan,
    but for the tagged path it only added the alignment qualifier and not
    the initializer :(
    
    Fix this by just zero-initializing the structure on the stack.
    
    Cc: Lorenzo Bianconi <lorenzo@kernel.org>
    Cc: Jonathan Cameron <jic23@kernel.org>
    Cc: David Lechner <dlechner@baylibre.com>
    Cc: "Nuno Sá" <nuno.sa@analog.com>
    Cc: Andy Shevchenko <andy@kernel.org>
    Fixes: c14edb4d0bdc ("iio:imu:st_lsm6dsx Fix alignment and data leak issues")
    Cc: stable <stable@kernel.org>
    Assisted-by: gregkh_clanker_t1000
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Reviewed-by: David Lechner <dlechner@baylibre.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: light: cm3323: fix reg_conf not being initialized correctly [+ + +]
Author: Aldo Conte <aldocontelk@gmail.com>
Date:   Tue Apr 7 17:17:01 2026 +0200

    iio: light: cm3323: fix reg_conf not being initialized correctly
    
    commit 1f4f0bcc5255dec5c4c3a1551bf49d8c33b69b20 upstream.
    
    The code stores the return value of i2c_smbus_write_word_data()
    in data->reg_conf; however, this value represents the result
    of the write operation and not the value actually written to
    the configuration register. This meant that the contents of
    data->reg_conf did not truly reflect the contents
    of the hardware register.
    
    Instead, save the value of the register before the write
    and use this value in the I2C write.
    
    The bug was found by code inspection: i2c_smbus_write_word_data()
    returns 0 on success, not the value written to the register.
    
    Tested using i2c-stub on a Raspberry Pi 3B running a custom 6.19.10
    kernel. Before loading the driver, the configuration register 0x00
    CM3323_CMD_CONF was populated with 0x0030 using
    `i2cset -y 11 0x10 0x00 0x0030 w`, encoding an integration time of 320ms
    in bits[6:4].
    
    Due to incorrect initialization of data->reg_conf in
    cm3323_init(), the print of integration_time returns 0.040000
    instead of the expected 0.320000. This happens because the read of the
    integration_time depends on cm3323_get_it_bits() that is based on the
    value of data->reg_conf, which is erroneously set to 0.
    
    With this fix applied, data->reg_conf correctly saves 0x0030 after init
    and the successive integration_time reports 0.320000 as expected.
    
    Fixes: 8b0544263761 ("iio: light: Add support for Capella CM3323 color sensor")
    Cc: stable@vger.kernel.org
    Signed-off-by: Aldo Conte <aldocontelk@gmail.com>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: magnetometer: st_magn: fix default DRDY pin selection for LIS2MDL [+ + +]
Author: Advait Dhamorikar <advaitd@mechasystems.com>
Date:   Tue Apr 7 12:50:59 2026 +0530

    iio: magnetometer: st_magn: fix default DRDY pin selection for LIS2MDL
    
    commit 49f79cd28f1e3333cbe0d616ce59ead0b24bf34e upstream.
    
    The device tree binding for st,lis2mdl does not support
    st,drdy-int-pin property. However, when no platform data is provided
    and the property is absent, the driver falls back to default_magn_pdata
    which hardcodes drdy_int_pin = 2. This causes
    `st_sensors_set_drdy_int_pin` to fail with -EINVAL because the LIS2MDL
    sensor settings have no INT2 DRDY mask defined.
    
    Fix this by checking the sensor's INT2 DRDY mask availability at
    probe time and selecting the appropriate default pin. Sensors that
    do not support INT2 DRDY will default to INT1, while all others
    retain the existing default of INT2.
    
    Fixes: 38934daf7b5c ("iio: magnetometer: st_magn: Provide default platform data")
    Signed-off-by: Advait Dhamorikar <advaitd@mechasystems.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: ssp_sensors: cancel delayed work_refresh on remove [+ + +]
Author: Sanjay Chitroda <sanjayembeddedse@gmail.com>
Date:   Sun Apr 26 14:47:04 2026 +0530

    iio: ssp_sensors: cancel delayed work_refresh on remove
    
    commit eedf7602fbd929e97e0c480da501dc7a34beb2a8 upstream.
    
    The work_refresh may still be pending or running when the device is
    removed, cancel the delayed work_refresh in remove path.
    
    Fixes: 50dd64d57eee ("iio: common: ssp_sensors: Add sensorhub driver")
    Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

iio: temperature: tsys01: fix broken PROM checksum validation [+ + +]
Author: Salah Triki <salah.triki@gmail.com>
Date:   Tue May 5 08:10:24 2026 +0100

    iio: temperature: tsys01: fix broken PROM checksum validation
    
    commit 4701e471c16866e7aa8f5e6a3a6b0d31e097e2c9 upstream.
    
    The current implementation of tsys01_crc_valid() incorrectly sums the
    first word (n_prom[0]) repeatedly instead of iterating over the 8 words
    retrieved from the PROM. This leads to a checksum mismatch and probe
    failure on hardware.
    
    According to the TSYS01 datasheet, the PROM consists of 8 words. A valid
    check must iterate through all 8 words to verify the integrity of the
    calibration data. The current driver only checks the first word 8 times.
    
    Note: This fix was identified during a code audit and is based on
    datasheet specifications. It has not been tested on real hardware.
    
    Fixes: 43e53407f680 ("Add tsys01 meas-spec driver support")
    Signed-off-by: Salah Triki <salah.triki@gmail.com>
    Cc: <Stable@vger.kernel.org>
    Signed-off-by: Jonathan Cameron <jic23@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Input: atkbd - add DMI quirk for Lenovo Yoga Air 14 (83QK) [+ + +]
Author: Zeyu WANG <zeyu.thomas.wang@gmail.com>
Date:   Wed Jun 3 01:09:09 2026 +0800

    Input: atkbd - add DMI quirk for Lenovo Yoga Air 14 (83QK)
    
    commit ad0979fe053e9f2db82da82188256ef6eb41095a upstream.
    
    The Lenovo Yoga Air 14 (83QK) laptop keyboard becomes unresponsive
    after the standard atkbd init sequence. Controlled testing on the
    actual hardware shows the F5 (ATKBD_CMD_RESET_DIS / deactivate)
    command specifically corrupts the EC state, causing zero IRQ1
    interrupts after init.
    
    Skipping only the deactivate command (while keeping F4 ENABLE)
    resolves the issue completely: both keystroke input and CapsLock
    LED toggle work correctly. The reverse test - skipping only F4
    while keeping F5 - makes the problem worse (zero keystroke
    interrupts), confirming F5 is the sole culprit.
    
    Add a DMI quirk entry for LENOVO/83QK using the existing
    atkbd_deactivate_fixup callback, consistent with the existing
    entries for LG Electronics and HONOR FMB-P that address the
    same EC F5 deactivate issue.
    
    Signed-off-by: Zeyu WANG <zeyu.thomas.wang@gmail.com>
    Link: https://patch.msgid.link/20260602170909.14725-1-zeyu.thomas.wang@gmail.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: atkbd - skip deactivate for HONOR BCC-N's internal keyboard [+ + +]
Author: Cryolitia PukNgae <cryolitia.pukngae@linux.dev>
Date:   Fri Jun 5 15:27:21 2026 +0800

    Input: atkbd - skip deactivate for HONOR BCC-N's internal keyboard
    
    commit fb402386af4cdce108ff991a796386de55439735 upstream.
    
    After commit 9cf6e24c9fbf17e52de9fff07f12be7565ea6d61 ("Input: atkbd -
    do not skip atkbd_deactivate() when skipping ATKBD_CMD_GETID"), HONOR
    BCC-N, aka HONOR MagicBook 14 2026's internal keyboard stops
    working. Adding the atkbd_deactivate_fixup quirk fixes it.
    
    DMI: HONOR BCC-N/BCC-N-PCB, BIOS 1.04 04/07/2026
    
    Fixes: 9cf6e24c9fbf17e52de9fff07f12be7565ea6d61 ("Input: atkbd - do not skip atkbd_deactivate() when skipping ATKBD_CMD_GETID")
    Reported-by: Hongfei Ren <lcrhf@outlook.com>
    Link: https://github.com/colorcube/Linux-on-Honor-Magicbook-14-Pro/issues/1#issuecomment-4562679891
    Tested-by: Hongfei Ren <lcrhf@outlook.com>
    Cc: stable@kernel.org
    Signed-off-by: Cryolitia PukNgae <cryolitia.pukngae@linux.dev>
    Link: https://patch.msgid.link/20260605-honor-v1-1-78e05e491193@linux.dev
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: atmel_mxt_ts - fix boundary check in mxt_prepare_cfg_mem [+ + +]
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Mon May 4 11:54:45 2026 -0700

    Input: atmel_mxt_ts - fix boundary check in mxt_prepare_cfg_mem
    
    commit baa0210fb6a9dc3882509a9411b6d284d88fe30e upstream.
    
    When a configuration file provides an object size that is larger than the
    driver's known mxt_obj_size(object), the driver intends to discard the
    extra bytes.
    
    The loop iterates using for (i = 0; i < size; i++). Inside the loop, the
    condition to skip processing extra bytes is:
    
        if (i > mxt_obj_size(object))
            continue;
    
    Since i is a 0-based index, the valid indices for the object are 0 through
    mxt_obj_size(object) - 1.
    
    When i == mxt_obj_size(object), the condition evaluates to false, and the
    code processes the byte instead of discarding it.
    
    This causes the code to calculate byte_offset = reg + i - cfg->start_ofs
    and writes the byte there, overwriting exactly one byte of the adjacent
    instance or object.
    
    Update the boundary check to skip extra bytes correctly by using >=.
    
    Fixes: 50a77c658b80 ("Input: atmel_mxt_ts - download device config using firmware loader")
    Cc: stable@vger.kernel.org
    Assisted-by: Gemini:gemini-3.1-pro
    Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
    Link: https://patch.msgid.link/20260504185448.4055973-1-dmitry.torokhov@gmail.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: elan_i2c - validate firmware size before use [+ + +]
Author: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date:   Sat Apr 25 22:07:06 2026 -0700

    Input: elan_i2c - validate firmware size before use
    
    commit 76b0d0baa9ae9c60e726bbe1b6ff0bec2c993634 upstream.
    
    Ensure that the firmware file is large enough to contain the expected
    number of pages and the signature (which resides at the end of the
    firmware blob) before accessing them to prevent potential out-of-bounds
    reads.
    
    Cc: stable@vger.kernel.org
    Link: https://patch.msgid.link/ae2dOgiFvXRm4BHo@google.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: ims-pcu - fix usb_free_coherent() size in ims_pcu_buffers_free() [+ + +]
Author: Thomas Fourier <fourier.thomas@gmail.com>
Date:   Fri May 22 10:54:04 2026 +0200

    Input: ims-pcu - fix usb_free_coherent() size in ims_pcu_buffers_free()
    
    commit dab48a7e74e6a394f3aa0461a2b1fb0c7b38fcb8 upstream.
    
    The input buffer size is pcu->max_in_size, but pcu->max_out_size is
    passed to usb_free_coherent().
    
    Change size to match the allocation size.
    
    Fixes: 628329d52474 ("Input: add IMS Passenger Control Unit driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
    Link: https://patch.msgid.link/20260522085412.45430-2-fourier.thomas@gmail.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: synaptics - add LEN2058 to SMBus passlist for ThinkPad E490 [+ + +]
Author: Nicolás Bazaes <contacto@bazaes.cl>
Date:   Wed May 13 21:35:49 2026 -0400

    Input: synaptics - add LEN2058 to SMBus passlist for ThinkPad E490
    
    commit 16ca52bc209fa4bf9239cd9e5643e95533476b58 upstream.
    
    The Lenovo ThinkPad E490 (PNP ID: LEN2058) has a Synaptics TM3471-020
    touchpad that supports SMBus/RMI4 mode but is not listed in
    smbus_pnp_ids[]. Without this entry, RMI4 over SMBus is not enabled
    by default, and the touchpad falls back to PS/2 mode.
    
    Adding LEN2058 to the passlist enables automatic RMI4 detection without
    requiring the psmouse.synaptics_intertouch parameter, and matches
    the behavior of similar ThinkPad models already in the list
    (E480/LEN2054, E580/LEN2055).
    
    Tested on ThinkPad E490 with kernel 7.0.5-zen1 and Arch Linux.
    RMI4 over SMBus is confirmed working without any kernel parameters.
    
    Signed-off-by: Nicolás Bazaes <contacto@bazaes.cl>
    Assisted-by: Claude:claude-sonnet-4-6
    Link: https://patch.msgid.link/20260514013552.14234-1-contacto@bazaes.cl
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: usbtouchscreen - clamp NEXIO data_len/x_len to URB buffer size [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Mon Apr 20 18:00:27 2026 +0200

    Input: usbtouchscreen - clamp NEXIO data_len/x_len to URB buffer size
    
    commit 2905281cbda52ec9df540113b35b835feb5fafd3 upstream.
    
    nexio_read_data() pulls data_len and x_len from a packed __be16 header
    in the device's interrupt packet and then walks packet->data[0..x_len)
    and packet->data[x_len..data_len) comparing each byte against a
    threshold.
    
    Both fields are 16-bit on the wire (max 65535).  The existing
    adjustments shave at most 0x100 / 0x80 off, so the loop bound can still
    reach roughly 0xfeff.  The URB transfer buffer for NEXIO is rept_size
    (1024) bytes from usb_alloc_coherent(), with the first 7 occupied by the
    packed header — so packet->data[] has 1017 valid bytes.  read_data()
    callbacks are not given urb->actual_length, and nothing else bounds the
    walk.
    
    A device that lies about its length can get a ~64 KiB out-of-bounds read
    past the coherent DMA allocation.  The first index whose byte exceeds
    NEXIO_THRESHOLD lands in begin_x / begin_y and from there into the
    reported touch coordinates, so adjacent kernel memory contents leak to
    userspace as ABS_X / ABS_Y events.  Far enough out, the read can also
    hit an unmapped page and fault.
    
    Fix this all by clamping data_len to the buffer's data[] capacity and
    x_len to data_len.
    
    Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Fixes: 5197424cdccc ("Input: usbtouchscreen - add NEXIO (or iNexio) support")
    Cc: stable <stable@kernel.org>
    Assisted-by: gkh_clanker_t1000
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Link: https://patch.msgid.link/2026042026-chlorine-epidermis-fd6d@gregkh
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
iomap: don't revert iov_iter on partially completed buffered writes [+ + +]
Author: Brian Foster <bfoster@redhat.com>
Date:   Fri Jun 12 08:10:47 2026 -0400

    iomap: don't revert iov_iter on partially completed buffered writes
    
    Gregg reports that the iomap retry behavior for nonblocking (nowait)
    append writes is broken. The problem occurs when an append write is
    first submitted in non-blocking mode (i.e. via io_uring), partially
    completes before hitting -EAGAIN, and then is resubmitted from
    blocking context.
    
    The specific problem is that at least one iteration of the loop in
    iomap_write_iter() completes in non-blocking context and thus has
    bumped i_size. The next iteration hits -EAGAIN, reverts the iov_iter
    and returns. io_uring retries the entire append write from blocking
    context, but since i_size has already been increased, the data that
    was partially written on the first attempt is rewritten at the new
    i_size. This is essentially an intra-write data corruption since the
    data written to the file does not reflect the write from userspace.
    
    This problem is already fixed on master as of commit 1a1a3b574b97
    ("iomap: advance the iter directly on buffered writes"). That commit
    was primarily intended to clean up iomap iter state tracking, but it
    also happened to remove the iov_iter revert and thus accidentally
    fix this problem as well. Without the revert, iomap will commit
    partial progress internally and loop once more before it more than
    likely hits -EAGAIN and returns partial progress consistent with the
    inode updates. This means the blocking retry from io_uring will pick
    up where the first attempt left off at the current i_size and
    perform the remainder of the write correctly.
    
    Cc: <stable@vger.kernel.org>
    Fixes: 18e419f6e80a ("iomap: Return -EAGAIN from iomap_write_iter()")
    Reported-by: Gregg Leventhal <gleventhal@janestreet.com>
    Reported-by: Eric Hagberg <ehagberg@janestreet.com>
    Signed-off-by: Brian Foster <bfoster@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
iommu, debugobjects: avoid gcc-16.1 section mismatch warnings [+ + +]
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Wed May 13 16:53:54 2026 +0200

    iommu, debugobjects: avoid gcc-16.1 section mismatch warnings
    
    commit 4c9ad387aa2d6785299722e54224d34764edaeb3 upstream.
    
    gcc-16 has gained some more advanced inter-procedual optimization
    techniques that enable it to inline the dummy_tlb_add_page() and
    dummy_tlb_flush() function pointers into a specialized version of
    __arm_v7s_unmap:
    
    WARNING: modpost: vmlinux: section mismatch in reference: __arm_v7s_unmap+0x2cc (section: .text) -> dummy_tlb_add_page (section: .init.text)
    ERROR: modpost: Section mismatches detected.
    
    >From what I can tell, the transformation is correct, as this is only
    called when __arm_v7s_unmap() is called from arm_v7s_do_selftests(),
    which is also __init. Since __arm_v7s_unmap() however is not __init,
    gcc cannot inline the inner function calls directly.
    
    In debug_objects_selftest(), the same thing happens. Both the
    caller and the leaf function are __init, but the IPA pulls
    it into a non-init one:
    
    WARNING: modpost: vmlinux: section mismatch in reference: lookup_object_or_alloc+0x7c (section: .text.lookup_object_or_alloc) -> is_static_object (section: .init.text)
    
    Marking the affected functions as not "__init" would reliably avoid this
    issue but is not a good solution because it removes an otherwise correct
    annotation. I tried marking the functions as 'noinline', but that ended
    up not covering all the affected configurations.
    
    With some more experimenting, I found that marking these functions as
    __attribute__((noipa)) is both logical and reliable.
    
    In order to keep the syntax readable, add a custom macro for this in
    include/linux/compiler_attributes.h next to other related macros and
    use it to annotate both files.
    
    Link: https://lore.kernel.org/all/abRB6g-48ZX6Yl2r@willie-the-truck/
    Cc: Will Deacon <will@kernel.org>
    Cc: Thomas Gleixner <tglx@kernel.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Miguel Ojeda <ojeda@kernel.org>
    Cc: linux-kbuild@vger.kernel.org
    Cc: stable@vger.kernel.org
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Acked-by: Will Deacon <will@kernel.org>
    Acked-by: Thomas Gleixner <tglx@kernel.org>
    Acked-by: Miguel Ojeda <ojeda@kernel.org>
    Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ip6: vti: Use ip6_tnl.net in vti6_changelink(). [+ + +]
Author: Kuniyuki Iwashima <kuniyu@google.com>
Date:   Thu May 21 21:05:54 2026 +0800

    ip6: vti: Use ip6_tnl.net in vti6_changelink().
    
    commit 11b326fb0a374f4654f9be22d0f0f7abd9f7d3fe upstream.
    
    ip netns add ns1
    ip netns add ns2
    ip -n ns1 link add vti6_test type vti6 remote ::1 local ::2 key 7
    ip -n ns1 link set vti6_test netns ns2
    ip -n ns2 link set vti6_test type vti6 remote ::3 local ::4 key 9
    ip netns del ns2
    ip netns del ns1
    [  132.495484] ------------[ cut here ]------------
    [  132.497609] kernel BUG at net/core/dev.c:12376!
    
    Commit 61220ab34948 ("vti6: Enable namespace changing") dropped
    NETIF_F_NETNS_LOCAL from vti6 devices. A vti6 tunnel can then
    move through IFLA_NET_NS_FD. After the move dev_net(dev) points
    at the new netns while t->net stays at the creation netns.
    
    vti6_changelink() and vti6_update() still use dev_net(dev) and
    dev_net(t->dev). They unlink from one per netns hash and relink
    into another. The creation netns is left with a stale entry.
    cleanup_net() of that netns later walks freed memory.
    
    Reachable from an unprivileged user namespace (unshare --user
    --map-root-user --net). Cross tenant scope on container hosts.
    
    Fixes: 61220ab34948 ("vti6: Enable namespace changing")
    Reported-by: Maoyi Xie <maoyi.xie@ntu.edu.sg>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Cc: stable@vger.kernel.org # v5.15+
    Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
    Link: https://patch.msgid.link/20260521130555.3421684-2-maoyixie.tju@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ip6: vti: Use ip6_tnl.net in vti6_siocdevprivate(). [+ + +]
Author: Maoyi Xie <maoyixie.tju@gmail.com>
Date:   Thu May 21 21:05:55 2026 +0800

    ip6: vti: Use ip6_tnl.net in vti6_siocdevprivate().
    
    commit 8b484efd5cb4eeef9021a661e198edc5349dacf6 upstream.
    
    After patch 1/2 in this series, vti6_update() unlinks and relinks
    the tunnel through t->net. vti6_siocdevprivate() still uses
    dev_net(dev) for the collision lookup. For a tunnel moved through
    IFLA_NET_NS_FD, dev_net(dev) is the new netns, not t->net.
    
    SIOCCHGTUNNEL on a migrated tunnel then runs:
    
      net = dev_net(dev)                    /* migrated netns */
      t   = vti6_locate(net, &p1, false)    /* misses target in t->net */
      ...
      t   = netdev_priv(dev)
      vti6_update(t, &p1, false)            /* mutates t->net's hash */
    
    A caller in the migrated netns picks params that match a tunnel
    in the creation netns. The lookup in dev_net(dev) finds nothing.
    vti6_update() prepends the migrated tunnel at the head of the
    creation netns hash bucket for those params. Later lookups in
    the creation netns resolve to the migrated device. xfrm receive
    delivers the matched packets through a device the caller controls.
    
    Reachable from an unprivileged user namespace (unshare --user
    --map-root-user --net). Cross tenant scope on container hosts.
    
    Switch the SIOCCHGTUNNEL path on a non fallback device to use
    t->net for the lookup. The lookup now matches the netns
    vti6_update() operates on.
    
    Also add ns_capable(self->net->user_ns, CAP_NET_ADMIN) before
    the lookup. The check at the top of the case is against
    dev_net(dev)->user_ns, which after migration is the attacker's
    netns. A caller there can pick params absent from self->net,
    the lookup returns NULL, t becomes self, and vti6_update()
    inserts the device into the creation netns hash. The new check
    requires CAP_NET_ADMIN in the creation netns user_ns too.
    
    SIOCADDTUNNEL and SIOCCHGTUNNEL on the fallback device keep
    dev_net(dev), which equals init_net there.
    
    Fixes: 61220ab34948 ("vti6: Enable namespace changing")
    Suggested-by: Jakub Kicinski <kuba@kernel.org>
    Suggested-by: Xiao Liang <shaw.leon@gmail.com>
    Cc: stable@vger.kernel.org # v5.15+
    Signed-off-by: Maoyi Xie <maoyixie.tju@gmail.com>
    Link: https://patch.msgid.link/20260521130555.3421684-3-maoyixie.tju@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ip6_vti: fix incorrect tunnel matching in vti6_tnl_lookup() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Mon Jun 8 16:46:13 2026 +0000

    ip6_vti: fix incorrect tunnel matching in vti6_tnl_lookup()
    
    [ Upstream commit a5c0359f5cbc51a2e2b114d6041e0f3c73f903e9 ]
    
    In vti6_tnl_lookup(), when an exact match for a tunnel fails,
    the code falls back to searching for wildcard tunnels:
    
    - Tunnels matching the packet's local address, with any remote address
      wildcard remote).
    
    - Tunnels matching the packet's remote address, with any local address
      (wildcard local).
    
    However, vti6 stores all these different types of tunnels in the same
    hash table (ip6n->tnls_r_l) prone to hash collisions.
    
    The bug is that the fallback search loops in vti6_tnl_lookup() were
    missing checks to ensure that the candidate tunnel actually has
    a wildcard address.
    
    Fixes: fbe68ee87522 ("vti6: Add a lookup method for tunnels with wildcard endpoints.")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Steffen Klassert <steffen.klassert@secunet.com>
    Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
    Link: https://patch.msgid.link/20260608164613.933023-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ipc/shm: serialize orphan cleanup with shm_nattch updates [+ + +]
Author: Yilin Zhu <zylzyl2333@gmail.com>
Date:   Thu Apr 30 13:21:34 2026 +0800

    ipc/shm: serialize orphan cleanup with shm_nattch updates
    
    commit 2e5c6f4fd4001562781e99bbfc7f1f0127187542 upstream.
    
    shm_destroy_orphaned() walks the shm idr under shm_ids(ns).rwsem, but that
    does not serialize all fields tested by shm_may_destroy().  In particular,
    shm_nattch is updated while holding shm_perm.lock, and attach paths can do
    that without holding the rwsem.
    
    Do not decide that an orphaned segment is unused before taking the object
    lock.  Move the shm_may_destroy() check under shm_perm.lock, matching the
    other destroy paths, and unlock the segment when it no longer qualifies
    for removal.
    
    Link: https://lore.kernel.org/9d97cc1031de2d0bace0edf3a668818aa2f4eca6.1777410234.git.zylzyl2333@gmail.com
    Fixes: 4c677e2eefdb ("shm: optimize locking and ipc_namespace getting")
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Signed-off-by: Yilin Zhu <zylzyl2333@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Cc: Christian Brauner <brauner@kernel.org>
    Cc: Jeongjun Park <aha310510@gmail.com>
    Cc: Kees Cook <kees@kernel.org>
    Cc: Liam Howlett <liam@infradead.org>
    Cc: Lorenzo Stoakes <ljs@kernel.org>
    Cc: Serge Hallyn <sergeh@kernel.org>
    Cc: Vasiliy Kulikov <segoon@openwall.com>
    Cc: Davidlohr Bueso <dave@stgolabs.net>
    Cc: Oleg Nesterov <oleg@redhat.com>
    Cc: Serge Hallyn <serge@hallyn.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ipc: limit next_id allocation to the valid ID range [+ + +]
Author: Linpu Yu <linpu5433@gmail.com>
Date:   Sun May 10 13:43:30 2026 +0800

    ipc: limit next_id allocation to the valid ID range
    
    commit fa0b9b2b7ae3539908d69c2b9ac0d144d9bc5139 upstream.
    
    The checkpoint/restore sysctl path can request the next SysV IPC id
    through ids->next_id.  ipc_idr_alloc() currently forwards that request to
    idr_alloc() with an open-ended upper bound.
    
    If the valid tail of the SysV IPC id space is full, the allocation can
    spill beyond ipc_mni.  The returned SysV IPC id still uses the normal
    index encoding, so later lookup and removal can target the wrong slot.
    This leaves the real IDR entry behind and breaks the IDR state for the
    object.
    
    The bug is in ipc_idr_alloc() in the checkpoint/restore path.
    
    1. ids->next_id is passed to:
    
           idr_alloc(&ids->ipcs_idr, new, ipcid_to_idx(next_id), 0, ...)
    
    2. The zero upper bound makes the allocation effectively open-ended.
       Once the valid SysV IPC tail is occupied, idr_alloc() can spill past
       ipc_mni and allocate an entry beyond the valid IPC id range.
    
    3. The new object id is still encoded with the narrower SysV IPC index
       width:
    
           new->id = (new->seq << ipcmni_seq_shift()) + idx
    
    4. Later removal goes through ipc_rmid(), which uses:
    
           ipcid_to_idx(ipcp->id)
    
       That truncates the real IDR index. An object actually stored at a
       high index can then be removed as if it lived at a low in-range
       index.
    
    5. For shared memory, shm_destroy() frees the current object anyway, but
       the real high IDR slot is left behind as a dangling pointer.
    
    6. A subsequent walk of /proc/sysvipc/shm reaches the stale IDR entry
       and dereferences freed memory.
    
    Prevent this by bounding the requested allocation to ipc_mni so the
    checkpoint/restore path fails once the valid range is exhausted.
    
    Link: https://lore.kernel.org/cover.1778336914.git.linpu5433@gmail.com
    Link: https://lore.kernel.org/2eebe949bfa7d1f6e13b5be6a92c64c850ce9d45.1778336914.git.linpu5433@gmail.com
    Fixes: 03f595668017 ("ipc: add sysctl to specify desired next object id")
    Signed-off-by: Linpu Yu <linpu5433@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Cc: Kees Cook <kees@kernel.org>
    Cc: Stanislav Kinsbursky <skinsbursky@parallels.com>
    Cc: Davidlohr Bueso <dave@stgolabs.net>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ipmi: Fix rcu_read_unlock to srcu_read_unlock in handle_read_event_rsp [+ + +]
Author: Rui Qi <qirui.001@bytedance.com>
Date:   Mon May 25 14:32:35 2026 +0800

    ipmi: Fix rcu_read_unlock to srcu_read_unlock in handle_read_event_rsp
    
    Fix a bug where rcu_read_unlock() was used instead of srcu_read_unlock()
    in handle_read_event_rsp() when ipmi_alloc_recv_msg() fails.
    
    This mismatch leads to an SRCU read-side critical section imbalance: the
    entry uses srcu_read_lock(&intf->users_srcu) but the error path
    incorrectly calls rcu_read_unlock(), which is a no-op for SRCU and
    leaves the SRCU lock held.
    
    The offending code was restructured in mainline by commit 3be997d5a64a
    ("ipmi:msghandler: Remove srcu from the ipmi user structure"), which
    replaced the SRCU locking with a mutex in this function, effectively
    eliminating the mismatch. However, that commit is part of a larger
    SRCU removal series that is not suitable for stable backport. This
    minimal fix addresses the SRCU imbalance for 6.12 and earlier stable
    branches that still carry the original locking scheme.
    
    Fixes: e86ee2d44b44 ("ipmi: Rework locking and shutdown for hot remove")
    Cc: stable@vger.kernel.org
    Signed-off-by: Rui Qi <qirui.001@bytedance.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Linux: ipmi:ssif: Clean up kthread on errors [+ + +]
Author: Corey Minyard <corey@minyard.net>
Date:   Mon Apr 13 08:00:23 2026 -0500

    ipmi:ssif: Clean up kthread on errors
    
    commit 75c486cb1bcaa1a3ec3a6438498176a3a4998ae4 upstream.
    
    If an error occurs after the ssif kthread is created, but before the
    main IPMI code starts the ssif interface, the ssif kthread will not
    be stopped.
    
    So make sure the kthread is stopped on an error condition if it is
    running.
    
    Fixes: 259307074bfc ("ipmi: Add SMBus interface driver (SSIF)")
    Reported-by: Li Xiao <<252270051@hdu.edu.cn>
    Cc: stable@vger.kernel.org
    Reviewed-by: Li Xiao <252270051@hdu.edu.cn>
    Signed-off-by: Corey Minyard <corey@minyard.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux: ipmi:ssif: Fix a shutdown race [+ + +]
Author: Corey Minyard <corey@minyard.net>
Date:   Thu Apr 10 14:44:26 2025 -0500

    ipmi:ssif: Fix a shutdown race
    
    commit 6bd0eb6d759b9a22c5509ea04e19c2e8407ba418 upstream.
    
    It was possible for the SSIF thread to stop and quit before the
    kthread_stop() call because ssif->stopping was set before the
    stop.  So only exit the SSIF thread is kthread_should_stop()
    returns true.
    
    There is no need to wake the thread, as the wait will be interrupted
    by kthread_stop().
    
    Signed-off-by: Corey Minyard <cminyard@mvista.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux: ipmi:ssif: NULL thread on error [+ + +]
Author: Corey Minyard <corey@minyard.net>
Date:   Tue Apr 21 06:50:22 2026 -0500

    ipmi:ssif: NULL thread on error
    
    commit a8aebe93a4938c0ca1941eeaae821738f869be3d upstream.
    
    Cleanup code was checking the thread for NULL, but it was possibly
    a PTR_ERR() in one spot.
    
    Spotted with static analysis.
    
    Link: https://sourceforge.net/p/openipmi/mailman/message/59324676/
    Fixes: 75c486cb1bca ("ipmi:ssif: Clean up kthread on errors")
    Cc: <stable@vger.kernel.org> # 91eb7ec72612: ipmi:ssif: Remove unnecessary indention
    Cc: stable@vger.kernel.org
    Signed-off-by: Corey Minyard <corey@minyard.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux: ipmi:ssif: Remove unnecessary indention [+ + +]
Author: Corey Minyard <corey@minyard.net>
Date:   Mon Apr 13 07:09:15 2026 -0500

    ipmi:ssif: Remove unnecessary indention
    
    commit 91eb7ec7261254b6875909df767185838598e21e upstream.
    
    A section was in {} that didn't need to be, move the variable
    definition to the top and set th eindentino properly.
    
    Signed-off-by: Corey Minyard <corey@minyard.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ipv4: free net->ipv4.sysctl_local_reserved_ports after unregister_net_sysctl_table() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu May 21 12:21:47 2026 +0000

    ipv4: free net->ipv4.sysctl_local_reserved_ports after unregister_net_sysctl_table()
    
    [ Upstream commit 87a1e0fe7776da7ab411be332b4be58ac8840d10 ]
    
    ipv4_sysctl_exit_net() is currently freeing net->ipv4.sysctl_local_reserved_ports
    too soon.
    
    Only after unregister_net_sysctl_table() we can be sure no threads can possibly
    use the sysctls, including /proc/sys/net/ipv4/ip_local_reserved_ports.
    
    Fixes: 122ff243f5f1 ("ipv4: make ip_local_reserved_ports per netns")
    Reported-by: Ji'an Zhou <eilaimemedsnaimel@gmail.com>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Cc: Cong Wang <xiyou.wangcong@gmail.com>
    Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
    Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
    Link: https://patch.msgid.link/20260521122147.3584624-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ipv4: restrict IPOPT_SSRR and IPOPT_LSRR options [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Tue Jun 2 16:15:47 2026 +0000

    ipv4: restrict IPOPT_SSRR and IPOPT_LSRR options
    
    [ Upstream commit d3915a1f5a4bc0ac911032903c3c6ab8df9fcc7c ]
    
    This patch restricts setting Loose Source and Record Route (LSRR)
    and Strict Source and Record Route (SSRR) IP options to users
    with CAP_NET_RAW capability.
    
    This prevents unprivileged applications from forcing packets to route
    through attacker-controlled nodes to leak TCP ISN and possibly other
    protocol information.
    
    While LSRR and SSRR are commonly filtered in many network environments,
    they may still be supported and forwarded along some network paths.
    
    RFC 7126 (Recommendations on Filtering of IPv4 Packets Containing
    IPv4 Options) recommend to drop these options in 4.3 and 4.4.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Reported-by: Tamir Shahar <tamirthesis@gmail.com>
    Reported-by: Amit Klein <aksecurity@gmail.com>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: David Ahern <dsahern@kernel.org>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260602161547.2642155-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ipv6: exthdrs: refresh nh after handling HAO option [+ + +]
Author: Zhengchuan Liang <zcliangcn@gmail.com>
Date:   Fri May 22 17:42:26 2026 +0800

    ipv6: exthdrs: refresh nh after handling HAO option
    
    commit f7b52afe3592eae66e160586b45a3f2242972c63 upstream.
    
    ip6_parse_tlv() caches skb_network_header(skb) in nh while walking
    IPv6 TLVs.
    
    ipv6_dest_hao() may call pskb_expand_head() for a cloned skb, which can
    move the skb head and invalidate the cached network header pointer.
    Refresh nh after ipv6_dest_hao() returns so any trailing padding or TLVs
    are parsed from the current skb head.
    
    This matches the existing pattern used in ip6_parse_tlv() after helpers
    that can modify skb header storage.
    
    Fixes: a831f5bbc89a ("[IPV6] MIP6: Add inbound interface of home address option.")
    Cc: stable@kernel.org
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Co-developed-by: Luxing Yin <tr0jan@lzu.edu.cn>
    Signed-off-by: Luxing Yin <tr0jan@lzu.edu.cn>
    Signed-off-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Reviewed-by: Justin Iurman <justin.iurman@gmail.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/7aba1debc2196189172499e5769802b026f8caf8.1779247873.git.zcliangcn@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ipv6: exthdrs: refresh nh pointer after ipv6_hop_jumbo() [+ + +]
Author: Justin Iurman <justin.iurman@gmail.com>
Date:   Fri May 22 13:20:13 2026 +0200

    ipv6: exthdrs: refresh nh pointer after ipv6_hop_jumbo()
    
    commit d47548a36639095939f4747d4c43f2271366f565 upstream.
    
    ipv6_hop_jumbo() calls pskb_trim_rcsum(), which can change skb pointers.
    Let's recompute nh pointer to make sure any change won't mess things up.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Justin Iurman <justin.iurman@gmail.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260522112013.12342-1-justin.iurman@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ipv6: fix possible infinite loop in fib6_select_path() [+ + +]
Author: Jiayuan Chen <jiayuan.chen@linux.dev>
Date:   Wed May 27 13:31:31 2026 +0800

    ipv6: fix possible infinite loop in fib6_select_path()
    
    [ Upstream commit 9c7da87c2dc860bb17ca1ece942495d28b1ce3b9 ]
    
    Found while auditing the same pattern Sashiko reported in
    rt6_fill_node() [1]. Apply the same fix as
    commit f8d8ce1b515a ("ipv6: fix possible infinite loop in fib6_info_uses_dev()").
    
    Writers holding tb6_lock can list_del_rcu(&first->fib6_siblings)
    without waiting for RCU readers; first->fib6_siblings.next then
    still points into the old ring and this softirq-side walker never
    reaches &first->fib6_siblings as its terminator. fib6_purge_rt()
    always WRITE_ONCE()s first->fib6_nsiblings to 0 before
    list_del_rcu(), so an inside-loop check is a reliable detach signal.
    
    [1] https://sashiko.dev/#/patchset/20260526020227.4857-1-jiayuan.chen%40linux.dev
    
    Fixes: d9ccb18f83ea ("ipv6: Fix soft lockups in fib6_select_path under high next hop churn")
    Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260527053133.180695-2-jiayuan.chen@linux.dev
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ipv6: fix possible infinite loop in rt6_fill_node() [+ + +]
Author: Jiayuan Chen <jiayuan.chen@linux.dev>
Date:   Wed May 27 13:31:30 2026 +0800

    ipv6: fix possible infinite loop in rt6_fill_node()
    
    [ Upstream commit 9f72412bcf60144f252b0d6205106abf14344abc ]
    
    Sashiko reported this issue [1]. Apply the same fix as
    commit f8d8ce1b515a ("ipv6: fix possible infinite loop in fib6_info_uses_dev()").
    
    Writers holding tb6_lock can list_del_rcu(&rt->fib6_siblings)
    without waiting for RCU readers; rt->fib6_siblings.next then still
    points into the old ring and this softirq-side walker never reaches
    &rt->fib6_siblings, causing a CPU stall. fib6_del_route() always
    WRITE_ONCE()s rt->fib6_nsiblings to 0 before list_del_rcu(), so an
    inside-loop check is a reliable detach signal.
    
    [1] https://sashiko.dev/#/patchset/20260526020227.4857-1-jiayuan.chen%40linux.dev
    
    Fixes: d9ccb18f83ea ("ipv6: Fix soft lockups in fib6_select_path under high next hop churn")
    Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260527053133.180695-1-jiayuan.chen@linux.dev
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ipv6: ioam: add NULL check for idev in ipv6_hop_ioam() [+ + +]
Author: Justin Iurman <justin.iurman@gmail.com>
Date:   Fri May 29 20:50:58 2026 -0400

    ipv6: ioam: add NULL check for idev in ipv6_hop_ioam()
    
    [ Upstream commit d4ea0dfd75011b78cebf3808f98ac4c4f51a6fb9 ]
    
    Reported by Sashiko:
    
    The function ipv6_hop_ioam() accesses
    __in6_dev_get(skb->dev)->cnf.ioam6_enabled without validating the returned
    idev pointer. Because addrconf_ifdown() can concurrently clear dev->ip6_ptr
    via RCU, __in6_dev_get() can return NULL during interface teardown, which
    could cause a NULL pointer dereference when processing an IOAM Hop-by-Hop
    option.
    
    Let's add a check and use SKB_DROP_REASON_IPV6DISABLED accordingly.
    
    Fixes: 9ee11f0fff20 ("ipv6: ioam: Data plane support for Pre-allocated Trace")
    Cc: stable@vger.kernel.org
    Signed-off-by: Justin Iurman <justin.iurman@gmail.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Link: https://patch.msgid.link/20260517183059.29140-1-justin.iurman@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [ dropped READ_ONCE() wrapper from idev->cnf.ioam6_enabled ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ipv6: mcast: Fix use-after-free when processing MLD queries [+ + +]
Author: Ido Schimmel <idosch@nvidia.com>
Date:   Wed Jun 3 13:18:11 2026 +0300

    ipv6: mcast: Fix use-after-free when processing MLD queries
    
    commit 791c91dc7a9dfb2457d5e29b8216a6484b9c4b40 upstream.
    
    When processing an MLD query, a pointer to the multicast group address
    is retrieved when initially parsing the packet. This pointer is later
    dereferenced without being reloaded despite the fact that the skb header
    might have been reallocated following the pskb_may_pull() calls, leading
    to a use-after-free [1].
    
    Fix by copying the multicast group address when the packet is initially
    parsed.
    
    [1]
    BUG: KASAN: slab-use-after-free in __mld_query_work (net/ipv6/mcast.c:1512)
    Read of size 8 at addr ffff8881154b8e90 by task kworker/4:1/118
    
    Workqueue: mld mld_query_work
    Call Trace:
    <TASK>
    dump_stack_lvl (lib/dump_stack.c:94 lib/dump_stack.c:120)
    print_address_description.constprop.0 (mm/kasan/report.c:378)
    print_report (mm/kasan/report.c:482)
    kasan_report (mm/kasan/report.c:595)
    __mld_query_work (net/ipv6/mcast.c:1512)
    mld_query_work (net/ipv6/mcast.c:1563)
    process_one_work (kernel/workqueue.c:3314)
    worker_thread (kernel/workqueue.c:3397 kernel/workqueue.c:3478)
    kthread (kernel/kthread.c:436)
    ret_from_fork (arch/x86/kernel/process.c:158)
    ret_from_fork_asm (arch/x86/entry/entry_64.S:245)
    </TASK>
    
    [...]
    
    Freed by task 118:
    kasan_save_stack (mm/kasan/common.c:57)
    kasan_save_track (mm/kasan/common.c:78)
    kasan_save_free_info (mm/kasan/generic.c:584)
    __kasan_slab_free (mm/kasan/common.c:253 mm/kasan/common.c:285)
    kfree (./include/linux/kasan.h:235 mm/slub.c:2689 mm/slub.c:6251 mm/slub.c:6566)
    pskb_expand_head (net/core/skbuff.c:2335)
    __pskb_pull_tail (net/core/skbuff.c:2878 (discriminator 4))
    __mld_query_work (net/ipv6/mcast.c:1495 (discriminator 1))
    mld_query_work (net/ipv6/mcast.c:1563)
    process_one_work (kernel/workqueue.c:3314)
    worker_thread (kernel/workqueue.c:3397 kernel/workqueue.c:3478)
    kthread (kernel/kthread.c:436)
    ret_from_fork (arch/x86/kernel/process.c:158)
    ret_from_fork_asm (arch/x86/entry/entry_64.S:245)
    
    Fixes: 97300b5fdfe2 ("[MCAST] IPv6: Check packet size when process Multicast")
    Reported-by: Leo Lin <leo@depthfirst.com>
    Reviewed-by: David Ahern <dahern@nvidia.com>
    Signed-off-by: Ido Schimmel <idosch@nvidia.com>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
    Link: https://patch.msgid.link/20260603101811.612594-1-idosch@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ipv6: rpl: fix hdrlen overflow in ipv6_rpl_srh_decompress() [+ + +]
Author: Rahul Chandelkar <rc@rexion.ai>
Date:   Mon May 25 21:10:31 2026 +0530

    ipv6: rpl: fix hdrlen overflow in ipv6_rpl_srh_decompress()
    
    [ Upstream commit 9d5e7a46a9f6d8f503b41bfefef70659845f1679 ]
    
    ipv6_rpl_srh_decompress() computes:
    
        outhdr->hdrlen = (((n + 1) * sizeof(struct in6_addr)) >> 3);
    
    hdrlen is __u8. For n >= 127 the result exceeds 255 and silently
    truncates. With n=127 (cmpri=15, cmpre=15, pad=0, hdrlen=16):
    
        (128 * 16) >> 3 = 256, truncated to 0 as __u8
    
    The caller in ipv6_rpl_srh_rcv() then places the compressed header
    at buf + ((ohdr->hdrlen + 1) << 3). With hdrlen=0 this is buf + 8,
    but the decompressed region occupies buf[0..2055] (8-byte header
    plus 128 full addresses). The compressed header overlaps the
    decompressed data, and ipv6_rpl_srh_compress() writes into this
    overlap, corrupting the routing header of the forwarded packet.
    
    The existing guard at exthdrs.c:546 checks (n + 1) > 255, which
    prevents n+1 from overflowing unsigned char (the segments_left
    field), but does not prevent the computed hdrlen from overflowing
    __u8. n=127 passes because 128 <= 255, yet hdrlen=256 does not
    fit.
    
    Tighten the bound to (n + 1) > 127. This caps n at 126, giving
    hdrlen = (127 * 16) >> 3 = 254, which fits in __u8. The compressed
    header then lands at buf + ((254 + 1) << 3) = buf + 2040, exactly
    past the decompressed region (buf[0..2039]). No overlap. 127
    segments is well beyond any realistic RPL deployment.
    
    Fixes: 8610c7c6e3bd ("net: ipv6: add support for rpl sr exthdr")
    Signed-off-by: Rahul Chandelkar <rc@rexion.ai>
    Link: https://patch.msgid.link/20260525154031.2290876-1-rc@rexion.ai
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ipv6: sit: reload inner IPv6 header after GSO offloads [+ + +]
Author: Kyle Zeng <kylebot@openai.com>
Date:   Fri Jun 5 00:34:48 2026 -0700

    ipv6: sit: reload inner IPv6 header after GSO offloads
    
    [ Upstream commit f0e42f0c4337b1f220de1ddd63f47197c7dee4de ]
    
    ipip6_tunnel_xmit() caches the inner IPv6 header pointer at function
    entry and continues using it after iptunnel_handle_offloads().
    
    For GSO skbs, iptunnel_handle_offloads() calls skb_header_unclone().
    When the skb header is cloned, skb_header_unclone() can call
    pskb_expand_head(), which may move the skb head. The pskb_expand_head()
    contract requires pointers into the skb header to be reloaded after the
    call.
    
    If the later skb_realloc_headroom() branch is not taken, SIT uses the
    stale iph6 pointer to read the inner hop limit and DS field. That can
    read from a freed skb head after the old head's remaining clone is
    released.
    
    Reload iph6 after the offload helper succeeds and before subsequent
    reads from the inner IPv6 header. Keep the existing reload after
    skb_realloc_headroom(), since that branch can also replace the skb.
    
    Fixes: 14909664e4e1 ("sit: Setup and TX path for sit/UDP foo-over-udp encapsulation")
    Signed-off-by: Kyle Zeng <kylebot@openai.com>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Reported-by: syzbot+6eb9ca986d80f6f88cf9@syzkaller.appspotmail.com
    Link: https://patch.msgid.link/20260605073448.6524-1-kylebot@openai.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ipv6: validate extension header length before copying to cmsg [+ + +]
Author: Qi Tang <tpluszz77@gmail.com>
Date:   Sat May 23 22:32:45 2026 +0800

    ipv6: validate extension header length before copying to cmsg
    
    commit dd433671fef381fdaf7b530c631e6b782d66e224 upstream.
    
    ip6_datagram_recv_specific_ctl() builds IPV6_{HOPOPTS,DSTOPTS,RTHDR}
    cmsgs (and their IPV6_2292* legacy counterparts) by trusting the
    on-wire hdrlen byte (ptr[1]) when computing the put_cmsg() length.
    The length was validated only at parse time (ipv6_parse_hopopts(),
    etc.).  An nftables payload-write expression can rewrite hdrlen after
    parsing and before the skb reaches recvmsg; the write itself is
    in-bounds but put_cmsg() then reads up to ((hdrlen+1) << 3) = 2040
    bytes from an 8-byte header.  nftables is reachable from an
    unprivileged user namespace, so this is an unprivileged
    slab-out-of-bounds read:
    
      BUG: KASAN: slab-out-of-bounds in put_cmsg+0x3ac/0x540
       put_cmsg+0x3ac/0x540
       udpv6_recvmsg+0xca0/0x1250
       sock_recvmsg+0xdf/0x190
       ____sys_recvmsg+0x1b1/0x620
    
    Add ipv6_get_exthdr_len() which validates that at least two bytes
    are accessible before reading the hdrlen field, then checks the
    computed length against skb_tail_pointer(skb), returning 0 on
    failure.  Extension headers are kept in the linear skb area by
    pskb_may_pull() during input, so skb_tail_pointer() is the correct
    bound.
    
    Use ipv6_get_exthdr_len() at all non-AH call sites: the five
    standalone cmsg blocks (HbH, 2292HbH, 2292DSTOPTS x2, 2292RTHDR)
    and the three standard cases in the extension-header walk loop
    (DSTOPTS, ROUTING, default).  AH retains an inline bounds check
    because its length formula differs ((ptr[1]+2)<<2).
    
    The walk loop also gets a pre-read bounds check at the top to
    validate ptr before any case accesses ptr[0] or ptr[1].
    
    When the walk loop detects a corrupted header, return from the
    function instead of continuing to process later socket options.
    
    Cc: stable@vger.kernel.org
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Qi Tang <tpluszz77@gmail.com>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/20260523143245.2281415-1-tpluszz77@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ipvs: clear the svc scheduler ptr early on edit [+ + +]
Author: Julian Anastasov <ja@ssi.bg>
Date:   Mon May 25 07:07:44 2026 +0300

    ipvs: clear the svc scheduler ptr early on edit
    
    [ Upstream commit 193989cc6d80dd8e0460fb3992e69fa03bf0ff9b ]
    
    ip_vs_edit_service() while unbinding the old scheduler clears
    the svc->scheduler ptr after the scheduler module initiates
    RCU callbacks. This can cause packets to use the old
    scheduler at the time when svc->sched_data is already freed
    after RCU grace period.
    
    Fix it by clearing the ptr early in ip_vs_unbind_scheduler(),
    before the done_service method schedules any RCU callbacks.
    
    Also, if the new scheduler fails to initialize when replacing
    the old scheduler, try to restore the old scheduler while still
    returning the error code.
    
    Link: https://sashiko.dev/#/patchset/20260519015506.634185-1-rosenp%40gmail.com
    Fixes: 05f00505a89a ("ipvs: fix crash if scheduler is changed")
    Signed-off-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

ipvs: skip ipv6 extension headers for csum checks [+ + +]
Author: Julian Anastasov <ja@ssi.bg>
Date:   Sat Feb 14 16:58:49 2026 +0200

    ipvs: skip ipv6 extension headers for csum checks
    
    commit 05cfe9863ef049d98141dc2969eefde72fb07625 upstream.
    
    Protocol checksum validation fails for IPv6 if there are extension
    headers before the protocol header. iph->len already contains its
    offset, so use it to fix the problem.
    
    Fixes: 2906f66a5682 ("ipvs: SCTP Trasport Loadbalancing Support")
    Fixes: 0bbdd42b7efa ("IPVS: Extend protocol DNAT/SNAT and state handlers")
    Signed-off-by: Julian Anastasov <ja@ssi.bg>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Nazar Kalashnikov <nazarkalashnikov0@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ksmbd: fix use-after-free of a deferred file_lock on double SMB2_CANCEL [+ + +]
Author: Gil Portnoy <dddhkts1@gmail.com>
Date:   Mon Jun 1 08:27:56 2026 +0900

    ksmbd: fix use-after-free of a deferred file_lock on double SMB2_CANCEL
    
    commit f580d27e8928828693df44ba2db0fffdbe11dfea upstream.
    
    A deferred byte-range lock (an SMB2_LOCK that blocks) registers an async work on
    conn->async_requests via setup_async_work(), with cancel_fn =
    smb2_remove_blocked_lock and cancel_argv[0] pointing at the struct file_lock.
    
    When the request is cancelled, the worker frees the file_lock with
    locks_free_lock() and takes the cancelled early-exit, which "goto out"s and never
    reaches release_async_work() -- the only site that unlinks the work from
    conn->async_requests and clears cancel_fn/cancel_argv. The work therefore stays
    matchable on async_requests with a live cancel_fn pointing at the freed file_lock,
    until connection teardown finally runs release_async_work().
    
    smb2_cancel() fires cancel_fn unconditionally with no state guard, so a second
    SMB2_CANCEL for the same AsyncId, arriving in that window, re-runs
    smb2_remove_blocked_lock() on the freed file_lock -- a slab use-after-free:
    
      BUG: KASAN: slab-use-after-free in __locks_delete_block
        __locks_delete_block
        locks_delete_block
        ksmbd_vfs_posix_lock_unblock
        smb2_remove_blocked_lock
        smb2_cancel                 <- 2nd SMB2_CANCEL fires cancel_fn
        handle_ksmbd_work
      Allocated by ...: locks_alloc_lock <- smb2_lock
      Freed by ...:     locks_free_lock  <- smb2_lock (cancelled branch)
      ... cache file_lock_cache of size 192
    
    Reproduced on mainline with KASAN by an authenticated SMB client.
    
    Skip a work whose state is already KSMBD_WORK_CANCELLED so its cancel callback
    cannot be fired a second time.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Gil Portnoy <dddhkts1@gmail.com>
    Acked-by: Namjae Jeon <linkinjeon@kernel.org>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ksmbd: OOB read regression in smb_check_perm_dacl() ACE-walk loops [+ + +]
Author: Ali Ganiyev <ali.qaniyev@gmail.com>
Date:   Mon May 25 10:23:47 2026 +0900

    ksmbd: OOB read regression in smb_check_perm_dacl() ACE-walk loops
    
    commit 0e60dafe97eca61721f3db456f97d97a80c6c8ae upstream.
    
    Commit d07b26f39246 ("ksmbd: require minimum ACE size in
    smb_check_perm_dacl()") introduced a transposed bounds check:
    
        if (offsetof(struct smb_ace, sid) + aces_size < CIFS_SID_BASE_SIZE)
    
    Since offsetof(..sid) is 8 and CIFS_SID_BASE_SIZE is 8, this evaluates
    to `aces_size < 0`. Because `aces_size` is always non-negative, this
    check becomes dead code and never breaks the loop.
    
    Worse, that commit removed the old 4-byte guard, meaning the loop now
    reads `ace->size` (offset 2) even when `aces_size` is 0-3 bytes. This
    re-opens a 2-byte heap out-of-bounds (OOB) read past the pntsd allocation
    during subsequent SMB2_CREATE operations.
    
    Fix this by properly transposing the comparison to require at least
    16 bytes (8-byte offset + 8-byte SID base), matching the correct form
    used in smb_inherit_dacl().
    
    Fixes: d07b26f39246 ("ksmbd: require minimum ACE size in smb_check_perm_dacl()")
    Cc: stable@vger.kernel.org
    Signed-off-by: Ali Ganiyev <ali.qaniyev@gmail.com>
    Acked-by: Namjae Jeon <linkinjeon@kernel.org>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ksmbd: require minimum ACE size in smb_check_perm_dacl() [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Fri Apr 24 13:22:12 2026 -0400

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

 
KVM: arm64: Remove VPIPT I-cache handling [+ + +]
Author: Marc Zyngier <maz@kernel.org>
Date:   Thu Jun 11 14:44:49 2026 +0100

    KVM: arm64: Remove VPIPT I-cache handling
    
    commit ced242ba9d7cb3571f6e0f165f643cb832d52148 upstream.
    
    We have some special handling for VPIPT I-cache in critical parts
    of the cache and TLB maintenance. Remove it.
    
    Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
    Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
    Signed-off-by: Marc Zyngier <maz@kernel.org>
    Acked-by: Mark Rutland <mark.rutland@arm.com>
    Link: https://lore.kernel.org/r/20231204143606.1806432-2-maz@kernel.org
    Signed-off-by: Will Deacon <will@kernel.org>
    [Mark: Backport to v6.1.y. VPIPT HW was never built; this is all dead code]
    Signed-off-by: Mark Rutland <mark.rutland@arm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

KVM: arm64: Wake-up from WFI when iqrchip is in userspace [+ + +]
Author: Marc Zyngier <maz@kernel.org>
Date:   Thu Apr 23 17:36:07 2026 +0100

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

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

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

 
lib: test_hmm: evict device pages on file close to avoid use-after-free [+ + +]
Author: Alistair Popple <apopple@nvidia.com>
Date:   Tue Apr 28 14:53:06 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/20260331063445.3551404-1-apopple@nvidia.com
    Link: https://lore.kernel.org/20260331063445.3551404-2-apopple@nvidia.com
    Fixes: b2ef9f5a5cb3 ("mm/hmm/test: add selftest driver for HMM")
    Signed-off-by: Alistair Popple <apopple@nvidia.com>
    Reported-by: Zenghui Yu <zenghui.yu@linux.dev>
    Closes: https://lore.kernel.org/linux-mm/8bd0396a-8997-4d2e-a13f-5aac033083d7@linux.dev/
    Reviewed-by: Balbir Singh <balbirs@nvidia.com>
    Tested-by: Zenghui Yu <zenghui.yu@linux.dev>
    Cc: David Hildenbrand <david@kernel.org>
    Cc: Jason Gunthorpe <jgg@ziepe.ca>
    Cc: Leon Romanovsky <leon@kernel.org>
    Cc: Liam Howlett <liam.howlett@oracle.com>
    Cc: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Mike Rapoport <rppt@kernel.org>
    Cc: Suren Baghdasaryan <surenb@google.com>
    Cc: Zenghui Yu <zenghui.yu@linux.dev>
    Cc: Matthew Brost <matthew.brost@intel.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    [ kept the existing simpler `dmirror_device_evict_chunk()` body instead of the upstream compound-folio version ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Linux: Linux 6.1.176 [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Fri Jun 19 13:37:33 2026 +0200

    Linux 6.1.176
    
    Link: https://lore.kernel.org/r/20260616145125.307082728@linuxfoundation.org
    Tested-by: Brett A C Sheffield <bacs@librecast.net>
    Tested-by: Salvatore Bonaccorso <carnil@debian.org>
    Tested-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
    Tested-by: Miguel Ojeda <ojeda@kernel.org>
    Tested-by: Francesco Dolcini <francesco.dolcini@toradex.com>
    Tested-by: Mark Brown <broonie@kernel.org>
    Tested-by: Shuah Khan <skhan@linuxfoundation.org>
    Tested-by: Peter Schneider <pschneider1968@googlemail.com>
    Tested-by: Ron Economos <re@w6rz.net>
    Tested-by: Pavel Machek (CIP) <pavel@nabladev.com>
    Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
LoongArch: Add spectre boundry for syscall dispatch table [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Tue Apr 28 05:19:39 2026 -0400

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

 
macsec: fix replay protection at XPN lower-PN wrap [+ + +]
Author: Junrui Luo <moonafterrain@outlook.com>
Date:   Wed May 20 11:47:55 2026 +0800

    macsec: fix replay protection at XPN lower-PN wrap
    
    commit e68842b3356471ba56c882209f324613dac47f64 upstream.
    
    In macsec_post_decrypt(), when pn is U32_MAX, pn + 1 overflows u32 to 0
    and the first branch never fires. If next_pn_halves.lower is also in the
    upper half, pn_same_half(pn, lower) is true and the XPN else-if does not
    fire either, leaving next_pn_halves unchanged. An attacker that captures
    the legitimate frame carrying pn == 0xFFFFFFFF on an XPN association
    can then replay it indefinitely, since lowest_pn never rises above
    the captured pn and macsec_decrypt() reconstructs the same IV.
    
    Extend the XPN else-if to also fire when pn + 1 wraps to 0, so receipt
    of pn == U32_MAX advances next_pn_halves to (upper + 1, 0).
    
    Fixes: a21ecf0e0338 ("macsec: Support XPN frame handling - IEEE 802.1AEbw")
    Reported-by: Yuhao Jiang <danisjiang@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
    Link: https://patch.msgid.link/SYBPR01MB78813FD49E58F253B989F197AF012@SYBPR01MB7881.ausprd01.prod.outlook.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
media: rc: igorplugusb: fix control request setup packet [+ + +]
Author: Henri A <contact@henrialfonso.com>
Date:   Wed May 20 10:25:44 2026 -0400

    media: rc: igorplugusb: fix control request setup packet
    
    commit 171022c7d594c133a45f92357a2a91475edabe20 upstream.
    
    Commit eac69475b01f ("media: rc: igorplugusb: heed coherency
    rules") changed the control request storage from an embedded struct to
    an allocated pointer so it can obey DMA coherency rules.
    
    However, the driver still passes &ir->request to usb_fill_control_urb().
    That points the URB setup packet at the pointer field itself rather than
    at the allocated struct usb_ctrlrequest.
    
    USB core then interprets pointer bytes as the setup packet. This can
    produce an invalid bRequestType and trigger the control direction warning
    reported by syzbot:
    
      usb 2-1: BOGUS control dir, pipe 80003580 doesn't match bRequestType 0
    
    Pass ir->request itself as the setup packet.
    
    Fixes: eac69475b01f ("media: rc: igorplugusb: heed coherency rules")
    Reported-by: syzbot+11f0e4f957c7c3bf3d51@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=11f0e4f957c7c3bf3d51
    Tested-by: syzbot+11f0e4f957c7c3bf3d51@syzkaller.appspotmail.com
    Cc: stable@vger.kernel.org
    Assisted-by: Codex:GPT-5.5
    Signed-off-by: Henri A <contact@henrialfonso.com>
    Signed-off-by: Sean Young <sean@mess.org>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: rc: igorplugusb: heed coherency rules [+ + +]
Author: Oliver Neukum <oneukum@suse.com>
Date:   Fri May 1 19:27:30 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: stable@vger.kernel.org
    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Sean Young <sean@mess.org>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    [ replaced kzalloc_obj(*ir->request, GFP_KERNEL) with kzalloc(sizeof(*ir->request), GFP_KERNEL) ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: rc: ttusbir: fix inverted error logic [+ + +]
Author: Oliver Neukum <oneukum@suse.com>
Date:   Fri Apr 10 23:03:09 2026 +0200

    media: rc: ttusbir: fix inverted error logic
    
    commit 646ebdd3105809d84ed04aa9e92e47e89cc44502 upstream.
    
    We have to report ENOMEM if no buffer is allocated.
    Typo dropped a "!". Restore it.
    
    Fixes: 50acaad3d202 ("media: rc: ttusbir: respect DMA coherency rules")
    Cc: stable@vger.kernel.org
    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Sean Young <sean@mess.org>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

media: rc: ttusbir: respect DMA coherency rules [+ + +]
Author: Oliver Neukum <oneukum@suse.com>
Date:   Fri May 1 13:13:21 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: stable@vger.kernel.org
    Signed-off-by: Oliver Neukum <oneukum@suse.com>
    Signed-off-by: Sean Young <sean@mess.org>
    Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
    [ kept kzalloc(sizeof(*tt), GFP_KERNEL) instead of kzalloc_obj() ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
misc: fastrpc: fix DMA address corruption due to find_vma misuse [+ + +]
Author: Junrui Luo <moonafterrain@outlook.com>
Date:   Sat May 30 21:45:26 2026 +0100

    misc: fastrpc: fix DMA address corruption due to find_vma misuse
    
    commit 464c6ad2aa16e1e1df9d559289199356493d1e00 upstream.
    
    fastrpc_get_args() uses find_vma() to look up the VMA for a user-provided
    pointer and compute a DMA address offset. When the address falls in a gap
    before the returned VMA, (ptr & PAGE_MASK) - vma->vm_start underflows,
    corrupting the DMA address sent to the DSP.
    
    Replace find_vma() with vma_lookup(), which returns NULL when the address
    is not contained within any VMA.
    
    Cc: stable@vger.kernel.org
    Fixes: 80f3afd72bd4 ("misc: fastrpc: consider address offset before sending to DSP")
    Reported-by: Yuhao Jiang <danisjiang@gmail.com>
    Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
    Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
    Link: https://patch.msgid.link/20260530204528.116920-3-srini@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

misc: fastrpc: fix use-after-free of fastrpc_user in workqueue context [+ + +]
Author: Anandu Krishnan E <anandu.e@oss.qualcomm.com>
Date:   Sat May 30 21:45:25 2026 +0100

    misc: fastrpc: fix use-after-free of fastrpc_user in workqueue context
    
    commit e85eb5feca8e254905ffa6c57a3c99c89a674a0f upstream.
    
    There is a race between fastrpc_device_release() and the workqueue
    that processes DSP responses. When the user closes the file descriptor,
    fastrpc_device_release() frees the fastrpc_user structure. Concurrently,
    an in-flight DSP invocation can complete and fastrpc_rpmsg_callback()
    schedules context cleanup via schedule_work(&ctx->put_work). If the
    workqueue runs fastrpc_context_free() in parallel with or after
    fastrpc_device_release() has freed the user structure, it dereferences
    the freed fastrpc_user. Depending on the state of the context at the
    time of the race, any one of the following accesses can be hit:
    
     1. fastrpc_buf_free() calls fastrpc_ipa_to_dma_addr(buf->fl->cctx, ...)
        to strip the SID bits from the stored IOVA before passing the
        physical address to dma_free_coherent().
    
     2. fastrpc_free_map() reads map->fl->cctx->vmperms[0].vmid to
        reconstruct the source permission bitmask needed for the
        qcom_scm_assign_mem() call that returns memory from the DSP VM
        back to HLOS.
    
     3. fastrpc_free_map() acquires map->fl->lock to safely remove the
        map node from the fl->maps list.
    
    The resulting use-after-free manifests as:
    
      pc : fastrpc_buf_free+0x38/0x80 [fastrpc]
      lr : fastrpc_context_free+0xa8/0x1b0 [fastrpc]
      fastrpc_context_free+0xa8/0x1b0 [fastrpc]
      fastrpc_context_put_wq+0x78/0xa0 [fastrpc]
      process_one_work+0x180/0x450
      worker_thread+0x26c/0x388
    
    Add kref-based reference counting to fastrpc_user. Have each invoke
    context take a reference on the user at allocation time and release it
    when the context is freed. Release the initial reference in
    fastrpc_device_release() at file close. Move the teardown of the user
    structure — freeing pending contexts, maps, mmaps, and the channel
    context reference — into the kref release callback fastrpc_user_free(),
    so that it runs only when the last reference is dropped, regardless of
    whether that happens at device close or after the final in-flight
    context completes.
    
    Fixes: 6cffd79504ce ("misc: fastrpc: Add support for dmabuf exporter")
    Cc: stable@kernel.org
    Signed-off-by: Anandu Krishnan E <anandu.e@oss.qualcomm.com>
    Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
    Link: https://patch.msgid.link/20260530204528.116920-2-srini@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

misc: fastrpc: fix use-after-free race in fastrpc_map_create [+ + +]
Author: Zhenghang Xiao <kipreyyy@gmail.com>
Date:   Sat May 30 21:45:28 2026 +0100

    misc: fastrpc: fix use-after-free race in fastrpc_map_create
    
    commit 07ebe87915d8accdaba20c4f88c5ae430fe62fbb upstream.
    
    fastrpc_map_lookup returns a raw pointer after releasing fl->lock. The
    caller fastrpc_map_create then calls fastrpc_map_get (kref_get_unless_zero)
    on this unprotected pointer. A concurrent MEM_UNMAP can free the map
    between the lock release and the kref operation, resulting in a
    use-after-free on the freed slab object.
    
    Restore the take_ref parameter to fastrpc_map_lookup so the reference
    is acquired atomically under fl->lock before the pointer is exposed to
    the caller.
    
    Fixes: 10df039834f8 ("misc: fastrpc: Skip reference for DMA handles")
    Cc: stable@vger.kernel.org
    Signed-off-by: Zhenghang Xiao <kipreyyy@gmail.com>
    Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
    Link: https://patch.msgid.link/20260530204528.116920-5-srini@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

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

mm/damon/core: implement damon_kdamond_pid() [+ + +]
Author: SeongJae Park <sj@kernel.org>
Date:   Thu Jan 15 07:20:41 2026 -0800

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

mm/damon/core: use time_in_range_open() for damos quota window start [+ + +]
Author: SeongJae Park <sj@kernel.org>
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/20260329152306.45796-1-sj@kernel.org
    Link: https://lore.kernel.org/20260324040722.57944-1-sj@kernel.org [1]
    Fixes: ee801b7dd782 ("mm/damon/schemes: activate schemes based on a watermarks mechanism")
    Signed-off-by: SeongJae Park <sj@kernel.org>
    Cc: <stable@vger.kernel.org> # 5.16.x
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: SeongJae Park <sj@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

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

 
mm/damon/ops-common: call folio_test_lru() after folio_get() [+ + +]
Author: SeongJae Park <sj@kernel.org>
Date:   Mon Jun 15 15:03:29 2026 -0400

    mm/damon/ops-common: call folio_test_lru() after folio_get()
    
    [ Upstream commit d6b8b02a27b3dd09ec12144322b3dac46d9bc9ef ]
    
    damon_get_folio() speculatively calls folio_test_lru() before
    folio_try_get().  The folio can get freed and reallocated to a tail page.
    In the case, VM_BUG_ON_PGFLAGS() in const_folio_flags() can be triggered.
    Remove the speculative call.
    
    Also mark folio_test_lru() check right after folio_try_get() success as no
    more unlikely.
    
    The race should be rare.  Also the problem can happen only if the kernel
    has enabled CONFIG_DEBUG_VM_PGFLAGS.  No real world report of this issue
    has been made so far.  This fix is based on only theoretical analysis.
    That said, a bug is a bug.  A similar issue was also fixed via commit
    3203b3ab0fcf ("mm/filemap: don't call folio_test_locked() without a
    reference in next_uptodate_folio()").  I don't expect this change will
    make a meaningful impact to DAMON performance in the real world, though I
    will be happy to be corrected from the real world reports.
    
    The issue was discovered [1] by Sashiko.
    
    Link: https://lore.kernel.org/20260525162256.8317-1-sj@kernel.org
    Link: https://lore.kernel.org/20260517234112.89245-1-sj@kernel.org [1]
    Fixes: 3f49584b262c ("mm/damon: implement primitives for the virtual memory address spaces")
    Signed-off-by: SeongJae Park <sj@kernel.org>
    Cc: Fernand Sieber <sieberf@amazon.com>
    Cc: Leonard Foerster <foersleo@amazon.de>
    Cc: Shakeel Butt <shakeel.butt@linux.dev>
    Cc: <stable@vger.kernel.org> # 5.15.x
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

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

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

 
mm/huge_memory: update file PMD counter before folio_put() [+ + +]
Author: Yin Tirui <yintirui@huawei.com>
Date:   Mon Jun 15 19:58:37 2026 -0400

    mm/huge_memory: update file PMD counter before folio_put()
    
    [ Upstream commit 8d878059924f12c1bc24556a92ec56add74de3c8 ]
    
    __split_huge_pmd_locked() updates the file/shmem RSS counter after
    dropping the PMD mapping's folio reference.  If folio_put() drops the last
    reference, mm_counter_file() can later read freed folio state via
    folio_test_swapbacked().
    
    Move the counter update before folio_put().
    
    Link: https://lore.kernel.org/20260526101337.1984081-1-yintirui@huawei.com
    Fixes: fadae2953072 ("thp: use mm_file_counter to determine update which rss counter")
    Signed-off-by: Yin Tirui <yintirui@huawei.com>
    Reviewed-by: Lorenzo Stoakes <ljs@kernel.org>
    Acked-by: David Hildenbrand (arm) <david@kernel.org>
    Reviewed-by: Lance Yang <lance.yang@linux.dev>
    Reviewed-by: Dev Jain <dev.jain@arm.com>
    Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
    Cc: Barry Song <baohua@kernel.org>
    Cc: Chen Jun <chenjun102@huawei.com>
    Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
    Cc: Liam R. Howlett <liam@infradead.org>
    Cc: Nico Pache <npache@redhat.com>
    Cc: Ryan Roberts <ryan.roberts@arm.com>
    Cc: Vlastimil Babka <vbabka@kernel.org>
    Cc: Yang Shi <yang.shi@linux.alibaba.com>
    Cc: Zi Yan <ziy@nvidia.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    [ changed folio API calls (folio_remove_rmap_pmd/mm_counter_file(folio)/folio_put) to page-based equivalents (page_remove_rmap/mm_counter_file(page)/put_page) ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
mm/hugetlb: avoid false positive lockdep assertion [+ + +]
Author: Lorenzo Stoakes <ljs@kernel.org>
Date:   Mon Jun 15 17:49:19 2026 +0100

    mm/hugetlb: avoid false positive lockdep assertion
    
    [ Upstream commit b4aea43cd37afad714b5684fe9fdfcb0e78dba26 ]
    
    Commit 081056dc00a2 ("mm/hugetlb: unshare page tables during VMA split,
    not before") changed the locking model around hugetlbfs PMD unsharing on
    VMA split, but did not update the function which asserts the locks,
    hugetlb_vma_assert_locked().
    
    This function asserts that either the hugetlb VMA lock is held (if a
    shared mapping) or that the reservation map lock is held (if private).
    
    If you get an unfortunate race between something which results in one of
    these locks being released and a hugetlb VMA split and you have
    CONFIG_LOCKDEP enabled, you can therefore see a false positive assertion
    arise when there is in fact no issue.
    
    Since this change introduced a new take_locks parameter to
    hugetlb_unshare_pmds(), which, when set to false, indicates that locking
    is sufficient, simply pass this to the unsharing logic and predicate the
    lock assertions on this.
    
    This is safe, as we already asserted the file rmap lock and the VMA write
    lock prior to this (implying exclusive mmap write lock), so we cannot be
    raced by either rmap or page fault page table walkers which the asserted
    locks are intended to protect against (we don't mind GUP-fast).
    
    Separate out huge_pmd_unshare() into __huge_pmd_unshare() to add a
    check_locks parameter, and update hugetlb_unshare_pmds() to pass this
    parameter to it.
    
    This leaves all other callers of huge_pmd_unshare() still correctly
    asserting the locks.
    
    The below reproducer will trigger the assert in a kernel with
    CONFIG_LOCKDEP enabled by racing process teardown (which will release the
    hugetlb lock) against a hugetlb split.
    
    void execute_one(void)
    {
            void *ptr;
            pid_t pid;
    
            /*
             * Create a hugetlb mapping spanning a PUD entry.
             *
             * We force the hugetlb page allocation with populate and
             * noreserve.
             *
             * |---------------------|
             * |                     |
             * |---------------------|
             * 0                 PUD boundary
             */
            ptr = mmap(0, PUD_SIZE, PROT_READ | PROT_WRITE,
                       MAP_FIXED | MAP_SHARED | MAP_ANON |
                       MAP_NORESERVE | MAP_HUGETLB | MAP_POPULATE,
                       -1, 0);
            if (ptr == MAP_FAILED) {
                    perror("mmap");
                    exit(EXIT_FAILURE);
            }
    
            /*
             * Fork but with a bogus stack pointer so we try to execute code in
             * a non-VM_EXEC VMA, causing segfault + teardown via exit_mmap().
             *
             * The clone will cause PMD page table sharing between the
             * processes first via:
             * copy_process() -> ... -> huge_pte_alloc() -> huge_pmd_share()
             *
             * Then tear down and release the hugetlb 'VMA' lock via:
             * exit_mmap() -> ... -> vma_close() -> hugetlb_vma_lock_free()
             */
            pid = syscall(__NR_clone, 0, 2 * PMD_SIZE, 0, 0, 0);
            if (pid < 0) {
                    perror("clone");
                    exit(EXIT_FAILURE);
            } if (pid == 0) {
                    /* Pop stack... */
                    return;
            }
    
            /*
             * We are the parent process.
             *
             * Race the child process's teardown with a PMD unshare.
             *
             * We do this by triggering:
             *
             * __split_vma() -> hugetlb_split() -> hugetlb_unshare_pmds()
             *
             * Which, importantly, doesn't hold the hugetlb VMA lock (nor can
             * it), meaning we assert in hugetlb_vma_assert_locked().
             *
             *            .
             * |----------.----------|
             * |          .          |
             * |----------.----------|
             * 0          .     PUD boundary
             */
            mmap(0, PUD_SIZE / 2, PROT_READ | PROT_WRITE,
                 MAP_FIXED | MAP_ANON | MAP_PRIVATE, -1, 0);
    }
    
    int main(void)
    {
            int i;
    
            /* Kick off fork children. */
            for (i = 0; i < NUM_FORKS; i++) {
                    pid_t pid = fork();
    
                    if (pid < 0) {
                            perror("fork");
                            exit(EXIT_FAILURE);
                    }
    
                    /* Fork children do their work and exit. */
                    if (!pid) {
                            int j;
    
                            for (j = 0; j < NUM_ITERS; j++)
                                    execute_one();
                            return EXIT_SUCCESS;
                    }
            }
    
            /* If we succeeded, wait on children. */
            for (i = 0; i < NUM_FORKS; i++)
                    wait(NULL);
    
            return EXIT_SUCCESS;
    }
    
    [ljs@kernel.org: account for the !CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING case]
      Link: https://lore.kernel.org/agWZsPGYid08uU6O@lucifer
    Link: https://lore.kernel.org/20260513085658.45264-1-ljs@kernel.org
    Fixes: 081056dc00a2 ("mm/hugetlb: unshare page tables during VMA split, not before")
    Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
    Acked-by: David Hildenbrand (Arm) <david@kernel.org>
    Acked-by: Oscar Salvador <osalvador@suse.de>
    Cc: Jann Horn <jannh@google.com>
    Cc: Muchun Song <muchun.song@linux.dev>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

mm/hugetlb: rename folio_putback_active_hugetlb() to folio_putback_hugetlb() [+ + +]
Author: David Hildenbrand <david@kernel.org>
Date:   Mon Jun 15 15:42:35 2026 -0400

    mm/hugetlb: rename folio_putback_active_hugetlb() to folio_putback_hugetlb()
    
    [ Upstream commit b235448e8cab7eea17d164efc7bf55505985ba65 ]
    
    Now that folio_putback_hugetlb() is only called on folios that were
    previously isolated through folio_isolate_hugetlb(), let's rename it to
    match folio_putback_lru().
    
    Add some kernel doc to clarify how this function is supposed to be used.
    
    Link: https://lkml.kernel.org/r/20250113131611.2554758-5-david@redhat.com
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Muchun Song <muchun.song@linux.dev>
    Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Stable-dep-of: 3c2d42b8ee34 ("mm/memory-failure: fix hugetlb_lock AA deadlock in get_huge_page_for_hwpoison")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mm/hugetlb: rename isolate_hugetlb() to folio_isolate_hugetlb() [+ + +]
Author: David Hildenbrand <david@kernel.org>
Date:   Mon Jun 15 15:42:33 2026 -0400

    mm/hugetlb: rename isolate_hugetlb() to folio_isolate_hugetlb()
    
    [ Upstream commit 4c640f128074e0d4459ecf072595a44df5c2ae18 ]
    
    Let's make the function name match "folio_isolate_lru()", and add some
    kernel doc.
    
    Link: https://lkml.kernel.org/r/20250113131611.2554758-3-david@redhat.com
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
    Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
    Cc: Muchun Song <muchun.song@linux.dev>
    Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Stable-dep-of: 3c2d42b8ee34 ("mm/memory-failure: fix hugetlb_lock AA deadlock in get_huge_page_for_hwpoison")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/hugetlb_cma: round up per_node before logging it [+ + +]
Author: Sang-Heon Jeon <ekffu200098@gmail.com>
Date:   Thu May 14 11:08:40 2026 -0400

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

 
mm/memory-failure: fix hugetlb_lock AA deadlock in get_huge_page_for_hwpoison [+ + +]
Author: Wupeng Ma <mawupeng1@huawei.com>
Date:   Mon Jun 15 15:42:37 2026 -0400

    mm/memory-failure: fix hugetlb_lock AA deadlock in get_huge_page_for_hwpoison
    
    [ Upstream commit 3c2d42b8ee345b17a4ba56b0f6492d1ff4c1178e ]
    
    Two concurrent madvise(MADV_HWPOISON) calls on the same hugetlb page can
    trigger a recursive spinlock self-deadlock (AA deadlock) on hugetlb_lock
    when racing with a concurrent unmap:
    
      thread#0                              thread#1
      --------                              --------
      madvise(folio, MADV_HWPOISON)
        -> poisons the folio successfully
      madvise(folio, MADV_HWPOISON)         unmap(folio)
        try_memory_failure_hugetlb
          get_huge_page_for_hwpoison
            spin_lock_irq(&hugetlb_lock)    <- held
            __get_huge_page_for_hwpoison
              hugetlb_update_hwpoison()
                -> MF_HUGETLB_FOLIO_PRE_POISONED
              goto out:
                folio_put()
                  refcount: 1 -> 0
                  free_huge_folio()
                    spin_lock_irqsave(&hugetlb_lock)
                      -> AA DEADLOCK!
    
    The out: path in __get_huge_page_for_hwpoison() calls folio_put() to drop
    the GUP reference while the hugetlb_lock is still held by the hugetlb.c
    wrapper get_huge_page_for_hwpoison().  If concurrent unmap has released
    the page table mapping reference, folio_put() drops the folio refcount to
    zero, triggering free_huge_folio() which attempts to re-acquire the
    non-recursive hugetlb_lock.
    
    Fix this by moving hugetlb_lock acquisition from the hugetlb.c wrapper
    into get_huge_page_for_hwpoison().  Place spin_unlock_irq() before the
    folio_put() at the out: label so the folio is always released outside the
    lock.
    
    [akpm@linux-foundation.org: fix race, rename label per Miaohe]
      Link: https://sashiko.dev/#/patchset/20260522010305.4099834-1-mawupeng1@huawei.com
      Link: https://lore.kernel.org/f39f405e-4b4b-8f79-70fe-a2b5b62114eb@huawei.com
    Link: https://lore.kernel.org/20260522010305.4099834-1-mawupeng1@huawei.com
    Fixes: 405ce051236c ("mm/hwpoison: fix race between hugetlb free/demotion and memory_failure_hugetlb()")
    Signed-off-by: Wupeng Ma <mawupeng1@huawei.com>
    Acked-by: Oscar Salvador (SUSE) <osalvador@kernel.org>
    Acked-by: Muchun Song <muchun.song@linux.dev>
    Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com>
    Acked-by: Miaohe Lin <linmiaohe@huawei.com>
    Cc: David Hildenbrand <david@kernel.org>
    Cc: Liam Howlett <liam.howlett@oracle.com>
    Cc: Lorenzo Stoakes <ljs@kernel.org>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Mike Rapoport <rppt@kernel.org>
    Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
    Cc: Suren Baghdasaryan <surenb@google.com>
    Cc: Vlastimil Babka <vbabka@kernel.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mm/memory-failure: fix missing ->mf_stats count in hugetlb poison [+ + +]
Author: Jane Chu <jane.chu@oracle.com>
Date:   Mon Jun 15 15:42:36 2026 -0400

    mm/memory-failure: fix missing ->mf_stats count in hugetlb poison
    
    [ Upstream commit a148a2040191b12b45b82cb29c281cb3036baf90 ]
    
    When a newly poisoned subpage ends up in an already poisoned hugetlb
    folio, 'num_poisoned_pages' is incremented, but the per node ->mf_stats is
    not.  Fix the inconsistency by designating action_result() to update them
    both.
    
    While at it, define __get_huge_page_for_hwpoison() return values in terms
    of symbol names for better readibility.  Also rename
    folio_set_hugetlb_hwpoison() to hugetlb_update_hwpoison() since the
    function does more than the conventional bit setting and the fact three
    possible return values are expected.
    
    Link: https://lkml.kernel.org/r/20260120232234.3462258-1-jane.chu@oracle.com
    Fixes: 18f41fa616ee ("mm: memory-failure: bump memory failure stats to pglist_data")
    Signed-off-by: Jane Chu <jane.chu@oracle.com>
    Acked-by: Miaohe Lin <linmiaohe@huawei.com>
    Cc: Chris Mason <clm@meta.com>
    Cc: David Hildenbrand <david@kernel.org>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Jiaqi Yan <jiaqiyan@google.com>
    Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
    Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Mike Rapoport <rppt@kernel.org>
    Cc: Muchun Song <muchun.song@linux.dev>
    Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
    Cc: Oscar Salvador <osalvador@suse.de>
    Cc: Suren Baghdasaryan <surenb@google.com>
    Cc: William Roche <william.roche@oracle.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Stable-dep-of: 3c2d42b8ee34 ("mm/memory-failure: fix hugetlb_lock AA deadlock in get_huge_page_for_hwpoison")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/memory: fix spurious warning when unmapping device-private/exclusive pages [+ + +]
Author: Alistair Popple <apopple@nvidia.com>
Date:   Fri May 29 17:48:42 2026 -0400

    mm/memory: fix spurious warning when unmapping device-private/exclusive pages
    
    [ Upstream commit be3f38d05cc5a7c3f13e51994c5dd043ab604d28 ]
    
    Device private and exclusive entries are only supported for anonymous
    folios.  This condition is tested in __migrate_device_pages() and
    make_device_exclusive() using folio_test_anon().  However the unmap path
    tests this assumption using vma_is_anonymous().
    
    This is wrong because whilst anonymous VMAs can only contain folios where
    folio_test_anon() is true the opposite relation does not hold.  A folio
    for which folio_test_anon() is true does not imply vma_is_anonymous() is
    true.  Such a condition can occur if for example a folio is part of a
    private filebacked mapping.
    
    In this case vma_is_anonymous() is false as the mapping is filebacked, but
    folio_test_anon() may be true, thus permitting devices to migrate the
    folio to device private memory.  This can lead to the following spurious
    warnings during process teardown:
    
    [  772.737706] ------------[ cut here ]------------
    [  772.739201] WARNING: mm/memory.c:1754 at unmap_page_range.cold+0x26/0x18a, CPU#17: hmm-tests/2041
    [  772.742050] Modules linked in: test_hmm nvidia_uvm(O) nvidia(O)
    [  772.743959] CPU: 17 UID: 0 PID: 2041 Comm: hmm-tests Tainted: G        W  O        7.0.0+ #387 PREEMPT(full)
    [  772.747104] Tainted: [W]=WARN, [O]=OOT_MODULE
    [  772.748509] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 04/01/2014
    [  772.752117] RIP: 0010:unmap_page_range.cold+0x26/0x18a
    [  772.753780] Code: 7e fe ff ff 48 89 4c 24 78 4c 89 44 24 38 e8 f2 ff b1 00 48 8b 4c 24 78 4c 8b 44 24 38 48 8b 44 24 18 48 83 78 48 00 74 04 90 <0f> 0b 90 48 89 ca b8 ff ff 37 00 48 c1 ea 03 48 c1 e0 2a 80 3c 02
    [  772.759602] RSP: 0018:ffff888112607550 EFLAGS: 00010286
    [  772.761310] RAX: ffff88811bbf4dc0 RBX: dffffc0000000000 RCX: ffffea03e9bfffd8
    [  772.763583] RDX: 1ffff1102377e9c1 RSI: 0000000000000008 RDI: ffff88811bbf4e08
    [  772.765914] RBP: 0000000000000006 R08: ffff8881059f7448 R09: ffffed10224c0e68
    [  772.768184] R10: ffff888112607347 R11: 0000000000000001 R12: 0000000000000001
    [  772.770461] R13: ffffea03e9bfffc0 R14: ffff888112607908 R15: ffffea03e9bfffc0
    [  772.772782] FS:  00007f327caa2780(0000) GS:ffff888427b7d000(0000) knlGS:0000000000000000
    [  772.775328] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  772.777187] CR2: 00007f327ca89000 CR3: 00000001994d5000 CR4: 00000000000006f0
    [  772.779135] Call Trace:
    [  772.779792]  <TASK>
    [  772.780317]  ? dmirror_interval_invalidate+0x1a3/0x290 [test_hmm]
    [  772.781873]  ? vm_normal_page_pud+0x2b0/0x2b0
    [  772.782992]  ? __rwlock_init+0x150/0x150
    [  772.784006]  ? lock_release+0x216/0x2b0
    [  772.785008]  ? __mmu_notifier_invalidate_range_start+0x505/0x6e0
    [  772.786522]  ? lock_release+0x216/0x2b0
    [  772.787498]  ? unmap_single_vma+0xb6/0x210
    [  772.788573]  unmap_vmas+0x27d/0x520
    [  772.789506]  ? unmap_single_vma+0x210/0x210
    [  772.790607]  ? mas_update_gap.part.0+0x620/0x620
    [  772.791834]  unmap_region+0x19e/0x350
    [  772.792769]  ? remove_vma+0x130/0x130
    [  772.793684]  ? mas_alloc_nodes+0x1f2/0x300
    [  772.794730]  vms_complete_munmap_vmas+0x8c1/0xe20
    [  772.795926]  ? unmap_region+0x350/0x350
    [  772.796917]  do_vmi_align_munmap+0x36a/0x4e0
    [  772.798018]  ? lock_release+0x216/0x2b0
    [  772.799024]  ? vma_shrink+0x620/0x620
    [  772.799983]  do_vmi_munmap+0x150/0x2c0
    [  772.800939]  __vm_munmap+0x161/0x2c0
    [  772.801872]  ? expand_downwards+0xd60/0xd60
    [  772.802948]  ? clockevents_program_event+0x1ef/0x540
    [  772.804217]  ? lock_release+0x216/0x2b0
    [  772.805158]  __x64_sys_munmap+0x59/0x80
    [  772.805776]  do_syscall_64+0xfc/0x670
    [  772.806336]  ? irqentry_exit+0xda/0x580
    [  772.806976]  entry_SYSCALL_64_after_hwframe+0x4b/0x53
    [  772.807772] RIP: 0033:0x7f327cbb2717
    [  772.808323] Code: 73 01 c3 48 8b 0d f9 76 0d 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 0b 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d c9 76 0d 00 f7 d8 64 89 01 48
    [  772.811337] RSP: 002b:00007ffde7f57d38 EFLAGS: 00000202 ORIG_RAX: 000000000000000b
    [  772.812564] RAX: ffffffffffffffda RBX: 00007f327cc9c000 RCX: 00007f327cbb2717
    [  772.813733] RDX: 0000000000000000 RSI: 0000000000400000 RDI: 00007f327c289000
    [  772.814867] RBP: 0000000000421360 R08: 000000000000001a R09: 0000000000000000
    [  772.815991] R10: 0000000000000003 R11: 0000000000000202 R12: 00007ffde7f57d74
    [  772.817121] R13: 00007f327c689010 R14: 0000000000100000 R15: 00007f327c289000
    [  772.818272]  </TASK>
    [  772.818614] irq event stamp: 0
    [  772.819159] hardirqs last  enabled at (0): [<0000000000000000>] 0x0
    [  772.820174] hardirqs last disabled at (0): [<ffffffff82a57ab3>] copy_process+0x19f3/0x6440
    [  772.821511] softirqs last  enabled at (0): [<ffffffff82a57b00>] copy_process+0x1a40/0x6440
    [  772.822869] softirqs last disabled at (0): [<0000000000000000>] 0x0
    [  772.823871] ---[ end trace 0000000000000000 ]---
    
    Fix this by using the same check for folio_test_anon() in
    zap_nonpresent_ptes(). Also add a hmm-test case for this.
    
    Link: https://lore.kernel.org/20260501065116.2057242-1-apopple@nvidia.com
    Fixes: 999dad824c39 ("mm/shmem: persist uffd-wp bit across zapping for file-backed")
    Signed-off-by: Alistair Popple <apopple@nvidia.com>
    Reported-by: Arsen Arsenović <aarsenovic@baylibre.com>
    Reviewed-by: Balbir Singh <balbirs@nvidia.com>
    Cc: David Hildenbrand <david@kernel.org>
    Cc: Jason Gunthorpe <jgg@ziepe.ca>
    Cc: John Hubbard <jhubbard@nvidia.com>
    Cc: Leon Romanovsky <leon@kernel.org>
    Cc: Liam R. Howlett <liam@infradead.org>
    Cc: Lorenzo Stoakes <ljs@kernel.org>
    Cc: Peter Xu <peterx@redhat.com>
    Cc: Matthew Brost <matthew.brost@intel.com>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Mike Rapoport <rppt@kernel.org>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: Suren Baghdasaryan <surenb@google.com>
    Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Cc: Vlastimil Babka <vbabka@kernel.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    [ adapted `folio_test_anon(folio)` to `PageAnon(page)` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/migrate: don't call folio_putback_active_hugetlb() on dst hugetlb folio [+ + +]
Author: David Hildenbrand <david@kernel.org>
Date:   Mon Jun 15 15:42:34 2026 -0400

    mm/migrate: don't call folio_putback_active_hugetlb() on dst hugetlb folio
    
    [ Upstream commit ba23f58de896842028b4b33b95530f08288396fe ]
    
    We replaced a simple put_page() by a putback_active_hugepage() call in
    commit 3aaa76e125c1 ("mm: migrate: hugetlb: putback destination hugepage
    to active list"), to set the "active" flag on the dst hugetlb folio.
    
    Nowadays, we decoupled the "active" list from the flag, by calling the
    flag "migratable".
    
    Calling "putback" on something that wasn't allocated is weird and not
    future proof, especially if we might reach that path when migration failed
    and we just want to free the freshly allocated hugetlb folio.
    
    Let's simply handle the migratable flag and the active list flag in
    move_hugetlb_state(), where we know that allocation succeeded and already
    handle the temporary flag; use a simple folio_put() to return our
    reference.
    
    Link: https://lkml.kernel.org/r/20250113131611.2554758-4-david@redhat.com
    Signed-off-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Muchun Song <muchun.song@linux.dev>
    Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Stable-dep-of: 3c2d42b8ee34 ("mm/memory-failure: fix hugetlb_lock AA deadlock in get_huge_page_for_hwpoison")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/page_alloc: clear page->private in free_pages_prepare() [+ + +]
Author: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Date:   Fri May 29 13:02:30 2026 +0800

    mm/page_alloc: clear page->private in free_pages_prepare()
    
    [ Upstream commit ac1ea219590c09572ed5992dc233bbf7bb70fef9 ]
    
    Several subsystems (slub, shmem, ttm, etc.) use page->private but don't
    clear it before freeing pages.  When these pages are later allocated as
    high-order pages and split via split_page(), tail pages retain stale
    page->private values.
    
    This causes a use-after-free in the swap subsystem.  The swap code uses
    page->private to track swap count continuations, assuming freshly
    allocated pages have page->private == 0.  When stale values are present,
    swap_count_continued() incorrectly assumes the continuation list is valid
    and iterates over uninitialized page->lru containing LIST_POISON values,
    causing a crash:
    
      KASAN: maybe wild-memory-access in range [0xdead000000000100-0xdead000000000107]
      RIP: 0010:__do_sys_swapoff+0x1151/0x1860
    
    Fix this by clearing page->private in free_pages_prepare(), ensuring all
    freed pages have clean state regardless of previous use.
    
    Link: https://lkml.kernel.org/r/20260207173615.146159-1-mikhail.v.gavrilov@gmail.com
    Fixes: 3b8000ae185c ("mm/vmalloc: huge vmalloc backing pages should be split rather than compound")
    Signed-off-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
    Suggested-by: Zi Yan <ziy@nvidia.com>
    Acked-by: Zi Yan <ziy@nvidia.com>
    Acked-by: David Hildenbrand (Arm) <david@kernel.org>
    Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
    Cc: Brendan Jackman <jackmanb@google.com>
    Cc: Chris Li <chrisl@kernel.org>
    Cc: Hugh Dickins <hughd@google.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Kairui Song <ryncsn@gmail.com>
    Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Nicholas Piggin <npiggin@gmail.com>
    Cc: Suren Baghdasaryan <surenb@google.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    [backport: context only]
    Signed-off-by: Li Wang <li.wang@windriver.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
mmc: core: Fix host controller programming for fixed driver type [+ + +]
Author: Kamal Dasu <kamal.dasu@broadcom.com>
Date:   Thu Apr 23 15:18:55 2026 -0400

    mmc: core: Fix host controller programming for fixed driver type
    
    commit 5a52c5701a67d5176eb1afbf1bdaf7d6dfeec597 upstream.
    
    When using the fixed-emmc-driver-type device tree property, the MMC core
    correctly selects the driver strength for the card but fails to program
    the host controller accordingly. This causes a mismatch where the card
    uses the specified driver type while the host controller defaults to
    Type B (since ios->drv_type remains zero).
    
    Split the driver type programming logic to handle both fixed and dynamic
    driver type selection paths. For fixed driver types, program the host
    controller with the selected drive_strength value. For dynamic selection,
    use the existing drv_type as before.
    
    This ensures both the eMMC device and host controller use matching driver
    strengths, preventing potential signal integrity issues.
    
    Fixes: 6186d06c519e ("mmc: parse new binding for eMMC fixed driver type")
    Signed-off-by: Kamal Dasu <kamal.dasu@broadcom.com>
    Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mmc: litex_mmc: Set mandatory idle clocks before CMD0 [+ + +]
Author: Inochi Amaoto <inochiama@gmail.com>
Date:   Thu May 21 15:21:21 2026 +0800

    mmc: litex_mmc: Set mandatory idle clocks before CMD0
    
    commit 99982b743e5ba72bd1f5de0e03e3b96ae70b1e51 upstream.
    
    The litex_mmc driver assumes the card is already probed in the BIOS
    and skip the phy initialization. This will cause the command fail
    like the following when the old card is unplugged and then insert
    a new card:
    
    [   62.923593] litex-mmc f0004000.mmc: Command (cmd 8) error, status -110
    [   62.949717] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110
    [   62.976606] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110
    [   63.002516] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110
    [   63.028442] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110
    
    Add required clock settings and initialization for the CMD 0, so it can
    probe the new card.
    
    Fixes: 92e099104729 ("mmc: Add driver for LiteX's LiteSDCard interface")
    Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
    Reviewed-by: Gabriel Somlo <gsomlo@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson <ulfh@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mmc: litex_mmc: Use DIV_ROUND_UP for more accurate clock calculation [+ + +]
Author: Inochi Amaoto <inochiama@gmail.com>
Date:   Thu May 21 15:21:20 2026 +0800

    mmc: litex_mmc: Use DIV_ROUND_UP for more accurate clock calculation
    
    commit b837e38c255dd9f8b53511d52e87f1fda32b3dfe upstream.
    
    The previous clock uses roundup_pow_of_two() to calculate the core
    clock frequency. It does not meet the actual hardware meaning.
    The actual frequency is calculated by "ref_clk / ((div >> 1) << 1)".
    
    Fix the clock divider calculation.
    
    Fixes: 92e099104729 ("mmc: Add driver for LiteX's LiteSDCard interface")
    Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
    Reviewed-by: Gabriel Somlo <gsomlo@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson <ulfh@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mmc: renesas_sdhi: Add OF entry for RZ/G2H SoC [+ + +]
Author: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Date:   Tue May 19 14:53:40 2026 +0100

    mmc: renesas_sdhi: Add OF entry for RZ/G2H SoC
    
    commit f48ee49726ee4ab545fd2dc644f169c0809b19b3 upstream.
    
    The RZ/G2H (R8A774E1) SoC was previously handled via the generic
    "renesas,rcar-gen3-sdhi" fallback compatible string. However, because
    the SDHI IP on RZ/G2H is identical with the R-Car H3-N (R8A77951), it
    requires the specific quirks and configuration defined in
    `of_r8a7795_compatible` rather than the generic Gen3 data.
    
    Add the explicit "renesas,sdhi-r8a774e1" match entry to map it correctly.
    Note that the DT binding file renesas,sdhi.yaml does not need an update
    as the entry for this SoC is already present.
    
    Fixes: 31941342888d ("arm64: dts: renesas: r8a774e1: Add SDHI nodes")
    Cc: stable@vger.kernel.org
    Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
    Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
    Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Signed-off-by: Ulf Hansson <ulfh@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mmc: sdhci: add signal voltage switch in sdhci_resume_host [+ + +]
Author: Jisheng Zhang <jszhang@kernel.org>
Date:   Sun May 24 10:34:55 2026 +0800

    mmc: sdhci: add signal voltage switch in sdhci_resume_host
    
    commit f595e8e77a51eee35e331f69321766593a845ef2 upstream.
    
    I met one suspend/resume issue with sdr104 capable sdio wifi card (with
    "keep-power-in-suspend" set in DT property):
    After resuming from suspend to ram, the sdio wifi card stops working.
    Further debug shows that although ios shows the sdio card is at sdr104
    mode, the voltage is still at 3V3. This is due to missing the calling
    of ->start_signal_voltage_switch() in sdhci_resume_host().
    
    Fix this issue by adding ->start_signal_voltage_switch() in
    sdhci_resume_host(). This also matches what we do for
    sdhci_runtime_resume_host().
    
    Then the question is: why this issue hasn't reported and fixed for so
    long time. IMHO, several reasons: Some host controllers just kick off
    the runtime resume for system resume, so they benefit from the well
    supported runtime pm code; Some platforms just use the old sdio wifi
    card which doesn't need signal voltage switch at all, the default
    voltage is 3v3 after resuming.
    
    Fixes: 6308d2905bd3 ("mmc: sdhci: add quirk for keeping card power during suspend")
    Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
    Acked-by: Adrian Hunter <adrian.hunter@intel.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Ulf Hansson <ulfh@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mptcp: allow subflow rcv wnd to shrink [+ + +]
Author: Paolo Abeni <pabeni@redhat.com>
Date:   Tue Jun 2 22:14:11 2026 +1000

    mptcp: allow subflow rcv wnd to shrink
    
    commit da23be77e1292cd611e736c3aa17da633d7ddce7 upstream.
    
    In MPTCP connection, the `window` field in the TCP header refers to the
    MPTCP-level rcv_nxt and it's right edge should not move backward. Such
    constraint is enforced at DSS option generation time.
    
    At the same time, the TCP stack ensures independently that the TCP-level
    rcv wnd right's edge does not move backward. That in turn causes artificial
    inflating of the MPTCP rcv window when the incoming data is acked at the
    TCP level and is OoO in the MPTCP sequence space (or lands in the backlog).
    
    As a consequence, the incoming traffic can exceed the receiver rcvbuf size
    even when the sender is not misbehaving.
    
    Prevent such scenario forcibly allowing the TCP subflow to shrink the
    TCP-level rcv wnd regardless of the current netns setting.
    
    Fixes: f3589be0c420 ("mptcp: never shrink offered window")
    Cc: stable@vger.kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260602-net-mptcp-misc-fixes-7-1-rc7-v2-4-856831229976@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: close TOCTOU race while computing rcv_wnd [+ + +]
Author: Paolo Abeni <pabeni@redhat.com>
Date:   Tue Jun 2 22:14:10 2026 +1000

    mptcp: close TOCTOU race while computing rcv_wnd
    
    commit 8ab24fdebc369c0dfb90f82c1650b1e66662bb45 upstream.
    
    The MPTCP output path access locklessly the MPTCP-level ack_seq
    in multiple times, using possibly different values for the data_ack
    in the DSS option and to compute the announced rcv wnd for the same
    packet.
    
    Refactor the cote to avoid inconsistencies which may confuse the
    peer. Also ensure that the MPTCP level rcv wnd is updated only when
    the egress packet actually contains a DSS ack.
    
    Fixes: fa3fe2b15031 ("mptcp: track window announced to peer")
    Cc: stable@vger.kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260602-net-mptcp-misc-fixes-7-1-rc7-v2-3-856831229976@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: do not drop partial packets [+ + +]
Author: Shardul Bankar <shardul.b@mpiricsoftware.com>
Date:   Sat May 30 12:48:34 2026 -0400

    mptcp: do not drop partial packets
    
    [ Upstream commit 50c2d91c5dfa0e465826ec1f8dbad9cdc254bd85 ]
    
    When a packet arrives with map_seq < ack_seq < end_seq, the beginning
    of the packet has already been acknowledged but the end contains new
    data. Currently the entire packet is dropped as "old data," forcing
    the sender to retransmit.
    
    Instead, skip the already-acked bytes by adjusting the skb offset and
    enqueue only the new portion. Update bytes_received and ack_seq to
    reflect the new data consumed.
    
    A previous attempt at this fix has been sent by Paolo Abeni [1], but had
    issues [2]: it also added a zero-window check and changed rcv_wnd_sent
    initialization, which caused test regressions. This version addresses
    only the partial packet handling without modifying receive window
    accounting.
    
    Fixes: ab174ad8ef76 ("mptcp: move ooo skbs into msk out of order queue.")
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/c9b426a4e163aa3c4fe8b80c79f1a610f47ae7d8.1763075056.git.pabeni@redhat.com [1]
    Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/600 [2]
    Signed-off-by: Shardul Bankar <shardul.b@mpiricsoftware.com>
    [pabeni@redhat.com: update map]
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260515-net-mptcp-misc-fixes-7-1-rc4-v2-1-701e96419f2f@kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    [ changed `skb_set_owner_r()` to `mptcp_set_owner_r()` and dropped the absent `msk->bytes_received` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: fastclose msk when linger time is 0 [+ + +]
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Date:   Sun May 17 23:28:15 2026 -0400

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

mptcp: fix retransmission loop when csum is enabled [+ + +]
Author: Paolo Abeni <pabeni@redhat.com>
Date:   Tue Jun 2 22:14:09 2026 +1000

    mptcp: fix retransmission loop when csum is enabled
    
    commit d1918b36edcaed0ec4ef6888b2358c6b1ddcff47 upstream.
    
    Sashiko noted that retransmission with csum enabled can actually
    transmit new data, but currently the relevant code does not update
    accordingly snd_nxt.
    
    The may cause incoming ack drop and an endless retransmission loop.
    
    Address the issue incrementing snd_nxt as needed.
    
    Fixes: 4e14867d5e91 ("mptcp: tune re-injections for csum enabled mode")
    Cc: stable@vger.kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260602-net-mptcp-misc-fixes-7-1-rc7-v2-2-856831229976@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: pm: ADD_ADDR rtx: allow ID 0 [+ + +]
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Date:   Mon May 18 10:33:51 2026 -0400

    mptcp: pm: ADD_ADDR rtx: allow ID 0
    
    [ Upstream commit 03f324f3f1f7619a47b9c91282cb12775ab0a2f1 ]
    
    ADD_ADDR can be sent for the ID 0, which corresponds to the local
    address and port linked to the initial subflow.
    
    Indeed, this address could be removed, and re-added later on, e.g. what
    is done in the "delete re-add signal" MPTCP Join selftests. So no reason
    to ignore it.
    
    Fixes: 00cfd77b9063 ("mptcp: retransmit ADD_ADDR when timeout")
    Cc: stable@vger.kernel.org
    Reviewed-by: Mat Martineau <martineau@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260505-net-mptcp-pm-fixes-7-1-rc3-v1-2-fca8091060a4@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [ relocated the 3-line deletion from net/mptcp/pm.c to net/mptcp/pm_netlink.c ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: pm: ADD_ADDR rtx: fix potential data-race [+ + +]
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Date:   Mon May 18 10:33:55 2026 -0400

    mptcp: pm: ADD_ADDR rtx: fix potential data-race
    
    [ Upstream commit 5cd6e0ad79d2615264f63929f8b457ad97ae550d ]
    
    This mptcp_pm_add_timer() helper is executed as a timer callback in
    softirq context. To avoid any data races, the socket lock needs to be
    held with bh_lock_sock().
    
    If the socket is in use, retry again soon after, similar to what is done
    with the keepalive timer.
    
    Fixes: 00cfd77b9063 ("mptcp: retransmit ADD_ADDR when timeout")
    Cc: stable@vger.kernel.org
    Reviewed-by: Mat Martineau <martineau@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260505-net-mptcp-pm-fixes-7-1-rc3-v1-3-fca8091060a4@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: pm: ADD_ADDR rtx: resched blocked ADD_ADDR quicker [+ + +]
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Date:   Tue May 19 08:41:06 2026 -0400

    mptcp: pm: ADD_ADDR rtx: resched blocked ADD_ADDR quicker
    
    [ Upstream commit 3cf12492891c4b5ff54dda404a2de4ec54c9e1b5 ]
    
    When an ADD_ADDR needs to be retransmitted and another one has already
    been prepared -- e.g. multiple ADD_ADDRs have been sent in a row and
    need to be retransmitted later -- this additional retransmission will
    need to wait.
    
    In this case, the timer was reset to TCP_RTO_MAX / 8, which is ~15
    seconds. This delay is unnecessary long: it should just be rescheduled
    at the next opportunity, e.g. after the retransmission timeout.
    
    Without this modification, some issues can be seen from time to time in
    the selftests when multiple ADD_ADDRs are sent, and the host takes time
    to process them, e.g. the "signal addresses, ADD_ADDR timeout" MPTCP
    Join selftest, especially with a debug kernel config.
    
    Note that on older kernels, 'timeout' is not available. It should be
    enough to replace it by one second (HZ).
    
    Fixes: 00cfd77b9063 ("mptcp: retransmit ADD_ADDR when timeout")
    Cc: stable@vger.kernel.org
    Reviewed-by: Mat Martineau <martineau@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260505-net-mptcp-pm-fixes-7-1-rc3-v1-6-fca8091060a4@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [ replaced `TCP_RTO_MAX / 8` with `HZ` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: pm: fix ADD_ADDR timer infinite retry on option space insufficient [+ + +]
Author: Li Xiasong <lixiasong1@huawei.com>
Date:   Sat May 30 07:39:11 2026 -0400

    mptcp: pm: fix ADD_ADDR timer infinite retry on option space insufficient
    
    [ Upstream commit 51e398a3b8961b26a8c0a4ba9a777c5339791707 ]
    
    When TCP option space is insufficient (e.g., when sending ADD_ADDR with an
    IPv6 address and port while tcp_timestamps is enabled), the original code
    jumped to out_unlock without clearing the addr_signal flag. This caused
    mptcp_pm_add_timer to keep rescheduling indefinitely, not sending ADD_ADDR,
    preventing subsequent addresses in the endpoint list from being announced.
    
    Handle this case by clearing the ADD_ADDR signal and skipping the matching
    ADD_ADDR retransmission entry. The skip path cancels the matching timer
    (with id check) and advances PM state progression, preserving forward
    progress to subsequent PM work.
    
    This cancellation is inherently best-effort. A concurrent add_timer
    callback may already be running and may acquire pm.lock before the
    cancel path updates entry state. In that case, one final ADD_ADDR
    transmit attempt can still be executed.
    
    Once the cancel path sets entry->retrans_times to ADD_ADDR_RETRANS_MAX,
    the callback-side retrans_times check suppresses further ADD_ADDR
    retransmissions.
    
    Note that when an ADD_ADDR is being prepared, a pure-ACK is queued. On
    the output side, it means that it is fine to skip non-pure-ACK packets,
    when drop_other_suboptions is set: a pure-ACK will be processed soon
    after.
    
    Fixes: 00cfd77b9063 ("mptcp: retransmit ADD_ADDR when timeout")
    Cc: stable@vger.kernel.org
    Signed-off-by: Li Xiasong <lixiasong1@huawei.com>
    Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260515-net-mptcp-misc-fixes-7-1-rc4-v2-2-701e96419f2f@kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: pm: kernel: correctly retransmit ADD_ADDR ID 0 [+ + +]
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Date:   Mon May 18 10:23:40 2026 -0400

    mptcp: pm: kernel: correctly retransmit ADD_ADDR ID 0
    
    [ Upstream commit b12014d2d36eaed4e4bec5f1ac7e91110eeb100d ]
    
    When adding the ADD_ADDR to the list, the address including the IP, port
    and ID are copied. On the other hand, when the endpoint corresponds to
    the one from the initial subflow, the ID is set to 0, as specified by
    the MPTCP protocol.
    
    The issue is that the ID was reset after having copied the ID in the
    ADD_ADDR entry. So the retransmission was done, but using a different ID
    than the initial one.
    
    Fixes: 8b8ed1b429f8 ("mptcp: pm: reuse ID 0 after delete and re-add")
    Cc: stable@vger.kernel.org
    Reviewed-by: Mat Martineau <martineau@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260505-net-mptcp-pm-fixes-7-1-rc3-v1-1-fca8091060a4@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [ applied to net/mptcp/pm_netlink.c instead of upstream's pm_kernel.c ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: pm: prio: skip closed subflows [+ + +]
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Date:   Mon May 18 09:45:31 2026 -0400

    mptcp: pm: prio: skip closed subflows
    
    [ Upstream commit 166b78344031bf7ac9f55cb5282776cfd85f220e ]
    
    When sending an MP_PRIO, closed subflows need to be skipped.
    
    This fixes the case where the initial subflow got closed, re-opened
    later, then an MP_PRIO is needed for the same local address.
    
    Note that explicit MP_PRIO cannot be sent during the 3WHS, so it is fine
    to use __mptcp_subflow_active().
    
    Fixes: 067065422fcd ("mptcp: add the outgoing MP_PRIO support")
    Cc: stable@vger.kernel.org
    Fixes: b29fcfb54cd7 ("mptcp: full disconnect implementation")
    Reviewed-by: Mat Martineau <martineau@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260505-net-mptcp-pm-fixes-7-1-rc3-v1-9-fca8091060a4@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [ applied to renamed function `mptcp_pm_nl_mp_prio_send_ack()` in `pm_netlink.c` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: reset rcv wnd on disconnect [+ + +]
Author: Paolo Abeni <pabeni@redhat.com>
Date:   Sat May 30 12:31:14 2026 -0400

    mptcp: reset rcv wnd on disconnect
    
    [ Upstream commit 0981f90e1a05773a4c29c6e720f5ea1e3c8f1876 ]
    
    If the MPTCP socket fallback to TCP before the MP handshake completion,
    the IASN remain 0, and the rcv_wnd_sent field is not explicitly
    initialized, just incremented over time with the data transfer.
    
    At disconnect time such value is not cleared. If the next connection falls
    back to TCP before the MP handshake completion, the data transfer will
    keep incrementing the receive window end sequence starting from the last
    value used in the previous connection: the announced window will be
    unrelated from the actual receiver buffer size and likely too big.
    
    Address the issue zeroing the field at disconnect time.
    
    Fixes: b29fcfb54cd7 ("mptcp: full disconnect implementation")
    Cc: stable@vger.kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260515-net-mptcp-misc-fixes-7-1-rc4-v2-4-701e96419f2f@kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mptcp: sockopt: check timestamping ret value [+ + +]
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Date:   Tue Jun 2 22:14:14 2026 +1000

    mptcp: sockopt: check timestamping ret value
    
    commit 57132affbc89c02e1bf73fdf5724311bdc9a29da upstream.
    
    sock_set_timestamping() can fail for different reasons. The returned
    value should then be checked.
    
    If sock_set_timestamping() fails for at least one subflow, the first
    error is now reported to the userspace, similar to what is done with
    other socket options.
    
    Fixes: 9061f24bf82e ("mptcp: sockopt: propagate timestamp request to subflows")
    Cc: stable@vger.kernel.org
    Reported-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
    Closes: https://lore.kernel.org/willemdebruijn.kernel.178a41a53d041@gmail.com
    Reviewed-by: Mat Martineau <martineau@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260602-net-mptcp-misc-fixes-7-1-rc7-v2-7-856831229976@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mtd: spi-nor: core: fix implicit declaration warning [+ + +]
Author: Zeng Heng <zengheng4@huawei.com>
Date:   Thu May 14 07:45:39 2026 -0400

    mtd: spi-nor: core: fix implicit declaration warning
    
    [ Upstream commit 25e3f30601a368642678744fc8a9b1dce183c7bc ]
    
    spi-nor/core.c needs to include linux/delay.h,
    or it would raise below compile warning:
    
    drivers/mtd/spi-nor/core.c: In function ‘spi_nor_soft_reset’:
    drivers/mtd/spi-nor/core.c:2779:2: error: implicit declaration of function ‘usleep_range’ [-Werror=implicit-function-declaration]
     2779 |  usleep_range(SPI_NOR_SRST_SLEEP_MIN, SPI_NOR_SRST_SLEEP_MAX);
          |  ^~~~~~~~~~~~
    
    Fixes: d73ee7534cc5 ("mtd: spi-nor: core: perform a Soft Reset on shutdown")
    Signed-off-by: Zeng Heng <zengheng4@huawei.com>
    Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
    Link: https://lore.kernel.org/r/20220923031457.56103-1-zengheng4@huawei.com
    Stable-dep-of: e47029b977e7 ("mtd: spi-nor: debugfs: fix out-of-bounds read in spi_nor_params_show()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mtd: spi-nor: debugfs: fix out-of-bounds read in spi_nor_params_show() [+ + +]
Author: Tudor Ambarus <tudor.ambarus@linaro.org>
Date:   Thu May 14 07:45:40 2026 -0400

    mtd: spi-nor: debugfs: fix out-of-bounds read in spi_nor_params_show()
    
    [ Upstream commit e47029b977e747cb3a9174308fd55762cce70147 ]
    
    Sashiko noticed an out-of-bounds read [1].
    
    In spi_nor_params_show(), the snor_f_names array is passed to
    spi_nor_print_flags() using sizeof(snor_f_names).
    
    Since snor_f_names is an array of pointers, sizeof() returns the total
    number of bytes occupied by the pointers
            (element_count * sizeof(void *))
    rather than the element count itself. On 64-bit systems, this makes the
    passed length 8x larger than intended.
    
    Inside spi_nor_print_flags(), the 'names_len' argument is used to
    bounds-check the 'names' array access. An out-of-bounds read occurs
    if a flag bit is set that exceeds the array's actual element count
    but is within the inflated byte-size count.
    
    Correct this by using ARRAY_SIZE() to pass the actual number of
    string pointers in the array.
    
    Cc: stable@vger.kernel.org
    Fixes: 0257be79fc4a ("mtd: spi-nor: expose internal parameters via debugfs")
    Closes: https://sashiko.dev/#/patchset/20260417-die-erase-fix-v2-1-73bb7004ebad%40infineon.com [1]
    Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
    Reviewed-by: Takahiro Kuwano <takahiro.kuwano@infineon.com>
    Reviewed-by: Michael Walle <mwalle@kernel.org>
    Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    [ adjusted include-block context to keep 6.1.y's existing non-alphabetical header order while still adding `#include <linux/array_size.h>` at the top ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
net/802/mrp: fix vector attribute parsing in mrp_pdu_parse_vecattr [+ + +]
Author: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Date:   Wed Jun 3 14:00:13 2026 +0800

    net/802/mrp: fix vector attribute parsing in mrp_pdu_parse_vecattr
    
    [ Upstream commit 7561c7fbc694308da73300f036719e63e42bf0b4 ]
    
    In mrp_pdu_parse_vecattr(), vector attribute events are encoded three
    per byte and valen tracks the number of events left to process.
    
    The parser decrements valen after processing the first and second events
    from each event byte, but not after processing the third one. When valen
    is exactly a multiple of three, the loop continues after the last valid
    event and consumes the next byte as a new event byte, applying a
    spurious event to the MRP applicant state.
    
    Additionally, when valen is zero the parser unconditionally consumes
    attrlen bytes as FirstValue and advances the offset, even though per
    IEEE 802.1ak a VectorAttribute with only a LeaveAllEvent has valen of
    zero and no FirstValue or Vector fields. This corrupts the offset for
    subsequent PDU parsing.
    
    Also, when valen exceeds three the loop crosses byte boundaries but
    the attribute value is not incremented between the last event of one
    byte and the first event of the next. This causes the first event of
    the next byte to use the same attribute value as the third event
    rather than the next consecutive value.
    
    Decrement valen after processing the third event, skip FirstValue
    consumption when valen is zero, and increment the attribute value at
    the end of each loop iteration.
    
    Fixes: febf018d2234 ("net/802: Implement Multiple Registration Protocol (MRP)")
    Reported-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
    Reported-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
    Reported-by: Ao Wang <wangao@seu.edu.cn>
    Reported-by: Xuewei Feng <fengxw06@126.com>
    Reported-by: Qi Li <qli01@tsinghua.edu.cn>
    Reported-by: Ke Xu <xuke@tsinghua.edu.cn>
    Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
    Link: https://patch.msgid.link/20260603060016.21522-1-zhaoyz24@mails.tsinghua.edu.cn
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/iucv: fix locking in .getsockopt [+ + +]
Author: Breno Leitao <leitao@debian.org>
Date:   Thu May 21 07:11:45 2026 -0700

    net/iucv: fix locking in .getsockopt
    
    [ Upstream commit 3589d20a666caf30ad100c960a2de7de390fce88 ]
    
    Mirror iucv_sock_setsockopt() and wrap the whole switch in
    lock_sock()/release_sock(). The pre-existing SO_MSGLIMIT-only lock
    becomes redundant and is removed.
    
    Any AF_IUCV HIPER user can potentially crash the kernel by racing
    recvmsg() with getsockopt(SO_MSGSIZE): the SO_MSGSIZE arm dereferences
    iucv->hs_dev->mtu after iucv_sock_close() (called from the racing
    recvmsg()) has set hs_dev to NULL, producing a NULL pointer dereference
    oops.
    
    Suggested-by: Stanislav Fomichev <sdf.kernel@gmail.com>
    Fixes: 51363b8751a6 ("af_iucv: allow retrieval of maximum message size")
    Signed-off-by: Breno Leitao <leitao@debian.org>
    Reviewed-by: Alexandra Winter <wintera@linux.ibm.com>
    Tested-by: Alexandra Winter <wintera@linux.ibm.com>
    Link: https://patch.msgid.link/20260521-af_iucv_fix2-v1-1-f16b1c510aa9@debian.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/mlx4: avoid GCC 10 __bad_copy_from() false positive [+ + +]
Author: Yao Sang <sangyao@kylinos.cn>
Date:   Wed Jun 3 14:10:44 2026 +0800

    net/mlx4: avoid GCC 10 __bad_copy_from() false positive
    
    [ Upstream commit 2365343f4aad3e1b1e7a2e87e98cf66d5e590589 ]
    
    mlx4_init_user_cqes() fills a scratch buffer with the CQE
    initialization pattern and then copies from that buffer to userspace.
    
    In the single-copy path, the copy length is array_size(entries,
    cqe_size), but the scratch buffer is allocated with PAGE_SIZE. GCC 10
    does not carry the branch invariant strongly enough through the object
    size checks and falsely triggers __bad_copy_from().
    
    Size the scratch buffer to the actual copy length for the active path,
    keep array_size() for the single-copy case, and retain a WARN_ON_ONCE()
    guard for the PAGE_SIZE invariant before allocating the buffer.
    
    Fixes: f69bf5dee7ef ("net/mlx4: Use array_size() helper in copy_to_user()")
    Signed-off-by: Yao Sang <sangyao@kylinos.cn>
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/mlx5: Reorder completion before putting command entry in cmd_work_handler [+ + +]
Author: Nikolay Kuratov <kniv@yandex-team.ru>
Date:   Tue May 26 19:29:32 2026 +0300

    net/mlx5: Reorder completion before putting command entry in cmd_work_handler
    
    commit 02896a7fa4cd3ec61d60ba30136841e4f04bdeac upstream.
    
    Assuming callback != NULL && !page_queue, cmd_work_handler takes
    command entry with refcnt == 1 from mlx5_cmd_invoke.
    If either semaphore timeout or index allocation error happens,
    it does final cmd_ent_put(ent). To avoid access to freed memory,
    notify slotted completion before cmd_ent_put.
    
    This is theoretical issue found by Svace static analyser.
    
    Cc: stable@vger.kernel.org
    Fixes: 485d65e135712 ("net/mlx5: Add a timeout to acquire the command queue semaphore")
    Fixes: 0e2909c6bec90 ("net/mlx5: Fix variable not being completed when function returns")
    Signed-off-by: Nikolay Kuratov <kniv@yandex-team.ru>
    Reviewed-by: Md Haris Iqbal <haris.iqbal@linux.dev>
    Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
    Acked-by: Tariq Toukan <tariqt@nvidia.com>
    Link: https://patch.msgid.link/20260526162932.501584-1-kniv@yandex-team.ru
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
net/packet: convert po->has_vnet_hdr to an atomic flag [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Mar 16 01:10:12 2023 +0000

    net/packet: convert po->has_vnet_hdr to an atomic flag
    
    [ Upstream commit 50d935eafee292fc432d5ac8c8715a6492961abc ]
    
    po->has_vnet_hdr can be read locklessly.
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Stable-dep-of: 2c054e17d9d4 ("net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/packet: convert po->running to an atomic flag [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Mar 16 01:10:13 2023 +0000

    net/packet: convert po->running to an atomic flag
    
    [ Upstream commit 61edf479818e63978cabd243b82ca80f8948a313 ]
    
    Instead of consuming 32 bits for po->running, use
    one available bit in po->flags.
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Stable-dep-of: 2c054e17d9d4 ("net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/packet: convert po->tp_loss to an atomic flag [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Mar 16 01:10:11 2023 +0000

    net/packet: convert po->tp_loss to an atomic flag
    
    [ Upstream commit 164bddace2e03f6005e650cb88f101a66ebdc05a ]
    
    tp_loss can be read locklessly.
    
    Convert it to an atomic flag to avoid races.
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Stable-dep-of: 2c054e17d9d4 ("net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/packet: convert po->tp_tx_has_off to an atomic flag [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Thu Mar 16 01:10:10 2023 +0000

    net/packet: convert po->tp_tx_has_off to an atomic flag
    
    [ Upstream commit 7438344660fa55b33b8234c1797c886eb73667a7 ]
    
    This is to use existing space in po->flags, and reclaim
    the storage used by the non atomic bit fields.
    
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Stable-dep-of: 2c054e17d9d4 ("net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd() [+ + +]
Author: Bingquan Chen <patzilla007@gmail.com>
Date:   Sat Apr 18 19:20:06 2026 +0800

    net/packet: fix TOCTOU race on mmap'd vnet_hdr in tpacket_snd()
    
    [ Upstream commit 2c054e17d9d41f1020376806c7f750834ced4dc5 ]
    
    In tpacket_snd(), when PACKET_VNET_HDR is enabled, vnet_hdr points
    directly into the mmap'd TX ring buffer shared with userspace. The
    kernel validates the header via __packet_snd_vnet_parse() but then
    re-reads all fields later in virtio_net_hdr_to_skb(). A concurrent
    userspace thread can modify the vnet_hdr fields between validation
    and use, bypassing all safety checks.
    
    The non-TPACKET path (packet_snd()) already correctly copies vnet_hdr
    to a stack-local variable. All other vnet_hdr consumers in the kernel
    (tun.c, tap.c, virtio_net.c) also use stack copies. The TPACKET TX
    path is the only caller of virtio_net_hdr_to_skb() that reads directly
    from user-controlled shared memory.
    
    Fix this by copying vnet_hdr from the mmap'd ring buffer to a
    stack-local variable before validation and use, consistent with the
    approach used in packet_snd() and all other callers.
    
    Fixes: 1d036d25e560 ("packet: tpacket_snd gso and checksum offload")
    Signed-off-by: Bingquan Chen <patzilla007@gmail.com>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/20260418112006.78823-1-patzilla007@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/rds: fix NULL deref in rds_ib_send_cqe_handler() on masked atomic completion [+ + +]
Author: Weiming Shi <bestswngs@gmail.com>
Date:   Sat Jun 6 12:24:48 2026 -0700

    net/rds: fix NULL deref in rds_ib_send_cqe_handler() on masked atomic completion
    
    [ Upstream commit 34080db3e70ddf94c38512ad2331e3c3afca6cc1 ]
    
    rds_ib_xmit_atomic() always programs a masked atomic opcode
    (IB_WR_MASKED_ATOMIC_CMP_AND_SWP or IB_WR_MASKED_ATOMIC_FETCH_AND_ADD)
    for every RDS atomic cmsg.  But the completion-side switch in
    rds_ib_send_unmap_op() only handles the non-masked opcodes, so a masked
    atomic completion falls through to default and returns rm == NULL while
    send->s_op is left set.  rds_ib_send_cqe_handler() then dereferences the
    NULL rm via rm->m_final_op, oopsing in softirq context.  An unprivileged
    AF_RDS sendmsg() of an atomic cmsg over an active RDS/IB connection
    triggers it; on hardware that natively accepts masked atomics (mlx4,
    mlx5) no extra setup is needed.
    
      RDS/IB: rds_ib_send_unmap_op: unexpected opcode 0xd in WR!
      Oops: general protection fault [#1] SMP KASAN
      KASAN: null-ptr-deref in range [0x0000000000000190-0x0000000000000197]
      RIP: rds_ib_send_cqe_handler+0x25c/0xb10 (net/rds/ib_send.c:282)
      Call Trace:
       <IRQ>
       rds_ib_send_cqe_handler (net/rds/ib_send.c:282)
       poll_scq (net/rds/ib_cm.c:274)
       rds_ib_tasklet_fn_send (net/rds/ib_cm.c:294)
       tasklet_action_common (kernel/softirq.c:943)
       handle_softirqs (kernel/softirq.c:573)
       run_ksoftirqd (kernel/softirq.c:479)
       </IRQ>
      Kernel panic - not syncing: Fatal exception in interrupt
    
    Handle the masked atomic opcodes in the same case as the non-masked
    ones: they map to the same struct rds_message.atomic union member, so
    the existing container_of()/rds_ib_send_unmap_atomic() body is correct
    for them.
    
    Fixes: 20c72bd5f5f9 ("RDS: Implement masked atomic operations")
    Reported-by: Xiang Mei <xmei5@asu.edu>
    Signed-off-by: Weiming Shi <bestswngs@gmail.com>
    Reviewed-by: Allison Henderson <achender@kernel.org>
    Link: https://patch.msgid.link/20260606192447.1179255-2-bestswngs@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/sched: act_api: use RCU with deferred freeing for action lifecycle [+ + +]
Author: Jamal Hadi Salim <jhs@mojatatu.com>
Date:   Sun May 31 12:08:12 2026 -0400

    net/sched: act_api: use RCU with deferred freeing for action lifecycle
    
    [ Upstream commit 5057e1aca011e51ef51498c940ef96f3d3e8a305 ]
    
    When NEWTFILTER and DELFILTER are run concurrently it is possible to create a
    race with an associated action.
    
    Let's illustrate with CPU0 running NEWTFILTER and CPU1 running DELFILTER:
    
     0: mutex_lock() <-- holds the idr lock
     0: rcu_read_lock()
     0: p = idr_find(idr, index) <-- action p is valid (RCU protects IDR)
     0: mutex_unlock() <-- releases the idr lock
     1: refcount_dec_and_mutex_lock() <-- refcnt 1->0, mutex held
     1: idr_remove(idr, index) <-- Action removed from IDR
     1: mutex_unlock() <-- mutex released allowing us to delete the action
     1: tcf_action_cleanup(p); kfree(p) <-- Kfrees p immediately, no deferral
     0: refcount_inc_not_zero(&p->tcfa_refcnt) <-- ouch, UAF p points to freed memory
    
    This patch fixes the race condition between NEWTFILTER and DELFILTER by
    adding struct rcu_head to tc_action used in the deferral and introducing a
    call_rcu() in the delete path to defer the final kfree().
    
    Note: this is a revert of commit d7fb60b9cafb ("net_sched: get rid of tcfa_rcu")
    but also modernization/simplification to directly use kfree_rcu().
    
    Let's illustrate the new restored code path:
    
     0: rcu_read_lock()
     1: refcount_dec_and_mutex_lock() <-- refcnt 1->0, mutex held
     1: idr_remove(idr, index)
     1: mutex_unlock()
     1: call_rcu(&p->tcfa_rcu, tcf_action_rcu_free) <-- defer kfree after grace period
     0: p = idr_find(idr, index)
     0: refcount_inc_not_zero(&p->tcfa_refcnt) <-- fails, refcnt already 0
     1: rcu_read_unlock() <-- release so freeing can run after grace period
    
    After CPU1 calls idr_remove(), the object is no longer reachable through the IDR.
    CPU0's subsequent idr_find() will return NULL, and even if it still held a
    stale pointer, the immediate kfree() is now deferred until after the RCU grace
    period, so no UAF can occur.
    
    Fixes: d7fb60b9cafb ("net_sched: get rid of tcfa_rcu")
    Suggested-by: Jakub Kicinski <kuba@kernel.org>
    Reported-by: Kyle Zeng <kylebot@openai.com>
    Tested-by: Victor Nogueira <victor@mojatatu.com>
    Tested-by: syzbot@syzkaller.appspotmail.com
    Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
    Tested-by: Kyle Zeng <kylebot@openai.com>
    Reviewed-by: Pedro Tammela <pctammela@mojatatu.com>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: Victor Nogueira <victor@mojatatu.com>
    Link: https://patch.msgid.link/20260531160812.68020-1-jhs@mojatatu.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/sched: cls_fw: fix NULL dereference of "old" filters before change() [+ + +]
Author: Davide Caratti <dcaratti@redhat.com>
Date:   Wed Apr 8 17:24:36 2026 +0200

    net/sched: cls_fw: fix NULL dereference of "old" filters before change()
    
    [ Upstream commit 65782b2db7321d5f97c16718c4c7f6c7205a56be ]
    
    Like pointed out by Sashiko [1], since commit ed76f5edccc9 ("net: sched:
    protect filter_chain list with filter_chain_lock mutex") TC filters are
    added to a shared block and published to datapath before their ->change()
    function is called. This is a problem for cls_fw: an invalid filter
    created with the "old" method can still classify some packets before it
    is destroyed by the validation logic added by Xiang.
    Therefore, insisting with repeated runs of the following script:
    
     # ip link add dev crash0 type dummy
     # ip link set dev crash0 up
     # mausezahn  crash0 -c 100000 -P 10 \
     > -A 4.3.2.1 -B 1.2.3.4 -t udp "dp=1234" -q &
     # sleep 1
     # tc qdisc add dev crash0 egress_block 1 clsact
     # tc filter add block 1 protocol ip prio 1 matchall \
     > action skbedit mark 65536 continue
     # tc filter add block 1 protocol ip prio 2 fw
     # ip link del dev crash0
    
    can still make fw_classify() hit the WARN_ON() in [2]:
    
     WARNING: ./include/net/pkt_cls.h:88 at fw_classify+0x244/0x250 [cls_fw], CPU#18: mausezahn/1399
     Modules linked in: cls_fw(E) act_skbedit(E)
     CPU: 18 UID: 0 PID: 1399 Comm: mausezahn Tainted: G            E       7.0.0-rc6-virtme #17 PREEMPT(full)
     Tainted: [E]=UNSIGNED_MODULE
     Hardware name: Red Hat KVM, BIOS 1.16.3-2.el9 04/01/2014
     RIP: 0010:fw_classify+0x244/0x250 [cls_fw]
     Code: 5c 49 c7 45 00 00 00 00 00 41 5d 41 5e 41 5f 5d c3 cc cc cc cc 5b b8 ff ff ff ff 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc 90 <0f> 0b 90 eb a0 0f 1f 80 00 00 00 00 90 90 90 90 90 90 90 90 90 90
     RSP: 0018:ffffd1b7026bf8a8 EFLAGS: 00010202
     RAX: ffff8c5ac9c60800 RBX: ffff8c5ac99322c0 RCX: 0000000000000004
     RDX: 0000000000000001 RSI: ffff8c5b74d7a000 RDI: ffff8c5ac8284f40
     RBP: ffffd1b7026bf8d0 R08: 0000000000000000 R09: ffffd1b7026bf9b0
     R10: 00000000ffffffff R11: 0000000000000000 R12: 0000000000010000
     R13: ffffd1b7026bf930 R14: ffff8c5ac8284f40 R15: 0000000000000000
     FS:  00007fca40c37740(0000) GS:ffff8c5b74d7a000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 00007fca40e822a0 CR3: 0000000005ca0001 CR4: 0000000000172ef0
     Call Trace:
      <TASK>
      tcf_classify+0x17d/0x5c0
      tc_run+0x9d/0x150
      __dev_queue_xmit+0x2ab/0x14d0
      ip_finish_output2+0x340/0x8f0
      ip_output+0xa4/0x250
      raw_sendmsg+0x147d/0x14b0
      __sys_sendto+0x1cc/0x1f0
      __x64_sys_sendto+0x24/0x30
      do_syscall_64+0x126/0xf80
      entry_SYSCALL_64_after_hwframe+0x77/0x7f
     RIP: 0033:0x7fca40e822ba
     Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb b8 0f 1f 00 f3 0f 1e fa 41 89 ca 64 8b 04 25 18 00 00 00 85 c0 75 15 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 7e c3 0f 1f 44 00 00 41 54 48 83 ec 30 44 89
     RSP: 002b:00007ffc248a42c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
     RAX: ffffffffffffffda RBX: 000055ef233289d0 RCX: 00007fca40e822ba
     RDX: 000000000000001e RSI: 000055ef23328c30 RDI: 0000000000000003
     RBP: 000055ef233289d0 R08: 00007ffc248a42d0 R09: 0000000000000010
     R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000001e
     R13: 00000000000186a0 R14: 0000000000000000 R15: 00007fca41043000
      </TASK>
     irq event stamp: 1045778
     hardirqs last  enabled at (1045784): [<ffffffff864ec042>] __up_console_sem+0x52/0x60
     hardirqs last disabled at (1045789): [<ffffffff864ec027>] __up_console_sem+0x37/0x60
     softirqs last  enabled at (1045426): [<ffffffff874d48c7>] __alloc_skb+0x207/0x260
     softirqs last disabled at (1045434): [<ffffffff874fe8f8>] __dev_queue_xmit+0x78/0x14d0
    
    Then, because of the value in the packet's mark, dereference on 'q->handle'
    with NULL 'q' occurs:
    
     BUG: kernel NULL  pointer dereference, address: 0000000000000038
     [...]
     RIP: 0010:fw_classify+0x1fe/0x250 [cls_fw]
     [...]
    
    Skip "old-style" classification on shared blocks, so that the NULL
    dereference is fixed and WARN_ON() is not hit anymore in the short
    lifetime of invalid cls_fw "old-style" filters.
    
    [1] https://sashiko.dev/#/patchset/20260331050217.504278-1-xmei5%40asu.edu
    [2] https://elixir.bootlin.com/linux/v7.0-rc6/source/include/net/pkt_cls.h#L86
    
    Fixes: faeea8bbf6e9 ("net/sched: cls_fw: fix NULL pointer dereference on shared blocks")
    Fixes: ed76f5edccc9 ("net: sched: protect filter_chain list with filter_chain_lock mutex")
    Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
    Signed-off-by: Davide Caratti <dcaratti@redhat.com>
    Link: https://patch.msgid.link/e39cbd3103a337f1e515d186fe697b4459d24757.1775661704.git.dcaratti@redhat.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/sched: sch_sfb: Replace direct dequeue call with peek and qdisc_dequeue_peeked [+ + +]
Author: Victor Nogueria <victor@mojatatu.com>
Date:   Thu Apr 30 11:29:56 2026 -0400

    net/sched: sch_sfb: Replace direct dequeue call with peek and qdisc_dequeue_peeked
    
    [ Upstream commit 1b9bc71153b01dbde8045b9edede4240f4f5520e ]
    
    When sfb has children (eg qfq qdisc) whose peek() callback is
    qdisc_peek_dequeued(), we could get a kernel panic. When the parent of such
    qdiscs (eg illustrated in patch #3 as tbf) wants to retrieve an skb from
    its child (sfb in this case), it will do the following:
     1a. do a peek() - and when sensing there's an skb the child can offer, then
         - the child in this case(sfb) calls its child's (qfq) peek.
            qfq does the right thing and will return the gso_skb queue packet.
            Note: if there wasnt a gso_skb entry then qfq will store it there.
     1b. invoke a dequeue() on the child (sfb). And herein lies the problem.
         - sfb will call the child's dequeue() which will essentially just
           try to grab something of qfq's queue.
    
    [  127.594489][  T453] KASAN: null-ptr-deref in range [0x0000000000000048-0x000000000000004f]
    [  127.594741][  T453] CPU: 2 UID: 0 PID: 453 Comm: ping Not tainted 7.1.0-rc1-00035-gac961974495b-dirty #793 PREEMPT(full)
    [  127.595059][  T453] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
    [  127.595254][  T453] RIP: 0010:qfq_dequeue+0x35c/0x1650 [sch_qfq]
    [  127.595461][  T453] Code: 00 fc ff df 80 3c 02 00 0f 85 17 0e 00 00 4c 8d 73 48 48 89 9d b8 02 00 00 48 b8 00 00 00 00 00 fc ff df 4c 89 f2 48 c1 ea 03 <80> 3c 02 00 0f 85 76 0c 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b
    [  127.596081][  T453] RSP: 0018:ffff88810e5af440 EFLAGS: 00010216
    [  127.596337][  T453] RAX: dffffc0000000000 RBX: 0000000000000000 RCX: dffffc0000000000
    [  127.596623][  T453] RDX: 0000000000000009 RSI: 0000001880000000 RDI: ffff888104fd82b0
    [  127.596917][  T453] RBP: ffff888104fd8000 R08: ffff888104fd8280 R09: 1ffff110211893a3
    [  127.597165][  T453] R10: 1ffff110211893a6 R11: 1ffff110211893a7 R12: 0000001880000000
    [  127.597404][  T453] R13: ffff888104fd82b8 R14: 0000000000000048 R15: 0000000040000000
    [  127.597644][  T453] FS:  00007fc380cbfc40(0000) GS:ffff88816f2a8000(0000) knlGS:0000000000000000
    [  127.597956][  T453] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  127.598160][  T453] CR2: 00005610aa9890a8 CR3: 000000010369e000 CR4: 0000000000750ef0
    [  127.598390][  T453] PKRU: 55555554
    [  127.598509][  T453] Call Trace:
    [  127.598629][  T453]  <TASK>
    [  127.598718][  T453]  ? mark_held_locks+0x40/0x70
    [  127.598890][  T453]  ? srso_alias_return_thunk+0x5/0xfbef5
    [  127.599053][  T453]  sfb_dequeue+0x88/0x4d0
    [  127.599174][  T453]  ? ktime_get+0x137/0x230
    [  127.599328][  T453]  ? srso_alias_return_thunk+0x5/0xfbef5
    [  127.599480][  T453]  ? qdisc_peek_dequeued+0x7b/0x350 [sch_qfq]
    [  127.599670][  T453]  ? srso_alias_return_thunk+0x5/0xfbef5
    [  127.599831][  T453]  tbf_dequeue+0x6b1/0x1098 [sch_tbf]
    [  127.599988][  T453]  __qdisc_run+0x169/0x1900
    
    The right thing to do in #1b is to grab the skb off gso_skb queue.
    This patchset fixes that issue by changing #1b to use qdisc_dequeue_peeked()
    method instead.
    
    Fixes: e13e02a3c68d ("net_sched: SFB flow scheduler")
    Signed-off-by: Victor Nogueria <victor@mojatatu.com>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Link: https://patch.msgid.link/20260430152957.194015-3-jhs@mojatatu.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
net/smc: Do not re-initialize smc hashtables [+ + +]
Author: Alexandra Winter <wintera@linux.ibm.com>
Date:   Thu May 21 16:56:39 2026 +0200

    net/smc: Do not re-initialize smc hashtables
    
    [ Upstream commit 9e4389b0038781f19f97895186ed941ff8ac1678 ]
    
    INIT_HLIST_HEAD(&smc_v*_hashinfo.ht) are called after smc_nl_init(),
    proto_register() and sock_register(). This can lead to smc_v*_hashinfo.ht
    being reset even though hash entries already exist and are being used,
    possibly resulting in a corrupted list.
    
    Remove unnecessary and dangerous re-initialisation of smc_v*_hashinfo.ht in
    smc_init(); it is implicitly initialised to zero anyhow. Add
    HLIST_HEAD_INIT to the definitions for clarity.
    
    Fixes: f16a7dd5cf27 ("smc: netlink interface for SMC sockets")
    Suggested-by: Halil Pasic <pasic@linux.ibm.com>
    Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
    Acked-by: Halil Pasic <pasic@linux.ibm.com>
    Reviewed-by: Mahanta Jambigi <mjambigi@linux.ibm.com>
    Link: https://patch.msgid.link/20260521145639.10317-1-wintera@linux.ibm.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net/smc: fix sleep-inside-lock in __smc_setsockopt() causing local DoS [+ + +]
Author: Nicolò Coccia <n.coccia96@gmail.com>
Date:   Sun May 10 12:34:13 2026 -0400

    net/smc: fix sleep-inside-lock in __smc_setsockopt() causing local DoS
    
    commit a3fdd924d88c30b9f488636ce0e4696012cf5511 upstream.
    
    A logic flaw in __smc_setsockopt() allows a local unprivileged user to
    cause a Denial of Service (DoS) by holding the socket lock indefinitely.
    
    The function __smc_setsockopt() calls copy_from_sockptr() while holding
    lock_sock(sk). By passing a userfaultfd-monitored memory page (or
    FUSE-backed memory on systems where unprivileged userfaultfd is disabled)
    as the optval, an attacker can halt execution during the copy operation,
    keeping the lock held.
    
    Combined with asynchronous tear-down operations like shutdown(), this
    exhausts the kernel wq (kworkers) and triggers the hung task watchdog.
    
    [  240.123456] INFO: task kworker/u8:2 blocked for more than 120 seconds.
    [  240.123489] Call Trace:
    [  240.123501]  smc_shutdown+...
    [  240.123512]  lock_sock_nested+...
    
    This patch moves the user-space copy outside the lock_sock() critical
    section to prevent the issue.
    
    Fixes: a6a6fe27bab4 ("net/smc: Dynamic control handshake limitation by socket options")
    Signed-off-by: Nicolò Coccia <n.coccia96@gmail.com>
    Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
    Tested-by: Dust Li <dust.li@linux.alibaba.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
net: Annotate sk->sk_write_space() for UDP SOCKMAP. [+ + +]
Author: Kuniyuki Iwashima <kuniyu@google.com>
Date:   Fri May 29 19:39:23 2026 +0000

    net: Annotate sk->sk_write_space() for UDP SOCKMAP.
    
    [ Upstream commit b748765019fe9e9234660327090fc1a9665cdbdd ]
    
    UDP TX skb->destructor() is sock_wfree(), and UDP holds lock_sock()
    only for UDP_CORK / MSG_MORE sendmsg().
    
    Otherwise, sk->sk_write_space() may be read locklessly while SOCKMAP
    rewrites sk->sk_write_space().
    
    Let's use WRITE_ONCE() and READ_ONCE() for sk->sk_write_space().
    
    Note that the write side is annotated by commit 2ef2b20cf4e0
    ("net: annotate data-races around sk->sk_{data_ready,write_space}").
    
    Fixes: 7b98cd42b049 ("bpf: sockmap: Add UDP support")
    Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
    Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
    Link: https://patch.msgid.link/20260529193941.3897256-1-kuniyu@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: bonding: fix NULL pointer dereference in bond_do_ioctl() [+ + +]
Author: ZhaoJinming <zhaojinming@uniontech.com>
Date:   Mon Jun 1 16:56:49 2026 +0800

    net: bonding: fix NULL pointer dereference in bond_do_ioctl()
    
    commit a764b0e8317a863006e05732e1aefe821b9d8c2d upstream.
    
    In bond_do_ioctl(), slave_dev is obtained via __dev_get_by_name() which
    can return NULL if the requested interface name does not exist. However,
    the subsequent slave_dbg() call is placed before the NULL check:
    
        slave_dev = __dev_get_by_name(net, ifr->ifr_slave);
        slave_dbg(bond_dev, slave_dev, "slave_dev=%p:\n", slave_dev); //here
        if (!slave_dev)
            return -ENODEV;
    
    The slave_dbg() macro expands to netdev_dbg(bond_dev, "(slave %s): " fmt,
    (slave_dev)->name, ...) which unconditionally dereferences slave_dev->name
    before the NULL check is performed. This results in a NULL pointer
    dereference kernel oops when a user calls bonding ioctl (e.g.
    SIOCBONDENSLAVE, SIOCBONDRELEASE, etc.) with a non-existent slave
    interface name.
    
    This is reachable from userspace via the bonding ioctl interface with
    CAP_NET_ADMIN capability, making it a potential local denial-of-service
    vector.
    
    Fix by moving the slave_dbg() call after the NULL check.
    
    Fixes: e2a7420df2e0 ("bonding/main: convert to using slave printk macros")
    Cc: stable@vger.kernel.org # v5.2+
    Signed-off-by: ZhaoJinming <zhaojinming@uniontech.com>
    Link: https://patch.msgid.link/20260601085649.4029067-1-zhaojinming@uniontech.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: bridge: use a stable FDB dst snapshot in RCU readers [+ + +]
Author: Zhengchuan Liang <zcliangcn@gmail.com>
Date:   Mon May 4 06:45:39 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: stable@kernel.org
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Co-developed-by: Yuan Tan <yuantan098@gmail.com>
    Signed-off-by: Yuan Tan <yuantan098@gmail.com>
    Suggested-by: Xin Liu <bird@lzu.edu.cn>
    Tested-by: Ren Wei <enjou1224z@gmail.com>
    Signed-off-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
    Link: https://patch.msgid.link/6570fabb85ecadb8baaf019efe856f407711c7b9.1776043229.git.zcliangcn@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    [ kept combined `BR_PROXYARP_WIFI | BR_NEIGH_SUPPRESS` check and `cb->args[2]` instead of `br_is_neigh_suppress_enabled()` helper and `ctx->fdb_idx` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: cpsw_new: Fix potential unregister of netdev that has not been registered yet [+ + +]
Author: Kevin Hao <haokexin@gmail.com>
Date:   Mon Jun 1 15:37:56 2026 +0800

    net: cpsw_new: Fix potential unregister of netdev that has not been registered yet
    
    [ Upstream commit 9d724b34fbe13b71865ad0906a4be97571f19cf5 ]
    
    If an error occurs during register_netdev() for the first MAC in
    cpsw_register_ports(), even though cpsw->slaves[0].ndev is set to NULL,
    cpsw->slaves[1].ndev would remain unchanged. This could later cause
    cpsw_unregister_ports() to attempt unregistering the second MAC.
    To address this, add a check for ndev->reg_state before calling
    unregister_netdev(). With this change, setting cpsw->slaves[i].ndev
    to NULL becomes unnecessary and can be removed accordingly.
    
    Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
    Signed-off-by: Kevin Hao <haokexin@gmail.com>
    Cc: stable@vger.kernel.org
    Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
    Link: https://patch.msgid.link/20260205-cpsw-error-path-v1-2-6e58bae6b299@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Wenshan Lan <jetlan9@163.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: fec: fix pinctrl default state restore order on resume [+ + +]
Author: Tapio Reijonen <tapio.reijonen@vaisala.com>
Date:   Fri May 29 06:18:57 2026 +0000

    net: fec: fix pinctrl default state restore order on resume
    
    [ Upstream commit b455410146bf723c7ebcb49ecd5becc0d6611482 ]
    
    In fec_resume(), fec_enet_clk_enable() is called before
    pinctrl_pm_select_default_state() in the non-WoL path, inverting the
    ordering used in fec_suspend() which correctly switches to the sleep
    pinctrl state before disabling clocks.
    
    For PHYs with the PHY_RST_AFTER_CLK_EN flag (e.g. TI DP83848 or
    SMSC LAN87xx), fec_enet_clk_enable() triggers a hardware reset pulse
    via the phy-reset GPIO. With the GPIO pin still in sleep pinctrl state
    at that point, the GPIO write has no physical effect and the PHY never
    receives the required reset after clock enable, leading to unreliable
    link establishment after system resume.
    
    Fix by restoring the default pinctrl state before enabling clocks,
    making resume the proper mirror of suspend. The call is made
    unconditionally: fec_suspend() only switches to the sleep pinctrl state
    on the non-WoL path and leaves the pins in the default state when WoL
    is enabled, so on a WoL resume the device is already in the default
    state and pinctrl_pm_select_default_state() is a no-op.
    
    Fixes: de40ed31b3c5 ("net: fec: add Wake-on-LAN support")
    Signed-off-by: Tapio Reijonen <tapio.reijonen@vaisala.com>
    Reviewed-by: Wei Fang <wei.fang@nxp.com>
    Link: https://patch.msgid.link/20260529-b4-fec-resume-pinctrl-order-v3-1-6eda0f592fca@vaisala.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: garp: fix unsigned integer underflow in garp_pdu_parse_attr [+ + +]
Author: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Date:   Wed May 27 16:31:58 2026 +0800

    net: garp: fix unsigned integer underflow in garp_pdu_parse_attr
    
    [ Upstream commit 16e408e607a94b646fb14a2a98422c6877ae4b3c ]
    
    The receive-side GARP attribute parser computes dlen with reversed
    operands:
    
            dlen = sizeof(*ga) - ga->len;
    
    ga->len is the on-wire attribute length and includes the GARP attribute
    header. For normal attributes with data, ga->len is larger than
    sizeof(*ga), so the subtraction underflows in unsigned arithmetic.
    
    The resulting value is later passed to garp_attr_lookup(), whose length
    argument is u8. After truncation, the parsed data length usually no
    longer matches the length stored for locally registered attributes, so
    received Join/Leave events are ignored. This breaks the GARP receive path
    for common attributes, such as GVRP VLAN registration attributes.
    
    Compute the data length as the attribute length minus the header length.
    
    Fixes: eca9ebac651f ("net: Add GARP applicant-only participant")
    Reported-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
    Reported-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
    Reported-by: Ao Wang <wangao@seu.edu.cn>
    Reported-by: Xuewei Feng <fengxw06@126.com>
    Reported-by: Qi Li <qli01@tsinghua.edu.cn>
    Reported-by: Ke Xu <xuke@tsinghua.edu.cn>
    Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260527083200.42861-1-zhaoyz24@mails.tsinghua.edu.cn
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: gro: don't merge zcopy skbs [+ + +]
Author: Sabrina Dubroca <sd@queasysnail.net>
Date:   Wed May 20 22:44:42 2026 +0200

    net: gro: don't merge zcopy skbs
    
    [ Upstream commit 4db79a322db8c97f7b73b8a347395ef4d685eb40 ]
    
    skb_gro_receive() can currently copy frags between the source and GRO
    skb, without checking the zerocopy status, and in particular the
    SKBFL_MANAGED_FRAG_REFS flag.
    
    When SKBFL_MANAGED_FRAG_REFS is set, the skb doesn't hold a reference
    on the pages in shinfo->frags. Appending those frags to another skb's
    frags without fixing up the page refcount can lead to UAF.
    
    When either the last skb in the GRO chain (the one we would append
    frags to) or the source skb is zerocopy, don't merge the skbs.
    
    Fixes: 753f1ca4e1e5 ("net: introduce managed frags infrastructure")
    Reported-by: Huzaifa Sidhpurwala <huzaifas@redhat.com>
    Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/c3b7f906bbfcbdfd7b4fa9d6c18a438870df85be.1779307748.git.sd@queasysnail.net
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [Salvatore Bonaccorso: Adjust for context in 6.1.y series without
    e8d4d34df715 ("net: Add netif_get_gro_max_size helper for GRO")]
    Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: guard timestamp cmsgs to real error queue skbs [+ + +]
Author: Kyle Zeng <kylebot@openai.com>
Date:   Sat Jun 6 19:18:19 2026 -0700

    net: guard timestamp cmsgs to real error queue skbs
    
    [ Upstream commit 1ee90b77b727df903033db873c75caac5c27ec98 ]
    
    skb_is_err_queue() treats PACKET_OUTGOING as the sole marker for an skb
    from sk_error_queue. That assumption is not true for AF_PACKET sockets:
    outgoing packet taps are also delivered to packet sockets with
    skb->pkt_type == PACKET_OUTGOING, but their skb->cb is owned by AF_PACKET
    instead of struct sock_exterr_skb.
    
    If such an skb is received with timestamping enabled, the generic
    timestamp cmsg path can read AF_PACKET control-buffer state as
    sock_exterr_skb::opt_stats. With SO_RXQ_OVFL enabled, the packet drop
    counter overlaps opt_stats. An odd drop count makes the path emit
    SCM_TIMESTAMPING_OPT_STATS with skb->len and skb->data. For non-linear
    skbs this copies past the linear head and can trigger hardened usercopy or
    disclose adjacent heap contents.
    
    Keep skb_is_err_queue() local to net/socket.c, but make it verify that
    the PACKET_OUTGOING marker is paired with the sock_rmem_free destructor
    installed by sock_queue_err_skb(). AF_PACKET receive skbs use normal
    receive ownership and no longer pass as error-queue skbs, while legitimate
    sk_error_queue entries keep the PACKET_OUTGOING marker and sock_rmem_free
    ownership.
    
    Fixes: 8605330aac5a ("tcp: fix SCM_TIMESTAMPING_OPT_STATS for normal skbs")
    Signed-off-by: Kyle Zeng <kylebot@openai.com>
    Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/20260607021819.49698-1-kylebot@openai.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: hsr: defer node table free until after RCU readers [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Fri May 29 19:55:12 2026 -0400

    net: hsr: defer node table free until after RCU readers
    
    [ Upstream commit aaec7096f9961eb223b5b149abe9495525c205d9 ]
    
    HSR node-list and node-status generic-netlink operations run under
    rcu_read_lock(). They walk hsr->node_db through hsr_get_next_node() and
    hsr_get_node_data(), but RTM_DELLINK teardown removes the same node table
    with plain list_del() and frees each node immediately.
    
    That lets a generic-netlink reader hold a struct hsr_node pointer across
    hsr_dellink(). In a KASAN build, widening the reader window after
    hsr_get_next_node() obtains the node reproduces a slab-use-after-free
    when the reader copies node->macaddress_A; the freeing stack is
    hsr_del_nodes() from hsr_dellink().
    
    Use list_del_rcu() and defer the free through the existing
    hsr_free_node_rcu() callback. This matches the lifetime rule used by the
    HSR prune paths, which already delete nodes with list_del_rcu() and
    call_rcu().
    
    Fixes: b9a1e627405d ("hsr: implement dellink to clean up resources")
    Cc: stable@vger.kernel.org # v5.3+
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Link: https://patch.msgid.link/20260513233838.3064715-2-michael.bommarito@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [ replaced `list_del`+`call_rcu(hsr_free_node_rcu)` with `list_del_rcu`+`kfree_rcu(node, rcu_head)` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: hsr: fix potential OOB access in supervision frame handling [+ + +]
Author: Luka Gejak <luka.gejak@linux.dev>
Date:   Sat May 23 15:03:30 2026 +0200

    net: hsr: fix potential OOB access in supervision frame handling
    
    [ Upstream commit f229426072fc865654a60978bb7fda790a051ff3 ]
    
    Ensure the entire TLV header is linearized before access by adding
    sizeof(struct hsr_sup_tlv) to the pskb_may_pull() calls. Without this,
    a truncated frame could cause an out-of-bounds access.
    
    Fixes: eafaa88b3eb7 ("net: hsr: Add support for redbox supervision frames")
    Signed-off-by: Luka Gejak <luka.gejak@linux.dev>
    Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
    Link: https://patch.msgid.link/20260523130330.61880-1-luka.gejak@linux.dev
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: ipv4: stop checking crypto_ahash_alignmask [+ + +]
Author: Eric Biggers <ebiggers@google.com>
Date:   Wed May 13 12:52:53 2026 -0400

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

net: ipv6: stop checking crypto_ahash_alignmask [+ + +]
Author: Eric Biggers <ebiggers@google.com>
Date:   Wed May 13 12:52:54 2026 -0400

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

net: lan743x: permit VLAN-tagged packets up to configured MTU [+ + +]
Author: David Thompson <davthompson@nvidia.com>
Date:   Fri May 29 21:03:00 2026 +0000

    net: lan743x: permit VLAN-tagged packets up to configured MTU
    
    [ Upstream commit 8173d22b211f615015f7b35f48ab11a6dd78dc99 ]
    
    VLAN-tagged interfaces on lan743x devices were previously unreachable via
    SSH and failed to respond to large ping packets (e.g. "ping -s 1469" given
    MTU=1500). In these scenarios, "ethtool -S" reports non-zero "RX Oversize
    Frame Errors". According to Microchip AN2948, the MAC_RX FSE (VLAN field
    size enforcement) bit determines whether frames with VLAN tags exceeding
    the base MTU plus tag length are discarded.
    
    The driver must set the MAC_RX.FSE bit before setting MAC_RX.RXEN to allow
    VLAN-tagged frames up to the interface MTU, preventing them from being
    treated as oversized. As a result, both the base and VLAN-tagged interfaces
    can use the same MTU without receive errors.
    
    Fixes: 23f0703c125b ("lan743x: Add main source files for new lan743x driver")
    Signed-off-by: David Thompson <davthompson@nvidia.com>
    Reviewed-by: Thangaraj Samynathan <Thangaraj.s@microchip.com>
    Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>
    Tested-by: Nicolai Buchwitz <nb@tipi-net.de> # lan7430 on arm64 (RevPi
    Link: https://patch.msgid.link/20260529210300.433135-1-davthompson@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: mana: Add NULL guards in teardown path to prevent panic on attach failure [+ + +]
Author: Dipayaan Roy <dipayanroy@linux.microsoft.com>
Date:   Mon May 25 01:08:24 2026 -0700

    net: mana: Add NULL guards in teardown path to prevent panic on attach failure
    
    [ Upstream commit 17bfe0a8c014ee1d542ad352cd6a0a505361664a ]
    
    When queue allocation fails partway through, the error cleanup frees
    and NULLs apc->tx_qp and apc->rxqs. Multiple teardown paths such as
    mana_remove(), mana_change_mtu() recovery, and internal error handling
    in mana_alloc_queues() can subsequently call into functions that
    dereference these pointers without NULL checks:
    
    - mana_chn_setxdp() dereferences apc->rxqs[0], causing a NULL pointer
      dereference panic (CR2: 0000000000000000 at mana_chn_setxdp+0x26).
    - mana_destroy_vport() iterates apc->rxqs without a NULL check.
    - mana_fence_rqs() iterates apc->rxqs without a NULL check.
    - mana_dealloc_queues() iterates apc->tx_qp without a NULL check.
    
    Add NULL guards for apc->rxqs in mana_fence_rqs(),
    mana_destroy_vport(), and before the mana_chn_setxdp() call. Add a
    NULL guard for apc->tx_qp in mana_dealloc_queues() to skip TX queue
    draining when TX queues were never allocated or already freed.
    
    Fixes: ca9c54d2d6a5 ("net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)")
    Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
    Signed-off-by: Dipayaan Roy <dipayanroy@linux.microsoft.com>
    Link: https://patch.msgid.link/20260525081129.1230035-2-dipayanroy@linux.microsoft.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: mctp: ensure our nlmsg responses are initialised [+ + +]
Author: Jeremy Kerr <jk@codeconstruct.com.au>
Date:   Tue Jun 2 15:50:05 2026 +0800

    net: mctp: ensure our nlmsg responses are initialised
    
    [ Upstream commit a6a9bc544b675d8b5180f2718ec985ad267b5cbf ]
    
    Syed Faraz Abrar (@farazsth98) from Zellic, and Pumpkin (@u1f383) from
    DEVCORE Research Team working with Trend Micro Zero Day Initiative
    report that a RTM_GETNEIGH will return uninitalised data in the pad
    bytes of the ndmsg data.
    
    Ensure we're initialising the netlink data to zero, in the link, addr
    and neigh response messages.
    
    Fixes: 831119f88781 ("mctp: Add neighbour netlink interface")
    Fixes: 06d2f4c583a7 ("mctp: Add netlink route management")
    Fixes: 583be982d934 ("mctp: Add device handling and netlink interface")
    Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260209-dev-mctp-nlmsg-v1-1-f1e30c346a43@codeconstruct.com.au
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Li hongliang <1468888505@139.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: mctp: fix don't require received header reserved bits to be zero [+ + +]
Author: Yuan Zhaoming <yuanzm2@lenovo.com>
Date:   Mon May 4 04:34:02 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 <yuanzm2@lenovo.com>
    Cc: stable@vger.kernel.org
    Acked-by: Jeremy Kerr <jk@codeconstruct.com.au>
    Link: https://patch.msgid.link/20260417141340.5306-1-yuanzhaoming901030@126.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [ Context ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: mv643xx: fix OF node refcount [+ + +]
Author: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Date:   Tue Jun 2 09:34:14 2026 +0200

    net: mv643xx: fix OF node refcount
    
    commit 4aacf509e537a711fa71bca9f234e5eb6968850e upstream.
    
    Platform devices created with platform_device_alloc() call
    platform_device_release() when the last reference to the device's
    kobject is dropped. This function calls of_node_put() unconditionally.
    This works fine for devices created with platform_device_register_full()
    but users of the split approach (platform_device_alloc() +
    platform_device_add()) must bump the reference of the of_node they
    assign manually. Add the missing call to of_node_get().
    
    Cc: stable@vger.kernel.org
    Fixes: 76723bca2802 ("net: mv643xx_eth: add DT parsing support")
    Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260602073414.22500-1-bartosz.golaszewski@oss.qualcomm.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: mvpp2: Add metadata support for xdp mode [+ + +]
Author: Lorenzo Bianconi <lorenzo@kernel.org>
Date:   Tue Mar 18 12:46:06 2025 +0100

    net: mvpp2: Add metadata support for xdp mode
    
    [ Upstream commit 9a45e193c88a55a536d7fd0ebfa29823d588c2cf ]
    
    Set metadata size building the skb from xdp_buff in mvpp2 driver
    mvpp2 driver sets xdp headroom to:
    
    MVPP2_MH_SIZE + MVPP2_SKB_HEADROOM
    
    where
    
    MVPP2_MH_SIZE 2
    MVPP2_SKB_HEADROOM min(max(XDP_PACKET_HEADROOM, NET_SKB_PAD), 224)
    
    so the headroom is large enough to contain xdp_frame and xdp metadata.
    Please note this patch is just compiled tested.
    
    Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
    Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
    Link: https://patch.msgid.link/20250318-mvneta-xdp-meta-v2-2-b6075778f61f@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Stable-dep-of: 77a6b90ce56b ("net: mvpp2: build skb from XDP-adjusted data on XDP_PASS")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: mvpp2: build skb from XDP-adjusted data on XDP_PASS [+ + +]
Author: Til Kaiser <mail@tk154.de>
Date:   Sun Jun 7 15:49:43 2026 +0200

    net: mvpp2: build skb from XDP-adjusted data on XDP_PASS
    
    [ Upstream commit 77a6b90ce56bc982dcfa94229b8e28e6abb16e95 ]
    
    When an XDP program uses bpf_xdp_adjust_head() or bpf_xdp_adjust_tail()
    and then returns XDP_PASS, mvpp2 still builds the skb from fixed offsets
    derived from the original RX descriptor. Packet geometry changes made by
    the XDP program are therefore discarded before the skb reaches the stack.
    
    Update rx_offset and rx_bytes from xdp.data and xdp.data_end for
    XDP_PASS. This makes skb_reserve() and skb_put() reflect the packet seen
    by XDP, and makes RX byte accounting for XDP_PASS follow the length of the
    skb passed to the network stack.
    
    Keep a separate rx_sync_size for page-pool recycling on skb allocation
    failure, which must stay tied to the received buffer range.
    
    Non-PASS verdicts continue to account the descriptor length because no skb
    is passed up in those cases.
    
    Fixes: 07dd0a7aae7f ("mvpp2: add basic XDP support")
    Signed-off-by: Til Kaiser <mail@tk154.de>
    Link: https://patch.msgid.link/20260607134943.21996-5-mail@tk154.de
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: mvpp2: limit XDP frame size to the RX buffer [+ + +]
Author: Til Kaiser <mail@tk154.de>
Date:   Sun Jun 7 15:49:41 2026 +0200

    net: mvpp2: limit XDP frame size to the RX buffer
    
    [ Upstream commit f3c6aa078927e6fe8121c9c591ddee8716c5305a ]
    
    mvpp2 has short and long BM pools, and short pool buffers can be smaller
    than PAGE_SIZE. The XDP path nevertheless initializes every xdp_buff with
    PAGE_SIZE as frame size.
    
    XDP helpers use frame_sz to validate tail growth and to derive the hard
    end of the data area. Advertising PAGE_SIZE for short buffers can let
    bpf_xdp_adjust_tail() grow a packet past the real allocation, corrupting
    memory or later tripping skb tailroom checks.
    
    Initialize the XDP buffer with bm_pool->frag_size so XDP tailroom matches
    the actual buffer backing the packet.
    
    Fixes: 07dd0a7aae7f ("mvpp2: add basic XDP support")
    Signed-off-by: Til Kaiser <mail@tk154.de>
    Link: https://patch.msgid.link/20260607134943.21996-3-mail@tk154.de
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: mvpp2: refill RX buffers before XDP or skb use [+ + +]
Author: Til Kaiser <mail@tk154.de>
Date:   Sun Jun 7 15:49:42 2026 +0200

    net: mvpp2: refill RX buffers before XDP or skb use
    
    [ Upstream commit 5e8e2a9624df72fca7c736b2966b2cbf6c9c3ff6 ]
    
    The RX error path returns the current descriptor buffer to the hardware
    BM pool. That is only valid while the driver still owns the buffer.
    
    mvpp2_rx_refill() can fail after the current buffer has been handed to
    XDP or attached to an skb. In those cases mvpp2_run_xdp() may have
    recycled, redirected, or queued the page for XDP_TX, and an skb free also
    retires the data buffer. Returning such a buffer to BM lets hardware DMA
    into memory that is no longer owned by the RX ring.
    
    Refill the BM pool before handing the current buffer to XDP or to the
    skb. If the allocation fails there, drop the packet and return the
    still-owned current buffer to BM, preserving the pool depth. Once the
    refill succeeds, later local drops retire/free the current buffer instead
    of returning it to BM.
    
    Fixes: 07dd0a7aae7f ("mvpp2: add basic XDP support")
    Fixes: d6526926de73 ("net: mvpp2: fix memory leak in mvpp2_rx")
    Signed-off-by: Til Kaiser <mail@tk154.de>
    Link: https://patch.msgid.link/20260607134943.21996-4-mail@tk154.de
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Stable-dep-of: 77a6b90ce56b ("net: mvpp2: build skb from XDP-adjusted data on XDP_PASS")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: mvpp2: sync RX data at the hardware packet offset [+ + +]
Author: Til Kaiser <mail@tk154.de>
Date:   Sun Jun 7 15:49:40 2026 +0200

    net: mvpp2: sync RX data at the hardware packet offset
    
    [ Upstream commit 180235600934bef6add3be637c296d6cf3272e67 ]
    
    mvpp2 programs the RX queue packet offset, so hardware writes received
    data at dma_addr + MVPP2_SKB_HEADROOM. The current CPU sync starts at
    dma_addr and only covers rx_bytes + MVPP2_MH_SIZE bytes, which syncs the
    unused headroom and misses the same number of bytes at the packet tail.
    
    On non-coherent DMA systems this can leave the CPU reading stale cache
    contents for the end of the received frame.
    
    Use dma_sync_single_range_for_cpu() with MVPP2_SKB_HEADROOM as the range
    offset so the sync covers the Marvell header and packet data actually
    written by hardware.
    
    Fixes: e1921168bbd4 ("mvpp2: sync only the received frame")
    Signed-off-by: Til Kaiser <mail@tk154.de>
    Link: https://patch.msgid.link/20260607134943.21996-2-mail@tk154.de
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: netlink: don't set nsid on local notifications [+ + +]
Author: Ilya Maximets <i.maximets@ovn.org>
Date:   Wed May 20 19:22:36 2026 +0200

    net: netlink: don't set nsid on local notifications
    
    [ Upstream commit 88b126b39f9757e9debc322d4679239e9af089c7 ]
    
    In most cases, notifications on sockets with NETLINK_LISTEN_ALL_NSID
    do not contain NSID in their ancillary data in case the event is local
    to the listener.
    
    However, when a self-referential NSID is allocated for a namespace,
    every local notification starts sending this ID to the user space.
    
    This is problematic, because the listener cannot tell if those
    notifications are local or not anymore without making extra requests
    to figure out if the provided NSID is local or not.  The listener
    can also not figure out the local NSID beforehand as it can be
    allocated at any point in time by other processes, changing the
    structure of the future notifications for everyone.
    
    The value is practically not useful, since it's the namespace's own
    ID that the application has to obtain from other sources in order to
    figure out if it's the same or not.  So, for the application it's
    just an extra busy work with no benefits.  Moreover, applications
    that do not know about this quirk may be mishandling notifications
    with NSID set as notifications from remote namespaces.  This is the
    case for ovs-vswitchd and the iproute2's 'ip monitor' that stops
    printing 'current' and starts printing the nsid number mid-session.
    
    Lack of clear documentation for this behavior is also not helping.
    
    A search though open-source projects doesn't reveal any projects
    that use NETNSA_NSID_NOT_ASSIGNED and rely on metadata to contain
    self-referential NSIDs (expected, since the value is not useful).
    Quite the opposite, as already mentioned, there are few applications
    that rely on NSID to not be present in local events.
    
    Since the value is not useful and actively harmful in some cases,
    let's not report it for local events, making the notifications more
    consistent.
    
    Also adding some blank lines for readability.
    
    Fixes: 59324cf35aba ("netlink: allow to listen "all" netns")
    Reported-by: Matteo Perin <matteo.perin@canonical.com>
    Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
    Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
    Link: https://patch.msgid.link/20260520172317.175168-3-i.maximets@ovn.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: netlink: fix sending unassigned nsid after assigned one [+ + +]
Author: Ilya Maximets <i.maximets@ovn.org>
Date:   Wed May 20 19:22:35 2026 +0200

    net: netlink: fix sending unassigned nsid after assigned one
    
    [ Upstream commit 70f8592ee90585272018a725054b6eb2ab7e99ca ]
    
    If the current skb is not shared, it is re-used directly for all the
    sockets subscribed to the notification.  If we have remote all-nsid
    socket receiving a message first, then the 'nsid_is_set' will be
    set to 'true'.  If the nsid is NOT_ASSIGNED for the next socket in
    the list, the 'nsid_is_set' will remain 'true' and the negative value
    is be delivered to the user space.  All subsequent nsid values will be
    delivered as well, since there is no code path that sets the flag
    back to 'false'.
    
    Fix that by always dropping the flag to 'false' first.
    
    Fixes: 7212462fa6fd ("netlink: don't send unknown nsid")
    Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
    Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
    Link: https://patch.msgid.link/20260520172317.175168-2-i.maximets@ovn.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: openvswitch: fix possible kfree_skb of ERR_PTR [+ + +]
Author: Adrian Moreno <amorenoz@redhat.com>
Date:   Thu Jun 4 14:19:46 2026 +0200

    net: openvswitch: fix possible kfree_skb of ERR_PTR
    
    [ Upstream commit ee30dd2909d8b98619f4341c70ec8dc8e155ab02 ]
    
    After the patch in the "Fixes" tag, the allocation of the "reply" skb
    can happen either before or after locking the ovs_mutex.
    
    However, error cleanups still follow the classical reversed order,
    assuming "reply" is allocated before locking: it is freed after unlocking.
    
    If "reply" allocation happens after locking the mutex and it fails,
    "reply" is left with an ERR_PTR, and execution jumps to the correspondent
    cleanup stage which will try to free an invalid pointer.
    
    Fix this by setting the pointer to NULL after having saved its error
    value.
    
    Fixes: 893f139b9a6c ("openvswitch: Minimize ovs_flow_cmd_new|set critical sections.")
    Signed-off-by: Adrian Moreno <amorenoz@redhat.com>
    Reviewed-by: Aaron Conole <aconole@redhat.com>
    Acked-by: Eelco Chaudron <echaudro@redhat.com>
    Link: https://patch.msgid.link/20260604121946.942164-1-amorenoz@redhat.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: qrtr: fix refcount saturation and potential UAF in qrtr_port_remove [+ + +]
Author: Mingyu Wang <25181214217@stu.xidian.edu.cn>
Date:   Thu Jun 4 14:48:01 2026 +0800

    net: qrtr: fix refcount saturation and potential UAF in qrtr_port_remove
    
    [ Upstream commit a2171131ecda1ed61a594a1eb715e75fdad0fef5 ]
    
    In qrtr_port_remove(), the socket reference count is decremented via
    __sock_put() before the port is removed from the qrtr_ports XArray and
    before the RCU grace period elapses.
    
    This breaks the fundamental RCU update paradigm. It exposes a race
    window where a concurrent RCU reader (such as qrtr_reset_ports() or
    qrtr_port_lookup()) can obtain a pointer to the socket from the XArray,
    and attempt to call sock_hold() on a socket whose reference count has
    already dropped to zero.
    
    This exact race condition was hit during syzkaller fuzzing, leading to
    the following refcount saturation warning and a potential Use-After-Free:
    
      refcount_t: saturated; leaking memory.
      WARNING: CPU: 3 PID: 1273 at lib/refcount.c:22 refcount_warn_saturate+0xae/0x1d0
      Modules linked in: qrtr(+) bochs drm_shmem_helper ...
      Call Trace:
       <TASK>
       qrtr_reset_ports net/qrtr/af_qrtr.c:768 [inline] [qrtr]
       __qrtr_bind.isra.0+0x48b/0x570 net/qrtr/af_qrtr.c:805 [qrtr]
       qrtr_bind+0x17d/0x210 net/qrtr/af_qrtr.c:901 [qrtr]
       kernel_bind+0xe4/0x120 net/socket.c:3592
       qrtr_ns_init+0x1a6/0x380 net/qrtr/ns.c:715 [qrtr]
       qrtr_proto_init+0x3b/0xff0 net/qrtr/af_qrtr.c:169 [qrtr]
       do_one_initcall+0xf5/0x5e0 init/main.c:1283
       ...
       </TASK>
    
    Fix this by deferring the reference count decrement until after the
    xa_erase() and the synchronize_rcu() complete.
    
    (Note: The v1 of this patch incorrectly replaced __sock_put() with
    sock_put(). As Simon Horman pointed out, the callers of qrtr_port_remove()
    still hold a reference to the socket, so freeing the socket memory here
    would lead to a subsequent UAF in the caller. Thus, the __sock_put() is
    kept, but only repositioned to close the RCU race.)
    
    Fixes: bdabad3e363d ("net: Add Qualcomm IPC router")
    Signed-off-by: Mingyu Wang <25181214217@stu.xidian.edu.cn>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260604064801.1180388-1-w15303746062@163.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: qrtr: ns: Change servers radix tree to xarray [+ + +]
Author: Vignesh Viswanathan <quic_viswanat@quicinc.com>
Date:   Mon May 4 01:19:18 2026 -0400

    net: qrtr: ns: Change servers radix tree to xarray
    
    [ Upstream commit 608a147a88728f84bbd2efdde3d4984339f1d872 ]
    
    There is a use after free scenario while iterating through the servers
    radix tree despite the ns being a single threaded process. This can
    happen when the radix tree APIs are not synchronized with the
    rcu_read_lock() APIs.
    
    Convert the radix tree for servers to xarray to take advantage of the
    built in rcu lock usage provided by xarray.
    
    Signed-off-by: Chris Lew <quic_clew@quicinc.com>
    Signed-off-by: Vignesh Viswanathan <quic_viswanat@quicinc.com>
    Reviewed-by: Simon Horman <simon.horman@corigine.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Stable-dep-of: 68efba36446a ("net: qrtr: ns: Free the node during ctrl_cmd_bye()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: qrtr: ns: Free the node during ctrl_cmd_bye() [+ + +]
Author: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Date:   Mon May 4 01:19:19 2026 -0400

    net: qrtr: ns: Free the node during ctrl_cmd_bye()
    
    [ Upstream commit 68efba36446a7774ea5b971257ade049272a07ac ]
    
    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: stable@vger.kernel.org
    Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace")
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260409-qrtr-fix-v3-3-00a8a5ff2b51@oss.qualcomm.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: qrtr: ns: Limit the maximum number of lookups [+ + +]
Author: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Date:   Mon May 4 00:36:35 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: stable@vger.kernel.org
    Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace")
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260409-qrtr-fix-v3-2-00a8a5ff2b51@oss.qualcomm.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [ 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 <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: qrtr: ns: Limit the total number of nodes [+ + +]
Author: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Date:   Mon May 4 05:59:01 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: stable@vger.kernel.org
    Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace")
    Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260409-qrtr-fix-v3-4-00a8a5ff2b51@oss.qualcomm.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    [ dropped node_count-- hunk since ctrl_cmd_bye() has no delete_node ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: rds: clear i_sends on setup unwind [+ + +]
Author: Yuqi Xu <xuyq21@lenovo.com>
Date:   Fri May 29 21:01:44 2026 +0800

    net: rds: clear i_sends on setup unwind
    
    commit 20cf0fb715c41111469577e85e35d15f099473e0 upstream.
    
    The RDS IB connection teardown path is written so it can run during
    partial startup and on repeated shutdown attempts. It uses NULL
    pointers to distinguish resources that are still owned from resources
    that have already been released.
    
    When rds_ib_setup_qp() fails after allocating i_sends but before
    allocating i_recvs, the sends_out path frees i_sends without clearing
    the pointer. A later shutdown pass can still treat that stale pointer
    as a live send ring allocation.
    
    Clear i_sends after vfree() in the error unwind path so the existing
    shutdown logic continues to use the correct ownership state.
    
    Fixes: 3b12f73a5c29 ("rds: ib: add error handle")
    Cc: stable@kernel.org
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Signed-off-by: Yuqi Xu <xuyq21@lenovo.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Reviewed-by: Allison Henderson <achender@kernel.org>
    Link: https://patch.msgid.link/5a0f7624bb9845a7b67d26166a150b59e7f394ce.1779632468.git.xuyq21@lenovo.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: skbuff: fix missing zerocopy reference in pskb_carve helpers [+ + +]
Author: Minh Nguyen <minhnguyen.080505@gmail.com>
Date:   Tue May 26 11:12:39 2026 +0700

    net: skbuff: fix missing zerocopy reference in pskb_carve helpers
    
    commit 98d0912e9f841e5529a5b89a972805f34cb1c69d upstream.
    
    pskb_carve_inside_header() and pskb_carve_inside_nonlinear() both copy
    the old skb_shared_info header into a new buffer via memcpy(), which
    includes the destructor_arg pointer (uarg) for MSG_ZEROCOPY skbs.
    Neither function calls net_zcopy_get() for the new shinfo, creating an
    unaccounted holder: every skb_shared_info with destructor_arg set will
    call skb_zcopy_clear() once when freed, but the corresponding
    net_zcopy_get() was never called for the new copy. Repeated calls
    drive uarg->refcnt to zero prematurely, freeing ubuf_info_msgzc while
    TX skbs still hold live destructor_arg pointers.
    
    KASAN reports use-after-free on a freed ubuf_info_msgzc:
    
      BUG: KASAN: slab-use-after-free in skb_release_data+0x77b/0x810
      Read of size 8 at addr ffff88801574d3e8 by task poc/220
    
      Call Trace:
       skb_release_data+0x77b/0x810
       kfree_skb_list_reason+0x13e/0x610
       skb_release_data+0x4cd/0x810
       sk_skb_reason_drop+0xf3/0x340
       skb_queue_purge_reason+0x282/0x440
       rds_tcp_inc_free+0x1e/0x30
       rds_recvmsg+0x354/0x1780
       __sys_recvmsg+0xdf/0x180
    
      Allocated by task 219:
       msg_zerocopy_realloc+0x157/0x7b0
       tcp_sendmsg_locked+0x2892/0x3ba0
    
      Freed by task 219:
       ip_recv_error+0x74a/0xb10
       tcp_recvmsg+0x475/0x530
    
    The skb consuming the late access still referenced the same uarg via
    shinfo->destructor_arg copied by pskb_carve_inside_nonlinear() without
    a refcount bump. This has been verified to be reliably exploitable: a
    working proof-of-concept achieves full root privilege escalation from
    an unprivileged local user on a default kernel configuration.
    
    The fix follows the pattern of pskb_expand_head() which has the same
    memcpy/cloned structure. For pskb_carve_inside_header(), net_zcopy_get()
    is placed after skb_orphan_frags() succeeds, so the orphan error path
    needs no cleanup. For pskb_carve_inside_nonlinear(), net_zcopy_get() is
    placed after all failure points and just before skb_release_data(), so
    no error path needs cleanup at all -- matching pskb_expand_head() more
    closely and avoiding the need for a balancing net_zcopy_put().
    
    Fixes: 6fa01ccd8830 ("skbuff: Add pskb_extract() helper function")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-sonnet-4-6
    Signed-off-by: Minh Nguyen <minhnguyen.080505@gmail.com>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/20260526041240.329462-1-minhnguyen.080505@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    [Salvatore Bonaccorso: Backport for context changes, as 6.1.y has not
    511a3eda2f8d ("net: dropreason: propagate drop_reason to
    skb_release_data()")].
    Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: skbuff: fix pskb_carve leaking zcopy pages [+ + +]
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Thu May 28 19:43:53 2026 +0100

    net: skbuff: fix pskb_carve leaking zcopy pages
    
    [ Upstream commit ff6e798c2eac3ebd0501ad7e796f583fab928de8 ]
    
    When SKBFL_MANAGED_FRAG_REFS is set, frag pages are not refcounted but
    their lifetime is controlled by the attached ubuf_info. To make a copy
    of the skb_shared_info, we either should clear the flag and reference
    the frags, or keep the flag and have frags unreferenced.
    
    pskb_carve_inside_header() and pskb_carve_inside_nonlinear() don't
    follow the rule and thus can leak page references. Let's clear
    SKBFL_MANAGED_FRAG_REFS from the original skb to fix it. It's the
    simplest way to address it, but there are more performant ways to do
    that if it ever becomes a problem.
    
    Link: https://lore.kernel.org/all/20260523085809.26331-1-nvminh232@clc.fitus.edu.vn/
    Fixes: 753f1ca4e1e50 ("net: introduce managed frags infrastructure")
    Reported-by: Minh Nguyen <minhnguyen.080505@gmail.com>
    Reported-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/1e2086aa69217d7f9c8da3d38f5be7160f1b4cd1.1779993185.git.asml.silence@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: stmmac: avoid shadowing global buf_sz [+ + +]
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Sun May 10 11:46:30 2026 -0400

    net: stmmac: avoid shadowing global buf_sz
    
    [ Upstream commit 876cfb20e8892143c0c967b3657074f9131f9b5f ]
    
    stmmac_rx() declares a local variable named "buf_sz" but there is also
    a global variable for a module parameter which is called the same. To
    avoid confusion, rename the local variable.
    
    Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Reviewed-by: Furong Xu <0x1207@gmail.com>
    Link: https://patch.msgid.link/E1tpswi-005U6C-Py@rmk-PC.armlinux.org.uk
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Stable-dep-of: 0bb05e6adfa9 ("net: stmmac: Prevent NULL deref when RX memory exhausted")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: stmmac: Prevent NULL deref when RX memory exhausted [+ + +]
Author: Sam Edwards <cfsworks@gmail.com>
Date:   Sun May 10 11:46:32 2026 -0400

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

net: stmmac: rename STMMAC_GET_ENTRY() -> STMMAC_NEXT_ENTRY() [+ + +]
Author: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Date:   Sun May 10 11:46:31 2026 -0400

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

net: wwan: t7xx: validate port_count against message length in t7xx_port_enum_msg_handler [+ + +]
Author: Pavitra Jha <jhapavitra98@gmail.com>
Date:   Thu May 14 13:58:13 2026 -0400

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

 
netfilter: bridge: make ebt_snat ARP rewrite writable [+ + +]
Author: Yiming Qian <yimingqian591@gmail.com>
Date:   Sat May 23 12:29:10 2026 +0000

    netfilter: bridge: make ebt_snat ARP rewrite writable
    
    [ Upstream commit 67ba971ae02514d85818fe0c32549ab4bfa3bf49 ]
    
    The ebtables SNAT target keeps the Ethernet source address rewrite
    behind skb_ensure_writable(skb, 0).  This is intentional: at the bridge
    ebtables hooks the Ethernet header is addressed through
    skb_mac_header()/eth_hdr(), while skb->data points at the Ethernet
    payload.  Asking skb_ensure_writable() for ETH_HLEN bytes would check
    the payload, not the Ethernet header, and would reintroduce the small
    packet regression fixed by commit 63137bc5882a.
    
    However, the optional ARP sender hardware address rewrite is different.
    It writes through skb_store_bits() at an offset relative to skb->data:
    
            skb_store_bits(skb, sizeof(struct arphdr), info->mac, ETH_ALEN)
    
    skb_header_pointer() only safely reads the ARP header; it does not make
    the later sender hardware address range writable.  If that range is
    still held in a nonlinear skb fragment backed by a splice-imported file
    page, skb_store_bits() maps the frag page and copies the new MAC address
    directly into it.
    
    Ensure the ARP SHA range is writable before reading the ARP header and
    before calling skb_store_bits().
    
    Fixes: 63137bc5882a ("netfilter: ebtables: Fixes dropping of small packets in bridge nat")
    Reported-by: Yiming Qian <yimingqian591@gmail.com>
    Signed-off-by: Yiming Qian <yimingqian591@gmail.com>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: conntrack: tcp: do not force CLOSE on invalid-seq RST without direction check [+ + +]
Author: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Date:   Mon May 11 10:43:14 2026 -0400

    netfilter: conntrack: tcp: do not force CLOSE on invalid-seq RST without direction check
    
    commit bed6e04be8e6b9133d8b16d5a42d0e0ce674fa9a upstream.
    
    An unintended behavior in the TCP conntrack state machine allows a
    connection to be forced into the CLOSE state using an RST packet with an
    invalid sequence number.
    
    Specifically, after a SYN packet is observed, an RST with an invalid SEQ
    can transition the conntrack entry to TCP_CONNTRACK_CLOSE, regardless of
    whether the RST corresponds to the expected reply direction. The relevant
    code path assumes the RST is a response to an outgoing SYN, but does not
    validate packet direction or ensure that a matching SYN was actually sent
    in the opposite direction.
    
    As a result, a crafted packet sequence consisting of a SYN followed by an
    invalid-sequence RST can prematurely terminate an active NAT entry. This
    makes connection teardown easier than intended.
    
    So, tighten the state transition logic to ensure that RST-triggered
    CLOSE transitions only occur when the RST is a valid response to a
    previously observed SYN in the correct direction.
    
    Cc: stable@vger.kernel.org
    Fixes: 9fb9cbb1082d ("[NETFILTER]: Add nf_conntrack subsystem.")
    Signed-off-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

netfilter: conntrack_irc: fix possible out-of-bounds read [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Wed May 27 12:20:19 2026 +0200

    netfilter: conntrack_irc: fix possible out-of-bounds read
    
    [ Upstream commit 66eba0ffce3b7e11449946b4cbbef8ea36112f56 ]
    
    When parsing fails after we've matched the command string we
    should bail out instead of trying to match a different command.
    
    This helper should be deprecated, given prevalence of TLS I doubt it has
    any relevance in 2026.
    
    Fixes: 869f37d8e48f ("[NETFILTER]: nf_conntrack/nf_nat: add IRC helper port")
    Closes: https://sashiko.dev/#/patchset/20260525182924.28456-1-fw%40strlen.de
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: ctnetlink: ensure safe access to master conntrack [+ + +]
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date:   Fri Jun 12 20:39:06 2026 +0000

    netfilter: ctnetlink: ensure safe access to master conntrack
    
    [ Upstream commit bffcaad9afdfe45d7fc777397d3b83c1e3ebffe5 ]
    
    Holding reference on the expectation is not sufficient, the master
    conntrack object can just go away, making exp->master invalid.
    
    To access exp->master safely:
    
    - Grab the nf_conntrack_expect_lock, this gets serialized with
      clean_from_lists() which also holds this lock when the master
      conntrack goes away.
    
    - Hold reference on master conntrack via nf_conntrack_find_get().
      Not so easy since the master tuple to look up for the master conntrack
      is not available in the existing problematic paths.
    
    This patch goes for extending the nf_conntrack_expect_lock section
    to address this issue for simplicity, in the cases that are described
    below this is just slightly extending the lock section.
    
    The add expectation command already holds a reference to the master
    conntrack from ctnetlink_create_expect().
    
    However, the delete expectation command needs to grab the spinlock
    before looking up for the expectation. Expand the existing spinlock
    section to address this to cover the expectation lookup. Note that,
    the nf_ct_expect_iterate_net() calls already grabs the spinlock while
    iterating over the expectation table, which is correct.
    
    The get expectation command needs to grab the spinlock to ensure master
    conntrack does not go away. This also expands the existing spinlock
    section to cover the expectation lookup too. I needed to move the
    netlink skb allocation out of the spinlock to keep it GFP_KERNEL.
    
    For the expectation events, the IPEXP_DESTROY event is already delivered
    under the spinlock, just move the delivery of IPEXP_NEW under the
    spinlock too because the master conntrack event cache is reached through
    exp->master.
    
    While at it, add lockdep notations to help identify what codepaths need
    to grab the spinlock.
    
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    [ fix timer_delete -> del_timer in diff context lines since 8fa7292
    ("treewide: Switch/rename to timer_delete[_sync]()") landed in 6.15 ]
    Signed-off-by: Mark Bundschuh <mkbund@amazon.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: ebtables: fix OOB read in compat_mtw_from_user [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Tue May 19 22:52:07 2026 +0200

    netfilter: ebtables: fix OOB read in compat_mtw_from_user
    
    [ Upstream commit f438d1786d657d57790c5d138d6db3fc9fdac392 ]
    
    Luxiao Xu says:
    
     The function compat_mtw_from_user() converts ebtables extensions from
     32-bit user structures to kernel native structures. However, it lacks
     proper validation of the user-supplied match_size/target_size.
    
     When certain extensions are processed, the kernel-side translation
     logic may perform memory accesses based on the extension's expected
     size. If the user provides a size smaller than what the extension
     requires, it results in an out-of-bounds read as reported by KASAN.
    
     This fix introduces a check to ensure match_size is at least as large
     as the extension's required compatsize. This covers matches, watchers,
     and targets, while maintaining compatibility with standard targets.
    
    AFAIU this is relevant for matches that need to go though
    match->compat_from_user() call.  Those that use plain memcpy with the
    user-provided size are ok because the caller checks that size vs the
    start of the next rule entry offset (which itself is checked vs. total
    size copied from userspace).
    
    The ->compat_from_user() callbacks assume they can read compatsize bytes,
    so they need this extra check.
    
    Based on an earlier patch from Luxiao Xu.
    
    Fixes: 81e675c227ec ("netfilter: ebtables: add CONFIG_COMPAT support")
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Signed-off-by: Luxiao Xu <rakukuip@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nf_conntrack: destroy stale expectfn expectations on unregister [+ + +]
Author: Weiming Shi <bestswngs@gmail.com>
Date:   Wed Jun 3 00:38:17 2026 -0700

    netfilter: nf_conntrack: destroy stale expectfn expectations on unregister
    
    [ Upstream commit c3009418f9fa1dcb3eb86f4d8c92583537b5faa3 ]
    
    NAT helpers such as nf_nat_h323 store a raw pointer to module text in
    exp->expectfn (e.g. ip_nat_q931_expect). nf_ct_helper_expectfn_unregister()
    only unlinks the callback descriptor and never walks the expectation table,
    so an expectation pending at module removal survives with a dangling
    exp->expectfn into freed module text.
    
    When the expected connection arrives, init_conntrack() invokes
    exp->expectfn(), now a stale pointer into the unloaded module. Reproduced
    on a KASAN build by loading the H.323 helpers, creating a Q.931
    expectation, unloading nf_nat_h323, then connecting to the expected port:
    
     Oops: int3: 0000 [#1] SMP KASAN NOPTI
     RIP: 0010:0xffffffffa06102d1
      init_conntrack.isra.0 (net/netfilter/nf_conntrack_core.c:1862)
      nf_conntrack_in (net/netfilter/nf_conntrack_core.c:2049)
      ipv4_conntrack_local (net/netfilter/nf_conntrack_proto.c:223)
      nf_hook_slow (net/netfilter/core.c:619)
      __ip_local_out (net/ipv4/ip_output.c:120)
      __tcp_transmit_skb (net/ipv4/tcp_output.c:1715)
      tcp_connect (net/ipv4/tcp_output.c:4374)
      tcp_v4_connect (net/ipv4/tcp_ipv4.c:345)
      __sys_connect (net/socket.c:2167)
     Modules linked in: nf_conntrack_h323 [last unloaded: nf_nat_h323]
    
    Reaching the dangling state requires CAP_SYS_MODULE in the initial user
    namespace to remove a NAT helper that still has live expectations, so this
    is a robustness fix; leaving an expectation pointing at freed text is wrong
    regardless.
    
    Add nf_ct_helper_expectfn_destroy(), which walks the expectation table and
    drops every expectation whose ->expectfn matches the descriptor being torn
    down. Call it from each NAT helper's exit path after the existing RCU grace
    period, so no expectation outlives the code it points at and no extra
    synchronize_rcu() is introduced. With the fix, the same reproducer runs to
    completion without the Oops.
    
    Fixes: f587de0e2feb ("[NETFILTER]: nf_conntrack/nf_nat: add H.323 helper port")
    Reported-by: Xiang Mei <xmei5@asu.edu>
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Weiming Shi <bestswngs@gmail.com>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nf_log: validate MAC header was set before dumping it [+ + +]
Author: Xiang Mei <xmei5@asu.edu>
Date:   Tue Jun 9 15:55:02 2026 -0700

    netfilter: nf_log: validate MAC header was set before dumping it
    
    [ Upstream commit a84b6fedbc97078788be78dbdd7517d143ad1a77 ]
    
    The fallback path of dump_mac_header() guards the MAC header access
    only with "skb->mac_header != skb->network_header", without checking
    skb_mac_header_was_set(). When the MAC header is unset, mac_header is
    0xffff, so the test passes and skb_mac_header(skb) returns
    skb->head + 0xffff, ~64 KiB past the buffer; the loop then reads
    dev->hard_header_len bytes out of bounds into the kernel log.
    
    This is reachable via the netdev logger: nf_log_unknown_packet() calls
    dump_mac_header() unconditionally, and an skb sent through AF_PACKET
    with PACKET_QDISC_BYPASS reaches the egress hook with mac_header still
    unset (__dev_queue_xmit(), which would reset it, is bypassed).
    
    Add the skb_mac_header_was_set() check the ARPHRD_ETHER path already
    uses, and replace the open-coded MAC header length test with
    skb_mac_header_len(). Only skbs with an unset MAC header are affected;
    valid ones are dumped as before.
    
     BUG: KASAN: slab-out-of-bounds in dump_mac_header (net/netfilter/nf_log_syslog.c:831)
     Read of size 1 at addr ffff88800ea49d3f by task exploit/148
     Call Trace:
      kasan_report (mm/kasan/report.c:595)
      dump_mac_header (net/netfilter/nf_log_syslog.c:831)
      nf_log_netdev_packet (net/netfilter/nf_log_syslog.c:938 net/netfilter/nf_log_syslog.c:963)
      nf_log_packet (net/netfilter/nf_log.c:260)
      nft_log_eval (net/netfilter/nft_log.c:60)
      nft_do_chain (net/netfilter/nf_tables_core.c:285)
      nft_do_chain_netdev (net/netfilter/nft_chain_filter.c:307)
      nf_hook_slow (net/netfilter/core.c:619)
      nf_hook_direct_egress (net/packet/af_packet.c:257)
      packet_xmit (net/packet/af_packet.c:280)
      packet_sendmsg (net/packet/af_packet.c:3114)
      __sys_sendto (net/socket.c:2265)
    
    Fixes: 7eb9282cd0ef ("netfilter: ipt_LOG/ip6t_LOG: add option to print decoded MAC header")
    Reported-by: Weiming Shi <bestswngs@gmail.com>
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Xiang Mei <xmei5@asu.edu>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nf_tables: restore set elements when delete set fails [+ + +]
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date:   Thu Jun 4 08:32:45 2026 +0000

    netfilter: nf_tables: restore set elements when delete set fails
    
    [ Upstream commit e79b47a8615d42c68aaeb68971593333667382ed ]
    
    >From abort path, nft_mapelem_activate() needs to restore refcounters to
    the original state. Currently, it uses the set->ops->walk() to iterate
    over these set elements. The existing set iterator skips inactive
    elements in the next generation, this does not work from the abort path
    to restore the original state since it has to skip active elements
    instead (not inactive ones).
    
    This patch moves the check for inactive elements to the set iterator
    callback, then it reverses the logic for the .activate case which
    needs to skip active elements.
    
    Toggle next generation bit for elements when delete set command is
    invoked and call nft_clear() from .activate (abort) path to restore the
    next generation bit.
    
    The splat below shows an object in mappings memleak:
    
    [43929.457523] ------------[ cut here ]------------
    [43929.457532] WARNING: CPU: 0 PID: 1139 at include/net/netfilter/nf_tables.h:1237 nft_setelem_data_deactivate+0xe4/0xf0 [nf_tables]
    [...]
    [43929.458014] RIP: 0010:nft_setelem_data_deactivate+0xe4/0xf0 [nf_tables]
    [43929.458076] Code: 83 f8 01 77 ab 49 8d 7c 24 08 e8 37 5e d0 de 49 8b 6c 24 08 48 8d 7d 50 e8 e9 5c d0 de 8b 45 50 8d 50 ff 89 55 50 85 c0 75 86 <0f> 0b eb 82 0f 0b eb b3 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90
    [43929.458081] RSP: 0018:ffff888140f9f4b0 EFLAGS: 00010246
    [43929.458086] RAX: 0000000000000000 RBX: ffff8881434f5288 RCX: dffffc0000000000
    [43929.458090] RDX: 00000000ffffffff RSI: ffffffffa26d28a7 RDI: ffff88810ecc9550
    [43929.458093] RBP: ffff88810ecc9500 R08: 0000000000000001 R09: ffffed10281f3e8f
    [43929.458096] R10: 0000000000000003 R11: ffff0000ffff0000 R12: ffff8881434f52a0
    [43929.458100] R13: ffff888140f9f5f4 R14: ffff888151c7a800 R15: 0000000000000002
    [43929.458103] FS:  00007f0c687c4740(0000) GS:ffff888390800000(0000) knlGS:0000000000000000
    [43929.458107] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [43929.458111] CR2: 00007f58dbe5b008 CR3: 0000000123602005 CR4: 00000000001706f0
    [43929.458114] Call Trace:
    [43929.458118]  <TASK>
    [43929.458121]  ? __warn+0x9f/0x1a0
    [43929.458127]  ? nft_setelem_data_deactivate+0xe4/0xf0 [nf_tables]
    [43929.458188]  ? report_bug+0x1b1/0x1e0
    [43929.458196]  ? handle_bug+0x3c/0x70
    [43929.458200]  ? exc_invalid_op+0x17/0x40
    [43929.458211]  ? nft_setelem_data_deactivate+0xd7/0xf0 [nf_tables]
    [43929.458271]  ? nft_setelem_data_deactivate+0xe4/0xf0 [nf_tables]
    [43929.458332]  nft_mapelem_deactivate+0x24/0x30 [nf_tables]
    [43929.458392]  nft_rhash_walk+0xdd/0x180 [nf_tables]
    [43929.458453]  ? __pfx_nft_rhash_walk+0x10/0x10 [nf_tables]
    [43929.458512]  ? rb_insert_color+0x2e/0x280
    [43929.458520]  nft_map_deactivate+0xdc/0x1e0 [nf_tables]
    [43929.458582]  ? __pfx_nft_map_deactivate+0x10/0x10 [nf_tables]
    [43929.458642]  ? __pfx_nft_mapelem_deactivate+0x10/0x10 [nf_tables]
    [43929.458701]  ? __rcu_read_unlock+0x46/0x70
    [43929.458709]  nft_delset+0xff/0x110 [nf_tables]
    [43929.458769]  nft_flush_table+0x16f/0x460 [nf_tables]
    [43929.458830]  nf_tables_deltable+0x501/0x580 [nf_tables]
    
    Fixes: 628bd3e49cba ("netfilter: nf_tables: drop map element references from preparation phase")
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    (cherry picked from commit e79b47a8615d42c68aaeb68971593333667382ed)
    [Vegard: CVE-2024-27012; fixed conflicts due to missing commits
     0e1ea651c9717ddcd8e0648d8468477a31867b0a ("netfilter: nf_tables: shrink
     memory consumption of set elements") and
     9dad402b89e81a0516bad5e0ac009b7a0a80898f ("netfilter: nf_tables: expose
     opaque set element as struct nft_elem_priv") so we pass the correct types
     and values to nft_setelem_data_deactivate(), nft_setelem_validate(),
     nft_set_elem_ext(), etc.]
    Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    [acsjakub: clean cherry-pick of the commit 164936b2fc88
     ("netfilter: nf_tables: restore set elements when delete set fails")
     from 6.6.y. Plus, add "[ Upstream commit .." header to the message]
    Signed-off-by: Jakub Acs <acsjakub@amazon.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_exthdr: fix register tracking for F_PRESENT flag [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Tue Jun 9 21:28:09 2026 +0200

    netfilter: nft_exthdr: fix register tracking for F_PRESENT flag
    
    [ Upstream commit 772cecf198da732faebb5dcfc46d66a505be8495 ]
    
    nft_exthdr_init() passes user-controlled priv->len to
    nft_parse_register_store(), which marks that many bytes in the
    register bitmap as initialized.  However, when NFT_EXTHDR_F_PRESENT
    is set, the eval paths write only 1 byte (nft_reg_store8) or
    4 bytes (*dest = 0 on TCP/DCCP error path).  When len > 4,
    registers beyond the first are never written, retaining
    uninitialized stack data from nft_regs.
    
    Bail out if userspace requests too much data when F_PRESENT is set.
    
    Reported-by: Ji'an Zhou <eilaimemedsnaimel@gmail.com>
    Fixes: c078ca3b0c5b ("netfilter: nft_exthdr: Add support for existence check")
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_fib: fix stale stack leak via the OIFNAME register [+ + +]
Author: Davide Ornaghi <d.ornaghi97@gmail.com>
Date:   Mon Jun 15 12:17:29 2026 -0400

    netfilter: nft_fib: fix stale stack leak via the OIFNAME register
    
    [ Upstream commit ab185e0c4fb82dfba6fb86f8271e06f931d9c64c ]
    
    For NFT_FIB_RESULT_OIFNAME the destination register is declared with
    len = IFNAMSIZ (four 32-bit registers), but on the lookup-fail,
    RTN_LOCAL and oif-mismatch paths nft_fib{4,6}_eval() only writes one
    register via "*dest = 0". The remaining three registers are left as
    whatever was on the stack in nft_do_chain()'s struct nft_regs, and a
    downstream expression that loads the register span can leak that
    uninitialised kernel stack to userspace.
    
    The NFTA_FIB_F_PRESENT existence check has the same shape: it is only
    meaningful for NFT_FIB_RESULT_OIF, yet it was accepted for any result type
    while the eval stores a single byte via nft_reg_store8(), leaving the rest
    of the declared span stale.
    
    Fix both:
    
     - replace the bare "*dest = 0" in the eval with nft_fib_store_result(),
       which strscpy_pad()s the whole IFNAMSIZ for OIFNAME (and is already
       used on the other early-return path), and
    
     - restrict NFTA_FIB_F_PRESENT to NFT_FIB_RESULT_OIF and declare its
       destination as a single u8, so the marked span matches the one byte
       the eval writes.
    
    Fixes: f6d0cbcf09c5 ("netfilter: nf_tables: add fib expression")
    Suggested-by: Florian Westphal <fw@strlen.de>
    Cc: stable@vger.kernel.org
    Signed-off-by: Davide Ornaghi <d.ornaghi97@gmail.com>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    [ kept the tree's existing `ip6_route_lookup`/`rt6_info` machinery (missing `fib6_lookup` refactor) and changed only `*dest = 0;` to `nft_fib_store_result(dest, priv, NULL)` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

netfilter: nft_tunnel: fix use-after-free on object destroy [+ + +]
Author: Tristan Madani <tristan@talencesecurity.com>
Date:   Wed May 27 13:57:50 2026 +0000

    netfilter: nft_tunnel: fix use-after-free on object destroy
    
    commit c32b26aaa2f9216520a38b3f4bfeec846eb3eb8a upstream.
    
    nft_tunnel_obj_destroy() calls metadata_dst_free() which directly
    kfree()s the metadata_dst, ignoring the dst_entry refcount. Packets
    that took a reference via dst_hold() in nft_tunnel_obj_eval() and
    are still queued (e.g. in a netem qdisc) are left with a dangling
    pointer. When these packets are eventually dequeued, dst_release()
    operates on freed memory.
    
    Replace metadata_dst_free() with dst_release() so the metadata_dst
    is freed only after all references are dropped. The dst subsystem
    already handles metadata_dst cleanup in dst_destroy() when
    DST_METADATA is set.
    
    Fixes: af308b94a2a4 ("netfilter: nf_tables: add tunnel support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
    Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

netfilter: require Ethernet MAC header before using eth_hdr() [+ + +]
Author: Zhengchuan Liang <zcliangcn@gmail.com>
Date:   Sat Apr 4 17:39:48 2026 +0800

    netfilter: require Ethernet MAC header before using eth_hdr()
    
    [ Upstream commit 62443dc21114c0bbc476fa62973db89743f2f137 ]
    
    `ip6t_eui64`, `xt_mac`, the `bitmap:ip,mac`, `hash:ip,mac`, and
    `hash:mac` ipset types, and `nf_log_syslog` access `eth_hdr(skb)`
    after either assuming that the skb is associated with an Ethernet
    device or checking only that the `ETH_HLEN` bytes at
    `skb_mac_header(skb)` lie between `skb->head` and `skb->data`.
    
    Make these paths first verify that the skb is associated with an
    Ethernet device, that the MAC header was set, and that it spans at
    least a full Ethernet header before accessing `eth_hdr(skb)`.
    
    Suggested-by: Florian Westphal <fw@strlen.de>
    Tested-by: Ren Wei <enjou1224z@gmail.com>
    Signed-off-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: synproxy: add mutex to guard hook reference counting [+ + +]
Author: Fernando Fernandez Mancera <fmancera@suse.de>
Date:   Tue May 26 23:58:31 2026 +0200

    netfilter: synproxy: add mutex to guard hook reference counting
    
    [ Upstream commit 2fcba19caaeb2a33017459d3430f057967bb91b6 ]
    
    As the synproxy infrastructure register netfilter hooks on-demand when a
    user adds the first iptables target or nftables expression, if done
    concurrently they can race each other.
    
    Introduce a mutex to serialize the refcount control blocks access from
    both frontends. While a per namespace mutex might be more efficient, it
    is not needed for target/expression like SYNPROXY.
    
    Fixes: ad49d86e07a4 ("netfilter: nf_tables: Add synproxy support")
    Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: synproxy: refresh tcphdr after skb_ensure_writable [+ + +]
Author: Chris Mason <clm@meta.com>
Date:   Tue May 19 12:36:14 2026 -0700

    netfilter: synproxy: refresh tcphdr after skb_ensure_writable
    
    [ Upstream commit 92170e6afe927ab2792a3f71902845789c8e31b1 ]
    
    synproxy_tstamp_adjust() rewrites the TCP timestamp option in place
    and then patches the TCP checksum via inet_proto_csum_replace4() on
    the caller-supplied tcphdr pointer.  Both ipv4_synproxy_hook() and
    ipv6_synproxy_hook() obtain that pointer with skb_header_pointer()
    before calling in, so it may either alias skb->head directly or
    point at the caller's on-stack _tcph buffer.
    
    Between obtaining the pointer and using it, the function calls
    skb_ensure_writable(skb, optend), which on a cloned or non-linear
    skb invokes pskb_expand_head() and frees the old skb->head.  After
    that point the cached th is stale:
    
        caller (ipv[46]_synproxy_hook)
          th = skb_header_pointer(skb, ..., &_tcph)
          synproxy_tstamp_adjust(skb, protoff, th, ...)
            skb_ensure_writable(skb, optend)
              pskb_expand_head()        /* kfree(old skb->head) */
            ...
            inet_proto_csum_replace4(&th->check, ...)
                                        /* writes into freed head, or
                                           into the caller's stack copy
                                           leaving the on-wire checksum
                                           stale */
    
    The option bytes are written through skb->data and are fine; only
    the checksum update goes through th and so lands in the wrong
    place.  The result is either a write into freed slab memory or a
    packet leaving with a checksum that does not match its payload.
    
    Fix by re-deriving th from skb->data + protoff immediately after
    skb_ensure_writable() succeeds, so the subsequent checksum update
    targets the linear, writable header.
    
    Fixes: 48b1de4c110a ("netfilter: add SYNPROXY core/target")
    Assisted-by: kres (claude-opus-4-7)
    Signed-off-by: Chris Mason <clm@meta.com>
    Reviewed-by: Fernando Fernandez Mancera <fmancera@suse.de>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: x_tables: avoid leaking percpu counter pointers [+ + +]
Author: Kyle Zeng <kylebot@openai.com>
Date:   Sat Jun 6 01:10:31 2026 -0700

    netfilter: x_tables: avoid leaking percpu counter pointers
    
    [ Upstream commit f7f2fbb0e893a0238dc464f8d8c0f5609bec584f ]
    
    The native and compat get-entries paths copy the fixed rule entry header
    from the kernelized rule blob to userspace before overwriting the entry's
    counter fields with a sanitized counter snapshot.
    
    On SMP kernels, entry->counters.pcnt contains the percpu allocation
    address used by x_tables rule counters. A caller can provide a userspace
    buffer that faults during the initial fixed-header copy after pcnt has
    been copied but before the later sanitized counter copy runs. The syscall
    then returns -EFAULT while leaving the raw percpu pointer in userspace.
    
    Copy only the fixed entry prefix before counters from the kernelized rule
    blob, then copy the sanitized counter snapshot into the counter field.
    Apply this ordering to the IPv4, IPv6, and ARP native and compat
    get-entries implementations so a fault cannot expose the internal percpu
    counter pointer.
    
    Fixes: 71ae0dff02d7 ("netfilter: xtables: use percpu rule counters")
    Signed-off-by: Kyle Zeng <kylebot@openai.com>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: xt_cpu: prefer raw_smp_processor_id [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Tue May 19 20:10:08 2026 +0200

    netfilter: xt_cpu: prefer raw_smp_processor_id
    
    [ Upstream commit c376f07e16c02239ed44cabb97145d03f65b4d15 ]
    
    With PREEMPT_RCU we get splat:
    
    BUG: using smp_processor_id() in preemptible [..]
    caller is cpu_mt+0x53/0xd0 net/netfilter/xt_cpu.c:37
    CPU: 1 .. Comm: syz.3.1377 #0 PREEMPT(full)
    Call Trace:
     <TASK>
     dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
     check_preemption_disabled+0xd3/0xe0 lib/smp_processor_id.c:47
     cpu_mt+0x53/0xd0 net/netfilter/xt_cpu.c:37
     [..]
    
    Just use raw version instead.
    This is similar to 14d14a5d2957 ("netfilter: nft_meta: use raw_smp_processor_id()").
    
    Fixes: 0ca743a55991 ("netfilter: nf_tables: add compatibility layer for x_tables")
    Reported-by: syzbot+690d3e3ffa7335ac10eb@syzkaller.appspotmail.com
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: xt_NFQUEUE: prefer raw_smp_processor_id [+ + +]
Author: Fernando Fernandez Mancera <fmancera@suse.de>
Date:   Fri May 22 12:47:17 2026 +0200

    netfilter: xt_NFQUEUE: prefer raw_smp_processor_id
    
    [ Upstream commit c6c5327dd18bec1e1bbf139b2cf5ae53608a9d30 ]
    
    With PREEMPT_RCU this triggers a splat because smp_processor_id() can be
    preempted while inside a RCU critical section. If xt_NFQUEUE target is
    invoked via nft_compat_eval() path, we are inside a RCU critical
    section.
    
    Just use the raw version instead.
    
    Fixes: 0ca743a55991 ("netfilter: nf_tables: add compatibility layer for x_tables")
    Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
netlabel: validate unlabeled address and mask attribute lengths [+ + +]
Author: Chenguang Zhao <zhaochenguang@kylinos.cn>
Date:   Wed Jun 3 09:13:53 2026 +0800

    netlabel: validate unlabeled address and mask attribute lengths
    
    [ Upstream commit 9772589b57e44aedc240211c5c3f7a684a034d3a ]
    
    netlbl_unlabel_addrinfo_get() used the address attribute length to
    determine whether the attribute data could be read as an IPv4 or IPv6
    address, but did not independently validate the corresponding mask
    attribute length.  A crafted Generic Netlink request could therefore
    provide a valid IPv4/IPv6 address attribute with a shorter mask
    attribute, which would later be read as a full struct in_addr or
    struct in6_addr.
    
    NLA_BINARY policy lengths are maximum lengths by default, so use
    NLA_POLICY_EXACT_LEN() for the unlabeled IPv4/IPv6 address and mask
    attributes.  This rejects short attributes during policy validation and
    also exposes the exact length requirements through policy introspection.
    
    Fixes: 8cc44579d1bd ("NetLabel: Introduce static network labels for unlabeled connections")
    Signed-off-by: Chenguang Zhao <zhaochenguang@kylinos.cn>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
nfc: hci: fix out-of-bounds read in HCP header parsing [+ + +]
Author: Ashutosh Desai <ashutoshdesai993@gmail.com>
Date:   Tue May 5 17:07:12 2026 +0000

    nfc: hci: fix out-of-bounds read in HCP header parsing
    
    commit f040e590c035bfd9553fe79ee9585caf1b14d67b upstream.
    
    Both nfc_hci_recv_from_llc() and nci_hci_data_received_cb() read
    packet->header from skb->data at function entry without first checking
    that the buffer holds at least one byte. A malicious NFC peer can send
    a 0-byte HCP frame that passes through the SHDLC layer and reaches
    these functions, causing an out-of-bounds heap read of packet->header.
    The same 0-byte frame, if queued as a non-final fragment, also causes
    the reassembly loop to underflow msg_len to UINT_MAX, triggering
    skb_over_panic() when the reassembled skb is written.
    
    Fix this by adding a pskb_may_pull() check at the entry of each
    function before packet->header is first accessed. The existing
    pskb_may_pull() checks before the reassembled hcp_skb is cast to
    struct hcp_packet remain in place to guard the 2-byte HCP message
    header.
    
    Fixes: 8b8d2e08bf0d ("NFC: HCI support")
    Fixes: 11f54f228643 ("NFC: nci: Add HCI over NCI protocol support")
    Cc: stable@vger.kernel.org
    Reviewed-by: Simon Horman <horms@kernel.org>
    Signed-off-by: Ashutosh Desai <ashutoshdesai993@gmail.com>
    Link: https://patch.msgid.link/20260505170712.96560-1-ashutoshdesai993@gmail.com
    Signed-off-by: David Heidelberg <david@ixit.cz>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

nfc: llcp: Fix use-after-free in llcp_sock_release() [+ + +]
Author: Lee Jones <lee@kernel.org>
Date:   Wed Apr 29 13:40:41 2026 +0000

    nfc: llcp: Fix use-after-free in llcp_sock_release()
    
    [ Upstream commit f4268b466190dae95a7585f69b4f1f8ad097632c ]
    
    llcp_sock_release() unconditionally unlinks the socket from the local
    sockets list.  However, if the socket is still in connecting state, it
    is on the connecting list.
    
    Fix this by checking the socket state and unlinking from the correct list.
    
    Fixes: b4011239a08e ("NFC: llcp: Fix non blocking sockets connections")
    Signed-off-by: Lee Jones <lee@kernel.org>
    Link: https://patch.msgid.link/20260429134115.3558604-1-lee@kernel.org
    Signed-off-by: David Heidelberg <david@ixit.cz>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

nfc: llcp: Fix use-after-free race in nfc_llcp_recv_cc() [+ + +]
Author: Lee Jones <lee@kernel.org>
Date:   Wed Apr 29 13:40:42 2026 +0000

    nfc: llcp: Fix use-after-free race in nfc_llcp_recv_cc()
    
    [ Upstream commit b493ea2765cc17cb8aa7e7544a4b6dcb05b6ed77 ]
    
    A race condition exists in the NFC LLCP connection state machine where
    the connection acceptance packet (CC) can be processed concurrently with
    socket release.  This can lead to a use-after-free of the socket object.
    
    When nfc_llcp_recv_cc() moves the socket from the connecting_sockets
    list to the sockets list, it does so without holding the socket lock.
    If llcp_sock_release() is executing concurrently, it might have already
    unlinked the socket and dropped its references, which can result in
    nfc_llcp_recv_cc() linking a freed socket into the live list.
    
    Fix this by holding lock_sock() during the state transition and list
    movement in nfc_llcp_recv_cc().  After acquiring the lock, check if
    the socket is still hashed to ensure it hasn't already been unlinked
    and marked for destruction by the release path.  This aligns the locking
    pattern with recv_hdlc() and recv_disc().
    
    Fixes: a69f32af86e3 ("NFC: Socket linked list")
    Signed-off-by: Lee Jones <lee@kernel.org>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260429134115.3558604-2-lee@kernel.org
    Signed-off-by: David Heidelberg <david@ixit.cz>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

nfc: nxp-nci: i2c: use rising-edge IRQ on ACPI systems [+ + +]
Author: Carl Lee <carl.lee@amd.com>
Date:   Sat May 16 19:55:18 2026 +0800

    nfc: nxp-nci: i2c: use rising-edge IRQ on ACPI systems
    
    [ Upstream commit f23bf992d65a42007c517b060ca35cebdea3525a ]
    
    Some ACPI-based platforms report incorrect IRQ trigger types (e.g.
    IRQF_TRIGGER_HIGH), which can lead to interrupt storms.
    
    Use the historically working rising-edge trigger on ACPI systems to
    avoid this regression.
    
    Device Tree-based systems continue to use the firmware-provided
    trigger type.
    
    Fixes: 57be33f85e36 ("nfc: nxp-nci: remove interrupt trigger type")
    Signed-off-by: Carl Lee <carl.lee@amd.com>
    Tested-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
    Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
    Tested-by: Luca Stefani <luca.stefani.ge1@gmail.com>
    Link: https://patch.msgid.link/20260516-nfc-nxp-nci-i2c-restore-irq-trigger-fallback-v3-1-37ba4b6e9086@amd.com
    Signed-off-by: David Heidelberg <david@ixit.cz>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
octeontx2-af: CGX: add bounds check to cgx_speed_mbps index [+ + +]
Author: Sam Daly <sam@samdaly.ie>
Date:   Sat May 30 10:37:38 2026 -0400

    octeontx2-af: CGX: add bounds check to cgx_speed_mbps index
    
    [ Upstream commit c0bf0a4f3f1f5f57aa83e1400ba4f56f0abfd542 ]
    
    cgx_speed_mbps has 13 elements but RESP_LINKSTAT_SPEED can yield values
    0-15. If it returns a value >= 13, this causes an out-of-bounds array
    access. Add a bounds check and default to speed 0 if the index is out of
    range.
    
    Fixes: 61071a871ea6 ("octeontx2-af: Forward CGX link notifications to PFs")
    Cc: Sunil Goutham <sgoutham@marvell.com>
    Cc: Linu Cherian <lcherian@marvell.com>
    Cc: Geetha sowjanya <gakula@marvell.com>
    Cc: hariprasad <hkelam@marvell.com>
    Cc: Subbaraya Sundeep <sbhatta@marvell.com>
    Cc: Andrew Lunn <andrew+netdev@lunn.ch>
    Cc: stable <stable@kernel.org>
    Signed-off-by: Sam Daly <sam@samdaly.ie>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Link: https://patch.msgid.link/2026051352-refined-demise-e88d@gregkh
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

octeontx2-af: fix memory leak in rvu_setup_hw_resources() [+ + +]
Author: Dawei Feng <dawei.feng@seu.edu.cn>
Date:   Thu Jun 4 22:37:56 2026 +0800

    octeontx2-af: fix memory leak in rvu_setup_hw_resources()
    
    commit 09a5bf856aa759513afc4afd233d15bcc711b84e upstream.
    
    If rvu_npc_exact_init() fails in rvu_setup_hw_resources(), the function
    returns directly instead of jumping to the error handling path. This
    causes a resource leak for the previously initialized CGX, NPC, fwdata,
    and MSI-X states.
    
    Fix this by replacing the direct return with goto cgx_err to ensure
    proper cleanup.
    
    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. Manual inspection confirms that the bug is still present in
    v7.1-rc6.
    
    An x86_64 allyesconfig build showed no new warnings. As we do not have
    access to Marvell OcteonTX2 RVU AF hardware to test with, no runtime
    testing was able to be performed.
    
    Fixes: 3571fe07a090 ("octeontx2-af: Drop rules for NPC MCAM")
    Cc: stable@vger.kernel.org
    Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
    Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
    Link: https://patch.msgid.link/20260604143756.1524482-1-dawei.feng@seu.edu.cn
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

octeontx2-af: npc: Fix CPT channel mask in npc_install_flow [+ + +]
Author: Nithin Dabilpuram <ndabilpuram@marvell.com>
Date:   Tue Jun 2 10:28:53 2026 +0530

    octeontx2-af: npc: Fix CPT channel mask in npc_install_flow
    
    [ Upstream commit 1d31eb27e570daa04f5373345f9ac98c95863be9 ]
    
    Use the CPT-aware NIX channel mask in the npc_install_flow path so that
    when the host PF installs steering rules in kernel for a VF used from
    userspace (e.g. DPDK), MCAM entries see the same channel mask semantics as
    other RX paths.
    
    Fixes: 56bcef528bd8 ("octeontx2-af: Use npc_install_flow API for promisc and broadcast entries")
    Cc: Naveen Mamindlapalli <naveenm@marvell.com>
    Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
    Signed-off-by: Ratheesh Kannoth <rkannoth@marvell.com>
    Link: https://patch.msgid.link/20260602045853.1558530-1-rkannoth@marvell.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

octeontx2-af: replace deprecated strncpy with strscpy [+ + +]
Author: Justin Stitt <justinstitt@google.com>
Date:   Sat May 30 10:37:37 2026 -0400

    octeontx2-af: replace deprecated strncpy with strscpy
    
    [ Upstream commit 473f8f2d1bfe1103f20140fdc80cad406b4d68c0 ]
    
    `strncpy` is deprecated for use on NUL-terminated destination strings
    [1] and as such we should prefer more robust and less ambiguous string
    interfaces.
    
    We can see that linfo->lmac_type is expected to be NUL-terminated based
    on the `... - 1`'s present in the current code. Presumably making room
    for a NUL-byte at the end of the buffer.
    
    Considering the above, a suitable replacement is `strscpy` [2] due to
    the fact that it guarantees NUL-termination on the destination buffer
    without unnecessarily NUL-padding.
    
    Let's also prefer the more idiomatic strscpy usage of (dest, src,
    sizeof(dest)) rather than (dest, src, SOME_LEN).
    
    Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings [1]
    Link: https://manpages.debian.org/testing/linux-manual-4.8/strscpy.9.en.html [2]
    Link: https://github.com/KSPP/linux/issues/90
    Signed-off-by: Justin Stitt <justinstitt@google.com>
    Reviewed-by: Kees Cook <keescook@chromium.org>
    Link: https://lore.kernel.org/r/20231010-strncpy-drivers-net-ethernet-marvell-octeontx2-af-cgx-c-v1-1-a443e18f9de8@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Stable-dep-of: c0bf0a4f3f1f ("octeontx2-af: CGX: add bounds check to cgx_speed_mbps index")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
octeontx2-pf: avoid double free of pool->stack on AQ init failure [+ + +]
Author: Dawei Feng <dawei.feng@seu.edu.cn>
Date:   Sat May 30 16:07:07 2026 -0400

    octeontx2-pf: avoid double free of pool->stack on AQ init failure
    
    [ Upstream commit 9b244c242bec48b37e82b89787afd6a4c43457e1 ]
    
    otx2_pool_aq_init() frees pool->stack when mailbox sync or retry
    allocation fails, but leaves the pointer unchanged. Later,
    otx2_sq_aura_pool_init() unwinds the partial setup through
    otx2_aura_pool_free(), which frees pool->stack again. The CN20K-specific
    cn20k_pool_aq_init() implementation has the same bug in
    its corresponding error path.
    
    Set pool->stack to NULL immediately after the local free so the shared
    cleanup path does not free the same stack again while cleaning up
    partially initialized pool state.
    
    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. Manual inspection confirms that the bug is still present in
    v7.1-rc3.
    
    Runtime validation was not performed because reproducing this path
    requires OcteonTX2/CN20K hardware.
    
    Fixes: caa2da34fd25 ("octeontx2-pf: Initialize and config queues")
    Fixes: d322fbd17203 ("octeontx2-pf: Initialize cn20k specific aura and pool contexts")
    Cc: stable@vger.kernel.org
    Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
    Signed-off-by: Dawei Feng <dawei.feng@seu.edu.cn>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20260515151826.1005397-1-dawei.feng@seu.edu.cn
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
parport: Fix race between port and client registration [+ + +]
Author: Ben Hutchings <benh@debian.org>
Date:   Tue May 5 20:45:12 2026 +0200

    parport: Fix race between port and client registration
    
    commit ef15ccbb3e8640a723c42ad90eaf81d66ae02017 upstream.
    
    The parport subsystem registers port devices before they are fully
    initialised, resulting in a race condition where client drivers such
    as lp can attach to ports that are not completely initialised or even
    being torn down.
    
    When the port and client drivers are built as modules and loaded
    around the same time during boot, this occasionally results in a
    crash.  I was able to make this happen reliably in a VM with a
    PC-style parallel port by patching parport_pc to fail probing:
    
    > --- a/drivers/parport/parport_pc.c
    > +++ b/drivers/parport/parport_pc.c
    > @@ -2069,7 +2069,7 @@ static struct parport *__parport_pc_probe_port(unsigned long int base,
    >       if (!p)
    >               goto out3;
    >
    > -     base_res = request_region(base, 3, p->name);
    > +     base_res = NULL;
    >       if (!base_res)
    >               goto out4;
    >
    
    and then running:
    
        while true; do
            modprobe lp & modprobe parport_pc
            wait
            rmmod lp parport_pc
        done
    
    for a few seconds.
    
    In the long term I think port registration should be changed to put
    the call to device_add() inside parport_announce_port(), but since the
    latter currently cannot fail this will require changing all port
    drivers.
    
    For now, add a flag to indicate whether a port has been "announced"
    and only try to attach client drivers to ports when the flag is set.
    
    Fixes: 6fa45a226897 ("parport: add device-model to parport subsystem")
    Closes: https://bugs.debian.org/1130365
    Closes: https://lore.kernel.org/all/6ba903ad-9897-42bb-8c2d-337385cc3746@molgen.mpg.de/
    Cc: stable <stable@kernel.org>
    Signed-off-by: Ben Hutchings <benh@debian.org>
    Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
    Link: https://patch.msgid.link/afo6uBv68GDevbMD@decadent.org.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
pcnet32: stop holding device spin lock during napi_complete_done [+ + +]
Author: Oscar Maes <oscmaes92@gmail.com>
Date:   Thu May 28 16:03:20 2026 +0200

    pcnet32: stop holding device spin lock during napi_complete_done
    
    [ Upstream commit 73bf3cca7de6a73f53b6a52dc3b1c82ae5667a4d ]
    
    napi_complete_done may call gro_flush_normal (though not currently, as GRO
    is unsupported at the moment), which may result in packet TX. This will
    eventually result in calling pcnet32_start_xmit - resulting in a deadlock
    while trying to re-acquire the already locked spin lock.
    
    It is safe to split the spinlock block into two, because the hardware
    registers are still protected from concurrent access, and the two blocks
    perform unrelated operations that don't need to happen atomically.
    
    Fixes: 5b2ec6f2be51 ("pcnet32: use napi_complete_done()")
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Oscar Maes <oscmaes92@gmail.com>
    Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
    Link: https://patch.msgid.link/20260528140320.5556-1-oscmaes92@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
perf build: Conditionally define NDEBUG [+ + +]
Author: Ian Rogers <irogers@google.com>
Date:   Wed May 20 09:33:16 2026 -0700

    perf build: Conditionally define NDEBUG
    
    commit 616b14b47a86d880ba21a363440f20f82152d8f2 upstream
    
    When a build is done without DEBUG=1 then define NDEBUG. This will
    compile out asserts and other debug code.
    
    Signed-off-by: Ian Rogers <irogers@google.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Sean Christopherson <seanjc@google.com>
    Link: https://lore.kernel.org/r/20230330183827.1412303-1-irogers@google.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

perf build: Disable fewer bison warnings [+ + +]
Author: Ian Rogers <irogers@google.com>
Date:   Wed May 20 09:33:18 2026 -0700

    perf build: Disable fewer bison warnings
    
    commit ddc8e4c966923ad1137790817157c8a5f0301aec upstream
    
    If bison is version 3.8.2, reduce the number of bison C warnings
    disabled. Earlier bison versions have all C warnings disabled. Avoid
    implicit declarations of yylex by adding the declaration in the C
    file. A header can't be included as a circular dependency would occur
    due to the lexer using the bison defined tokens.
    
    Committer notes:
    
    Some recent versions of gcc and clang (noticed on Alpine Linux 3.17,
    edge, clearlinux, fedora 37, etc.
    
    Signed-off-by: Ian Rogers <irogers@google.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Andrii Nakryiko <andrii@kernel.org>
    Cc: Eduard Zingerman <eddyz87@gmail.com>
    Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Nathan Chancellor <nathan@kernel.org>
    Cc: Nick Desaulniers <ndesaulniers@google.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rob Herring <robh@kernel.org>
    Cc: Tom Rix <trix@redhat.com>
    Cc: bpf@vger.kernel.org
    Cc: llvm@lists.linux.dev
    Link: https://lore.kernel.org/r/20230728064917.767761-6-irogers@google.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    [florian: Remove non-existent tools/perf/util/bpf-filter.y in 6.1.y]
    Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Change-Id: I62327ddbe816008197053a9234a92d9c253a2c5d
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

perf build: Remove -Wno-unused-but-set-variable from the flex flags when building with clang < 13.0.0 [+ + +]
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
Date:   Wed May 20 09:33:20 2026 -0700

    perf build: Remove -Wno-unused-but-set-variable from the flex flags when building with clang < 13.0.0
    
    commit 878460e8d0ff84a0edbaff9d06f9d9dbe8353800 upstream.
    
    clang < 13.0.0 doesn't grok -Wno-unused-but-set-variable, so just remove
    it to avoid:
    
      error: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Werror,-Wunknown-warning-option]
      make[4]: *** [/git/perf-6.5.0-rc4/tools/build/Makefile.build:128: /tmp/build/perf/util/pmu-flex.o] Error 1
      make[4]: *** Waiting for unfinished jobs....
    
    Fixes: ddc8e4c966923ad1 ("perf build: Disable fewer bison warnings")
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Link: https://lore.kernel.org/lkml/ZNUSWr52jUnVaaa%2F@kernel.org/
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
perf parse-events: Make YYDEBUG dependent on doing a debug build [+ + +]
Author: Ian Rogers <irogers@google.com>
Date:   Wed May 20 09:33:17 2026 -0700

    perf parse-events: Make YYDEBUG dependent on doing a debug build
    
    commit d4ce60190e08d84f88937019defa5e3d23409ac1 upstream
    
    YYDEBUG enables line numbers and other error helpers in the generated
    parse-events-bison.c. These shouldn't be generated when debugging
    isn't enabled.
    
    Signed-off-by: Ian Rogers <irogers@google.com>
    Acked-by: Namhyung Kim <namhyung@kernel.org>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Gaosheng Cui <cuigaosheng1@huawei.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: James Clark <james.clark@arm.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Kan Liang <kan.liang@linux.intel.com>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Rob Herring <robh@kernel.org>
    Cc: bpf@vger.kernel.org
    Link: https://lore.kernel.org/r/20230911170559.4037734-2-irogers@google.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
phy: mscc: Use PHY_ID_MATCH_EXACT for VSC8584, VSC8582, VSC8575, VSC856X [+ + +]
Author: Horatiu Vultur <horatiu.vultur@microchip.com>
Date:   Thu Oct 23 21:13:49 2025 +0200

    phy: mscc: Use PHY_ID_MATCH_EXACT for VSC8584, VSC8582, VSC8575, VSC856X
    
    [ Upstream commit 1bc80d673087e5704adbb3ee8e4b785c14899cce ]
    
    As the PHYs VSC8584, VSC8582, VSC8575 and VSC856X exists only as rev B,
    we can use PHY_ID_MATCH_EXACT to match exactly on revision B of the PHY.
    Because of this change then there is not need the check if it is a
    different revision than rev B in the function vsc8584_probe() as we
    already know that this will never happen.
    These changes are a preparation for the next patch because in that patch
    we will make the PHYs VSC8574 and VSC8572 to use vsc8584_probe() and
    these PHYs have multiple revision.
    
    Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
    Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
    Link: https://patch.msgid.link/20251023191350.190940-2-horatiu.vultur@microchip.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

phy: mscc: Use PHY_ID_MATCH_VENDOR to minimize PHY ID table [+ + +]
Author: Harini Katakam <harini.katakam@amd.com>
Date:   Mon May 29 17:50:16 2023 +0530

    phy: mscc: Use PHY_ID_MATCH_VENDOR to minimize PHY ID table
    
    [ Upstream commit 31605c01fb242806f5b8c9d08abe11328d514206 ]
    
    All the PHY devices variants specified have the same mask and
    hence can be simplified to one vendor look up for 0x00070400.
    Any individual config can be identified by PHY_ID_MATCH_EXACT
    in the respective structure.
    
    Signed-off-by: Harini Katakam <harini.katakam@amd.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Stable-dep-of: 1bc80d673087 ("phy: mscc: Use PHY_ID_MATCH_EXACT for VSC8584, VSC8582, VSC8575, VSC856X")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

phy: tegra: xusb: Disable trk clk when not in use [+ + +]
Author: Wayne Chang <waynec@nvidia.com>
Date:   Mon Jun 1 06:51:02 2026 -0400

    phy: tegra: xusb: Disable trk clk when not in use
    
    [ Upstream commit 71d9e899584e11bbd7eaf9934a619c69a15060d8 ]
    
    Pad tracking is a one-time calibration for Tegra186 and Tegra194.
    Clk should be disabled after calibration.
    
    Disable clk after calibration.
    While at it add 100us delay for HW recording the calibration value.
    
    Signed-off-by: Wayne Chang <waynec@nvidia.com>
    Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
    Link: https://lore.kernel.org/r/20230111110450.24617-5-jonathanh@nvidia.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Stable-dep-of: da110228b54f ("phy: tegra: xusb: Fix per-pad high-speed termination calibration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

phy: tegra: xusb: Fix per-pad high-speed termination calibration [+ + +]
Author: Wayne Chang <waynec@nvidia.com>
Date:   Mon Jun 1 06:51:03 2026 -0400

    phy: tegra: xusb: Fix per-pad high-speed termination calibration
    
    [ Upstream commit da110228b54f2e2143d97ea7151e0dc22e539d67 ]
    
    The existing code reads a single hs_term_range_adj value from bit field
    [10:7] of FUSE_SKU_CALIB_0 and applies it to all USB2 pads uniformly.
    However, on SoCs that support per-pad termination, each pad has its own
    hs_term_range_adj field: pad 0 in FUSE_SKU_CALIB_0[10:7], and pads 1-3
    in FUSE_USB_CALIB_EXT_0 at bit offsets [8:5], [12:9], and [16:13]
    respectively.
    
    Fix the calibration by reading per-pad values from the appropriate fuse
    registers. For SoCs that do not support per-pad termination, replicate
    pad 0's value to all pads to maintain existing behavior.
    
    Add a has_per_pad_term flag to the SoC data to indicate whether per-pad
    termination values are available in FUSE_USB_CALIB_EXT_0.
    
    Fixes: 1ef535c6ba8e ("phy: tegra: xusb: Add Tegra194 support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Wayne Chang <waynec@nvidia.com>
    Signed-off-by: Wei-Cheng Chen <weichengc@nvidia.com>
    Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
    Tested-by: Jon Hunter <jonathanh@nvidia.com>
    Link: https://patch.msgid.link/20260504033305.2283145-1-weichengc@nvidia.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
pidfd: refuse access to tasks that have started exiting harder [+ + +]
Author: Christian Brauner <brauner@kernel.org>
Date:   Mon May 18 10:32:11 2026 +0200

    pidfd: refuse access to tasks that have started exiting harder
    
    commit 62c4d31d78294bd61cf3403626b789e854357177 upstream.
    
    The recent ptrace fix closed a hole where someone could rely on task->mm
    becoming NULL during do_exit() to bypass dumpability checks. This api
    here leans on on the very same check and so inherits the fix.
    
    But there is no good reason to let it succeed at all once the target has
    entered do_exit(). PF_EXITING is set by exit_signals() at the very top
    of do_exit(), before exit_mm() and exit_files() run. Once we observe it,
    the task is committed to dying and exit_files() will release the fdtable
    shortly.
    
    Fixes: 8649c322f75c ("pid: Implement pidfd_getfd syscall")
    Cc: stable@vger.kernel.org
    Link: https://patch.msgid.link/20260518-obgleich-petersilie-2d77ccccf9b9@brauner
    Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
platform/x86/intel/vsec: Add private data for per-device data [+ + +]
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Sat May 30 13:03:28 2026 -0400

    platform/x86/intel/vsec: Add private data for per-device data
    
    [ Upstream commit dc957ab6aa05c118c3da0542428a4d6602aa2d2d ]
    
    Introduce a new private structure, struct vsec_priv, to hold a pointer to
    the platform-specific information. Although the driver didn’t previously
    require this per-device data, adding it now lays the groundwork for
    upcoming patches that will manage such data. No functional changes.
    
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://lore.kernel.org/r/20250703022832.1302928-3-david.e.box@linux.intel.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Stable-dep-of: 348ccc754d89 ("platform/x86/intel/vsec: Fix enable_cnt imbalance on PCIe error recovery")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

platform/x86/intel/vsec: Create wrapper to walk PCI config space [+ + +]
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Sat May 30 13:03:29 2026 -0400

    platform/x86/intel/vsec: Create wrapper to walk PCI config space
    
    [ Upstream commit b0631f8a5740c55b52d02174cc4c9c84cc7a16a1 ]
    
    Combine three PCI config space walkers — intel_vsec_walk_dvsec(),
    intel_vsec_walk_vsec(), and intel_vsec_walk_header() — into a new wrapper
    function, intel_vsec_feature_walk().  This refactoring simplifies the probe
    logic and lays the groundwork for future patches that will loop over these
    calls. No functional changes.
    
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://lore.kernel.org/r/20250703022832.1302928-4-david.e.box@linux.intel.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Stable-dep-of: 348ccc754d89 ("platform/x86/intel/vsec: Fix enable_cnt imbalance on PCIe error recovery")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

platform/x86/intel/vsec: Fix enable_cnt imbalance on PCIe error recovery [+ + +]
Author: Lukas Wunner <lukas@wunner.de>
Date:   Sat May 30 13:03:31 2026 -0400

    platform/x86/intel/vsec: Fix enable_cnt imbalance on PCIe error recovery
    
    [ Upstream commit 348ccc754d8939e21ca5956ff45720b81d6e407f ]
    
    After a PCIe Uncorrectable Error has been reported by a device with
    Intel Vendor Specific Extended Capabilities and has been recovered
    through a Secondary Bus Reset, its driver calls intel_vsec_pci_probe()
    to rescan and reinitialize VSECs.
    
    intel_vsec_pci_probe() invokes pcim_enable_device() and thereby adds
    another devm action which calls pcim_disable_device() on driver unbind.
    
    So once the driver unbinds, pcim_disable_device() will be called as many
    times as an Uncorrectable Error occurred, plus one.  This will lead to
    an enable_cnt imbalance on driver unbind.
    
    Additionally, since commit dc957ab6aa05 ("platform/x86/intel/vsec: Add
    private data for per-device data"), a devm_kzalloc() allocation is
    leaked on every Uncorrectable Error.
    
    Avoid by splitting the VSEC rescan out of intel_vsec_pci_probe() into a
    separate helper and calling that on PCIe error recovery.
    
    Fixes: 936874b77dd0 ("platform/x86/intel/vsec: Add PCI error recovery support to Intel PMT")
    Signed-off-by: Lukas Wunner <lukas@wunner.de>
    Cc: stable@vger.kernel.org  # v6.0+
    Link: https://patch.msgid.link/bd594d09fa866dc51dddc9a447c3b23f9b1402cc.1778736835.git.lukas@wunner.de
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

platform/x86/intel/vsec: Make driver_data info const [+ + +]
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Sat May 30 13:03:30 2026 -0400

    platform/x86/intel/vsec: Make driver_data info const
    
    [ Upstream commit 9577c74c96f88d807d1ba005adbf5952e7127e55 ]
    
    Treat PCI id->driver_data (intel_vsec_platform_info) as read-only by making
    vsec_priv->info a const pointer and updating all function signatures to
    accept const intel_vsec_platform_info *.
    
    This improves const-correctness and clarifies that the platform info data
    from the driver_data table is not meant to be modified at runtime.
    
    No functional changes intended.
    
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
    Link: https://patch.msgid.link/20260313015202.3660072-3-david.e.box@linux.intel.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Stable-dep-of: 348ccc754d89 ("platform/x86/intel/vsec: Fix enable_cnt imbalance on PCIe error recovery")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
pmdomain: core: Fix detach procedure for virtual devices in genpd [+ + +]
Author: Ulf Hansson <ulfh@kernel.org>
Date:   Fri May 15 11:35:51 2026 -0400

    pmdomain: core: Fix detach procedure for virtual devices in genpd
    
    [ Upstream commit 26735dfdd8930d9ef1fa92e590a9bf77726efdf6 ]
    
    If a device is attached to a PM domain through genpd_dev_pm_attach_by_id(),
    genpd calls pm_runtime_enable() for the corresponding virtual device that
    it registers. While this avoids boilerplate code in drivers, there is no
    corresponding call to pm_runtime_disable() in genpd_dev_pm_detach().
    
    This means these virtual devices are typically detached from its genpd,
    while runtime PM remains enabled for them, which is not how things are
    designed to work. In worst cases it may lead to critical errors, like a
    NULL pointer dereference bug in genpd_runtime_suspend(), which was recently
    reported. For another case, we may end up keeping an unnecessary vote for a
    performance state for the device.
    
    To fix these problems, let's add this missing call to pm_runtime_disable()
    in genpd_dev_pm_detach().
    
    Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
    Closes: https://lore.kernel.org/all/CAMuHMdWapT40hV3c+CSBqFOW05aWcV1a6v_NiJYgoYi0i9_PDQ@mail.gmail.com/
    Fixes: 3c095f32a92b ("PM / Domains: Add support for multi PM domains per device to genpd")
    Cc: stable@vger.kernel.org
    Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
printk: add print_hex_dump_devel() [+ + +]
Author: Thorsten Blum <thorsten.blum@linux.dev>
Date:   Sun May 10 10:22:49 2026 -0400

    printk: add print_hex_dump_devel()
    
    [ Upstream commit d134feeb5df33fbf77f482f52a366a44642dba09 ]
    
    Add print_hex_dump_devel() as the hex dump equivalent of pr_devel(),
    which emits output only when DEBUG is enabled, but keeps call sites
    compiled otherwise.
    
    Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
    Reviewed-by: John Ogness <john.ogness@linutronix.de>
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Stable-dep-of: 177730a273b1 ("crypto: caam - guard HMAC key hex dumps in hash_digest_key")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
ptp: vclock: Switch from RCU to SRCU [+ + +]
Author: Kurt Kanzenbach <kurt@linutronix.de>
Date:   Fri May 29 19:11:47 2026 +0200

    ptp: vclock: Switch from RCU to SRCU
    
    [ Upstream commit 672bd0519e27c357c43b7f8c0d653fce3817d06e ]
    
    The usage of PTP vClocks leads immediately to the following issues with
    ptp4l with LOCKDEP and DEBUG_ATOMIC_SLEEP enabled: "BUG: sleeping function
    called from invalid context".
    
    ptp_convert_timestamp() acquires a mutex_t within a RCU read section.  This
    is illegal, because acquiring a mutex_t can result in voluntary scheduling
    request which is not allowed within a RCU read section.
    
    Replace the RCU usage with SRCU where sleeping is allowed.
    
    Reported-by: Florian Zeitz <florian.zeitz@schettke.com>
    Closes: https://lore.kernel.org/all/00a8cce8-410e-4038-98af-49be6d93d7bd@schettke.com/
    Fixes: 67d93ffc0f3c ("ptp: vclock: use mutex to fix "sleep on atomic" bug")
    Signed-off-by: Kurt Kanzenbach <kurt@linutronix.de>
    Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Link: https://patch.msgid.link/20260529-vclock_rcu-v2-1-02a5531fab92@linutronix.de
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
r8152: Block future register access if register access fails [+ + +]
Author: Douglas Anderson <dianders@chromium.org>
Date:   Fri Oct 20 14:06:59 2023 -0700

    r8152: Block future register access if register access fails
    
    [ Upstream commit d9962b0d42029bcb40fe3c38bce06d1870fa4df4 ]
    
    Even though the functions to read/write registers can fail, most of
    the places in the r8152 driver that read/write register values don't
    check error codes. The lack of error code checking is problematic in
    at least two ways.
    
    The first problem is that the r8152 driver often uses code patterns
    similar to this:
      x = read_register()
      x = x | SOME_BIT;
      write_register(x);
    
    ...with the above pattern, if the read_register() fails and returns
    garbage then we'll end up trying to write modified garbage back to the
    Realtek adapter. If the write_register() succeeds that's bad. Note
    that as of commit f53a7ad18959 ("r8152: Set memory to all 0xFFs on
    failed reg reads") the "garbage" returned by read_register() will at
    least be consistent garbage, but it is still garbage.
    
    It turns out that this problem is very serious. Writing garbage to
    some of the hardware registers on the Ethernet adapter can put the
    adapter in such a bad state that it needs to be power cycled (fully
    unplugged and plugged in again) before it can enumerate again.
    
    The second problem is that the r8152 driver generally has functions
    that are long sequences of register writes. Assuming everything will
    be OK if a random register write fails in the middle isn't a great
    assumption.
    
    One might wonder if the above two problems are real. You could ask if
    we would really have a successful write after a failed read. It turns
    out that the answer appears to be "yes, this can happen". In fact,
    we've seen at least two distinct failure modes where this happens.
    
    On a sc7180-trogdor Chromebook if you drop into kdb for a while and
    then resume, you can see:
    1. We get a "Tx timeout"
    2. The "Tx timeout" queues up a USB reset.
    3. In rtl8152_pre_reset() we try to reinit the hardware.
    4. The first several (2-9) register accesses fail with a timeout, then
       things recover.
    
    The above test case was actually fixed by the patch ("r8152: Increase
    USB control msg timeout to 5000ms as per spec") but at least shows
    that we really can see successful calls after failed ones.
    
    On a different (AMD) based Chromebook with a particular adapter, we
    found that during reboot tests we'd also sometimes get a transitory
    failure. In this case we saw -EPIPE being returned sometimes. Retrying
    worked, but retrying is not always safe for all register accesses
    since reading/writing some registers might have side effects (like
    registers that clear on read).
    
    Let's fully lock out all register access if a register access fails.
    When we do this, we'll try to queue up a USB reset and try to unlock
    register access after the reset. This is slightly tricker than it
    sounds since the r8152 driver has an optimized reset sequence that
    only works reliably after probe happens. In order to handle this, we
    avoid the optimized reset if probe didn't finish. Instead, we simply
    retry the probe routine in this case.
    
    When locking out access, we'll use the existing infrastructure that
    the driver was using when it detected we were unplugged. This keeps us
    from getting stuck in delay loops in some parts of the driver.
    
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    Reviewed-by: Grant Grundler <grundler@chromium.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Stable-dep-of: 19440600e729 ("r8152: handle the return value of usb_reset_device()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

r8152: handle the return value of usb_reset_device() [+ + +]
Author: Chih Kai Hsu <hsu.chih.kai@realtek.com>
Date:   Thu Jun 4 17:22:47 2026 +0800

    r8152: handle the return value of usb_reset_device()
    
    [ Upstream commit 19440600e729d4f74a42591a872099cf25c7d28a ]
    
    If usb_reset_device() returns a negative error code, stop the
    process of probing.
    
    Fixes: 10c3271712f5 ("r8152: disable the ECM mode")
    Signed-off-by: Chih Kai Hsu <hsu.chih.kai@realtek.com>
    Reviewed-by: Hayes Wang <hayeswang@realtek.com>
    Reviewed-by: Andrew Lunn <andrew@lunn.ch>
    Link: https://patch.msgid.link/20260604092247.27158-450-nic_swsd@realtek.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

r8152: Hold the rtnl_lock for all of reset [+ + +]
Author: Douglas Anderson <dianders@chromium.org>
Date:   Wed Nov 29 13:25:20 2023 -0800

    r8152: Hold the rtnl_lock for all of reset
    
    commit e62adaeecdc6a1e8ae86e7f3f9f8223a3ede94f5 upstream.
    
    As of commit d9962b0d4202 ("r8152: Block future register access if
    register access fails") there is a race condition that can happen
    between the USB device reset thread and napi_enable() (not) getting
    called during rtl8152_open(). Specifically:
    * While rtl8152_open() is running we get a register access error
      that's _not_ -ENODEV and queue up a USB reset.
    * rtl8152_open() exits before calling napi_enable() due to any reason
      (including usb_submit_urb() returning an error).
    
    In that case:
    * Since the USB reset is perform in a separate thread asynchronously,
      it can run at anytime USB device lock is not held - even before
      rtl8152_open() has exited with an error and caused __dev_open() to
      clear the __LINK_STATE_START bit.
    * The rtl8152_pre_reset() will notice that the netif_running() returns
      true (since __LINK_STATE_START wasn't cleared) so it won't exit
      early.
    * rtl8152_pre_reset() will then hang in napi_disable() because
      napi_enable() was never called.
    
    We can fix the race by making sure that the r8152 reset routines don't
    run at the same time as we're opening the device. Specifically we need
    the reset routines in their entirety rely on the return value of
    netif_running(). The only way to reliably depend on that is for them
    to hold the rntl_lock() mutex for the duration of reset.
    
    Grabbing the rntl_lock() mutex for the duration of reset seems like a
    long time, but reset is not expected to be common and the rtnl_lock()
    mutex is already held for long durations since the core grabs it
    around the open/close calls.
    
    Fixes: d9962b0d4202 ("r8152: Block future register access if register access fails")
    Reviewed-by: Grant Grundler <grundler@chromium.org>
    Signed-off-by: Douglas Anderson <dianders@chromium.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

r8152: reduce the control transfer of rtl8152_get_version() [+ + +]
Author: Hayes Wang <hayeswang@realtek.com>
Date:   Thu Jan 19 15:40:43 2023 +0800

    r8152: reduce the control transfer of rtl8152_get_version()
    
    [ Upstream commit 02767440e1dda9861a11ca1dbe0f19a760b1d5c2 ]
    
    Reduce the control transfer by moving calling rtl8152_get_version() in
    rtl8152_probe(). This could prevent from calling rtl8152_get_version()
    for unnecessary situations. For example, after setting config #2 for the
    device, there are two interfaces and rtl8152_probe() may be called
    twice. However, we don't need to call rtl8152_get_version() for this
    situation.
    
    Signed-off-by: Hayes Wang <hayeswang@realtek.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Stable-dep-of: 19440600e729 ("r8152: handle the return value of usb_reset_device()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
RDMA/rxe: Complete the rxe_cleanup_task backport [+ + +]
Author: Vladislav Nikolaev <vlad102nikolaev@gmail.com>
Date:   Wed Jun 3 16:27:15 2026 +0300

    RDMA/rxe: Complete the rxe_cleanup_task backport
    
    No upstream commit exists for this patch.
    
    The issue was introduced with backporting upstream commit b2b1ddc45745
    ("RDMA/rxe: Fix the error "trying to register non-static key in
    rxe_cleanup_task"") to the 6.1 stable tree as commit 3236221bb8e4
    ("RDMA/rxe: Fix the error "trying to register non-static key in
    rxe_cleanup_task"").
    
    The 6.1 backport guarded qp->req.task and qp->comp.task before calling
    rxe_cleanup_task(), but left qp->resp.task unguarded. It also kept the
    responder task cleanup before deleting the RC timers, while upstream had
    already moved it after the timer shutdown by commit 960ebe97e523
    ("RDMA/rxe: Remove __rxe_do_task()").
    
    In the 6.1 tree, rxe_qp_from_init() calls rxe_qp_init_req() before
    rxe_qp_init_resp(). Therefore, if rxe_qp_init_req() fails, cleanup can
    run before qp->resp.task has been initialized by rxe_init_task(), and the
    unconditional rxe_cleanup_task(&qp->resp.task) can still hit the same
    uninitialized task lock problem that upstream commit b2b1ddc45745 fixed.
    
    Move responder task cleanup after deleting the RC timers, matching the
    upstream cleanup order, and guard it with qp->resp.task.func like the
    requester and completer tasks.
    
    Fixes: 3236221bb8e4 ("RDMA/rxe: Fix the error "trying to register non-static key in rxe_cleanup_task"")
    Signed-off-by: Vladislav Nikolaev <vlad102nikolaev@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

RDMA/rxe: Fix double free in rxe_srq_from_init [+ + +]
Author: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Date:   Thu May 28 13:13:39 2026 +0200

    RDMA/rxe: Fix double free in rxe_srq_from_init
    
    commit 0beefd0e15d962f497aad750b2d5e9c3570b66d1 upstream.
    
    In rxe_srq_from_init(), the queue pointer 'q' is assigned to
    'srq->rq.queue' before copying the SRQ number to user space.
    If copy_to_user() fails, the function calls rxe_queue_cleanup()
    to free the queue, but leaves the now-invalid pointer in
    'srq->rq.queue'.
    
    The caller of rxe_srq_from_init() (rxe_create_srq) eventually
    calls rxe_srq_cleanup() upon receiving the error, which triggers
    a second rxe_queue_cleanup() on the same memory, leading to a
    double free.
    
    The call trace looks like this:
       kmem_cache_free+0x.../0x...
       rxe_queue_cleanup+0x1a/0x30 [rdma_rxe]
       rxe_srq_cleanup+0x42/0x60 [rdma_rxe]
       rxe_elem_release+0x31/0x70 [rdma_rxe]
       rxe_create_srq+0x12b/0x1a0 [rdma_rxe]
       ib_create_srq_user+0x9a/0x150 [ib_core]
    
    Fix this by moving 'srq->rq.queue = q' after copy_to_user.
    
    Fixes: aae0484e15f0 ("IB/rxe: avoid srq memory leak")
    Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
    Link: https://patch.msgid.link/20260112015412.29458-1-jiashengjiangcool@gmail.com
    Reviewed-by: Zhu Yanjun <yanjun.Zhu@linux.dev>
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    [bwh: Backported to 6.1: There was no assignment to init->attr.max_wr
     here; don't add it]
    Signed-off-by: Ben Hutchings <benh@debian.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
RDMA/srp: bound SRP_RSP sense copy by the received length [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Tue Jun 2 18:04:57 2026 -0400

    RDMA/srp: bound SRP_RSP sense copy by the received length
    
    commit 13e91fd076306f5d0cdfa14f53d69e37274723c4 upstream.
    
    srp_process_rsp() copies sense data from rsp->data + resp_data_len,
    where resp_data_len is the full 32-bit value supplied by the SRP target
    and is never checked against the number of bytes actually received
    (wc->byte_len). The copy length is bounded to SCSI_SENSE_BUFFERSIZE, so
    at most 96 bytes are copied, but the source offset is not bounded.
    
    A malicious or compromised SRP target on the InfiniBand/RoCE fabric that
    the initiator has logged into can return an SRP_RSP with
    SRP_RSP_FLAG_SNSVALID set and a large resp_data_len. The receive buffer
    is allocated at the target-chosen max_ti_iu_len, so the source of the
    sense copy lands past the bytes actually received; with resp_data_len
    near 0xFFFFFFFF it is gigabytes past the buffer and the read faults.
    
    Copy the sense data only if it has not been truncated, that is, only if
    the response header, the response data, and the sense region fit within
    the bytes actually received; otherwise drop the sense and log. The
    in-tree iSER and NVMe-RDMA receive paths already bound their parse by
    wc->byte_len; this brings ib_srp into line with them.
    
    Fixes: aef9ec39c47f ("IB: Add SCSI RDMA Protocol (SRP) initiator")
    Link: https://patch.msgid.link/r/20260602220457.2542840-1-michael.bommarito@gmail.com
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Reviewed-by: Bart Van Assche <bvanassche@acm.org>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
RDMA/umem: fix kernel-doc warnings [+ + +]
Author: Randy Dunlap <rdunlap@infradead.org>
Date:   Mon Jun 15 20:19:48 2026 -0400

    RDMA/umem: fix kernel-doc warnings
    
    [ Upstream commit ff46d1392750444fab5ae5a0194764ffdc4ac0d2 ]
    
    Add or correct kernel-doc comments to eliminate warnings:
    
    Warning: include/rdma/ib_umem.h:104 function parameter 'biter' not
     described in 'rdma_umem_for_each_dma_block'
    Warning: include/rdma/ib_umem.h:140 function parameter 'pgsz_bitmap' not
     described in 'ib_umem_find_best_pgoff'
    Warning: include/rdma/ib_umem.h:141 No description found for return
     value of 'ib_umem_find_best_pgoff'
    
    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Link: https://patch.msgid.link/20260224003120.3173892-1-rdunlap@infradead.org
    Signed-off-by: Leon Romanovsky <leon@kernel.org>
    Stable-dep-of: 15fe76e23615 ("RDMA/umem: Fix truncation for block sizes >= 4G")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

RDMA/umem: Fix truncation for block sizes >= 4G [+ + +]
Author: Jason Gunthorpe <jgg@ziepe.ca>
Date:   Mon Jun 15 20:19:50 2026 -0400

    RDMA/umem: Fix truncation for block sizes >= 4G
    
    [ Upstream commit 15fe76e23615f502d051ef0768f86babaf08746c ]
    
    When the iommu is used the linearization of the mapping can give a single
    block that is very large split across multiple SG entries.
    
    When __rdma_block_iter_next() reassembles the split SG entries it is
    overflowing the 32 bit stack values and computed the wrong DMA addresses
    for blocks after the truncation.
    
    Use the right types to hold DMA addresses.
    
    Link: https://patch.msgid.link/r/1-v1-88303e9e509f+f7-ib_umem_types_jgg@nvidia.com
    Cc: stable@vger.kernel.org
    Fixes: a808273a495c ("RDMA/verbs: Add a DMA iterator to return aligned contiguous memory blocks")
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
RDMA: Move DMA block iterator logic into dedicated files [+ + +]
Author: Leon Romanovsky <leon@kernel.org>
Date:   Mon Jun 15 20:19:49 2026 -0400

    RDMA: Move DMA block iterator logic into dedicated files
    
    [ Upstream commit 6094ea64c69520ed1e770e7c79c43412de202bfa ]
    
    The DMA iterator logic was mixed into verbs and umem-specific code,
    forcing all users to include rdma/ib_umem.h. Move the block iterator
    logic into iter.c and rdma/iter.h so that rdma/ib_umem.h and
    rdma/ib_verbs.h can be separated in a follow-up patch.
    
    Link: https://patch.msgid.link/20260213-refactor-umem-v1-1-f3be85847922@nvidia.com
    Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
    Stable-dep-of: 15fe76e23615 ("RDMA/umem: Fix truncation for block sizes >= 4G")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
rds: mark snapshot pages dirty in rds_info_getsockopt() [+ + +]
Author: Breno Leitao <leitao@debian.org>
Date:   Mon Jun 8 02:32:05 2026 -0700

    rds: mark snapshot pages dirty in rds_info_getsockopt()
    
    [ Upstream commit 512db8267b73a220a64180d95ab5eebe7c4964a8 ]
    
    rds_info_getsockopt() pins the destination user pages with FOLL_WRITE and
    the RDS_INFO_* producers memcpy the snapshot into them through
    kmap_atomic(). Because that copy goes through the kernel direct map, the
    dirty bit on the user PTE is never set, so unpin_user_pages() releases the
    pages without marking them dirty. A file-backed destination page can then
    be reclaimed without writeback, silently discarding the copied data.
    
    Use unpin_user_pages_dirty_lock() with make_dirty=true so the modified
    pages are marked dirty before they are unpinned.
    
    Fixes: a8c879a7ee98 ("RDS: Info and stats")
    Signed-off-by: Breno Leitao <leitao@debian.org>
    Reviewed-by: Allison Henderson <achender@kernel.org>
    Link: https://patch.msgid.link/20260608-rds_fix-v1-1-006c88543408@debian.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Revert "RDMA/rxe: Fix double free in rxe_srq_from_init" [+ + +]
Author: Ben Hutchings <benh@debian.org>
Date:   Thu May 28 13:13:17 2026 +0200

    Revert "RDMA/rxe: Fix double free in rxe_srq_from_init"
    
    This reverts commit d286f0d4e3ad3caf5f0e673cdad7bf89bf37d947, which
    was commit 0beefd0e15d962f497aad750b2d5e9c3570b66d1 upstream.  The
    backported version did not move but duplicated the problematic
    assignment, so it did not fix the bug.  A proper backport will follow.
    
    Signed-off-by: Ben Hutchings <benh@debian.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Revert "selftest/ptp: update ptp selftest to exercise the gettimex options" [+ + +]
Author: Petr Machata <petrm@nvidia.com>
Date:   Fri May 15 15:53:53 2026 +0200

    Revert "selftest/ptp: update ptp selftest to exercise the gettimex options"
    
    This reverts commit 06954f715deb0ed053f8bf85547370db6870225d, which is
    commit 3d07b691ee707c00afaf365440975e81bb96cd9b upstream.
    
    The cited commit allows testptp to set a configurable clock_id. That is
    done via a PTP_SYS_OFFSET_EXTENDED ioctl call, whose argument is struct
    ptp_sys_offset_extended, where the clock_id is set. However, this Linux
    version does not support the ptp_sys_offset_extended.clockid field, and
    the test case cannot be built against this tree's own UAPI headers.
    
    The reverted commit was introduced to resolve a missing dependency of
    commit c6dc458227a3 ("testptp: Add option to open PHC in readonly mode"),
    which is 76868642e427 upstream. My suspicion is that the only conflict
    between the two is the getopt string, and there is otherwise no direct
    dependency between the two.
    
    This patch therefore reverts the cited commit, with hand-resolving the
    getopt string to include 'r' (as introduced by c6dc458227a3), but not
    'y' (introduced by 06954f715deb).
    
    Reported-by: Yong Wang <yongwang@nvidia.com>
    Signed-off-by: Petr Machata <petrm@nvidia.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Revert "selftests/bpf: Add a cgroup prog bpf_get_ns_current_pid_tgid() test" [+ + +]
Author: Paul Chaignon <paul.chaignon@gmail.com>
Date:   Tue Jun 2 21:41:46 2026 +0200

    Revert "selftests/bpf: Add a cgroup prog bpf_get_ns_current_pid_tgid() test"
    
    This reverts commit 4d8fb7ed7a55 ("selftests/bpf: Add a cgroup prog
    bpf_get_ns_current_pid_tgid() test").
    
    That commit should have never been backported to 6.1 because it
    introduces a test for a feature that isn't supported:
    bpf_get_ns_current_pid_tgid() cannot be called from cgroup BPF programs
    in 6.1.
    
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Revert "selftests/bpf: Add tests for _opts variants of bpf_*_get_fd_by_id()" [+ + +]
Author: Paul Chaignon <paul.chaignon@gmail.com>
Date:   Tue Jun 2 21:40:57 2026 +0200

    Revert "selftests/bpf: Add tests for _opts variants of bpf_*_get_fd_by_id()"
    
    This reverts commit 45108a7b4866 ("selftests/bpf: Add tests for _opts
    variants of bpf_*_get_fd_by_id()"). As explained in the previous patch,
    it introduces a new selftest for a feature that doesn't exist in 6.1. It
    was backported as a stable-dep of a1914d146622 ("selftests/bpf:
    Workaround strict bpf_lsm return value check"), also reverted in the
    previous patch.
    
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Revert "selftests/bpf: Workaround strict bpf_lsm return value check." [+ + +]
Author: Paul Chaignon <paul.chaignon@gmail.com>
Date:   Tue Jun 2 21:40:48 2026 +0200

    Revert "selftests/bpf: Workaround strict bpf_lsm return value check."
    
    This reverts commit a1914d146622 ("selftests/bpf: Workaround strict
    bpf_lsm return value check"). It seems it was picked up by mistake.
    
    It applies to a selftest that didn't exist in 6.1. The whole selftest
    was then backported as a stable-dep in commit 45108a7b4866
    ("selftests/bpf: Add tests for _opts variants of bpf_*_get_fd_by_id()")
    (reverted as well in the next patch).
    
    The new selftest covers the bpf_*_get_fd_by_id structures. Those don't
    exist in 6.1 so the selftest shouldn't either.
    
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
sched: Use u64 for bandwidth ratio calculations [+ + +]
Author: Joseph Salisbury <joseph.salisbury@oracle.com>
Date:   Sat May 2 19:58:03 2026 -0400

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

 
scsi: fcoe: Reject FIP descriptors with zero fip_dlen in CVL walker [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Mon May 18 10:43:07 2026 -0400

    scsi: fcoe: Reject FIP descriptors with zero fip_dlen in CVL walker
    
    commit 9eed1bd59937e6828b00d2f2dfef631d964f3636 upstream.
    
    drivers/scsi/fcoe/fcoe_ctlr.c::fcoe_ctlr_recv_clr_vlink() advanced the
    descriptor cursor by an attacker-supplied fip_dlen without ever
    requiring dlen >= sizeof(struct fip_desc) in the default branch.  The
    named descriptor cases (FIP_DT_MAC, FIP_DT_NAME, FIP_DT_VN_ID) checked
    their per-type minimum lengths, but a FIP_DT_NON_CRITICAL descriptor
    (fip_dtype >= 128, which the standard requires receivers to silently
    ignore) skipped that check entirely.
    
    An unauthenticated L2 peer on the FCoE control VLAN could hang
    fcoe_ctlr_recv_work on an fcoe, qedf, or bnx2fc initiator indefinitely
    by emitting one FIP CVL frame whose single descriptor had fip_dtype ==
    FIP_DT_NON_CRITICAL and fip_dlen == 0: the cursor advanced zero bytes
    per iteration and the loop condition rlen >= sizeof(*desc) stayed true
    forever, blocking every subsequent FIP frame on that controller.
    
    Tighten the outer dlen guard to also reject dlen < sizeof(struct
    fip_desc), so a malformed descriptor whose length cannot even cover the
    descriptor header is rejected before the switch.  This is the same
    lower-bound the named cases already apply and is the minimum scope that
    closes the loop.
    
    Fixes: 97c8389d54b9 ("[SCSI] fcoe, libfcoe: Add support for FIP. FCoE discovery and keep-alive.")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Reviewed-by: Hannes Reinecke <hare@kernel.org>
    Link: https://patch.msgid.link/20260518144307.2820961-1-michael.bommarito@gmail.com
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

scsi: scsi_transport_fc: Widen FPIN pname walker counter to u32 [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Wed May 20 09:30:15 2026 -0400

    scsi: scsi_transport_fc: Widen FPIN pname walker counter to u32
    
    commit a9a39233ec1fc9f97ea1340a4d09bb7ec2be5153 upstream.
    
    An adjacent Fibre Channel fabric actor that can deliver an FPIN ELS
    frame to an lpfc or qla2xxx Linux initiator can trigger a non-return in
    the generic FC transport. This is not a local userspace or IP network
    path; the attacker must be able to inject fabric traffic, for example as
    a compromised switch or fabric controller, or as a same-zone N_Port on a
    fabric that permits source spoofing.
    
    The Link-Integrity and Peer-Congestion FPIN walkers used a u8 loop
    counter against the 32-bit on-wire pname_count field, and did not bound
    pname_count by the descriptor body already validated by the TLV walker.
    A pname_count of 256 therefore wraps the counter and keeps the loop
    condition true indefinitely.
    
    Factor the shared pname_list[] walk into one helper, widen the counter
    to u32, and clamp pname_count against the entries that fit in the
    descriptor body before iterating.
    
    Fixes: 3dcfe0de5a97 ("scsi: fc: Parse FPIN packets and update statistics")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: John Garry <john.g.garry@oracle.com>
    Link: https://patch.msgid.link/20260520133015.1018937-1-michael.bommarito@gmail.com
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

scsi: target: iscsi: Bound iscsi_encode_text_output() appends to rsp_buf [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Mon May 11 14:49:14 2026 -0400

    scsi: target: iscsi: Bound iscsi_encode_text_output() appends to rsp_buf
    
    commit bf33e01f88388c43e285492a63e539df6ffed64c upstream.
    
    iscsi_encode_text_output() concatenates "key=value\0" records into
    login->rsp_buf, an 8192-byte kzalloc(MAX_KEY_VALUE_PAIRS) buffer
    allocated in iscsit_alloc_login_setup_buffer(). The three sprintf() call
    sites in this function (lines 1398, 1411, 1424 in v7.1-rc2) never check
    the remaining buffer capacity:
    
            *length += sprintf(output_buf, "%s=%s", er->key, er->value);
            *length += 1;
            output_buf = textbuf + *length;
    
    The 8192-byte ceiling at iscsi_target_check_login_request() bounds the
    *input* Login PDU payload, but a single PDU can carry up to 2048 minimal
    four-byte "a=b\0" pairs, each unknown key expanding to a 16-byte
    "a=NotUnderstood\0" output record via iscsi_add_notunderstood_response().
    2048 * 16 = 32 KiB of output into an 8 KiB buffer, producing a ~24 KiB
    heap overrun in the kmalloc-8k slab.
    
    The fix introduces a static iscsi_encode_text_record() helper that uses
    snprintf() with a per-call bounds check against the remaining buffer,
    and threads a u32 textbuf_size parameter through
    iscsi_encode_text_output(). Both call sites in
    iscsi_target_handle_csg_zero() (PHASE_SECURITY) and
    iscsi_target_handle_csg_one() (PHASE_OPERATIONAL) pass
    MAX_KEY_VALUE_PAIRS. On overflow the encoder logs the condition, calls
    iscsi_release_extra_responses() to drop queued records, and returns -1;
    both caller sites now emit ISCSI_STATUS_CLS_INITIATOR_ERR /
    ISCSI_LOGIN_STATUS_INIT_ERR via iscsit_tx_login_rsp() before returning,
    so the initiator sees an explicit failed-login response rather than a
    silent connection drop. (Prior to this patch only the PHASE_OPERATIONAL
    caller did that; the PHASE_SECURITY caller is converted to the same
    shape.)
    
    Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Tested-by: John Garry <john.g.garry@oracle.com>
    Reviewed-by: John Garry <john.g.garry@oracle.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

scsi: target: iscsi: Fix CRC overread and double-free in iscsit_handle_text_cmd() [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Sat Jun 6 08:32:06 2026 -0400

    scsi: target: iscsi: Fix CRC overread and double-free in iscsit_handle_text_cmd()
    
    [ Upstream commit 778c2ab142c625a8a8afa570e0f9b7873f445d99 ]
    
    Two latent bugs in the Text-phase handler, both present since the
    original LIO integration in commit e48354ce078c ("iscsi-target: Add
    iSCSI fabric support for target v4.1"):
    
    1) DataDigest CRC buffer overread (4 bytes past text_in).
    
       text_in is kzalloc()'d at ALIGN(payload_length, 4).  rx_size is then
       incremented by ISCSI_CRC_LEN to make room for the received DataDigest
       in the iovec, but the same (now-bumped) rx_size is passed as the
       buffer length to iscsit_crc_buf():
    
           if (conn->conn_ops->DataDigest) {
                   ...
                   rx_size += ISCSI_CRC_LEN;
           }
           ...
           if (conn->conn_ops->DataDigest) {
                   data_crc = iscsit_crc_buf(text_in, rx_size, 0, NULL);
    
       iscsit_crc_buf() walks rx_size bytes of text_in with crc32c(), so
       when DataDigest is negotiated it reads 4 bytes past the end of the
       text_in allocation.  KASAN reproduces this directly on the unpatched
       mainline tree as slab-out-of-bounds in crc32c() called from the Text
       PDU path.  The OOB bytes feed crc32c() and are then compared against
       the initiator-supplied checksum, so the value does not flow back to
       the attacker, but the kernel does read past the buffer on every Text
       PDU with DataDigest=CRC32C.
    
       Fix by passing the actual padded payload length
       (ALIGN(payload_length, 4)) that was used for the kzalloc().
    
    2) Stale cmd->text_in_ptr re-free (double-free) on ERL>0 bad DataDigest
       drop.
    
       On DataDigest mismatch with ErrorRecoveryLevel > 0 the handler
       silently drops the PDU and lets the initiator plug the CmdSN gap:
    
                   kfree(text_in);
                   return 0;
    
       cmd->text_in_ptr still points at the freed buffer.  The next Text
       Request on the same ITT re-enters iscsit_setup_text_cmd(), which
       unconditionally does
    
           kfree(cmd->text_in_ptr);
           cmd->text_in_ptr = NULL;
    
       freeing the same pointer a second time.  Session teardown via
       iscsit_release_cmd() has the same shape and hits the same double-free
       if the connection is dropped before a second Text Request arrives.
    
       On an unmodified mainline tree the bug-1 CRC overread fires first on
       the initial valid Text Request and perturbs the subsequent state, so
       #4 was isolated by building a kernel with only the bug-1 hunk of this
       patch applied plus temporary printk() observability around the three
       relevant kfree() sites.  The observability prints are not part of
       this patch.  On that build, a three-PDU Text Request sequence after
       login produces two back-to-back splats:
    
           BUG: KASAN: double-free in iscsit_setup_text_cmd+0x??
           BUG: KASAN: double-free in iscsit_release_cmd+0x??
    
       showing the same pointer freed in the ERL>0 drop path and again in
       iscsit_setup_text_cmd() (next Text Request on the same ITT) and once
       more in iscsit_release_cmd() (session teardown).  On distro kernels
       with CONFIG_SLAB_FREELIST_HARDENED=y (default) the double-free
       becomes a remote kernel BUG(); on non-hardened kernels it corrupts
       the slab freelist.
    
       Fix by clearing cmd->text_in_ptr after the kfree() in the ERL>0 drop
       path.  With both hunks applied #4 is directly observable on the stock
       tree without observability printks; fixing bug-1 alone would mask #4
       less, not more, so the hunks are submitted together.
    
    Both fixes are one-liners.  The Text PDU state machine is unchanged and
    the wire protocol is unaffected.
    
    Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Tested-by: John Garry <john.g.garry@oracle.com>
    Reviewed-by: John Garry <john.g.garry@oracle.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

scsi: target: iscsi: Validate CHAP_R length before base64 decode [+ + +]
Author: Alexandru Hossu <hossu.alexandru@gmail.com>
Date:   Thu May 21 17:11:21 2026 +0200

    scsi: target: iscsi: Validate CHAP_R length before base64 decode
    
    commit 85db7391310b1304d2dc8ae3b0b12105a9567147 upstream.
    
    chap_server_compute_hash() allocates client_digest as
    kzalloc(chap->digest_size) and then, for BASE64-encoded responses,
    passes chap_r directly to chap_base64_decode() without checking whether
    the input length could produce more than digest_size bytes of output.
    
    chap_base64_decode() writes to the destination unconditionally as long
    as there is input to consume. With MAX_RESPONSE_LENGTH set to 128 and
    the "0b" prefix stripped by extract_param(), up to 127 base64 characters
    can reach the decoder. 127 characters decode to 95 bytes. For SHA-256
    (digest_size=32) this overflows client_digest by 63 bytes; for MD5
    (digest_size=16) the overflow is 79 bytes.
    
    The length check at line 344 fires after the write has already happened.
    
    The HEX branch in the same switch statement already validates the length
    up front. Apply the same approach to the BASE64 branch: strip trailing
    base64 padding characters, then reject any input whose data length
    exceeds DIV_ROUND_UP(digest_size * 4, 3) before calling the decoder.
    
    Stripping trailing '=' before the comparison handles both padded and
    unpadded encodings. chap_base64_decode() already returns early on '=',
    so the full original string is still passed to the decoder unchanged.
    
    The mutual CHAP path decodes CHAP_C into initiatorchg_binhex, which is
    kzalloc(CHAP_CHALLENGE_STR_LEN). extract_param() caps initiatorchg at
    CHAP_CHALLENGE_STR_LEN characters, so at most CHAP_CHALLENGE_STR_LEN-1
    base64 characters reach the decoder. The maximum decoded size,
    DIV_ROUND_UP((CHAP_CHALLENGE_STR_LEN-1) * 3, 4), is less than
    CHAP_CHALLENGE_STR_LEN, so no overflow is possible there. A comment is
    added at the call site to document this.
    
    Fixes: 1e5733883421 ("scsi: target: iscsi: Support base64 in CHAP")
    Cc: stable@vger.kernel.org
    Signed-off-by: Alexandru Hossu <hossu.alexandru@gmail.com>
    Reviewed-by: David Disseldorp <ddiss@suse.de>
    Link: https://patch.msgid.link/20260521151121.808477-1-hossu.alexandru@gmail.com
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
sctp: diag: reject stale associations in dump_one path [+ + +]
Author: Zhao Zhang <zzhan461@ucr.edu>
Date:   Sat May 30 23:57:14 2026 +0800

    sctp: diag: reject stale associations in dump_one path
    
    commit 5eba3e48d78edd7551b992cb7ba687019b3a78da upstream.
    
    The SCTP exact sock_diag lookup can hold a transport reference, block on
    lock_sock(sk), and then resume after sctp_association_free() has marked
    the association dead and freed its bind address list.
    
    When that happens, inet_assoc_attr_size() and
    inet_diag_msg_sctpasoc_fill() can still dereference association state
    that is no longer valid for reporting. In particular,
    inet_diag_msg_sctpasoc_fill() may read an empty bind-address list as a
    real sctp_sockaddr_entry and trigger an out-of-bounds read from
    unrelated association memory.
    
    Reject the association after taking the socket lock if it has been
    reaped or detached from the endpoint, and report the lookup as stale.
    This keeps the exact dump-one path from formatting torn association
    state.
    
    Fixes: 8f840e47f190 ("sctp: add the sctp_diag.c file")
    Cc: stable@kernel.org
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Signed-off-by: Zhao Zhang <zzhan461@ucr.edu>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/fac6043fa20a2ff68e12958c431836f692c51268.1780113823.git.zzhan461@ucr.edu
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

sctp: fix race between sctp_wait_for_connect and peeloff [+ + +]
Author: Zhenghang Xiao <kipreyyy@gmail.com>
Date:   Wed May 27 11:24:11 2026 +0800

    sctp: fix race between sctp_wait_for_connect and peeloff
    
    [ Upstream commit f14fe6395a8b3d961a61e138ad7b36ba3626dd4e ]
    
    sctp_wait_for_connect() drops and re-acquires the socket lock while
    waiting for the association to reach ESTABLISHED state. During this
    window, another thread can peeloff the association to a new socket via
    getsockopt(SCTP_SOCKOPT_PEELOFF), changing asoc->base.sk. After
    re-acquiring the old socket lock, sctp_wait_for_connect() returns
    success without noticing the migration — the caller then accesses
    the association under the wrong lock in sctp_datamsg_from_user().
    
    Add the same sk != asoc->base.sk check that sctp_wait_for_sndbuf()
    already has, returning an error if the association was migrated while
    we slept.
    
    Fixes: 668c9beb9020 ("sctp: implement assign_number for sctp_stream_interleave")
    Signed-off-by: Zhenghang Xiao <kipreyyy@gmail.com>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260527032411.60959-1-kipreyyy@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

sctp: fix uninit-value in __sctp_rcv_asconf_lookup() [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Mon Jun 8 08:22:34 2026 -0400

    sctp: fix uninit-value in __sctp_rcv_asconf_lookup()
    
    [ Upstream commit f8373d7090b745728de66308deeecc67e8d319ce ]
    
    __sctp_rcv_asconf_lookup() in net/sctp/input.c only checks that the ASCONF
    chunk can hold the ADDIP header and a parameter header, then calls
    af->from_addr_param(), which reads the full address (16 bytes for IPv6)
    trusting the parameter's declared length.
    
    An unauthenticated peer can send a truncated trailing ASCONF chunk that
    declares an IPv6 address parameter but stops after the 4-byte parameter
    header; reached from the no-association lookup path, from_addr_param() then
    reads uninitialized bytes past the parameter.
    
    Impact: an unauthenticated SCTP peer makes the receive path read up to 16
    bytes of uninitialized memory past a truncated ASCONF address parameter.
    
    The sibling __sctp_rcv_init_lookup() bounds parameters with
    sctp_walk_params(); this path open-codes the fetch and omits the bound.
    Verify the whole address parameter lies within the chunk before
    from_addr_param() reads it, the same class of fix as commit 51e5ad549c43
    ("net: sctp: fix KMSAN uninit-value in sctp_inq_pop").
    
    Fixes: df2185771439 ("[SCTP]: Update association lookup to look at ASCONF chunks as well")
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/20260608122234.459098-1-michael.bommarito@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

sctp: purge outqueue on stale COOKIE-ECHO handling [+ + +]
Author: Xin Long <lucien.xin@gmail.com>
Date:   Wed Jun 3 14:11:44 2026 -0400

    sctp: purge outqueue on stale COOKIE-ECHO handling
    
    [ Upstream commit e374b22e9b07b72a25909621464ff74096151bfb ]
    
    sctp_stream_update() is only invoked when the association is moved into
    COOKIE_WAIT during association setup/reconfiguration. In this path, the
    outbound stream scheduler state (stream->out_curr) is expected to be
    clean, since no user data should have been transmitted yet unless the
    state machine has already partially progressed.
    
    However, a corner case exists in sctp_sf_do_5_2_6_stale(): when a
    Stale Cookie ERROR is received, the association is rolled back from
    COOKIE_ECHOED to COOKIE_WAIT. In this scenario, user data may already
    have been queued and even bundled with the COOKIE-ECHO chunk.
    
    During the rollback, sctp_stream_update() frees the old stream table
    and installs a new one, but it does not invalidate stream->out_curr.
    As a result, out_curr may still point to a freed sctp_stream_out
    entry from the previous stream state.
    
    Later, SCTP scheduler dequeue paths (FCFS, RR, PRIO, etc.) rely on
    stream->out_curr->ext, which can lead to use-after-free once the old
    stream state has been released via sctp_stream_free().
    
    This results in crashes such as (reported by Yuqi):
    
      BUG: KASAN: slab-use-after-free in sctp_sched_fcfs_dequeue+0x13a/0x140
      Read of size 8 at addr ff1100004d4d3208 by task mini_poc/9312
      CPU: 1 UID: 1001 PID: 9312 Comm: mini_poc Not tainted
         7.1.0-rc1-00305-gbd3a4795d574 #5 PREEMPT(full)
       sctp_sched_fcfs_dequeue+0x13a/0x140
       sctp_outq_flush+0x1603/0x33e0
       sctp_do_sm+0x31c9/0x5d30
       sctp_assoc_bh_rcv+0x392/0x6f0
       sctp_inq_push+0x1db/0x270
       sctp_rcv+0x138d/0x3c10
    
    Fix this by fully purging the association outqueue when handling the
    Stale Cookie case. This ensures all pending transmit and retransmit
    state is dropped, and any scheduler cached pointers are invalidated,
    making it safe to rebuild stream state during COOKIE_WAIT restart.
    
    Updating only stream->out_curr would be insufficient, since queued
    and retransmittable data would still reference the old stream state and
    trigger later use-after-free in dequeue paths.
    
    Fixes: 5bbbbe32a431 ("sctp: introduce stream scheduler foundations")
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Reported-by: Yuqi Xu <xuyq21@lenovo.com>
    Reported-by: Ren Wei <n05ec@lzu.edu.cn>
    Signed-off-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/94318159b9052907a6cbb7256aee8b5f8dfbfccb.1780510304.git.lucien.xin@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

sctp: stream: fully roll back denied add-stream state [+ + +]
Author: Wyatt Feng <bronzed_45_vested@icloud.com>
Date:   Fri Jun 5 13:53:42 2026 +0800

    sctp: stream: fully roll back denied add-stream state
    
    commit a5f8a90ac9f77c678a9781c0a464b635e0d63e49 upstream.
    
    When ADD_OUT_STREAMS is denied, SCTP only shrinks the queued chunks and
    then lowers outcnt. That leaves removed stream metadata behind, so a
    later re-add can reuse a stale ext and hit a null-pointer dereference in
    the scheduler get path.
    
    Fix the rollback by tearing down the removed stream state the same way
    other stream resizes do. Unschedule the current scheduler state, drop
    the removed stream ext state with sctp_stream_outq_migrate(), and then
    reschedule the remaining streams.
    
    This keeps scheduler-private RR/FC/PRIO lists consistent while fully
    rolling back denied outgoing stream additions.
    
    Fixes: 637784ade221 ("sctp: introduce priority based stream scheduler")
    Cc: stable@kernel.org
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Signed-off-by: Wyatt Feng <bronzed_45_vested@icloud.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Acked-by: Xin Long <lucien.xin@gmail.com>
    Link: https://patch.msgid.link/d78954ecd94954653ee299400e98d74a03a6f7d3.1780603399.git.bronzed_45_vested@icloud.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
selftests/bpf: add generic BPF program tester-loader [+ + +]
Author: Andrii Nakryiko <andrii@kernel.org>
Date:   Tue Jun 2 21:39:58 2026 +0200

    selftests/bpf: add generic BPF program tester-loader
    
    [ Upstream commit 537c3f66eac137a02ec50a40219d2da6597e5dc9 ]
    
    It's become a common pattern to have a collection of small BPF programs
    in one BPF object file, each representing one test case. On user-space
    side of such tests we maintain a table of program names and expected
    failure or success, along with optional expected verifier log message.
    
    This works, but each set of tests reimplement this mundane code over and
    over again, which is a waste of time for anyone trying to add a new set
    of tests. Furthermore, it's quite error prone as it's way too easy to miss
    some entries in these manually maintained test tables (as evidences by
    dynptr_fail tests, in which ringbuf_release_uninit_dynptr subtest was
    accidentally missed; this is fixed in next patch).
    
    So this patch implements generic test_loader, which accepts skeleton
    name and handles the rest of details: opens and loads BPF object file,
    making sure each program is tested in isolation. Optionally each test
    case can specify expected BPF verifier log message. In case of failure,
    tester makes sure to report verifier log, but it also reports verifier
    log in verbose mode unconditionally.
    
    Now, the interesting deviation from existing custom implementations is
    the use of btf_decl_tag attribute to specify expected-to-fail vs
    expected-to-succeed markers and, optionally, expected log message
    directly next to BPF program source code, eliminating the need to
    manually create and update table of tests.
    
    We define few macros wrapping btf_decl_tag with a convention that all
    values of btf_decl_tag start with "comment:" prefix, and then utilizing
    a very simple "just_some_text_tag" or "some_key_name=<value>" pattern to
    define things like expected success/failure, expected verifier message,
    extra verifier log level (if necessary). This approach is demonstrated
    by next patch in which two existing sets of failure tests are converted.
    
    Tester supports both expected-to-fail and expected-to-succeed programs,
    though this patch set didn't convert any existing expected-to-succeed
    programs yet, as existing tests couple BPF program loading with their
    further execution through attach or test_prog_run. One way to allow
    testing scenarios like this would be ability to specify custom callback,
    executed for each successfully loaded BPF program. This is left for
    follow up patches, after some more analysis of existing test cases.
    
    This test_loader is, hopefully, a start of a test_verifier-like runner,
    but integrated into test_progs infrastructure. It will allow much better
    "user experience" of defining low-level verification tests that can take
    advantage of all the libbpf-provided nicety features on BPF side: global
    variables, declarative maps, etc.  All while having a choice of defining
    it in C or as BPF assembly (through __attribute__((naked)) functions and
    using embedded asm), depending on what makes most sense in each
    particular case. This will be explored in follow up patches as well.
    
    Acked-by: John Fastabend <john.fastabend@gmail.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/r/20221207201648.2990661-1-andrii@kernel.org
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Stable-dep-of: 95ebb376176c ("selftests/bpf: Convert test_global_funcs test to test_loader framework")
    [ Note: Minor conflict in Makefile. ]
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

selftests/bpf: Add read_build_id function [+ + +]
Author: Jiri Olsa <jolsa@kernel.org>
Date:   Tue Jun 2 21:41:07 2026 +0200

    selftests/bpf: Add read_build_id function
    
    [ Upstream commit 88dc8b3605b38a440fba45edcc53a6c7a98eee3b ]
    
    Adding read_build_id function that parses out build id from
    specified binary.
    
    It will replace extract_build_id and also be used in following
    changes.
    
    Signed-off-by: Jiri Olsa <jolsa@kernel.org>
    Link: https://lore.kernel.org/r/20230331093157.1749137-3-jolsa@kernel.org
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Fixes: be4e85369e5a ("selftests/bpf: Replace extract_build_id with read_build_id")
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

selftests/bpf: Convert test_global_funcs test to test_loader framework [+ + +]
Author: Andrii Nakryiko <andrii@kernel.org>
Date:   Tue Jun 2 21:40:40 2026 +0200

    selftests/bpf: Convert test_global_funcs test to test_loader framework
    
    [ Upstream commit 95ebb376176c52382293e05e63f142114a5e40ef ]
    
    Convert 17 test_global_funcs subtests into test_loader framework for
    easier maintenance and more declarative way to define expected
    failures/successes.
    
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Stanislav Fomichev <sdf@google.com>
    Link: https://lore.kernel.org/bpf/20230216045954.3002473-3-andrii@kernel.org
    Fixes: bbac91d57ac2 ("bpf: Allow reads from uninit stack")
    [ Notes: This backport fixes backport commit bbac91d57ac2 ("bpf: Allow
      reads from uninit stack"), which broke the BPF selftest build. A minor
      conflict needed resolution in test_global_func10.c on the error
      message. ]
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

selftests/bpf: enhance align selftest's expected log matching [+ + +]
Author: Andrii Nakryiko <andrii@kernel.org>
Date:   Tue Jun 2 21:41:34 2026 +0200

    selftests/bpf: enhance align selftest's expected log matching
    
    [ Upstream commit 6f876e75d316a75957f3d43c3a8c2a6fe9bc18b2 ]
    
    Allow to search for expected register state in all the verifier log
    output that's related to specified instruction number.
    
    See added comment for an example of possible situation that is happening
    due to a simple enhancement done in the next patch, which fixes handling
    of env->test_state_freq flag in state checkpointing logic.
    
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/r/20230302235015.2044271-4-andrii@kernel.org
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    [ Note: Backport needed to fix the align selftest where some of the
      expected log messages can't be found. This is happening because
      commit 1a8a315f008a ("bpf: Ensure proper register state printing for
      cond jumps") was also backported to 6.1. ]
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

selftests/bpf: Fix ARG_PTR_TO_LONG {half-,}uninitialized test [+ + +]
Author: Daniel Borkmann <daniel@iogearbox.net>
Date:   Tue Jun 2 21:41:55 2026 +0200

    selftests/bpf: Fix ARG_PTR_TO_LONG {half-,}uninitialized test
    
    [ Upstream commit b8e188f023e07a733b47d5865311ade51878fe40 ]
    
    The assumption of 'in privileged mode reads from uninitialized stack locations
    are permitted' is not quite correct since the verifier was probing for read
    access rather than write access. Both tests need to be annotated as __success
    for privileged and unprivileged.
    
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Acked-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/r/20240913191754.13290-6-daniel@iogearbox.net
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    [ Note: The format of logs completely changed since 6.1 so this change
      had to be reapplied to the old test file. This commit needs to be
      backported because it fixes a test broken by commit 32556ce93bc4
      ("bpf: Fix helper writes to read-only maps") from the same patchset. ]
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

selftests/bpf: Fix bpf_nf selftest failure [+ + +]
Author: Saket Kumar Bhaskar <skb99@linux.ibm.com>
Date:   Wed Apr 9 15:26:33 2025 +0530

    selftests/bpf: Fix bpf_nf selftest failure
    
    commit 967e8def1100cb4b08c28a54d27ce69563fdf281 upstream.
    
    For systems with missing iptables-legacy tool this selftest fails.
    
    Add check to find if iptables-legacy tool is available and skip the
    test if the tool is missing.
    
    Fixes: de9c8d848d90 ("selftests/bpf: S/iptables/iptables-legacy/ in the bpf_nf and xdp_synproxy test")
    Signed-off-by: Saket Kumar Bhaskar <skb99@linux.ibm.com>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Link: https://lore.kernel.org/bpf/20250409095633.33653-1-skb99@linux.ibm.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

selftests/bpf: S/iptables/iptables-legacy/ in the bpf_nf and xdp_synproxy test [+ + +]
Author: Martin KaFai Lau <martin.lau@kernel.org>
Date:   Tue Jun 2 21:42:04 2026 +0200

    selftests/bpf: S/iptables/iptables-legacy/ in the bpf_nf and xdp_synproxy test
    
    [ Upstream commit de9c8d848d90cf2e53aced50b350827442ca5a4f ]
    
    The recent vm image in CI has reported error in selftests that use
    the iptables command.  Manu Bretelle has pointed out the difference
    in the recent vm image that the iptables is sym-linked to the iptables-nft.
    With this knowledge,  I can also reproduce the CI error by manually running
    with the 'iptables-nft'.
    
    This patch is to replace the iptables command with iptables-legacy
    to unblock the CI tests.
    
    Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
    Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
    Acked-by: David Vernet <void@manifault.com>
    Link: https://lore.kernel.org/bpf/20221012221235.3529719-1-martin.lau@linux.dev
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

selftests/bpf: Update bpf_clone_redirect expected return code [+ + +]
Author: Stanislav Fomichev <sdf@fomichev.me>
Date:   Tue Jun 2 21:41:25 2026 +0200

    selftests/bpf: Update bpf_clone_redirect expected return code
    
    [ Upstream commit b772b70b69046c5b76e3f2eda680f692dee5e6d5 ]
    
    Commit 151e887d8ff9 ("veth: Fixing transmit return status for dropped
    packets") started propagating proper NET_XMIT_DROP error to the caller
    which means it's now possible to get positive error code when calling
    bpf_clone_redirect() in this particular test. Update the test to reflect
    that.
    
    Reported-by: Daniel Borkmann <daniel@iogearbox.net>
    Signed-off-by: Stanislav Fomichev <sdf@google.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Link: https://lore.kernel.org/bpf/20230911194731.286342-2-sdf@google.com
    [ Note: Commit 151e887d8ff9 was backported to 6.1 so this fix should be
      as well. ]
    Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
    Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
selftests: forwarding: lib: Add helpers for checksum handling [+ + +]
Author: Petr Machata <petrm@nvidia.com>
Date:   Thu May 28 13:33:34 2026 +0200

    selftests: forwarding: lib: Add helpers for checksum handling
    
    commit 952e0ee38c7215c45192d8c899acd1830873f28b upstream.
    
    In order to generate IGMPv3 and MLDv2 packets on the fly, we will need
    helpers to calculate the packet checksum.
    
    The approach presented in this patch revolves around payload templates
    for mausezahn. These are mausezahn-like payload strings (01:23:45:...)
    with possibly one 2-byte sequence replaced with the word PAYLOAD. The
    main function is payload_template_calc_checksum(), which calculates
    RFC 1071 checksum of the message. There are further helpers to then
    convert the checksum to the payload format, and to expand it.
    
    For IPv6, MLDv2 message checksum is computed using a pseudoheader that
    differs from the header used in the payload itself. The fact that the
    two messages are different means that the checksum needs to be
    returned as a separate quantity, instead of being expanded in-place in
    the payload itself. Furthermore, the pseudoheader includes a length of
    the message. Much like the checksum, this needs to be expanded in
    mausezahn format. And likewise for number of addresses for (S,G)
    entries. Thus we have several places where a computed quantity needs
    to be presented in the payload format. Add a helper u16_to_bytes(),
    which will be used in all these cases.
    
    Signed-off-by: Petr Machata <petrm@nvidia.com>
    Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Stable-dep-of: 02cb2e6bacbb ("selftests: forwarding: vxlan_bridge_1d: fix test failure with br_netfilter enabled")
    [bwh: Backported to 6,1: adjust context]
    Signed-off-by: Ben Hutchings <benh@debian.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

selftests: mptcp: drop nanoseconds width specifier [+ + +]
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Date:   Sat May 30 10:28:35 2026 -0400

    selftests: mptcp: drop nanoseconds width specifier
    
    [ Upstream commit 01ff78e4b3d98689184c52d97f9575dfbdc3b10f ]
    
    Using the format specifier +%s%3N with GNU date is honoured, and only
    prints 3 digits of the nanoseconds portion of the seconds since epoch,
    which corresponds to the milliseconds.
    
    The uutils implementation of date currently does not honour this, and
    always prints all 9 digits. This is a known issue [1], but can be worked
    around by adapting this test to use nanoseconds instead of microseconds,
    and then divide it by 1e6.
    
    This fix is similar to what has been done on systemd side [2], and it is
    needed to run the selftests on Ubuntu 26.04, containing uutils 0.8.0.
    
    Note that the Fixes tag is there even if this patch doesn't fix an issue
    in the kernel selftests, but it is useful for those using uutils 0.8.0.
    
    Fixes: 048d19d444be ("mptcp: add basic kselftest for mptcp")
    Cc: stable@vger.kernel.org
    Link: https://github.com/uutils/coreutils/issues/11658 [1]
    Link: https://github.com/systemd/systemd/pull/41627 [2]
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20260515-net-mptcp-misc-fixes-7-1-rc4-v2-6-701e96419f2f@kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
serial: altera_jtaguart: handle uart_add_one_port() failures [+ + +]
Author: Myeonghun Pak <mhun512@gmail.com>
Date:   Tue May 12 15:56:57 2026 +0900

    serial: altera_jtaguart: handle uart_add_one_port() failures
    
    commit ea66be25f0e934f49d24cd0c5845d13cdba3520b upstream.
    
    altera_jtaguart_probe() maps the register window before registering the
    UART port, but it ignores failures from uart_add_one_port(). If port
    registration fails, probe still returns success and the mapping remains
    live until a later remove path that is not part of probe failure cleanup.
    
    Return the uart_add_one_port() error and unmap the register window on
    that failure path.
    
    This issue was identified during our ongoing static-analysis research while
    reviewing kernel code.
    
    Fixes: 5bcd601049c6 ("serial: Add driver for the Altera JTAG UART")
    Cc: stable <stable@kernel.org>
    Co-developed-by: Ijae Kim <ae878000@gmail.com>
    Signed-off-by: Ijae Kim <ae878000@gmail.com>
    Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
    Link: https://patch.msgid.link/20260512065837.79528-1-mhun512@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

serial: dz: Fix bootconsole handover lockup [+ + +]
Author: Maciej W. Rozycki <macro@orcam.me.uk>
Date:   Fri Jun 5 04:07:17 2026 +0100

    serial: dz: Fix bootconsole handover lockup
    
    commit 7f127b2208e5e2b817243cad41fe4211a6d5a7a3 upstream.
    
    Calling dz_reset() in the course of setting up the serial device causes
    line parameters to be reset and the transmitter disabled.  We've been
    lucky in that no message is usually produced to the kernel log between
    this call and the later call to uart_set_options() in the course of
    console setup done by dz_serial_console_init(), or the system would hang
    as the console output handler in the firmware tried to access a port the
    transmitter of which has been disabled and line parameters messed up.
    
    This will change with the next change to the driver, so fix dz_reset()
    such that line parameters are set for 9600n8 console operation as with
    the system firmware and the transmitter re-enabled after reset.  This
    also means dz_pm() serves no purpose anymore, so drop it.
    
    Fixes: e6ee512f5a77 ("dz.c: Resource management")
    Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
    Cc: stable@vger.kernel.org # v2.6.25+
    Link: https://patch.msgid.link/alpine.DEB.2.21.2605062302010.46195@angie.orcam.me.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

serial: dz: Fix bootconsole message clobbering at chip reset [+ + +]
Author: Maciej W. Rozycki <macro@orcam.me.uk>
Date:   Wed May 6 23:42:31 2026 +0100

    serial: dz: Fix bootconsole message clobbering at chip reset
    
    commit ca904f4b42355287bc5ce8b7550ebe909cda4c2c upstream.
    
    In the DZ interface as implemented by the DC7085 gate array the serial
    transmitters are double buffered, meaning that at the time a transmitter
    is ready to accept the next character there is one in the transmit shift
    register still being sent to the line.  Issuing a master clear at this
    time causes this character to be lost, so wait an extra amount of time
    sufficient for the transmit shift register to drain at 9600bps, which is
    the baud rate setting used by the firmware console.
    
    Mind the specified 1.4us TRDY recovery time in the course and continue
    using iob() as the completion barrier, since the platforms involved use
    a write buffer that can delay and combine writes, and reorder them with
    respect to reads regardless of the MMIO locations accessed and we still
    lack a platform-independent handler for that.
    
    When called from dz_serial_console_init() this is too early for fsleep()
    to work and even before lpj has been calculated and therefore the delay
    is actually not sufficient for the transmitter to drain and is merely a
    placeholder now.  This will be addressed in a follow-up change.
    
    Fixes: e6ee512f5a77 ("dz.c: Resource management")
    Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
    Cc: stable@vger.kernel.org # v2.6.25+
    Link: https://patch.msgid.link/alpine.DEB.2.21.2605062259080.46195@angie.orcam.me.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

serial: fsl_lpuart: fix rx buffer and DMA map leaks in start_rx_dma [+ + +]
Author: Shitalkumar Gandhi <shital.gandhi45@gmail.com>
Date:   Mon Apr 20 19:29:03 2026 +0530

    serial: fsl_lpuart: fix rx buffer and DMA map leaks in start_rx_dma
    
    commit 9a9254c4a2a3ca2b3da16d173f3b0dd01f397ff6 upstream.
    
    lpuart_start_rx_dma() allocates sport->rx_ring.buf with kzalloc() and
    then maps a scatterlist via dma_map_sg().  On three subsequent error
    paths the function returns directly without releasing those resources:
    
      - when dma_map_sg() returns 0 (-EINVAL):
          ring->buf is leaked.
      - when dmaengine_slave_config() fails:
          ring->buf and the DMA mapping are leaked.
      - when dmaengine_prep_dma_cyclic() returns NULL:
          ring->buf and the DMA mapping are leaked.
    
    The sole cleanup path, lpuart_dma_rx_free(), is only reached when
    lpuart_dma_rx_use is set, and the caller lpuart_rx_dma_startup() clears
    that flag on failure of lpuart_start_rx_dma().  So these resources are
    permanently leaked on every failure in this function.  Repeated port
    open/close or termios changes under error conditions will slowly consume
    memory and leave stale streaming DMA mappings behind.
    
    Fix it by introducing two error labels that unmap the scatterlist and
    free the ring buffer as appropriate.  While here, replace the misleading
    -EFAULT (bad userspace pointer) returned when dmaengine_prep_dma_cyclic()
    fails with the more accurate -ENOMEM, matching how other dmaengine users
    in the tree treat this failure.
    
    No functional change on the success path.
    
    Fixes: 5887ad43ee02 ("tty: serial: fsl_lpuart: Use cyclic DMA for Rx")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Shitalkumar Gandhi <shitalkumar.gandhi@cambiumnetworks.com>
    Reviewed-by: Frank Li <Frank.Li@nxp.com>
    Link: https://patch.msgid.link/20260420135903.2062024-1-shitalkumar.gandhi@cambiumnetworks.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

serial: qcom-geni: fix UART_RX_PAR_EN bit position [+ + +]
Author: Prasanna S <prasanna.s@oss.qualcomm.com>
Date:   Fri Jun 5 22:47:09 2026 -0400

    serial: qcom-geni: fix UART_RX_PAR_EN bit position
    
    [ Upstream commit ca2584d841b69391ffc4144840563d2e1a0018df ]
    
    UART_RX_PAR_EN is incorrectly defined as bit 3, which triggers false
    framing errors (S_GP_IRQ_1_EN) and causes received data to be dropped
    when parity is enabled and the parity bit is 0.
    
    Define UART_RX_PAR_EN as bit 4 of the SE_UART_RX_TRANS_CFG register, as
    specified in the reference manual.
    
    Fixes: c4f528795d1a ("tty: serial: msm_geni_serial: Add serial driver support for GENI based QUP")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Prasanna S <prasanna.s@oss.qualcomm.com>
    Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260428-serial-bit-correct-v1-1-9131ad5b97d8@oss.qualcomm.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

serial: samsung_tty: Use port lock wrappers [+ + +]
Author: Thomas Gleixner <tglx@kernel.org>
Date:   Fri Jun 5 11:31:02 2026 -0400

    serial: samsung_tty: Use port lock wrappers
    
    [ Upstream commit 97d7a9aeba1d424c2359f1686d02c75d798ad184 ]
    
    When a serial port is used for kernel console output, then all
    modifications to the UART registers which are done from other contexts,
    e.g. getty, termios, are interference points for the kernel console.
    
    So far this has been ignored and the printk output is based on the
    principle of hope. The rework of the console infrastructure which aims to
    support threaded and atomic consoles, requires to mark sections which
    modify the UART registers as unsafe. This allows the atomic write function
    to make informed decisions and eventually to restore operational state. It
    also allows to prevent the regular UART code from modifying UART registers
    while printk output is in progress.
    
    All modifications of UART registers are guarded by the UART port lock,
    which provides an obvious synchronization point with the console
    infrastructure.
    
    To avoid adding this functionality to all UART drivers, wrap the
    spin_[un]lock*() invocations for uart_port::lock into helper functions
    which just contain the spin_[un]lock*() invocations for now. In a
    subsequent step these helpers will gain the console synchronization
    mechanisms.
    
    Converted with coccinelle. No functional change.
    
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: John Ogness <john.ogness@linutronix.de>
    Link: https://lore.kernel.org/r/20230914183831.587273-54-john.ogness@linutronix.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Stable-dep-of: a3bb136bff5e ("tty: serial: samsung: Remove redundant port lock acquisition in rx helpers")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

serial: sh-sci: fix memory region release in error path [+ + +]
Author: Hongling Zeng <zenghongling@kylinos.cn>
Date:   Tue Apr 21 14:57:37 2026 +0800

    serial: sh-sci: fix memory region release in error path
    
    commit 92b1ea22454b08a39baef3a7290fb3ec50366616 upstream.
    
    The sci_request_port() function uses request_mem_region() to reserve
    I/O memory, but in the error path when sci_remap_port() fails, it
    incorrectly calls release_resource() instead of release_mem_region().
    
    This mismatch can cause resource accounting issues. Fix it by using
    the correct release function, consistent with sci_release_port().
    
    Fixes: e2651647080930a1 ("serial: sh-sci: Handle port memory region reservations.")
    Cc: stable <stable@kernel.org>
    Reported-by: kernel test robot <lkp@intel.com>
    Reported-by: Dan Carpenter <error27@gmail.com>
    Closes: https://lore.kernel.org/r/202604032356.SzEjYkBC-lkp@intel.com/
    Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
    Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
    Link: https://patch.msgid.link/20260421065737.724187-1-zenghongling@kylinos.cn
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

serial: zs: Fix bootconsole handover lockup [+ + +]
Author: Maciej W. Rozycki <macro@orcam.me.uk>
Date:   Wed May 6 23:42:39 2026 +0100

    serial: zs: Fix bootconsole handover lockup
    
    commit 6c05cf72e13314ce9b770b5951695dc5a2152920 upstream.
    
    Calling zs_reset() in the course of setting up the serial device causes
    line parameters to be reset and the transmitter disabled.  We've been
    lucky in that no message is usually produced to the kernel log between
    this call and the later call to uart_set_options() in the course of
    console setup done by zs_serial_console_init(), or the system would hang
    as the console output handler in the firmware tried to access a port the
    transmitter of which has been disabled and line parameters messed up.
    
    This will change with the next change to the driver, so fix zs_reset()
    such that line parameters are set for 9600n8 console operation as with
    the system firmware and the transmitter re-enabled after reset.  This
    also means zs_pm() serves no purpose anymore, so drop it.
    
    Fixes: 8b4a40809e53 ("zs: move to the serial subsystem")
    Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
    Cc: stable@vger.kernel.org # v2.6.23+
    Link: https://patch.msgid.link/alpine.DEB.2.21.2605062308040.46195@angie.orcam.me.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

serial: zs: Fix swapped RI/DSR modem line transition counting [+ + +]
Author: Maciej W. Rozycki <macro@orcam.me.uk>
Date:   Fri Apr 10 18:19:31 2026 +0100

    serial: zs: Fix swapped RI/DSR modem line transition counting
    
    commit d15cd40cb1858f75846eaafa9a6bca841b790a92 upstream.
    
    Fix a thinko in the status interrupt handler that has caused counters
    for the RI and DSR modem line transitions to be used for the other line
    each.
    
    Fixes: 8b4a40809e53 ("zs: move to the serial subsystem")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
    Link: https://patch.msgid.link/alpine.DEB.2.21.2604101747110.29980@angie.orcam.me.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

serial: zs: Switch to using channel reset [+ + +]
Author: Maciej W. Rozycki <macro@orcam.me.uk>
Date:   Wed May 6 23:42:43 2026 +0100

    serial: zs: Switch to using channel reset
    
    commit 8572955630f30948837088aa98bcbe0532d1ceac upstream.
    
    Switch the driver to using the channel reset rather than hardware reset,
    simplifying handling by removing an interference between channels that
    causes the other channel to become uninitialised afterwards.
    
    There is little difference between the two kinds of reset in terms of
    register settings that result, and we initialise the whole register set
    right away anyway.  However this prevents a hang from happening should
    the console output handler in the firmware try to access the other port
    whose transmitter has been disabled and line parameters messed up.
    
    For example this will happen if the keyboard port (port A) is chosen for
    the system console, unusually but not insanely for a headless system, as
    the port is wired to a standard DA-15 connector and an adapter can be
    easily made.  Or with the next change in place this would happen for the
    regular console port (port B), since the keyboard port (port A) will be
    initialised first.
    
    Just remove the unnecessary complication then, a channel reset is good
    enough.  We still need the initialisation marker, now per channel rather
    than per SCC, as for the console port zs_reset() will be called twice:
    once early on via zs_serial_console_init() for the console setup only,
    and then again via zs_config_port() as the port is associated with a TTY
    device.
    
    Fixes: 8b4a40809e53 ("zs: move to the serial subsystem")
    Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
    Cc: stable@vger.kernel.org # v2.6.23+
    Link: https://patch.msgid.link/alpine.DEB.2.21.2605062323430.46195@angie.orcam.me.uk
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
signal: clear JOBCTL_PENDING_MASK for caller in zap_other_threads() [+ + +]
Author: Aleksandr Nogikh <nogikh@google.com>
Date:   Thu May 21 16:22:40 2026 +0200

    signal: clear JOBCTL_PENDING_MASK for caller in zap_other_threads()
    
    [ Upstream commit 90918794a4e2c3b440f8fcf3847765a8b1d81b25 ]
    
    When a multi-threaded process receives a stop signal (e.g., SIGSTOP),
    do_signal_stop() sets JOBCTL_STOP_PENDING and JOBCTL_STOP_CONSUME on all
    threads and sets signal->group_stop_count to the number of threads. If
    one of the threads concurrently calls execve(), de_thread() invokes
    zap_other_threads() to kill all other threads. zap_other_threads()
    aborts the pending group stop by resetting signal->group_stop_count to 0
    and clears the JOBCTL_PENDING_MASK for all other threads. However, it
    fails to clear the job control flags for the calling thread.
    
    When execve() completes, the calling thread returns to user mode and
    checks for pending signals. Seeing the stale JOBCTL_STOP_PENDING flag,
    it calls do_signal_stop(), which invokes task_participate_group_stop().
    Since JOBCTL_STOP_CONSUME is still set, it attempts to decrement the
    already-zero signal->group_stop_count, triggering a warning:
    
    sig->group_stop_count == 0
    WARNING: CPU: 1 PID: 6475 at kernel/signal.c:373
    task_participate_group_stop+0x215/0x2d0
    Call Trace:
     <TASK>
     do_signal_stop+0x3be/0x5c0 kernel/signal.c:2619
     get_signal+0xa8c/0x1330 kernel/signal.c:2884
     arch_do_signal_or_restart+0xbc/0x840 arch/x86/kernel/signal.c:337
     exit_to_user_mode_loop+0x8c/0x4d0 kernel/entry/common.c:98
     do_syscall_64+0x33e/0xf80 arch/x86/entry/syscall_64.c:100
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
     </TASK>
    
    Fix this race condition by clearing the JOBCTL_PENDING_MASK for the
    calling thread in zap_other_threads(), ensuring it does not retain any
    stale job control state after the thread group is destroyed. This aligns
    with other functions that tear down a thread group and abort group
    stops, such as zap_process() and complete_signal(), which correctly
    clear these flags for all threads including the current one.
    
    Fixes: 39efa3ef3a37 ("signal: Use GROUP_STOP_PENDING to stop once for a single group stop")
    Assisted-by: Gemini:gemini-3.1-pro-preview Gemini:gemini-3-flash-preview syzbot
    Reported-by: syzbot+b109633ea805cac54a61@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=b109633ea805cac54a61
    Link: https://syzkaller.appspot.com/ai_job?id=d70208cc-862b-4fe3-bf02-3031e10cd0b3
    Signed-off-by: Aleksandr Nogikh <nogikh@google.com>
    Link: https://patch.msgid.link/20260521142240.2973022-1-nogikh@google.com
    Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
slimbus: qcom-ngd-ctrl: Avoid ABBA on tx_lock/ctrl->lock [+ + +]
Author: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Date:   Sat May 30 21:44:21 2026 +0100

    slimbus: qcom-ngd-ctrl: Avoid ABBA on tx_lock/ctrl->lock
    
    commit 55f2ea9ff83cc27a85526b14bc9b32f96a08d6ec upstream.
    
    During the SSR/PDR down notification the tx_lock is taken with the
    intent to provide synchronization with active DMA transfers.
    
    But during this period qcom_slim_ngd_down() is invoked, which ends up in
    slim_report_absent(), which takes the slim_controller lock. In multiple
    other codepaths these two locks are taken in the opposite order (i.e.
    slim_controller then tx_lock).
    
    The result is a lockdep splat, and a possible deadlock:
    
      rprocctl/449 is trying to acquire lock:
      ffff00009793e620 (&ctrl->lock){+.+.}-{4:4}, at: slim_report_absent (drivers/slimbus/core.c:322) slimbus
    
      but task is already holding lock:
      ffff00009793fb50 (&ctrl->tx_lock){+.+.}-{4:4}, at: qcom_slim_ngd_ssr_pdr_notify (drivers/slimbus/qcom-ngd-ctrl.c:1475) slim_qcom_ngd_ctrl
    
      which lock already depends on the new lock.
    
      Possible unsafe locking scenario:
    
            CPU0                    CPU1
            ----                    ----
       lock(&ctrl->tx_lock);
                                    lock(&ctrl->lock);
                                    lock(&ctrl->tx_lock);
       lock(&ctrl->lock);
    
    The assumption is that the comment refers to the desire to not call
    qcom_slim_ngd_exit_dma() while we have an ongoing DMA TX transaction.
    But any such transaction is initiated and completed within a single
    qcom_slim_ngd_xfer_msg().
    
    Prior to calling qcom_slim_ngd_exit_dma() the slim_controller is torn
    down, all child devices are notified that the slimbus is gone and the
    child devices are removed.
    
    Stop taking the tx_lock in qcom_slim_ngd_ssr_pdr_notify() to avoid the
    deadlock.
    
    Fixes: a899d324863a ("slimbus: qcom-ngd-ctrl: add Sub System Restart support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
    Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
    Link: https://patch.msgid.link/20260530204421.116824-9-srini@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

slimbus: qcom-ngd-ctrl: fix OF node refcount [+ + +]
Author: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Date:   Sat May 30 21:44:14 2026 +0100

    slimbus: qcom-ngd-ctrl: fix OF node refcount
    
    commit 120134fe75c6b0ae38f14eb8b548ad1e5761f912 upstream.
    
    Platform devices created with platform_device_alloc() call
    platform_device_release() when the last reference to the device's
    kobject is dropped. This function calls of_node_put() unconditionally.
    This works fine for devices created with platform_device_register_full()
    but users of the split approach (platform_device_alloc() +
    platform_device_add()) must bump the reference of the of_node they
    assign manually. Add the missing call to of_node_get().
    
    Cc: stable@vger.kernel.org
    Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver")
    Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
    Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
    Link: https://patch.msgid.link/20260530204421.116824-2-srini@kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
smb: client: require net admin for CIFS SWN netlink [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Fri May 29 13:06:10 2026 -0400

    smb: client: require net admin for CIFS SWN netlink
    
    [ Upstream commit d1ebfce2c1d161186a82e77590bf7da2ea1bce91 ]
    
    CIFS_GENL_CMD_SWN_NOTIFY is the userspace witness-notify command.  The
    intended sender is the cifs.witness helper, but the generic-netlink
    operation currently has no capability flag, so any local process can send
    RESOURCE_CHANGE or CLIENT_MOVE notifications to the in-kernel witness
    handler.
    
    The same family exposes CIFS_GENL_MCGRP_SWN without multicast-group
    capability flags.  Register messages sent to that group include the witness
    registration id and, for NTLM-authenticated mounts, the username, domain,
    and password attributes copied from the CIFS session.  An unprivileged
    local process should not be able to join that group and receive those
    messages.
    
    Require CAP_NET_ADMIN for incoming SWN_NOTIFY commands with
    GENL_ADMIN_PERM, and require CAP_NET_ADMIN over the network namespace for
    joining the SWN multicast group with GENL_MCAST_CAP_NET_ADMIN.  The
    cifs.witness service runs with the privileges needed for both operations.
    
    Fixes: fed979a7e082 ("cifs: Set witness notification handler for messages from userspace daemon")
    Cc: stable@vger.kernel.org
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

smb: client: Use FullSessionKey for AES-256 encryption key derivation [+ + +]
Author: Piyush Sachdeva <s.piyush1024@gmail.com>
Date:   Sun May 17 11:48:33 2026 -0400

    smb: client: Use FullSessionKey for AES-256 encryption key derivation
    
    [ Upstream commit 5be7a0cef3229fb3b63a07c0d289daf752545424 ]
    
    When Kerberos authentication is used with AES-256 encryption (AES-256-CCM
    or AES-256-GCM), the SMB3 encryption and decryption keys must be derived
    using the full session key (Session.FullSessionKey) rather than just the
    first 16 bytes (Session.SessionKey).
    
    Per MS-SMB2 section 3.2.5.3.1, when Connection.Dialect is "3.1.1" and
    Connection.CipherId is AES-256-CCM or AES-256-GCM, Session.FullSessionKey
    must be set to the full cryptographic key from the GSS authentication
    context. The encryption and decryption key derivation (SMBC2SCipherKey,
    SMBS2CCipherKey) must use this FullSessionKey as the KDF input. The
    signing key derivation continues to use Session.SessionKey (first 16
    bytes) in all cases.
    
    Previously, generate_key() hardcoded SMB2_NTLMV2_SESSKEY_SIZE (16) as the
    HMAC-SHA256 key input length for all derivations. When Kerberos with
    AES-256 provides a 32-byte session key, the KDF for encryption/decryption
    was using only the first 16 bytes, producing keys that did not match the
    server's, causing mount failures with sec=krb5 and require_gcm_256=1.
    
    Add a full_key_size parameter to generate_key() and pass the appropriate
    size from generate_smb3signingkey():
     - Signing: always SMB2_NTLMV2_SESSKEY_SIZE (16 bytes)
     - Encryption/Decryption: ses->auth_key.len when AES-256, otherwise 16
    
    Also fix cifs_dump_full_key() to report the actual session key length for
    AES-256 instead of hardcoded CIFS_SESS_KEY_SIZE, so that userspace tools
    like Wireshark receive the correct key for decryption.
    
    Cc: <stable@vger.kernel.org>
    Reviewed-by: Bharath SM <bharathsm@microsoft.com>
    Signed-off-by: Piyush Sachdeva <psachdeva@microsoft.com>
    Signed-off-by: Piyush Sachdeva <s.piyush1024@gmail.com>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    [ adapted upstream's void/hmac_sha256_init_usingrawkey-based generate_key() to 6.12's int-return crypto_shash_* form while threading full_key_size through all callers. ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

smb: client: validate dacloffset before building DACL pointers [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Fri May 15 17:36:00 2026 -0400

    smb: client: validate dacloffset before building DACL pointers
    
    [ Upstream commit f98b48151cc502ada59d9778f0112d21f2586ca3 ]
    
    parse_sec_desc(), build_sec_desc(), and the chown path in
    id_mode_to_cifs_acl() all add the server-supplied dacloffset to pntsd
    before proving a DACL header fits inside the returned security
    descriptor.
    
    On 32-bit builds a malicious server can return dacloffset near
    U32_MAX, wrap the derived DACL pointer below end_of_acl, and then slip
    past the later pointer-based bounds checks. build_sec_desc() and
    id_mode_to_cifs_acl() can then dereference DACL fields from the wrapped
    pointer in the chmod/chown rewrite paths.
    
    Validate dacloffset numerically before building any DACL pointer and
    reuse the same helper at the three DACL entry points.
    
    Fixes: bc3e9dd9d104 ("cifs: Change SIDs in ACEs while transferring file ownership.")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-6
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    [ renamed smb_ntsd/smb_acl structs to cifs_ntsd/cifs_acl and kept existing inline ACL size check instead of using missing validate_dacl() helper ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

smb: client: validate the whole DACL before rewriting it in cifsacl [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Fri Apr 24 19:46:38 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: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-6
    Assisted-by: Codex:gpt-5-4
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Steve French <stfrench@microsoft.com>
    [ renamed smb_acl/smb_ace/smb_sid/smb_ntsd to cifs_* and widened num_aces from u16 to u32 for 6.1's __le32 field ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
spi: Convert to SPI_CONTROLLER_HALF_DUPLEX [+ + +]
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date:   Wed May 13 14:20:14 2026 -0400

    spi: Convert to SPI_CONTROLLER_HALF_DUPLEX
    
    [ Upstream commit 7a2b552c8e0e5bb280558f6c120140f5f06323bc ]
    
    Convert the users under SPI subsystem to SPI_CONTROLLER_HALF_DUPLEX.
    
    Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Link: https://lore.kernel.org/r/20230710154932.68377-15-andriy.shevchenko@linux.intel.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 0c18a1bacbb1 ("spi: ti-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: fix resource leaks on device setup failure [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Mon May 4 11:02:09 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: stable@vger.kernel.org      # 5.13
    Cc: Saravana Kannan <saravanak@kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260410154907.129248-2-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    [ adjusted context ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: imx: Convert to platform remove callback returning void [+ + +]
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date:   Thu Apr 30 14:13:43 2026 -0400

    spi: imx: Convert to platform remove callback returning void
    
    [ Upstream commit 423e548127223d597bb65a149ebcb3c50ea08846 ]
    
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is (mostly) ignored
    and this typically results in resource leaks. To improve here there is a
    quest to make the remove callback return void. In the first step of this
    quest all drivers are converted to .remove_new() which already returns
    void.
    
    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.
    
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Link: https://lore.kernel.org/r/20230306065733.2170662-3-u.kleine-koenig@pengutronix.de
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 1c78c2002380 ("spi: imx: fix use-after-free on unbind")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: imx: fix use-after-free on unbind [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Apr 30 14:13:44 2026 -0400

    spi: imx: fix use-after-free on unbind
    
    [ Upstream commit 1c78c2002380a1fe31bfb01a3d5f29809e55a096 ]
    
    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: stable@vger.kernel.org      # 5.19
    Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260324082326.901043-2-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: lantiq-ssc: fix controller deregistration [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Wed May 20 10:28:08 2026 -0400

    spi: lantiq-ssc: fix controller deregistration
    
    [ Upstream commit b99206710d032c16b7f8b75e4bc18414d8e4b9f4 ]
    
    Make sure to deregister the controller before releasing underlying
    resources like clocks during driver unbind.
    
    Fixes: 17f84b793c01 ("spi: lantiq-ssc: add support for Lantiq SSC SPI controller")
    Cc: stable@vger.kernel.org      # 4.11
    Cc: Hauke Mehrtens <hauke@hauke-m.de>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260409120419.388546-17-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    [ adapted spi_controller/host naming to spi_master/master and preserved the int-returning remove() with trailing return 0 ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: microchip-core-qspi: Convert to platform remove callback returning void [+ + +]
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date:   Thu May 14 14:50:12 2026 -0400

    spi: microchip-core-qspi: Convert to platform remove callback returning void
    
    [ Upstream commit e4cf312d6db2941b8267de6e094312afc1b523ee ]
    
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is (mostly) ignored
    and this typically results in resource leaks. To improve here there is a
    quest to make the remove callback return void. In the first step of this
    quest all drivers are converted to .remove_new() which already returns
    void.
    
    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.
    
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
    Link: https://lore.kernel.org/r/20230303172041.2103336-37-u.kleine-koenig@pengutronix.de
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: e6464140d439 ("spi: microchip-core-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: microchip-core-qspi: fix controller deregistration [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu May 14 14:50:14 2026 -0400

    spi: microchip-core-qspi: fix controller deregistration
    
    [ Upstream commit e6464140d439f2d42f072eb422a5b1fec470c5a6 ]
    
    Make sure to deregister the controller before disabling underlying
    resources like interrupts during driver unbind.
    
    Fixes: 8596124c4c1b ("spi: microchip-core-qspi: Add support for microchip fpga qspi controllers")
    Cc: stable@vger.kernel.org      # 6.1
    Cc: Naga Sureshkumar Relli <nagasuresh.relli@microchip.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Acked-by: Conor Dooley <conor.dooley@microchip.com>
    Link: https://patch.msgid.link/20260409120419.388546-19-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: microchip-core-qspi: Use helper function devm_clk_get_enabled() [+ + +]
Author: Li Zetao <lizetao1@huawei.com>
Date:   Thu May 14 14:50:13 2026 -0400

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

spi: qup: fix error pointer deref after DMA setup failure [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Sun May 31 20:38:30 2026 -0400

    spi: qup: fix error pointer deref after DMA setup failure
    
    [ Upstream commit a7e8f3efd50a165ba0189f6dc57f7e51a7d149db ]
    
    The driver falls back to PIO mode if DMA setup fails during probe.
    
    Make sure to the clear the DMA channel pointers on setup failure to
    avoid dereferencing an error pointer (or attempting to release a channel
    a second time) on later probe errors or driver unbind.
    
    This issue was flagged by Sashiko when reviewing a devres allocation
    conversion patch.
    
    Fixes: 612762e82ae6 ("spi: qup: Add DMA capabilities")
    Link: https://sashiko.dev/#/patchset/20260505072909.618363-1-johan%40kernel.org?part=4
    Cc: stable@vger.kernel.org      # 4.1
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260512074334.914735-1-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: qup: switch to use modern name [+ + +]
Author: Yang Yingliang <yangyingliang@huawei.com>
Date:   Sun May 31 20:38:29 2026 -0400

    spi: qup: switch to use modern name
    
    [ Upstream commit 597442ff4f6226206b7cc28b86eb2be0ae9c6418 ]
    
    Change legacy name master to modern name host or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    Link: https://lore.kernel.org/r/20230818093154.1183529-10-yangyingliang@huawei.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: a7e8f3efd50a ("spi: qup: fix error pointer deref after DMA setup failure")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: s3c64xx: fix NULL-deref on driver unbind [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu May 14 01:20:32 2026 -0400

    spi: s3c64xx: fix NULL-deref on driver unbind
    
    [ Upstream commit 45daacbead8a009844bd5dba6cfa731332184d17 ]
    
    A change moving DMA channel allocation from probe() back to
    s3c64xx_spi_prepare_transfer() failed to remove the corresponding
    deallocation from remove().
    
    Drop the bogus DMA channel release from remove() to avoid triggering a
    NULL-pointer dereference on driver unbind.
    
    This issue was flagged by Sashiko when reviewing a controller
    deregistration fix.
    
    Fixes: f52b03c70744 ("spi: s3c64xx: requests spi-dma channel only during data transfer")
    Cc: stable@vger.kernel.org      # 6.0
    Cc: Adithya K V <adithya.kv@samsung.com>
    Link: https://sashiko.dev/#/patchset/20260410081757.503099-1-johan%40kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260410094925.518343-1-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: s3c64xx: Use devm_clk_get_enabled() [+ + +]
Author: Andi Shyti <andi.shyti@kernel.org>
Date:   Thu May 14 01:20:31 2026 -0400

    spi: s3c64xx: Use devm_clk_get_enabled()
    
    [ Upstream commit 20c475d21ed9326f7b1396c9bb8991b375cb6c50 ]
    
    Replace the tuple devm_clk_get()/clk_prepare_enable() with the
    single function devm_clk_get_enabled().
    
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/20230531205550.568340-1-andi.shyti@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 45daacbead8a ("spi: s3c64xx: fix NULL-deref on driver unbind")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: spi-ti-qspi: Convert to platform remove callback returning void [+ + +]
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date:   Wed May 13 14:20:15 2026 -0400

    spi: spi-ti-qspi: Convert to platform remove callback returning void
    
    [ Upstream commit 2f2802d1a59d79a3d00cb429841db502c2bbc3df ]
    
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is ignored (apart
    from emitting a warning) and this typically results in resource leaks.
    
    To improve here there is a quest to make the remove callback return
    void. In the first step of this quest all drivers are converted to
    .remove_new(), which already returns void. Eventually after all drivers
    are converted, .remove_new() will be renamed to .remove().
    
    Add an error message to the error path that returned an error before to
    replace the core's error message with more information. Apart from the
    different wording of the error message, this patch doesn't introduce a
    semantic difference.
    
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Link: https://lore.kernel.org/r/20231105172649.3738556-2-u.kleine-koenig@pengutronix.de
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 0c18a1bacbb1 ("spi: ti-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: spi-ti-qspi: switch to use modern name [+ + +]
Author: Yang Yingliang <yangyingliang@huawei.com>
Date:   Wed May 13 14:20:16 2026 -0400

    spi: spi-ti-qspi: switch to use modern name
    
    [ Upstream commit 9d93c8d97b4cdb5edddb4c5530881c90eecb7e44 ]
    
    Change legacy name master to modern name host or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    Link: https://msgid.link/r/20231128093031.3707034-16-yangyingliang@huawei.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 0c18a1bacbb1 ("spi: ti-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: spi-zynq: Do not check for 0 return after calling platform_get_irq() [+ + +]
Author: Ruan Jinjie <ruanjinjie@huawei.com>
Date:   Wed May 13 15:34:17 2026 -0400

    spi: spi-zynq: Do not check for 0 return after calling platform_get_irq()
    
    [ Upstream commit 3182d49aad5f1cd8acdcf7de0c5b651772edd32e ]
    
    It is not possible for platform_get_irq() to return 0. Use the
    return value from platform_get_irq().
    
    Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
    Link: https://lore.kernel.org/r/20230802094357.981100-1-ruanjinjie@huawei.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: c9c012706c9f ("spi: zynq-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: st-ssc4: fix controller deregistration [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Wed May 20 09:11:33 2026 -0400

    spi: st-ssc4: fix controller deregistration
    
    [ Upstream commit 19857374010d06ca6a2f7c2c53464122eb804df0 ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: 9e862375c542 ("spi: Add new driver for STMicroelectronics' SPI Controller")
    Cc: stable@vger.kernel.org      # 4.0
    Cc: Lee Jones <lee@kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260410081757.503099-18-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: st-ssc4: switch to use modern name [+ + +]
Author: Yang Yingliang <yangyingliang@huawei.com>
Date:   Wed May 20 09:11:32 2026 -0400

    spi: st-ssc4: switch to use modern name
    
    [ Upstream commit e6b7e64cb11966b26646a362677ca5a08481157e ]
    
    Change legacy name master/slave to modern name host/target or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    Link: https://msgid.link/r/20231128093031.3707034-4-yangyingliang@huawei.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 19857374010d ("spi: st-ssc4: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: sun4i: Convert to platform remove callback returning void [+ + +]
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date:   Wed May 13 13:44:59 2026 -0400

    spi: sun4i: Convert to platform remove callback returning void
    
    [ Upstream commit b7b949458ac391963e56ae354b73fee63016dcee ]
    
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is (mostly) ignored
    and this typically results in resource leaks. To improve here there is a
    quest to make the remove callback return void. In the first step of this
    quest all drivers are converted to .remove_new() which already returns
    void.
    
    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.
    
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Reviewed-by: Andre Przywara <andre.przywara@arm.com>
    Link: https://lore.kernel.org/r/20230303172041.2103336-75-u.kleine-koenig@pengutronix.de
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 42108a2f03e0 ("spi: sun4i: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: sun4i: fix controller deregistration [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Wed May 13 13:45:01 2026 -0400

    spi: sun4i: fix controller deregistration
    
    [ Upstream commit 42108a2f03e0fdeabe9d02d085bdb058baa1189f ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: b5f6517948cc ("spi: sunxi: Add Allwinner A10 SPI controller driver")
    Cc: stable@vger.kernel.org      # 3.15
    Cc: Maxime Ripard <mripard@kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260410081757.503099-19-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: sun4i: switch to use modern name [+ + +]
Author: Yang Yingliang <yangyingliang@huawei.com>
Date:   Wed May 13 13:45:00 2026 -0400

    spi: sun4i: switch to use modern name
    
    [ Upstream commit 6d232cc8a7e59af0c083319827541966a68817a0 ]
    
    Change legacy name master to modern name host or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    Link: https://msgid.link/r/20231128093031.3707034-7-yangyingliang@huawei.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 42108a2f03e0 ("spi: sun4i: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: sun6i: fix controller deregistration [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Wed May 13 23:10:51 2026 -0400

    spi: sun6i: fix controller deregistration
    
    [ Upstream commit d874a1c33aee0d88fb4ba2f8aeadaa9f1965209a ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: 3558fe900e8a ("spi: sunxi: Add Allwinner A31 SPI controller driver")
    Cc: stable@vger.kernel.org      # 3.15
    Cc: Maxime Ripard <mripard@kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260410081757.503099-20-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    [ renamed spi_controller APIs to spi_master equivalents and kept int return type for sun6i_spi_remove ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: syncuacer: fix controller deregistration [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Wed May 13 13:44:55 2026 -0400

    spi: syncuacer: fix controller deregistration
    
    [ Upstream commit 75d849c3452e9611de031db45b3149ba9a99035f ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: b0823ee35cf9 ("spi: Add spi driver for Socionext SynQuacer platform")
    Cc: stable@vger.kernel.org      # 5.3
    Cc: Masahisa Kojima <masahisa.kojima@linaro.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260410081757.503099-21-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: synquacer: Convert to platform remove callback returning void [+ + +]
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date:   Wed May 13 13:44:53 2026 -0400

    spi: synquacer: Convert to platform remove callback returning void
    
    [ Upstream commit 1972cdc47df737f5b90ac2132080004f5e413e91 ]
    
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is (mostly) ignored
    and this typically results in resource leaks. To improve here there is a
    quest to make the remove callback return void. In the first step of this
    quest all drivers are converted to .remove_new() which already returns
    void.
    
    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.
    
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Link: https://lore.kernel.org/r/20230303172041.2103336-78-u.kleine-koenig@pengutronix.de
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 75d849c3452e ("spi: syncuacer: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: synquacer: switch to use modern name [+ + +]
Author: Yang Yingliang <yangyingliang@huawei.com>
Date:   Wed May 13 13:44:54 2026 -0400

    spi: synquacer: switch to use modern name
    
    [ Upstream commit 3524d1b727a66712f02f92807219a3650e5cf910 ]
    
    Change legacy name master to modern name host or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    Link: https://msgid.link/r/20231128093031.3707034-10-yangyingliang@huawei.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 75d849c3452e ("spi: syncuacer: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: tegra114: fix controller deregistration [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu May 14 07:45:54 2026 -0400

    spi: tegra114: fix controller deregistration
    
    [ Upstream commit 9c9c27ff2058142d8f800de3186d6864184958de ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: 5c8096439600 ("spi: tegra114: use devm_spi_register_master()")
    Cc: stable@vger.kernel.org      # 3.13
    Cc: Jingoo Han <jg1.han@samsung.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260410081757.503099-22-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    [ renamed spi_controller/host APIs to spi_master/master equivalents and placed spi_master_put() before the existing return 0 in remove ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: tegra20-sflash: fix controller deregistration [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu May 14 07:46:26 2026 -0400

    spi: tegra20-sflash: fix controller deregistration
    
    [ Upstream commit ad7310e983327f939dd6c4e801eab13238992572 ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Fixes: f12f7318c44a ("spi: tegra20-sflash: use devm_spi_register_master()")
    Cc: stable@vger.kernel.org      # 3.13
    Cc: Jingoo Han <jg1.han@samsung.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260410081757.503099-23-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    [ renamed spi_controller/host APIs to spi_master/master equivalents and switched devm_spi_register_master to spi_register_master ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: ti-qspi: fix controller deregistration [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Wed May 13 14:20:17 2026 -0400

    spi: ti-qspi: fix controller deregistration
    
    [ Upstream commit 0c18a1bacbb1d8b8aa34d3d004a2cb8226c8b1ea ]
    
    Make sure to deregister the controller before disabling underlying
    resources like clocks during driver unbind.
    
    Note that the controller is suspended before disabling and releasing
    resources since commit 3ac066e2227c ("spi: spi-ti-qspi: Suspend the
    queue before removing the device") which avoids issues like unclocked
    accesses but prevents SPI device drivers from doing I/O during
    deregistration.
    
    Fixes: 3b3a80019ff1 ("spi: ti-qspi: one only one interrupt handler")
    Cc: stable@vger.kernel.org      # 3.13
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260410081757.503099-24-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: topcliff-pch: Convert to platform remove callback returning void [+ + +]
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date:   Fri May 15 07:45:14 2026 -0400

    spi: topcliff-pch: Convert to platform remove callback returning void
    
    [ Upstream commit b082694f18bdff807b42a3bccc62c3a524168f23 ]
    
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is (mostly) ignored
    and this typically results in resource leaks. To improve here there is a
    quest to make the remove callback return void. In the first step of this
    quest all drivers are converted to .remove_new() which already returns
    void.
    
    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.
    
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Link: https://lore.kernel.org/r/20230303172041.2103336-83-u.kleine-koenig@pengutronix.de
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 5d6f477d6fc0 ("spi: topcliff-pch: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: uniphier: Convert to platform remove callback returning void [+ + +]
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date:   Thu May 14 08:02:30 2026 -0400

    spi: uniphier: Convert to platform remove callback returning void
    
    [ Upstream commit 1b13d196d2813dadc1947940dbd4aaad6ae21c02 ]
    
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is (mostly) ignored
    and this typically results in resource leaks. To improve here there is a
    quest to make the remove callback return void. In the first step of this
    quest all drivers are converted to .remove_new() which already returns
    void.
    
    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.
    
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Link: https://lore.kernel.org/r/20230303172041.2103336-84-u.kleine-koenig@pengutronix.de
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 0245435f7772 ("spi: uniphier: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: uniphier: fix controller deregistration [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu May 14 08:02:33 2026 -0400

    spi: uniphier: fix controller deregistration
    
    [ Upstream commit 0245435f777264ac45945ed2f325dd095a41d1af ]
    
    Make sure to deregister the controller before releasing underlying
    resources like DMA during driver unbind.
    
    Note that clocks were also disabled before the recent commit
    fdca270f8f87 ("spi: uniphier: Simplify clock handling with
    devm_clk_get_enabled()").
    
    Fixes: 5ba155a4d4cc ("spi: add SPI controller driver for UniPhier SoC")
    Cc: stable@vger.kernel.org      # 4.19
    Cc: Keiji Hayashibara <hayashibara.keiji@socionext.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260410081757.503099-25-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: uniphier: Simplify clock handling with devm_clk_get_enabled() [+ + +]
Author: Pei Xiao <xiaopei01@kylinos.cn>
Date:   Thu May 14 08:02:32 2026 -0400

    spi: uniphier: Simplify clock handling with devm_clk_get_enabled()
    
    [ Upstream commit fdca270f8f87cae2eb5b619234b9dd11a863ce6b ]
    
    Replace devm_clk_get() followed by clk_prepare_enable() with
    devm_clk_get_enabled() for the clock. This removes the need for
    explicit clock enable and disable calls, as the managed API automatically
    handles clock disabling on device removal or probe failure.
    
    Remove the now-unnecessary clk_disable_unprepare() calls from the probe
    error path and the remove callback. Adjust error labels accordingly.
    
    Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
    Reviewed-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
    Link: https://patch.msgid.link/b2deeefd4ef1a4bce71116aabfcb7e81400f6d37.1775546948.git.xiaopei01@kylinos.cn
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 0245435f7772 ("spi: uniphier: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: uniphier: switch to use modern name [+ + +]
Author: Yang Yingliang <yangyingliang@huawei.com>
Date:   Thu May 14 08:02:31 2026 -0400

    spi: uniphier: switch to use modern name
    
    [ Upstream commit 4c2ee0991013ca8a32bb093a017d460204790112 ]
    
    Change legacy name master to modern name host or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    Link: https://msgid.link/r/20231128093031.3707034-19-yangyingliang@huawei.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: 0245435f7772 ("spi: uniphier: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: zynq-qspi: Convert to platform remove callback returning void [+ + +]
Author: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date:   Wed May 13 15:34:16 2026 -0400

    spi: zynq-qspi: Convert to platform remove callback returning void
    
    [ Upstream commit ae9084b6458d34ebf3e377d0407ebe513e41ac71 ]
    
    The .remove() callback for a platform driver returns an int which makes
    many driver authors wrongly assume it's possible to do error handling by
    returning an error code. However the value returned is (mostly) ignored
    and this typically results in resource leaks. To improve here there is a
    quest to make the remove callback return void. In the first step of this
    quest all drivers are converted to .remove_new() which already returns
    void.
    
    Trivially convert this driver from always returning zero in the remove
    callback to the void returning variant.
    
    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    Link: https://lore.kernel.org/r/20230303172041.2103336-87-u.kleine-koenig@pengutronix.de
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: c9c012706c9f ("spi: zynq-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: zynq-qspi: fix controller deregistration [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Wed May 13 15:34:20 2026 -0400

    spi: zynq-qspi: fix controller deregistration
    
    [ Upstream commit c9c012706c9fa8ca6d129a9161caf92ab625a3fd ]
    
    Make sure to deregister the controller before disabling it during driver
    unbind.
    
    Note that clocks were also disabled before the recent commit
    1f8fd9490e31 ("spi: zynq-qspi: Simplify clock handling with
    devm_clk_get_enabled()").
    
    Fixes: 67dca5e580f1 ("spi: spi-mem: Add support for Zynq QSPI controller")
    Cc: stable@vger.kernel.org      # 5.2: 8eb2fd00f65a
    Cc: stable@vger.kernel.org      # 5.2
    Cc: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://patch.msgid.link/20260410081757.503099-27-johan@kernel.org
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: zynq-qspi: Simplify clock handling with devm_clk_get_enabled() [+ + +]
Author: Pei Xiao <xiaopei01@kylinos.cn>
Date:   Wed May 13 15:34:19 2026 -0400

    spi: zynq-qspi: Simplify clock handling with devm_clk_get_enabled()
    
    [ Upstream commit 1f8fd9490e3184e9a2394df2e682901a1d57ce71 ]
    
    Replace devm_clk_get() followed by clk_prepare_enable() with
    devm_clk_get_enabled() for both "pclk" and "ref_clk". This removes
    the need for explicit clock enable and disable calls, as the managed
    API automatically disables the clocks on device removal or probe
    failure.
    
    Remove the now-unnecessary clk_disable_unprepare() calls from the
    probe error paths and the remove callback. Simplify error handling
    by jumping directly to the remove_ctlr label.
    
    Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
    Acked-by: Michal Simek <michal.simek@amd.com>
    Link: https://patch.msgid.link/24043625f89376da36feca2408f990a85be7ab36.1775555500.git.xiaopei01@kylinos.cn
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: c9c012706c9f ("spi: zynq-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

spi: zynq-qspi: switch to use modern name [+ + +]
Author: Yang Yingliang <yangyingliang@huawei.com>
Date:   Wed May 13 15:34:18 2026 -0400

    spi: zynq-qspi: switch to use modern name
    
    [ Upstream commit 178ebb0c505b0a35edb4fb2a0e23a1f29e1db14d ]
    
    Change legacy name master/slave to modern name host/target or controller.
    
    No functional changed.
    
    Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
    Link: https://msgid.link/r/20231128093031.3707034-24-yangyingliang@huawei.com
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Stable-dep-of: c9c012706c9f ("spi: zynq-qspi: fix controller deregistration")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tap: free page on error paths in tap_get_user_xdp() [+ + +]
Author: Weiming Shi <bestswngs@gmail.com>
Date:   Thu Jun 11 06:21:06 2026 -0700

    tap: free page on error paths in tap_get_user_xdp()
    
    [ Upstream commit 3bcf7aec6a9d16438f2cec29f5d7c8d5b8edf9b2 ]
    
    tap_get_user_xdp() rejects a frame shorter than ETH_HLEN with -EINVAL,
    and returns -ENOMEM when build_skb() fails. Both paths jump to the err
    label without freeing the page that vhost_net_build_xdp() allocated for
    the frame. tap_sendmsg() discards the per-buffer return value and always
    returns 0, so vhost_tx_batch() takes the success path and never frees
    the page; each rejected frame in a batch leaks one page-frag chunk.
    
    Free the page on both error paths, before the skb is built. This is the
    tap counterpart of the same leak in tun_xdp_one().
    
    Fixes: 0efac27791ee ("tap: accept an array of XDP buffs through sendmsg()")
    Fixes: ed7f2afdd0e0 ("tap: add missing verification for short frame")
    Reported-by: Xiang Mei <xmei5@asu.edu>
    Signed-off-by: Weiming Shi <bestswngs@gmail.com>
    Reviewed-by: Dongli Zhang <dongli.zhang@oracle.com>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/20260521163230.1478627-2-bestswngs@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    (cherry picked from commit 3bcf7aec6a9d16438f2cec29f5d7c8d5b8edf9b2)
    Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tcp: restrict SO_ATTACH_FILTER to priv users [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Fri Jun 5 11:21:34 2026 +0000

    tcp: restrict SO_ATTACH_FILTER to priv users
    
    [ Upstream commit 5d39580f68e6ddeedd15e587282207489dfb3da2 ]
    
    This patch restricts the use of SO_ATTACH_FILTER (cBPF) on TCP sockets
    to users with CAP_NET_ADMIN capability.
    
    This blocks potential side-channel attack where an unprivileged application
    attaches a filter to leak TCP sequence/acknowledgment numbers.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reported-by: Tamir Shahar <tamirthesis@gmail.com>
    Reported-by: Amit Klein <aksecurity@gmail.com>
    Cc: Willem de Bruijn <willemb@google.com>
    Cc: Alexei Starovoitov <ast@kernel.org>
    Cc: Daniel Borkmann <daniel@iogearbox.net>
    Cc: Andrii Nakryiko <andrii@kernel.org>
    Cc: Martin KaFai Lau <martin.lau@linux.dev>
    Cc: Eduard Zingerman <eddyz87@gmail.com>
    Cc: Kumar Kartikeya Dwivedi <memxor@gmail.com>
    Cc: Song Liu <song@kernel.org>
    Cc: Yonghong Song <yonghong.song@linux.dev>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: John Fastabend <john.fastabend@gmail.com>
    Cc: Stanislav Fomichev <sdf@fomichev.me>
    Acked-by: Daniel Borkmann <daniel@iogearbox.net>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tee: optee: prevent use-after-free when the client exits before the supplicant [+ + +]
Author: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
Date:   Mon Feb 16 14:24:06 2026 -0800

    tee: optee: prevent use-after-free when the client exits before the supplicant
    
    [ Upstream commit 387a926ee166814611acecb960207fe2f3c4fd3e ]
    
    Commit 70b0d6b0a199 ("tee: optee: Fix supplicant wait loop") made the
    client wait as killable so it can be interrupted during shutdown or
    after a supplicant crash. This changes the original lifetime expectations:
    the client task can now terminate while the supplicant is still processing
    its request.
    
    If the client exits first it removes the request from its queue and
    kfree()s it, while the request ID remains in supp->idr. A subsequent
    lookup on the supplicant path then dereferences freed memory, leading to
    a use-after-free.
    
    Serialise access to the request with supp->mutex:
    
      * Hold supp->mutex in optee_supp_recv() and optee_supp_send() while
        looking up and touching the request.
      * Let optee_supp_thrd_req() notice that the client has terminated and
        signal optee_supp_send() accordingly.
    
    With these changes the request cannot be freed while the supplicant still
    has a reference, eliminating the race.
    
    Fixes: 70b0d6b0a199 ("tee: optee: Fix supplicant wait loop")
    Signed-off-by: Amirreza Zarrabi <amirreza.zarrabi@oss.qualcomm.com>
    Tested-by: Ox Yeh <ox.yeh@mediatek.com>
    Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
    Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
thermal: core: Fix thermal zone governor cleanup issues [+ + +]
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Thu Apr 30 14:27:52 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 <stable@vger.kernel.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Link: https://patch.msgid.link/5092923.31r3eYUQgx@rafael.j.wysocki
    [ adapted context for missing mutex_destroy/complete ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
thunderbolt: Bound root directory content to block size [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Mon May 25 05:28:26 2026 -0400

    thunderbolt: Bound root directory content to block size
    
    commit 65423079c7420e3dbf9a7aa345c243a3f5752e5d upstream.
    
    __tb_property_parse_dir() does not check that content_offset +
    content_len fits within block_len for the root directory case.
    When rootdir->length equals or exceeds block_len - 2, the entry
    loop reads past the allocated property block.
    
    Add a bounds check after computing content_offset and content_len
    to reject directories whose content extends past the block.
    
    Fixes: cdae7c07e3e3 ("thunderbolt: Add support for XDomain properties")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

thunderbolt: Clamp XDomain response data copy to allocation size [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Mon May 25 05:28:27 2026 -0400

    thunderbolt: Clamp XDomain response data copy to allocation size
    
    commit 322e93448d908434ae5545660fcbe8f5a7a8e141 upstream.
    
    tb_xdp_properties_request() derives the per-packet copy length from
    the response header without checking that it fits in the previously
    allocated data buffer.  A malicious peer can set its length field
    larger than the declared data_length, causing memcpy to write past
    the kcalloc allocation.
    
    Clamp the per-packet copy length so that the cumulative offset
    never exceeds data_len.
    
    Fixes: cdae7c07e3e3 ("thunderbolt: Add support for XDomain properties")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

thunderbolt: Limit XDomain response copy to actual frame size [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Mon May 25 05:28:29 2026 -0400

    thunderbolt: Limit XDomain response copy to actual frame size
    
    commit 4db2bd2ed4785dbadaeeab9f4e346b21ac5fb8eb upstream.
    
    tb_xdomain_copy() copies req->response_size bytes from the received
    packet buffer regardless of the actual frame size.  When a short
    response arrives, this reads past the valid frame data in the DMA
    pool buffer into stale contents from previous transactions.
    
    Use the minimum of frame size and expected response size for the
    copy length.
    
    Fixes: cdae7c07e3e3 ("thunderbolt: Add support for XDomain properties")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

thunderbolt: property: Cap recursion depth in __tb_property_parse_dir() [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Fri Jun 5 15:50:25 2026 -0400

    thunderbolt: property: Cap recursion depth in __tb_property_parse_dir()
    
    [ Upstream commit 928abe19fbf0127003abcb1ea69cabc1c897d0ab ]
    
    A DIRECTORY entry's value field is used as the dir_offset for a
    recursive call into __tb_property_parse_dir() with no depth counter.
    A crafted peer that chains DIRECTORY entries into a back-reference
    loop drives the parser until the kernel stack is exhausted and the
    guard page fires.  Any untrusted XDomain peer (cable, dock, in-line
    inspector, adjacent host) that reaches the PROPERTIES_REQUEST
    control-plane exchange can trigger this without authentication.
    
    Thread a depth counter through tb_property_parse() and
    __tb_property_parse_dir(), and reject blocks that exceed
    TB_PROPERTY_MAX_DEPTH = 8.  That is comfortably larger than any
    observed legitimate XDomain layout.
    
    Operators who do not need XDomain host-to-host discovery can disable
    the path entirely with thunderbolt.xdomain=0 on the kernel command
    line.
    
    Fixes: cdae7c07e3e3 ("thunderbolt: Add support for XDomain properties")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-6
    Assisted-by: Codex:gpt-5-4
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

thunderbolt: property: Reject dir_len < 4 to prevent size_t underflow [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Sun May 10 19:16:57 2026 -0400

    thunderbolt: property: Reject dir_len < 4 to prevent size_t underflow
    
    commit de21b59c29e31c5108ddc04210631bbfab81b997 upstream.
    
    On the non-root path, __tb_property_parse_dir() takes dir_len from
    entry->length (u16 widened to size_t).  Two distinct OOB conditions
    follow when entry->length < 4:
    
    1. The non-root path begins with kmemdup(&block[dir_offset],
       sizeof(*dir->uuid), ...) which always reads 4 dwords from
       dir_offset.  tb_property_entry_valid() only enforces
       dir_offset + entry->length <= block_len, so a crafted entry
       with dir_offset close to the end of the property block and
       entry->length in 0..3 passes that gate but lets the UUID copy
       run off the block (e.g. dir_offset = 497, dir_len = 3 in a
       500-dword block reads block[497..501]).
    
    2. After the kmemdup, content_len = dir_len - 4 underflows size_t
       to ~SIZE_MAX, nentries becomes SIZE_MAX / 4, and the entry
       walk runs OOB on each iteration until an entry fails
       validation or the kernel oopses on an unmapped page.
    
    Reject dir_len < 4 on the non-root path *before* the UUID kmemdup,
    which closes both holes.
    
    Also move INIT_LIST_HEAD(&dir->properties) up to immediately after
    the dir allocation so the new error-return path (and the existing
    uuid-alloc failure path) calling tb_property_free_dir() sees a
    walkable list rather than the zero-initialized NULL next/prev that
    list_for_each_entry_safe() would oops on.
    
    Fixes: cdae7c07e3e3 ("thunderbolt: Add support for XDomain properties")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-6
    Assisted-by: Codex:gpt-5-4
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

thunderbolt: property: Reject u32 wrap in tb_property_entry_valid() [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Sun May 10 19:16:56 2026 -0400

    thunderbolt: property: Reject u32 wrap in tb_property_entry_valid()
    
    commit 01deda0152066c6c955f0619114ea6afa070aaec upstream.
    
    entry->value is u32 and entry->length is u16; the sum is performed in
    u32 and wraps.  A malicious XDomain peer can pick
    value = 0xffffff00, length = 0x100 so the sum 0x100000000 wraps to 0
    and passes the > block_len check.  tb_property_parse() then passes
    entry->value to parse_dwdata() as a dword offset into the property
    block, reading attacker-directed memory far past the allocation.
    
    For TEXT-typed entries with the "deviceid" or "vendorid" keys this
    lands in xd->device_name / xd->vendor_name and is readable back via
    the per-XDomain device_name / vendor_name sysfs attributes; the leak
    is NUL-bounded (kstrdup() stops at the first zero byte) and
    untargeted (the attacker picks a delta, not an absolute address).
    DATA-typed entries are parsed into property->value.data but not
    generically surfaced to userspace.
    
    Use check_add_overflow() so a wrapped sum is rejected.
    
    Fixes: cdae7c07e3e3 ("thunderbolt: Add support for XDomain properties")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-6
    Assisted-by: Codex:gpt-5-4
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

thunderbolt: Reject zero-length property entries in validator [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Mon May 25 05:28:25 2026 -0400

    thunderbolt: Reject zero-length property entries in validator
    
    commit cff8eb65d1eafe7793e54b4d0cf6bf831644630b upstream.
    
    tb_property_entry_valid() accepts entries with length == 0 for
    DIRECTORY, DATA, and TEXT types.  A zero-length TEXT entry passes
    validation but causes an underflow in the null-termination logic:
    
      property->value.text[property->length * 4 - 1] = '\0';
    
    When property->length is 0 this writes to offset -1 relative to
    the allocation.
    
    Reject zero-length entries early in the validator since they have no
    valid representation in the XDomain property protocol.
    
    Fixes: cdae7c07e3e3 ("thunderbolt: Add support for XDomain properties")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

thunderbolt: Validate XDomain request packet size before type cast [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Mon May 25 05:28:28 2026 -0400

    thunderbolt: Validate XDomain request packet size before type cast
    
    commit a504b9f2797b739e0304d537e8aa4ce883ecce39 upstream.
    
    tb_xdp_handle_request() casts the received packet buffer to
    protocol-specific structs without verifying that the allocation
    is large enough for the target type.  A peer can send a minimal
    XDomain packet that passes the generic header length check but is
    shorter than the struct accessed after the cast, causing out-of-
    bounds reads from the kmemdup allocation.
    
    Plumb the packet length through xdomain_request_work and validate
    it against the expected struct size before each cast.
    
    Fixes: 8e1de7042596 ("thunderbolt: Add support for XDomain lane bonding")
    Fixes: cdae7c07e3e3 ("thunderbolt: Add support for XDomain properties")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
time: Fix off-by-one in settimeofday() usec validation [+ + +]
Author: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
Date:   Tue Jun 2 23:37:37 2026 +0530

    time: Fix off-by-one in settimeofday() usec validation
    
    [ Upstream commit ce4abda5e12622f33450159e76c8f56d28d7f03d ]
    
    The validation check uses '>' instead of '>=' when comparing tv_usec
    against USEC_PER_SEC, allowing the value 1000000 through. After
    conversion to nanoseconds (*= 1000), this produces tv_nsec ==
    NSEC_PER_SEC, violating the timespec invariant that tv_nsec must be
    less than NSEC_PER_SEC.
    
    Use '>=' to reject tv_usec values that are not in the valid range of
    0 to 999999.
    
    Fixes: 5e0fb1b57bea ("y2038: time: avoid timespec usage in settimeofday()")
    Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
    Signed-off-by: Thomas Gleixner <tglx@kernel.org>
    Acked-by: John Stultz <jstultz@google.com>
    Link: https://patch.msgid.link/4rikk44zew3s6577dugmx4jyblz7o5c57niuap6ct3td5yfm6w@gh7pcumg7qor
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tools build: Add 3-component logical version comparators [+ + +]
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
Date:   Wed May 20 09:33:19 2026 -0700

    tools build: Add 3-component logical version comparators
    
    commit a9b451509565d40a5ca3b41c39a2b758cdbc5355 upstream
    
    The next cset needs to compare if a flex version is greater or
    equal/less than another, but since there is no canonical, generally
    available way to compare versions in the command line (sort -V, yeah,
    but...), just use awk to canonicalize the versions like is also done in
    scripts/rust_is_available.sh.
    
    There was a problem spotted in linux-next where a bashism, here
    documents, aka the '<<<' stdin redirector, for strings to be used as the
    stdin for awk. Use $(shell echo | awk ...) instead.
    
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
    Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tools/bootconfig: Cleanup bootconfig footer size calculations [+ + +]
Author: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Date:   Thu Jul 10 11:24:17 2025 +0900

    tools/bootconfig: Cleanup bootconfig footer size calculations
    
    [ Upstream commit 26dda57695090e05c1a99c3e8f802f862d1ac474 ]
    
    There are many same pattern of 8 + BOOTCONFIG_MAGIC_LEN for calculating
    the size of bootconfig footer. Use BOOTCONFIG_FOOTER_SIZE macro to
    clean up those magic numbers.
    
    Link: https://lore.kernel.org/all/175211425693.2591046.16029516706923643510.stgit@mhiramat.tok.corp.google.com/
    
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Stable-dep-of: f42d01aadced ("tools/bootconfig: Fix buf leaks in apply_xbc")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

tools/bootconfig: Fix buf leaks in apply_xbc [+ + +]
Author: Hongtao Lee <lihongtao@kylinos.cn>
Date:   Wed May 20 11:01:26 2026 +0800

    tools/bootconfig: Fix buf leaks in apply_xbc
    
    [ Upstream commit f42d01aadcedd7bbf4f9a466cabe25c1781dedad ]
    
    If data calloc failed, free the buf before return.
    
    Link: https://lore.kernel.org/all/20260520030126.147782-1-lihongtao@kylinos.cn/
    
    Fixes: 950313ebf79c ("tools: bootconfig: Add bootconfig command")
    Signed-off-by: Hongtao Lee <lihongtao@kylinos.cn>
    Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tracepoint: balance regfunc() on func_add() failure in tracepoint_add_func() [+ + +]
Author: David Carlier <devnexen@gmail.com>
Date:   Sun May 10 20:10:41 2026 -0400

    tracepoint: balance regfunc() on func_add() failure in tracepoint_add_func()
    
    [ Upstream commit fad217e16fded7f3c09f8637b0f6a224d58b5f2e ]
    
    When a tracepoint goes through the 0 -> 1 transition, tracepoint_add_func()
    invokes the subsystem's ext->regfunc() before attempting to install the
    new probe via func_add(). If func_add() then fails (for example, when
    allocate_probes() cannot allocate a new probe array under memory pressure
    and returns -ENOMEM), the function returns the error without calling the
    matching ext->unregfunc(), leaving the side effects of regfunc() behind
    with no installed probe to justify them.
    
    For syscall tracepoints this is particularly unpleasant: syscall_regfunc()
    bumps sys_tracepoint_refcount and sets SYSCALL_TRACEPOINT on every task.
    After a leaked failure, the refcount is stuck at a non-zero value with no
    consumer, and every task continues paying the syscall trace entry/exit
    overhead until reboot. Other subsystems providing regfunc()/unregfunc()
    pairs exhibit similarly scoped persistent state.
    
    Mirror the existing 1 -> 0 cleanup and call ext->unregfunc() in the
    func_add() error path, gated on the same condition used there so the
    unwind is symmetric with the registration.
    
    Fixes: 8cf868affdc4 ("tracing: Have the reg function allow to fail")
    Cc: stable@vger.kernel.org
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Link: https://patch.msgid.link/20260413190601.21993-1-devnexen@gmail.com
    Signed-off-by: David Carlier <devnexen@gmail.com>
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    [ changed `tp->ext->unregfunc` to `tp->unregfunc` to match older struct layout ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tracing/probes: Limit size of event probe to 3K [+ + +]
Author: Steven Rostedt <rostedt@goodmis.org>
Date:   Fri May 15 10:48:40 2026 -0400

    tracing/probes: Limit size of event probe to 3K
    
    [ Upstream commit b2aa3b4d64e460ac606f386c24e7d8a873ce6f1a ]
    
    There currently isn't a max limit an event probe can be. One could make an
    event greater than PAGE_SIZE, which makes the event useless because if
    it's bigger than the max event that can be recorded into the ring buffer,
    then it will never be recorded.
    
    A event probe should never need to be greater than 3K, so make that the
    max size. As long as the max is less than the max that can be recorded
    onto the ring buffer, it should be fine.
    
    Cc: stable@vger.kernel.org
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Fixes: 93ccae7a22274 ("tracing/kprobes: Support basic types on dynamic events")
    Link: https://patch.msgid.link/20260428122302.706610ba@gandalf.local.home
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    [ changed `ctx->offset` to `offset` and `goto fail` to `goto out` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tty: serial: pch_uart: add check for dma_alloc_coherent() [+ + +]
Author: Zhaoyang Yu <2426767509@qq.com>
Date:   Thu Apr 9 13:41:58 2026 +0800

    tty: serial: pch_uart: add check for dma_alloc_coherent()
    
    commit 6fe472c1bbbe238e91141f7cabc1226e96a60d43 upstream.
    
    Add a check for dma_alloc_coherent() failure to prevent a potential
    NULL pointer dereference in dma_handle_rx(). Properly release DMA
    channels and the PCI device reference using a goto ladder if the
    allocation fails.
    
    Fixes: 3c6a483275f4 ("Serial: EG20T: add PCH_UART driver")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Zhaoyang Yu <2426767509@qq.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Link: https://patch.msgid.link/tencent_E328416B7CFD436F6029F2DF02AD7ED89C08@qq.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tty: serial: qcom-geni-serial: align #define values [+ + +]
Author: Bartosz Golaszewski <brgl@kernel.org>
Date:   Fri Jun 5 22:47:08 2026 -0400

    tty: serial: qcom-geni-serial: align #define values
    
    [ Upstream commit 6cde11dbf4b65170eeefba48df730c93d75e01a3 ]
    
    Keep the #define symbols aligned for better readability.
    
    Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
    Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
    Link: https://lore.kernel.org/r/20221229155030.418800-5-brgl@bgdev.pl
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Stable-dep-of: ca2584d841b6 ("serial: qcom-geni: fix UART_RX_PAR_EN bit position")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tty: serial: qcom-geni-serial: remove unused symbols [+ + +]
Author: Bartosz Golaszewski <brgl@kernel.org>
Date:   Fri Jun 5 22:47:07 2026 -0400

    tty: serial: qcom-geni-serial: remove unused symbols
    
    [ Upstream commit 68c6bd92c86cbc4937834c79963b27c77ee3bf51 ]
    
    Drop all unused symbols from the driver.
    
    Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
    Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
    Link: https://lore.kernel.org/r/20221229155030.418800-4-brgl@bgdev.pl
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Stable-dep-of: ca2584d841b6 ("serial: qcom-geni: fix UART_RX_PAR_EN bit position")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tty: serial: samsung: Remove redundant port lock acquisition in rx helpers [+ + +]
Author: Tudor Ambarus <tudor.ambarus@linaro.org>
Date:   Fri Jun 5 11:31:04 2026 -0400

    tty: serial: samsung: Remove redundant port lock acquisition in rx helpers
    
    [ Upstream commit a3bb136bff5e6a5e48cdd813246c9c4686feaaa9 ]
    
    Sashiko identified a deadlock when the console flow is engaged [1].
    
    When console flow control is enabled (UPF_CONS_FLOW),
    s3c24xx_serial_stop_tx() calls s3c24xx_serial_rx_enable() and
    s3c24xx_serial_start_tx() calls s3c24xx_serial_rx_disable().
    
    The serial core framework invokes the .stop_tx() and .start_tx()
    callbacks with the port->lock spinlock already held. Furthermore, all
    internal driver paths that invoke stop_tx (such as the DMA TX
    completion handler s3c24xx_serial_tx_dma_complete() or the PIO TX IRQ
    handler s3c24xx_serial_tx_irq()) also acquire port->lock prior to
    calling it. (Note that s3c24xx_serial_start_tx() is only invoked by the
    serial core).
    
    However, s3c24xx_serial_rx_enable() and s3c24xx_serial_rx_disable()
    unconditionally attempt to acquire port->lock again using
    uart_port_lock_irqsave(). Since spinlocks are not recursive, this
    causes a deadlock on the same CPU when console flow control is engaged.
    
    Remove the redundant lock acquisition from both rx helper functions.
    
    Cc: stable <stable@kernel.org>
    Fixes: b497549a035c ("[ARM] S3C24XX: Split serial driver into core and per-cpu drivers")
    Reported-by: John Ogness <john.ogness@linutronix.de>
    Closes: https://sashiko.dev/#/patchset/20260506121606.5805-1-john.ogness%40linutronix.de [1]
    Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
    Link: https://patch.msgid.link/20260515-samsung-tty-flow-control-deadlock-v1-1-93255edbc9bc@linaro.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

tty: serial: samsung: use u32 for register interactions [+ + +]
Author: Tudor Ambarus <tudor.ambarus@linaro.org>
Date:   Fri Jun 5 11:31:03 2026 -0400

    tty: serial: samsung: use u32 for register interactions
    
    [ Upstream commit 032a725c16add79332d774348d7ad7d0d4b86479 ]
    
    All registers of the IP have 32 bits. Use u32 variables when reading
    or writing from/to the registers. The purpose of those variables becomes
    clearer.
    
    Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
    Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
    Link: https://lore.kernel.org/r/20240119104526.1221243-9-tudor.ambarus@linaro.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Stable-dep-of: a3bb136bff5e ("tty: serial: samsung: Remove redundant port lock acquisition in rx helpers")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tun: free page on build_skb failure in tun_xdp_one() [+ + +]
Author: Weiming Shi <bestswngs@gmail.com>
Date:   Thu May 21 09:33:13 2026 -0700

    tun: free page on build_skb failure in tun_xdp_one()
    
    [ Upstream commit aa8963fdce667a42fb7f0bdd2909fadcab02f9a8 ]
    
    When build_skb() fails in tun_xdp_one(), the function sets ret to
    -ENOMEM and jumps to the out label, which returns without freeing the
    page that vhost_net_build_xdp() allocated for the frame. As with the
    short-frame rejection path, tun_sendmsg() discards the per-buffer error
    and still returns total_len, so vhost_tx_batch() takes the success path
    and never frees the page. Each build_skb() failure in a batch leaks one
    page-frag chunk.
    
    Free the page before taking the error path, matching the put_page() the
    other error exits of tun_xdp_one() already perform.
    
    Fixes: 043d222f93ab ("tuntap: accept an array of XDP buffs through sendmsg()")
    Reported-by: Xiang Mei <xmei5@asu.edu>
    Signed-off-by: Weiming Shi <bestswngs@gmail.com>
    Reviewed-by: Dongli Zhang <dongli.zhang@oracle.com>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/20260521163312.1479805-2-bestswngs@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

tun: free page on short-frame rejection in tun_xdp_one() [+ + +]
Author: Weiming Shi <bestswngs@gmail.com>
Date:   Wed May 20 09:00:21 2026 -0700

    tun: free page on short-frame rejection in tun_xdp_one()
    
    [ Upstream commit f4feb1e20058e407cb00f45aff47f5b7e19a6bbf ]
    
    tun_xdp_one() returns -EINVAL on a frame shorter than ETH_HLEN without
    freeing the page that vhost_net_build_xdp() allocated for it.
    tun_sendmsg() discards that -EINVAL and still returns total_len, so
    vhost_tx_batch() takes the success path and never frees the page; each
    short frame in a batch leaks one page-frag chunk.
    
    A local process that can open /dev/net/tun and /dev/vhost-net can hit
    this path: it attaches a tun/tap device as the vhost-net backend and
    feeds TX descriptors whose length minus the virtio-net header is below
    ETH_HLEN. Each kick leaks the page-frag chunks for that batch, and a
    tight submission loop exhausts host memory and triggers an OOM panic.
    Free the page before returning -EINVAL, matching the XDP-program error
    path in the same function.
    
    Fixes: 049584807f1d ("tun: add missing verification for short frame")
    Reported-by: Xiang Mei <xmei5@asu.edu>
    Signed-off-by: Weiming Shi <bestswngs@gmail.com>
    Reviewed-by: Dongli Zhang <dongli.zhang@oracle.com>
    Reviewed-by: Willem de Bruijn <willemb@google.com>
    Link: https://patch.msgid.link/20260520160020.375349-2-bestswngs@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tunnels: do not assume transport header in iptunnel_pmtud_check_icmp() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Fri May 22 11:55:12 2026 +0000

    tunnels: do not assume transport header in iptunnel_pmtud_check_icmp()
    
    [ Upstream commit 509323077ef79a26ba0c60bb556e45c12c398b2d ]
    
    In some cases, iptunnel_pmtud_check_icmp() can be called while
    skb transport header is not set.
    
    This triggers an out-of-bound access, because
    (typeof(skb->transport_header))~0U is 65535.
    
    Access the icmp header based on IPv4 network header,
    after making sure icmp->type is present in skb linear part.
    
    Note that iptunnel_pmtud_check_icmpv6()) is fine.
    
    Fixes: 4cb47a8644cc ("tunnels: PMTU discovery support for directly bridged IP packets")
    Reported-by: Damiano Melotti <melotti@google.com>
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
    Link: https://patch.msgid.link/20260522115512.1519110-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

tunnels: load network headers after skb_cow() in iptunnel_pmtud_build_icmp[v6]() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Mon May 25 20:13:35 2026 +0000

    tunnels: load network headers after skb_cow() in iptunnel_pmtud_build_icmp[v6]()
    
    [ Upstream commit b4bc94353050b1fa7b702bd4c6600710dd926cff ]
    
    Sashiko found that iptunnel_pmtud_build_icmp() and
    iptunnel_pmtud_build_icmpv6() were caching ip_hdr() and ipv6_hdr()
    before an skb_cow() call which can reallocate skb->head.
    
    Fix this possible UAF by initializing the local variables
    after the skb_cow() call.
    
    Remove skb_reset_network_header() calls which were not needed.
    
    Fixes: 4cb47a8644cc ("tunnels: PMTU discovery support for directly bridged IP packets")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
    Link: https://patch.msgid.link/20260525201335.2361845-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
udf: fix partition descriptor append bookkeeping [+ + +]
Author: Seohyeon Maeng <bioloidgp@gmail.com>
Date:   Fri May 8 17:17:31 2026 -0400

    udf: fix partition descriptor append bookkeeping
    
    [ Upstream commit 08841b06fa64d8edbd1a21ca6e613420c90cc4b8 ]
    
    Mounting a crafted UDF image with repeated partition descriptors can
    trigger a heap out-of-bounds write in part_descs_loc[].
    
    handle_partition_descriptor() deduplicates entries by partition number,
    but appended slots never record partnum. As a result duplicate
    Partition Descriptors are appended repeatedly and num_part_descs keeps
    growing.
    
    Once the table is full, the growth path still sizes the allocation from
    partnum even though inserts are indexed by num_part_descs. If partnum is
    already aligned to PART_DESC_ALLOC_STEP, ALIGN(partnum, step) can keep
    the old capacity and the next append writes past the end of the table.
    
    Store partnum in the appended slot and size growth from the next append
    count so deduplication and capacity tracking follow the same model.
    
    Fixes: ee4af50ca94f ("udf: Fix mounting of Win7 created UDF filesystems")
    Cc: stable@vger.kernel.org
    Signed-off-by: Seohyeon Maeng <bioloidgp@gmail.com>
    Link: https://patch.msgid.link/20260310081652.21220-1-bioloidgp@gmail.com
    Signed-off-by: Jan Kara <jack@suse.cz>
    [ replaced kzalloc_objs() helper with equivalent kcalloc() ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
udp: clear skb->dev before running a sockmap verdict [+ + +]
Author: Sechang Lim <rhkrqnwk98@gmail.com>
Date:   Wed Jun 3 16:27:33 2026 +0000

    udp: clear skb->dev before running a sockmap verdict
    
    commit 3c94f241f776562c489876ff506f366224565c21 upstream.
    
    On the UDP receive path skb->dev is repurposed as dev_scratch (the
    truesize/state cache set by udp_set_dev_scratch()), through the
    union { struct net_device *dev; unsigned long dev_scratch; } in sk_buff.
    
    When a UDP socket is in a sockmap, sk_data_ready is
    sk_psock_verdict_data_ready(), which calls udp_read_skb() -> recv_actor()
    (sk_psock_verdict_recv) to run the attached SK_SKB verdict program in softirq.
    If that program calls a socket-lookup helper (bpf_sk_lookup_tcp/udp,
    bpf_skc_lookup_tcp), bpf_skc_lookup() does:
    
            if (skb->dev)
                    caller_net = dev_net(skb->dev);
    
    skb->dev still holds the dev_scratch value (a non-NULL integer), so dev_net()
    dereferences it as a struct net_device * and the kernel takes a general
    protection fault on a non-canonical address in softirq:
    
      Oops: general protection fault, probably for non-canonical address 0x1010000800004a0
      CPU: 1 UID: 0 PID: 1406 Comm: syz.2.19 Not tainted 7.1.0-rc6 #1 PREEMPT(full)
      RIP: 0010:bpf_skc_lookup net/core/filter.c:7033 [inline]
      RIP: 0010:bpf_sk_lookup+0x45/0x160 net/core/filter.c:7047
      Call Trace:
       <IRQ>
       bpf_prog_4675cb904b7071f8+0x12e/0x14e
       bpf_prog_run_pin_on_cpu+0xc6/0x1f0
       sk_psock_verdict_recv+0x1ba/0x350
       udp_read_skb+0x31a/0x370
       sk_psock_verdict_data_ready+0x2e3/0x600
       __udp_enqueue_schedule_skb+0x4c8/0x650
       udpv6_queue_rcv_one_skb+0x3ec/0x740
       udp6_unicast_rcv_skb+0x11d/0x140
       ip6_protocol_deliver_rcu+0x61e/0x950
       ip6_input_finish+0xa9/0x150
       NF_HOOK+0x286/0x2f0
       ip6_input+0x117/0x220
       NF_HOOK+0x286/0x2f0
       __netif_receive_skb+0x85/0x200
       process_backlog+0x374/0x9a0
       __napi_poll+0x4f/0x1c0
       net_rx_action+0x3b0/0x770
       handle_softirqs+0x15a/0x460
       do_softirq+0x57/0x80
       </IRQ>
    
    The rmem charge that dev_scratch accounted for is released by skb_recv_udp() on
    dequeue, just above, so the scratch is dead by the time recv_actor() runs. Clear
    skb->dev so bpf_skc_lookup() falls back to sock_net(skb->sk), which
    skb_set_owner_sk_safe() set just above.
    
    Fixes: 965b57b469a5 ("net: Introduce a new proto_ops ->read_skb()")
    Cc: stable@vger.kernel.org
    Signed-off-by: Sechang Lim <rhkrqnwk98@gmail.com>
    Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Link: https://patch.msgid.link/20260603162737.697215-1-rhkrqnwk98@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
USB: cdc-acm: Fix bit overlap and move quirk definitions to header [+ + +]
Author: Wentao Guan <guanwentao@uniontech.com>
Date:   Fri May 22 17:13:58 2026 +0800

    USB: cdc-acm: Fix bit overlap and move quirk definitions to header
    
    commit 5eb070769ea5e18405535609d1d3f6886f3755bd upstream.
    
    The VENDOR_CLASS_DATA_IFACE and ALWAYS_POLL_CTRL quirk flags added in
    commit f58752ebcb35 ("USB: cdc-acm: Add quirks for Yoga Book 9 14IAH10
    INGENIC touchscreen") were placed inside the acm_ctrl_msg() function
    rather than in the header with the other quirk flags.  Then, their
    values (BIT(9) and BIT(10)) collided with NO_UNION_12 which is already
    BIT(9).
    
    Move the definitions to drivers/usb/class/cdc-acm.h where they belong
    and shift them to BIT(10) and BIT(11) to avoid the overlap.
    
    Fixes: f58752ebcb35 ("USB: cdc-acm: Add quirks for Yoga Book 9 14IAH10 INGENIC touchscreen")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
    Link: https://patch.msgid.link/20260522091357.1301196-1-guanwentao@uniontech.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
usb: cdns3: gadget: fix request skipping after clearing halt [+ + +]
Author: Yongchao Wu <yongchao.wu@autochips.com>
Date:   Thu May 14 00:00:12 2026 +0800

    usb: cdns3: gadget: fix request skipping after clearing halt
    
    commit c8778ff817a7047d6848fefba99dcb27b1bf01fe upstream.
    
    According to the cdns3 datasheet, the EPRST (Endpoint Reset) command
    causes the DMA engine to reposition its internal pointer to the next
    Transfer Descriptor (TD) if it was already processing one.
    
    This issue is consistently observed during the ADB identification
    process on macOS hosts, where the host issues a Clear_Halt. Although
    commit 4bf2dd65135a ("usb: cdns3: gadget: toggle cycle bit before reset
    endpoint") attempted to avoid DMA advance by toggling the cycle bit,
    trace logs show that on certain hosts like macOS, the DMA pointer
    (EP_TRADDR) still shifts after EPRST:
    
      cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out)
      cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030  <-- Should be f9c04000
      cdns3_gadget_giveback: ep1out: req: ... length: 16384/16384
    
    As shown above, the DMA pointer jumped to the next TD, causing
    the controller to skip the initial TRBs of the request. This leads to
    data misalignment and ADB protocol hangs on macOS.
    
    Fix this by manually restoring the EP_TRADDR register to the starting
    physical address of the current request after the EPRST operation is
    complete.
    
    Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
    Cc: stable <stable@kernel.org>
    Cc: Peter Chen <peter.chen@kernel.org>
    Signed-off-by: Yongchao Wu <yongchao.wu@autochips.com>
    Acked-by: Peter Chen <peter.chen@kernel.org>
    Link: https://patch.msgid.link/20260513160012.2547894-1-yongchao.wu@autochips.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: cdns3: plat: fix leaked usb2_phy initialization on usb3_phy acquisition failure [+ + +]
Author: Peter Chen <peter.chen@cixtech.com>
Date:   Thu Jun 4 20:34:56 2026 -0400

    usb: cdns3: plat: fix leaked usb2_phy initialization on usb3_phy acquisition failure
    
    [ Upstream commit e6970cda63fd4b4546aeed9d0e2f53a7c95cd09c ]
    
    Move usb2_phy initialization after usb3_phy acquisition.
    
    Fixes: f738957277ba ("usb: cdns3: Split core.c into cdns3-plat and core.c file")
    Cc: stable <stable@kernel.org>
    Reported-by: sashiko-bot <sashiko-bot@kernel.org>
    Closes: https://lore.kernel.org/linux-devicetree/agKaEePSFknhDBg2@nchen-desktop/T/#m21e1d9c1574eb127ce03c0c2a1a49002ce435b52
    Signed-off-by: Peter Chen <peter.chen@cixtech.com>
    Link: https://patch.msgid.link/20260513085310.2217547-2-peter.chen@cixtech.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: cdns3: plat: fix unbalanced pm_runtime_forbid() call permanently leaks the runtime PM usage counter across bind/unbind cycles [+ + +]
Author: Peter Chen <peter.chen@cixtech.com>
Date:   Wed May 13 16:53:10 2026 +0800

    usb: cdns3: plat: fix unbalanced pm_runtime_forbid() call permanently leaks the runtime PM usage counter across bind/unbind cycles
    
    commit ae6f3b82324e4f39ad8443c9020787e6fc889637 upstream.
    
    Call pm_runtime_allow(dev) conditionally at cdns3_plat_remove.
    
    Fixes: f738957277ba ("usb: cdns3: Split core.c into cdns3-plat and core.c file")
    Cc: stable <stable@kernel.org>
    Reported-by: sashiko-bot <sashiko-bot@kernel.org>
    Closes: https://lore.kernel.org/linux-devicetree/agKaEePSFknhDBg2@nchen-desktop/T/#m21e1d9c1574eb127ce03c0c2a1a49002ce435b52
    Signed-off-by: Peter Chen <peter.chen@cixtech.com>
    Link: https://patch.msgid.link/20260513085310.2217547-3-peter.chen@cixtech.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: chipidea: core: convert ci_role_switch to local variable [+ + +]
Author: Xu Yang <xu.yang_2@nxp.com>
Date:   Mon Apr 27 15:57:55 2026 +0800

    usb: chipidea: core: convert ci_role_switch to local variable
    
    commit 8f6aa392653e52a45858cff5c063df550028836b upstream.
    
    When a system contains multiple USB controllers, the global ci_role_switch
    variable may be overwritten by subsequent driver initialization code.
    
    This can cause issues in the following cases:
     - The 2nd ci_hdrc_probe() sees ci_role_switch.fwnode as non-NULL even
       though the "usb-role-switch" property is not present for the controller.
     - When the ci_hdrc device is unbound and bound again, ci_role_switch
       fwnode will not be reassigned, and the old value will be used instead.
    
    Convert ci_role_switch to a local variable to fix these issues.
    
    Fixes: 05559f10ed79 ("usb: chipidea: add role switch class support")
    Cc: stable <stable@kernel.org>
    Acked-by: Peter Chen <peter.chen@kernel.org>
    Reviewed-by: Frank Li <Frank.Li@nxp.com>
    Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
    Link: https://patch.msgid.link/20260427075755.3611217-1-xu.yang_2@nxp.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: core: Fix SuperSpeed root hub wMaxPacketSize [+ + +]
Author: Michal Pecio <michal.pecio@gmail.com>
Date:   Mon May 18 07:31:21 2026 +0200

    usb: core: Fix SuperSpeed root hub wMaxPacketSize
    
    commit d1e280334b7f0a1df441e08bd1f6a1bcc36b3bbb upstream.
    
    There is no good reason to have wBytesPerInterval < wMaxPacketSize -
    either one is too low or the other too high, and we may want to warn
    about such descriptors. Start with cleaning up our own root hubs.
    
    USB 3.2 section 10.15.1 sets wMaxPacketSize and wBytesPerInterval of
    SuperSpeed hub status endpoints at 2 bytes, so reduce wMaxPacketSize
    from its former value of 4, which was derived from USB 2.0 spec and
    the kernel's USB_MAXCHILDREN limit. They don't apply because USB 3.2
    10.15.2.1 specifies SuperSpeed hubs to have up to 15 ports.
    
    Suggested-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
    Link: https://patch.msgid.link/20260518073121.7bc1da0f.michal.pecio@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: core: Fix up Interrupt IN endpoints with bogus wBytesPerInterval [+ + +]
Author: Michal Pecio <michal.pecio@gmail.com>
Date:   Mon May 18 07:32:07 2026 +0200

    usb: core: Fix up Interrupt IN endpoints with bogus wBytesPerInterval
    
    commit 727d045d064b7c9a24db3bce9c0485a382cb768b upstream.
    
    Tao Xue found that some common devices violate USB 3.x section 9.6.7
    by reporting wBytesPerInterval lower than the size of packets they
    actually send. I confirmed that AX88179 may set it to 0 and RTL8153
    CDC configuration sets it to 8 but sends both 8 and 16 byte packets:
    
    S Ii:11:007:3 -115:128 16 <
    C Ii:11:007:3 0:128 8 = a1000000 01000000
    S Ii:11:007:3 -115:128 16 <
    C Ii:11:007:3 0:128 16 = a12a0000 01000800 00000000 00000000
    
    Most xHCI host controllers neglect interrupt bandwidth reservations
    and let such devices exceed theirs, some fail the URB with EOVERFLOW.
    
    Assume that wBytesPerInterval lower than wMaxPacketSize is bogus and
    increase it to the worst case maximum on interrupt IN endpoints. This
    solves xHCI problems and appears to have no other effect. Interrupt
    transfers are not limited to one interval and drivers submit URBs of
    class defined size without looking at wBytesPerInterval. Any multi-
    interval transfer is considered terminated by a packet shorter than
    wMaxPacketSize regardless of wBytesPerInterval - see USB3 8.10.3.
    
    Stay in spec on OUT endpoints and isochronous. No buggy devices are
    known and we don't want to risk sending more data than the device
    is prepared to handle or confusing isoc drivers regarding altsetting
    capacities guaranteed by the device itself. And don't complain when
    wMaxPacketSize <= wBytesPerInterval < wMaxPacketSize * (bMaxBurst+1)
    because enabling this seems to be the exact goal of the spec.
    
    Reported-and-tested-by: Tao Xue <xuetao09@huawei.com>
    Closes: https://lore.kernel.org/linux-usb/20260402021400.28853-1-xuetao09@huawei.com/
    Cc: stable@vger.kernel.org
    Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
    Link: https://patch.msgid.link/20260518073207.5b7d26e7.michal.pecio@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: dwc2: Fix use after free in debug code [+ + +]
Author: Dan Carpenter <error27@gmail.com>
Date:   Wed May 20 08:59:28 2026 +0300

    usb: dwc2: Fix use after free in debug code
    
    commit 9ea06a3fbf9f16e0d98c52cb3b99642be15ec281 upstream.
    
    We're not allowed to dereference "urb" after calling
    usb_hcd_giveback_urb() so save the urb->status ahead of time.
    
    Fixes: 7359d482eb4d ("staging: HCD files for the DWC2 driver")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Link: https://patch.msgid.link/ag1NwBpqT4IEQcdJ@stanley.mountain
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: dwc3: Move GUID programming after PHY initialization [+ + +]
Author: Selvarasu Ganesan <selvarasu.g@samsung.com>
Date:   Wed May 13 09:32:57 2026 -0400

    usb: dwc3: Move GUID programming after PHY initialization
    
    [ Upstream commit aad35f9c926ec220b0742af1ada45666ae667956 ]
    
    The Linux Version Code is currently written to the GUID register before
    PHY initialization. Certain PHY implementations (such as Synopsys eUSB
    PHY performing link_sw_reset) clear the GUID register to its default
    value during initialization, causing the kernel version information to
    be lost.
    
    Move the GUID register programming to occur after PHY initialization
    completes to ensure the Linux version information persists.
    
    Fixes: fa0ea13e9f1c ("usb: dwc3: core: write LINUX_VERSION_CODE to our GUID register")
    Cc: stable <stable@kernel.org>
    Reported-by: Pritam Manohar Sutar <pritam.sutar@samsung.com>
    Signed-off-by: Selvarasu Ganesan <selvarasu.g@samsung.com>
    Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    Link: https://patch.msgid.link/20260417063314.2359-1-selvarasu.g@samsung.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    [ adapted dwc3_writel(dwc, ...) to dwc3_writel(dwc->regs, ...) ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: dwc3: xilinx: fix error handling in zynqmp init error paths [+ + +]
Author: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Date:   Fri Jun 5 14:31:18 2026 -0400

    usb: dwc3: xilinx: fix error handling in zynqmp init error paths
    
    [ Upstream commit c1a0ecbf32c4b397353204e2ec94c5bb9f3300ed ]
    
    Fix error handling and resource cleanup i.e remove invalid
    phy_exit() after failed phy_init(), route failures through
    proper cleanup paths and return 0 explicitly on success.
    
    Fixes: 84770f028fab ("usb: dwc3: Add driver for Xilinx platforms")
    Cc: stable@vger.kernel.org
    Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
    Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
    Link: https://patch.msgid.link/20260519115529.2980421-1-radhey.shyam.pandey@amd.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: dummy_hcd: Reject hub port requests for non-existent ports [+ + +]
Author: Seungjin Bae <eeodqql09@gmail.com>
Date:   Mon May 18 19:43:14 2026 -0400

    usb: gadget: dummy_hcd: Reject hub port requests for non-existent ports
    
    commit 7d9633528dd40e33964d2dc74a5abbf5c4d116ce upstream.
    
    The `dummy_hub_control()` function handles USB hub class requests
    to the virtual root hub. The `GetPortStatus` case returns -EPIPE for
    requests with `wIndex != 1`, since the virtual root hub has only a
    single port. However, the `ClearPortFeature` and `SetPortFeature`
    cases lack the same check.
    
    Fix this by extending the `wIndex != 1` rejection to both cases,
    matching the existing behavior of `GetPortStatus`.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable <stable@kernel.org>
    Suggested-by: Alan Stern <stern@rowland.harvard.edu>
    Signed-off-by: Seungjin Bae <eeodqql09@gmail.com>
    Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
    Link: https://patch.msgid.link/20260518234314.1889396-1-eeodqql09@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: f_fs: copy only received bytes on short ep0 read [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Sun Apr 19 12:03:59 2026 -0400

    usb: gadget: f_fs: copy only received bytes on short ep0 read
    
    commit 4e036c10e7f4df5d951c69cc3697bc8e209c6d02 upstream.
    
    ffs_ep0_read() allocates its control-OUT data buffer with
    kmalloc() (not kzalloc) at the Length value from the Setup
    packet, then copies that full len to userspace regardless of
    how many bytes were actually received:
    
        data = kmalloc(len, GFP_KERNEL);
        ...
        ret = __ffs_ep0_queue_wait(ffs, data, len);
        if ((ret > 0) && (copy_to_user(buf, data, len)))
                ret = -EFAULT;
    
    __ffs_ep0_queue_wait() returns req->actual, which on a short
    control OUT transfer is strictly less than len.  The
    copy_to_user() call still copies len bytes, so on a short OUT
    the last (len - ret) bytes of the kmalloc() buffer --
    uninitialised slab residue -- are delivered to the FunctionFS
    daemon.
    
    Short ep0 OUT completions are specified USB control-transfer
    behavior and are produced by in-tree UDCs:
    
      * dwc2 continues on req->actual < req->length for ep0 DATA OUT
        (short-not-ok is the only ep0-OUT stall path).
      * aspeed_udc ends ep0 OUT on rx_len < ep->ep.maxpacket.
      * renesas_usbf logs "ep0 short packet" and completes the
        request.
      * dwc3 stalls on short IN but not on short OUT.
    
    A short ep0 OUT is therefore not evidence of a broken UDC; it is
    a normal condition f_fs has to cope with.  The sibling gadgetfs
    implementation in drivers/usb/gadget/legacy/inode.c already does
    this correctly via min(len, dev->req->actual) before
    copy_to_user().  This patch brings f_fs.c to the same safe
    pattern rather than trimming at a defensive layer.
    
    The bug is reached from the FunctionFS device node, which in
    real deployments is owned by the privileged gadget daemon
    (adbd, UMS, composite gadget services, etc.); it is not
    reachable from unprivileged userspace.  Linux host stacks
    normally reject short-wLength control OUTs before they reach
    the gadget, so reproducing this required a build that
    bypasses that host-side check.  With the bypass in place, a
    1-byte payload on a 64-byte Setup produces 63 bytes of
    non-canary slab residue in the daemon's read buffer.
    
    Fix by copying only ret (actually received) bytes to
    userspace.
    
    Fixes: ddf8abd25994 ("USB: f_fs: the FunctionFS driver")
    Cc: stable <stable@kernel.org>
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Link: https://patch.msgid.link/20260419160359.1577270-1-michael.bommarito@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: f_hid: fix device reference leak in hidg_alloc() [+ + +]
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Fri Jun 5 15:17:11 2026 -0400

    usb: gadget: f_hid: fix device reference leak in hidg_alloc()
    
    [ Upstream commit 4f88d65def6f3c90121601b4f62a4c967f3063a6 ]
    
    hidg_alloc() initializes hidg->dev with device_initialize() before
    calling dev_set_name(). If dev_set_name() fails, the function currently
    jumps to err_unlock and returns without calling put_device().
    
    This leaves the device reference unbalanced and prevents hidg_release()
    from being called. Calling put_device() here is also safe, since
    hidg_release() only frees resources owned by hidg.
    
    The issue was identified by a static analysis tool I developed and
    confirmed by manual review.
    
    Route the dev_set_name() failure path through err_put_device so the
    device reference is dropped properly.
    
    Fixes: 89ff3dfac604 ("usb: gadget: f_hid: fix f_hidg lifetime vs cdev")
    Cc: stable <stable@kernel.org>
    Reviewed-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Reviewed-by: Johan Hovold johan@kernel.org
    Link: https://patch.msgid.link/20260413142119.2977716-1-lgs201920130244@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: f_hid: tidy error handling in hidg_alloc [+ + +]
Author: John Keeping <john@keeping.me.uk>
Date:   Fri Jun 5 15:17:10 2026 -0400

    usb: gadget: f_hid: tidy error handling in hidg_alloc
    
    [ Upstream commit 944fe915d00d3cb1bacb1e77cabfb6dc82e6f8b8 ]
    
    Unify error handling at the end of the function, reducing the risk of
    missing something on one of the error paths.
    
    Moving the increment of opts->refcnt later means there is no need to
    decrement it on the error path and is safe as this is guarded by
    opts->lock which is held for this entire section.
    
    Tested-by: Lee Jones <lee@kernel.org>
    Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
    Reviewed-by: Lee Jones <lee@kernel.org>
    Signed-off-by: John Keeping <john@metanate.com>
    Link: https://lore.kernel.org/r/20221122123523.3068034-4-john@metanate.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Stable-dep-of: 4f88d65def6f ("usb: gadget: f_hid: fix device reference leak in hidg_alloc()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: f_ncm: Fix net_device lifecycle with device_move [+ + +]
Author: Kuen-Han Tsai <khtsai@google.com>
Date:   Wed Jun 10 18:08:36 2026 +0000

    usb: gadget: f_ncm: Fix net_device lifecycle with device_move
    
    [ Upstream commit ec35c1969650e7cb6c8a91020e568ed46e3551b0 ]
    
    The network device outlived its parent gadget device during
    disconnection, resulting in dangling sysfs links and null pointer
    dereference problems.
    
    A prior attempt to solve this by removing SET_NETDEV_DEV entirely [1]
    was reverted due to power management ordering concerns and a NO-CARRIER
    regression.
    
    A subsequent attempt to defer net_device allocation to bind [2] broke
    1:1 mapping between function instance and network device, making it
    impossible for configfs to report the resolved interface name. This
    results in a regression where the DHCP server fails on pmOS.
    
    Use device_move to reparent the net_device between the gadget device and
    /sys/devices/virtual/ across bind/unbind cycles. This preserves the
    network interface across USB reconnection, allowing the DHCP server to
    retain their binding.
    
    Introduce gether_attach_gadget()/gether_detach_gadget() helpers and use
    __free(detach_gadget) macro to undo attachment on bind failure. The
    bind_count ensures device_move executes only on the first bind.
    
    [1] https://lore.kernel.org/lkml/f2a4f9847617a0929d62025748384092e5f35cce.camel@crapouillou.net/
    [2] https://lore.kernel.org/linux-usb/795ea759-7eaf-4f78-81f4-01ffbf2d7961@ixit.cz/
    
    Fixes: 40d133d7f542 ("usb: gadget: f_ncm: convert to new function interface with backward compatibility")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
    Link: https://patch.msgid.link/20260309-f-ncm-revert-v2-7-ea2afbc7d9b2@google.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    [ Use no_free_ptr() since retain_and_null_ptr() is unavailable in Linux 6.1. ]
    Signed-off-by: Jianqiang kang <jianqkang@sina.cn>
    Signed-off-by: Carlos Llamas <cmllamas@google.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

usb: gadget: net2280: Fix double free in probe error path [+ + +]
Author: Guangshuo Li <lgs201920130244@gmail.com>
Date:   Mon Apr 27 23:36:51 2026 +0800

    usb: gadget: net2280: Fix double free in probe error path
    
    commit c8547c74988e0b5f4cbb1b895e2a57aae084f070 upstream.
    
    usb_initialize_gadget() installs gadget_release() as the release
    callback for the embedded gadget device.  The struct net2280 instance is
    therefore released through gadget_release() when the gadget device's last
    reference is dropped.
    
    The probe error path calls net2280_remove(), which tears down the
    partially initialized device and drops the gadget reference with
    usb_put_gadget().  Calling kfree(dev) afterwards can free the same object
    again.
    
    Drop the explicit kfree() and let the gadget device release callback
    handle the final free.  This issue was found by a static analysis tool
    I am developing.
    
    Fixes: f770fbec4165 ("USB: UDC: net2280: Fix memory leaks")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
    Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
    Link: https://patch.msgid.link/20260427153651.337846-1-lgs201920130244@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: u_ether: Fix NULL pointer deref in eth_get_drvinfo [+ + +]
Author: Kuen-Han Tsai <khtsai@google.com>
Date:   Wed Jun 10 18:08:37 2026 +0000

    usb: gadget: u_ether: Fix NULL pointer deref in eth_get_drvinfo
    
    [ Upstream commit e002e92e88e12457373ed096b18716d97e7bbb20 ]
    
    Commit ec35c1969650 ("usb: gadget: f_ncm: Fix net_device lifecycle with
    device_move") reparents the gadget device to /sys/devices/virtual during
    unbind, clearing the gadget pointer. If the userspace tool queries on
    the surviving interface during this detached window, this leads to a
    NULL pointer dereference.
    
    Unable to handle kernel NULL pointer dereference
    Call trace:
     eth_get_drvinfo+0x50/0x90
     ethtool_get_drvinfo+0x5c/0x1f0
     __dev_ethtool+0xaec/0x1fe0
     dev_ethtool+0x134/0x2e0
     dev_ioctl+0x338/0x560
    
    Add a NULL check for dev->gadget in eth_get_drvinfo(). When detached,
    skip copying the fw_version and bus_info strings, which is natively
    handled by ethtool_get_drvinfo for empty strings.
    
    Suggested-by: Val Packett <val@packett.cool>
    Reported-by: Val Packett <val@packett.cool>
    Closes: https://lore.kernel.org/linux-usb/10890524-cf83-4a71-b879-93e2b2cc1fcc@packett.cool/
    Fixes: ec35c1969650 ("usb: gadget: f_ncm: Fix net_device lifecycle with device_move")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
    Link: https://patch.msgid.link/20260316-eth-null-deref-v1-1-07005f33be85@google.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Carlos Llamas <cmllamas@google.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

usb: musb: omap2430: Fix use-after-free in omap2430_probe() [+ + +]
Author: Wentao Liang <vulab@iscas.ac.cn>
Date:   Fri Jun 5 14:31:21 2026 -0400

    usb: musb: omap2430: Fix use-after-free in omap2430_probe()
    
    [ Upstream commit e194ce048f5a6c549b3a23a8c568c6470f40f772 ]
    
    In omap2430_probe(), of_node_put(np) is called prematurely before the
    last access to np, leading to a use-after-free if the node's reference
    count drops to zero. Move the of_node_put() calls after the last use of
    np in both the success and error paths.
    
    Fixes: ffbe2feac59b ("usb: musb: omap2430: Fix probe regression for missing resources")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
    Link: https://patch.msgid.link/20260409101104.480623-1-vulab@iscas.ac.cn
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
USB: quirks: add NO_LPM for Lenovo ThinkPad USB-C Dock Gen2 hub controllers [+ + +]
Author: Stephen J. Fuhry <fuhrysteve@gmail.com>
Date:   Wed May 13 13:14:19 2026 -0400

    USB: quirks: add NO_LPM for Lenovo ThinkPad USB-C Dock Gen2 hub controllers
    
    commit 9ddb9c0deca48d2c2a22ebf4d2f35c925a520328 upstream.
    
    The Lenovo ThinkPad USB-C Dock Gen2 (17ef:a391, 17ef:a392) hub
    controllers exhibit link instability when USB Link Power Management
    is enabled, similar to the dock's Ethernet adapter (17ef:a387) which
    already carries USB_QUIRK_NO_LPM.
    
    When the dock reconnects after a transient disconnect, the hub
    controllers enter LPM states between re-enumeration retries, causing
    repeated disconnect/reconnect cycles lasting up to two minutes.
    Disabling LPM for these devices restores stable enumeration.
    
    Signed-off-by: Stephen J. Fuhry <fuhrysteve@gmail.com>
    Cc: stable <stable@kernel.org>
    Link: https://patch.msgid.link/20260513171419.44849-1-fuhrysteve@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: belkin_sa: validate interrupt status length [+ + +]
Author: Zhang Cen <rollkingzzc@gmail.com>
Date:   Tue May 19 19:11:50 2026 +0800

    USB: serial: belkin_sa: validate interrupt status length
    
    commit 4ce058df2ee02cc2a0f0fd5cd64ce6f1482a0b65 upstream.
    
    The Belkin interrupt callback treats interrupt data as a four-byte
    status report and reads LSR/MSR fields at offsets 2 and 3. The
    interrupt-in buffer length is derived from endpoint wMaxPacketSize, and
    short interrupt transfers may complete successfully with a smaller
    actual_length.
    
    Check the completed interrupt packet length before parsing status
    fields so short interrupt endpoints and short successful packets are
    ignored instead of causing out-of-bounds or stale status-byte reads.
    
    KASAN report as below:
    
    BUG: KASAN: slab-out-of-bounds in belkin_sa_read_int_callback()
    Read of size 1
    Call trace:
      belkin_sa_read_int_callback() (drivers/usb/serial/belkin_sa.c:202)
      __usb_hcd_giveback_urb() (drivers/usb/core/hcd.c:1630)
      dummy_timer() (?:?)
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Assisted-by: Codex:gpt-5.5
    Signed-off-by: Zhang Cen <rollkingzzc@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: cypress_m8: fix memory corruption with small endpoint [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Jun 4 10:36:36 2026 +0200

    USB: serial: cypress_m8: fix memory corruption with small endpoint
    
    commit e1a9d791fd66ab2431b9e6f6f835823809869047 upstream.
    
    Make sure that the interrupt-out endpoint max packet size is at least
    eight bytes to avoid user-controlled slab corruption or NULL-pointer
    dereference should a malicious device report a smaller size.
    
    Fixes: 3416eaa1f8f8 ("USB: cypress_m8: Packet format is separate from characteristic size")
    Cc: stable@vger.kernel.org      # 2.6.26
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    [ johan: adjust context for 6.18 ]
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

USB: serial: cypress_m8: validate interrupt packet headers [+ + +]
Author: Zhang Cen <rollkingzzc@gmail.com>
Date:   Fri May 22 22:54:42 2026 +0800

    USB: serial: cypress_m8: validate interrupt packet headers
    
    commit 9f9bfc80c67f35a275820da7e83a35dface08281 upstream.
    
    cypress_read_int_callback() parses the interrupt-in buffer according to
    the selected Cypress packet format. Format 1 has a two-byte status/count
    header and format 2 has a one-byte combined status/count header. The
    usb-serial core sizes the interrupt-in buffer from the endpoint
    descriptor's wMaxPacketSize, and successful interrupt transfers can
    complete short when URB_SHORT_NOT_OK is not set.
    
    Check that the completed packet contains the selected header before
    reading it. Malformed short reports are ignored and the interrupt URB is
    resubmitted through the existing retry path, preventing out-of-bounds
    header-byte reads.
    
    KASAN report as below:
    KASAN slab-out-of-bounds in cypress_read_int_callback+0x240/0x7f0
    Read of size 1
    Call trace:
      cypress_read_int_callback() (drivers/usb/serial/cypress_m8.c:1009)
      __usb_hcd_giveback_urb()
      dummy_timer()
    
    Fixes: 3416eaa1f8f8 ("USB: cypress_m8: Packet format is separate from characteristic size")
    Assisted-by: Codex:gpt-5.5
    Signed-off-by: Zhang Cen <rollkingzzc@gmail.com>
    Fixes: 3416eaa1f8f8 ("USB: cypress_m8: Packet format is separate from characteristic size")
    Cc: stable@vger.kernel.org      # 2.6.26
    [ johan: use constants in header length sanity checks ]
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: digi_acceleport: fix memory corruption with small endpoints [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Jun 4 14:07:58 2026 +0200

    USB: serial: digi_acceleport: fix memory corruption with small endpoints
    
    commit cb3560e8eab1dfa1cac1ed52631adf8ec6ff2cd5 upstream.
    
    Add the missing bulk-out buffer size sanity checks to avoid
    out-of-bounds memory accesses or slab corruption should a malicious
    device report smaller buffers than expected.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

USB: serial: io_ti: fix heap overflow in build_i2c_fw_hdr() [+ + +]
Author: Adrian Korwel <adriank20047@gmail.com>
Date:   Mon May 25 09:58:32 2026 -0500

    USB: serial: io_ti: fix heap overflow in build_i2c_fw_hdr()
    
    commit 0fd2b00b2d3d05e3eaa13342b3dfb0fa85c226ae upstream.
    
    build_i2c_fw_hdr() allocates a fixed-size buffer of
    (16*1024 - 512) + sizeof(struct ti_i2c_firmware_rec) bytes, then
    copies le16_to_cpu(img_header->Length) bytes into it without
    validating that Length fits within the available space after the
    firmware record header.
    
    img_header->Length is a __le16 from the firmware file and can be
    up to 65535. check_fw_sanity() validates the total firmware size
    but not img_header->Length specifically.
    
    Fix by rejecting images where img_header->Length exceeds the
    available destination space.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Adrian Korwel <adriank20047@gmail.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: io_ti: fix heap overflow in get_manuf_info() [+ + +]
Author: Adrian Korwel <adriank20047@gmail.com>
Date:   Mon May 25 09:58:31 2026 -0500

    USB: serial: io_ti: fix heap overflow in get_manuf_info()
    
    commit 183c1076eca43bbb3e7bdf597456f91d81c73e74 upstream.
    
    get_manuf_info() reads le16_to_cpu(rom_desc->Size) bytes from the
    device I2C EEPROM into a buffer allocated with kmalloc_obj(), which
    is sizeof(struct edge_ti_manuf_descriptor) = 10 bytes.
    
    The Size field comes from the device and is only validated (in
    check_i2c_image()) to make sure the descriptor fits within
    TI_MAX_I2C_SIZE (16384 bytes), not against the destination buffer size.
    A malicious USB device can therefore set Size to any value up to 16377,
    causing a heap overflow of up to 16367 bytes when plugged into a host
    running this driver.
    
    valid_csum() is called after read_rom() and also iterates
    buffer[0..Size-1], compounding the out-of-bounds access.
    
    Fix by rejecting descriptors with unexpected length before calling
    read_rom().
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Adrian Korwel <adriank20047@gmail.com>
    [ johan: amend commit message; also check for short descriptors ]
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: keyspan: fix missing indat transfer sanity check [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Wed May 20 16:26:48 2026 +0200

    USB: serial: keyspan: fix missing indat transfer sanity check
    
    commit ab8336a7e414f018430aa1af3a46944032f7ff96 upstream.
    
    Add the missing sanity check on the size of usa49wg indat transfers to
    avoid parsing stale or uninitialised slab data.
    
    Fixes: 0ca1268e109a ("USB Serial Keyspan: add support for USA-49WG & USA-28XG")
    Cc: stable@vger.kernel.org      # 2.6.23
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: kl5kusb105: fix bulk-out buffer overflow [+ + +]
Author: HyeongJun An <sammiee5311@gmail.com>
Date:   Mon Jun 8 18:09:26 2026 +0900

    USB: serial: kl5kusb105: fix bulk-out buffer overflow
    
    commit 96d47e40bf9db4a9efd5c8fb53287a508d165f14 upstream.
    
    klsi_105_prepare_write_buffer() is called by the generic write path
    with the bulk-out buffer and its size (bulk_out_size, 64 bytes). It
    stores a two-byte length header at the start of the buffer and copies
    the payload from the write fifo starting at buf + KLSI_HDR_LEN, but
    passes the full buffer size as the number of bytes to copy:
    
      count = kfifo_out_locked(&port->write_fifo, buf + KLSI_HDR_LEN,
                               size, &port->lock);
    
    When the fifo holds at least size bytes, size bytes are copied starting
    two bytes into the size-byte buffer, writing KLSI_HDR_LEN bytes past its
    end. Copy at most size - KLSI_HDR_LEN bytes instead, leaving room for
    the header as safe_serial already does.
    
    Writing bulk_out_size or more bytes to the tty triggers a slab
    out-of-bounds write, observed with KASAN by emulating the device with
    dummy_hcd and raw-gadget:
    
      BUG: KASAN: slab-out-of-bounds in kfifo_copy_out+0x83/0xc0
      Write of size 64 at addr ffff888112c62202 by task python3
       kfifo_copy_out
       klsi_105_prepare_write_buffer [kl5kusb105]
       usb_serial_generic_write_start [usbserial]
      Allocated by task 139:
       usb_serial_probe [usbserial]
      The buggy address is located 2 bytes inside of allocated 64-byte region
    
    The out-of-bounds write no longer occurs with this change applied.
    
    Fixes: 60b3013cdaf3 ("USB: kl5usb105: reimplement using generic framework")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-8
    Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: mct_u232: fix memory corruption with small endpoint [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Jun 4 14:11:33 2026 +0200

    USB: serial: mct_u232: fix memory corruption with small endpoint
    
    commit 915b36d701950503c4ea0f6e314b10868e59fce3 upstream.
    
    The driver overrides the maximum transfer size for a specific device
    which only accepts 16 byte packets for its 32 byte bulk-out endpoint.
    
    Make sure to never increase the maximum transfer size to prevent slab
    corruption should a malicious device report a smaller endpoint max
    packet size than expected.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

USB: serial: mct_u232: fix missing interrupt-in transfer sanity check [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Wed May 20 16:27:10 2026 +0200

    USB: serial: mct_u232: fix missing interrupt-in transfer sanity check
    
    commit 245aba83e3c288e176ed037a1f6b618b09e92ed8 upstream.
    
    Add the missing sanity check on the size of interrupt-in transfers to
    avoid parsing stale or uninitialised slab data (and leaking it to user
    space).
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: mxuport: fix memory corruption with small endpoint [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Fri May 22 16:19:50 2026 +0200

    USB: serial: mxuport: fix memory corruption with small endpoint
    
    commit 4085f0dbb1ce2251c9a5938d693de6593f0ab2bd upstream.
    
    Make sure that the bulk-out endpoint max packet size is at least eight
    bytes to avoid user-controlled slab corruption should a malicious device
    report a smaller size.
    
    Fixes: ee467a1f2066 ("USB: serial: add Moxa UPORT 12XX/14XX/16XX driver")
    Cc: stable@vger.kernel.org      # 3.14
    Cc: Andrew Lunn <andrew@lunn.ch>
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: omninet: fix memory corruption with small endpoint [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Fri May 22 16:20:58 2026 +0200

    USB: serial: omninet: fix memory corruption with small endpoint
    
    commit 60df93d30f9bdd27db17c4d80ed80ef718d7226b upstream.
    
    Make sure that the bulk-out buffers are at least as large as the
    hardcoded transfer size to avoid user-controlled slab corruption should
    a malicious device report a smaller endpoint max packet size than
    expected.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: option: add MeiG SRM813Q [+ + +]
Author: Jan Volckaert <janvolck@gmail.com>
Date:   Sun May 17 17:32:37 2026 +0200

    USB: serial: option: add MeiG SRM813Q
    
    commit 7d2b37d3e42d19071b62f4ddbee6e16e905efbf1 upstream.
    
    Add support for the Qualcomm Technology Snapdragon X35-based MeiG
    SRM813Q module.
    
    The module can be put in different modes via AT commands to
    enable/disable GPS functionality:
    
    MODEM - PPP mode(2dee:4d63): AT+SER=1,1
    
    If#= 0: RMNET
    If#= 1: DIAG/ADB
    If#= 2: MODEM
    If#= 3: AT
    
    P:  Vendor=2dee ProdID=4d63 Rev=05.15
    S:  Manufacturer=MEIG
    S:  Product=LTE-A Module
    S:  SerialNumber=1bd51f0e
    C:  #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    
    NMEA mode(2dee:4d64): AT+SER=51,1
    
    If#= 0: RMNET
    If#= 1: DIAG/ADB
    If#= 2: NMEA
    If#= 3: AT
    
    P:  Vendor=2dee ProdID=4d64 Rev=05.15
    S:  Manufacturer=MEIG
    S:  Product=LTE-A Module
    S:  SerialNumber=1bd51f0e
    C:  #Ifs= 4 Cfg#= 1 Atr=80 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=82(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    
    Signed-off-by: Jan Volckaert <janvolck@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: option: add missing RSVD(5) flag for Rolling RW135R-GL [+ + +]
Author: Wanquan Zhong <wanquan.zhong@fibocom.com>
Date:   Wed May 20 19:32:45 2026 +0800

    USB: serial: option: add missing RSVD(5) flag for Rolling RW135R-GL
    
    commit 689f2facc689c8add11d7ff69fbbad17d65ee596 upstream.
    
    The RW135R-GL entry added in commit 01e8d0f74222 ("USB: serial: option:
    add support for Rolling Wireless RW135R-GL") was missing the
    .driver_info = RSVD(5) flag used by other Rolling Wireless MBIM laptop
    modules (e.g. RW135-GL and RW350-GL).
    
    Without this flag, the option driver incorrectly binds to the reserved
    ADB interface (If#5) in multi-interface USB modes, causing AT/MBIM
    communication failures after mode switching. This matches the handling
    of other Rolling Wireless MBIM devices.
    
    - VID:PID 33f8:1003, RW135R-GL for laptop debug M.2 cards (with MBIM
      interface for Linux/Chrome OS)
    
      0x1003: mbim, diag, AT, pipe
    
      Here are the outputs of usb-devices:
    
    T:  Bus=03 Lev=01 Prnt=01 Port=04 Cnt=02 Dev#=  8 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=33f8 ProdID=1003 Rev= 5.15
    S:  Manufacturer=Rolling Wireless S.a.r.l.
    S:  Product=Rolling RW135R-GL Module
    S:  SerialNumber=12345678
    C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA
    A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
    E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
    I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    - VID:PID 33f8:1003, RW135R-GL for laptop debug M.2 cards (with MBIM
      interface for Linux/Chrome OS)
    
      0x1003: mbim, diag, AT, ADB, pipe
    
      Here are the outputs of usb-devices:
    
    T:  Bus=03 Lev=01 Prnt=01 Port=04 Cnt=02 Dev#=  7 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=33f8 ProdID=1003 Rev= 5.15
    S:  Manufacturer=Rolling Wireless S.a.r.l.
    S:  Product=Rolling RW135R-GL Module
    S:  SerialNumber=12345678
    C:* #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
    A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
    E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
    I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    - VID:PID 33f8:1003, RW135R-GL for laptop debug M.2 cards (with MBIM
      interface for Linux/Chrome OS)
    
      0x1003: mbim, pipe
    
      Here are the outputs of usb-devices:
    
    T:  Bus=03 Lev=01 Prnt=01 Port=04 Cnt=02 Dev#=  9 Spd=480  MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=33f8 ProdID=1003 Rev= 5.15
    S:  Manufacturer=Rolling Wireless S.a.r.l.
    S:  Product=Rolling RW135R-GL Module
    S:  SerialNumber=12345678
    C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=500mA
    A:  FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
    I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
    E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
    I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    Fixes: 01e8d0f74222 ("USB: serial: option: add support for Rolling Wireless RW135R-GL")
    Signed-off-by: Wanquan Zhong <wanquan.zhong@fibocom.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: option: add usb-id for Dell Wireless DW5826e-m [+ + +]
Author: Jack Wu <jackbb_wu@compal.com>
Date:   Thu Jun 4 10:04:40 2026 +0800

    USB: serial: option: add usb-id for Dell Wireless DW5826e-m
    
    commit 1938fb9fe38c4f04a3f30bea44f8071c80a63be4 upstream.
    
    Add support for Dell DW5826e-m with USB-id 0x413c:0x81ea
    
    T:  Bus=03 Lev=01 Prnt=01 Port=04 Cnt=01 Dev#=  8 Spd=480  MxCh= 0
    D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=413c ProdID=81ea Rev= 5.04
    S:  Manufacturer=DELL
    S:  Product=DW5826e-m Qualcomm Snapdragon X12 Global LTE-A
    S:  SerialNumber=358988870177734
    C:* #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=500mA
    A:  FirstIf#=12 IfCount= 2 Cls=02(comm.) Sub=0e Prot=00
    I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=option
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
    E:  Ad=84(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:* If#= 4 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
    E:  Ad=87(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
    I:* If#=12 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0e Prot=00 Driver=cdc_mbim
    E:  Ad=88(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
    I:  If#=13 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
    I:* If#=13 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
    E:  Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    Signed-off-by: Jack Wu <jackbb_wu@compal.com>
    Reviewed-by: Lars Melin <larsm17@gmail>
    Cc: stable@vger.kernel.org
    [ johan: reserve also interface 4 ]
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: safe_serial: fix memory corruption with small endpoint [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Fri May 22 16:22:18 2026 +0200

    USB: serial: safe_serial: fix memory corruption with small endpoint
    
    commit 438061ed1ad85e6743e2dce826671772d81089ec upstream.
    
    Make sure that the bulk-out buffer size is at least eight bytes to avoid
    user-controlled slab corruption in "safe" mode should a malicious device
    report a smaller size.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
usb: storage: Add quirks for PNY Elite Portable SSD [+ + +]
Author: Sam Burkels <sam@1a38.nl>
Date:   Fri May 1 15:23:46 2026 +0200

    usb: storage: Add quirks for PNY Elite Portable SSD
    
    commit b53ebb811e00be50a779ce4e7aee604178b4a825 upstream.
    
    The PNY Elite Portable SSD (USB ID 154b:f009) is a sibling of the
    already-quirked PNY Pro Elite SSDs (154b:f00b and 154b:f00d). Like its
    siblings, it uses a Phison-based USB-SATA bridge that exhibits
    firmware bugs when bound to the uas driver.
    
    Without quirks, the device fails to complete READ CAPACITY commands
    when accessed over UAS on a SuperSpeed (USB 3) port. The device
    enumerates and reports as a SCSI direct-access device, but reports
    zero logical blocks and never finishes spin-up:
    
        usb 2-3: new SuperSpeed USB device number 8 using xhci_hcd
        usb 2-3: New USB device found, idVendor=154b, idProduct=f009
        usb 2-3: Product: PNY ELITE PSSD
        usb 2-3: Manufacturer: PNY
        scsi host0: uas
        scsi 0:0:0:0: Direct-Access     PNY      PNY ELITE PSSD   0
        sd 0:0:0:0: [sda] Spinning up disk...
        [...10+ seconds of polling, no progress...]
        sd 0:0:0:0: [sda] Read Capacity(16) failed: hostbyte=DID_ERROR
        sd 0:0:0:0: [sda] Read Capacity(10) failed: hostbyte=DID_ERROR
        sd 0:0:0:0: [sda] 0 512-byte logical blocks: (0 B/0 B)
    
    Tested each individual quirk to find the minimum that fixes this:
      - US_FL_NO_ATA_1X alone: device hangs on spin-up
      - US_FL_NO_REPORT_OPCODES alone: works on USB 2.0, hangs on USB 3.0
      - US_FL_NO_ATA_1X | US_FL_NO_REPORT_OPCODES: works on both
    
    With both quirks the device enumerates correctly while still using
    the uas driver, and delivers full UAS throughput (~281 MB/s
    sequential read on a USB 3.0 Gen 1 port).
    
    The existing PNY Pro Elite entries (f00b, f00d) only set NO_ATA_1X,
    but this device additionally chokes on REPORT OPCODES under
    SuperSpeed.
    
    Signed-off-by: Sam Burkels <sam@1a38.nl>
    Acked-by: Oliver Neukum <oneukum@suse.com>
    Cc: stable <stable@kernel.org>
    Link: https://patch.msgid.link/20260501132346.86572-1-sam@1a38.nl
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: typec: altmodes/displayport: validate count before reading Status Update VDO [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed May 13 17:52:49 2026 +0200

    usb: typec: altmodes/displayport: validate count before reading Status Update VDO
    
    commit 8a18f896e667df491331371b55d4ad644dc51d60 upstream.
    
    A broken/malicious device can send the incorrect count for a status
    update VDO, which will cause the kernel to read uninitialized stack data
    and send it off elsewhere.
    
    Fix this up by correctly verifying the count for the update object.
    
    Assisted-by: gkh_clanker_t1000
    Cc: stable <stable@kernel.org>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Link: https://patch.msgid.link/2026051350-reacquire-sculpture-4244@gregkh
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: typec: tcpm: reset internal port states on soft reset AMS [+ + +]
Author: Amit Sunil Dhamne <amitsd@google.com>
Date:   Tue Apr 14 00:58:32 2026 +0000

    usb: typec: tcpm: reset internal port states on soft reset AMS
    
    commit 2909f0d4994fb4306bf116df5ccee797791fce2c upstream.
    
    Reset internal port states (such as vdm_sm_running and
    explicit_contract) on soft reset AMS as the port needs to negotiate a
    new contract. The consequence of leaving the states in as-is cond are as
    follows:
      * port is in SRC power role and an explicit contract is negotiated
        with the port partner (in sink role)
      * port partner sends a Soft Reset AMS while VDM State Machine is
        running
      * port accepts the Soft Reset request and the port advertises src caps
      * port partner sends a Request message but since the explicit_contract
        and vdm_sm_running are true from previous negotiation, the port ends
        up sending Soft Reset instead of Accept msg.
    
    Stub Log:
    [  203.653942] AMS DISCOVER_IDENTITY start
    [  203.653947] PD TX, header: 0x176f
    [  203.655901] PD TX complete, status: 0
    [  203.657470] PD RX, header: 0x124f [1]
    [  203.657477] Rx VDM cmd 0xff008081 type 2 cmd 1 len 1
    [  203.657482] AMS DISCOVER_IDENTITY finished
    [  203.657484] cc:=4
    [  204.155698] PD RX, header: 0x144f [1]
    [  204.155718] Rx VDM cmd 0xeeee8001 type 0 cmd 1 len 1
    [  204.155741] PD TX, header: 0x196f
    [  204.157622] PD TX complete, status: 0
    [  204.160060] PD RX, header: 0x4d [1]
    [  204.160066] state change SRC_READY -> SOFT_RESET [rev2 SOFT_RESET_AMS]
    [  204.160076] PD TX, header: 0x163
    [  204.162486] PD TX complete, status: 0
    [  204.162832] AMS SOFT_RESET_AMS finished
    [  204.162840] cc:=4
    [  204.162891] AMS POWER_NEGOTIATION start
    [  204.162896] state change SOFT_RESET -> AMS_START [rev2 POWER_NEGOTIATION]
    [  204.162908] state change AMS_START -> SRC_SEND_CAPABILITIES [rev2 POWER_NEGOTIATION]
    [  204.162913] PD TX, header: 0x1361
    [  204.165529] PD TX complete, status: 0
    [  204.165571] pending state change SRC_SEND_CAPABILITIES -> SRC_SEND_CAPABILITIES_TIMEOUT @ 60 ms [rev2 POWER_NEGOTIATION]
    [  204.166996] PD RX, header: 0x1242 [1]
    [  204.167009] state change SRC_SEND_CAPABILITIES -> SRC_SOFT_RESET_WAIT_SNK_TX [rev2 POWER_NEGOTIATION]
    [  204.167019] AMS POWER_NEGOTIATION finished
    [  204.167020] cc:=4
    [  204.167083] AMS SOFT_RESET_AMS start
    [  204.167086] state change SRC_SOFT_RESET_WAIT_SNK_TX -> SOFT_RESET_SEND [rev2 SOFT_RESET_AMS]
    [  204.167092] PD TX, header: 0x16d
    [  204.168824] PD TX complete, status: 0
    [  204.168854] pending state change SOFT_RESET_SEND -> HARD_RESET_SEND @ 60 ms [rev2 SOFT_RESET_AMS]
    [  204.171876] PD RX, header: 0x43 [1]
    [  204.171879] AMS SOFT_RESET_AMS finished
    
    This causes COMMON.PROC.PD.11.2 check failure for
    TEST.PD.VDM.SRC.2_Rev2Src test on the PD compliance tester.
    
    Signed-off-by: Amit Sunil Dhamne <amitsd@google.com>
    Fixes: 8d3a0578ad1a ("usb: typec: tcpm: Respond Wait if VDM state machine is running")
    Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)")
    Cc: stable <stable@kernel.org>
    Reviewed-by: Badhri Jagan Sridharan <badhri@google.com>
    Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Link: https://patch.msgid.link/20260414-fix-soft-reset-v1-1-01d7cb9764e2@google.com
    Signed-off-by: Amit Sunil Dhamne <amitsd@google.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: typec: ucsi: ccg: reject firmware images without a ':' record header [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Thu May 14 19:10:06 2026 +0200

    usb: typec: ucsi: ccg: reject firmware images without a ':' record header
    
    commit d7486952bf74e546ee3748fb14b2d07881fa6273 upstream.
    
    do_flash() locates the first .cyacd record with
    
            p = strnchr(fw->data, fw->size, ':');
            while (p < eof) {
                    s = strnchr(p + 1, eof - p - 1, ':');
                    ...
            }
    
    If the firmware image contains no ':' byte,  strnchr() returns NULL.
    NULL compares less than the valid kernel pointer eof, so the loop body
    runs and strnchr() is called with p + 1 == (void *)1 and a length of
    roughly (unsigned long)eof, causing a wonderful crash.
    
    The not_signed_fw fallthrough earlier in do_flash() and the chip-state
    branches in ccg_fw_update_needed() allow an unsigned blob to reach this
    loop, so a root user who can place a crafted file under /lib/firmware
    and write the do_flash sysfs attribute can trigger the oops.
    
    Bail out with -EINVAL when the initial strnchr() returns NULL.
    
    Assisted-by: gkh_clanker_t1000
    Cc: stable <stable@kernel.org>
    Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Link: https://patch.msgid.link/2026051405-posture-shrill-7884@gregkh
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: typec: ucsi: Check if power role change actually happened before handling [+ + +]
Author: Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
Date:   Fri Jun 5 15:38:29 2026 -0400

    usb: typec: ucsi: Check if power role change actually happened before handling
    
    [ Upstream commit b80e7d34c7ea6a564525119d6138fbb577a23dba ]
    
    The CrOS EC may send a connector status change event with the power
    direction changed flag set even if the power direction hasn't actually
    changed after initiating a SET_PDR command internally [1]. In practice
    this happens on every system suspend due to other changes performed by
    the EC [2][3][4], causing suspend to fail.
    
    Fix this by checking if the power role change actually happened before
    handling it.
    
    [1]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=1689;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
    [2]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=3923;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
    [3]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=5094;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
    [4]: https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform/ec/zephyr/subsys/pd_controller/pdc_power_mgmt.c;l=2229;drc=2d5a1cffce4e5ac8a39442cb3b764d2d5e1cf794
    
    Cc: stable <stable@kernel.org>
    Fixes: 7616f006db07 ("usb: typec: ucsi: Update power_supply on power role change")
    Signed-off-by: Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
    Reported-and-tested-by: Sergey Senozhatsky <senozhatsky@chromium.org>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Link: https://patch.msgid.link/20260519-ucsi-fix-2-v1-1-6f1239535187@qtmlabs.xyz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: typec: ucsi: displayport: NAK DP_CMD_CONFIGURE without a payload VDO [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed May 13 17:52:54 2026 +0200

    usb: typec: ucsi: displayport: NAK DP_CMD_CONFIGURE without a payload VDO
    
    commit 167dd8d12226587ee554f520aed0256b7769cd5d upstream.
    
    ucsi_displayport_vdm() handles a DP_CMD_CONFIGURE by copying the first
    payload VDO from data[], but unlike the equivalent handler in
    altmodes/displayport.c it does not check that count covers a VDO beyond
    the header.  A header-only Configure VDM (count == 1) would read one u32
    past the caller's array.
    
    In the normal UCSI path the caller controls count, so this is hardening
    for non-standard delivery paths.  NAK and bail when no configuration VDO
    is present, matching the generic DP altmode driver's existing guard.
    
    Assisted-by: gkh_clanker_t1000
    Cc: Pooja Katiyar <pooja.katiyar@intel.com>
    Cc: Johan Hovold <johan@kernel.org>
    Cc: stable <stable@kernel.org>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Link: https://patch.msgid.link/2026051351-vividly-flattered-eb3d@gregkh
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: typec: ucsi: Don't update power_supply on power role change if not connected [+ + +]
Author: Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
Date:   Sat Jun 6 09:21:53 2026 -0400

    usb: typec: ucsi: Don't update power_supply on power role change if not connected
    
    [ Upstream commit d98d413ca65d0790a8f3695d0a5845538958ab84 ]
    
    We only need to update the power_supply on power role change if the port
    is connected, because otherwise the online status should be the same for
    both cases.
    
    Cc: stable <stable@kernel.org>
    Fixes: 7616f006db07 ("usb: typec: ucsi: Update power_supply on power role change")
    Signed-off-by: Myrrh Periwinkle <myrrhperiwinkle@qtmlabs.xyz>
    Reported-and-tested-by: Sergey Senozhatsky <senozhatsky@chromium.org>
    Link: https://patch.msgid.link/20260519-ucsi-fix-2-v1-2-6f1239535187@qtmlabs.xyz
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    [ changed `UCSI_CONSTAT(con, CONNECTED)` accessor macro to `con->status.flags & UCSI_CONSTAT_CONNECTED` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: typec: ucsi: validate connector number in ucsi_connector_change() [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed May 13 17:52:55 2026 +0200

    usb: typec: ucsi: validate connector number in ucsi_connector_change()
    
    commit 288a81a8507052bcfbf884d39a463c44c42c5fd9 upstream.
    
    The connector number in a UCSI CCI notification is a 7-bit field
    supplied by the PPM.  ucsi_connector_change() uses it to index the
    ucsi->connector[] array without checking it against the number of
    connectors the PPM reported at init time, so a buggy or malicious PPM
    (EC firmware, or an I2C-attached UCSI controller on the ccg / stm32g0 /
    glink transports) can drive schedule_work() on memory past the end of
    the array.
    
    Reject connector numbers that are zero or exceed cap.num_connectors
    before dereferencing the array.
    
    Assisted-by: gkh_clanker_t1000
    Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Cc: Benson Leung <bleung@chromium.org>
    Cc: Jameson Thies <jthies@google.com>
    Cc: Nathan Rebello <nathan.c.rebello@gmail.com>
    Cc: Johan Hovold <johan@kernel.org>
    Cc: Pooja Katiyar <pooja.katiyar@intel.com>
    Cc: Hsin-Te Yuan <yuanhsinte@chromium.org>
    Cc: Abel Vesa <abelvesa@kernel.org>
    Cc: stable <stable@kernel.org>
    Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Reviewed-by: Benson Leung <bleung@chromium.org>
    Link: https://patch.msgid.link/2026051351-truck-steadfast-df48@gregkh
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: typec: wcove: don't write past struct pd_message in wcove_read_rx_buffer() [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Wed May 13 17:52:48 2026 +0200

    usb: typec: wcove: don't write past struct pd_message in wcove_read_rx_buffer()
    
    commit 4af7ad0e6d7aa4403dbb1dac7b9659b0421efcaa upstream.
    
    wcove_read_rx_buffer() copies the PD RX FIFO into the caller's
    struct pd_message with
    
            for (i = 0; i < USBC_RXINFO_RXBYTES(info); i++)
                    regmap_read(wcove->regmap, USBC_RX_DATA + i, msg + i);
    
    which has two problems:
    
    USBC_RXINFO_RXBYTES() is a 5-bit field (max 31) while struct pd_message
    is 30 bytes (__le16 header + __le32 payload[PD_MAX_PAYLOAD], packed).
    The byte count latched in RXINFO is the number of bytes the port partner
    put on the wire, so a malicious partner that transmits a 31-byte frame
    can drive the loop one byte past the destination if the WCOVE BMC
    receiver does not enforce the PD object-count limit in hardware. The
    existing FIXME flagged this as unverified.
    
    Independently, regmap_read() takes an unsigned int * and stores a full
    unsigned int at the destination. Passing the byte pointer msg + i means
    each iteration writes four bytes; the high three are zero (val_bits is
    8) and are normally overwritten by the next iteration, but the final
    iteration's high bytes are not. With RXBYTES == 30 the i == 29 iteration
    already writes three zero bytes past msg, which sits on the IRQ thread's
    stack in wcove_typec_irq().
    
    Clamp the loop to sizeof(struct pd_message) and read each register into
    a local before storing only its low byte, so the copy can never exceed
    the destination regardless of what RXINFO reports.
    
    Assisted-by: gkh_clanker_t1000
    Cc: stable <stable@kernel.org>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Link: https://patch.msgid.link/2026051347-clustered-deflected-9543@gregkh
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: usbtmc: check URB actual_length for interrupt-IN notifications [+ + +]
Author: Heitor Alves de Siqueira <halves@igalia.com>
Date:   Tue May 5 15:56:03 2026 -0300

    usb: usbtmc: check URB actual_length for interrupt-IN notifications
    
    commit 52f2ad3f7e5eb3b5908e1d685d4342519dc9cfcd upstream.
    
    USBTMC devices can use an optional interrupt endpoint for notification
    messages. These typically contain two-byte headers indicating the
    payload format, but the driver does not check if these headers are
    present before accessing the data buffers. In cases where the URB
    actual_length is not enough to fit these headers, the driver will either
    cause an out-of-bounds read, or consume stale leftover data from a
    previous notification.
    
    Fix by checking if actual_data contains enough bytes for the headers,
    otherwise resubmit URB to the interrupt endpoint.
    
    Fixes: dbf3e7f654c0 ("Implement an ioctl to support the USMTMC-USB488 READ_STATUS_BYTE operation.")
    Reported-by: syzbot+abbfd103085885cf16a2@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=abbfd103085885cf16a2
    Cc: stable <stable@kernel.org>
    Suggested-by: Michal Pecio <michal.pecio@gmail.com>
    Signed-off-by: Heitor Alves de Siqueira <halves@igalia.com>
    Link: https://patch.msgid.link/20260505-usbtmc-iin-size-v3-1-a36113f62db7@igalia.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: usbtmc: reject interrupt endpoints with small wMaxPacketSize [+ + +]
Author: Heitor Alves de Siqueira <halves@igalia.com>
Date:   Tue May 5 15:56:04 2026 -0300

    usb: usbtmc: reject interrupt endpoints with small wMaxPacketSize
    
    commit 121d2f682ba912b1427cddca7cf84840f41cc620 upstream.
    
    The USB488 subclass specification requires interrupt wMaxPacketSize to
    be 0x02, unless the device sends vendor-specific notifications.
    Endpoints that advertise less than 2 bytes for wMaxPacketSize are
    unlikely to work with the current driver, as URBs will not have enough
    space for interrupt headers. Considering that any notification URBs will
    be ignored by the driver, reject these endpoints early during probe.
    
    Fixes: 041370cce889 ("USB: usbtmc: refactor endpoint retrieval")
    Cc: stable <stable@kernel.org>
    Suggested-by: Michal Pecio <michal.pecio@gmail.com>
    Signed-off-by: Heitor Alves de Siqueira <halves@igalia.com>
    Link: https://patch.msgid.link/20260505-usbtmc-iin-size-v3-2-a36113f62db7@igalia.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
usbip: vudc: Fix use after free bug in vudc_remove due to race condition [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Fri Apr 17 12:35:52 2026 -0400

    usbip: vudc: Fix use after free bug in vudc_remove due to race condition
    
    commit d96209626a29ea64666be98c30b30ac82e5f1be6 upstream.
    
    This patch follows up Zheng Wang's 2023 report of a use-after-free in
    vudc_remove(). The original thread stalled on Shuah Khan's request for
    runtime testing of the unplug/unbind path. This patch supplies that
    testing and keeps Zheng's original fix shape.
    
    In vudc_probe(), v_init_timer() binds udc->tr_timer.timer to v_timer().
    usbip_sockfd_store() starts the timer via v_start_timer()/v_kick_timer().
    vudc_remove() can then free the containing struct vudc while the timer is
    still pending or executing.
    
    KASAN confirms the race on an unpatched x86_64 QEMU guest with
    CONFIG_KASAN=y, CONFIG_USBIP_VUDC=y, CONFIG_USB_ZERO=y, and a tight loop
    that repeatedly writes a socket fd to usbip_sockfd, closes the socket
    pair, and unbinds/rebinds usbip-vudc.0:
    
      BUG: KASAN: slab-use-after-free in __run_timer_base.part.0+0x8ba/0x8e0
      Write of size 8 at addr ffff888001b80740 by task trigger_and_unb/239
      Allocated by task 239:
        vudc_probe+0x4d/0xaa0
      Freed by task 239:
        kfree+0x18f/0x520
        device_release_driver_internal+0x388/0x540
        unbind_store+0xd9/0x100
    
    This lands in the timer core rather than v_timer() itself because the
    embedded timer_list is being walked after its containing struct vudc has
    already been freed. The underlying lifetime bug is the same one Zheng
    reported.
    
    With v_stop_timer() called from vudc_remove() and the timer deleted
    synchronously, the same harness completed 5000 bind/unbind iterations
    with no KASAN report.
    
    Fixes: b6a0ca111867 ("usbip: vudc: Add UDC specific ops")
    Cc: stable <stable@kernel.org>
    Reported-by: Zheng Wang <zyytlz.wz@163.com>
    Closes: https://lore.kernel.org/linux-usb/20230317100954.2626573-1-zyytlz.wz@163.com/
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Acked-by: Shuah Khan <skhan@linuxfoundation.org>
    Link: https://patch.msgid.link/20260417163552.807548-1-michael.bommarito@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
vsock/vmci: fix sk_ack_backlog leak on failed handshake [+ + +]
Author: Raf Dickson <rafdog35@gmail.com>
Date:   Tue May 26 10:43:56 2026 +0000

    vsock/vmci: fix sk_ack_backlog leak on failed handshake
    
    commit c05fa14db43ebef3bd862ca9d073981c0358b3f0 upstream.
    
    When vmci_transport_recv_connecting_server() returns an error,
    vmci_transport_recv_listen() calls vsock_remove_pending() but never
    calls sk_acceptq_removed(). This leaves sk_ack_backlog incremented
    permanently.
    
    Repeated handshake failures (malformed packets, queue pair alloc
    failure, event subscribe failure) cause sk_ack_backlog to climb
    toward sk_max_ack_backlog. Once it reaches the limit the listener
    permanently refuses all new connections with -ECONNREFUSED, a
    silent denial of service requiring a process restart to recover.
    
    The two existing sk_acceptq_removed() calls in af_vsock.c do not
    cover this path: line 764 checks vsock_is_pending() which returns
    false after vsock_remove_pending(), and line 1889 is only reached
    on successful accept().
    
    Fix by balancing sk_acceptq_added() with sk_acceptq_removed() on
    the error path.
    
    Fixes: d021c344051a ("VSOCK: Introduce VM Sockets")
    Cc: stable@vger.kernel.org
    Signed-off-by: Raf Dickson <rafdog35@gmail.com>
    Acked-by: Stefano Garzarella <sgarzare@redhat.com>
    Link: https://patch.msgid.link/20260526104356.469928-1-rafdog35@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
vxlan: do not reuse cached ip_hdr() value after skb_tunnel_check_pmtu() [+ + +]
Author: Eric Dumazet <edumazet@google.com>
Date:   Mon May 25 20:36:42 2026 +0000

    vxlan: do not reuse cached ip_hdr() value after skb_tunnel_check_pmtu()
    
    [ Upstream commit 7d9ef0cb271555d8cf39fefe6c981e1493b25ecf ]
    
    skb_tunnel_check_pmtu() can change skb->head.
    
    Reusing old_iph afer skb_tunnel_check_pmtu() can cause an UAF.
    
    Use instead ip_hdr(skb) as done in drivers/net/bareudp.c
    and drivers/net/geneve.c.
    
    Found by Sashiko.
    
    Fixes: 4cb47a8644cc ("tunnels: PMTU discovery support for directly bridged IP packets")
    Signed-off-by: Eric Dumazet <edumazet@google.com>
    Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
    Link: https://patch.msgid.link/20260525203642.2389723-1-edumazet@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

vxlan: vnifilter: fix spurious notification on VNI update [+ + +]
Author: Andy Roulin <aroulin@nvidia.com>
Date:   Tue Jun 2 11:51:37 2026 -0700

    vxlan: vnifilter: fix spurious notification on VNI update
    
    [ Upstream commit 84683b5b60c7274e2c8f7f413d39d78d3db5540f ]
    
    When a VNI is re-added with the same attributes (e.g. same group or no
    group), vxlan_vni_update() sends a spurious RTM_NEWTUNNEL notification
    even though nothing changed.
    
    The bug is that 'if (changed)' tests whether the pointer is non-NULL,
    not the bool value it points to. Since every caller passes a valid
    pointer, the condition is always true and the notification fires
    unconditionally.
    
    Fix by dereferencing the pointer: 'if (*changed)'.
    
    Reproducer:
    
     # ip link add vxlan100 type vxlan dstport 4789 local 10.0.0.1 \
          nolearning external vnifilter
     # ip link set vxlan100 up
     # bridge monitor vni &
     # bridge vni add vni 1000 dev vxlan100
     # bridge vni add vni 1000 dev vxlan100  # spurious notification
    
    Fixes: f9c4bb0b245c ("vxlan: vni filtering support on collect metadata device")
    Signed-off-by: Andy Roulin <aroulin@nvidia.com>
    Reviewed-by: Petr Machata <petrm@nvidia.com>
    Link: https://patch.msgid.link/20260602185138.253265-3-aroulin@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

vxlan: vnifilter: send notification on VNI add [+ + +]
Author: Andy Roulin <aroulin@nvidia.com>
Date:   Tue Jun 2 11:51:36 2026 -0700

    vxlan: vnifilter: send notification on VNI add
    
    [ Upstream commit aa6ca1c5c338907817374b59f7551fd855a88754 ]
    
    When a new VNI is added to a vxlan device with vnifilter enabled,
    no RTM_NEWTUNNEL notification is sent to userspace. This means
    'bridge monitor vni' never shows VNI add events, even though
    VNI delete events are reported correctly.
    
    The bug is in vxlan_vni_add(), where the notification is guarded by
    'if (changed)'. The 'changed' flag is set by vxlan_vni_update_group()
    only when the multicast group or remote IP is modified, but for a
    new VNI added without a group (e.g. in L3 VxLAN interface scenarios),
    the function returns early without setting changed=true. Since this
    is a new VNI, the notification should be sent unconditionally.
    
    The notification is not guarded by the return value of
    vxlan_vni_update_group() because, at this point, the VNI has already
    been inserted into the hash table and list with no rollback on error.
    The VNI will be visible in 'bridge vni show' regardless, so userspace
    should be informed. This is consistent with vxlan_vni_del() which also
    notifies unconditionally.
    
    The 'if (changed)' guard remains correct in vxlan_vni_update(), which
    handles the case where a VNI already exists and is being re-added --
    there, we only want to notify if the group/remote actually changed.
    
    Reproducer:
    
     # ip link add vxlan100 type vxlan dstport 4789 local 10.0.0.1 \
          nolearning external vnifilter
     # ip link set vxlan100 up
     # bridge monitor vni &
     # bridge vni add vni 1000 dev vxlan100    # no notification
     # bridge vni delete vni 1000 dev vxlan100 # notification received
    
    Fixes: f9c4bb0b245c ("vxlan: vni filtering support on collect metadata device")
    Reported-by: Chirag Shah <chirag@nvidia.com>
    Signed-off-by: Andy Roulin <aroulin@nvidia.com>
    Reviewed-by: Petr Machata <petrm@nvidia.com>
    Link: https://patch.msgid.link/20260602185138.253265-2-aroulin@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
wifi: brcmfmac: Fix potential use-after-free issue when stopping watchdog task [+ + +]
Author: Marek Szyprowski <m.szyprowski@samsung.com>
Date:   Wed May 13 08:48:41 2026 -0400

    wifi: brcmfmac: Fix potential use-after-free issue when stopping watchdog task
    
    [ Upstream commit c623b63580880cc742255eaed3d79804c1b91143 ]
    
    Watchdog task might end between send_sig() and kthread_stop() calls, what
    results in the use-after-free issue. Fix this by increasing watchdog task
    reference count before calling send_sig() and dropping it by switching to
    kthread_stop_put().
    
    Cc: stable@vger.kernel.org
    Fixes: 373c83a801f1 ("brcmfmac: stop watchdog before detach and free everything")
    Fixes: a9ffda88be74 ("brcm80211: fmac: abstract bus_stop interface function pointer")
    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
    Link: https://patch.msgid.link/20260416093339.2066829-1-m.szyprowski@samsung.com
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    [ replaced kthread_stop_put() with open-coded kthread_stop() + put_task_struct() ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

wifi: mac80211: remove station if connection prep fails [+ + +]
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Wed May 13 07:48:48 2026 -0400

    wifi: mac80211: remove station if connection prep fails
    
    [ Upstream commit 283fc9e44ff5b5ac967439b4951b80bd4299f4e4 ]
    
    If connection preparation fails for MLO connections, then the
    interface is completely reset to non-MLD. In this case, we must
    not keep the station since it's related to the link of the vif
    being removed. Delete an existing station. Any "new_sta" is
    already being removed, so that doesn't need changes.
    
    This fixes a use-after-free/double-free in debugfs if that's
    enabled, because a vif going from MLD (and to MLD, but that's
    not relevant here) recreates its entire debugfs.
    
    Cc: stable@vger.kernel.org
    Fixes: 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link")
    Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20260505151533.c4e52deb06ad.Iafe56cec7de8512626169496b134bce3a6c17010@changeid
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    [ used sta_info_destroy_addr() instead of __sta_info_destroy() ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

wifi: mwifiex: fix use-after-free in mwifiex_adapter_cleanup() [+ + +]
Author: Daniel Hodges <git@danielhodges.dev>
Date:   Thu Apr 30 13:56:43 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: stable@vger.kernel.org
    Signed-off-by: Daniel Hodges <git@danielhodges.dev>
    Link: https://patch.msgid.link/20260206194401.2346-1-git@danielhodges.dev
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    [ changed `timer_delete_sync()` to `del_timer_sync()` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

wifi: nl80211: reject oversized EMA RNR lists [+ + +]
Author: Yuqi Xu <xuyuqiabc@gmail.com>
Date:   Fri May 29 23:25:37 2026 +0800

    wifi: nl80211: reject oversized EMA RNR lists
    
    commit 4cd92957e8f8cc4ebfe8a5d4203c14c592fde6b1 upstream.
    
    nl80211_parse_rnr_elems() stores the parsed element count in a
    u8-backed cfg80211_rnr_elems::cnt field and uses that count to size
    the flexible array allocation.
    
    Reject nested NL80211_ATTR_EMA_RNR_ELEMS input once the count reaches
    255, before incrementing it again. This keeps the parser aligned with
    the data structure it fills and matches the existing bound check used
    by nl80211_parse_mbssid_elems().
    
    Fixes: dbbb27e183b1 ("cfg80211: support RNR for EMA AP")
    Cc: stable@kernel.org
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Assisted-by: Codex:gpt-5.4
    Signed-off-by: Yuqi Xu <xuyuqiabc@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Link: https://patch.msgid.link/20260529152542.1412734-1-n05ec@lzu.edu.cn
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
wireguard: send: append trailer after expanding head [+ + +]
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date:   Fri May 29 19:31:34 2026 +0200

    wireguard: send: append trailer after expanding head
    
    commit f75e3eb08fe31d30a9af6ed80cdd22e6772837e2 upstream.
    
    With how this is currently written, we add the trailer, zero it out, and
    then add the header space on. If that header space requires a
    reallocation + copy, the zeros in the trailer aren't copied, because the
    skb len hasn't actually been yet expanded to cover that. Instead add the
    padding at the end of the process rather than at the beginning.
    
    Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
    Cc: stable@vger.kernel.org
    Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
    Link: https://patch.msgid.link/20260529173134.3080773-2-Jason@zx2c4.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
x86/CPU/AMD: Move the Zen3 BTC_NO detection to the Zen3 init function [+ + +]
Author: Borislav Petkov (AMD) <bp@alien8.de>
Date:   Wed Nov 1 11:28:31 2023 +0100

    x86/CPU/AMD: Move the Zen3 BTC_NO detection to the Zen3 init function
    
    commit affc66cb96f865b3763a8e18add52e133d864f04 upstream.
    
    No functional changes.
    
    Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
    Reviewed-by: Nikolay Borisov <nik.borisov@suse.com>
    Link: http://lore.kernel.org/r/20231120104152.13740-4-bp@alien8.de
    Stable-dep-of: 7c81ad8e8bc2 ("x86/CPU/AMD: Rename init_amd_zn() to init_amd_zen_common()")
    [bwh: Adjusted to apply after backports of the above commit which actually
     depended on this]
    Signed-off-by: Ben Hutchings <benh@debian.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
xfrm: ah: account for ESN high bits in async callbacks [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Wed May 13 12:52:55 2026 -0400

    xfrm: ah: account for ESN high bits in async callbacks
    
    [ Upstream commit ec54093e6a8f87e800bb6aa15eb7fc1e33faa524 ]
    
    AH allocates its temporary auth/ICV layout differently when ESN is enabled:
    the async ahash setup appends a 4-byte seqhi slot before the ICV or
    auth_data area, but the async completion callbacks still reconstruct the
    temporary layout as if seqhi were absent.
    
    With an async AH implementation selected, that makes AH copy or compare
    the wrong bytes on both the IPv4 and IPv6 paths. In UML repro on IPv4 AH
    with ESN and forced async hmac(sha1), ping fails with 100% packet loss,
    and the callback logs show the pre-fix drift:
    
      ah4 output_done: esn=1 err=0 icv_off=20 expected_off=24
      ah4 input_done: esn=1 auth_off=20 expected_auth_off=24 icv_off=32 expected_icv_off=36
    
    Reconstruct the callback-side layout the same way the setup path built it
    by skipping the ESN seqhi slot before locating the saved auth_data or ICV.
    Per RFC 4302, the ESN high-order 32 bits participate in the AH ICV
    computation, so the async callbacks must account for the seqhi slot.
    
    Post-fix, the same IPv4 AH+ESN+forced-async-hmac(sha1) UML repro shows
    the corrected offset (ah4 output_done: esn=1 err=0 icv_off=24
    expected_off=24) and ping succeeds; net/ipv4/ah4.o and net/ipv6/ah6.o
    build clean at W=1. IPv6 AH+ESN was not exercised at runtime, and the
    change has not been tested against a real async hardware AH engine.
    
    Fixes: d4d573d0334d ("{IPv4,xfrm} Add ESN support for AH egress part")
    Fixes: d8b2a8600b0e ("{IPv4,xfrm} Add ESN support for AH ingress part")
    Fixes: 26dd70c3fad3 ("{IPv6,xfrm} Add ESN support for AH egress part")
    Fixes: 8d6da6f32557 ("{IPv6,xfrm} Add ESN support for AH ingress part")
    Cc: stable@vger.kernel.org
    Assisted-by: Codex:gpt-5-4
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfrm: ah: use skb_to_full_sk in async output callbacks [+ + +]
Author: Michael Bommarito <michael.bommarito@gmail.com>
Date:   Fri May 15 11:45:31 2026 -0400

    xfrm: ah: use skb_to_full_sk in async output callbacks
    
    commit 79d8be262377f7112cfa3088dfc4142d5a2533f3 upstream.
    
    When AH output is offloaded to an asynchronous crypto provider
    (hardware accelerators such as AMD CCP, or a forced-async software
    shim used for testing), the digest completion fires
    ah_output_done() / ah6_output_done() on a workqueue.  The egress
    skb at that point may have been originated by a TCP listener
    sending a SYN-ACK, which sets skb->sk to a request_sock via
    skb_set_owner_edemux(); it may also have been originated by an
    inet_timewait_sock retransmit.  Neither is a full struct sock, and
    passing the raw skb->sk to xfrm_output_resume() then forwards a
    non-full socket through the rest of the xfrm output chain.
    
    xfrm_output_resume() and its downstream consumers expect a full
    sk where they dereference at all.  The natural egress path
    through ah_output_done() does not crash today because the
    consumers that read past sock_common are either gated by
    sk_fullsock() or short-circuit on flags that are clear on a fresh
    request_sock; an exhaustive walk of the 50 most plausible
    consumers under sch_fq, dev_queue_xmit, netfilter, tc-egress and
    cgroup-egress BPF found no current unguarded deref.  The bug is
    still a real type confusion that future consumer changes could
    turn into a memory-corruption primitive.
    
    This is the same bug class fixed for ESP in commit 1620c88887b1
    ("xfrm: Fix the usage of skb->sk").  Apply the analogous fix to
    AH: convert skb->sk to a full socket pointer (or NULL) via
    skb_to_full_sk() before handing it to xfrm_output_resume().
    
    The same async AH callbacks were touched recently for an
    independent ESN-related ICV layout bug in commit ec54093e6a8f
    ("xfrm: ah: account for ESN high bits in async callbacks"); the
    sk type-confusion addressed here is orthogonal.  This patch is
    part of an ongoing audit of the AH callback paths; an ah_output
    ihl-validation hardening series is also currently under review on
    netdev.
    
    Reproduced under UML + KASAN + lockdep with a forced-async
    hmac(sha1) shim that registers at priority 9999 and wraps the
    sync in-tree hmac-sha1-lib.  With the shim loaded, ah_output_done
    runs on every SYN-ACK egress through a transport-mode AH SA and
    skb->sk arrives as a request_sock (TCP_NEW_SYN_RECV); after this
    patch, xfrm_output_resume() receives the listener (the result of
    sk_to_full_sk()) and consumer derefs land on full-sock fields as
    intended.
    
    Fixes: 9ab1265d5231 ("xfrm: Use actual socket sk instead of skb socket for xfrm_output_resume")
    Cc: stable@vger.kernel.org
    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfrm: Check for underflow in xfrm_state_mtu [+ + +]
Author: David Ahern <dahern@nvidia.com>
Date:   Wed May 13 10:49:14 2026 -0600

    xfrm: Check for underflow in xfrm_state_mtu
    
    [ Upstream commit 742b04d0550b0ec89dcbc99537ec88653bd1ad90 ]
    
    Leo Lin reported OOB write issue in esp component:
    
      xfrm_state_mtu() returns u32 but performs its arithmetic in unsigned
      modulo-2^32 space using an attacker-influenced "header_len + authsize +
      net_adj" subtracted from a small "mtu" argument. A nobody user can
      install an IPv4 ESP tunnel SA with a large authentication key
      (XFRMA_ALG_AUTH_TRUNC, e.g. hmac(sha512), 64-byte key, 64-byte trunc),
      configure a small interface MTU (68 bytes), and set XFRMA_TFCPAD to a
      large value. When a single UDP datagram is then sent through the
      tunnel, xfrm_state_mtu() underflows to a near-2^32 value, and
      esp_output() consumes it as a signed int via:
    
            padto      = min(x->tfcpad, xfrm_state_mtu(x, mtu_cached))
            esp.tfclen = padto - skb->len   (assigned to int)
    
      esp.tfclen ends up negative (e.g. -207). It is sign-extended to size_t
      when passed to memset() inside esp_output_fill_trailer(), producing a
      ~16 EB write of zeroes at skb_tail_pointer(skb). KASAN logs it as
      "Write of size 18446744073709551537 at addr ffff888...".
    
    Check for underflow and return 1. This causes the sendmsg attempt to
    fail with ENETUNREACH.
    
    Fixes: c5c252389374 ("[XFRM]: Optimize MTU calculation")
    Reported-by: Leo Lin <leo@depthfirst.com>
    Assisted-by: Codex:26.506.31004
    Signed-off-by: David Ahern <dahern@nvidia.com>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

xfrm: defensively unhash xfrm_state lists in __xfrm_state_delete [+ + +]
Author: Michal Kosiorek <mkosiorek121@gmail.com>
Date:   Wed May 13 13:31:43 2026 -0400

    xfrm: defensively unhash xfrm_state lists in __xfrm_state_delete
    
    [ Upstream commit 14acf9652e5690de3c7486c6db5fb8dafd0a32a3 ]
    
    KASAN reproduces a slab-use-after-free in __xfrm_state_delete()'s
    hlist_del_rcu calls under syzkaller load on linux-6.12.y stable
    (reproduced on 6.12.47, also reachable via the same code path on
    torvalds/master and on the ipsec tree). Nine unique signatures cluster
    in the xfrm_state lifecycle, the load-bearing one being:
    
      BUG: KASAN: slab-use-after-free in __hlist_del include/linux/list.h:990 [inline]
      BUG: KASAN: slab-use-after-free in hlist_del_rcu include/linux/rculist.h:516 [inline]
      BUG: KASAN: slab-use-after-free in __xfrm_state_delete net/xfrm/xfrm_state.c
      Write of size 8 at addr ffff8881198bcb70 by task kworker/u8:9/435
    
      Workqueue: netns cleanup_net
      Call Trace:
       __hlist_del / hlist_del_rcu
       __xfrm_state_delete
       xfrm_state_delete
       xfrm_state_flush
       xfrm_state_fini
       ops_exit_list
       cleanup_net
    
    The other observed signatures hit the same slab object from
    __xfrm_state_lookup, xfrm_alloc_spi, __xfrm_state_insert and an OOB
    write variant of __xfrm_state_delete, all on the byseq/byspi
    hash chains.
    
    __xfrm_state_delete() guards its byseq and byspi unhashes with
    value-based predicates:
    
            if (x->km.seq)
                    hlist_del_rcu(&x->byseq);
            if (x->id.spi)
                    hlist_del_rcu(&x->byspi);
    
    while everywhere else in the file (e.g. state_cache, state_cache_input)
    the safer hlist_unhashed() check is used. xfrm_alloc_spi() sets
    x->id.spi = newspi inside xfrm_state_lock and then immediately inserts
    into byspi, but a path that observes x->id.spi != 0 outside of
    xfrm_state_lock can still skip-or-hit the byspi unhash inconsistently
    with whether x is actually on the list. The same holds for x->km.seq
    versus byseq, and the bydst/bysrc unhashes have no predicate at all,
    so a second __xfrm_state_delete() on the same object writes through
    LIST_POISON pprev.
    
    The defensive change here:
    
      - Use hlist_del_init_rcu() instead of hlist_del_rcu() on bydst,
        bysrc, byseq and byspi so a second deletion is a no-op rather
        than a write through LIST_POISON pprev. The byseq/byspi nodes
        are already initialised in xfrm_state_alloc().
      - Test hlist_unhashed() rather than the value predicate for
        byseq/byspi, so the unhash decision tracks list state rather than
        mutable scalar fields.
    
    Empirical verification: applied this patch on top of v6.12.47, rebuilt,
    and re-ran the same syzkaller harness for 1h16m on a previously-crashy
    configuration that produced ~100 hits each of slab-use-after-free
    Read in xfrm_alloc_spi / Read in __xfrm_state_lookup / Write in
    __xfrm_state_delete. After the patch, 7.1M execs across 32 VMs at
    ~1550 exec/sec produced zero xfrm_state UAF/OOB hits. /proc/slabinfo
    confirms the xfrm_state slab is actively allocated and freed during
    the run (~143 KiB resident), so the fuzzer is still exercising those
    code paths -- they just no longer crash.
    
    Reproduction:
    
      - Linux 6.12.47 x86_64 + KASAN_GENERIC + KASAN_INLINE + KCOV
      - syzkaller @ 746545b8b1e4c3a128db8652b340d3df90ce61db
      - 32 QEMU/KVM VMs x 2 vCPU on AWS c5.metal bare metal
      - 9 unique signatures collected in ~9h, all within xfrm_state
        lifecycle
    
    Fixes: fe9f1d8779cb ("xfrm: add state hashtable keyed by seq")
    Fixes: 7b4dc3600e48 ("[XFRM]: Do not add a state whose SPI is zero to the SPI hash.")
    Reported-by: Michal Kosiorek <mkosiorek121@gmail.com>
    Tested-by: Michal Kosiorek <mkosiorek121@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Michal Kosiorek <mkosiorek121@gmail.com>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    [ dropped state_cache/state_cache_input unhash hunks and xfrm_nat_keepalive_state_updated() call ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfrm: esp: restore combined single-frag length gate [+ + +]
Author: Jingguo Tan <tanjingguo@huawei.com>
Date:   Mon May 18 17:06:48 2026 +0800

    xfrm: esp: restore combined single-frag length gate
    
    commit dfa0d7b0ff1eb6b2c416b8fdb9b4f2cefba57a40 upstream.
    
    The ESP out-of-place fast path appends the trailer in esp_output_head()
    before esp_output_tail() allocates the destination page frag. The
    head-side gate currently checks skb->data_len and tailen separately, but
    the tail code allocates a single destination frag from the combined
    post-trailer skb->data_len.
    
    Reject the page-frag fast path when the combined aligned length exceeds a
    page. Otherwise skb_page_frag_refill() may fall back to a single page while
    the destination sg still spans the combined skb->data_len.
    
    Restore this combined-length page gate for both IPv4 and IPv6.
    
    Fixes: 5bd8baab087d ("esp: limit skb_page_frag_refill use to a single page")
    Cc: stable@vger.kernel.org
    Signed-off-by: Lin Ma <malin89@huawei.com>
    Signed-off-by: Chenyuan Mi <michenyuan@huawei.com>
    Signed-off-by: Jingguo Tan <tanjingguo@huawei.com>
    Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfrm: espintcp: do not reuse an in-progress partial send [+ + +]
Author: Wyatt Feng <bronzed_45_vested@icloud.com>
Date:   Wed Jun 3 00:46:27 2026 +0800

    xfrm: espintcp: do not reuse an in-progress partial send
    
    commit c381039ade2e161ab08c0eda73c4f8b9a7115928 upstream.
    
    espintcp keeps a single in-flight transmit in ctx->partial.
    Before building a new sk_msg, espintcp_sendmsg() first tries to flush
    that state through espintcp_push_msgs().
    
    For blocking callers, espintcp_push_msgs() may return success even when
    the previous partial send is still pending. espintcp_sendmsg() would
    then reinitialize emsg->skmsg and reuse ctx->partial while the old
    transfer still owns that state.
    
    Do not rebuild the send message when ctx->partial is still in progress.
    If espintcp_push_msgs() returns with emsg->len still set, fail the new
    send instead of overwriting the live partial state.
    
    This is a memory-safety fix: reusing the live partial-send state can
    leave a stale offset attached to a new sk_msg and lead to an out-of-
    bounds read in the send path.
    
    tcp_sendmsg_locked() already handles waiting for send buffer memory, so
    the fix here is just to preserve espintcp's one-message-at-a-time
    transmit state.
    
    Fixes: e27cca96cd68 ("xfrm: add espintcp (RFC 8229)")
    Cc: stable@kernel.org
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Yifan Wu <yifanwucs@gmail.com>
    Reported-by: Juefei Pu <tomapufckgml@gmail.com>
    Reported-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Assisted-by: Codex:GPT-5.4
    Signed-off-by: Wyatt Feng <bronzed_45_vested@icloud.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfrm: input: hold netns during deferred transport reinjection [+ + +]
Author: Zhengchuan Liang <zcliangcn@gmail.com>
Date:   Fri May 22 17:31:55 2026 +0800

    xfrm: input: hold netns during deferred transport reinjection
    
    commit c16f74dc1d75d0e2e7670076d5375deda110ebeb upstream.
    
    Transport-mode reinjection stores a struct net pointer in skb->cb and
    uses it later from xfrm_trans_reinject(). That pointer must stay valid
    until the deferred callback runs.
    
    Take a netns reference when queueing deferred reinjection work and drop
    it after the callback completes. Use maybe_get_net() so the queueing
    path does not revive a namespace that is already being torn down.
    
    This keeps the existing workqueue design and fixes the netns lifetime
    handling in one place for all users of xfrm_trans_queue_net().
    
    Fixes: 7b3801927e52 ("xfrm: introduce xfrm_trans_queue_net")
    Cc: stable@kernel.org
    Reported-by: Yuan Tan <yuantan098@gmail.com>
    Reported-by: Xin Liu <bird@lzu.edu.cn>
    Co-developed-by: Luxing Yin <tr0jan@lzu.edu.cn>
    Signed-off-by: Luxing Yin <tr0jan@lzu.edu.cn>
    Signed-off-by: Zhengchuan Liang <zcliangcn@gmail.com>
    Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
    Assisted-by: Codex:gpt-5.4
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xfrm: policy: fix use-after-free on inexact bin in xfrm_policy_bysel_ctx() [+ + +]
Author: Sanghyun Park <sanghyun.park.cnu@gmail.com>
Date:   Tue Jun 2 18:49:05 2026 +0900

    xfrm: policy: fix use-after-free on inexact bin in xfrm_policy_bysel_ctx()
    
    [ Upstream commit 7f2d76c9c03257c0782afef9d95321fa04096f60 ]
    
    Fix the race by pruning the bin while still holding xfrm_policy_lock,
    before dropping it. Use __xfrm_policy_inexact_prune_bin() directly since
    the lock is already held. The wrapper xfrm_policy_inexact_prune_bin()
    becomes unused and is removed.
    
    Race:
    
      CPU0 (XFRM_MSG_DELPOLICY)           CPU1 (XFRM_MSG_NEWSPDINFO)
      ==========================          ==========================
      xfrm_policy_bysel_ctx():
        spin_lock_bh(xfrm_policy_lock)
        bin = xfrm_policy_inexact_lookup()
        __xfrm_policy_unlink(pol)
        spin_unlock_bh(xfrm_policy_lock)
        xfrm_policy_kill(ret)
        // wide window, lock not held
                                           xfrm_hash_rebuild():
                                             spin_lock_bh(xfrm_policy_lock)
                                             __xfrm_policy_inexact_flush():
                                               kfree_rcu(bin)  // bin freed
                                             spin_unlock_bh(xfrm_policy_lock)
        xfrm_policy_inexact_prune_bin(bin)
        // UAF: bin is freed
    
    Fixes: 6be3b0db6db8 ("xfrm: policy: add inexact policy search tree infrastructure")
    Signed-off-by: Sanghyun Park <sanghyun.park.cnu@gmail.com>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

xfrm: route MIGRATE notifications to caller's netns [+ + +]
Author: Maoyi Xie <maoyixie.tju@gmail.com>
Date:   Mon May 4 22:27:36 2026 +0800

    xfrm: route MIGRATE notifications to caller's netns
    
    commit 7e2a4f7ca0952820731ef7bdadfc9a9e9d3571b4 upstream.
    
    xfrm_send_migrate() in net/xfrm/xfrm_user.c and pfkey_send_migrate()
    in net/key/af_key.c both hardcode &init_net for the multicast that
    announces a successful XFRM_MSG_MIGRATE / SADB_X_MIGRATE.
    
    XFRM_MSG_MIGRATE arrives on a per-netns NETLINK_XFRM socket, and the
    rest of the xfrm/af_key netlink path was made netns-aware in 2008.
    The other 14 multicast paths in xfrm_user.c route their event using
    xs_net(x), xp_net(xp) or sock_net(skb->sk); only the migrate path
    was missed.
    
    Two consequences of the init_net hardcoding:
    
      1. The notification (selector, old/new endpoint addresses, and the
         km_address) is delivered to listeners on init_net's
         XFRMNLGRP_MIGRATE / pfkey BROADCAST_ALL groups rather than on
         the issuing netns. An IKE daemon running in init_net therefore
         receives migration notifications originating from any other
         netns on the host.
    
      2. An IKE daemon running inside a non-init netns and subscribed
         to its own XFRMNLGRP_MIGRATE / pfkey groups never receives the
         notification of its own migration. IKEv2 MOBIKE / address-update
         handling inside a netns is silently broken.
    
    Thread struct net through km_migrate() and the xfrm_mgr.migrate
    function pointer, drop the &init_net override in xfrm_send_migrate()
    and pfkey_send_migrate(), and pass the caller's net (already in
    scope in xfrm_migrate() via sock_net(skb->sk)) all the way down.
    struct xfrm_mgr is in-tree only and not exported as a stable API,
    so the function-pointer signature change is internal.
    
    pfkey_broadcast() is already netns-aware via net_generic(net,
    pfkey_net_id) since the pernet conversion. The five other
    pfkey_broadcast() callers in af_key.c already pass xs_net(x),
    sock_net(sk) or a per-netns net, so this only removes the
    &init_net outlier.
    
    Fixes: 5c79de6e79cd ("[XFRM]: User interface for handling XFRM_MSG_MIGRATE")
    Cc: stable@vger.kernel.org # v5.15+
    Signed-off-by: Maoyi Xie <maoyi.xie@ntu.edu.sg>
    Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
xfs: fix a resource leak in xfs_alloc_buftarg() [+ + +]
Author: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Date:   Fri May 8 10:52:06 2026 -0400

    xfs: fix a resource leak in xfs_alloc_buftarg()
    
    [ Upstream commit 29a7b2614357393b176ef06ba5bc3ff5afc8df69 ]
    
    In the error path, call fs_put_dax() to drop the DAX
    device reference.
    
    Fixes: 6f643c57d57c ("xfs: implement ->notify_failure() for XFS")
    Cc: stable@vger.kernel.org
    Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
    Reviewed-by: Darrick J. Wong <djwong@kernel.org>
    Signed-off-by: Carlos Maiolino <cem@kernel.org>
    [ kept `kmem_free(btp)` and `return NULL` instead of `kfree(btp)`/`ERR_PTR(error)` ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
xhci: tegra: Fix ghost USB device on dual-role port unplug [+ + +]
Author: Wei-Cheng Chen <weichengc@nvidia.com>
Date:   Thu Jun 4 20:19:13 2026 +0800

    xhci: tegra: Fix ghost USB device on dual-role port unplug
    
    [ Upstream commit 5a4c828b8b29b47534814ade26d9aee09d5101fc ]
    
    When a USB device is unplugged from the dual-role port, the device-mode
    path in tegra_xhci_id_work() explicitly clears both SS and HS port power
    via direct hub_control ClearPortFeature(POWER) calls. This preempts the
    xHCI controller's normal disconnect processing -- PORT_CSC is never
    generated, the USB core never sees the disconnect, and the device remains
    in its internal tree as a ghost visible in lsusb.
    
    Add an otg_set_port_power flag to control whether the dual-role switch
    path performs explicit port power management. SoCs that need it
    (Tegra124 / Tegra210 / Tegra186) set the flag; later SoCs (Tegra194 and
    beyond) rely on the PHY mode change to handle disconnect naturally and
    skip all port power calls.
    
    Within the port power path, otg_reset_sspi additionally gates the SSPI
    reset sequence on host-mode entry for SoCs that require it.
    
    Flags set per SoC:
      Tegra124, Tegra186  -> otg_set_port_power
      Tegra210            -> otg_set_port_power, otg_reset_sspi
      Tegra194 and later  -> (none)
    
    [ Backport to 6.1.y: keep the host-mode snapshot in the existing
      tegra->lock section, retain pm_runtime_mark_last_busy() in the host
      port-power path, and omit the newer Tegra234 entry. ]
    
    Fixes: f836e7843036 ("usb: xhci-tegra: Add OTG support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Wei-Cheng Chen <weichengc@nvidia.com>
    Link: https://patch.msgid.link/20260505112630.217704-1-weichengc@nvidia.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>