Changelog in Linux kernel 6.16.8

 
arm64: kexec: initialize kexec_buf struct in load_other_segments() [+ + +]
Author: Breno Leitao <leitao@debian.org>
Date:   Wed Aug 27 03:42:21 2025 -0700

    arm64: kexec: initialize kexec_buf struct in load_other_segments()
    
    commit 04d3cd43700a2d0fe4bfb1012a8ec7f2e34a3507 upstream.
    
    Patch series "kexec: Fix invalid field access".
    
    The kexec_buf structure was previously declared without initialization.
    commit bf454ec31add ("kexec_file: allow to place kexec_buf randomly")
    added a field that is always read but not consistently populated by all
    architectures.  This un-initialized field will contain garbage.
    
    This is also triggering a UBSAN warning when the uninitialized data was
    accessed:
    
            ------------[ cut here ]------------
            UBSAN: invalid-load in ./include/linux/kexec.h:210:10
            load of value 252 is not a valid value for type '_Bool'
    
    Zero-initializing kexec_buf at declaration ensures all fields are cleanly
    set, preventing future instances of uninitialized memory being used.
    
    An initial fix was already landed for arm64[0], and this patchset fixes
    the problem on the remaining arm64 code and on riscv, as raised by Mark.
    
    Discussions about this problem could be found at[1][2].
    
    
    This patch (of 3):
    
    The kexec_buf structure was previously declared without initialization.
    commit bf454ec31add ("kexec_file: allow to place kexec_buf randomly")
    added a field that is always read but not consistently populated by all
    architectures. This un-initialized field will contain garbage.
    
    This is also triggering a UBSAN warning when the uninitialized data was
    accessed:
    
            ------------[ cut here ]------------
            UBSAN: invalid-load in ./include/linux/kexec.h:210:10
            load of value 252 is not a valid value for type '_Bool'
    
    Zero-initializing kexec_buf at declaration ensures all fields are
    cleanly set, preventing future instances of uninitialized memory being
    used.
    
    Link: https://lkml.kernel.org/r/20250827-kbuf_all-v1-0-1df9882bb01a@debian.org
    Link: https://lkml.kernel.org/r/20250827-kbuf_all-v1-1-1df9882bb01a@debian.org
    Link: https://lore.kernel.org/all/20250826180742.f2471131255ec1c43683ea07@linux-foundation.org/ [0]
    Link: https://lore.kernel.org/all/oninomspajhxp4omtdapxnckxydbk2nzmrix7rggmpukpnzadw@c67o7njgdgm3/ [1]
    Link: https://lore.kernel.org/all/20250826-akpm-v1-1-3c831f0e3799@debian.org/ [2]
    Fixes: bf454ec31add ("kexec_file: allow to place kexec_buf randomly")
    Signed-off-by: Breno Leitao <leitao@debian.org>
    Acked-by: Baoquan He <bhe@redhat.com>
    Cc: Albert Ou <aou@eecs.berkeley.edu>
    Cc: Alexander Gordeev <agordeev@linux.ibm.com>
    Cc: Alexandre Ghiti <alex@ghiti.fr>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
    Cc: Coiby Xu <coxu@redhat.com>
    Cc: Heiko Carstens <hca@linux.ibm.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Sven Schnelle <svens@linux.ibm.com>
    Cc: Vasily Gorbik <gor@linux.ibm.com>
    Cc: Will Deacon <will@kernel.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
block: don't silently ignore metadata for sync read/write [+ + +]
Author: Christoph Hellwig <hch@lst.de>
Date:   Tue Aug 19 10:25:01 2025 +0200

    block: don't silently ignore metadata for sync read/write
    
    [ Upstream commit 2729a60bbfb9215997f25372ebe9b7964f038296 ]
    
    The block fops don't try to handle metadata for synchronous requests,
    probably because the completion handler looks at dio->iocb which is not
    valid for synchronous requests.
    
    But silently ignoring metadata (or warning in case of
    __blkdev_direct_IO_simple) is a really bad idea as that can cause
    silent data corruption if a user ever shows up.
    
    Instead simply handle metadata for synchronous requests as the completion
    handler can simply check for bio_integrity() as the block layer default
    integrity will already be freed at this point, and thus bio_integrity()
    will only return true for user mapped integrity.
    
    Fixes: 3d8b5a22d404 ("block: add support to pass user meta buffer")
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Link: https://lore.kernel.org/20250819082517.2038819-3-hch@lst.de
    Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
    Signed-off-by: Christian Brauner <brauner@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Bluetooth: hci_conn: Fix not cleaning up Broadcaster/Broadcast Source [+ + +]
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date:   Tue Jul 29 12:11:09 2025 -0400

    Bluetooth: hci_conn: Fix not cleaning up Broadcaster/Broadcast Source
    
    [ Upstream commit 3ba486c5f3ce2c22ffd29c0103404cdbe21912b3 ]
    
    This fixes Broadcaster/Broadcast Source not sending HCI_OP_LE_TERM_BIG
    because HCI_CONN_PER_ADV where not being set.
    
    Fixes: a7bcffc673de ("Bluetooth: Add PA_LINK to distinguish BIG sync and PA sync connections")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: hci_conn: Fix running bis_cleanup for hci_conn->type PA_LINK [+ + +]
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date:   Mon Jul 28 13:51:01 2025 -0400

    Bluetooth: hci_conn: Fix running bis_cleanup for hci_conn->type PA_LINK
    
    [ Upstream commit d36349ea73d805bb72cbc24ab90cb1da4ad5c379 ]
    
    Connections with type of PA_LINK shall be considered temporary just to
    track the lifetime of PA Sync setup, once the BIG Sync is established
    and connection are created with BIS_LINK the existing PA_LINK
    connection shall not longer use bis_cleanup otherwise it terminates the
    PA Sync when that shall be left to BIS_LINK connection to do it.
    
    Fixes: a7bcffc673de ("Bluetooth: Add PA_LINK to distinguish BIG sync and PA sync connections")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Bluetooth: ISO: Fix getname not returning broadcast fields [+ + +]
Author: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date:   Thu Jul 24 16:36:27 2025 -0400

    Bluetooth: ISO: Fix getname not returning broadcast fields
    
    [ Upstream commit aee29c18a38d479c2f058c9b6a39b0527cf81d10 ]
    
    getname shall return iso_bc fields for both BIS_LINK and PA_LINK since
    the likes of bluetoothd do use the getpeername to retrieve the SID both
    when enumerating the broadcasters and when synchronizing.
    
    Fixes: a7bcffc673de ("Bluetooth: Add PA_LINK to distinguish BIG sync and PA sync connections")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
bpf, cpumap: Disable page_pool direct xdp_return need larger scope [+ + +]
Author: Jesper Dangaard Brouer <hawk@kernel.org>
Date:   Thu Aug 14 20:24:37 2025 +0200

    bpf, cpumap: Disable page_pool direct xdp_return need larger scope
    
    [ Upstream commit 2b986b9e917bc88f81aa1ed386af63b26c983f1d ]
    
    When running an XDP bpf_prog on the remote CPU in cpumap code
    then we must disable the direct return optimization that
    xdp_return can perform for mem_type page_pool.  This optimization
    assumes code is still executing under RX-NAPI of the original
    receiving CPU, which isn't true on this remote CPU.
    
    The cpumap code already disabled this via helpers
    xdp_set_return_frame_no_direct() and xdp_clear_return_frame_no_direct(),
    but the scope didn't include xdp_do_flush().
    
    When doing XDP_REDIRECT towards e.g devmap this causes the
    function bq_xmit_all() to run with direct return optimization
    enabled. This can lead to hard to find bugs.  The issue
    only happens when bq_xmit_all() cannot ndo_xdp_xmit all
    frames and them frees them via xdp_return_frame_rx_napi().
    
    Fix by expanding scope to include xdp_do_flush(). This was found
    by Dragos Tatulea.
    
    Fixes: 11941f8a8536 ("bpf: cpumap: Implement generic cpumap")
    Reported-by: Dragos Tatulea <dtatulea@nvidia.com>
    Reported-by: Chris Arges <carges@cloudflare.com>
    Signed-off-by: Jesper Dangaard Brouer <hawk@kernel.org>
    Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Tested-by: Chris Arges <carges@cloudflare.com>
    Link: https://patch.msgid.link/175519587755.3008742.1088294435150406835.stgit@firesoul
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
bpf: Allow fall back to interpreter for programs with stack size <= 512 [+ + +]
Author: KaFai Wan <kafai.wan@linux.dev>
Date:   Tue Sep 9 22:46:14 2025 +0800

    bpf: Allow fall back to interpreter for programs with stack size <= 512
    
    [ Upstream commit df0cb5cb50bd54d3cd4d0d83417ceec6a66404aa ]
    
    OpenWRT users reported regression on ARMv6 devices after updating to latest
    HEAD, where tcpdump filter:
    
    tcpdump "not ether host 3c37121a2b3c and not ether host 184ecbca2a3a \
    and not ether host 14130b4d3f47 and not ether host f0f61cf440b7 \
    and not ether host a84b4dedf471 and not ether host d022be17e1d7 \
    and not ether host 5c497967208b and not ether host 706655784d5b"
    
    fails with warning: "Kernel filter failed: No error information"
    when using config:
     # CONFIG_BPF_JIT_ALWAYS_ON is not set
     CONFIG_BPF_JIT_DEFAULT_ON=y
    
    The issue arises because commits:
    1. "bpf: Fix array bounds error with may_goto" changed default runtime to
       __bpf_prog_ret0_warn when jit_requested = 1
    2. "bpf: Avoid __bpf_prog_ret0_warn when jit fails" returns error when
       jit_requested = 1 but jit fails
    
    This change restores interpreter fallback capability for BPF programs with
    stack size <= 512 bytes when jit fails.
    
    Reported-by: Felix Fietkau <nbd@nbd.name>
    Closes: https://lore.kernel.org/bpf/2e267b4b-0540-45d8-9310-e127bf95fc63@nbd.name/
    Fixes: 6ebc5030e0c5 ("bpf: Fix array bounds error with may_goto")
    Signed-off-by: KaFai Wan <kafai.wan@linux.dev>
    Acked-by: Eduard Zingerman <eddyz87@gmail.com>
    Link: https://lore.kernel.org/r/20250909144614.2991253-1-kafai.wan@linux.dev
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

bpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt [+ + +]
Author: Daniel Borkmann <daniel@iogearbox.net>
Date:   Fri Aug 29 16:36:56 2025 +0200

    bpf: Fix out-of-bounds dynptr write in bpf_crypto_crypt
    
    [ Upstream commit f9bb6ffa7f5ad0f8ee0f53fc4a10655872ee4a14 ]
    
    Stanislav reported that in bpf_crypto_crypt() the destination dynptr's
    size is not validated to be at least as large as the source dynptr's
    size before calling into the crypto backend with 'len = src_len'. This
    can result in an OOB write when the destination is smaller than the
    source.
    
    Concretely, in mentioned function, psrc and pdst are both linear
    buffers fetched from each dynptr:
    
      psrc = __bpf_dynptr_data(src, src_len);
      [...]
      pdst = __bpf_dynptr_data_rw(dst, dst_len);
      [...]
      err = decrypt ?
            ctx->type->decrypt(ctx->tfm, psrc, pdst, src_len, piv) :
            ctx->type->encrypt(ctx->tfm, psrc, pdst, src_len, piv);
    
    The crypto backend expects pdst to be large enough with a src_len length
    that can be written. Add an additional src_len > dst_len check and bail
    out if it's the case. Note that these kfuncs are accessible under root
    privileges only.
    
    Fixes: 3e1c6f35409f ("bpf: make common crypto API for TC/XDP programs")
    Reported-by: Stanislav Fort <disclosure@aisle.com>
    Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
    Cc: Vadim Fedorenko <vadim.fedorenko@linux.dev>
    Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
    Link: https://lore.kernel.org/r/20250829143657.318524-1-daniel@iogearbox.net
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

bpf: Tell memcg to use allow_spinning=false path in bpf_timer_init() [+ + +]
Author: Peilin Ye <yepeilin@google.com>
Date:   Tue Sep 9 09:52:20 2025 +0000

    bpf: Tell memcg to use allow_spinning=false path in bpf_timer_init()
    
    [ Upstream commit 6d78b4473cdb08b74662355a9e8510bde09c511e ]
    
    Currently, calling bpf_map_kmalloc_node() from __bpf_async_init() can
    cause various locking issues; see the following stack trace (edited for
    style) as one example:
    
    ...
     [10.011566]  do_raw_spin_lock.cold
     [10.011570]  try_to_wake_up             (5) double-acquiring the same
     [10.011575]  kick_pool                      rq_lock, causing a hardlockup
     [10.011579]  __queue_work
     [10.011582]  queue_work_on
     [10.011585]  kernfs_notify
     [10.011589]  cgroup_file_notify
     [10.011593]  try_charge_memcg           (4) memcg accounting raises an
     [10.011597]  obj_cgroup_charge_pages        MEMCG_MAX event
     [10.011599]  obj_cgroup_charge_account
     [10.011600]  __memcg_slab_post_alloc_hook
     [10.011603]  __kmalloc_node_noprof
    ...
     [10.011611]  bpf_map_kmalloc_node
     [10.011612]  __bpf_async_init
     [10.011615]  bpf_timer_init             (3) BPF calls bpf_timer_init()
     [10.011617]  bpf_prog_xxxxxxxxxxxxxxxx_fcg_runnable
     [10.011619]  bpf__sched_ext_ops_runnable
     [10.011620]  enqueue_task_scx           (2) BPF runs with rq_lock held
     [10.011622]  enqueue_task
     [10.011626]  ttwu_do_activate
     [10.011629]  sched_ttwu_pending         (1) grabs rq_lock
    ...
    
    The above was reproduced on bpf-next (b338cf849ec8) by modifying
    ./tools/sched_ext/scx_flatcg.bpf.c to call bpf_timer_init() during
    ops.runnable(), and hacking the memcg accounting code a bit to make
    a bpf_timer_init() call more likely to raise an MEMCG_MAX event.
    
    We have also run into other similar variants (both internally and on
    bpf-next), including double-acquiring cgroup_file_kn_lock, the same
    worker_pool::lock, etc.
    
    As suggested by Shakeel, fix this by using __GFP_HIGH instead of
    GFP_ATOMIC in __bpf_async_init(), so that e.g. if try_charge_memcg()
    raises an MEMCG_MAX event, we call __memcg_memory_event() with
    @allow_spinning=false and avoid calling cgroup_file_notify() there.
    
    Depends on mm patch
    "memcg: skip cgroup_file_notify if spinning is not allowed":
    https://lore.kernel.org/bpf/20250905201606.66198-1-shakeel.butt@linux.dev/
    
    v0 approach s/bpf_map_kmalloc_node/bpf_mem_alloc/
    https://lore.kernel.org/bpf/20250905061919.439648-1-yepeilin@google.com/
    v1 approach:
    https://lore.kernel.org/bpf/20250905234547.862249-1-yepeilin@google.com/
    
    Fixes: b00628b1c7d5 ("bpf: Introduce bpf timers.")
    Suggested-by: Shakeel Butt <shakeel.butt@linux.dev>
    Signed-off-by: Peilin Ye <yepeilin@google.com>
    Link: https://lore.kernel.org/r/20250909095222.2121438-1-yepeilin@google.com
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
btrfs: fix corruption reading compressed range when block size is smaller than page size [+ + +]
Author: Qu Wenruo <wqu@suse.com>
Date:   Sat Sep 13 10:12:33 2025 -0400

    btrfs: fix corruption reading compressed range when block size is smaller than page size
    
    [ Upstream commit 9786531399a679fc2f4630d2c0a186205282ab2f ]
    
    [BUG]
    With 64K page size (aarch64 with 64K page size config) and 4K btrfs
    block size, the following workload can easily lead to a corrupted read:
    
            mkfs.btrfs -f -s 4k $dev > /dev/null
            mount -o compress $dev $mnt
            xfs_io -f -c "pwrite -S 0xff 0 64k" $mnt/base > /dev/null
            echo "correct result:"
            od -Ad -t x1 $mnt/base
            xfs_io -f -c "reflink $mnt/base 32k 0 32k" \
                      -c "reflink $mnt/base 0 32k 32k" \
                      -c "pwrite -S 0xff 60k 4k" $mnt/new > /dev/null
            echo "incorrect result:"
            od -Ad -t x1 $mnt/new
            umount $mnt
    
    This shows the following result:
    
    correct result:
    0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    *
    0065536
    incorrect result:
    0000000 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    *
    0032768 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    *
    0061440 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    *
    0065536
    
    Notice the zero in the range [32K, 60K), which is incorrect.
    
    [CAUSE]
    With extra trace printk, it shows the following events during od:
    (some unrelated info removed like CPU and context)
    
     od-3457   btrfs_do_readpage: enter r/i=5/258 folio=0(65536) prev_em_start=0000000000000000
    
    The "r/i" is indicating the root and inode number. In our case the file
    "new" is using ino 258 from fs tree (root 5).
    
    Here notice the @prev_em_start pointer is NULL. This means the
    btrfs_do_readpage() is called from btrfs_read_folio(), not from
    btrfs_readahead().
    
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=0 got em start=0 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=4096 got em start=0 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=8192 got em start=0 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=12288 got em start=0 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=16384 got em start=0 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=20480 got em start=0 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=24576 got em start=0 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=28672 got em start=0 len=32768
    
    These above 32K blocks will be read from the first half of the
    compressed data extent.
    
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=32768 got em start=32768 len=32768
    
    Note here there is no btrfs_submit_compressed_read() call. Which is
    incorrect now.
    Although both extent maps at 0 and 32K are pointing to the same compressed
    data, their offsets are different thus can not be merged into the same
    read.
    
    So this means the compressed data read merge check is doing something
    wrong.
    
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=36864 got em start=32768 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=40960 got em start=32768 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=45056 got em start=32768 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=49152 got em start=32768 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=53248 got em start=32768 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=57344 got em start=32768 len=32768
     od-3457   btrfs_do_readpage: r/i=5/258 folio=0(65536) cur=61440 skip uptodate
     od-3457   btrfs_submit_compressed_read: cb orig_bio: file off=0 len=61440
    
    The function btrfs_submit_compressed_read() is only called at the end of
    folio read. The compressed bio will only have an extent map of range [0,
    32K), but the original bio passed in is for the whole 64K folio.
    
    This will cause the decompression part to only fill the first 32K,
    leaving the rest untouched (aka, filled with zero).
    
    This incorrect compressed read merge leads to the above data corruption.
    
    There were similar problems that happened in the past, commit 808f80b46790
    ("Btrfs: update fix for read corruption of compressed and shared
    extents") is doing pretty much the same fix for readahead.
    
    But that's back to 2015, where btrfs still only supports bs (block size)
    == ps (page size) cases.
    This means btrfs_do_readpage() only needs to handle a folio which
    contains exactly one block.
    
    Only btrfs_readahead() can lead to a read covering multiple blocks.
    Thus only btrfs_readahead() passes a non-NULL @prev_em_start pointer.
    
    With v5.15 kernel btrfs introduced bs < ps support. This breaks the above
    assumption that a folio can only contain one block.
    
    Now btrfs_read_folio() can also read multiple blocks in one go.
    But btrfs_read_folio() doesn't pass a @prev_em_start pointer, thus the
    existing bio force submission check will never be triggered.
    
    In theory, this can also happen for btrfs with large folios, but since
    large folio is still experimental, we don't need to bother it, thus only
    bs < ps support is affected for now.
    
    [FIX]
    Instead of passing @prev_em_start to do the proper compressed extent
    check, introduce one new member, btrfs_bio_ctrl::last_em_start, so that
    the existing bio force submission logic will always be triggered.
    
    CC: stable@vger.kernel.org # 5.15+
    Reviewed-by: Filipe Manana <fdmanana@suse.com>
    Signed-off-by: Qu Wenruo <wqu@suse.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 squota compressed stats leak [+ + +]
Author: Boris Burkov <boris@bur.io>
Date:   Wed Aug 20 14:52:05 2025 -0700

    btrfs: fix squota compressed stats leak
    
    commit de134cb54c3a67644ff95b1c9bffe545e752c912 upstream.
    
    The following workload on a squota enabled fs:
    
      btrfs subvol create mnt/subvol
    
      # ensure subvol extents get accounted
      sync
      btrfs qgroup create 1/1 mnt
      btrfs qgroup assign mnt/subvol 1/1 mnt
      btrfs qgroup delete mnt/subvol
    
      # make the cleaner thread run
      btrfs filesystem sync mnt
      sleep 1
      btrfs filesystem sync mnt
      btrfs qgroup destroy 1/1 mnt
    
    will fail with EBUSY. The reason is that 1/1 does the quick accounting
    when we assign subvol to it, gaining its exclusive usage as excl and
    excl_cmpr. But then when we delete subvol, the decrement happens via
    record_squota_delta() which does not update excl_cmpr, as squotas does
    not make any distinction between compressed and normal extents. Thus,
    we increment excl_cmpr but never decrement it, and are unable to delete
    1/1. The two possible fixes are to make squota always mirror excl and
    excl_cmpr or to make the fast accounting separately track the plain and
    cmpr numbers. The latter felt cleaner to me so that is what I opted for.
    
    Fixes: 1e0e9d5771c3 ("btrfs: add helper for recording simple quota deltas")
    CC: stable@vger.kernel.org # 6.12+
    Reviewed-by: Qu Wenruo <wqu@suse.com>
    Signed-off-by: Boris Burkov <boris@bur.io>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

btrfs: fix subvolume deletion lockup caused by inodes xarray race [+ + +]
Author: Omar Sandoval <osandov@fb.com>
Date:   Tue Aug 26 11:24:38 2025 -0700

    btrfs: fix subvolume deletion lockup caused by inodes xarray race
    
    commit f6a6c280059c4ddc23e12e3de1b01098e240036f upstream.
    
    There is a race condition between inode eviction and inode caching that
    can cause a live struct btrfs_inode to be missing from the root->inodes
    xarray. Specifically, there is a window during evict() between the inode
    being unhashed and deleted from the xarray. If btrfs_iget() is called
    for the same inode in that window, it will be recreated and inserted
    into the xarray, but then eviction will delete the new entry, leaving
    nothing in the xarray:
    
    Thread 1                          Thread 2
    ---------------------------------------------------------------
    evict()
      remove_inode_hash()
                                      btrfs_iget_path()
                                        btrfs_iget_locked()
                                        btrfs_read_locked_inode()
                                          btrfs_add_inode_to_root()
      destroy_inode()
        btrfs_destroy_inode()
          btrfs_del_inode_from_root()
            __xa_erase
    
    In turn, this can cause issues for subvolume deletion. Specifically, if
    an inode is in this lost state, and all other inodes are evicted, then
    btrfs_del_inode_from_root() will call btrfs_add_dead_root() prematurely.
    If the lost inode has a delayed_node attached to it, then when
    btrfs_clean_one_deleted_snapshot() calls btrfs_kill_all_delayed_nodes(),
    it will loop forever because the delayed_nodes xarray will never become
    empty (unless memory pressure forces the inode out). We saw this
    manifest as soft lockups in production.
    
    Fix it by only deleting the xarray entry if it matches the given inode
    (using __xa_cmpxchg()).
    
    Fixes: 310b2f5d5a94 ("btrfs: use an xarray to track open inodes in a root")
    Cc: stable@vger.kernel.org # 6.11+
    Reviewed-by: Josef Bacik <josef@toxicpanda.com>
    Reviewed-by: Filipe Manana <fdmanana@suse.com>
    Co-authored-by: Leo Martins <loemra.dev@gmail.com>
    Signed-off-by: Leo Martins <loemra.dev@gmail.com>
    Signed-off-by: Omar Sandoval <osandov@fb.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

btrfs: use readahead_expand() on compressed extents [+ + +]
Author: Boris Burkov <boris@bur.io>
Date:   Sat Sep 13 10:12:32 2025 -0400

    btrfs: use readahead_expand() on compressed extents
    
    [ Upstream commit 9e9ff875e4174be939371667d2cc81244e31232f ]
    
    We recently received a report of poor performance doing sequential
    buffered reads of a file with compressed extents. With bs=128k, a naive
    sequential dd ran as fast on a compressed file as on an uncompressed
    (1.2GB/s on my reproducing system) while with bs<32k, this performance
    tanked down to ~300MB/s.
    
    i.e., slow:
    
      dd if=some-compressed-file of=/dev/null bs=4k count=X
    
    vs fast:
    
      dd if=some-compressed-file of=/dev/null bs=128k count=Y
    
    The cause of this slowness is overhead to do with looking up extent_maps
    to enable readahead pre-caching on compressed extents
    (add_ra_bio_pages()), as well as some overhead in the generic VFS
    readahead code we hit more in the slow case. Notably, the main
    difference between the two read sizes is that in the large sized request
    case, we call btrfs_readahead() relatively rarely while in the smaller
    request we call it for every compressed extent. So the fast case stays
    in the btrfs readahead loop:
    
        while ((folio = readahead_folio(rac)) != NULL)
                btrfs_do_readpage(folio, &em_cached, &bio_ctrl, &prev_em_start);
    
    where the slower one breaks out of that loop every time. This results in
    calling add_ra_bio_pages a lot, doing lots of extent_map lookups,
    extent_map locking, etc.
    
    This happens because although add_ra_bio_pages() does add the
    appropriate un-compressed file pages to the cache, it does not
    communicate back to the ractl in any way. To solve this, we should be
    using readahead_expand() to signal to readahead to expand the readahead
    window.
    
    This change passes the readahead_control into the btrfs_bio_ctrl and in
    the case of compressed reads sets the expansion to the size of the
    extent_map we already looked up anyway. It skips the subpage case as
    that one already doesn't do add_ra_bio_pages().
    
    With this change, whether we use bs=4k or bs=128k, btrfs expands the
    readahead window up to the largest compressed extent we have seen so far
    (in the trivial example: 128k) and the call stacks of the two modes look
    identical. Notably, we barely call add_ra_bio_pages at all. And the
    performance becomes identical as well. So this change certainly "fixes"
    this performance problem.
    
    Of course, it does seem to beg a few questions:
    
    1. Will this waste too much page cache with a too large ra window?
    2. Will this somehow cause bugs prevented by the more thoughtful
       checking in add_ra_bio_pages?
    3. Should we delete add_ra_bio_pages?
    
    My stabs at some answers:
    
    1. Hard to say. See attempts at generic performance testing below. Is
       there a "readahead_shrink" we should be using? Should we expand more
       slowly, by half the remaining em size each time?
    2. I don't think so. Since the new behavior is indistinguishable from
       reading the file with a larger read size passed in, I don't see why
       one would be safe but not the other.
    3. Probably! I tested that and it was fine in fstests, and it seems like
       the pages would get re-used just as well in the readahead case.
       However, it is possible some reads that use page cache but not
       btrfs_readahead() could suffer. I will investigate this further as a
       follow up.
    
    I tested the performance implications of this change in 3 ways (using
    compress-force=zstd:3 for compression):
    
    Directly test the affected workload of small sequential reads on a
    compressed file (improved from ~250MB/s to ~1.2GB/s)
    
    ==========for-next==========
      dd /mnt/lol/non-cmpr 4k
      1048576+0 records in
      1048576+0 records out
      4294967296 bytes (4.3 GB, 4.0 GiB) copied, 6.02983 s, 712 MB/s
      dd /mnt/lol/non-cmpr 128k
      32768+0 records in
      32768+0 records out
      4294967296 bytes (4.3 GB, 4.0 GiB) copied, 5.92403 s, 725 MB/s
      dd /mnt/lol/cmpr 4k
      1048576+0 records in
      1048576+0 records out
      4294967296 bytes (4.3 GB, 4.0 GiB) copied, 17.8832 s, 240 MB/s
      dd /mnt/lol/cmpr 128k
      32768+0 records in
      32768+0 records out
      4294967296 bytes (4.3 GB, 4.0 GiB) copied, 3.71001 s, 1.2 GB/s
    
    ==========ra-expand==========
      dd /mnt/lol/non-cmpr 4k
      1048576+0 records in
      1048576+0 records out
      4294967296 bytes (4.3 GB, 4.0 GiB) copied, 6.09001 s, 705 MB/s
      dd /mnt/lol/non-cmpr 128k
      32768+0 records in
      32768+0 records out
      4294967296 bytes (4.3 GB, 4.0 GiB) copied, 6.07664 s, 707 MB/s
      dd /mnt/lol/cmpr 4k
      1048576+0 records in
      1048576+0 records out
      4294967296 bytes (4.3 GB, 4.0 GiB) copied, 3.79531 s, 1.1 GB/s
      dd /mnt/lol/cmpr 128k
      32768+0 records in
      32768+0 records out
      4294967296 bytes (4.3 GB, 4.0 GiB) copied, 3.69533 s, 1.2 GB/s
    
    Built the linux kernel from clean (no change)
    
    Ran fsperf. Mostly neutral results with some improvements and
    regressions here and there.
    
    Reported-by: Dimitrios Apostolou <jimis@gmx.net>
    Link: https://lore.kernel.org/linux-btrfs/34601559-6c16-6ccc-1793-20a97ca0dbba@gmx.net/
    Reviewed-by: Filipe Manana <fdmanana@suse.com>
    Signed-off-by: Boris Burkov <boris@bur.io>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Stable-dep-of: 9786531399a6 ("btrfs: fix corruption reading compressed range when block size is smaller than page size")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
can: j1939: implement NETDEV_UNREGISTER notification handler [+ + +]
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date:   Mon Aug 25 23:07:24 2025 +0900

    can: j1939: implement NETDEV_UNREGISTER notification handler
    
    [ Upstream commit 7fcbe5b2c6a4b5407bf2241fdb71e0a390f6ab9a ]
    
    syzbot is reporting
    
      unregister_netdevice: waiting for vcan0 to become free. Usage count = 2
    
    problem, for j1939 protocol did not have NETDEV_UNREGISTER notification
    handler for undoing changes made by j1939_sk_bind().
    
    Commit 25fe97cb7620 ("can: j1939: move j1939_priv_put() into sk_destruct
    callback") expects that a call to j1939_priv_put() can be unconditionally
    delayed until j1939_sk_sock_destruct() is called. But we need to call
    j1939_priv_put() against an extra ref held by j1939_sk_bind() call
    (as a part of undoing changes made by j1939_sk_bind()) as soon as
    NETDEV_UNREGISTER notification fires (i.e. before j1939_sk_sock_destruct()
    is called via j1939_sk_release()). Otherwise, the extra ref on "struct
    j1939_priv" held by j1939_sk_bind() call prevents "struct net_device" from
    dropping the usage count to 1; making it impossible for
    unregister_netdevice() to continue.
    
    Reported-by: syzbot <syzbot+881d65229ca4f9ae8c84@syzkaller.appspotmail.com>
    Closes: https://syzkaller.appspot.com/bug?extid=881d65229ca4f9ae8c84
    Tested-by: syzbot <syzbot+881d65229ca4f9ae8c84@syzkaller.appspotmail.com>
    Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
    Fixes: 25fe97cb7620 ("can: j1939: move j1939_priv_put() into sk_destruct callback")
    Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Link: https://patch.msgid.link/ac9db9a4-6c30-416e-8b94-96e6559d55b2@I-love.SAKURA.ne.jp
    [mkl: remove space in front of label]
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: j1939: j1939_local_ecu_get(): undo increment when j1939_local_ecu_get() fails [+ + +]
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date:   Sun Aug 24 19:27:40 2025 +0900

    can: j1939: j1939_local_ecu_get(): undo increment when j1939_local_ecu_get() fails
    
    [ Upstream commit 06e02da29f6f1a45fc07bd60c7eaf172dc21e334 ]
    
    Since j1939_sk_bind() and j1939_sk_release() call j1939_local_ecu_put()
    when J1939_SOCK_BOUND was already set, but the error handling path for
    j1939_sk_bind() will not set J1939_SOCK_BOUND when j1939_local_ecu_get()
    fails, j1939_local_ecu_get() needs to undo priv->ents[sa].nusers++ when
    j1939_local_ecu_get() returns an error.
    
    Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
    Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Link: https://patch.msgid.link/e7f80046-4ff7-4ce2-8ad8-7c3c678a42c9@I-love.SAKURA.ne.jp
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: j1939: j1939_sk_bind(): call j1939_priv_put() immediately when j1939_local_ecu_get() failed [+ + +]
Author: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Date:   Sun Aug 24 19:30:09 2025 +0900

    can: j1939: j1939_sk_bind(): call j1939_priv_put() immediately when j1939_local_ecu_get() failed
    
    [ Upstream commit f214744c8a27c3c1da6b538c232da22cd027530e ]
    
    Commit 25fe97cb7620 ("can: j1939: move j1939_priv_put() into sk_destruct
    callback") expects that a call to j1939_priv_put() can be unconditionally
    delayed until j1939_sk_sock_destruct() is called. But a refcount leak will
    happen when j1939_sk_bind() is called again after j1939_local_ecu_get()
     from previous j1939_sk_bind() call returned an error. We need to call
    j1939_priv_put() before j1939_sk_bind() returns an error.
    
    Fixes: 25fe97cb7620 ("can: j1939: move j1939_priv_put() into sk_destruct callback")
    Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
    Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Link: https://patch.msgid.link/4f49a1bc-a528-42ad-86c0-187268ab6535@I-love.SAKURA.ne.jp
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

can: xilinx_can: xcan_write_frame(): fix use-after-free of transmitted SKB [+ + +]
Author: Anssi Hannula <anssi.hannula@bitwise.fi>
Date:   Fri Aug 22 12:50:02 2025 +0300

    can: xilinx_can: xcan_write_frame(): fix use-after-free of transmitted SKB
    
    [ Upstream commit ef79f00be72bd81d2e1e6f060d83cf7e425deee4 ]
    
    can_put_echo_skb() takes ownership of the SKB and it may be freed
    during or after the call.
    
    However, xilinx_can xcan_write_frame() keeps using SKB after the call.
    
    Fix that by only calling can_put_echo_skb() after the code is done
    touching the SKB.
    
    The tx_lock is held for the entire xcan_write_frame() execution and
    also on the can_get_echo_skb() side so the order of operations does not
    matter.
    
    An earlier fix commit 3d3c817c3a40 ("can: xilinx_can: Fix usage of skb
    memory") did not move the can_put_echo_skb() call far enough.
    
    Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
    Fixes: 1598efe57b3e ("can: xilinx_can: refactor code in preparation for CAN FD support")
    Link: https://patch.msgid.link/20250822095002.168389-1-anssi.hannula@bitwise.fi
    [mkl: add "commit" in front of sha1 in patch description]
    [mkl: fix indention]
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ceph: always call ceph_shift_unused_folios_left() [+ + +]
Author: Max Kellermann <max.kellermann@ionos.com>
Date:   Wed Aug 27 20:17:08 2025 +0200

    ceph: always call ceph_shift_unused_folios_left()
    
    commit cce7c15faaac79b532a07ed6ab8332280ad83762 upstream.
    
    The function ceph_process_folio_batch() sets folio_batch entries to
    NULL, which is an illegal state.  Before folio_batch_release() crashes
    due to this API violation, the function ceph_shift_unused_folios_left()
    is supposed to remove those NULLs from the array.
    
    However, since commit ce80b76dd327 ("ceph: introduce
    ceph_process_folio_batch() method"), this shifting doesn't happen
    anymore because the "for" loop got moved to ceph_process_folio_batch(),
    and now the `i` variable that remains in ceph_writepages_start()
    doesn't get incremented anymore, making the shifting effectively
    unreachable much of the time.
    
    Later, commit 1551ec61dc55 ("ceph: introduce ceph_submit_write()
    method") added more preconditions for doing the shift, replacing the
    `i` check (with something that is still just as broken):
    
    - if ceph_process_folio_batch() fails, shifting never happens
    
    - if ceph_move_dirty_page_in_page_array() was never called (because
      ceph_process_folio_batch() has returned early for some of various
      reasons), shifting never happens
    
    - if `processed_in_fbatch` is zero (because ceph_process_folio_batch()
      has returned early for some of the reasons mentioned above or
      because ceph_move_dirty_page_in_page_array() has failed), shifting
      never happens
    
    Since those two commits, any problem in ceph_process_folio_batch()
    could crash the kernel, e.g. this way:
    
     BUG: kernel NULL pointer dereference, address: 0000000000000034
     #PF: supervisor write access in kernel mode
     #PF: error_code(0x0002) - not-present page
     PGD 0 P4D 0
     Oops: Oops: 0002 [#1] SMP NOPTI
     CPU: 172 UID: 0 PID: 2342707 Comm: kworker/u778:8 Not tainted 6.15.10-cm4all1-es #714 NONE
     Hardware name: Dell Inc. PowerEdge R7615/0G9DHV, BIOS 1.6.10 12/08/2023
     Workqueue: writeback wb_workfn (flush-ceph-1)
     RIP: 0010:folios_put_refs+0x85/0x140
     Code: 83 c5 01 39 e8 7e 76 48 63 c5 49 8b 5c c4 08 b8 01 00 00 00 4d 85 ed 74 05 41 8b 44 ad 00 48 8b 15 b0 >
     RSP: 0018:ffffb880af8db778 EFLAGS: 00010207
     RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000003
     RDX: ffffe377cc3b0000 RSI: 0000000000000000 RDI: ffffb880af8db8c0
     RBP: 0000000000000000 R08: 000000000000007d R09: 000000000102b86f
     R10: 0000000000000001 R11: 00000000000000ac R12: ffffb880af8db8c0
     R13: 0000000000000000 R14: 0000000000000000 R15: ffff9bd262c97000
     FS:  0000000000000000(0000) GS:ffff9c8efc303000(0000) knlGS:0000000000000000
     CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
     CR2: 0000000000000034 CR3: 0000000160958004 CR4: 0000000000770ef0
     PKRU: 55555554
     Call Trace:
      <TASK>
      ceph_writepages_start+0xeb9/0x1410
    
    The crash can be reproduced easily by changing the
    ceph_check_page_before_write() return value to `-E2BIG`.
    
    (Interestingly, the crash happens only if `huge_zero_folio` has
    already been allocated; without `huge_zero_folio`,
    is_huge_zero_folio(NULL) returns true and folios_put_refs() skips NULL
    entries instead of dereferencing them.  That makes reproducing the bug
    somewhat unreliable.  See
    https://lore.kernel.org/20250826231626.218675-1-max.kellermann@ionos.com
    for a discussion of this detail.)
    
    My suggestion is to move the ceph_shift_unused_folios_left() to right
    after ceph_process_folio_batch() to ensure it always gets called to
    fix up the illegal folio_batch state.
    
    Cc: stable@vger.kernel.org
    Fixes: ce80b76dd327 ("ceph: introduce ceph_process_folio_batch() method")
    Link: https://lore.kernel.org/ceph-devel/aK4v548CId5GIKG1@swift.blarg.de/
    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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ceph: fix crash after fscrypt_encrypt_pagecache_blocks() error [+ + +]
Author: Max Kellermann <max.kellermann@ionos.com>
Date:   Thu Aug 28 13:15:52 2025 +0200

    ceph: fix crash after fscrypt_encrypt_pagecache_blocks() error
    
    commit 249e0a47cdb46bb9eae65511c569044bd8698d7d upstream.
    
    The function move_dirty_folio_in_page_array() was created by commit
    ce80b76dd327 ("ceph: introduce ceph_process_folio_batch() method") by
    moving code from ceph_writepages_start() to this function.
    
    This new function is supposed to return an error code which is checked
    by the caller (now ceph_process_folio_batch()), and on error, the
    caller invokes redirty_page_for_writepage() and then breaks from the
    loop.
    
    However, the refactoring commit has gone wrong, and it by accident, it
    always returns 0 (= success) because it first NULLs the pointer and
    then returns PTR_ERR(NULL) which is always 0.  This means errors are
    silently ignored, leaving NULL entries in the page array, which may
    later crash the kernel.
    
    The simple solution is to call PTR_ERR() before clearing the pointer.
    
    Cc: stable@vger.kernel.org
    Fixes: ce80b76dd327 ("ceph: introduce ceph_process_folio_batch() method")
    Link: https://lore.kernel.org/ceph-devel/aK4v548CId5GIKG1@swift.blarg.de/
    Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
    Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ceph: fix race condition validating r_parent before applying state [+ + +]
Author: Alex Markuze <amarkuze@redhat.com>
Date:   Tue Aug 12 09:57:38 2025 +0000

    ceph: fix race condition validating r_parent before applying state
    
    commit 15f519e9f883b316d86e2bb6b767a023aafd9d83 upstream.
    
    Add validation to ensure the cached parent directory inode matches the
    directory info in MDS replies. This prevents client-side race conditions
    where concurrent operations (e.g. rename) cause r_parent to become stale
    between request initiation and reply processing, which could lead to
    applying state changes to incorrect directory inodes.
    
    [ idryomov: folded a kerneldoc fixup and a follow-up fix from Alex to
      move CEPH_CAP_PIN reference when r_parent is updated:
    
      When the parent directory lock is not held, req->r_parent can become
      stale and is updated to point to the correct inode.  However, the
      associated CEPH_CAP_PIN reference was not being adjusted.  The
      CEPH_CAP_PIN is a reference on an inode that is tracked for
      accounting purposes.  Moving this pin is important to keep the
      accounting balanced. When the pin was not moved from the old parent
      to the new one, it created two problems: The reference on the old,
      stale parent was never released, causing a reference leak.
      A reference for the new parent was never acquired, creating the risk
      of a reference underflow later in ceph_mdsc_release_request().  This
      patch corrects the logic by releasing the pin from the old parent and
      acquiring it for the new parent when r_parent is switched.  This
      ensures reference accounting stays balanced. ]
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Alex Markuze <amarkuze@redhat.com>
    Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

ceph: fix race condition where r_parent becomes stale before sending message [+ + +]
Author: Alex Markuze <amarkuze@redhat.com>
Date:   Tue Aug 12 09:57:39 2025 +0000

    ceph: fix race condition where r_parent becomes stale before sending message
    
    commit bec324f33d1ed346394b2eee25bf6dbf3511f727 upstream.
    
    When the parent directory's i_rwsem is not locked, req->r_parent may become
    stale due to concurrent operations (e.g. rename) between dentry lookup and
    message creation. Validate that r_parent matches the encoded parent inode
    and update to the correct inode if a mismatch is detected.
    
    [ idryomov: folded a follow-up fix from Alex to drop extra reference
      from ceph_get_reply_dir() in ceph_fill_trace():
    
      ceph_get_reply_dir() may return a different, referenced inode when
      r_parent is stale and the parent directory lock is not held.
      ceph_fill_trace() used that inode but failed to drop the reference
      when it differed from req->r_parent, leaking an inode reference.
    
      Keep the directory inode in a local variable and iput() it at
      function end if it does not match req->r_parent. ]
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Alex Markuze <amarkuze@redhat.com>
    Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
compiler-clang.h: define __SANITIZE_*__ macros only when undefined [+ + +]
Author: Nathan Chancellor <nathan@kernel.org>
Date:   Tue Sep 2 15:49:26 2025 -0700

    compiler-clang.h: define __SANITIZE_*__ macros only when undefined
    
    commit 3fac212fe489aa0dbe8d80a42a7809840ca7b0f9 upstream.
    
    Clang 22 recently added support for defining __SANITIZE__ macros similar
    to GCC [1], which causes warnings (or errors with CONFIG_WERROR=y or W=e)
    with the existing defines that the kernel creates to emulate this behavior
    with existing clang versions.
    
      In file included from <built-in>:3:
      In file included from include/linux/compiler_types.h:171:
      include/linux/compiler-clang.h:37:9: error: '__SANITIZE_THREAD__' macro redefined [-Werror,-Wmacro-redefined]
         37 | #define __SANITIZE_THREAD__
            |         ^
      <built-in>:352:9: note: previous definition is here
        352 | #define __SANITIZE_THREAD__ 1
            |         ^
    
    Refactor compiler-clang.h to only define the sanitizer macros when they
    are undefined and adjust the rest of the code to use these macros for
    checking if the sanitizers are enabled, clearing up the warnings and
    allowing the kernel to easily drop these defines when the minimum
    supported version of LLVM for building the kernel becomes 22.0.0 or newer.
    
    Link: https://lkml.kernel.org/r/20250902-clang-update-sanitize-defines-v1-1-cf3702ca3d92@kernel.org
    Link: https://github.com/llvm/llvm-project/commit/568c23bbd3303518c5056d7f03444dae4fdc8a9c [1]
    Signed-off-by: Nathan Chancellor <nathan@kernel.org>
    Reviewed-by: Justin Stitt <justinstitt@google.com>
    Cc: Alexander Potapenko <glider@google.com>
    Cc: Andrey Konovalov <andreyknvl@gmail.com>
    Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
    Cc: Bill Wendling <morbo@google.com>
    Cc: Dmitriy Vyukov <dvyukov@google.com>
    Cc: Marco Elver <elver@google.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
coredump: don't pointlessly check and spew warnings [+ + +]
Author: Christian Brauner <brauner@kernel.org>
Date:   Thu Aug 21 13:50:47 2025 +0200

    coredump: don't pointlessly check and spew warnings
    
    [ Upstream commit be1e0283021ec73c2eb92839db9a471a068709d9 ]
    
    When a write happens it doesn't make sense to check perform checks on
    the input. Skip them.
    
    Whether a fixes tag is licensed is a bit of a gray area here but I'll
    add one for the socket validation part I added recently.
    
    Link: https://lore.kernel.org/20250821-moosbedeckt-denunziant-7908663f3563@brauner
    Fixes: 16195d2c7dd2 ("coredump: validate socket name as it is written")
    Reported-by: Brad Spengler <brad.spengler@opensrcsec.com>
    Signed-off-by: Christian Brauner <brauner@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
cpufreq/amd-pstate: Fix a regression leading to EPP 0 after resume [+ + +]
Author: Mario Limonciello (AMD) <superm1@kernel.org>
Date:   Tue Aug 26 00:27:47 2025 -0500

    cpufreq/amd-pstate: Fix a regression leading to EPP 0 after resume
    
    [ Upstream commit ba3319e5905710abe495b11a1aaf03ebb51d62e2 ]
    
    During the suspend sequence the cached CPPC request is destroyed
    with the expectation that it's restored during resume.  This assumption
    broke when the separate cache EPP variable was removed, and then it was
    broken again by commit 608a76b65288 ("cpufreq/amd-pstate: Add support
    for the "Requested CPU Min frequency" BIOS option") which explicitly
    set it to zero during suspend.
    
    Remove the invalidation and set the value during the suspend call to
    update limits so that the cached variable can be used to restore on
    resume.
    
    Fixes: 608a76b65288 ("cpufreq/amd-pstate: Add support for the "Requested CPU Min frequency" BIOS option")
    Fixes: b7a41156588a ("cpufreq/amd-pstate: Invalidate cppc_req_cached during suspend")
    Reported-by: goldens <goldenspinach.rhbugzilla@gmail.com>
    Closes: https://community.frame.work/t/increased-power-usage-after-resuming-from-suspend-on-ryzen-7040-kernel-6-15-regression/
    Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2391221
    Tested-by: goldens <goldenspinach.rhbugzilla@gmail.com>
    Tested-by: Willian Wang <kernel@willian.wang>
    Reported-by: Vincent Mauirn <vincent.maurin.fr@gmail.com>
    Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219981
    Tested-by: Alex De Lorenzo <kernel@alexdelorenzo.dev>
    Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
    Link: https://lore.kernel.org/r/20250826052747.2240670-1-superm1@kernel.org
    Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

cpufreq/amd-pstate: Fix setting of CPPC.min_perf in active mode for performance governor [+ + +]
Author: Gautham R. Shenoy <gautham.shenoy@amd.com>
Date:   Thu Aug 21 09:56:38 2025 +0530

    cpufreq/amd-pstate: Fix setting of CPPC.min_perf in active mode for performance governor
    
    [ Upstream commit 220abf77e7c2835cc63ea8cd7158cf83952640af ]
    
    In the "active" mode of the amd-pstate driver with performance
    governor, the CPPC.min_perf is expected to be the nominal_perf.
    
    However after commit a9b9b4c2a4cd ("cpufreq/amd-pstate: Drop min and
    max cached frequencies"), this is not the case when the governor is
    switched from performance to powersave and back to performance, and
    the CPPC.min_perf will be equal to the scaling_min_freq that was set
    for the powersave governor.
    
    This is because prior to commit a9b9b4c2a4cd ("cpufreq/amd-pstate:
    Drop min and max cached frequencies"), amd_pstate_epp_update_limit()
    would unconditionally call amd_pstate_update_min_max_limit() and the
    latter function would enforce the CPPC.min_perf constraint when the
    governor is performance.
    
    However, after the aforementioned commit,
    amd_pstate_update_min_max_limit() is called by
    amd_pstate_epp_update_limit() only when either the
    scaling_{min/max}_freq is different from the cached value of
    cpudata->{min/max}_limit_freq, which wouldn't have changed on a
    governor transition from powersave to performance, thus missing out on
    enforcing the CPPC.min_perf constraint for the performance governor.
    
    Fix this by invoking amd_pstate_epp_udpate_limit() not only when the
    {min/max} limits have changed from the cached values, but also when
    the policy itself has changed.
    
    Fixes: a9b9b4c2a4cd ("cpufreq/amd-pstate: Drop min and max cached frequencies")
    Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
    Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
    Link: https://lore.kernel.org/r/20250821042638.356-1-gautham.shenoy@amd.com
    Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
dma-debug: don't enforce dma mapping check on noncoherent allocations [+ + +]
Author: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Date:   Thu Aug 28 16:17:33 2025 +0800

    dma-debug: don't enforce dma mapping check on noncoherent allocations
    
    [ Upstream commit 7e2368a21741e2db542330b32aa6fdd8908e7cff ]
    
    As discussed in [1], there is no need to enforce dma mapping check on
    noncoherent allocations, a simple test on the returned CPU address is
    good enough.
    
    Add a new pair of debug helpers and use them for noncoherent alloc/free
    to fix this issue.
    
    Fixes: efa70f2fdc84 ("dma-mapping: add a new dma_alloc_pages API")
    Link: https://lore.kernel.org/all/ff6c1fe6-820f-4e58-8395-df06aa91706c@oss.qualcomm.com # 1
    Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
    Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Link: https://lore.kernel.org/r/20250828-dma-debug-fix-noncoherent-dma-check-v1-1-76e9be0dd7fc@oss.qualcomm.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
dmaengine: dw: dmamux: Fix device reference leak in rzn1_dmamux_route_allocate [+ + +]
Author: Miaoqian Lin <linmq006@gmail.com>
Date:   Tue Sep 2 17:03:58 2025 +0800

    dmaengine: dw: dmamux: Fix device reference leak in rzn1_dmamux_route_allocate
    
    commit aa2e1e4563d3ab689ffa86ca1412ecbf9fd3b308 upstream.
    
    The reference taken by of_find_device_by_node()
    must be released when not needed anymore.
    Add missing put_device() call to fix device reference leaks.
    
    Fixes: 134d9c52fca2 ("dmaengine: dw: dmamux: Introduce RZN1 DMA router support")
    Cc: stable@vger.kernel.org
    Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
    Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Link: https://lore.kernel.org/r/20250902090358.2423285-1-linmq006@gmail.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

dmaengine: idxd: Fix double free in idxd_setup_wqs() [+ + +]
Author: Dan Carpenter <dan.carpenter@linaro.org>
Date:   Mon Aug 11 13:43:39 2025 +0300

    dmaengine: idxd: Fix double free in idxd_setup_wqs()
    
    [ Upstream commit 39aaa337449e71a41d4813be0226a722827ba606 ]
    
    The clean up in idxd_setup_wqs() has had a couple bugs because the error
    handling is a bit subtle.  It's simpler to just re-write it in a cleaner
    way.  The issues here are:
    
    1) If "idxd->max_wqs" is <= 0 then we call put_device(conf_dev) when
       "conf_dev" hasn't been initialized.
    2) If kzalloc_node() fails then again "conf_dev" is invalid.  It's
       either uninitialized or it points to the "conf_dev" from the
       previous iteration so it leads to a double free.
    
    It's better to free partial loop iterations within the loop and then
    the unwinding at the end can handle whole loop iterations.  I also
    renamed the labels to describe what the goto does and not where the goto
    was located.
    
    Fixes: 3fd2f4bc010c ("dmaengine: idxd: fix memory leak in error handling path of idxd_setup_wqs")
    Reported-by: Colin Ian King <colin.i.king@gmail.com>
    Closes: https://lore.kernel.org/all/20250811095836.1642093-1-colin.i.king@gmail.com/
    Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
    Reviewed-by: Dave Jiang <dave.jiang@intel.com>
    Link: https://lore.kernel.org/r/aJnJW3iYTDDCj9sk@stanley.mountain
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

dmaengine: idxd: Fix refcount underflow on module unload [+ + +]
Author: Yi Sun <yi.sun@intel.com>
Date:   Tue Jul 29 23:03:13 2025 +0800

    dmaengine: idxd: Fix refcount underflow on module unload
    
    [ Upstream commit b7cb9a034305d52222433fad10c3de10204f29e7 ]
    
    A recent refactor introduced a misplaced put_device() call, resulting in a
    reference count underflow during module unload.
    
    There is no need to add additional put_device() calls for idxd groups,
    engines, or workqueues. Although the commit claims: "Note, this also
    fixes the missing put_device() for idxd groups, engines, and wqs."
    
    It appears no such omission actually existed. The required cleanup is
    already handled by the call chain:
    idxd_unregister_devices() -> device_unregister() -> put_device()
    
    Extend idxd_cleanup() to handle the remaining necessary cleanup and
    remove idxd_cleanup_internals(), which duplicates deallocation logic
    for idxd, engines, groups, and workqueues. Memory management is also
    properly handled through the Linux device model.
    
    Fixes: a409e919ca32 ("dmaengine: idxd: Refactor remove call with idxd_cleanup() helper")
    Signed-off-by: Yi Sun <yi.sun@intel.com>
    Tested-by: Shuai Xue <xueshuai@linux.alibaba.com>
    Reviewed-by: Dave Jiang <dave.jiang@intel.com>
    Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
    
    Link: https://lore.kernel.org/r/20250729150313.1934101-3-yi.sun@intel.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

dmaengine: idxd: Remove improper idxd_free [+ + +]
Author: Yi Sun <yi.sun@intel.com>
Date:   Tue Jul 29 23:03:12 2025 +0800

    dmaengine: idxd: Remove improper idxd_free
    
    [ Upstream commit f41c538881eec4dcf5961a242097d447f848cda6 ]
    
    The call to idxd_free() introduces a duplicate put_device() leading to a
    reference count underflow:
    refcount_t: underflow; use-after-free.
    WARNING: CPU: 15 PID: 4428 at lib/refcount.c:28 refcount_warn_saturate+0xbe/0x110
    ...
    Call Trace:
     <TASK>
      idxd_remove+0xe4/0x120 [idxd]
      pci_device_remove+0x3f/0xb0
      device_release_driver_internal+0x197/0x200
      driver_detach+0x48/0x90
      bus_remove_driver+0x74/0xf0
      pci_unregister_driver+0x2e/0xb0
      idxd_exit_module+0x34/0x7a0 [idxd]
      __do_sys_delete_module.constprop.0+0x183/0x280
      do_syscall_64+0x54/0xd70
      entry_SYSCALL_64_after_hwframe+0x76/0x7e
    
    The idxd_unregister_devices() which is invoked at the very beginning of
    idxd_remove(), already takes care of the necessary put_device() through the
    following call path:
    idxd_unregister_devices() -> device_unregister() -> put_device()
    
    In addition, when CONFIG_DEBUG_KOBJECT_RELEASE is enabled, put_device() may
    trigger asynchronous cleanup via schedule_delayed_work(). If idxd_free() is
    called immediately after, it can result in a use-after-free.
    
    Remove the improper idxd_free() to avoid both the refcount underflow and
    potential memory corruption during module unload.
    
    Fixes: d5449ff1b04d ("dmaengine: idxd: Add missing idxd cleanup to fix memory leak in remove call")
    Signed-off-by: Yi Sun <yi.sun@intel.com>
    Tested-by: Shuai Xue <xueshuai@linux.alibaba.com>
    Reviewed-by: Dave Jiang <dave.jiang@intel.com>
    Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
    
    Link: https://lore.kernel.org/r/20250729150313.1934101-2-yi.sun@intel.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

dmaengine: qcom: bam_dma: Fix DT error handling for num-channels/ees [+ + +]
Author: Stephan Gerhold <stephan.gerhold@linaro.org>
Date:   Wed Feb 12 18:03:54 2025 +0100

    dmaengine: qcom: bam_dma: Fix DT error handling for num-channels/ees
    
    commit 5068b5254812433e841a40886e695633148d362d upstream.
    
    When we don't have a clock specified in the device tree, we have no way to
    ensure the BAM is on. This is often the case for remotely-controlled or
    remotely-powered BAM instances. In this case, we need to read num-channels
    from the DT to have all the necessary information to complete probing.
    
    However, at the moment invalid device trees without clock and without
    num-channels still continue probing, because the error handling is missing
    return statements. The driver will then later try to read the number of
    channels from the registers. This is unsafe, because it relies on boot
    firmware and lucky timing to succeed. Unfortunately, the lack of proper
    error handling here has been abused for several Qualcomm SoCs upstream,
    causing early boot crashes in several situations [1, 2].
    
    Avoid these early crashes by erroring out when any of the required DT
    properties are missing. Note that this will break some of the existing DTs
    upstream (mainly BAM instances related to the crypto engine). However,
    clearly these DTs have never been tested properly, since the error in the
    kernel log was just ignored. It's safer to disable the crypto engine for
    these broken DTBs.
    
    [1]: https://lore.kernel.org/r/CY01EKQVWE36.B9X5TDXAREPF@fairphone.com/
    [2]: https://lore.kernel.org/r/20230626145959.646747-1-krzysztof.kozlowski@linaro.org/
    
    Cc: stable@vger.kernel.org
    Fixes: 48d163b1aa6e ("dmaengine: qcom: bam_dma: get num-channels and num-ees from dt")
    Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
    Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
    Link: https://lore.kernel.org/r/20250212-bam-dma-fixes-v1-8-f560889e65d8@linaro.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

dmaengine: ti: edma: Fix memory allocation size for queue_priority_map [+ + +]
Author: Anders Roxell <anders.roxell@linaro.org>
Date:   Sat Aug 30 11:49:53 2025 +0200

    dmaengine: ti: edma: Fix memory allocation size for queue_priority_map
    
    [ Upstream commit e63419dbf2ceb083c1651852209c7f048089ac0f ]
    
    Fix a critical memory allocation bug in edma_setup_from_hw() where
    queue_priority_map was allocated with insufficient memory. The code
    declared queue_priority_map as s8 (*)[2] (pointer to array of 2 s8),
    but allocated memory using sizeof(s8) instead of the correct size.
    
    This caused out-of-bounds memory writes when accessing:
      queue_priority_map[i][0] = i;
      queue_priority_map[i][1] = i;
    
    The bug manifested as kernel crashes with "Oops - undefined instruction"
    on ARM platforms (BeagleBoard-X15) during EDMA driver probe, as the
    memory corruption triggered kernel hardening features on Clang.
    
    Change the allocation to use sizeof(*queue_priority_map) which
    automatically gets the correct size for the 2D array structure.
    
    Fixes: 2b6b3b742019 ("ARM/dmaengine: edma: Merge the two drivers under drivers/dma/")
    Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
    Link: https://lore.kernel.org/r/20250830094953.3038012-1-anders.roxell@linaro.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
doc: mptcp: net.mptcp.pm_type is deprecated [+ + +]
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Date:   Mon Sep 8 23:27:28 2025 +0200

    doc: mptcp: net.mptcp.pm_type is deprecated
    
    commit 6f021e95d0828edc8ed104a294594c2f9569383a upstream.
    
    The net.mptcp.pm_type sysctl knob has been deprecated in v6.15,
    net.mptcp.path_manager should be used instead.
    
    Adapt the section about path managers to suggest using the new sysctl
    knob instead of the deprecated one.
    
    Fixes: 595c26d122d1 ("mptcp: sysctl: set path manager by name")
    Cc: stable@vger.kernel.org
    Reviewed-by: Geliang Tang <geliang@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20250908-net-mptcp-misc-fixes-6-17-rc5-v1-2-5f2168a66079@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
docs: networking: can: change bcm_msg_head frames member to support flexible array [+ + +]
Author: Alex Tran <alex.t.tran@gmail.com>
Date:   Wed Sep 3 20:17:09 2025 -0700

    docs: networking: can: change bcm_msg_head frames member to support flexible array
    
    [ Upstream commit 641427d5bf90af0625081bf27555418b101274cd ]
    
    The documentation of the 'bcm_msg_head' struct does not match how
    it is defined in 'bcm.h'. Changed the frames member to a flexible array,
    matching the definition in the header file.
    
    See commit 94dfc73e7cf4 ("treewide: uapi: Replace zero-length arrays with
    flexible-array members")
    
    Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
    Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
    Link: https://patch.msgid.link/20250904031709.1426895-1-alex.t.tran@gmail.com
    Fixes: 94dfc73e7cf4 ("treewide: uapi: Replace zero-length arrays with flexible-array members")
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=217783
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/amd/amdgpu: Declare isp firmware binary file [+ + +]
Author: Pratap Nirujogi <pratap.nirujogi@amd.com>
Date:   Wed Sep 3 16:00:24 2025 -0400

    drm/amd/amdgpu: Declare isp firmware binary file
    
    commit 857ccfc19f9be1269716f3d681650c1bd149a656 upstream.
    
    Declare isp firmware file isp_4_1_1.bin required by isp4.1.1 device.
    
    Suggested-by: Alexey Zagorodnikov <xglooom@gmail.com>
    Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Pratap Nirujogi <pratap.nirujogi@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit d97b74a833eba1f4f69f67198fd98ef036c0e5f9)
    Cc: stable@vger.kernel.org
    [ Adjust context ]
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amd/display: Correct sequences and delays for DCN35 PG & RCG [+ + +]
Author: Ovidiu Bunea <ovidiu.bunea@amd.com>
Date:   Mon Aug 25 14:45:33 2025 -0400

    drm/amd/display: Correct sequences and delays for DCN35 PG & RCG
    
    commit 70f0b051f82d0234ade2f6753f72a2610048db3b upstream.
    
    [why]
    The current PG & RCG programming in driver has some gaps and incorrect
    sequences.
    
    [how]
    Added delays after ungating clocks to allow ramp up, increased polling
    to allow more time for power up, and removed the incorrect sequences.
    
    Cc: Mario Limonciello <mario.limonciello@amd.com>
    Cc: Alex Deucher <alexander.deucher@amd.com>
    Reviewed-by: Charlene Liu <charlene.liu@amd.com>
    Signed-off-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
    Signed-off-by: Wayne Lin <wayne.lin@amd.com>
    Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 1bde5584e297921f45911ae874b0175dce5ed4b5)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: Destroy cached state in complete() callback [+ + +]
Author: Mario Limonciello <mario.limonciello@amd.com>
Date:   Sun Sep 14 07:48:17 2025 -0400

    drm/amd/display: Destroy cached state in complete() callback
    
    [ Upstream commit 45cc102f8e6520ac07637c7e09f61dcc3772e125 ]
    
    [Why]
    When the suspend sequence has been aborted after prepare() but
    before suspend() the resume() callback never gets called. The PM core
    will call complete() when this happens. As the state has been cached
    in prepare() it needs to be destroyed in complete() if it's still around.
    
    [How]
    Create a helper for destroying cached state and call it both in resume()
    and complete() callbacks. If resume has been called the state will be
    destroyed and it's a no-op for complete().  If resume hasn't been called
    (such as an aborted suspend) then destroy the state in complete().
    
    Fixes: 50e0bae34fa6 ("drm/amd/display: Add and use new dm_prepare_suspend() callback")
    Reviewed-by: Alex Hung <alex.hung@amd.com>
    Link: https://lore.kernel.org/r/20250602014432.3538345-4-superm1@kernel.org
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Stable-dep-of: 60f71f0db7b1 ("drm/amd/display: Drop dm_prepare_suspend() and dm_complete()")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: Disable DPCD Probe Quirk [+ + +]
Author: Fangzhi Zuo <Jerry.Zuo@amd.com>
Date:   Thu Sep 4 15:13:51 2025 -0400

    drm/amd/display: Disable DPCD Probe Quirk
    
    commit f5c32370dba668c171c73684f489a3ea0b9503c5 upstream.
    
    Disable dpcd probe quirk to native aux.
    
    Signed-off-by: Fangzhi Zuo <Jerry.Zuo@amd.com>
    Reviewed-by: Imre Deak <imre.deak@intel.com>
    Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4500
    Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
    Link: https://lore.kernel.org/r/20250904191351.746707-1-Jerry.Zuo@amd.com
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit c5f4fb40584ee591da9fa090c6f265d11cbb1acf)
    Cc: stable@vger.kernel.org # 6.16.y: 5281cbe0b55a
    Cc: stable@vger.kernel.org # 6.16.y: 0b4aa85e8981
    Cc: stable@vger.kernel.org # 6.16.y: b87ed522b364
    Cc: stable@vger.kernel.org # 6.16.y
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: Drop dm_prepare_suspend() and dm_complete() [+ + +]
Author: Mario Limonciello (AMD) <mario.limonciello@amd.com>
Date:   Sun Sep 14 07:48:18 2025 -0400

    drm/amd/display: Drop dm_prepare_suspend() and dm_complete()
    
    [ Upstream commit 60f71f0db7b12f303789ef59949e38ee5838ee8b ]
    
    [Why]
    dm_prepare_suspend() was added in commit 50e0bae34fa6b
    ("drm/amd/display: Add and use new dm_prepare_suspend() callback")
    to allow display to turn off earlier in the suspend sequence.
    
    This caused a regression that HDMI audio sometimes didn't work
    properly after resume unless audio was playing during suspend.
    
    [How]
    Drop dm_prepare_suspend() callback. All code in it will still run
    during dm_suspend(). Also drop unnecessary dm_complete() callback.
    dm_complete() was used for failed prepare and also for any case
    of successful resume.  The code in it already runs in dm_resume().
    
    This change will introduce more time that the display is turned on
    during suspend sequence. The compositor can turn it off sooner if
    desired.
    
    Cc: Harry Wentland <harry.wentland@amd.com>
    Reported-by: Przemysław Kopa <prz.kopa@gmail.com>
    Closes: https://lore.kernel.org/amd-gfx/1cea0d56-7739-4ad9-bf8e-c9330faea2bb@kernel.org/T/#m383d9c08397043a271b36c32b64bb80e524e4b0f
    Reported-by: Kalvin <hikaph+oss@gmail.com>
    Closes: https://github.com/alsa-project/alsa-lib/issues/465
    Closes: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/4809
    Fixes: 50e0bae34fa6b ("drm/amd/display: Add and use new dm_prepare_suspend() callback")
    Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
    Acked-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 2fd653b9bb5aacec5d4c421ab290905898fe85a2)
    Cc: stable@vger.kernel.org
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: remove oem i2c adapter on finish [+ + +]
Author: Geoffrey McRae <geoffrey.mcrae@amd.com>
Date:   Thu Aug 28 22:26:22 2025 +1000

    drm/amd/display: remove oem i2c adapter on finish
    
    commit 1dfd2864a1c4909147663e5a27c055f50f7c2796 upstream.
    
    Fixes a bug where unbinding of the GPU would leave the oem i2c adapter
    registered resulting in a null pointer dereference when applications try
    to access the invalid device.
    
    Fixes: 3d5470c97314 ("drm/amd/display/dm: add support for OEM i2c bus")
    Cc: Harry Wentland <harry.wentland@amd.com>
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Geoffrey McRae <geoffrey.mcrae@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 89923fb7ead4fdd37b78dd49962d9bb5892403e6)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/amd/display: use udelay rather than fsleep [+ + +]
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Wed Sep 3 09:11:12 2025 -0400

    drm/amd/display: use udelay rather than fsleep
    
    [ Upstream commit 1d66c3f2b8c0b5c51f3f4fe29b362c9851190c5a ]
    
    This function can be called from an atomic context so we can't use
    fsleep().
    
    Fixes: 01f60348d8fb ("drm/amd/display: Fix 'failed to blank crtc!'")
    Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4549
    Cc: Wen Chen <Wen.Chen3@amd.com>
    Cc: Fangzhi Zuo <jerry.zuo@amd.com>
    Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
    Cc: Harry Wentland <harry.wentland@amd.com>
    Reviewed-by: Harry Wentland <harry.wentland@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 27e4dc2c0543fd1808cc52bd888ee1e0533c4a2e)
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/amdgpu/vcn4: Fix IB parsing with multiple engine info packages [+ + +]
Author: David Rosca <david.rosca@amd.com>
Date:   Mon Aug 18 09:06:58 2025 +0200

    drm/amdgpu/vcn4: Fix IB parsing with multiple engine info packages
    
    commit 2b10cb58d7a3fd621ec9b2ba765a092e562ef998 upstream.
    
    There can be multiple engine info packages in one IB and the first one
    may be common engine, not decode/encode.
    We need to parse the entire IB instead of stopping after finding first
    engine info.
    
    Signed-off-by: David Rosca <david.rosca@amd.com>
    Reviewed-by: Leo Liu <leo.liu@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit dc8f9f0f45166a6b37864e7a031c726981d6e5fc)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amdgpu/vcn: Allow limiting ctx to instance 0 for AV1 at any time [+ + +]
Author: David Rosca <david.rosca@amd.com>
Date:   Mon Aug 18 09:18:37 2025 +0200

    drm/amdgpu/vcn: Allow limiting ctx to instance 0 for AV1 at any time
    
    commit 3318f2d20ce48849855df5e190813826d0bc3653 upstream.
    
    There is no reason to require this to happen on first submitted IB only.
    We need to wait for the queue to be idle, but it can be done at any
    time (including when there are multiple video sessions active).
    
    Signed-off-by: David Rosca <david.rosca@amd.com>
    Reviewed-by: Leo Liu <leo.liu@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit 8908fdce0634a623404e9923ed2f536101a39db5)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/amdgpu: fix a memory leak in fence cleanup when unloading [+ + +]
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Sep 4 12:35:05 2025 -0400

    drm/amdgpu: fix a memory leak in fence cleanup when unloading
    
    commit 7838fb5f119191403560eca2e23613380c0e425e upstream.
    
    Commit b61badd20b44 ("drm/amdgpu: fix usage slab after free")
    reordered when amdgpu_fence_driver_sw_fini() was called after
    that patch, amdgpu_fence_driver_sw_fini() effectively became
    a no-op as the sched entities we never freed because the
    ring pointers were already set to NULL.  Remove the NULL
    setting.
    
    Reported-by: Lin.Cao <lincao12@amd.com>
    Cc: Vitaly Prosyak <vitaly.prosyak@amd.com>
    Cc: Christian König <christian.koenig@amd.com>
    Fixes: b61badd20b44 ("drm/amdgpu: fix usage slab after free")
    Reviewed-by: Christian König <christian.koenig@amd.com>
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit a525fa37aac36c4591cc8b07ae8957862415fbd5)
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/dp: Add an EDID quirk for the DPCD register access probe [+ + +]
Author: Imre Deak <imre.deak@intel.com>
Date:   Mon Jun 9 15:55:55 2025 +0300

    drm/dp: Add an EDID quirk for the DPCD register access probe
    
    commit b87ed522b3643f096ef183ed0ccf2d2b90ddd513 upstream.
    
    Reading DPCD registers has side-effects and some of these can cause a
    problem for instance during link training. Based on this it's better to
    avoid the probing quirk done before each DPCD register read, limiting
    this to the monitor which requires it. Add an EDID quirk for this. Leave
    the quirk enabled by default, allowing it to be disabled after the
    monitor is detected.
    
    v2: Fix lockdep wrt. drm_dp_aux::hw_mutex when calling
        drm_dp_dpcd_set_probe_quirk() with a dependent lock already held.
    v3: Add a helper for determining if DPCD probing is needed. (Jani)
    v4:
    - s/drm_dp_dpcd_set_probe_quirk/drm_dp_dpcd_set_probe (Jani)
    - Fix documentation of drm_dp_dpcd_set_probe().
    - Add comment at the end of internal quirk entries.
    
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Cc: Jani Nikula <jani.nikula@linux.intel.com>
    Reviewed-by: Jani Nikula <jani.nikula@intel.com>
    Signed-off-by: Imre Deak <imre.deak@intel.com>
    Link: https://lore.kernel.org/r/20250609125556.109538-1-imre.deak@intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/edid: Add support for quirks visible to DRM core and drivers [+ + +]
Author: Imre Deak <imre.deak@intel.com>
Date:   Thu Jun 5 11:28:48 2025 +0300

    drm/edid: Add support for quirks visible to DRM core and drivers
    
    commit 0b4aa85e8981198e23a68d50ee3c490ccd7f8311 upstream.
    
    Add support for EDID based quirks which can be queried outside of the
    EDID parser iteself by DRM core and drivers. There are at least two such
    quirks applicable to all drivers: the DPCD register access probe quirk
    and the 128b/132b DPRX Lane Count Conversion quirk (see 3.5.2.16.3 in
    the v2.1a DP Standard). The latter quirk applies to panels with specific
    EDID panel names, support for defining a quirk this way will be added as
    a follow-up.
    
    v2: Reset global_quirks in drm_reset_display_info().
    v3: (Jani)
    - Use one list for both the global and internal quirks.
    - Drop change for panel name specific quirks.
    - Add comment about the way quirks should be queried.
    
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Cc: Jani Nikula <jani.nikula@linux.intel.com>
    Reviewed-by: Jani Nikula <jani.nikula@intel.com>
    Signed-off-by: Imre Deak <imre.deak@intel.com>
    Link: https://lore.kernel.org/r/20250605082850.65136-4-imre.deak@intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/edid: Define the quirks in an enum list [+ + +]
Author: Imre Deak <imre.deak@intel.com>
Date:   Thu Jun 5 11:28:47 2025 +0300

    drm/edid: Define the quirks in an enum list
    
    commit 5281cbe0b55a1ff9c6c29361540016873bdc506e upstream.
    
    An enum list is better suited to define a quirk list, do that. This
    makes looking up a quirk more robust and also allows for separating
    quirks internal to the EDID parser and global quirks which can be
    queried outside of the EDID parser (added as a follow-up).
    
    Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
    Reviewed-by: Jani Nikula <jani.nikula@intel.com>
    Signed-off-by: Imre Deak <imre.deak@intel.com>
    Link: https://lore.kernel.org/r/20250605082850.65136-3-imre.deak@intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/i915/power: fix size for for_each_set_bit() in abox iteration [+ + +]
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Fri Sep 5 13:41:49 2025 +0300

    drm/i915/power: fix size for for_each_set_bit() in abox iteration
    
    commit cfa7b7659757f8d0fc4914429efa90d0d2577dd7 upstream.
    
    for_each_set_bit() expects size to be in bits, not bytes. The abox mask
    iteration uses bytes, but it works by coincidence, because the local
    variable holding the mask is unsigned long, and the mask only ever has
    bit 2 as the highest bit. Using a smaller type could lead to subtle and
    very hard to track bugs.
    
    Fixes: 62afef2811e4 ("drm/i915/rkl: RKL uses ABOX0 for pixel transfers")
    Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Cc: Matt Roper <matthew.d.roper@intel.com>
    Cc: stable@vger.kernel.org # v5.9+
    Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
    Link: https://lore.kernel.org/r/20250905104149.1144751-1-jani.nikula@intel.com
    Signed-off-by: Jani Nikula <jani.nikula@intel.com>
    (cherry picked from commit 7ea3baa6efe4bb93d11e1c0e6528b1468d7debf6)
    Signed-off-by: Tvrtko Ursulin <tursulin@ursulin.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/mediatek: fix potential OF node use-after-free [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Fri Aug 29 11:03:44 2025 +0200

    drm/mediatek: fix potential OF node use-after-free
    
    commit 4de37a48b6b58faaded9eb765047cf0d8785ea18 upstream.
    
    The for_each_child_of_node() helper drops the reference it takes to each
    node as it iterates over children and an explicit of_node_put() is only
    needed when exiting the loop early.
    
    Drop the recently introduced bogus additional reference count decrement
    at each iteration that could potentially lead to a use-after-free.
    
    Fixes: 1f403699c40f ("drm/mediatek: Fix device/node reference count leaks in mtk_drm_get_all_drm_priv")
    Cc: Ma Ke <make24@iscas.ac.cn>
    Cc: stable@vger.kernel.org
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Reviewed-by: CK Hu <ck.hu@mediatek.com>
    Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
    Link: https://patchwork.kernel.org/project/dri-devel/patch/20250829090345.21075-2-johan@kernel.org/
    Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
drm/panthor: validate group queue count [+ + +]
Author: Chia-I Wu <olvaffe@gmail.com>
Date:   Wed Sep 3 12:21:33 2025 -0700

    drm/panthor: validate group queue count
    
    [ Upstream commit a00f2015acdbd8a4b3d2382eaeebe11db1925fad ]
    
    A panthor group can have at most MAX_CS_PER_CSG panthor queues.
    
    Fixes: 4bdca11507928 ("drm/panthor: Add the driver frontend block")
    Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
    Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> # v1
    Reviewed-by: Steven Price <steven.price@arm.com>
    Signed-off-by: Steven Price <steven.price@arm.com>
    Link: https://lore.kernel.org/r/20250903192133.288477-1-olvaffe@gmail.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/xe/configfs: Don't touch survivability_mode on fini [+ + +]
Author: Michal Wajdeczko <michal.wajdeczko@intel.com>
Date:   Thu Sep 4 12:35:21 2025 +0200

    drm/xe/configfs: Don't touch survivability_mode on fini
    
    [ Upstream commit 7934fdc25ad642ab3dbc16d734ab58638520ea60 ]
    
    This is a user controlled configfs attribute, we should not
    modify that outside the configfs attr.store() implementation.
    
    Fixes: bc417e54e24b ("drm/xe: Enable configfs support for survivability mode")
    Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
    Cc: Lucas De Marchi <lucas.demarchi@intel.com>
    Cc: Riana Tauro <riana.tauro@intel.com>
    Reviewed-by: Stuart Summers <stuart.summers@intel.com>
    Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
    Link: https://lore.kernel.org/r/20250904103521.7130-1-michal.wajdeczko@intel.com
    (cherry picked from commit 079a5c83dbd23db7a6eed8f558cf75e264d8a17b)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
drm/xe: Allow the pm notifier to continue on failure [+ + +]
Author: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Date:   Thu Sep 4 18:07:14 2025 +0200

    drm/xe: Allow the pm notifier to continue on failure
    
    commit d84820309ed34cc412ce76ecfa9471dae7d7d144 upstream.
    
    Its actions are opportunistic anyway and will be completed
    on device suspend.
    
    Marking as a fix to simplify backporting of the fix
    that follows in the series.
    
    v2:
    - Keep the runtime pm reference over suspend / hibernate and
      document why. (Matt Auld, Rodrigo Vivi):
    
    Fixes: c6a4d46ec1d7 ("drm/xe: evict user memory in PM notifier")
    Cc: Matthew Auld <matthew.auld@intel.com>
    Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Cc: <stable@vger.kernel.org> # v6.16+
    Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Link: https://lore.kernel.org/r/20250904160715.2613-3-thomas.hellstrom@linux.intel.com
    (cherry picked from commit ebd546fdffddfcaeab08afdd68ec93052c8fa740)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/xe: Attempt to bring bos back to VRAM after eviction [+ + +]
Author: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Date:   Thu Sep 4 18:07:13 2025 +0200

    drm/xe: Attempt to bring bos back to VRAM after eviction
    
    commit 5c87fee3c96ce898ad681552404a66c7605193c0 upstream.
    
    VRAM+TT bos that are evicted from VRAM to TT may remain in
    TT also after a revalidation following eviction or suspend.
    
    This manifests itself as applications becoming sluggish
    after buffer objects get evicted or after a resume from
    suspend or hibernation.
    
    If the bo supports placement in both VRAM and TT, and
    we are on DGFX, mark the TT placement as fallback. This means
    that it is tried only after VRAM + eviction.
    
    This flaw has probably been present since the xe module was
    upstreamed but use a Fixes: commit below where backporting is
    likely to be simple. For earlier versions we need to open-
    code the fallback algorithm in the driver.
    
    v2:
    - Remove check for dgfx. (Matthew Auld)
    - Update the xe_dma_buf kunit test for the new strategy (CI)
    - Allow dma-buf to pin in current placement (CI)
    - Make xe_bo_validate() for pinned bos a NOP.
    
    Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/5995
    Fixes: a78a8da51b36 ("drm/ttm: replace busy placement with flags v6")
    Cc: Matthew Brost <matthew.brost@intel.com>
    Cc: Matthew Auld <matthew.auld@intel.com>
    Cc: <stable@vger.kernel.org> # v6.9+
    Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Link: https://lore.kernel.org/r/20250904160715.2613-2-thomas.hellstrom@linux.intel.com
    (cherry picked from commit cb3d7b3b46b799c96b54f8e8fe36794a55a77f0b)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

drm/xe: Block exec and rebind worker while evicting for suspend / hibernate [+ + +]
Author: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Date:   Thu Sep 4 18:07:15 2025 +0200

    drm/xe: Block exec and rebind worker while evicting for suspend / hibernate
    
    commit eb5723a75104605b7d2207a7d598e314166fbef4 upstream.
    
    When the xe pm_notifier evicts for suspend / hibernate, there might be
    racing tasks trying to re-validate again. This can lead to suspend taking
    excessive time or get stuck in a live-lock. This behaviour becomes
    much worse with the fix that actually makes re-validation bring back
    bos to VRAM rather than letting them remain in TT.
    
    Prevent that by having exec and the rebind worker waiting for a completion
    that is set to block by the pm_notifier before suspend and is signaled
    by the pm_notifier after resume / wakeup.
    
    It's probably still possible to craft malicious applications that block
    suspending. More work is pending to fix that.
    
    v3:
    - Avoid wait_for_completion() in the kernel worker since it could
      potentially cause work item flushes from freezable processes to
      wait forever. Instead terminate the rebind workers if needed and
      re-launch at resume. (Matt Auld)
    v4:
    - Fix some bad naming and leftover debug printouts.
    - Fix kerneldoc.
    - Use drmm_mutex_init() for the xe->rebind_resume_lock (Matt Auld).
    - Rework the interface of xe_vm_rebind_resume_worker (Matt Auld).
    
    Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4288
    Fixes: c6a4d46ec1d7 ("drm/xe: evict user memory in PM notifier")
    Cc: Matthew Auld <matthew.auld@intel.com>
    Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Cc: <stable@vger.kernel.org> # v6.16+
    Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
    Reviewed-by: Matthew Auld <matthew.auld@intel.com>
    Link: https://lore.kernel.org/r/20250904160715.2613-4-thomas.hellstrom@linux.intel.com
    (cherry picked from commit 599334572a5a99111015fbbd5152ce4dedc2f8b7)
    Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
dt-bindings: serial: brcm,bcm7271-uart: Constrain clocks [+ + +]
Author: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Date:   Tue Aug 12 14:16:31 2025 +0200

    dt-bindings: serial: brcm,bcm7271-uart: Constrain clocks
    
    commit ee047e1d85d73496541c54bd4f432c9464e13e65 upstream.
    
    Lists should have fixed constraints, because binding must be specific in
    respect to hardware, thus add missing constraints to number of clocks.
    
    Cc: stable <stable@kernel.org>
    Fixes: 88a499cd70d4 ("dt-bindings: Add support for the Broadcom UART driver")
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Link: https://lore.kernel.org/r/20250812121630.67072-2-krzysztof.kozlowski@linaro.org
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
EDAC/altera: Delete an inappropriate dma_free_coherent() call [+ + +]
Author: Salah Triki <salah.triki@gmail.com>
Date:   Thu Jul 31 04:15:27 2025 +0100

    EDAC/altera: Delete an inappropriate dma_free_coherent() call
    
    commit ff2a66d21fd2364ed9396d151115eec59612b200 upstream.
    
    dma_free_coherent() must only be called if the corresponding
    dma_alloc_coherent() call has succeeded. Calling it when the allocation fails
    leads to undefined behavior.
    
    Delete the wrong call.
    
      [ bp: Massage commit message. ]
    
    Fixes: 71bcada88b0f3 ("edac: altera: Add Altera SDRAM EDAC support")
    Signed-off-by: Salah Triki <salah.triki@gmail.com>
    Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
    Acked-by: Dinh Nguyen <dinguyen@kernel.org>
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/aIrfzzqh4IzYtDVC@pc
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
erofs: fix invalid algorithm for encoded extents [+ + +]
Author: Gao Xiang <xiang@kernel.org>
Date:   Sun Aug 24 23:11:57 2025 +0800

    erofs: fix invalid algorithm for encoded extents
    
    [ Upstream commit 131897c65e2b86cf14bec7379f44aa8fbb407526 ]
    
    The current algorithm sanity checks do not properly apply to new
    encoded extents.
    
    Unify the algorithm check with Z_EROFS_COMPRESSION(_RUNTIME)_MAX
    and ensure consistency with sbi->available_compr_algs.
    
    Reported-and-tested-by: syzbot+5a398eb460ddaa6f242f@syzkaller.appspotmail.com
    Closes: https://lore.kernel.org/r/68a8bd20.050a0220.37038e.005a.GAE@google.com
    Fixes: 1d191b4ca51d ("erofs: implement encoded extent metadata")
    Thanks-to: Edward Adam Davis <eadavis@qq.com>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

erofs: fix runtime warning on truncate_folio_batch_exceptionals() [+ + +]
Author: Yuezhang Mo <Yuezhang.Mo@sony.com>
Date:   Wed Sep 10 13:33:40 2025 +0800

    erofs: fix runtime warning on truncate_folio_batch_exceptionals()
    
    [ Upstream commit 181993bb0d626cf88cc803f4356ce5c5abe86278 ]
    
    Commit 0e2f80afcfa6("fs/dax: ensure all pages are idle prior to
    filesystem unmount") introduced the WARN_ON_ONCE to capture whether
    the filesystem has removed all DAX entries or not and applied the
    fix to xfs and ext4.
    
    Apply the missed fix on erofs to fix the runtime warning:
    
    [  5.266254] ------------[ cut here ]------------
    [  5.266274] WARNING: CPU: 6 PID: 3109 at mm/truncate.c:89 truncate_folio_batch_exceptionals+0xff/0x260
    [  5.266294] Modules linked in:
    [  5.266999] CPU: 6 UID: 0 PID: 3109 Comm: umount Tainted: G S                  6.16.0+ #6 PREEMPT(voluntary)
    [  5.267012] Tainted: [S]=CPU_OUT_OF_SPEC
    [  5.267017] Hardware name: Dell Inc. OptiPlex 5000/05WXFV, BIOS 1.5.1 08/24/2022
    [  5.267024] RIP: 0010:truncate_folio_batch_exceptionals+0xff/0x260
    [  5.267076] Code: 00 00 41 39 df 7f 11 eb 78 83 c3 01 49 83 c4 08 41 39 df 74 6c 48 63 f3 48 83 fe 1f 0f 83 3c 01 00 00 43 f6 44 26 08 01 74 df <0f> 0b 4a 8b 34 22 4c 89 ef 48 89 55 90 e8 ff 54 1f 00 48 8b 55 90
    [  5.267083] RSP: 0018:ffffc900013f36c8 EFLAGS: 00010202
    [  5.267095] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
    [  5.267101] RDX: ffffc900013f3790 RSI: 0000000000000000 RDI: ffff8882a1407898
    [  5.267108] RBP: ffffc900013f3740 R08: 0000000000000000 R09: 0000000000000000
    [  5.267113] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
    [  5.267119] R13: ffff8882a1407ab8 R14: ffffc900013f3888 R15: 0000000000000001
    [  5.267125] FS:  00007aaa8b437800(0000) GS:ffff88850025b000(0000) knlGS:0000000000000000
    [  5.267132] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  5.267138] CR2: 00007aaa8b3aac10 CR3: 000000024f764000 CR4: 0000000000f52ef0
    [  5.267144] PKRU: 55555554
    [  5.267150] Call Trace:
    [  5.267154]  <TASK>
    [  5.267181]  truncate_inode_pages_range+0x118/0x5e0
    [  5.267193]  ? save_trace+0x54/0x390
    [  5.267296]  truncate_inode_pages_final+0x43/0x60
    [  5.267309]  evict+0x2a4/0x2c0
    [  5.267339]  dispose_list+0x39/0x80
    [  5.267352]  evict_inodes+0x150/0x1b0
    [  5.267376]  generic_shutdown_super+0x41/0x180
    [  5.267390]  kill_block_super+0x1b/0x50
    [  5.267402]  erofs_kill_sb+0x81/0x90 [erofs]
    [  5.267436]  deactivate_locked_super+0x32/0xb0
    [  5.267450]  deactivate_super+0x46/0x60
    [  5.267460]  cleanup_mnt+0xc3/0x170
    [  5.267475]  __cleanup_mnt+0x12/0x20
    [  5.267485]  task_work_run+0x5d/0xb0
    [  5.267499]  exit_to_user_mode_loop+0x144/0x170
    [  5.267512]  do_syscall_64+0x2b9/0x7c0
    [  5.267523]  ? __lock_acquire+0x665/0x2ce0
    [  5.267535]  ? __lock_acquire+0x665/0x2ce0
    [  5.267560]  ? lock_acquire+0xcd/0x300
    [  5.267573]  ? find_held_lock+0x31/0x90
    [  5.267582]  ? mntput_no_expire+0x97/0x4e0
    [  5.267606]  ? mntput_no_expire+0xa1/0x4e0
    [  5.267625]  ? mntput+0x24/0x50
    [  5.267634]  ? path_put+0x1e/0x30
    [  5.267647]  ? do_faccessat+0x120/0x2f0
    [  5.267677]  ? do_syscall_64+0x1a2/0x7c0
    [  5.267686]  ? from_kgid_munged+0x17/0x30
    [  5.267703]  ? from_kuid_munged+0x13/0x30
    [  5.267711]  ? __do_sys_getuid+0x3d/0x50
    [  5.267724]  ? do_syscall_64+0x1a2/0x7c0
    [  5.267732]  ? irqentry_exit+0x77/0xb0
    [  5.267743]  ? clear_bhb_loop+0x30/0x80
    [  5.267752]  ? clear_bhb_loop+0x30/0x80
    [  5.267765]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
    [  5.267772] RIP: 0033:0x7aaa8b32a9fb
    [  5.267781] Code: c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 f3 0f 1e fa 31 f6 e9 05 00 00 00 0f 1f 44 00 00 f3 0f 1e fa b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 8b 15 e9 83 0d 00 f7 d8
    [  5.267787] RSP: 002b:00007ffd7c4c9468 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
    [  5.267796] RAX: 0000000000000000 RBX: 00005a61592a8b00 RCX: 00007aaa8b32a9fb
    [  5.267802] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00005a61592b2080
    [  5.267806] RBP: 00007ffd7c4c9540 R08: 00007aaa8b403b20 R09: 0000000000000020
    [  5.267812] R10: 0000000000000001 R11: 0000000000000246 R12: 00005a61592a8c00
    [  5.267817] R13: 0000000000000000 R14: 00005a61592b2080 R15: 00005a61592a8f10
    [  5.267849]  </TASK>
    [  5.267854] irq event stamp: 4721
    [  5.267859] hardirqs last  enabled at (4727): [<ffffffff814abf50>] __up_console_sem+0x90/0xa0
    [  5.267873] hardirqs last disabled at (4732): [<ffffffff814abf35>] __up_console_sem+0x75/0xa0
    [  5.267884] softirqs last  enabled at (3044): [<ffffffff8132adb3>] kernel_fpu_end+0x53/0x70
    [  5.267895] softirqs last disabled at (3042): [<ffffffff8132b5f4>] kernel_fpu_begin_mask+0xc4/0x120
    [  5.267905] ---[ end trace 0000000000000000 ]---
    
    Fixes: bde708f1a65d ("fs/dax: always remove DAX page-cache entries when breaking layouts")
    Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
    Reviewed-by: Friendy Su <friendy.su@sony.com>
    Reviewed-by: Daniel Palmer <daniel.palmer@sony.com>
    Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

erofs: get rid of {get,put}_page() for ztailpacking data [+ + +]
Author: Gao Xiang <xiang@kernel.org>
Date:   Thu Jun 26 16:54:59 2025 +0800

    erofs: get rid of {get,put}_page() for ztailpacking data
    
    [ Upstream commit 96debe8c27ee2494bbd78abf3744745a84a745f1 ]
    
    The compressed data for the ztailpacking feature is fetched from
    the metadata inode (e.g., bd_inode), which is folio-based.
    
    Therefore, the folio interface should be used instead.
    
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Link: https://lore.kernel.org/r/20250626085459.339830-1-hsiangkao@linux.alibaba.com
    Stable-dep-of: 131897c65e2b ("erofs: fix invalid algorithm for encoded extents")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

erofs: remove need_kmap in erofs_read_metabuf() [+ + +]
Author: Gao Xiang <xiang@kernel.org>
Date:   Mon Jul 14 17:09:06 2025 +0800

    erofs: remove need_kmap in erofs_read_metabuf()
    
    [ Upstream commit 5e744cb61536bb4e37caca9c5e84feef638782be ]
    
     - need_kmap is always true except for a ztailpacking case; thus, just
       open-code that one;
    
     - The upcoming metadata compression will add a new boolean, so simplify
       this first.
    
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Reviewed-by: Chao Yu <chao@kernel.org>
    Link: https://lore.kernel.org/r/20250714090907.4095645-1-hsiangkao@linux.alibaba.com
    Stable-dep-of: 131897c65e2b ("erofs: fix invalid algorithm for encoded extents")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

erofs: unify meta buffers in z_erofs_fill_inode() [+ + +]
Author: Gao Xiang <xiang@kernel.org>
Date:   Wed Jul 16 14:41:52 2025 +0800

    erofs: unify meta buffers in z_erofs_fill_inode()
    
    [ Upstream commit df50848bcd9f17e4e60e6d5823d0e8fe8982bbab ]
    
    There is no need to keep additional local metabufs since we already
    have one in `struct erofs_map_blocks`.
    
    This was actually a leftover when applying meta buffers to zmap
    operations, see commit 09c543798c3c ("erofs: use meta buffers for
    zmap operations").
    
    Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
    Link: https://lore.kernel.org/r/20250716064152.3537457-1-hsiangkao@linux.alibaba.com
    Stable-dep-of: 131897c65e2b ("erofs: fix invalid algorithm for encoded extents")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
fhandle: use more consistent rules for decoding file handle from userns [+ + +]
Author: Amir Goldstein <amir73il@gmail.com>
Date:   Wed Aug 27 21:43:09 2025 +0200

    fhandle: use more consistent rules for decoding file handle from userns
    
    [ Upstream commit bb585591ebf00fb1f6a1fdd1ea96b5848bd9112d ]
    
    Commit 620c266f39493 ("fhandle: relax open_by_handle_at() permission
    checks") relaxed the coditions for decoding a file handle from non init
    userns.
    
    The conditions are that that decoded dentry is accessible from the user
    provided mountfd (or to fs root) and that all the ancestors along the
    path have a valid id mapping in the userns.
    
    These conditions are intentionally more strict than the condition that
    the decoded dentry should be "lookable" by path from the mountfd.
    
    For example, the path /home/amir/dir/subdir is lookable by path from
    unpriv userns of user amir, because /home perms is 755, but the owner of
    /home does not have a valid id mapping in unpriv userns of user amir.
    
    The current code did not check that the decoded dentry itself has a
    valid id mapping in the userns.  There is no security risk in that,
    because that final open still performs the needed permission checks,
    but this is inconsistent with the checks performed on the ancestors,
    so the behavior can be a bit confusing.
    
    Add the check for the decoded dentry itself, so that the entire path,
    including the last component has a valid id mapping in the userns.
    
    Fixes: 620c266f39493 ("fhandle: relax open_by_handle_at() permission checks")
    Signed-off-by: Amir Goldstein <amir73il@gmail.com>
    Link: https://lore.kernel.org/20250827194309.1259650-1-amir73il@gmail.com
    Signed-off-by: Christian Brauner <brauner@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
flexfiles/pNFS: fix NULL checks on result of ff_layout_choose_ds_for_read [+ + +]
Author: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Date:   Thu Aug 28 16:51:00 2025 +0200

    flexfiles/pNFS: fix NULL checks on result of ff_layout_choose_ds_for_read
    
    [ Upstream commit 5a46d2339a5ae268ede53a221f20433d8ea4f2f9 ]
    
    Recent commit f06bedfa62d5 ("pNFS/flexfiles: don't attempt pnfs on fatal DS
    errors") has changed the error return type of ff_layout_choose_ds_for_read() from
    NULL to an error pointer. However, not all code paths have been updated
    to match the change. Thus, some non-NULL checks will accept error pointers
    as a valid return value.
    
    Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
    Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
    Fixes: f06bedfa62d5 ("pNFS/flexfiles: don't attempt pnfs on fatal DS errors")
    Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
fs/resctrl: Eliminate false positive lockdep warning when reading SNC counters [+ + +]
Author: Reinette Chatre <reinette.chatre@intel.com>
Date:   Mon Sep 8 15:15:51 2025 -0700

    fs/resctrl: Eliminate false positive lockdep warning when reading SNC counters
    
    commit d2e1b84c5141ff2ad465279acfc3cf943c960b78 upstream.
    
    Running resctrl_tests on an SNC-2 system with lockdep debugging enabled
    triggers several warnings with following trace:
    
      WARNING: CPU: 0 PID: 1914 at kernel/cpu.c:528 lockdep_assert_cpus_held
      ...
      Call Trace:
      __mon_event_count
      ? __lock_acquire
      ? __pfx___mon_event_count
      mon_event_count
      ? __pfx_smp_mon_event_count
      smp_mon_event_count
      smp_call_on_cpu_callback
    
    get_cpu_cacheinfo_level() called from __mon_event_count() requires CPU hotplug
    lock to be held. The hotplug lock is indeed held during this time, as
    confirmed by the lockdep_assert_cpus_held() within mon_event_read() that calls
    mon_event_count() via IPI, but the lockdep tracking is not able to follow the
    IPI.
    
    Fresh CPU cache information via get_cpu_cacheinfo_level() from
    __mon_event_count() was added to support the fix for the issue where resctrl
    inappropriately maintained links to L3 cache information that will be stale in
    the case when the associated CPU goes offline.
    
    Keep the cacheinfo ID in struct rdt_mon_domain to ensure that resctrl does not
    maintain stale cache information while CPUs can go offline. Return to using
    a pointer to the L3 cache information (struct cacheinfo) in struct rmid_read,
    rmid_read::ci. Initialize rmid_read::ci before the IPI where it is used. CPU
    hotplug lock is held across rmid_read::ci initialization and use to ensure
    that it points to accurate cache information.
    
    Fixes: 594902c986e2 ("x86,fs/resctrl: Remove inappropriate references to cacheinfo in the resctrl subsystem")
    Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
    Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
fs: add a FMODE_ flag to indicate IOCB_HAS_METADATA availability [+ + +]
Author: Christoph Hellwig <hch@lst.de>
Date:   Tue Aug 19 10:25:00 2025 +0200

    fs: add a FMODE_ flag to indicate IOCB_HAS_METADATA availability
    
    [ Upstream commit d072148a8631f102de60ed5a3a827e85d09d24f0 ]
    
    Currently the kernel will happily route io_uring requests with metadata
    to file operations that don't support it.  Add a FMODE_ flag to guard
    that.
    
    Fixes: 4de2ce04c862 ("fs: introduce IOCB_HAS_METADATA for metadata")
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Link: https://lore.kernel.org/20250819082517.2038819-2-hch@lst.de
    Signed-off-by: Christian Brauner <brauner@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
 
ftrace/samples: Fix function size computation [+ + +]
Author: Vladimir Riabchun <ferr.lambarginio@gmail.com>
Date:   Tue Aug 26 18:16:46 2025 +0200

    ftrace/samples: Fix function size computation
    
    [ Upstream commit 80d03a40837a9b26750a25122b906c052cc846c9 ]
    
    In my_tramp1 function .size directive was placed above
    ASM_RET instruction, leading to a wrong function size.
    
    Link: https://lore.kernel.org/aK3d7vxNcO52kEmg@vova-pc
    Fixes: 9d907f1ae80b ("samples/ftrace: Fix asm function ELF annotations")
    Signed-off-by: Vladimir Riabchun <ferr.lambarginio@gmail.com>
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
fuse: Block access to folio overlimit [+ + +]
Author: Edward Adam Davis <eadavis@qq.com>
Date:   Wed Aug 27 09:45:55 2025 +0800

    fuse: Block access to folio overlimit
    
    [ Upstream commit 9d81ba6d49a7457784f0b6a71046818b86ec7e44 ]
    
    syz reported a slab-out-of-bounds Write in fuse_dev_do_write.
    
    When the number of bytes to be retrieved is truncated to the upper limit
    by fc->max_pages and there is an offset, the oob is triggered.
    
    Add a loop termination condition to prevent overruns.
    
    Fixes: 3568a9569326 ("fuse: support large folios for retrieves")
    Reported-by: syzbot+2d215d165f9354b9c4ea@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=2d215d165f9354b9c4ea
    Tested-by: syzbot+2d215d165f9354b9c4ea@syzkaller.appspotmail.com
    Signed-off-by: Edward Adam Davis <eadavis@qq.com>
    Reviewed-by: Joanne Koong <joannelkoong@gmail.com>
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

fuse: check if copy_file_range() returns larger than requested size [+ + +]
Author: Miklos Szeredi <mszeredi@redhat.com>
Date:   Tue Aug 12 14:07:54 2025 +0200

    fuse: check if copy_file_range() returns larger than requested size
    
    commit e5203209b3935041dac541bc5b37efb44220cc0b upstream.
    
    Just like write(), copy_file_range() should check if the return value is
    less or equal to the requested number of bytes.
    
    Reported-by: Chunsheng Luo <luochunsheng@ustc.edu>
    Closes: https://lore.kernel.org/all/20250807062425.694-1-luochunsheng@ustc.edu/
    Fixes: 88bc7d5097a1 ("fuse: add support for copy_file_range()")
    Cc: <stable@vger.kernel.org> # v4.20
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

fuse: do not allow mapping a non-regular backing file [+ + +]
Author: Amir Goldstein <amir73il@gmail.com>
Date:   Thu Jul 10 12:08:30 2025 +0200

    fuse: do not allow mapping a non-regular backing file
    
    commit e9c8da670e749f7dedc53e3af54a87b041918092 upstream.
    
    We do not support passthrough operations other than read/write on
    regular file, so allowing non-regular backing files makes no sense.
    
    Fixes: efad7153bf93 ("fuse: allow O_PATH fd for FUSE_DEV_IOC_BACKING_OPEN")
    Cc: stable@vger.kernel.org
    Signed-off-by: Amir Goldstein <amir73il@gmail.com>
    Reviewed-by: Bernd Schubert <bschubert@ddn.com>
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

fuse: prevent overflow in copy_file_range return value [+ + +]
Author: Miklos Szeredi <mszeredi@redhat.com>
Date:   Tue Aug 12 14:46:34 2025 +0200

    fuse: prevent overflow in copy_file_range return value
    
    commit 1e08938c3694f707bb165535df352ac97a8c75c9 upstream.
    
    The FUSE protocol uses struct fuse_write_out to convey the return value of
    copy_file_range, which is restricted to uint32_t.  But the COPY_FILE_RANGE
    interface supports a 64-bit size copies.
    
    Currently the number of bytes copied is silently truncated to 32-bit, which
    may result in poor performance or even failure to copy in case of
    truncation to zero.
    
    Reported-by: Florian Weimer <fweimer@redhat.com>
    Closes: https://lore.kernel.org/all/lhuh5ynl8z5.fsf@oldenburg.str.redhat.com/
    Fixes: 88bc7d5097a1 ("fuse: add support for copy_file_range()")
    Cc: <stable@vger.kernel.org> # v4.20
    Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
genetlink: fix genl_bind() invoking bind() after -EPERM [+ + +]
Author: Alok Tiwari <alok.a.tiwari@oracle.com>
Date:   Fri Sep 5 06:57:27 2025 -0700

    genetlink: fix genl_bind() invoking bind() after -EPERM
    
    [ Upstream commit 1dbfb0363224f6da56f6655d596dc5097308d6f5 ]
    
    Per family bind/unbind callbacks were introduced to allow families
    to track multicast group consumer presence, e.g. to start or stop
    producing events depending on listeners.
    
    However, in genl_bind() the bind() callback was invoked even if
    capability checks failed and ret was set to -EPERM. This means that
    callbacks could run on behalf of unauthorized callers while the
    syscall still returned failure to user space.
    
    Fix this by only invoking bind() after "if (ret) break;" check
    i.e. after permission checks have succeeded.
    
    Fixes: 3de21a8990d3 ("genetlink: Add per family bind/unbind callbacks")
    Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
    Link: https://patch.msgid.link/20250905135731.3026965-1-alok.a.tiwari@oracle.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
hrtimers: Unconditionally update target CPU base after offline timer migration [+ + +]
Author: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Date:   Tue Aug 5 16:10:25 2025 +0800

    hrtimers: Unconditionally update target CPU base after offline timer migration
    
    commit e895f8e29119c8c966ea794af9e9100b10becb88 upstream.
    
    When testing softirq based hrtimers on an ARM32 board, with high resolution
    mode and NOHZ inactive, softirq based hrtimers fail to expire after being
    moved away from an offline CPU:
    
    CPU0                            CPU1
                                    hrtimer_start(..., HRTIMER_MODE_SOFT);
    cpu_down(CPU1)                  ...
                                    hrtimers_cpu_dying()
                                      // Migrate timers to CPU0
                                      smp_call_function_single(CPU0, returgger_next_event);
      retrigger_next_event()
        if (!highres && !nohz)
            return;
    
    As retrigger_next_event() is a NOOP when both high resolution timers and
    NOHZ are inactive CPU0's hrtimer_cpu_base::softirq_expires_next is not
    updated and the migrated softirq timers never expire unless there is a
    softirq based hrtimer queued on CPU0 later.
    
    Fix this by removing the hrtimer_hres_active() and tick_nohz_active() check
    in retrigger_next_event(), which enforces a full update of the CPU base.
    As this is not a fast path the extra cost does not matter.
    
    [ tglx: Massaged change log ]
    
    Fixes: 5c0930ccaad5 ("hrtimers: Push pending hrtimers away from outgoing CPU earlier")
    Co-developed-by: Frederic Weisbecker <frederic@kernel.org>
    Signed-off-by: Frederic Weisbecker <frederic@kernel.org>
    Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Link: https://lore.kernel.org/all/20250805081025.54235-1-wangxiongfeng2@huawei.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
hsr: hold rcu and dev lock for hsr_get_port_ndev [+ + +]
Author: Hangbin Liu <liuhangbin@gmail.com>
Date:   Fri Sep 5 09:15:33 2025 +0000

    hsr: hold rcu and dev lock for hsr_get_port_ndev
    
    [ Upstream commit 847748fc66d08a89135a74e29362a66ba4e3ab15 ]
    
    hsr_get_port_ndev calls hsr_for_each_port, which need to hold rcu lock.
    On the other hand, before return the port device, we need to hold the
    device reference to avoid UaF in the caller function.
    
    Suggested-by: Paolo Abeni <pabeni@redhat.com>
    Fixes: 9c10dd8eed74 ("net: hsr: Create and export hsr_get_port_ndev()")
    Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20250905091533.377443-4-liuhangbin@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hsr: use hsr_for_each_port_rtnl in hsr_port_get_hsr [+ + +]
Author: Hangbin Liu <liuhangbin@gmail.com>
Date:   Fri Sep 5 09:15:32 2025 +0000

    hsr: use hsr_for_each_port_rtnl in hsr_port_get_hsr
    
    [ Upstream commit 393c841fe4333cdd856d0ca37b066d72746cfaa6 ]
    
    hsr_port_get_hsr() iterates over ports using hsr_for_each_port(),
    but many of its callers do not hold the required RCU lock.
    
    Switch to hsr_for_each_port_rtnl(), since most callers already hold
    the rtnl lock. After review, all callers are covered by either the rtnl
    lock or the RCU lock, except hsr_dev_xmit(). Fix this by adding an
    RCU read lock there.
    
    Fixes: c5a759117210 ("net/hsr: Use list_head (and rcu) instead of array for slave devices.")
    Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20250905091533.377443-3-liuhangbin@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

hsr: use rtnl lock when iterating over ports [+ + +]
Author: Hangbin Liu <liuhangbin@gmail.com>
Date:   Fri Sep 5 09:15:31 2025 +0000

    hsr: use rtnl lock when iterating over ports
    
    [ Upstream commit 8884c693991333ae065830554b9b0c96590b1bb2 ]
    
    hsr_for_each_port is called in many places without holding the RCU read
    lock, this may trigger warnings on debug kernels. Most of the callers
    are actually hold rtnl lock. So add a new helper hsr_for_each_port_rtnl
    to allow callers in suitable contexts to iterate ports safely without
    explicit RCU locking.
    
    This patch only fixed the callers that is hold rtnl lock. Other caller
    issues will be fixed in later patches.
    
    Fixes: c5a759117210 ("net/hsr: Use list_head (and rcu) instead of array for slave devices.")
    Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20250905091533.377443-2-liuhangbin@gmail.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
i2c: i801: Hide Intel Birch Stream SoC TCO WDT [+ + +]
Author: Chiasheng Lee <chiasheng.lee@linux.intel.com>
Date:   Mon Sep 1 20:59:43 2025 +0800

    i2c: i801: Hide Intel Birch Stream SoC TCO WDT
    
    commit 664596bd98bb251dd417dfd3f9b615b661e1e44a upstream.
    
    Hide the Intel Birch Stream SoC TCO WDT feature since it was removed.
    
    On platforms with PCH TCO WDT, this redundant device might be rendering
    errors like this:
    
    [   28.144542] sysfs: cannot create duplicate filename '/bus/platform/devices/iTCO_wdt'
    
    Fixes: 8c56f9ef25a3 ("i2c: i801: Add support for Intel Birch Stream SoC")
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=220320
    Signed-off-by: Chiasheng Lee <chiasheng.lee@linux.intel.com>
    Cc: <stable@vger.kernel.org> # v6.7+
    Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/20250901125943.916522-1-chiasheng.lee@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

i2c: rtl9300: ensure data length is within supported range [+ + +]
Author: Jonas Jelonek <jelonek.jonas@gmail.com>
Date:   Sun Aug 31 10:04:47 2025 +0000

    i2c: rtl9300: ensure data length is within supported range
    
    commit 06418cb5a1a542a003fdb4ad8e76ea542d57cfba upstream.
    
    Add an explicit check for the xfer length to 'rtl9300_i2c_config_xfer'
    to ensure the data length isn't within the supported range. In
    particular a data length of 0 is not supported by the hardware and
    causes unintended or destructive behaviour.
    
    This limitation becomes obvious when looking at the register
    documentation [1]. 4 bits are reserved for DATA_WIDTH and the value
    of these 4 bits is used as N + 1, allowing a data length range of
    1 <= len <= 16.
    
    Affected by this is the SMBus Quick Operation which works with a data
    length of 0. Passing 0 as the length causes an underflow of the value
    due to:
    
    (len - 1) & 0xf
    
    and effectively specifying a transfer length of 16 via the registers.
    This causes a 16-byte write operation instead of a Quick Write. For
    example, on SFP modules without write-protected EEPROM this soft-bricks
    them by overwriting some initial bytes.
    
    For completeness, also add a quirk for the zero length.
    
    [1] https://svanheule.net/realtek/longan/register/i2c_mst1_ctrl2
    
    Fixes: c366be720235 ("i2c: Add driver for the RTL9300 I2C controller")
    Cc: stable@vger.kernel.org # v6.13+
    Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
    Tested-by: Sven Eckelmann <sven@narfation.org>
    Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
    Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # On RTL9302C based board
    Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/20250831100457.3114-3-jelonek.jonas@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

i2c: rtl9300: fix channel number bound check [+ + +]
Author: Jonas Jelonek <jelonek.jonas@gmail.com>
Date:   Sun Aug 31 10:04:46 2025 +0000

    i2c: rtl9300: fix channel number bound check
    
    commit cd6c956fbc13156bcbcca084b46a8380caebc2a8 upstream.
    
    Fix the current check for number of channels (child nodes in the device
    tree). Before, this was:
    
    if (device_get_child_node_count(dev) >= RTL9300_I2C_MUX_NCHAN)
    
    RTL9300_I2C_MUX_NCHAN gives the maximum number of channels so checking
    with '>=' isn't correct because it doesn't allow the last channel
    number. Thus, fix it to:
    
    if (device_get_child_node_count(dev) > RTL9300_I2C_MUX_NCHAN)
    
    Issue occured on a TP-Link TL-ST1008F v2.0 device (8 SFP+ ports) and fix
    is tested there.
    
    Fixes: c366be720235 ("i2c: Add driver for the RTL9300 I2C controller")
    Cc: stable@vger.kernel.org # v6.13+
    Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
    Tested-by: Sven Eckelmann <sven@narfation.org>
    Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
    Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # On RTL9302C based board
    Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/20250831100457.3114-2-jelonek.jonas@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

i2c: rtl9300: remove broken SMBus Quick operation support [+ + +]
Author: Jonas Jelonek <jelonek.jonas@gmail.com>
Date:   Sun Aug 31 10:04:48 2025 +0000

    i2c: rtl9300: remove broken SMBus Quick operation support
    
    commit ede965fd555ac2536cf651893a998dbfd8e57b86 upstream.
    
    Remove the SMBus Quick operation from this driver because it is not
    natively supported by the hardware and is wrongly implemented in the
    driver.
    
    The I2C controllers in Realtek RTL9300 and RTL9310 are SMBus-compliant
    but there doesn't seem to be native support for the SMBus Quick
    operation. It is not explicitly mentioned in the documentation but
    looking at the registers which configure an SMBus transaction, one can
    see that the data length cannot be set to 0. This suggests that the
    hardware doesn't allow any SMBus message without data bytes (except for
    those it does on it's own, see SMBus Block Read).
    
    The current implementation of SMBus Quick operation passes a length of
    0 (which is actually invalid). Before the fix of a bug in a previous
    commit, this led to a read operation of 16 bytes from any register (the
    one of a former transaction or any other value.
    
    This caused issues like soft-bricked SFP modules after a simple probe
    with i2cdetect which uses Quick by default. Running this with SFP
    modules whose EEPROM isn't write-protected, some of the initial bytes
    are overwritten because a 16-byte write operation is executed instead of
    a Quick Write. (This temporarily soft-bricked one of my DAC cables.)
    
    Because SMBus Quick operation is obviously not supported on these
    controllers (because a length of 0 cannot be set, even when no register
    address is set), remove that instead of claiming there is support. There
    also shouldn't be any kind of emulated 'Quick' which just does another
    kind of operation in the background. Otherwise, specific issues occur
    in case of a 'Quick' Write which actually writes unknown data to an
    unknown register.
    
    Fixes: c366be720235 ("i2c: Add driver for the RTL9300 I2C controller")
    Cc: stable@vger.kernel.org # v6.13+
    Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
    Tested-by: Sven Eckelmann <sven@narfation.org>
    Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
    Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # On RTL9302C based board
    Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
    Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
    Link: https://lore.kernel.org/r/20250831100457.3114-4-jelonek.jonas@gmail.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
i40e: fix IRQ freeing in i40e_vsi_request_irq_msix error path [+ + +]
Author: Michal Schmidt <mschmidt@redhat.com>
Date:   Mon Aug 18 17:39:03 2025 +0200

    i40e: fix IRQ freeing in i40e_vsi_request_irq_msix error path
    
    [ Upstream commit 915470e1b44e71d1dd07ee067276f003c3521ee3 ]
    
    If request_irq() in i40e_vsi_request_irq_msix() fails in an iteration
    later than the first, the error path wants to free the IRQs requested
    so far. However, it uses the wrong dev_id argument for free_irq(), so
    it does not free the IRQs correctly and instead triggers the warning:
    
     Trying to free already-free IRQ 173
     WARNING: CPU: 25 PID: 1091 at kernel/irq/manage.c:1829 __free_irq+0x192/0x2c0
     Modules linked in: i40e(+) [...]
     CPU: 25 UID: 0 PID: 1091 Comm: NetworkManager Not tainted 6.17.0-rc1+ #1 PREEMPT(lazy)
     Hardware name: [...]
     RIP: 0010:__free_irq+0x192/0x2c0
     [...]
     Call Trace:
      <TASK>
      free_irq+0x32/0x70
      i40e_vsi_request_irq_msix.cold+0x63/0x8b [i40e]
      i40e_vsi_request_irq+0x79/0x80 [i40e]
      i40e_vsi_open+0x21f/0x2f0 [i40e]
      i40e_open+0x63/0x130 [i40e]
      __dev_open+0xfc/0x210
      __dev_change_flags+0x1fc/0x240
      netif_change_flags+0x27/0x70
      do_setlink.isra.0+0x341/0xc70
      rtnl_newlink+0x468/0x860
      rtnetlink_rcv_msg+0x375/0x450
      netlink_rcv_skb+0x5c/0x110
      netlink_unicast+0x288/0x3c0
      netlink_sendmsg+0x20d/0x430
      ____sys_sendmsg+0x3a2/0x3d0
      ___sys_sendmsg+0x99/0xe0
      __sys_sendmsg+0x8a/0xf0
      do_syscall_64+0x82/0x2c0
      entry_SYSCALL_64_after_hwframe+0x76/0x7e
      [...]
      </TASK>
     ---[ end trace 0000000000000000 ]---
    
    Use the same dev_id for free_irq() as for request_irq().
    
    I tested this with inserting code to fail intentionally.
    
    Fixes: 493fb30011b3 ("i40e: Move q_vectors from pointer to array to array of pointers")
    Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
    Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
    Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
    Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
igb: fix link test skipping when interface is admin down [+ + +]
Author: Kohei Enju <enjuk@amazon.com>
Date:   Fri Aug 15 15:26:31 2025 +0900

    igb: fix link test skipping when interface is admin down
    
    [ Upstream commit d709f178abca22a4d3642513df29afe4323a594b ]
    
    The igb driver incorrectly skips the link test when the network
    interface is admin down (if_running == false), causing the test to
    always report PASS regardless of the actual physical link state.
    
    This behavior is inconsistent with other drivers (e.g. i40e, ice, ixgbe,
    etc.) which correctly test the physical link state regardless of admin
    state.
    Remove the if_running check to ensure link test always reflects the
    physical link state.
    
    Fixes: 8d420a1b3ea6 ("igb: correct link test not being run when link is down")
    Signed-off-by: Kohei Enju <enjuk@amazon.com>
    Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
    Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

igb: Fix NULL pointer dereference in ethtool loopback test [+ + +]
Author: Tianyu Xu <tianyxu@cisco.com>
Date:   Tue Aug 12 21:10:56 2025 +0800

    igb: Fix NULL pointer dereference in ethtool loopback test
    
    [ Upstream commit 75871a525a596ff4d16c4aebc0018f8d0923c9b1 ]
    
    The igb driver currently causes a NULL pointer dereference when executing
    the ethtool loopback test. This occurs because there is no associated
    q_vector for the test ring when it is set up, as interrupts are typically
    not added to the test rings.
    
    Since commit 5ef44b3cb43b removed the napi_id assignment in
    __xdp_rxq_info_reg(), there is no longer a need to pass a napi_id to it.
    Therefore, simply use 0 as the last parameter.
    
    Fixes: 2c6196013f84 ("igb: Add AF_XDP zero-copy Rx support")
    Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
    Reviewed-by: Joe Damato <joe@dama.to>
    Signed-off-by: Tianyu Xu <tianyxu@cisco.com>
    Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
    Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Input: i8042 - add TUXEDO InfinityBook Pro Gen10 AMD to i8042 quirk table [+ + +]
Author: Christoffer Sandberg <cs@tuxedo.de>
Date:   Tue Aug 26 16:26:06 2025 +0200

    Input: i8042 - add TUXEDO InfinityBook Pro Gen10 AMD to i8042 quirk table
    
    commit 1939a9fcb80353dd8b111aa1e79c691afbde08b4 upstream.
    
    Occasionally wakes up from suspend with missing input on the internal
    keyboard. Setting the quirks appears to fix the issue for this device as
    well.
    
    Signed-off-by: Christoffer Sandberg <cs@tuxedo.de>
    Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/20250826142646.13516-1-wse@tuxedocomputers.com
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: iqs7222 - avoid enabling unused interrupts [+ + +]
Author: Jeff LaBundy <jeff@labundy.com>
Date:   Sun Aug 17 19:20:22 2025 -0500

    Input: iqs7222 - avoid enabling unused interrupts
    
    commit c9ddc41cdd522f2db5d492eda3df8994d928be34 upstream.
    
    If a proximity event node is defined so as to specify the wake-up
    properties of the touch surface, the proximity event interrupt is
    enabled unconditionally. This may result in unwanted interrupts.
    
    Solve this problem by enabling the interrupt only if the event is
    mapped to a key or switch code.
    
    Signed-off-by: Jeff LaBundy <jeff@labundy.com>
    Link: https://lore.kernel.org/r/aKJxxgEWpNaNcUaW@nixie71
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Input: xpad - add support for Flydigi Apex 5 [+ + +]
Author: Antheas Kapenekakis <lkml@antheas.dev>
Date:   Wed Sep 3 18:51:14 2025 +0200

    Input: xpad - add support for Flydigi Apex 5
    
    commit 47ddf62b43eced739b56422cd55e86b9b4bb7dac upstream.
    
    Add Flydigi Apex 5 to the list of recognized controllers.
    
    Reported-by: Brandon Lin <brandon@emergence.ltd>
    Reported-by: Sergey Belozyorcev <belozyorcev@ya.ru>
    Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
    Link: https://lore.kernel.org/r/20250903165114.2987905-1-lkml@antheas.dev
    Cc: stable@vger.kernel.org
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
iommu/vt-d: Create unique domain ops for each stage [+ + +]
Author: Jason Gunthorpe <jgg@ziepe.ca>
Date:   Mon Jul 14 12:50:24 2025 +0800

    iommu/vt-d: Create unique domain ops for each stage
    
    [ Upstream commit b33125296b5047115469b8a3b74c0fdbf4976548 ]
    
    Use the domain ops pointer to tell what kind of domain it is instead of
    the internal use_first_level indication. This also protects against
    wrongly using a SVA/nested/IDENTITY/BLOCKED domain type in places they
    should not be.
    
    The only remaining uses of use_first_level outside the paging domain are in
    paging_domain_compatible() and intel_iommu_enforce_cache_coherency().
    
    Thus, remove the useless sets of use_first_level in
    intel_svm_domain_alloc() and intel_iommu_domain_alloc_nested(). None of
    the unique ops for these domain types ever reference it on their call
    chains.
    
    Add a WARN_ON() check in domain_context_mapping_one() as it only works
    with second stage.
    
    This is preparation for iommupt which will have different ops for each of
    the stages.
    
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Link: https://lore.kernel.org/r/5-v3-dbbe6f7e7ae3+124ffe-vtd_prep_jgg@nvidia.com
    Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
    Link: https://lore.kernel.org/r/20250714045028.958850-8-baolu.lu@linux.intel.com
    Signed-off-by: Will Deacon <will@kernel.org>
    Stable-dep-of: cee686775f9c ("iommu/vt-d: Make iotlb_sync_map a static property of dmar_domain")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

iommu/vt-d: Make iotlb_sync_map a static property of dmar_domain [+ + +]
Author: Lu Baolu <baolu.lu@linux.intel.com>
Date:   Mon Jul 21 13:16:57 2025 +0800

    iommu/vt-d: Make iotlb_sync_map a static property of dmar_domain
    
    [ Upstream commit cee686775f9cd4eae31f3c1f7ec24b2048082667 ]
    
    Commit 12724ce3fe1a ("iommu/vt-d: Optimize iotlb_sync_map for
    non-caching/non-RWBF modes") dynamically set iotlb_sync_map. This causes
    synchronization issues due to lack of locking on map and attach paths,
    racing iommufd userspace operations.
    
    Invalidation changes must precede device attachment to ensure all flushes
    complete before hardware walks page tables, preventing coherence issues.
    
    Make domain->iotlb_sync_map static, set once during domain allocation. If
    an IOMMU requires iotlb_sync_map but the domain lacks it, attach is
    rejected. This won't reduce domain sharing: RWBF and shadowing page table
    caching are legacy uses with legacy hardware. Mixed configs (some IOMMUs
    in caching mode, others not) are unlikely in real-world scenarios.
    
    Fixes: 12724ce3fe1a ("iommu/vt-d: Optimize iotlb_sync_map for non-caching/non-RWBF modes")
    Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
    Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
    Link: https://lore.kernel.org/r/20250721051657.1695788-1-baolu.lu@linux.intel.com
    Signed-off-by: Will Deacon <will@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

iommu/vt-d: Split intel_iommu_domain_alloc_paging_flags() [+ + +]
Author: Jason Gunthorpe <jgg@ziepe.ca>
Date:   Mon Jul 14 12:50:23 2025 +0800

    iommu/vt-d: Split intel_iommu_domain_alloc_paging_flags()
    
    [ Upstream commit b9434ba97c44f5744ea537adfd1f9f3fe102681c ]
    
    Create stage specific functions that check the stage specific conditions
    if each stage can be supported.
    
    Have intel_iommu_domain_alloc_paging_flags() call both stages in sequence
    until one does not return EOPNOTSUPP and prefer to use the first stage if
    available and suitable for the requested flags.
    
    Move second stage only operations like nested_parent and dirty_tracking
    into the second stage function for clarity.
    
    Move initialization of the iommu_domain members into paging_domain_alloc().
    
    Drop initialization of domain->owner as the callers all do it.
    
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Link: https://lore.kernel.org/r/4-v3-dbbe6f7e7ae3+124ffe-vtd_prep_jgg@nvidia.com
    Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
    Link: https://lore.kernel.org/r/20250714045028.958850-7-baolu.lu@linux.intel.com
    Signed-off-by: Will Deacon <will@kernel.org>
    Stable-dep-of: cee686775f9c ("iommu/vt-d: Make iotlb_sync_map a static property of dmar_domain")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

iommu/vt-d: Split paging_domain_compatible() [+ + +]
Author: Jason Gunthorpe <jgg@ziepe.ca>
Date:   Mon Jul 14 12:50:26 2025 +0800

    iommu/vt-d: Split paging_domain_compatible()
    
    [ Upstream commit 85cfaacc99377a63e47412eeef66eff77197acea ]
    
    Make First/Second stage specific functions that follow the same pattern in
    intel_iommu_domain_alloc_first/second_stage() for computing
    EOPNOTSUPP. This makes the code easier to understand as if we couldn't
    create a domain with the parameters for this IOMMU instance then we
    certainly are not compatible with it.
    
    Check superpage support directly against the per-stage cap bits and the
    pgsize_bitmap.
    
    Add a note that the force_snooping is read without locking. The locking
    needs to cover the compatible check and the add of the device to the list.
    
    Reviewed-by: Kevin Tian <kevin.tian@intel.com>
    Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
    Link: https://lore.kernel.org/r/7-v3-dbbe6f7e7ae3+124ffe-vtd_prep_jgg@nvidia.com
    Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
    Link: https://lore.kernel.org/r/20250714045028.958850-10-baolu.lu@linux.intel.com
    Signed-off-by: Will Deacon <will@kernel.org>
    Stable-dep-of: cee686775f9c ("iommu/vt-d: Make iotlb_sync_map a static property of dmar_domain")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
irqchip/mvebu-gicp: Fix an IS_ERR() vs NULL check in probe() [+ + +]
Author: Dan Carpenter <dan.carpenter@linaro.org>
Date:   Tue Aug 19 12:40:02 2025 +0300

    irqchip/mvebu-gicp: Fix an IS_ERR() vs NULL check in probe()
    
    [ Upstream commit c8bb0f00a4886b24d933ffaabcdc09bf9a370dca ]
    
    ioremap() never returns error pointers, it returns NULL on error.  Fix the
    check to match.
    
    Fixes: 3c3d7dbab2c7 ("irqchip/mvebu-gicp: Clear pending interrupts on init")
    Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Link: https://lore.kernel.org/all/aKRGcgMeaXm2TMIC@stanley.mountain
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
kernfs: Fix UAF in polling when open file is released [+ + +]
Author: Chen Ridong <chenridong@huawei.com>
Date:   Fri Aug 22 07:07:14 2025 +0000

    kernfs: Fix UAF in polling when open file is released
    
    commit 3c9ba2777d6c86025e1ba4186dc5cd930e40ec5f upstream.
    
    A use-after-free (UAF) vulnerability was identified in the PSI (Pressure
    Stall Information) monitoring mechanism:
    
    BUG: KASAN: slab-use-after-free in psi_trigger_poll+0x3c/0x140
    Read of size 8 at addr ffff3de3d50bd308 by task systemd/1
    
    psi_trigger_poll+0x3c/0x140
    cgroup_pressure_poll+0x70/0xa0
    cgroup_file_poll+0x8c/0x100
    kernfs_fop_poll+0x11c/0x1c0
    ep_item_poll.isra.0+0x188/0x2c0
    
    Allocated by task 1:
    cgroup_file_open+0x88/0x388
    kernfs_fop_open+0x73c/0xaf0
    do_dentry_open+0x5fc/0x1200
    vfs_open+0xa0/0x3f0
    do_open+0x7e8/0xd08
    path_openat+0x2fc/0x6b0
    do_filp_open+0x174/0x368
    
    Freed by task 8462:
    cgroup_file_release+0x130/0x1f8
    kernfs_drain_open_files+0x17c/0x440
    kernfs_drain+0x2dc/0x360
    kernfs_show+0x1b8/0x288
    cgroup_file_show+0x150/0x268
    cgroup_pressure_write+0x1dc/0x340
    cgroup_file_write+0x274/0x548
    
    Reproduction Steps:
    1. Open test/cpu.pressure and establish epoll monitoring
    2. Disable monitoring: echo 0 > test/cgroup.pressure
    3. Re-enable monitoring: echo 1 > test/cgroup.pressure
    
    The race condition occurs because:
    1. When cgroup.pressure is disabled (echo 0 > cgroup.pressure), it:
       - Releases PSI triggers via cgroup_file_release()
       - Frees of->priv through kernfs_drain_open_files()
    2. While epoll still holds reference to the file and continues polling
    3. Re-enabling (echo 1 > cgroup.pressure) accesses freed of->priv
    
    epolling                        disable/enable cgroup.pressure
    fd=open(cpu.pressure)
    while(1)
    ...
    epoll_wait
    kernfs_fop_poll
    kernfs_get_active = true        echo 0 > cgroup.pressure
    ...                             cgroup_file_show
                                    kernfs_show
                                    // inactive kn
                                    kernfs_drain_open_files
                                    cft->release(of);
                                    kfree(ctx);
                                    ...
    kernfs_get_active = false
                                    echo 1 > cgroup.pressure
                                    kernfs_show
                                    kernfs_activate_one(kn);
    kernfs_fop_poll
    kernfs_get_active = true
    cgroup_file_poll
    psi_trigger_poll
    // UAF
    ...
    end: close(fd)
    
    To address this issue, introduce kernfs_get_active_of() for kernfs open
    files to obtain active references. This function will fail if the open file
    has been released. Replace kernfs_get_active() with kernfs_get_active_of()
    to prevent further operations on released file descriptors.
    
    Fixes: 34f26a15611a ("sched/psi: Per-cgroup PSI accounting disable/re-enable interface")
    Cc: stable <stable@kernel.org>
    Reported-by: Zhang Zhaotian <zhangzhaotian@huawei.com>
    Signed-off-by: Chen Ridong <chenridong@huawei.com>
    Acked-by: Tejun Heo <tj@kernel.org>
    Link: https://lore.kernel.org/r/20250822070715.1565236-2-chenridong@huaweicloud.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
libceph: fix invalid accesses to ceph_connection_v1_info [+ + +]
Author: Ilya Dryomov <idryomov@gmail.com>
Date:   Thu Jul 3 12:10:50 2025 +0200

    libceph: fix invalid accesses to ceph_connection_v1_info
    
    commit cdbc9836c7afadad68f374791738f118263c5371 upstream.
    
    There is a place where generic code in messenger.c is reading and
    another place where it is writing to con->v1 union member without
    checking that the union member is active (i.e. msgr1 is in use).
    
    On 64-bit systems, con->v1.auth_retry overlaps with con->v2.out_iter,
    so such a read is almost guaranteed to return a bogus value instead of
    0 when msgr2 is in use.  This ends up being fairly benign because the
    side effect is just the invalidation of the authorizer and successive
    fetching of new tickets.
    
    con->v1.connect_seq overlaps with con->v2.conn_bufs and the fact that
    it's being written to can cause more serious consequences, but luckily
    it's not something that happens often.
    
    Cc: stable@vger.kernel.org
    Fixes: cd1a677cad99 ("libceph, ceph: implement msgr2.1 protocol (crc and secure modes)")
    Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
    Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Linux: Linux 6.16.8 [+ + +]
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date:   Fri Sep 19 16:37:39 2025 +0200

    Linux 6.16.8
    
    Link: https://lore.kernel.org/r/20250917123351.839989757@linuxfoundation.org
    Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
    Tested-by: Hardik Garg <hargar@linux.microsoft.com>
    Tested-By: Achill Gilgenast <achill@achill.org>=
    Tested-by: Jon Hunter <jonathanh@nvidia.com>
    Tested-by: Peter Schneider <pschneider1968@googlemail.com>
    Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com>
    Tested-by: Brett A C Sheffield <bacs@librecast.net>
    Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
    Tested-by: Salvatore Bonaccorso <carnil@debian.org>
    Tested-by: Dileep Malepu <dileep.debian@gmail.com>
    Tested-by: Ron Economos <re@w6rz.net>
    Tested-by: Mark Brown <broonie@kernel.org>
    Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Tested-by: Pavel Machek (CIP) <pavel@denx.de>
    Tested-by: Pascal Ernster <git@hardfalcon.net>
    Tested-by: Christian Heusel <christian@heusel.eu>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
macsec: sync features on RTM_NEWLINK [+ + +]
Author: Stanislav Fomichev <sdf@fomichev.me>
Date:   Mon Sep 8 10:36:14 2025 -0700

    macsec: sync features on RTM_NEWLINK
    
    [ Upstream commit 0f82c3ba66c6b2e3cde0f255156a753b108ee9dc ]
    
    Syzkaller managed to lock the lower device via ETHTOOL_SFEATURES:
    
     netdev_lock include/linux/netdevice.h:2761 [inline]
     netdev_lock_ops include/net/netdev_lock.h:42 [inline]
     netdev_sync_lower_features net/core/dev.c:10649 [inline]
     __netdev_update_features+0xcb1/0x1be0 net/core/dev.c:10819
     netdev_update_features+0x6d/0xe0 net/core/dev.c:10876
     macsec_notify+0x2f5/0x660 drivers/net/macsec.c:4533
     notifier_call_chain+0x1b3/0x3e0 kernel/notifier.c:85
     call_netdevice_notifiers_extack net/core/dev.c:2267 [inline]
     call_netdevice_notifiers net/core/dev.c:2281 [inline]
     netdev_features_change+0x85/0xc0 net/core/dev.c:1570
     __dev_ethtool net/ethtool/ioctl.c:3469 [inline]
     dev_ethtool+0x1536/0x19b0 net/ethtool/ioctl.c:3502
     dev_ioctl+0x392/0x1150 net/core/dev_ioctl.c:759
    
    It happens because lower features are out of sync with the upper:
    
      __dev_ethtool (real_dev)
        netdev_lock_ops(real_dev)
        ETHTOOL_SFEATURES
          __netdev_features_change
            netdev_sync_upper_features
              disable LRO on the lower
        if (old_features != dev->features)
          netdev_features_change
            fires NETDEV_FEAT_CHANGE
            macsec_notify
              NETDEV_FEAT_CHANGE
                netdev_update_features (for each macsec dev)
                  netdev_sync_lower_features
                    if (upper_features != lower_features)
                      netdev_lock_ops(lower) # lower == real_dev
                      stuck
                      ...
    
        netdev_unlock_ops(real_dev)
    
    Per commit af5f54b0ef9e ("net: Lock lower level devices when updating
    features"), we elide the lock/unlock when the upper and lower features
    are synced. Makes sure the lower (real_dev) has proper features after
    the macsec link has been created. This makes sure we never hit the
    situation where we need to sync upper flags to the lower.
    
    Reported-by: syzbot+7e0f89fb6cae5d002de0@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=7e0f89fb6cae5d002de0
    Fixes: 7e4d784f5810 ("net: hold netdev instance lock during rtnetlink operations")
    Signed-off-by: Stanislav Fomichev <sdf@fomichev.me>
    Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
    Link: https://patch.msgid.link/20250908173614.3358264-1-sdf@fomichev.me
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
md: keep recovery_cp in mdp_superblock_s [+ + +]
Author: Xiao Ni <xni@redhat.com>
Date:   Fri Aug 15 12:00:28 2025 +0800

    md: keep recovery_cp in mdp_superblock_s
    
    [ Upstream commit c27973211ffcdf0a092eec265d5993e64b89adaf ]
    
    commit 907a99c314a5 ("md: rename recovery_cp to resync_offset") replaces
    recovery_cp with resync_offset in mdp_superblock_s which is in md_p.h.
    md_p.h is used in userspace too. So mdadm building fails because of this.
    This patch revert this change.
    
    Fixes: 907a99c314a5 ("md: rename recovery_cp to resync_offset")
    Signed-off-by: Xiao Ni <xni@redhat.com>
    Link: https://lore.kernel.org/linux-raid/20250815040028.18085-1-xni@redhat.com
    Signed-off-by: Yu Kuai <yukuai3@huawei.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
mm/damon/core: set quota->charged_from to jiffies at first charge window [+ + +]
Author: Sang-Heon Jeon <ekffu200098@gmail.com>
Date:   Fri Aug 22 11:50:57 2025 +0900

    mm/damon/core: set quota->charged_from to jiffies at first charge window
    
    commit ce652aac9c90a96c6536681d17518efb1f660fb8 upstream.
    
    Kernel initializes the "jiffies" timer as 5 minutes below zero, as shown
    in include/linux/jiffies.h
    
     /*
     * Have the 32 bit jiffies value wrap 5 minutes after boot
     * so jiffies wrap bugs show up earlier.
     */
     #define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ))
    
    And jiffies comparison help functions cast unsigned value to signed to
    cover wraparound
    
     #define time_after_eq(a,b) \
      (typecheck(unsigned long, a) && \
      typecheck(unsigned long, b) && \
      ((long)((a) - (b)) >= 0))
    
    When quota->charged_from is initialized to 0, time_after_eq() can
    incorrectly return FALSE even after reset_interval has elapsed.  This
    occurs when (jiffies - reset_interval) produces a value with MSB=1, which
    is interpreted as negative in signed arithmetic.
    
    This issue primarily affects 32-bit systems because: On 64-bit systems:
    MSB=1 values occur after ~292 million years from boot (assuming HZ=1000),
    almost impossible.
    
    On 32-bit systems: MSB=1 values occur during the first 5 minutes after
    boot, and the second half of every jiffies wraparound cycle, starting from
    day 25 (assuming HZ=1000)
    
    When above unexpected FALSE return from time_after_eq() occurs, the
    charging window will not reset.  The user impact depends on esz value at
    that time.
    
    If esz is 0, scheme ignores configured quotas and runs without any limits.
    
    If esz is not 0, scheme stops working once the quota is exhausted.  It
    remains until the charging window finally resets.
    
    So, change quota->charged_from to jiffies at damos_adjust_quota() when it
    is considered as the first charge window.  By this change, we can avoid
    unexpected FALSE return from time_after_eq()
    
    Link: https://lkml.kernel.org/r/20250822025057.1740854-1-ekffu200098@gmail.com
    Fixes: 2b8a248d5873 ("mm/damon/schemes: implement size quota for schemes application speed control") # 5.16
    Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
    Reviewed-by: SeongJae Park <sj@kernel.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/damon/lru_sort: avoid divide-by-zero in damon_lru_sort_apply_parameters() [+ + +]
Author: Quanmin Yan <yanquanmin1@huawei.com>
Date:   Wed Aug 27 19:58:57 2025 +0800

    mm/damon/lru_sort: avoid divide-by-zero in damon_lru_sort_apply_parameters()
    
    commit 711f19dfd783ffb37ca4324388b9c4cb87e71363 upstream.
    
    Patch series "mm/damon: avoid divide-by-zero in DAMON module's parameters
    application".
    
    DAMON's RECLAIM and LRU_SORT modules perform no validation on
    user-configured parameters during application, which may lead to
    division-by-zero errors.
    
    Avoid the divide-by-zero by adding validation checks when DAMON modules
    attempt to apply the parameters.
    
    
    This patch (of 2):
    
    During the calculation of 'hot_thres' and 'cold_thres', either
    'sample_interval' or 'aggr_interval' is used as the divisor, which may
    lead to division-by-zero errors.  Fix it by directly returning -EINVAL
    when such a case occurs.  Additionally, since 'aggr_interval' is already
    required to be set no smaller than 'sample_interval' in damon_set_attrs(),
    only the case where 'sample_interval' is zero needs to be checked.
    
    Link: https://lkml.kernel.org/r/20250827115858.1186261-2-yanquanmin1@huawei.com
    Fixes: 40e983cca927 ("mm/damon: introduce DAMON-based LRU-lists Sorting")
    Signed-off-by: Quanmin Yan <yanquanmin1@huawei.com>
    Reviewed-by: SeongJae Park <sj@kernel.org>
    Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
    Cc: ze zuo <zuoze1@huawei.com>
    Cc: <stable@vger.kernel.org>    [6.0+]
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/damon/reclaim: avoid divide-by-zero in damon_reclaim_apply_parameters() [+ + +]
Author: Quanmin Yan <yanquanmin1@huawei.com>
Date:   Wed Aug 27 19:58:58 2025 +0800

    mm/damon/reclaim: avoid divide-by-zero in damon_reclaim_apply_parameters()
    
    commit e6b543ca9806d7bced863f43020e016ee996c057 upstream.
    
    When creating a new scheme of DAMON_RECLAIM, the calculation of
    'min_age_region' uses 'aggr_interval' as the divisor, which may lead to
    division-by-zero errors.  Fix it by directly returning -EINVAL when such a
    case occurs.
    
    Link: https://lkml.kernel.org/r/20250827115858.1186261-3-yanquanmin1@huawei.com
    Fixes: f5a79d7c0c87 ("mm/damon: introduce struct damos_access_pattern")
    Signed-off-by: Quanmin Yan <yanquanmin1@huawei.com>
    Reviewed-by: SeongJae Park <sj@kernel.org>
    Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
    Cc: ze zuo <zuoze1@huawei.com>
    Cc: <stable@vger.kernel.org>    [6.1+]
    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/sysfs: fix use-after-free in state_show() [+ + +]
Author: Stanislav Fort <stanislav.fort@aisle.com>
Date:   Fri Sep 5 13:10:46 2025 +0300

    mm/damon/sysfs: fix use-after-free in state_show()
    
    commit 3260a3f0828e06f5f13fac69fb1999a6d60d9cff upstream.
    
    state_show() reads kdamond->damon_ctx without holding damon_sysfs_lock.
    This allows a use-after-free race:
    
    CPU 0                         CPU 1
    -----                         -----
    state_show()                  damon_sysfs_turn_damon_on()
    ctx = kdamond->damon_ctx;     mutex_lock(&damon_sysfs_lock);
                                  damon_destroy_ctx(kdamond->damon_ctx);
                                  kdamond->damon_ctx = NULL;
                                  mutex_unlock(&damon_sysfs_lock);
    damon_is_running(ctx);        /* ctx is freed */
    mutex_lock(&ctx->kdamond_lock); /* UAF */
    
    (The race can also occur with damon_sysfs_kdamonds_rm_dirs() and
    damon_sysfs_kdamond_release(), which free or replace the context under
    damon_sysfs_lock.)
    
    Fix by taking damon_sysfs_lock before dereferencing the context, mirroring
    the locking used in pid_show().
    
    The bug has existed since state_show() first accessed kdamond->damon_ctx.
    
    Link: https://lkml.kernel.org/r/20250905101046.2288-1-disclosure@aisle.com
    Fixes: a61ea561c871 ("mm/damon/sysfs: link DAMON for virtual address spaces monitoring")
    Signed-off-by: Stanislav Fort <disclosure@aisle.com>
    Reported-by: Stanislav Fort <disclosure@aisle.com>
    Reviewed-by: SeongJae Park <sj@kernel.org>
    Cc: <stable@vger.kernel.org>
    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/hugetlb: add missing hugetlb_lock in __unmap_hugepage_range() [+ + +]
Author: Jeongjun Park <aha310510@gmail.com>
Date:   Sun Aug 24 03:21:15 2025 +0900

    mm/hugetlb: add missing hugetlb_lock in __unmap_hugepage_range()
    
    commit 21cc2b5c5062a256ae9064442d37ebbc23f5aef7 upstream.
    
    When restoring a reservation for an anonymous page, we need to check to
    freeing a surplus.  However, __unmap_hugepage_range() causes data race
    because it reads h->surplus_huge_pages without the protection of
    hugetlb_lock.
    
    And adjust_reservation is a boolean variable that indicates whether
    reservations for anonymous pages in each folio should be restored.
    Therefore, it should be initialized to false for each round of the loop.
    However, this variable is not initialized to false except when defining
    the current adjust_reservation variable.
    
    This means that once adjust_reservation is set to true even once within
    the loop, reservations for anonymous pages will be restored
    unconditionally in all subsequent rounds, regardless of the folio's state.
    
    To fix this, we need to add the missing hugetlb_lock, unlock the
    page_table_lock earlier so that we don't lock the hugetlb_lock inside the
    page_table_lock lock, and initialize adjust_reservation to false on each
    round within the loop.
    
    Link: https://lkml.kernel.org/r/20250823182115.1193563-1-aha310510@gmail.com
    Fixes: df7a6d1f6405 ("mm/hugetlb: restore the reservation if needed")
    Signed-off-by: Jeongjun Park <aha310510@gmail.com>
    Reported-by: syzbot+417aeb05fd190f3a6da9@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=417aeb05fd190f3a6da9
    Reviewed-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
    Cc: Breno Leitao <leitao@debian.org>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Muchun Song <muchun.song@linux.dev>
    Cc: Oscar Salvador <osalvador@suse.de>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/khugepaged: fix the address passed to notifier on testing young [+ + +]
Author: Wei Yang <richard.weiyang@gmail.com>
Date:   Fri Aug 22 06:33:18 2025 +0000

    mm/khugepaged: fix the address passed to notifier on testing young
    
    commit 394bfac1c7f7b701c2c93834c5761b9c9ceeebcf upstream.
    
    Commit 8ee53820edfd ("thp: mmu_notifier_test_young") introduced
    mmu_notifier_test_young(), but we are passing the wrong address.
    In xxx_scan_pmd(), the actual iteration address is "_address" not
    "address".  We seem to misuse the variable on the very beginning.
    
    Change it to the right one.
    
    [akpm@linux-foundation.org fix whitespace, per everyone]
    Link: https://lkml.kernel.org/r/20250822063318.11644-1-richard.weiyang@gmail.com
    Fixes: 8ee53820edfd ("thp: mmu_notifier_test_young")
    Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
    Reviewed-by: Dev Jain <dev.jain@arm.com>
    Reviewed-by: Zi Yan <ziy@nvidia.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
    Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
    Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
    Cc: Nico Pache <npache@redhat.com>
    Cc: Ryan Roberts <ryan.roberts@arm.com>
    Cc: Barry Song <baohua@kernel.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/memory-failure: fix redundant updates for already poisoned pages [+ + +]
Author: Kyle Meyer <kyle.meyer@hpe.com>
Date:   Thu Aug 28 13:38:20 2025 -0500

    mm/memory-failure: fix redundant updates for already poisoned pages
    
    commit 3be306cccdccede13e3cefd0c14e430cc2b7c9c7 upstream.
    
    Duplicate memory errors can be reported by multiple sources.
    
    Passing an already poisoned page to action_result() causes issues:
    
    * The amount of hardware corrupted memory is incorrectly updated.
    * Per NUMA node MF stats are incorrectly updated.
    * Redundant "already poisoned" messages are printed.
    
    Avoid those issues by:
    
    * Skipping hardware corrupted memory updates for already poisoned pages.
    * Skipping per NUMA node MF stats updates for already poisoned pages.
    * Dropping redundant "already poisoned" messages.
    
    Make MF_MSG_ALREADY_POISONED consistent with other action_page_types and
    make calls to action_result() consistent for already poisoned normal pages
    and huge pages.
    
    Link: https://lkml.kernel.org/r/aLCiHMy12Ck3ouwC@hpe.com
    Fixes: b8b9488d50b7 ("mm/memory-failure: improve memory failure action_result messages")
    Signed-off-by: Kyle Meyer <kyle.meyer@hpe.com>
    Reviewed-by: Jiaqi Yan <jiaqiyan@google.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Reviewed-by: Jane Chu <jane.chu@oracle.com>
    Acked-by: Miaohe Lin <linmiaohe@huawei.com>
    Cc: Borislav Betkov <bp@alien8.de>
    Cc: Kyle Meyer <kyle.meyer@hpe.com>
    Cc: Liam Howlett <liam.howlett@oracle.com>
    Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
    Cc: "Luck, Tony" <tony.luck@intel.com>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Mike Rapoport <rppt@kernel.org>
    Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
    Cc: Oscar Salvador <osalvador@suse.de>
    Cc: Russ Anderson <russ.anderson@hpe.com>
    Cc: Suren Baghdasaryan <surenb@google.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mm/memory-failure: fix VM_BUG_ON_PAGE(PagePoisoned(page)) when unpoison memory [+ + +]
Author: Miaohe Lin <linmiaohe@huawei.com>
Date:   Thu Aug 28 10:46:18 2025 +0800

    mm/memory-failure: fix VM_BUG_ON_PAGE(PagePoisoned(page)) when unpoison memory
    
    commit d613f53c83ec47089c4e25859d5e8e0359f6f8da upstream.
    
    When I did memory failure tests, below panic occurs:
    
    page dumped because: VM_BUG_ON_PAGE(PagePoisoned(page))
    kernel BUG at include/linux/page-flags.h:616!
    Oops: invalid opcode: 0000 [#1] PREEMPT SMP NOPTI
    CPU: 3 PID: 720 Comm: bash Not tainted 6.10.0-rc1-00195-g148743902568 #40
    RIP: 0010:unpoison_memory+0x2f3/0x590
    RSP: 0018:ffffa57fc8787d60 EFLAGS: 00000246
    RAX: 0000000000000037 RBX: 0000000000000009 RCX: ffff9be25fcdc9c8
    RDX: 0000000000000000 RSI: 0000000000000027 RDI: ffff9be25fcdc9c0
    RBP: 0000000000300000 R08: ffffffffb4956f88 R09: 0000000000009ffb
    R10: 0000000000000284 R11: ffffffffb4926fa0 R12: ffffe6b00c000000
    R13: ffff9bdb453dfd00 R14: 0000000000000000 R15: fffffffffffffffe
    FS:  00007f08f04e4740(0000) GS:ffff9be25fcc0000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000564787a30410 CR3: 000000010d4e2000 CR4: 00000000000006f0
    Call Trace:
     <TASK>
     unpoison_memory+0x2f3/0x590
     simple_attr_write_xsigned.constprop.0.isra.0+0xb3/0x110
     debugfs_attr_write+0x42/0x60
     full_proxy_write+0x5b/0x80
     vfs_write+0xd5/0x540
     ksys_write+0x64/0xe0
     do_syscall_64+0xb9/0x1d0
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    RIP: 0033:0x7f08f0314887
    RSP: 002b:00007ffece710078 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
    RAX: ffffffffffffffda RBX: 0000000000000009 RCX: 00007f08f0314887
    RDX: 0000000000000009 RSI: 0000564787a30410 RDI: 0000000000000001
    RBP: 0000564787a30410 R08: 000000000000fefe R09: 000000007fffffff
    R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000009
    R13: 00007f08f041b780 R14: 00007f08f0417600 R15: 00007f08f0416a00
     </TASK>
    Modules linked in: hwpoison_inject
    ---[ end trace 0000000000000000 ]---
    RIP: 0010:unpoison_memory+0x2f3/0x590
    RSP: 0018:ffffa57fc8787d60 EFLAGS: 00000246
    RAX: 0000000000000037 RBX: 0000000000000009 RCX: ffff9be25fcdc9c8
    RDX: 0000000000000000 RSI: 0000000000000027 RDI: ffff9be25fcdc9c0
    RBP: 0000000000300000 R08: ffffffffb4956f88 R09: 0000000000009ffb
    R10: 0000000000000284 R11: ffffffffb4926fa0 R12: ffffe6b00c000000
    R13: ffff9bdb453dfd00 R14: 0000000000000000 R15: fffffffffffffffe
    FS:  00007f08f04e4740(0000) GS:ffff9be25fcc0000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000564787a30410 CR3: 000000010d4e2000 CR4: 00000000000006f0
    Kernel panic - not syncing: Fatal exception
    Kernel Offset: 0x31c00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
    ---[ end Kernel panic - not syncing: Fatal exception ]---
    
    The root cause is that unpoison_memory() tries to check the PG_HWPoison
    flags of an uninitialized page.  So VM_BUG_ON_PAGE(PagePoisoned(page)) is
    triggered.  This can be reproduced by below steps:
    
    1.Offline memory block:
    
     echo offline > /sys/devices/system/memory/memory12/state
    
    2.Get offlined memory pfn:
    
     page-types -b n -rlN
    
    3.Write pfn to unpoison-pfn
    
     echo <pfn> > /sys/kernel/debug/hwpoison/unpoison-pfn
    
    This scenario can be identified by pfn_to_online_page() returning NULL.
    And ZONE_DEVICE pages are never expected, so we can simply fail if
    pfn_to_online_page() == NULL to fix the bug.
    
    Link: https://lkml.kernel.org/r/20250828024618.1744895-1-linmiaohe@huawei.com
    Fixes: f1dd2cd13c4b ("mm, memory_hotplug: do not associate hotadded memory to zones until online")
    Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
    Suggested-by: David Hildenbrand <david@redhat.com>
    Acked-by: David Hildenbrand <david@redhat.com>
    Cc: Naoya Horiguchi <nao.horiguchi@gmail.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mm/vmalloc, mm/kasan: respect gfp mask in kasan_populate_vmalloc() [+ + +]
Author: Uladzislau Rezki (Sony) <urezki@gmail.com>
Date:   Sun Aug 31 14:10:58 2025 +0200

    mm/vmalloc, mm/kasan: respect gfp mask in kasan_populate_vmalloc()
    
    commit 79357cd06d41d0f5a11b17d7c86176e395d10ef2 upstream.
    
    kasan_populate_vmalloc() and its helpers ignore the caller's gfp_mask and
    always allocate memory using the hardcoded GFP_KERNEL flag.  This makes
    them inconsistent with vmalloc(), which was recently extended to support
    GFP_NOFS and GFP_NOIO allocations.
    
    Page table allocations performed during shadow population also ignore the
    external gfp_mask.  To preserve the intended semantics of GFP_NOFS and
    GFP_NOIO, wrap the apply_to_page_range() calls into the appropriate
    memalloc scope.
    
    xfs calls vmalloc with GFP_NOFS, so this bug could lead to deadlock.
    
    There was a report here
    https://lkml.kernel.org/r/686ea951.050a0220.385921.0016.GAE@google.com
    
    This patch:
     - Extends kasan_populate_vmalloc() and helpers to take gfp_mask;
     - Passes gfp_mask down to alloc_pages_bulk() and __get_free_page();
     - Enforces GFP_NOFS/NOIO semantics with memalloc_*_save()/restore()
       around apply_to_page_range();
     - Updates vmalloc.c and percpu allocator call sites accordingly.
    
    Link: https://lkml.kernel.org/r/20250831121058.92971-1-urezki@gmail.com
    Fixes: 451769ebb7e7 ("mm/vmalloc: alloc GFP_NO{FS,IO} for vmalloc")
    Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
    Reported-by: syzbot+3470c9ffee63e4abafeb@syzkaller.appspotmail.com
    Reviewed-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
    Cc: Baoquan He <bhe@redhat.com>
    Cc: Michal Hocko <mhocko@kernel.org>
    Cc: Alexander Potapenko <glider@google.com>
    Cc: Andrey Konovalov <andreyknvl@gmail.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: Vincenzo Frascino <vincenzo.frascino@arm.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mptcp: sockopt: make sync_socket_options propagate SOCK_KEEPOPEN [+ + +]
Author: Krister Johansen <kjlx@templeofstupid.com>
Date:   Mon Sep 8 11:16:01 2025 -0700

    mptcp: sockopt: make sync_socket_options propagate SOCK_KEEPOPEN
    
    commit 648de37416b301f046f62f1b65715c7fa8ebaa67 upstream.
    
    Users reported a scenario where MPTCP connections that were configured
    with SO_KEEPALIVE prior to connect would fail to enable their keepalives
    if MTPCP fell back to TCP mode.
    
    After investigating, this affects keepalives for any connection where
    sync_socket_options is called on a socket that is in the closed or
    listening state.  Joins are handled properly. For connects,
    sync_socket_options is called when the socket is still in the closed
    state.  The tcp_set_keepalive() function does not act on sockets that
    are closed or listening, hence keepalive is not immediately enabled.
    Since the SO_KEEPOPEN flag is absent, it is not enabled later in the
    connect sequence via tcp_finish_connect.  Setting the keepalive via
    sockopt after connect does work, but would not address any subsequently
    created flows.
    
    Fortunately, the fix here is straight-forward: set SOCK_KEEPOPEN on the
    subflow when calling sync_socket_options.
    
    The fix was valdidated both by using tcpdump to observe keepalive
    packets not being sent before the fix, and being sent after the fix.  It
    was also possible to observe via ss that the keepalive timer was not
    enabled on these sockets before the fix, but was enabled afterwards.
    
    Fixes: 1b3e7ede1365 ("mptcp: setsockopt: handle SO_KEEPALIVE and SO_PRIORITY")
    Cc: stable@vger.kernel.org
    Signed-off-by: Krister Johansen <kjlx@templeofstupid.com>
    Reviewed-by: Geliang Tang <geliang@kernel.org>
    Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/aL8dYfPZrwedCIh9@templeofstupid.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
mtd: nand: raw: atmel: Respect tAR, tCLR in read setup timing [+ + +]
Author: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Date:   Thu Aug 21 14:00:57 2025 +0200

    mtd: nand: raw: atmel: Respect tAR, tCLR in read setup timing
    
    commit fd779eac2d659668be4d3dbdac0710afd5d6db12 upstream.
    
    Having setup time 0 violates tAR, tCLR of some chips, for instance
    TOSHIBA TC58NVG2S3ETAI0 cannot be detected successfully (first ID byte
    being read duplicated, i.e. 98 98 dc 90 15 76 14 03 instead of
    98 dc 90 15 76 ...).
    
    Atmel Application Notes postulated 1 cycle NRD_SETUP without explanation
    [1], but it looks more appropriate to just calculate setup time properly.
    
    [1] Link: https://ww1.microchip.com/downloads/aemDocuments/documents/MPU32/ApplicationNotes/ApplicationNotes/doc6255.pdf
    
    Cc: stable@vger.kernel.org
    Fixes: f9ce2eddf176 ("mtd: nand: atmel: Add ->setup_data_interface() hooks")
    Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
    Tested-by: Alexander Dahl <ada@thorsis.com>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mtd: rawnand: nuvoton: Fix an error handling path in ma35_nand_chips_init() [+ + +]
Author: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Date:   Wed Jul 30 21:47:46 2025 +0200

    mtd: rawnand: nuvoton: Fix an error handling path in ma35_nand_chips_init()
    
    [ Upstream commit 1eae113dd5ff5192cfd3e11b6ab7b96193b42c01 ]
    
    If a ma35_nand_chip_init() call fails, then a reference to 'nand_np' still
    needs to be released.
    
    Use for_each_child_of_node_scoped() to fix the issue.
    
    Fixes: 5abb5d414d55 ("mtd: rawnand: nuvoton: add new driver for the Nuvoton MA35 SoC")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

mtd: rawnand: stm32_fmc2: avoid overlapping mappings on ECC buffer [+ + +]
Author: Christophe Kerello <christophe.kerello@foss.st.com>
Date:   Tue Aug 12 09:26:58 2025 +0200

    mtd: rawnand: stm32_fmc2: avoid overlapping mappings on ECC buffer
    
    commit 513c40e59d5a414ab763a9c84797534b5e8c208d upstream.
    
    Avoid below overlapping mappings by using a contiguous
    non-cacheable buffer.
    
    [    4.077708] DMA-API: stm32_fmc2_nfc 48810000.nand-controller: cacheline tracking EEXIST,
    overlapping mappings aren't supported
    [    4.089103] WARNING: CPU: 1 PID: 44 at kernel/dma/debug.c:568 add_dma_entry+0x23c/0x300
    [    4.097071] Modules linked in:
    [    4.100101] CPU: 1 PID: 44 Comm: kworker/u4:2 Not tainted 6.1.82 #1
    [    4.106346] Hardware name: STMicroelectronics STM32MP257F VALID1 SNOR / MB1704 (LPDDR4 Power discrete) + MB1703 + MB1708 (SNOR MB1730) (DT)
    [    4.118824] Workqueue: events_unbound deferred_probe_work_func
    [    4.124674] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [    4.131624] pc : add_dma_entry+0x23c/0x300
    [    4.135658] lr : add_dma_entry+0x23c/0x300
    [    4.139792] sp : ffff800009dbb490
    [    4.143016] x29: ffff800009dbb4a0 x28: 0000000004008022 x27: ffff8000098a6000
    [    4.150174] x26: 0000000000000000 x25: ffff8000099e7000 x24: ffff8000099e7de8
    [    4.157231] x23: 00000000ffffffff x22: 0000000000000000 x21: ffff8000098a6a20
    [    4.164388] x20: ffff000080964180 x19: ffff800009819ba0 x18: 0000000000000006
    [    4.171545] x17: 6361727420656e69 x16: 6c6568636163203a x15: 72656c6c6f72746e
    [    4.178602] x14: 6f632d646e616e2e x13: ffff800009832f58 x12: 00000000000004ec
    [    4.185759] x11: 00000000000001a4 x10: ffff80000988af58 x9 : ffff800009832f58
    [    4.192916] x8 : 00000000ffffefff x7 : ffff80000988af58 x6 : 80000000fffff000
    [    4.199972] x5 : 000000000000bff4 x4 : 0000000000000000 x3 : 0000000000000000
    [    4.207128] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff0000812d2c40
    [    4.214185] Call trace:
    [    4.216605]  add_dma_entry+0x23c/0x300
    [    4.220338]  debug_dma_map_sg+0x198/0x350
    [    4.224373]  __dma_map_sg_attrs+0xa0/0x110
    [    4.228411]  dma_map_sg_attrs+0x10/0x2c
    [    4.232247]  stm32_fmc2_nfc_xfer.isra.0+0x1c8/0x3fc
    [    4.237088]  stm32_fmc2_nfc_seq_read_page+0xc8/0x174
    [    4.242127]  nand_read_oob+0x1d4/0x8e0
    [    4.245861]  mtd_read_oob_std+0x58/0x84
    [    4.249596]  mtd_read_oob+0x90/0x150
    [    4.253231]  mtd_read+0x68/0xac
    
    Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
    Cc: stable@vger.kernel.org
    Fixes: 2cd457f328c1 ("mtd: rawnand: stm32_fmc2: add STM32 FMC2 NAND flash controller driver")
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mtd: rawnand: stm32_fmc2: fix ECC overwrite [+ + +]
Author: Christophe Kerello <christophe.kerello@foss.st.com>
Date:   Tue Aug 12 09:30:08 2025 +0200

    mtd: rawnand: stm32_fmc2: fix ECC overwrite
    
    commit 811c0da4542df3c065f6cb843ced68780e27bb44 upstream.
    
    In case OOB write is requested during a data write, ECC is currently
    lost. Avoid this issue by only writing in the free spare area.
    This issue has been seen with a YAFFS2 file system.
    
    Signed-off-by: Christophe Kerello <christophe.kerello@foss.st.com>
    Cc: stable@vger.kernel.org
    Fixes: 2cd457f328c1 ("mtd: rawnand: stm32_fmc2: add STM32 FMC2 NAND flash controller driver")
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mtd: spinand: Add a ->configure_chip() hook [+ + +]
Author: Miquel Raynal <miquel.raynal@bootlin.com>
Date:   Sat Sep 13 11:30:47 2025 -0400

    mtd: spinand: Add a ->configure_chip() hook
    
    [ Upstream commit da55809ebb45d1d80b7a388ffef841ed683e1a6f ]
    
    There is already a manufacturer hook, which is manufacturer specific but
    not chip specific. We no longer have access to the actual NAND identity
    at this stage so let's add a per-chip configuration hook to align the
    chip configuration (if any) with the core's setting.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Stable-dep-of: 4550d33e1811 ("mtd: spinand: winbond: Fix oob_layout for W25N01JW")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mtd: spinand: winbond: Enable high-speed modes on w25n0xjw [+ + +]
Author: Miquel Raynal <miquel.raynal@bootlin.com>
Date:   Sat Sep 13 11:30:48 2025 -0400

    mtd: spinand: winbond: Enable high-speed modes on w25n0xjw
    
    [ Upstream commit f1a91175faaab02a45d1ceb313a315a5bfeb5416 ]
    
    w25n0xjw chips have a high-speed capability hidden in a configuration
    register. Once enabled, dual/quad SDR reads may be performed at a much
    higher frequency.
    
    Implement the new ->configure_chip() hook for this purpose and configure
    the SR4 register accordingly.
    
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Stable-dep-of: 4550d33e1811 ("mtd: spinand: winbond: Fix oob_layout for W25N01JW")
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

mtd: spinand: winbond: Fix oob_layout for W25N01JW [+ + +]
Author: Santhosh Kumar K <s-k6@ti.com>
Date:   Sat Sep 13 11:30:49 2025 -0400

    mtd: spinand: winbond: Fix oob_layout for W25N01JW
    
    [ Upstream commit 4550d33e18112a11a740424c4eec063cd58e918c ]
    
    Fix the W25N01JW's oob_layout according to the datasheet [1]
    
    [1] https://www.winbond.com/hq/product/code-storage-flash-memory/qspinand-flash/?__locale=en&partNo=W25N01JW
    
    Fixes: 6a804fb72de5 ("mtd: spinand: winbond: add support for serial NAND flash")
    Cc: Sridharan S N <quic_sridsn@quicinc.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
    Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
net: bridge: Bounce invalid boolopts [+ + +]
Author: Petr Machata <petrm@nvidia.com>
Date:   Fri Sep 5 13:12:33 2025 +0200

    net: bridge: Bounce invalid boolopts
    
    [ Upstream commit 8625f5748fea960d2af4f3c3e9891ee8f6f80906 ]
    
    The bridge driver currently tolerates options that it does not recognize.
    Instead, it should bounce them.
    
    Fixes: a428afe82f98 ("net: bridge: add support for user-controlled bool options")
    Signed-off-by: Petr Machata <petrm@nvidia.com>
    Reviewed-by: Ido Schimmel <idosch@nvidia.com>
    Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
    Link: https://patch.msgid.link/e6fdca3b5a8d54183fbda075daffef38bdd7ddce.1757070067.git.petrm@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: dev_ioctl: take ops lock in hwtstamp lower paths [+ + +]
Author: Carolina Jubran <cjubran@nvidia.com>
Date:   Sun Sep 7 11:08:21 2025 +0300

    net: dev_ioctl: take ops lock in hwtstamp lower paths
    
    [ Upstream commit 686cab5a18e443e1d5f2abb17bed45837836425f ]
    
    ndo hwtstamp callbacks are expected to run under the per-device ops
    lock. Make the lower get/set paths consistent with the rest of ndo
    invocations.
    
    Kernel log:
    WARNING: CPU: 13 PID: 51364 at ./include/net/netdev_lock.h:70 __netdev_update_features+0x4bd/0xe60
    ...
    RIP: 0010:__netdev_update_features+0x4bd/0xe60
    ...
    Call Trace:
    <TASK>
    netdev_update_features+0x1f/0x60
    mlx5_hwtstamp_set+0x181/0x290 [mlx5_core]
    mlx5e_hwtstamp_set+0x19/0x30 [mlx5_core]
    dev_set_hwtstamp_phylib+0x9f/0x220
    dev_set_hwtstamp_phylib+0x9f/0x220
    dev_set_hwtstamp+0x13d/0x240
    dev_ioctl+0x12f/0x4b0
    sock_ioctl+0x171/0x370
    __x64_sys_ioctl+0x3f7/0x900
    ? __sys_setsockopt+0x69/0xb0
    do_syscall_64+0x6f/0x2e0
    entry_SYSCALL_64_after_hwframe+0x4b/0x53
    ...
    </TASK>
    ....
    ---[ end trace 0000000000000000 ]---
    
    Note that the mlx5_hwtstamp_set and mlx5e_hwtstamp_set functions shown
    in the trace come from an in progress patch converting the legacy ioctl
    to ndo_hwtstamp_get/set and are not present in mainline.
    
    Fixes: ffb7ed19ac0a ("net: hold netdev instance lock during ioctl operations")
    Signed-off-by: Carolina Jubran <cjubran@nvidia.com>
    Reviewed-by: Cosmin Ratiu <cratiu@nvidia.com>
    Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com>
    Link: https://patch.msgid.link/20250907080821.2353388-1-cjubran@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: dsa: b53: fix ageing time for BCM53101 [+ + +]
Author: Jonas Gorski <jonas.gorski@gmail.com>
Date:   Fri Sep 5 14:45:07 2025 +0200

    net: dsa: b53: fix ageing time for BCM53101
    
    [ Upstream commit 674b34c4c770551e916ae707829c7faea4782d3a ]
    
    For some reason Broadcom decided that BCM53101 uses 0.5s increments for
    the ageing time register, but kept the field width the same [1]. Due to
    this, the actual ageing time was always half of what was configured.
    
    Fix this by adapting the limits and value calculation for BCM53101.
    
    So far it looks like this is the only chip with the increased tick
    speed:
    
    $ grep -l -r "Specifies the aging time in 0.5 seconds" cdk/PKG/chip | sort
    cdk/PKG/chip/bcm53101/bcm53101_a0_defs.h
    
    $ grep -l -r "Specifies the aging time in seconds" cdk/PKG/chip | sort
    cdk/PKG/chip/bcm53010/bcm53010_a0_defs.h
    cdk/PKG/chip/bcm53020/bcm53020_a0_defs.h
    cdk/PKG/chip/bcm53084/bcm53084_a0_defs.h
    cdk/PKG/chip/bcm53115/bcm53115_a0_defs.h
    cdk/PKG/chip/bcm53118/bcm53118_a0_defs.h
    cdk/PKG/chip/bcm53125/bcm53125_a0_defs.h
    cdk/PKG/chip/bcm53128/bcm53128_a0_defs.h
    cdk/PKG/chip/bcm53134/bcm53134_a0_defs.h
    cdk/PKG/chip/bcm53242/bcm53242_a0_defs.h
    cdk/PKG/chip/bcm53262/bcm53262_a0_defs.h
    cdk/PKG/chip/bcm53280/bcm53280_a0_defs.h
    cdk/PKG/chip/bcm53280/bcm53280_b0_defs.h
    cdk/PKG/chip/bcm53600/bcm53600_a0_defs.h
    cdk/PKG/chip/bcm89500/bcm89500_a0_defs.h
    
    [1] https://github.com/Broadcom/OpenMDK/blob/a5d3fc9b12af3eeb68f2ca0ce7ec4056cd14d6c2/cdk/PKG/chip/bcm53101/bcm53101_a0_defs.h#L28966
    
    Fixes: e39d14a760c0 ("net: dsa: b53: implement setting ageing time")
    Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
    Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
    Link: https://patch.msgid.link/20250905124507.59186-1-jonas.gorski@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: fec: Fix possible NPD in fec_enet_phy_reset_after_clk_enable() [+ + +]
Author: Stefan Wahren <wahrenst@gmx.net>
Date:   Thu Sep 4 11:13:34 2025 +0200

    net: fec: Fix possible NPD in fec_enet_phy_reset_after_clk_enable()
    
    [ Upstream commit 03e79de4608bdd48ad6eec272e196124cefaf798 ]
    
    The function of_phy_find_device may return NULL, so we need to take
    care before dereferencing phy_dev.
    
    Fixes: 64a632da538a ("net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()")
    Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
    Cc: Christoph Niedermaier <cniedermaier@dh-electronics.com>
    Cc: Richard Leitner <richard.leitner@skidata.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Reviewed-by: Wei Fang <wei.fang@nxp.com>
    Link: https://patch.msgid.link/20250904091334.53965-1-wahrenst@gmx.net
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: libwx: fix to enable RSS [+ + +]
Author: Jiawen Wu <jiawenwu@trustnetic.com>
Date:   Thu Sep 4 10:43:22 2025 +0800

    net: libwx: fix to enable RSS
    
    commit 157cf360c4a8751f7f511a71cc3a283b5d27f889 upstream.
    
    Now when SRIOV is enabled, PF with multiple queues can only receive
    all packets on queue 0. This is caused by an incorrect flag judgement,
    which prevents RSS from being enabled.
    
    In fact, RSS is supported for the functions when SRIOV is enabled.
    Remove the flag judgement to fix it.
    
    Fixes: c52d4b898901 ("net: libwx: Redesign flow when sriov is enabled")
    Cc: stable@vger.kernel.org
    Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/A3B7449A08A044D0+20250904024322.87145-1-jiawenwu@trustnetic.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

net: phy: transfer phy_config_inband() locking responsibility to phylink [+ + +]
Author: Vladimir Oltean <vladimir.oltean@nxp.com>
Date:   Thu Sep 4 15:52:38 2025 +0300

    net: phy: transfer phy_config_inband() locking responsibility to phylink
    
    [ Upstream commit e2a10daba84968f6b5777d150985fd7d6abc9c84 ]
    
    Problem description
    ===================
    
    Lockdep reports a possible circular locking dependency (AB/BA) between
    &pl->state_mutex and &phy->lock, as follows.
    
    phylink_resolve() // acquires &pl->state_mutex
    -> phylink_major_config()
       -> phy_config_inband() // acquires &pl->phydev->lock
    
    whereas all the other call sites where &pl->state_mutex and
    &pl->phydev->lock have the locking scheme reversed. Everywhere else,
    &pl->phydev->lock is acquired at the top level, and &pl->state_mutex at
    the lower level. A clear example is phylink_bringup_phy().
    
    The outlier is the newly introduced phy_config_inband() and the existing
    lock order is the correct one. To understand why it cannot be the other
    way around, it is sufficient to consider phylink_phy_change(), phylink's
    callback from the PHY device's phy->phy_link_change() virtual method,
    invoked by the PHY state machine.
    
    phy_link_up() and phy_link_down(), the (indirect) callers of
    phylink_phy_change(), are called with &phydev->lock acquired.
    Then phylink_phy_change() acquires its own &pl->state_mutex, to
    serialize changes made to its pl->phy_state and pl->link_config.
    So all other instances of &pl->state_mutex and &phydev->lock must be
    consistent with this order.
    
    Problem impact
    ==============
    
    I think the kernel runs a serious deadlock risk if an existing
    phylink_resolve() thread, which results in a phy_config_inband() call,
    is concurrent with a phy_link_up() or phy_link_down() call, which will
    deadlock on &pl->state_mutex in phylink_phy_change(). Practically
    speaking, the impact may be limited by the slow speed of the medium
    auto-negotiation protocol, which makes it unlikely for the current state
    to still be unresolved when a new one is detected, but I think the
    problem is there. Nonetheless, the problem was discovered using lockdep.
    
    Proposed solution
    =================
    
    Practically speaking, the phy_config_inband() requirement of having
    phydev->lock acquired must transfer to the caller (phylink is the only
    caller). There, it must bubble up until immediately before
    &pl->state_mutex is acquired, for the cases where that takes place.
    
    Solution details, considerations, notes
    =======================================
    
    This is the phy_config_inband() call graph:
    
                              sfp_upstream_ops :: connect_phy()
                              |
                              v
                              phylink_sfp_connect_phy()
                              |
                              v
                              phylink_sfp_config_phy()
                              |
                              |   sfp_upstream_ops :: module_insert()
                              |   |
                              |   v
                              |   phylink_sfp_module_insert()
                              |   |
                              |   |   sfp_upstream_ops :: module_start()
                              |   |   |
                              |   |   v
                              |   |   phylink_sfp_module_start()
                              |   |   |
                              |   v   v
                              |   phylink_sfp_config_optical()
     phylink_start()          |   |
       |   phylink_resume()   v   v
       |   |  phylink_sfp_set_config()
       |   |  |
       v   v  v
     phylink_mac_initial_config()
       |   phylink_resolve()
       |   |  phylink_ethtool_ksettings_set()
       v   v  v
       phylink_major_config()
                |
                v
        phy_config_inband()
    
    phylink_major_config() caller #1, phylink_mac_initial_config(), does not
    acquire &pl->state_mutex nor do its callers. It must acquire
    &pl->phydev->lock prior to calling phylink_major_config().
    
    phylink_major_config() caller #2, phylink_resolve() acquires
    &pl->state_mutex, thus also needs to acquire &pl->phydev->lock.
    
    phylink_major_config() caller #3, phylink_ethtool_ksettings_set(), is
    completely uninteresting, because it only calls phylink_major_config()
    if pl->phydev is NULL (otherwise it calls phy_ethtool_ksettings_set()).
    We need to change nothing there.
    
    Other solutions
    ===============
    
    The lock inversion between &pl->state_mutex and &pl->phydev->lock has
    occurred at least once before, as seen in commit c718af2d00a3 ("net:
    phylink: fix ethtool -A with attached PHYs"). The solution there was to
    simply not call phy_set_asym_pause() under the &pl->state_mutex. That
    cannot be extended to our case though, where the phy_config_inband()
    call is much deeper inside the &pl->state_mutex section.
    
    Fixes: 5fd0f1a02e75 ("net: phylink: add negotiation of in-band capabilities")
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/20250904125238.193990-2-vladimir.oltean@nxp.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: phylink: add lock for serializing concurrent pl->phydev writes with resolver [+ + +]
Author: Vladimir Oltean <vladimir.oltean@nxp.com>
Date:   Thu Sep 4 15:52:37 2025 +0300

    net: phylink: add lock for serializing concurrent pl->phydev writes with resolver
    
    [ Upstream commit 0ba5b2f2c381dbec9ed9e4ab3ae5d3e667de0dc3 ]
    
    Currently phylink_resolve() protects itself against concurrent
    phylink_bringup_phy() or phylink_disconnect_phy() calls which modify
    pl->phydev by relying on pl->state_mutex.
    
    The problem is that in phylink_resolve(), pl->state_mutex is in a lock
    inversion state with pl->phydev->lock. So pl->phydev->lock needs to be
    acquired prior to pl->state_mutex. But that requires dereferencing
    pl->phydev in the first place, and without pl->state_mutex, that is
    racy.
    
    Hence the reason for the extra lock. Currently it is redundant, but it
    will serve a functional purpose once mutex_lock(&phy->lock) will be
    moved outside of the mutex_lock(&pl->state_mutex) section.
    
    Another alternative considered would have been to let phylink_resolve()
    acquire the rtnl_mutex, which is also held when phylink_bringup_phy()
    and phylink_disconnect_phy() are called. But since phylink_disconnect_phy()
    runs under rtnl_lock(), it would deadlock with phylink_resolve() when
    calling flush_work(&pl->resolve). Additionally, it would have been
    undesirable because it would have unnecessarily blocked many other call
    paths as well in the entire kernel, so the smaller-scoped lock was
    preferred.
    
    Link: https://lore.kernel.org/netdev/aLb6puGVzR29GpPx@shell.armlinux.org.uk/
    Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
    Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
    Link: https://patch.msgid.link/20250904125238.193990-1-vladimir.oltean@nxp.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Stable-dep-of: e2a10daba849 ("net: phy: transfer phy_config_inband() locking responsibility to phylink")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

net: usb: asix: ax88772: drop phylink use in PM to avoid MDIO runtime PM wakeups [+ + +]
Author: Oleksij Rempel <o.rempel@pengutronix.de>
Date:   Mon Sep 8 13:26:19 2025 +0200

    net: usb: asix: ax88772: drop phylink use in PM to avoid MDIO runtime PM wakeups
    
    commit 5537a4679403423e0b49c95b619983a4583d69c5 upstream.
    
    Drop phylink_{suspend,resume}() from ax88772 PM callbacks.
    
    MDIO bus accesses have their own runtime-PM handling and will try to
    wake the device if it is suspended. Such wake attempts must not happen
    from PM callbacks while the device PM lock is held. Since phylink
    {sus|re}sume may trigger MDIO, it must not be called in PM context.
    
    No extra phylink PM handling is required for this driver:
    - .ndo_open/.ndo_stop control the phylink start/stop lifecycle.
    - ethtool/phylib entry points run in process context, not PM.
    - phylink MAC ops program the MAC on link changes after resume.
    
    Fixes: e0bffe3e6894 ("net: asix: ax88772: migrate to phylink")
    Reported-by: Hubert Wiśniewski <hubert.wisniewski.25632@gmail.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
    Tested-by: Hubert Wiśniewski <hubert.wisniewski.25632@gmail.com>
    Tested-by: Xu Yang <xu.yang_2@nxp.com>
    Link: https://patch.msgid.link/20250908112619.2900723-1-o.rempel@pengutronix.de
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
netfilter: nf_tables: make nft_set_do_lookup available unconditionally [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Wed Sep 10 10:02:21 2025 +0200

    netfilter: nf_tables: make nft_set_do_lookup available unconditionally
    
    [ Upstream commit 11fe5a82e53ac3581a80c88e0e35fb8a80e15f48 ]
    
    This function was added for retpoline mitigation and is replaced by a
    static inline helper if mitigations are not enabled.
    
    Enable this helper function unconditionally so next patch can add a lookup
    restart mechanism to fix possible false negatives while transactions are
    in progress.
    
    Adding lookup restarts in nft_lookup_eval doesn't work as nft_objref would
    then need the same copypaste loop.
    
    This patch is separate to ease review of the actual bug fix.
    
    Suggested-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Stable-dep-of: b2f742c846ca ("netfilter: nf_tables: restart set lookup on base_seq change")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nf_tables: place base_seq in struct net [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Wed Sep 10 10:02:20 2025 +0200

    netfilter: nf_tables: place base_seq in struct net
    
    [ Upstream commit 64102d9bbc3d41dac5188b8fba75b1344c438970 ]
    
    This will soon be read from packet path around same time as the gencursor.
    
    Both gencursor and base_seq get incremented almost at the same time, so
    it makes sense to place them in the same structure.
    
    This doesn't increase struct net size on 64bit due to padding.
    
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Stable-dep-of: b2f742c846ca ("netfilter: nf_tables: restart set lookup on base_seq change")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nf_tables: Reintroduce shortened deletion notifications [+ + +]
Author: Phil Sutter <phil@nwl.cc>
Date:   Fri Jun 13 15:37:03 2025 +0200

    netfilter: nf_tables: Reintroduce shortened deletion notifications
    
    [ Upstream commit a1050dd071682d2c9d8d6d5c96119f8f401b62f0 ]
    
    Restore commit 28339b21a365 ("netfilter: nf_tables: do not send complete
    notification of deletions") and fix it:
    
    - Avoid upfront modification of 'event' variable so the conditionals
      become effective.
    - Always include NFTA_OBJ_TYPE attribute in object notifications, user
      space requires it for proper deserialisation.
    - Catch DESTROY events, too.
    
    Signed-off-by: Phil Sutter <phil@nwl.cc>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Stable-dep-of: b2f742c846ca ("netfilter: nf_tables: restart set lookup on base_seq change")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nf_tables: restart set lookup on base_seq change [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Wed Sep 10 10:02:22 2025 +0200

    netfilter: nf_tables: restart set lookup on base_seq change
    
    [ Upstream commit b2f742c846cab9afc5953a5d8f17b54922dcc723 ]
    
    The hash, hash_fast, rhash and bitwise sets may indicate no result even
    though a matching element exists during a short time window while other
    cpu is finalizing the transaction.
    
    This happens when the hash lookup/bitwise lookup function has picked up
    the old genbit, right before it was toggled by nf_tables_commit(), but
    then the same cpu managed to unlink the matching old element from the
    hash table:
    
    cpu0                                    cpu1
      has added new elements to clone
      has marked elements as being
      inactive in new generation
                                            perform lookup in the set
      enters commit phase:
                                            A) observes old genbit
       increments base_seq
    I) increments the genbit
    II) removes old element from the set
                                            B) finds matching element
                                            C) returns no match: found
                                            element is not valid in old
                                            generation
    
                                            Next lookup observes new genbit and
                                            finds matching e2.
    
    Consider a packet matching element e1, e2.
    
    cpu0 processes following transaction:
    1. remove e1
    2. adds e2, which has same key as e1.
    
    P matches both e1 and e2.  Therefore, cpu1 should always find a match
    for P. Due to above race, this is not the case:
    
    cpu1 observed the old genbit.  e2 will not be considered once it is found.
    The element e1 is not found anymore if cpu0 managed to unlink it from the
    hlist before cpu1 found it during list traversal.
    
    The situation only occurs for a brief time period, lookups happening
    after I) observe new genbit and return e2.
    
    This problem exists in all set types except nft_set_pipapo, so fix it once
    in nft_lookup rather than each set ops individually.
    
    Sample the base sequence counter, which gets incremented right before the
    genbit is changed.
    
    Then, if no match is found, retry the lookup if the base sequence was
    altered in between.
    
    If the base sequence hasn't changed:
     - No update took place: no-match result is expected.
       This is the common case.  or:
     - nf_tables_commit() hasn't progressed to genbit update yet.
       Old elements were still visible and nomatch result is expected, or:
     - nf_tables_commit updated the genbit:
       We picked up the new base_seq, so the lookup function also picked
       up the new genbit, no-match result is expected.
    
    If the old genbit was observed, then nft_lookup also picked up the old
    base_seq: nft_lookup_should_retry() returns true and relookup is performed
    in the new generation.
    
    This problem was added when the unconditional synchronize_rcu() call
    that followed the current/next generation bit toggle was removed.
    
    Thanks to Pablo Neira Ayuso for reviewing an earlier version of this
    patchset, for suggesting re-use of existing base_seq and placement of
    the restart loop in nft_set_do_lookup().
    
    Fixes: 0cbc06b3faba ("netfilter: nf_tables: remove synchronize_rcu in commit phase")
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_set: remove one argument from lookup and update functions [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Wed Jul 9 19:05:13 2025 +0200

    netfilter: nft_set: remove one argument from lookup and update functions
    
    [ Upstream commit 17a20e09f086f2c574ac87f3cf6e14c4377f65f6 ]
    
    Return the extension pointer instead of passing it as a function
    argument to be filled in by the callee.
    
    As-is, whenever false is returned, the extension pointer is not used.
    
    For all set types, when true is returned, the extension pointer was set
    to the matching element.
    
    Only exception: nft_set_bitmap doesn't support extensions.
    Return a pointer to a static const empty element extension container.
    
    return false -> return NULL
    return true -> return the elements' extension pointer.
    
    This saves one function argument.
    
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Stable-dep-of: c4eaca2e1052 ("netfilter: nft_set_pipapo: don't check genbit from packetpath lookups")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_set_bitmap: fix lockdep splat due to missing annotation [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Tue Sep 9 14:45:21 2025 +0200

    netfilter: nft_set_bitmap: fix lockdep splat due to missing annotation
    
    [ Upstream commit 5e13f2c491a4100d208e77e92fe577fe3dbad6c2 ]
    
    Running new 'set_flush_add_atomic_bitmap' test case for nftables.git
    with CONFIG_PROVE_RCU_LIST=y yields:
    
    net/netfilter/nft_set_bitmap.c:231 RCU-list traversed in non-reader section!!
    rcu_scheduler_active = 2, debug_locks = 1
    1 lock held by nft/4008:
     #0: ffff888147f79cd8 (&nft_net->commit_mutex){+.+.}-{4:4}, at: nf_tables_valid_genid+0x2f/0xd0
    
     lockdep_rcu_suspicious+0x116/0x160
     nft_bitmap_walk+0x22d/0x240
     nf_tables_delsetelem+0x1010/0x1a00
     ..
    
    This is a false positive, the list cannot be altered while the
    transaction mutex is held, so pass the relevant argument to the iterator.
    
    Fixes tag intentionally wrong; no point in picking this up if earlier
    false-positive-fixups were not applied.
    
    Fixes: 28b7a6b84c0a ("netfilter: nf_tables: avoid false-positive lockdep splats in set walker")
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_set_pipapo: don't check genbit from packetpath lookups [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Wed Sep 10 10:02:18 2025 +0200

    netfilter: nft_set_pipapo: don't check genbit from packetpath lookups
    
    [ Upstream commit c4eaca2e1052adfd67bed0a36a9d4b8e515666e4 ]
    
    The pipapo set type is special in that it has two copies of its
    datastructure: one live copy containing only valid elements and one
    on-demand clone used during transaction where adds/deletes happen.
    
    This clone is not visible to the datapath.
    
    This is unlike all other set types in nftables, those all link new
    elements into their live hlist/tree.
    
    For those sets, the lookup functions must skip the new elements while the
    transaction is ongoing to ensure consistency.
    
    As the clone is shallow, removal does have an effect on the packet path:
    once the transaction enters the commit phase the 'gencursor' bit that
    determines which elements are active and which elements should be ignored
    (because they are no longer valid) is flipped.
    
    This causes the datapath lookup to ignore these elements if they are found
    during lookup.
    
    This opens up a small race window where pipapo has an inconsistent view of
    the dataset from when the transaction-cpu flipped the genbit until the
    transaction-cpu calls nft_pipapo_commit() to swap live/clone pointers:
    
    cpu0                                    cpu1
      has added new elements to clone
      has marked elements as being
      inactive in new generation
                                            perform lookup in the set
      enters commit phase:
    
    I) increments the genbit
                                            A) observes new genbit
      removes elements from the clone so
      they won't be found anymore
                                            B) lookup in datastructure
                                               can't see new elements yet,
                                               but old elements are ignored
                                               -> Only matches elements that
                                               were not changed in the
                                               transaction
    II) calls nft_pipapo_commit(), clone
        and live pointers are swapped.
                                            C New nft_lookup happening now
                                              will find matching elements.
    
    Consider a packet matching range r1-r2:
    
    cpu0 processes following transaction:
    1. remove r1-r2
    2. add r1-r3
    
    P is contained in both ranges. Therefore, cpu1 should always find a match
    for P.  Due to above race, this is not the case:
    
    cpu1 does find r1-r2, but then ignores it due to the genbit indicating
    the range has been removed.
    
    At the same time, r1-r3 is not visible yet, because it can only be found
    in the clone.
    
    The situation persists for all lookups until after cpu0 hits II).
    
    The fix is easy: Don't check the genbit from pipapo lookup functions.
    This is possible because unlike the other set types, the new elements are
    not reachable from the live copy of the dataset.
    
    The clone/live pointer swap is enough to avoid matching on old elements
    while at the same time all new elements are exposed in one go.
    
    After this change, step B above returns a match in r1-r2.
    This is fine: r1-r2 only becomes truly invalid the moment they get freed.
    This happens after a synchronize_rcu() call and rcu read lock is held
    via netfilter hook traversal (nf_hook_slow()).
    
    Cc: Stefano Brivio <sbrivio@redhat.com>
    Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges")
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_set_pipapo: don't return bogus extension pointer [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Mon Aug 4 12:10:41 2025 +0200

    netfilter: nft_set_pipapo: don't return bogus extension pointer
    
    [ Upstream commit c8a7c2c608180f3b4e51dc958b3861242dcdd76d ]
    
    Dan Carpenter says:
    Commit 17a20e09f086 ("netfilter: nft_set: remove one argument from
    lookup and update functions") [..] leads to the following Smatch
    static checker warning:
    
     net/netfilter/nft_set_pipapo_avx2.c:1269 nft_pipapo_avx2_lookup()
     error: uninitialized symbol 'ext'.
    
    Fix this by initing ext to NULL and set it only once we've found
    a match.
    
    Fixes: 17a20e09f086 ("netfilter: nft_set: remove one argument from lookup and update functions")
    Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
    Closes: https://lore.kernel.org/netfilter-devel/aJBzc3V5wk-yPOnH@stanley.mountain/
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Stable-dep-of: c4eaca2e1052 ("netfilter: nft_set_pipapo: don't check genbit from packetpath lookups")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_set_pipapo: fix null deref for empty set [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Mon Aug 11 12:26:10 2025 +0200

    netfilter: nft_set_pipapo: fix null deref for empty set
    
    commit 30c1d25b9870d551be42535067d5481668b5e6f3 upstream.
    
    Blamed commit broke the check for a null scratch map:
      -  if (unlikely(!m || !*raw_cpu_ptr(m->scratch)))
      +  if (unlikely(!raw_cpu_ptr(m->scratch)))
    
    This should have been "if (!*raw_ ...)".
    Use the pattern of the avx2 version which is more readable.
    
    This can only be reproduced if avx2 support isn't available.
    
    Fixes: d8d871a35ca9 ("netfilter: nft_set_pipapo: merge pipapo_get/lookup")
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

netfilter: nft_set_pipapo: merge pipapo_get/lookup [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Wed Jul 9 19:05:15 2025 +0200

    netfilter: nft_set_pipapo: merge pipapo_get/lookup
    
    [ Upstream commit d8d871a35ca9ee4881d34995444ed1cb826d01db ]
    
    The matching algorithm has implemented thrice:
    1. data path lookup, generic version
    2. data path lookup, avx2 version
    3. control plane lookup
    
    Merge 1 and 3 by refactoring pipapo_get as a common helper, then make
    nft_pipapo_lookup and nft_pipapo_get both call the common helper.
    
    Aside from the code savings this has the benefit that we no longer allocate
    temporary scratch maps for each control plane get and insertion operation.
    
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Stable-dep-of: c4eaca2e1052 ("netfilter: nft_set_pipapo: don't check genbit from packetpath lookups")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_set_pipapo: remove unused arguments [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Wed Jul 9 19:05:12 2025 +0200

    netfilter: nft_set_pipapo: remove unused arguments
    
    [ Upstream commit 7792c1e03054440c60d4bce0c06a31c134601997 ]
    
    They are not used anymore, so remove them.
    
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Stable-dep-of: c4eaca2e1052 ("netfilter: nft_set_pipapo: don't check genbit from packetpath lookups")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

netfilter: nft_set_rbtree: continue traversal if element is inactive [+ + +]
Author: Florian Westphal <fw@strlen.de>
Date:   Wed Sep 10 10:02:19 2025 +0200

    netfilter: nft_set_rbtree: continue traversal if element is inactive
    
    [ Upstream commit a60f7bf4a1524d8896b76ba89623080aebf44272 ]
    
    When the rbtree lookup function finds a match in the rbtree, it sets the
    range start interval to a potentially inactive element.
    
    Then, after tree lookup, if the matching element is inactive, it returns
    NULL and suppresses a matching result.
    
    This is wrong and leads to false negative matches when a transaction has
    already entered the commit phase.
    
    cpu0                                    cpu1
      has added new elements to clone
      has marked elements as being
      inactive in new generation
                                            perform lookup in the set
      enters commit phase:
    I) increments the genbit
                                            A) observes new genbit
                                            B) finds matching range
                                            C) returns no match: found
                                            range invalid in new generation
    II) removes old elements from the tree
                                            C New nft_lookup happening now
                                              will find matching element,
                                              because it is no longer
                                              obscured by old, inactive one.
    
    Consider a packet matching range r1-r2:
    
    cpu0 processes following transaction:
    1. remove r1-r2
    2. add r1-r3
    
    P is contained in both ranges. Therefore, cpu1 should always find a match
    for P.  Due to above race, this is not the case:
    
    cpu1 does find r1-r2, but then ignores it due to the genbit indicating
    the range has been removed.  It does NOT test for further matches.
    
    The situation persists for all lookups until after cpu0 hits II) after
    which r1-r3 range start node is tested for the first time.
    
    Move the "interval start is valid" check ahead so that tree traversal
    continues if the starting interval is not valid in this generation.
    
    Thanks to Stefan Hanreich for providing an initial reproducer for this
    bug.
    
    Reported-by: Stefan Hanreich <s.hanreich@proxmox.com>
    Fixes: c1eda3c6394f ("netfilter: nft_rbtree: ignore inactive matching element with no descendants")
    Signed-off-by: Florian Westphal <fw@strlen.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
netlink: specs: mptcp: fix if-idx attribute type [+ + +]
Author: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Date:   Mon Sep 8 23:27:27 2025 +0200

    netlink: specs: mptcp: fix if-idx attribute type
    
    commit 7094b84863e5832cb1cd9c4b9d648904775b6bd9 upstream.
    
    This attribute is used as a signed number in the code in pm_netlink.c:
    
      nla_put_s32(skb, MPTCP_ATTR_IF_IDX, ssk->sk_bound_dev_if))
    
    The specs should then reflect that. Note that other 'if-idx' attributes
    from the same .yaml file use a signed number as well.
    
    Fixes: bc8aeb2045e2 ("Documentation: netlink: add a YAML spec for mptcp")
    Cc: stable@vger.kernel.org
    Reviewed-by: Geliang Tang <geliang@kernel.org>
    Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
    Link: https://patch.msgid.link/20250908-net-mptcp-misc-fixes-6-17-rc5-v1-1-5f2168a66079@kernel.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
nfs/localio: restore creds before releasing pageio data [+ + +]
Author: Scott Mayhew <smayhew@redhat.com>
Date:   Thu Aug 7 12:49:38 2025 -0400

    nfs/localio: restore creds before releasing pageio data
    
    [ Upstream commit 992203a1fba51b025c60ec0c8b0d9223343dea95 ]
    
    Otherwise if the nfsd filecache code releases the nfsd_file
    immediately, it can trigger the BUG_ON(cred == current->cred) in
    __put_cred() when it puts the nfsd_file->nf_file->f-cred.
    
    Fixes: b9f5dd57f4a5 ("nfs/localio: use dedicated workqueues for filesystem read and write")
    Signed-off-by: Scott Mayhew <smayhew@redhat.com>
    Reviewed-by: Mike Snitzer <snitzer@kernel.org>
    Link: https://lore.kernel.org/r/20250807164938.2395136-1-smayhew@redhat.com
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
NFS: nfs_invalidate_folio() must observe the offset and size arguments [+ + +]
Author: Trond Myklebust <trond.myklebust@hammerspace.com>
Date:   Wed Sep 3 11:48:57 2025 -0400

    NFS: nfs_invalidate_folio() must observe the offset and size arguments
    
    [ Upstream commit b7b8574225e9d2b5f1fb5483886ab797892f43b5 ]
    
    If we're truncating part of the folio, then we need to write out the
    data on the part that is not covered by the cancellation.
    
    Fixes: d47992f86b30 ("mm: change invalidatepage prototype to accept length")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

NFS: Serialise O_DIRECT i/o and truncate() [+ + +]
Author: Trond Myklebust <trond.myklebust@hammerspace.com>
Date:   Fri Sep 5 12:06:23 2025 -0400

    NFS: Serialise O_DIRECT i/o and truncate()
    
    [ Upstream commit 9eb90f435415c7da4800974ed943e39b5578ee7f ]
    
    Ensure that all O_DIRECT reads and writes are complete, and prevent the
    initiation of new i/o until the setattr operation that will truncate the
    file is complete.
    
    Fixes: a5864c999de6 ("NFS: Do not serialise O_DIRECT reads and writes")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
NFSv4.2: Serialise O_DIRECT i/o and clone range [+ + +]
Author: Trond Myklebust <trond.myklebust@hammerspace.com>
Date:   Sat Sep 6 10:40:24 2025 -0400

    NFSv4.2: Serialise O_DIRECT i/o and clone range
    
    [ Upstream commit c80ebeba1198eac8811ab0dba36ecc13d51e4438 ]
    
    Ensure that all O_DIRECT reads and writes complete before cloning a file
    range, so that both the source and destination are up to date.
    
    Fixes: a5864c999de6 ("NFS: Do not serialise O_DIRECT reads and writes")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

NFSv4.2: Serialise O_DIRECT i/o and copy range [+ + +]
Author: Trond Myklebust <trond.myklebust@hammerspace.com>
Date:   Sat Sep 6 10:54:13 2025 -0400

    NFSv4.2: Serialise O_DIRECT i/o and copy range
    
    [ Upstream commit ca247c89900ae90207f4d321e260cd93b7c7d104 ]
    
    Ensure that all O_DIRECT reads and writes complete before copying a file
    range, so that the destination is up to date.
    
    Fixes: a5864c999de6 ("NFS: Do not serialise O_DIRECT reads and writes")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

NFSv4.2: Serialise O_DIRECT i/o and fallocate() [+ + +]
Author: Trond Myklebust <trond.myklebust@hammerspace.com>
Date:   Fri Sep 5 12:11:17 2025 -0400

    NFSv4.2: Serialise O_DIRECT i/o and fallocate()
    
    [ Upstream commit b93128f29733af5d427a335978a19884c2c230e2 ]
    
    Ensure that all O_DIRECT reads and writes complete before calling
    fallocate so that we don't race w.r.t. attribute updates.
    
    Fixes: 99f237832243 ("NFSv4.2: Always flush out writes in nfs42_proc_fallocate()")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
NFSv4/flexfiles: Fix layout merge mirror check. [+ + +]
Author: Jonathan Curley <jcurley@purestorage.com>
Date:   Mon Sep 8 17:35:16 2025 +0000

    NFSv4/flexfiles: Fix layout merge mirror check.
    
    [ Upstream commit dd2fa82473453661d12723c46c9f43d9876a7efd ]
    
    Typo in ff_lseg_match_mirrors makes the diff ineffective. This results
    in merge happening all the time. Merge happening all the time is
    problematic because it marks lsegs invalid. Marking lsegs invalid
    causes all outstanding IO to get restarted with EAGAIN and connections
    to get closed.
    
    Closing connections constantly triggers race conditions in the RDMA
    implementation...
    
    Fixes: 660d1eb22301c ("pNFS/flexfile: Don't merge layout segments if the mirrors don't match")
    Signed-off-by: Jonathan Curley <jcurley@purestorage.com>
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
NFSv4: Clear NFS_CAP_OPEN_XOR and NFS_CAP_DELEGTIME if not supported [+ + +]
Author: Trond Myklebust <trond.myklebust@hammerspace.com>
Date:   Fri Aug 29 09:12:30 2025 -0700

    NFSv4: Clear NFS_CAP_OPEN_XOR and NFS_CAP_DELEGTIME if not supported
    
    [ Upstream commit b3ac33436030bce37ecb3dcae581ecfaad28078c ]
    
    _nfs4_server_capabilities() should clear capabilities that are not
    supported by the server.
    
    Fixes: d2a00cceb93a ("NFSv4: Detect support for OPEN4_SHARE_ACCESS_WANT_OPEN_XOR_DELEGATION")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

NFSv4: Clear the NFS_CAP_FS_LOCATIONS flag if it is not set [+ + +]
Author: Trond Myklebust <trond.myklebust@hammerspace.com>
Date:   Fri Aug 29 09:07:22 2025 -0700

    NFSv4: Clear the NFS_CAP_FS_LOCATIONS flag if it is not set
    
    [ Upstream commit dd5a8621b886b02f8341c5d4ea68eb2c552ebd3e ]
    
    _nfs4_server_capabilities() is expected to clear any flags that are not
    supported by the server.
    
    Fixes: 8a59bb93b7e3 ("NFSv4 store server support for fs_location attribute")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

NFSv4: Clear the NFS_CAP_XATTR flag if not supported by the server [+ + +]
Author: Trond Myklebust <trond.myklebust@hammerspace.com>
Date:   Fri Aug 29 09:15:12 2025 -0700

    NFSv4: Clear the NFS_CAP_XATTR flag if not supported by the server
    
    [ Upstream commit 4fb2b677fc1f70ee642c0beecc3cabf226ef5707 ]
    
    nfs_server_set_fsinfo() shouldn't assume that NFS_CAP_XATTR is unset
    on entry to the function.
    
    Fixes: b78ef845c35d ("NFSv4.2: query the server for extended attribute support")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

NFSv4: Don't clear capabilities that won't be reset [+ + +]
Author: Trond Myklebust <trond.myklebust@hammerspace.com>
Date:   Fri Aug 29 09:02:16 2025 -0700

    NFSv4: Don't clear capabilities that won't be reset
    
    [ Upstream commit 31f1a960ad1a14def94fa0b8c25d62b4c032813f ]
    
    Don't clear the capabilities that are not going to get reset by the call
    to _nfs4_server_capabilities().
    
    Reported-by: Scott Haiden <scott.b.haiden@gmail.com>
    Fixes: b01f21cacde9 ("NFS: Fix the setting of capabilities when automounting a new filesystem")
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
ocfs2: fix recursive semaphore deadlock in fiemap call [+ + +]
Author: Mark Tinguely <mark.tinguely@oracle.com>
Date:   Fri Aug 29 10:18:15 2025 -0500

    ocfs2: fix recursive semaphore deadlock in fiemap call
    
    commit 04100f775c2ea501927f508f17ad824ad1f23c8d upstream.
    
    syzbot detected a OCFS2 hang due to a recursive semaphore on a
    FS_IOC_FIEMAP of the extent list on a specially crafted mmap file.
    
    context_switch kernel/sched/core.c:5357 [inline]
       __schedule+0x1798/0x4cc0 kernel/sched/core.c:6961
       __schedule_loop kernel/sched/core.c:7043 [inline]
       schedule+0x165/0x360 kernel/sched/core.c:7058
       schedule_preempt_disabled+0x13/0x30 kernel/sched/core.c:7115
       rwsem_down_write_slowpath+0x872/0xfe0 kernel/locking/rwsem.c:1185
       __down_write_common kernel/locking/rwsem.c:1317 [inline]
       __down_write kernel/locking/rwsem.c:1326 [inline]
       down_write+0x1ab/0x1f0 kernel/locking/rwsem.c:1591
       ocfs2_page_mkwrite+0x2ff/0xc40 fs/ocfs2/mmap.c:142
       do_page_mkwrite+0x14d/0x310 mm/memory.c:3361
       wp_page_shared mm/memory.c:3762 [inline]
       do_wp_page+0x268d/0x5800 mm/memory.c:3981
       handle_pte_fault mm/memory.c:6068 [inline]
       __handle_mm_fault+0x1033/0x5440 mm/memory.c:6195
       handle_mm_fault+0x40a/0x8e0 mm/memory.c:6364
       do_user_addr_fault+0x764/0x1390 arch/x86/mm/fault.c:1387
       handle_page_fault arch/x86/mm/fault.c:1476 [inline]
       exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532
       asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
    RIP: 0010:copy_user_generic arch/x86/include/asm/uaccess_64.h:126 [inline]
    RIP: 0010:raw_copy_to_user arch/x86/include/asm/uaccess_64.h:147 [inline]
    RIP: 0010:_inline_copy_to_user include/linux/uaccess.h:197 [inline]
    RIP: 0010:_copy_to_user+0x85/0xb0 lib/usercopy.c:26
    Code: e8 00 bc f7 fc 4d 39 fc 72 3d 4d 39 ec 77 38 e8 91 b9 f7 fc 4c 89
    f7 89 de e8 47 25 5b fd 0f 01 cb 4c 89 ff 48 89 d9 4c 89 f6 <f3> a4 0f
    1f 00 48 89 cb 0f 01 ca 48 89 d8 5b 41 5c 41 5d 41 5e 41
    RSP: 0018:ffffc9000403f950 EFLAGS: 00050256
    RAX: ffffffff84c7f101 RBX: 0000000000000038 RCX: 0000000000000038
    RDX: 0000000000000000 RSI: ffffc9000403f9e0 RDI: 0000200000000060
    RBP: ffffc9000403fa90 R08: ffffc9000403fa17 R09: 1ffff92000807f42
    R10: dffffc0000000000 R11: fffff52000807f43 R12: 0000200000000098
    R13: 00007ffffffff000 R14: ffffc9000403f9e0 R15: 0000200000000060
       copy_to_user include/linux/uaccess.h:225 [inline]
       fiemap_fill_next_extent+0x1c0/0x390 fs/ioctl.c:145
       ocfs2_fiemap+0x888/0xc90 fs/ocfs2/extent_map.c:806
       ioctl_fiemap fs/ioctl.c:220 [inline]
       do_vfs_ioctl+0x1173/0x1430 fs/ioctl.c:532
       __do_sys_ioctl fs/ioctl.c:596 [inline]
       __se_sys_ioctl+0x82/0x170 fs/ioctl.c:584
       do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
       do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
       entry_SYSCALL_64_after_hwframe+0x77/0x7f
    RIP: 0033:0x7f5f13850fd9
    RSP: 002b:00007ffe3b3518b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
    RAX: ffffffffffffffda RBX: 0000200000000000 RCX: 00007f5f13850fd9
    RDX: 0000200000000040 RSI: 00000000c020660b RDI: 0000000000000004
    RBP: 6165627472616568 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000000 R11: 0000000000000246 R12: 00007ffe3b3518f0
    R13: 00007ffe3b351b18 R14: 431bde82d7b634db R15: 00007f5f1389a03b
    
    ocfs2_fiemap() takes a read lock of the ip_alloc_sem semaphore (since
    v2.6.22-527-g7307de80510a) and calls fiemap_fill_next_extent() to read the
    extent list of this running mmap executable.  The user supplied buffer to
    hold the fiemap information page faults calling ocfs2_page_mkwrite() which
    will take a write lock (since v2.6.27-38-g00dc417fa3e7) of the same
    semaphore.  This recursive semaphore will hold filesystem locks and causes
    a hang of the fileystem.
    
    The ip_alloc_sem protects the inode extent list and size.  Release the
    read semphore before calling fiemap_fill_next_extent() in ocfs2_fiemap()
    and ocfs2_fiemap_inline().  This does an unnecessary semaphore lock/unlock
    on the last extent but simplifies the error path.
    
    Link: https://lkml.kernel.org/r/61d1a62b-2631-4f12-81e2-cd689914360b@oracle.com
    Fixes: 00dc417fa3e7 ("ocfs2: fiemap support")
    Signed-off-by: Mark Tinguely <mark.tinguely@oracle.com>
    Reported-by: syzbot+541dcc6ee768f77103e7@syzkaller.appspotmail.com
    Closes: https://syzkaller.appspot.com/bug?extid=541dcc6ee768f77103e7
    Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
    Cc: Mark Fasheh <mark@fasheh.com>
    Cc: Joel Becker <jlbec@evilplan.org>
    Cc: Junxiao Bi <junxiao.bi@oracle.com>
    Cc: Changwei Ge <gechangwei@live.cn>
    Cc: Jun Piao <piaojun@huawei.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
PCI: mvebu: Fix use of for_each_of_range() iterator [+ + +]
Author: Klaus Kudielka <klaus.kudielka@gmail.com>
Date:   Sun Sep 7 12:21:46 2025 +0200

    PCI: mvebu: Fix use of for_each_of_range() iterator
    
    [ Upstream commit b816265396daf1beb915e0ffbfd7f3906c2bf4a4 ]
    
    5da3d94a23c6 ("PCI: mvebu: Use for_each_of_range() iterator for parsing
    "ranges"") simplified code by using the for_each_of_range() iterator, but
    it broke PCI enumeration on Turris Omnia (and probably other mvebu
    targets).
    
    Issue #1:
    
    To determine range.flags, of_pci_range_parser_one() uses bus->get_flags(),
    which resolves to of_bus_pci_get_flags(), which already returns an
    IORESOURCE bit field, and NOT the original flags from the "ranges"
    resource.
    
    Then mvebu_get_tgt_attr() attempts the very same conversion again.  Remove
    the misinterpretation of range.flags in mvebu_get_tgt_attr(), to restore
    the intended behavior.
    
    Issue #2:
    
    The driver needs target and attributes, which are encoded in the raw
    address values of the "/soc/pcie/ranges" resource. According to
    of_pci_range_parser_one(), the raw values are stored in range.bus_addr and
    range.parent_bus_addr, respectively. range.cpu_addr is a translated version
    of range.parent_bus_addr, and not relevant here.
    
    Use the correct range structure member, to extract target and attributes.
    This restores the intended behavior.
    
    Fixes: 5da3d94a23c6 ("PCI: mvebu: Use for_each_of_range() iterator for parsing "ranges"")
    Reported-by: Jan Palus <jpalus@fastmail.com>
    Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220479
    Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
    Tested-by: Tony Dinh <mibodhi@gmail.com>
    Tested-by: Jan Palus <jpalus@fastmail.com>
    Link: https://patch.msgid.link/20250907102303.29735-1-klaus.kudielka@gmail.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
perf: Fix the POLL_HUP delivery breakage [+ + +]
Author: Kan Liang <kan.liang@linux.intel.com>
Date:   Mon Aug 11 11:26:44 2025 -0700

    perf: Fix the POLL_HUP delivery breakage
    
    [ Upstream commit 18dbcbfabfffc4a5d3ea10290c5ad27f22b0d240 ]
    
    The event_limit can be set by the PERF_EVENT_IOC_REFRESH to limit the
    number of events. When the event_limit reaches 0, the POLL_HUP signal
    should be sent. But it's missed.
    
    The corresponding counter should be stopped when the event_limit reaches
    0. It was implemented in the ARCH-specific code. However, since the
    commit 9734e25fbf5a ("perf: Fix the throttle logic for a group"), all
    the ARCH-specific code has been moved to the generic code. The code to
    handle the event_limit was lost.
    
    Add the event->pmu->stop(event, 0); back.
    
    Fixes: 9734e25fbf5a ("perf: Fix the throttle logic for a group")
    Closes: https://lore.kernel.org/lkml/aICYAqM5EQUlTqtX@li-2b55cdcc-350b-11b2-a85c-a78bff51fc11.ibm.com/
    Reported-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
    Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
    Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
    Tested-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
    Link: https://lkml.kernel.org/r/20250811182644.1305952-1-kan.liang@linux.intel.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
phy: qcom: qmp-pcie: Fix PHY initialization when powered down by firmware [+ + +]
Author: Stephan Gerhold <stephan.gerhold@linaro.org>
Date:   Thu Aug 21 10:01:47 2025 +0200

    phy: qcom: qmp-pcie: Fix PHY initialization when powered down by firmware
    
    commit 6cb8c1f957f674ca20b7d7c96b1f1bb11b83b679 upstream.
    
    Commit 0cc22f5a861c ("phy: qcom: qmp-pcie: Add PHY register retention
    support") added support for using the "no_csr" reset to skip configuration
    of the PHY if the init sequence was already applied by the boot firmware.
    The expectation is that the PHY is only turned on/off by using the "no_csr"
    reset, instead of powering it down and re-programming it after a full
    reset.
    
    The boot firmware on X1E does not fully conform to this expectation: If the
    PCIe3 link fails to come up (e.g. because no PCIe card is inserted), the
    firmware powers down the PHY using the QPHY_PCS_POWER_DOWN_CONTROL
    register. The QPHY_START_CTRL register is kept as-is, so the driver assumes
    the PHY is already initialized and skips the configuration/power up
    sequence. The PHY won't come up again without clearing the
    QPHY_PCS_POWER_DOWN_CONTROL, so eventually initialization fails:
    
      qcom-qmp-pcie-phy 1be0000.phy: phy initialization timed-out
      phy phy-1be0000.phy.0: phy poweron failed --> -110
      qcom-pcie 1bd0000.pcie: cannot initialize host
      qcom-pcie 1bd0000.pcie: probe with driver qcom-pcie failed with error -110
    
    This can be reliably reproduced on the X1E CRD, QCP and Devkit when no card
    is inserted for PCIe3.
    
    Fix this by checking the QPHY_PCS_POWER_DOWN_CONTROL register in addition
    to QPHY_START_CTRL. If the PHY is powered down with the register, it
    doesn't conform to the expectations for using the "no_csr" reset, so we
    fully re-initialize with the normal reset sequence.
    
    Also check the register more carefully to ensure all of the bits we expect
    are actually set. A simple !!(readl()) is not enough, because the PHY might
    be only partially set up with some of the expected bits set.
    
    Cc: stable@vger.kernel.org
    Fixes: 0cc22f5a861c ("phy: qcom: qmp-pcie: Add PHY register retention support")
    Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
    Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
    Link: https://lore.kernel.org/r/20250821-phy-qcom-qmp-pcie-nocsr-fix-v3-1-4898db0cc07c@linaro.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

phy: qualcomm: phy-qcom-eusb2-repeater: fix override properties [+ + +]
Author: Pengyu Luo <mitltlatltl@gmail.com>
Date:   Tue Aug 12 17:39:56 2025 +0800

    phy: qualcomm: phy-qcom-eusb2-repeater: fix override properties
    
    [ Upstream commit 942e47ab228c7dd27c2ae043c17e7aab2028082c ]
    
    property "qcom,tune-usb2-preem" is for EUSB2_TUNE_USB2_PREEM
    property "qcom,tune-usb2-amplitude" is for EUSB2_TUNE_IUSB2
    
    The downstream correspondence is as follows:
    EUSB2_TUNE_USB2_PREEM: Tx pre-emphasis tuning
    EUSB2_TUNE_IUSB2: HS trasmit amplitude
    EUSB2_TUNE_SQUELCH_U: Squelch detection threshold
    EUSB2_TUNE_HSDISC: HS disconnect threshold
    EUSB2_TUNE_EUSB_SLEW: slew rate
    
    Fixes: 31bc94de7602 ("phy: qualcomm: phy-qcom-eusb2-repeater: Don't zero-out registers")
    Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
    Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
    Reviewed-by: Luca Weiss <luca.weiss@fairphone.com>
    Link: https://lore.kernel.org/r/20250812093957.32235-1-mitltlatltl@gmail.com
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

phy: tegra: xusb: fix device and OF node leak at probe [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Jul 24 15:12:04 2025 +0200

    phy: tegra: xusb: fix device and OF node leak at probe
    
    commit bca065733afd1e3a89a02f05ffe14e966cd5f78e upstream.
    
    Make sure to drop the references taken to the PMC OF node and device by
    of_parse_phandle() and of_find_device_by_node() during probe.
    
    Note the holding a reference to the PMC device does not prevent the
    PMC regmap from going away (e.g. if the PMC driver is unbound) so there
    is no need to keep the reference.
    
    Fixes: 2d1021487273 ("phy: tegra: xusb: Add wake/sleepwalk for Tegra210")
    Cc: stable@vger.kernel.org      # 5.14
    Cc: JC Kuo <jckuo@nvidia.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
    Link: https://lore.kernel.org/r/20250724131206.2211-2-johan@kernel.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

phy: ti-pipe3: fix device leak at unbind [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Jul 24 15:12:06 2025 +0200

    phy: ti-pipe3: fix device leak at unbind
    
    commit e19bcea99749ce8e8f1d359f68ae03210694ad56 upstream.
    
    Make sure to drop the reference to the control device taken by
    of_find_device_by_node() during probe when the driver is unbound.
    
    Fixes: 918ee0d21ba4 ("usb: phy: omap-usb3: Don't use omap_get_control_dev()")
    Cc: stable@vger.kernel.org      # 3.13
    Cc: Roger Quadros <rogerq@kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://lore.kernel.org/r/20250724131206.2211-4-johan@kernel.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

phy: ti: omap-usb2: fix device leak at unbind [+ + +]
Author: Johan Hovold <johan@kernel.org>
Date:   Thu Jul 24 15:12:05 2025 +0200

    phy: ti: omap-usb2: fix device leak at unbind
    
    commit 64961557efa1b98f375c0579779e7eeda1a02c42 upstream.
    
    Make sure to drop the reference to the control device taken by
    of_find_device_by_node() during probe when the driver is unbound.
    
    Fixes: 478b6c7436c2 ("usb: phy: omap-usb2: Don't use omap_get_control_dev()")
    Cc: stable@vger.kernel.org      # 3.13
    Cc: Roger Quadros <rogerq@kernel.org>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Link: https://lore.kernel.org/r/20250724131206.2211-3-johan@kernel.org
    Signed-off-by: Vinod Koul <vkoul@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
PM: EM: Add function for registering a PD without capacity update [+ + +]
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Fri Sep 5 15:44:45 2025 +0200

    PM: EM: Add function for registering a PD without capacity update
    
    commit e0423541477dfb684fbc6e6b5386054bc650f264 upstream.
    
    The intel_pstate driver manages CPU capacity changes itself and it does
    not need an update of the capacity of all CPUs in the system to be
    carried out after registering a PD.
    
    Moreover, in some configurations (for instance, an SMT-capable
    hybrid x86 system booted with nosmt in the kernel command line) the
    em_check_capacity_update() call at the end of em_dev_register_perf_domain()
    always fails and reschedules itself to run once again in 1 s, so
    effectively it runs in vain every 1 s forever.
    
    To address this, introduce a new variant of em_dev_register_perf_domain(),
    called em_dev_register_pd_no_update(), that does not invoke
    em_check_capacity_update(), and make intel_pstate use it instead of the
    original.
    
    Fixes: 7b010f9b9061 ("cpufreq: intel_pstate: EAS support for hybrid platforms")
    Closes: https://lore.kernel.org/linux-pm/40212796-734c-4140-8a85-854f72b8144d@panix.com/
    Reported-by: Kenneth R. Crudup <kenny@panix.com>
    Tested-by: Kenneth R. Crudup <kenny@panix.com>
    Cc: 6.16+ <stable@vger.kernel.org> # 6.16+
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

PM: hibernate: Restrict GFP mask in hibernation_snapshot() [+ + +]
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Wed Sep 10 11:41:59 2025 +0200

    PM: hibernate: Restrict GFP mask in hibernation_snapshot()
    
    commit 449c9c02537a146ac97ef962327a221e21c9cab3 upstream.
    
    Commit 12ffc3b1513e ("PM: Restrict swap use to later in the suspend
    sequence") incorrectly removed a pm_restrict_gfp_mask() call from
    hibernation_snapshot(), so memory allocations involving swap are not
    prevented from being carried out in this code path any more which may
    lead to serious breakage.
    
    The symptoms of such breakage have become visible after adding a
    shrink_shmem_memory() call to hibernation_snapshot() in commit
    2640e819474f ("PM: hibernate: shrink shmem pages after dev_pm_ops.prepare()")
    which caused this problem to be much more likely to manifest itself.
    
    However, since commit 2640e819474f was initially present in the DRM
    tree that did not include commit 12ffc3b1513e, the symptoms of this
    issue were not visible until merge commit 260f6f4fda93 ("Merge tag
    'drm-next-2025-07-30' of https://gitlab.freedesktop.org/drm/kernel")
    that exposed it through an entirely reasonable merge conflict
    resolution.
    
    Fixes: 12ffc3b1513e ("PM: Restrict swap use to later in the suspend sequence")
    Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220555
    Reported-by: Todd Brandt <todd.e.brandt@linux.intel.com>
    Tested-by: Todd Brandt <todd.e.brandt@linux.intel.com>
    Cc: 6.16+ <stable@vger.kernel.org> # 6.16+
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
proc: fix type confusion in pde_set_flags() [+ + +]
Author: wangzijie <wangzijie1@honor.com>
Date:   Thu Sep 4 21:57:15 2025 +0800

    proc: fix type confusion in pde_set_flags()
    
    [ Upstream commit 0ce9398aa0830f15f92bbed73853f9861c3e74ff ]
    
    Commit 2ce3d282bd50 ("proc: fix missing pde_set_flags() for net proc
    files") missed a key part in the definition of proc_dir_entry:
    
    union {
            const struct proc_ops *proc_ops;
            const struct file_operations *proc_dir_ops;
    };
    
    So dereference of ->proc_ops assumes it is a proc_ops structure results in
    type confusion and make NULL check for 'proc_ops' not work for proc dir.
    
    Add !S_ISDIR(dp->mode) test before calling pde_set_flags() to fix it.
    
    Link: https://lkml.kernel.org/r/20250904135715.3972782-1-wangzijie1@honor.com
    Fixes: 2ce3d282bd50 ("proc: fix missing pde_set_flags() for net proc files")
    Signed-off-by: wangzijie <wangzijie1@honor.com>
    Reported-by: Brad Spengler <spender@grsecurity.net>
    Closes: https://lore.kernel.org/all/20250903065758.3678537-1-wangzijie1@honor.com/
    Cc: Alexey Dobriyan <adobriyan@gmail.com>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Christian Brauner <brauner@kernel.org>
    Cc: Jiri Slaby <jirislaby@kernel.org>
    Cc: Stefano Brivio <sbrivio@redhat.com>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
regulator: sy7636a: fix lifecycle of power good gpio [+ + +]
Author: Andreas Kemnade <akemnade@kernel.org>
Date:   Sat Sep 6 11:09:13 2025 +0200

    regulator: sy7636a: fix lifecycle of power good gpio
    
    [ Upstream commit c05d0b32eebadc8be6e53196e99c64cf2bed1d99 ]
    
    Attach the power good gpio to the regulator device devres instead of the
    parent device to fix problems if probe is run multiple times
    (rmmod/insmod or some deferral).
    
    Fixes: 8c485bedfb785 ("regulator: sy7636a: Initial commit")
    Signed-off-by: Andreas Kemnade <akemnade@kernel.org>
    Reviewed-by: Alistair Francis <alistair@alistair23.me>
    Reviewed-by: Peng Fan <peng.fan@nxp.com>
    Message-ID: <20250906-sy7636-rsrc-v1-2-e2886a9763a7@kernel.org>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
Revert "drm/amdgpu: Add more checks to PSP mailbox" [+ + +]
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Sep 4 18:04:57 2025 -0400

    Revert "drm/amdgpu: Add more checks to PSP mailbox"
    
    This reverts commit 165a69a87d6bde85cac2c051fa6da611ca4524f6 which is
    commit 8345a71fc54b28e4d13a759c45ce2664d8540d28 upstream.
    
    This commit is not applicable for stable kernels and results in the
    driver failing to load on some chips on kernel 6.16.x.  Revert from
    6.16.x.
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    Cc: stable@vger.kernel.org # 6.16.x
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Revert "net: usb: asix: ax88772: drop phylink use in PM to avoid MDIO runtime PM wakeups" [+ + +]
Author: Paolo Abeni <pabeni@redhat.com>
Date:   Thu Sep 11 16:33:31 2025 +0200

    Revert "net: usb: asix: ax88772: drop phylink use in PM to avoid MDIO runtime PM wakeups"
    
    commit 63a796558bc22ec699e4193d5c75534757ddf2e6 upstream.
    
    This reverts commit 5537a4679403 ("net: usb: asix: ax88772: drop
    phylink use in PM to avoid MDIO runtime PM wakeups"), it breaks
    operation of asix ethernet usb dongle after system suspend-resume
    cycle.
    
    Link: https://lore.kernel.org/all/b5ea8296-f981-445d-a09a-2f389d7f6fdd@samsung.com/
    Fixes: 5537a4679403 ("net: usb: asix: ax88772: drop phylink use in PM to avoid MDIO runtime PM wakeups")
    Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
    Acked-by: Jakub Kicinski <kuba@kernel.org>
    Link: https://patch.msgid.link/2945b9dbadb8ee1fee058b19554a5cb14f1763c1.1757601118.git.pabeni@redhat.com
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
Revert "SUNRPC: Don't allow waiting for exiting tasks" [+ + +]
Author: Trond Myklebust <trond.myklebust@hammerspace.com>
Date:   Wed Sep 3 09:49:33 2025 -0400

    Revert "SUNRPC: Don't allow waiting for exiting tasks"
    
    commit 199cd9e8d14bc14bdbd1fa3031ce26dac9781507 upstream.
    
    This reverts commit 14e41b16e8cb677bb440dca2edba8b041646c742.
    
    This patch breaks the LTP acct02 test, so let's revert and look for a
    better solution.
    
    Reported-by: Mark Brown <broonie@kernel.org>
    Reported-by: Harshvardhan Jha <harshvardhan.j.jha@oracle.com>
    Link: https://lore.kernel.org/linux-nfs/7d4d57b0-39a3-49f1-8ada-60364743e3b4@sirena.org.uk/
    Cc: stable@vger.kernel.org # 6.15.x
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
rqspinlock: Choose trylock fallback for NMI waiters [+ + +]
Author: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Date:   Tue Sep 9 18:49:59 2025 +0000

    rqspinlock: Choose trylock fallback for NMI waiters
    
    [ Upstream commit 0d80e7f951be1bdd08d328fd87694be0d6e8aaa8 ]
    
    Currently, out of all 3 types of waiters in the rqspinlock slow path
    (i.e., pending bit waiter, wait queue head waiter, and wait queue
    non-head waiter), only the pending bit waiter and wait queue head
    waiters apply deadlock checks and a timeout on their waiting loop. The
    assumption here was that the wait queue head's forward progress would be
    sufficient to identify cases where the lock owner or pending bit waiter
    is stuck, and non-head waiters relying on the head waiter would prove to
    be sufficient for their own forward progress.
    
    However, the head waiter itself can be preempted by a non-head waiter
    for the same lock (AA) or a different lock (ABBA) in a manner that
    impedes its forward progress. In such a case, non-head waiters not
    performing deadlock and timeout checks becomes insufficient, and the
    system can enter a state of lockup.
    
    This is typically not a concern with non-NMI lock acquisitions, as lock
    holders which in run in different contexts (IRQ, non-IRQ) use "irqsave"
    variants of the lock APIs, which naturally excludes such lock holders
    from preempting one another on the same CPU.
    
    It might seem likely that a similar case may occur for rqspinlock when
    programs are attached to contention tracepoints (begin, end), however,
    these tracepoints either precede the enqueue into the wait queue, or
    succeed it, therefore cannot be used to preempt a head waiter's waiting
    loop.
    
    We must still be careful against nested kprobe and fentry programs that
    may attach to the middle of the head's waiting loop to stall forward
    progress and invoke another rqspinlock acquisition that proceeds as a
    non-head waiter. To this end, drop CC_FLAGS_FTRACE from the rqspinlock.o
    object file.
    
    For now, this issue is resolved by falling back to a repeated trylock on
    the lock word from NMI context, while performing the deadlock checks to
    break out early in case forward progress is impossible, and use the
    timeout as a final fallback.
    
    A more involved fix to terminate the queue when such a condition occurs
    will be made as a follow up. A selftest to stress this aspect of nested
    NMI/non-NMI locking attempts will be added in a subsequent patch to the
    bpf-next tree when this fix lands and trees are synchronized.
    
    Reported-by: Josef Bacik <josef@toxicpanda.com>
    Fixes: 164c246571e9 ("rqspinlock: Protect waiters in queue from stalls")
    Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
    Link: https://lore.kernel.org/r/20250909184959.3509085-1-memxor@gmail.com
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
s390/cpum_cf: Deny all sampling events by counter PMU [+ + +]
Author: Thomas Richter <tmricht@linux.ibm.com>
Date:   Fri Aug 22 14:05:57 2025 +0200

    s390/cpum_cf: Deny all sampling events by counter PMU
    
    [ Upstream commit ce971233242b5391d99442271f3ca096fb49818d ]
    
    Deny all sampling event by the CPUMF counter facility device driver
    and return -ENOENT. This return value is used to try other PMUs.
    Up to now events for type PERF_TYPE_HARDWARE were not tested for
    sampling and returned later on -EOPNOTSUPP. This ends the search
    for alternative PMUs. Change that behavior and try other PMUs
    instead.
    
    Fixes: 613a41b0d16e ("s390/cpum_cf: Reject request for sampling in event initialization")
    Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
    Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
    Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
s390/pai: Deny all events not handled by this PMU [+ + +]
Author: Thomas Richter <tmricht@linux.ibm.com>
Date:   Mon Aug 25 09:53:27 2025 +0200

    s390/pai: Deny all events not handled by this PMU
    
    [ Upstream commit 85941afd2c404247e583c827fae0a45da1c1d92c ]
    
    Each PAI PMU device driver returns -EINVAL when an event is out of
    its accepted range. This return value aborts the search for an
    alternative PMU device driver to handle this event.
    Change the return value to -ENOENT. This return value is used to
    try other PMUs instead.  This makes the PMUs more robust when
    the sequence of PMU device driver initialization changes (at boot time)
    or by using modules.
    
    Fixes: 39d62336f5c12 ("s390/pai: add support for cryptography counters")
    Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
    Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
    Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
s390: kexec: initialize kexec_buf struct [+ + +]
Author: Breno Leitao <leitao@debian.org>
Date:   Wed Aug 27 03:42:23 2025 -0700

    s390: kexec: initialize kexec_buf struct
    
    commit e67f0bd05519012eaabaae68618ffc4ed30ab680 upstream.
    
    The kexec_buf structure was previously declared without initialization.
    commit bf454ec31add ("kexec_file: allow to place kexec_buf randomly")
    added a field that is always read but not consistently populated by all
    architectures. This un-initialized field will contain garbage.
    
    This is also triggering a UBSAN warning when the uninitialized data was
    accessed:
    
            ------------[ cut here ]------------
            UBSAN: invalid-load in ./include/linux/kexec.h:210:10
            load of value 252 is not a valid value for type '_Bool'
    
    Zero-initializing kexec_buf at declaration ensures all fields are
    cleanly set, preventing future instances of uninitialized memory being
    used.
    
    Link: https://lkml.kernel.org/r/20250827-kbuf_all-v1-3-1df9882bb01a@debian.org
    Fixes: bf454ec31add ("kexec_file: allow to place kexec_buf randomly")
    Signed-off-by: Breno Leitao <leitao@debian.org>
    Cc: Albert Ou <aou@eecs.berkeley.edu>
    Cc: Alexander Gordeev <agordeev@linux.ibm.com>
    Cc: Alexandre Ghiti <alex@ghiti.fr>
    Cc: Baoquan He <bhe@redhat.com>
    Cc: Catalin Marinas <catalin.marinas@arm.com>
    Cc: Christian Borntraeger <borntraeger@linux.ibm.com>
    Cc: Coiby Xu <coxu@redhat.com>
    Cc: Heiko Carstens <hca@linux.ibm.com>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Cc: Sven Schnelle <svens@linux.ibm.com>
    Cc: Vasily Gorbik <gor@linux.ibm.com>
    Cc: Will Deacon <will@kernel.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
selftests: can: enable CONFIG_CAN_VCAN as a module [+ + +]
Author: Davide Caratti <dcaratti@redhat.com>
Date:   Wed Sep 10 16:56:06 2025 +0200

    selftests: can: enable CONFIG_CAN_VCAN as a module
    
    [ Upstream commit d013ebc3499fd87cb9dee1dafd0c58aeb05c27c1 ]
    
    A proper kernel configuration for running kselftest can be obtained with:
    
     $ yes | make kselftest-merge
    
    Build of 'vcan' driver is currently missing, while the other required knobs
    are already there because of net/link_netns.py [1]. Add a config file in
    selftests/net/can to store the minimum set of kconfig needed for CAN
    selftests.
    
    [1] https://patch.msgid.link/20250219125039.18024-14-shaw.leon@gmail.com
    
    Fixes: 77442ffa83e8 ("selftests: can: Import tst-filter from can-tests")
    Reviewed-by: Vincent Mailhol <mailhol@kernel.org>
    Signed-off-by: Davide Caratti <dcaratti@redhat.com>
    Link: https://patch.msgid.link/fa4c0ea262ec529f25e5f5aa9269d84764c67321.1757516009.git.dcaratti@redhat.com
    Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
serial: sc16is7xx: fix bug in flow control levels init [+ + +]
Author: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Date:   Thu Jul 31 08:44:50 2025 -0400

    serial: sc16is7xx: fix bug in flow control levels init
    
    commit 535fd4c98452c87537a40610abba45daf5761ec6 upstream.
    
    When trying to set MCR[2], XON1 is incorrectly accessed instead. And when
    writing to the TCR register to configure flow control levels, we are
    incorrectly writing to the MSR register. The default value of $00 is then
    used for TCR, which means that selectable trigger levels in FCR are used
    in place of TCR.
    
    TCR/TLR access requires EFR[4] (enable enhanced functions) and MCR[2]
    to be set. EFR[4] is already set in probe().
    
    MCR access requires LCR[7] to be zero.
    
    Since LCR is set to $BF when trying to set MCR[2], XON1 is incorrectly
    accessed instead because MCR shares the same address space as XON1.
    
    Since MCR[2] is unmodified and still zero, when writing to TCR we are in
    fact writing to MSR because TCR/TLR registers share the same address space
    as MSR/SPR.
    
    Fix by first removing useless reconfiguration of EFR[4] (enable enhanced
    functions), as it is already enabled in sc16is7xx_probe() since commit
    43c51bb573aa ("sc16is7xx: make sure device is in suspend once probed").
    Now LCR is $00, which means that MCR access is enabled.
    
    Also remove regcache_cache_bypass() calls since we no longer access the
    enhanced registers set, and TCR is already declared as volatile (in fact
    by declaring MSR as volatile, which shares the same address).
    
    Finally disable access to TCR/TLR registers after modifying them by
    clearing MCR[2].
    
    Note: the comment about "... and internal clock div" is wrong and can be
          ignored/removed as access to internal clock div registers (DLL/DLH)
          is permitted only when LCR[7] is logic 1, not when enhanced features
          is enabled. And DLL/DLH access is not needed in sc16is7xx_startup().
    
    Fixes: dfeae619d781 ("serial: sc16is7xx")
    Cc: stable@vger.kernel.org
    Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
    Link: https://lore.kernel.org/r/20250731124451.1108864-1-hugo@hugovil.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
smb: client: fix compound alignment with encryption [+ + +]
Author: Paulo Alcantara <pc@manguebit.org>
Date:   Sat Sep 6 21:19:29 2025 -0300

    smb: client: fix compound alignment with encryption
    
    commit 90f7c100d2dd99d5cd5be950d553edd2647e6cc8 upstream.
    
    The encryption layer can't handle the padding iovs, so flatten the
    compound request into a single buffer with required padding to prevent
    the server from dropping the connection when finding unaligned
    compound requests.
    
    Fixes: bc925c1216f0 ("smb: client: improve compound padding in encryption")
    Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
    Reviewed-by: David Howells <dhowells@redhat.com>
    Cc: linux-cifs@vger.kernel.org
    Cc: stable@vger.kernel.org
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

smb: client: fix data loss due to broken rename(2) [+ + +]
Author: Paulo Alcantara <pc@manguebit.org>
Date:   Sun Sep 7 21:24:06 2025 -0300

    smb: client: fix data loss due to broken rename(2)
    
    commit c5ea3065586d790ea5193a679b85585173d59866 upstream.
    
    Rename of open files in SMB2+ has been broken for a very long time,
    resulting in data loss as the CIFS client would fail the rename(2)
    call with -ENOENT and then removing the target file.
    
    Fix this by implementing ->rename_pending_delete() for SMB2+, which
    will rename busy files to random filenames (e.g. silly rename) during
    unlink(2) or rename(2), and then marking them to delete-on-close.
    
    Besides, introduce a FIND_WR_NO_PENDING_DELETE flag to prevent open(2)
    from reusing open handles that had been marked as delete pending.
    Handle it in cifs_get_readable_path() as well.
    
    Reported-by: Jean-Baptiste Denis <jbdenis@pasteur.fr>
    Closes: https://marc.info/?i=16aeb380-30d4-4551-9134-4e7d1dc833c0@pasteur.fr
    Reviewed-by: David Howells <dhowells@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
    Cc: Frank Sorenson <sorenson@redhat.com>
    Cc: Olga Kornievskaia <okorniev@redhat.com>
    Cc: Benjamin Coddington <bcodding@redhat.com>
    Cc: Scott Mayhew <smayhew@redhat.com>
    Cc: linux-cifs@vger.kernel.org
    Signed-off-by: Steve French <stfrench@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
SUNRPC: call xs_sock_process_cmsg for all cmsg [+ + +]
Author: Justin Worrell <jworrell@gmail.com>
Date:   Thu Sep 4 16:09:57 2025 -0500

    SUNRPC: call xs_sock_process_cmsg for all cmsg
    
    [ Upstream commit 9559d2fffd4f9b892165eed48198a0e5cb8504e6 ]
    
    xs_sock_recv_cmsg was failing to call xs_sock_process_cmsg for any cmsg
    type other than TLS_RECORD_TYPE_ALERT (TLS_RECORD_TYPE_DATA, and other
    values not handled.) Based on my reading of the previous commit
    (cc5d5908: sunrpc: fix client side handling of tls alerts), it looks
    like only iov_iter_revert should be conditional on TLS_RECORD_TYPE_ALERT
    (but that other cmsg types should still call xs_sock_process_cmsg). On
    my machine, I was unable to connect (over mtls) to an NFS share hosted
    on FreeBSD. With this patch applied, I am able to mount the share again.
    
    Fixes: cc5d59081fa2 ("sunrpc: fix client side handling of tls alerts")
    Signed-off-by: Justin Worrell <jworrell@gmail.com>
    Reviewed-and-tested-by: Scott Mayhew <smayhew@redhat.com>
    Link: https://lore.kernel.org/r/20250904211038.12874-3-jworrell@gmail.com
    Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tcp_bpf: Call sk_msg_free() when tcp_bpf_send_verdict() fails to allocate psock->cork. [+ + +]
Author: Kuniyuki Iwashima <kuniyu@google.com>
Date:   Tue Sep 9 23:26:12 2025 +0000

    tcp_bpf: Call sk_msg_free() when tcp_bpf_send_verdict() fails to allocate psock->cork.
    
    [ Upstream commit a3967baad4d533dc254c31e0d221e51c8d223d58 ]
    
    syzbot reported the splat below. [0]
    
    The repro does the following:
    
      1. Load a sk_msg prog that calls bpf_msg_cork_bytes(msg, cork_bytes)
      2. Attach the prog to a SOCKMAP
      3. Add a socket to the SOCKMAP
      4. Activate fault injection
      5. Send data less than cork_bytes
    
    At 5., the data is carried over to the next sendmsg() as it is
    smaller than the cork_bytes specified by bpf_msg_cork_bytes().
    
    Then, tcp_bpf_send_verdict() tries to allocate psock->cork to hold
    the data, but this fails silently due to fault injection + __GFP_NOWARN.
    
    If the allocation fails, we need to revert the sk->sk_forward_alloc
    change done by sk_msg_alloc().
    
    Let's call sk_msg_free() when tcp_bpf_send_verdict fails to allocate
    psock->cork.
    
    The "*copied" also needs to be updated such that a proper error can
    be returned to the caller, sendmsg. It fails to allocate psock->cork.
    Nothing has been corked so far, so this patch simply sets "*copied"
    to 0.
    
    [0]:
    WARNING: net/ipv4/af_inet.c:156 at inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156, CPU#1: syz-executor/5983
    Modules linked in:
    CPU: 1 UID: 0 PID: 5983 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full)
    Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
    RIP: 0010:inet_sock_destruct+0x623/0x730 net/ipv4/af_inet.c:156
    Code: 0f 0b 90 e9 62 fe ff ff e8 7a db b5 f7 90 0f 0b 90 e9 95 fe ff ff e8 6c db b5 f7 90 0f 0b 90 e9 bb fe ff ff e8 5e db b5 f7 90 <0f> 0b 90 e9 e1 fe ff ff 89 f9 80 e1 07 80 c1 03 38 c1 0f 8c 9f fc
    RSP: 0018:ffffc90000a08b48 EFLAGS: 00010246
    RAX: ffffffff8a09d0b2 RBX: dffffc0000000000 RCX: ffff888024a23c80
    RDX: 0000000000000100 RSI: 0000000000000fff RDI: 0000000000000000
    RBP: 0000000000000fff R08: ffff88807e07c627 R09: 1ffff1100fc0f8c4
    R10: dffffc0000000000 R11: ffffed100fc0f8c5 R12: ffff88807e07c380
    R13: dffffc0000000000 R14: ffff88807e07c60c R15: 1ffff1100fc0f872
    FS:  00005555604c4500(0000) GS:ffff888125af1000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 00005555604df5c8 CR3: 0000000032b06000 CR4: 00000000003526f0
    Call Trace:
     <IRQ>
     __sk_destruct+0x86/0x660 net/core/sock.c:2339
     rcu_do_batch kernel/rcu/tree.c:2605 [inline]
     rcu_core+0xca8/0x1770 kernel/rcu/tree.c:2861
     handle_softirqs+0x286/0x870 kernel/softirq.c:579
     __do_softirq kernel/softirq.c:613 [inline]
     invoke_softirq kernel/softirq.c:453 [inline]
     __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680
     irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
     instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline]
     sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1052
     </IRQ>
    
    Fixes: 4f738adba30a ("bpf: create tcp_bpf_ulp allowing BPF to monitor socket TX/RX data")
    Reported-by: syzbot+4cabd1d2fa917a456db8@syzkaller.appspotmail.com
    Closes: https://lore.kernel.org/netdev/68c0b6b5.050a0220.3c6139.0013.GAE@google.com/
    Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
    Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
    Link: https://patch.msgid.link/20250909232623.4151337-1-kuniyu@google.com
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
trace/fgraph: Fix error handling [+ + +]
Author: Guenter Roeck <linux@roeck-us.net>
Date:   Fri Sep 5 22:06:18 2025 -0700

    trace/fgraph: Fix error handling
    
    [ Upstream commit ab1396af7595e7d49a3850481b24d7fe7cbdfd31 ]
    
    Commit edede7a6dcd7 ("trace/fgraph: Fix the warning caused by missing
    unregister notifier") added a call to unregister the PM notifier if
    register_ftrace_graph() failed. It does so unconditionally. However,
    the PM notifier is only registered with the first call to
    register_ftrace_graph(). If the first registration was successful and
    a subsequent registration failed, the notifier is now unregistered even
    if ftrace graphs are still registered.
    
    Fix the problem by only unregistering the PM notifier during error handling
    if there are no active fgraph registrations.
    
    Fixes: edede7a6dcd7 ("trace/fgraph: Fix the warning caused by missing unregister notifier")
    Closes: https://lore.kernel.org/all/63b0ba5a-a928-438e-84f9-93028dd72e54@roeck-us.net/
    Cc: Ye Weihua <yeweihua4@huawei.com>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Mark Rutland <mark.rutland@arm.com>
    Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Link: https://lore.kernel.org/20250906050618.2634078-1-linux@roeck-us.net
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tracing/osnoise: Fix null-ptr-deref in bitmap_parselist() [+ + +]
Author: Wang Liang <wangliang74@huawei.com>
Date:   Sat Sep 6 11:56:10 2025 +0800

    tracing/osnoise: Fix null-ptr-deref in bitmap_parselist()
    
    [ Upstream commit c1628c00c4351dd0727ef7f670694f68d9e663d8 ]
    
    A crash was observed with the following output:
    
    BUG: kernel NULL pointer dereference, address: 0000000000000010
    Oops: Oops: 0000 [#1] SMP NOPTI
    CPU: 2 UID: 0 PID: 92 Comm: osnoise_cpus Not tainted 6.17.0-rc4-00201-gd69eb204c255 #138 PREEMPT(voluntary)
    RIP: 0010:bitmap_parselist+0x53/0x3e0
    Call Trace:
     <TASK>
     osnoise_cpus_write+0x7a/0x190
     vfs_write+0xf8/0x410
     ? do_sys_openat2+0x88/0xd0
     ksys_write+0x60/0xd0
     do_syscall_64+0xa4/0x260
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
     </TASK>
    
    This issue can be reproduced by below code:
    
    fd=open("/sys/kernel/debug/tracing/osnoise/cpus", O_WRONLY);
    write(fd, "0-2", 0);
    
    When user pass 'count=0' to osnoise_cpus_write(), kmalloc() will return
    ZERO_SIZE_PTR (16) and cpulist_parse() treat it as a normal value, which
    trigger the null pointer dereference. Add check for the parameter 'count'.
    
    Cc: <mhiramat@kernel.org>
    Cc: <mathieu.desnoyers@efficios.com>
    Cc: <tglozar@redhat.com>
    Link: https://lore.kernel.org/20250906035610.3880282-1-wangliang74@huawei.com
    Fixes: 17f89102fe23 ("tracing/osnoise: Allow arbitrarily long CPU string")
    Signed-off-by: Wang Liang <wangliang74@huawei.com>
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tracing: Fix tracing_marker may trigger page fault during preempt_disable [+ + +]
Author: Luo Gengkun <luogengkun@huaweicloud.com>
Date:   Tue Aug 19 10:51:52 2025 +0000

    tracing: Fix tracing_marker may trigger page fault during preempt_disable
    
    [ Upstream commit 3d62ab32df065e4a7797204a918f6489ddb8a237 ]
    
    Both tracing_mark_write and tracing_mark_raw_write call
    __copy_from_user_inatomic during preempt_disable. But in some case,
    __copy_from_user_inatomic may trigger page fault, and will call schedule()
    subtly. And if a task is migrated to other cpu, the following warning will
    be trigger:
            if (RB_WARN_ON(cpu_buffer,
                           !local_read(&cpu_buffer->committing)))
    
    An example can illustrate this issue:
    
    process flow                                            CPU
    ---------------------------------------------------------------------
    
    tracing_mark_raw_write():                               cpu:0
       ...
       ring_buffer_lock_reserve():                          cpu:0
          ...
          cpu = raw_smp_processor_id()                      cpu:0
          cpu_buffer = buffer->buffers[cpu]                 cpu:0
          ...
       ...
       __copy_from_user_inatomic():                         cpu:0
          ...
          # page fault
          do_mem_abort():                                   cpu:0
             ...
             # Call schedule
             schedule()                                     cpu:0
             ...
       # the task schedule to cpu1
       __buffer_unlock_commit():                            cpu:1
          ...
          ring_buffer_unlock_commit():                      cpu:1
             ...
             cpu = raw_smp_processor_id()                   cpu:1
             cpu_buffer = buffer->buffers[cpu]              cpu:1
    
    As shown above, the process will acquire cpuid twice and the return values
    are not the same.
    
    To fix this problem using copy_from_user_nofault instead of
    __copy_from_user_inatomic, as the former performs 'access_ok' before
    copying.
    
    Link: https://lore.kernel.org/20250819105152.2766363-1-luogengkun@huaweicloud.com
    Fixes: 656c7f0d2d2b ("tracing: Replace kmap with copy_from_user() in trace_marker writing")
    Signed-off-by: Luo Gengkun <luogengkun@huaweicloud.com>
    Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

tracing: Silence warning when chunk allocation fails in trace_pid_write [+ + +]
Author: Pu Lehui <pulehui@huawei.com>
Date:   Mon Sep 8 02:46:58 2025 +0000

    tracing: Silence warning when chunk allocation fails in trace_pid_write
    
    [ Upstream commit cd4453c5e983cf1fd5757e9acb915adb1e4602b6 ]
    
    Syzkaller trigger a fault injection warning:
    
    WARNING: CPU: 1 PID: 12326 at tracepoint_add_func+0xbfc/0xeb0
    Modules linked in:
    CPU: 1 UID: 0 PID: 12326 Comm: syz.6.10325 Tainted: G U 6.14.0-rc5-syzkaller #0
    Tainted: [U]=USER
    Hardware name: Google Compute Engine/Google Compute Engine
    RIP: 0010:tracepoint_add_func+0xbfc/0xeb0 kernel/tracepoint.c:294
    Code: 09 fe ff 90 0f 0b 90 0f b6 74 24 43 31 ff 41 bc ea ff ff ff
    RSP: 0018:ffffc9000414fb48 EFLAGS: 00010283
    RAX: 00000000000012a1 RBX: ffffffff8e240ae0 RCX: ffffc90014b78000
    RDX: 0000000000080000 RSI: ffffffff81bbd78b RDI: 0000000000000001
    RBP: 0000000000000000 R08: 0000000000000001 R09: 0000000000000000
    R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffffffffef
    R13: 0000000000000000 R14: dffffc0000000000 R15: ffffffff81c264f0
    FS:  00007f27217f66c0(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
    CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000001b2e80dff8 CR3: 00000000268f8000 CR4: 00000000003526f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
     <TASK>
     tracepoint_probe_register_prio+0xc0/0x110 kernel/tracepoint.c:464
     register_trace_prio_sched_switch include/trace/events/sched.h:222 [inline]
     register_pid_events kernel/trace/trace_events.c:2354 [inline]
     event_pid_write.isra.0+0x439/0x7a0 kernel/trace/trace_events.c:2425
     vfs_write+0x24c/0x1150 fs/read_write.c:677
     ksys_write+0x12b/0x250 fs/read_write.c:731
     do_syscall_x64 arch/x86/entry/common.c:52 [inline]
     do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
     entry_SYSCALL_64_after_hwframe+0x77/0x7f
    
    We can reproduce the warning by following the steps below:
    1. echo 8 >> set_event_notrace_pid. Let tr->filtered_pids owns one pid
       and register sched_switch tracepoint.
    2. echo ' ' >> set_event_pid, and perform fault injection during chunk
       allocation of trace_pid_list_alloc. Let pid_list with no pid and
    assign to tr->filtered_pids.
    3. echo ' ' >> set_event_pid. Let pid_list is NULL and assign to
       tr->filtered_pids.
    4. echo 9 >> set_event_pid, will trigger the double register
       sched_switch tracepoint warning.
    
    The reason is that syzkaller injects a fault into the chunk allocation
    in trace_pid_list_alloc, causing a failure in trace_pid_list_set, which
    may trigger double register of the same tracepoint. This only occurs
    when the system is about to crash, but to suppress this warning, let's
    add failure handling logic to trace_pid_list_set.
    
    Link: https://lore.kernel.org/20250908024658.2390398-1-pulehui@huaweicloud.com
    Fixes: 8d6e90983ade ("tracing: Create a sparse bitmask for pid filtering")
    Reported-by: syzbot+161412ccaeff20ce4dde@syzkaller.appspotmail.com
    Closes: https://lore.kernel.org/all/67cb890e.050a0220.d8275.022e.GAE@google.com
    Signed-off-by: Pu Lehui <pulehui@huawei.com>
    Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
tty: hvc_console: Call hvc_kick in hvc_write unconditionally [+ + +]
Author: Fabian Vogt <fvogt@suse.de>
Date:   Fri Aug 15 13:33:28 2025 +0200

    tty: hvc_console: Call hvc_kick in hvc_write unconditionally
    
    commit cfd956dcb101aa3d25bac321fae923323a47c607 upstream.
    
    After hvc_write completes, call hvc_kick also in the case the output
    buffer has been drained, to ensure tty_wakeup gets called.
    
    This fixes that functions which wait for a drained buffer got stuck
    occasionally.
    
    Cc: stable <stable@kernel.org>
    Closes: https://bugzilla.opensuse.org/show_bug.cgi?id=1230062
    Signed-off-by: Fabian Vogt <fvogt@suse.de>
    Link: https://lore.kernel.org/r/2011735.PYKUYFuaPT@fvogt-thinkpad
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
tunnels: reset the GSO metadata before reusing the skb [+ + +]
Author: Antoine Tenart <atenart@kernel.org>
Date:   Thu Sep 4 14:53:50 2025 +0200

    tunnels: reset the GSO metadata before reusing the skb
    
    [ Upstream commit e3c674db356c4303804b2415e7c2b11776cdd8c3 ]
    
    If a GSO skb is sent through a Geneve tunnel and if Geneve options are
    added, the split GSO skb might not fit in the MTU anymore and an ICMP
    frag needed packet can be generated. In such case the ICMP packet might
    go through the segmentation logic (and dropped) later if it reaches a
    path were the GSO status is checked and segmentation is required.
    
    This is especially true when an OvS bridge is used with a Geneve tunnel
    attached to it. The following set of actions could lead to the ICMP
    packet being wrongfully segmented:
    
    1. An skb is constructed by the TCP layer (e.g. gso_type SKB_GSO_TCPV4,
       segs >= 2).
    
    2. The skb hits the OvS bridge where Geneve options are added by an OvS
       action before being sent through the tunnel.
    
    3. When the skb is xmited in the tunnel, the split skb does not fit
       anymore in the MTU and iptunnel_pmtud_build_icmp is called to
       generate an ICMP fragmentation needed packet. This is done by reusing
       the original (GSO!) skb. The GSO metadata is not cleared.
    
    4. The ICMP packet being sent back hits the OvS bridge again and because
       skb_is_gso returns true, it goes through queue_gso_packets...
    
    5. ...where __skb_gso_segment is called. The skb is then dropped.
    
    6. Note that in the above example on re-transmission the skb won't be a
       GSO one as it would be segmented (len > MSS) and the ICMP packet
       should go through.
    
    Fix this by resetting the GSO information before reusing an skb in
    iptunnel_pmtud_build_icmp and iptunnel_pmtud_build_icmpv6.
    
    Fixes: 4cb47a8644cc ("tunnels: PMTU discovery support for directly bridged IP packets")
    Reported-by: Adrian Moreno <amorenoz@redhat.com>
    Signed-off-by: Antoine Tenart <atenart@kernel.org>
    Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
    Link: https://patch.msgid.link/20250904125351.159740-1-atenart@kernel.org
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

 
USB: gadget: dummy-hcd: Fix locking bug in RT-enabled kernels [+ + +]
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Mon Aug 25 12:00:22 2025 -0400

    USB: gadget: dummy-hcd: Fix locking bug in RT-enabled kernels
    
    commit 8d63c83d8eb922f6c316320f50c82fa88d099bea upstream.
    
    Yunseong Kim and the syzbot fuzzer both reported a problem in
    RT-enabled kernels caused by the way dummy-hcd mixes interrupt
    management and spin-locking.  The pattern was:
    
            local_irq_save(flags);
            spin_lock(&dum->lock);
            ...
            spin_unlock(&dum->lock);
            ...             // calls usb_gadget_giveback_request()
            local_irq_restore(flags);
    
    The code was written this way because usb_gadget_giveback_request()
    needs to be called with interrupts disabled and the private lock not
    held.
    
    While this pattern works fine in non-RT kernels, it's not good when RT
    is enabled.  RT kernels handle spinlocks much like mutexes; in particular,
    spin_lock() may sleep.  But sleeping is not allowed while local
    interrupts are disabled.
    
    To fix the problem, rewrite the code to conform to the pattern used
    elsewhere in dummy-hcd and other UDC drivers:
    
            spin_lock_irqsave(&dum->lock, flags);
            ...
            spin_unlock(&dum->lock);
            usb_gadget_giveback_request(...);
            spin_lock(&dum->lock);
            ...
            spin_unlock_irqrestore(&dum->lock, flags);
    
    This approach satisfies the RT requirements.
    
    Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
    Cc: stable <stable@kernel.org>
    Fixes: b4dbda1a22d2 ("USB: dummy-hcd: disable interrupts during req->complete")
    Reported-by: Yunseong Kim <ysk@kzalloc.com>
    Closes: <https://lore.kernel.org/linux-usb/5b337389-73b9-4ee4-a83e-7e82bf5af87a@kzalloc.com/>
    Reported-by: syzbot+8baacc4139f12fa77909@syzkaller.appspotmail.com
    Closes: <https://lore.kernel.org/linux-usb/68ac2411.050a0220.37038e.0087.GAE@google.com/>
    Tested-by: syzbot+8baacc4139f12fa77909@syzkaller.appspotmail.com
    CC: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    CC: stable@vger.kernel.org
    Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Link: https://lore.kernel.org/r/bb192ae2-4eee-48ee-981f-3efdbbd0d8f0@rowland.harvard.edu
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
usb: gadget: midi2: Fix MIDI2 IN EP max packet size [+ + +]
Author: Takashi Iwai <tiwai@suse.de>
Date:   Fri Sep 5 15:32:34 2025 +0200

    usb: gadget: midi2: Fix MIDI2 IN EP max packet size
    
    commit 116e79c679a1530cf833d0ff3007061d7a716bd9 upstream.
    
    The EP-IN of MIDI2 (altset 1) wasn't initialized in
    f_midi2_create_usb_configs() as it's an INT EP unlike others BULK
    EPs.  But this leaves rather the max packet size unchanged no matter
    which speed is used, resulting in the very slow access.
    And the wMaxPacketSize values set there look legit for INT EPs, so
    let's initialize the MIDI2 EP-IN there for achieving the equivalent
    speed as well.
    
    Fixes: 8b645922b223 ("usb: gadget: Add support for USB MIDI 2.0 function driver")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Link: https://lore.kernel.org/r/20250905133240.20966-1-tiwai@suse.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

usb: gadget: midi2: Fix missing UMP group attributes initialization [+ + +]
Author: Takashi Iwai <tiwai@suse.de>
Date:   Thu Sep 4 17:39:24 2025 +0200

    usb: gadget: midi2: Fix missing UMP group attributes initialization
    
    commit 21d8525d2e061cde034277d518411b02eac764e2 upstream.
    
    The gadget card driver forgot to call snd_ump_update_group_attrs()
    after adding FBs, and this leaves the UMP group attributes
    uninitialized.  As a result, -ENODEV error is returned at opening a
    legacy rawmidi device as an inactive group.
    
    This patch adds the missing call to address the behavior above.
    
    Fixes: 8b645922b223 ("usb: gadget: Add support for USB MIDI 2.0 function driver")
    Cc: stable <stable@kernel.org>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Link: https://lore.kernel.org/r/20250904153932.13589-1-tiwai@suse.de
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
USB: serial: option: add Telit Cinterion FN990A w/audio compositions [+ + +]
Author: Fabio Porcedda <fabio.porcedda@gmail.com>
Date:   Wed Aug 6 14:09:26 2025 +0200

    USB: serial: option: add Telit Cinterion FN990A w/audio compositions
    
    commit cba70aff623b104085ab5613fedd21f6ea19095a upstream.
    
    Add the following Telit Cinterion FN990A w/audio compositions:
    
    0x1077: tty (diag) + adb + rmnet + audio + tty (AT/NMEA) + tty (AT) +
    tty (AT) + tty (AT)
    T:  Bus=01 Lev=01 Prnt=01 Port=09 Cnt=01 Dev#=  8 Spd=480 MxCh= 0
    D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=1077 Rev=05.04
    S:  Manufacturer=Telit Wireless Solutions
    S:  Product=FN990
    S:  SerialNumber=67e04c35
    C:  #Ifs=10 Cfg#= 1 Atr=e0 MxPwr=500mA
    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=(none)
    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=50 Driver=qmi_wwan
    E:  Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
    E:  Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 3 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=20 Driver=snd-usb-audio
    I:  If#= 4 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
    E:  Ad=03(O) Atr=0d(Isoc) MxPS=  68 Ivl=1ms
    I:  If#= 5 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
    E:  Ad=84(I) Atr=0d(Isoc) MxPS=  68 Ivl=1ms
    I:  If#= 6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 7 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=88(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 8 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8a(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 9 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8c(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    
    0x1078: tty (diag) + adb + MBIM + audio + tty (AT/NMEA) + tty (AT) +
    tty (AT) + tty (AT)
    T:  Bus=01 Lev=01 Prnt=01 Port=09 Cnt=01 Dev#= 21 Spd=480 MxCh= 0
    D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=1078 Rev=05.04
    S:  Manufacturer=Telit Wireless Solutions
    S:  Product=FN990
    S:  SerialNumber=67e04c35
    C:  #Ifs=11 Cfg#= 1 Atr=e0 MxPwr=500mA
    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=(none)
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#=10 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8c(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 2 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
    E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=32ms
    I:  If#= 3 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
    E:  Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 4 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=20 Driver=snd-usb-audio
    I:  If#= 5 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
    I:  If#= 6 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
    E:  Ad=84(I) Atr=0d(Isoc) MxPS=  68 Ivl=1ms
    I:  If#= 7 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 8 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=88(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 9 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8a(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    
    0x1079: RNDIS + tty (diag) + adb + audio + tty (AT/NMEA) + tty (AT) +
    tty (AT) + tty (AT)
    T:  Bus=01 Lev=01 Prnt=01 Port=09 Cnt=01 Dev#= 23 Spd=480 MxCh= 0
    D:  Ver= 2.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=1079 Rev=05.04
    S:  Manufacturer=Telit Wireless Solutions
    S:  Product=FN990
    S:  SerialNumber=67e04c35
    C:  #Ifs=11 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 1 Cls=ef(misc ) Sub=04 Prot=01 Driver=rndis_host
    E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=32ms
    I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
    E:  Ad=0f(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8e(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#=10 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=07(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8b(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8c(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 2 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=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 4 Alt= 0 #EPs= 0 Cls=01(audio) Sub=01 Prot=20 Driver=snd-usb-audio
    I:  If#= 5 Alt= 0 #EPs= 0 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
    I:  If#= 6 Alt= 1 #EPs= 1 Cls=01(audio) Sub=02 Prot=20 Driver=snd-usb-audio
    E:  Ad=84(I) Atr=0d(Isoc) MxPS=  68 Ivl=1ms
    I:  If#= 7 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 8 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=88(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    I:  If#= 9 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=option
    E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=89(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=8a(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: serial: option: add Telit Cinterion LE910C4-WWX new compositions [+ + +]
Author: Fabio Porcedda <fabio.porcedda@gmail.com>
Date:   Fri Aug 22 11:08:39 2025 +0200

    USB: serial: option: add Telit Cinterion LE910C4-WWX new compositions
    
    commit a5a261bea9bf8444300d1067b4a73bedee5b5227 upstream.
    
    Add the following Telit Cinterion LE910C4-WWX new compositions:
    
    0x1034: tty (AT) + tty (AT) + rmnet
    T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  8 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=1034 Rev=00.00
    S:  Manufacturer=Telit
    S:  Product=LE910C4-WWX
    S:  SerialNumber=93f617e7
    C:  #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    0x1036: tty (AT) + tty (AT)
    T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 10 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=1036 Rev=00.00
    S:  Manufacturer=Telit
    S:  Product=LE910C4-WWX
    S:  SerialNumber=93f617e7
    C:  #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    0x1037: tty (diag) + tty (Telit custom) + tty (AT) + tty (AT) + rmnet
    T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 15 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=1037 Rev=00.00
    S:  Manufacturer=Telit
    S:  Product=LE910C4-WWX
    S:  SerialNumber=93f617e7
    C:  #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA
    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=ff Prot=ff Driver=option
    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=ff Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
    E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=87(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    0x1038: tty (Telit custom) + tty (AT) + tty (AT) + rmnet
    T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  9 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=1038 Rev=00.00
    S:  Manufacturer=Telit
    S:  Product=LE910C4-WWX
    S:  SerialNumber=93f617e7
    C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff 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= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=86(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    0x103b: tty (diag) + tty (Telit custom) + tty (AT) + tty (AT)
    T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 10 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=103b Rev=00.00
    S:  Manufacturer=Telit
    S:  Product=LE910C4-WWX
    S:  SerialNumber=93f617e7
    C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA
    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=ff Prot=ff Driver=option
    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=ff Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option
    E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=85(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    0x103c: tty (Telit custom) + tty (AT) + tty (AT)
    T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 11 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
    P:  Vendor=1bc7 ProdID=103c Rev=00.00
    S:  Manufacturer=Telit
    S:  Product=LE910C4-WWX
    S:  SerialNumber=93f617e7
    C:  #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff 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= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
    E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=fe Prot=ff Driver=option
    E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
    E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
    Signed-off-by: Johan Hovold <johan@kernel.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
usb: typec: tcpm: properly deliver cable vdms to altmode drivers [+ + +]
Author: RD Babiera <rdbabiera@google.com>
Date:   Thu Aug 21 20:37:57 2025 +0000

    usb: typec: tcpm: properly deliver cable vdms to altmode drivers
    
    commit f34bfcc77b18375a87091c289c2eb53c249787b4 upstream.
    
    tcpm_handle_vdm_request delivers messages to the partner altmode or the
    cable altmode depending on the SVDM response type, which is incorrect.
    The partner or cable should be chosen based on the received message type
    instead.
    
    Also add this filter to ADEV_NOTIFY_USB_AND_QUEUE_VDM, which is used when
    the Enter Mode command is responded to by a NAK on SOP or SOP' and when
    the Exit Mode command is responded to by an ACK on SOP.
    
    Fixes: 7e7877c55eb1 ("usb: typec: tcpm: add alt mode enter/exit/vdm support for sop'")
    Cc: stable@vger.kernel.org
    Signed-off-by: RD Babiera <rdbabiera@google.com>
    Reviewed-by: Badhri Jagan Sridharan <badhri@google.com>
    Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
    Link: https://lore.kernel.org/r/20250821203759.1720841-2-rdbabiera@google.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
wifi: ath12k: add link support for multi-link in arsta [+ + +]
Author: Sarika Sharma <quic_sarishar@quicinc.com>
Date:   Tue Jul 1 16:29:24 2025 +0530

    wifi: ath12k: add link support for multi-link in arsta
    
    [ Upstream commit 3b8aa249d0fce93590888a6ed3d22b458091ecb9 ]
    
    Currently, statistics in arsta are updated at deflink for both non-ML
    and multi-link(ML) station. Link statistics are not updated for
    multi-link operation(MLO).
    
    Hence, add support to correctly obtain the link ID if the peer is ML,
    fetch the arsta from the appropriate link ID, and update the
    statistics in the corresponding arsta.
    
    Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
    
    Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com>
    Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
    Link: https://patch.msgid.link/20250701105927.803342-3-quic_sarishar@quicinc.com
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Stable-dep-of: 82e2be57d544 ("wifi: ath12k: fix WMI TLV header misalignment")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: ath12k: Add support to enqueue management frame at MLD level [+ + +]
Author: Sriram R <quic_srirrama@quicinc.com>
Date:   Fri Jul 11 14:47:04 2025 +0530

    wifi: ath12k: Add support to enqueue management frame at MLD level
    
    [ Upstream commit 9d2abd4162fca8a1eb46f664268dffad35c8ad20 ]
    
    A multi-link client can use any link for transmissions. It can decide to
    put one link in power save mode for longer periods while listening on the
    other links as per MLD listen interval. Unicast management frames sent to
    that link station might get dropped if that link station is in power save
    mode or inactive. In such cases, firmware can take decision on which link
    to use.
    
    Allow the firmware to decide on which link management frame should be
    sent on, by filling the hardware link with maximum value of u32, so that
    the firmware will not have a specific link to transmit data on and so
    the management frames will be link agnostic. For QCN devices, all action
    frames are marked as link agnostic. For WCN devices, if the device is
    configured as an AP, then all frames other than probe response frames,
    authentication frames, association response frames, re-association response
    frames and ADDBA response frames are marked as link agnostic and if the
    device is configured as a station, then all frames other than probe request
    frames, authentication frames, de-authentication frames and ADDBA response
    frames are marked as link agnostic.
    
    Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
    Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
    
    Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
    Co-developed-by: Roopni Devanathan <quic_rdevanat@quicinc.com>
    Signed-off-by: Roopni Devanathan <quic_rdevanat@quicinc.com>
    Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
    Link: https://patch.msgid.link/20250711091704.3704379-1-quic_rdevanat@quicinc.com
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Stable-dep-of: 82e2be57d544 ("wifi: ath12k: fix WMI TLV header misalignment")
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: ath12k: Fix missing station power save configuration [+ + +]
Author: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
Date:   Mon Sep 8 09:50:25 2025 +0800

    wifi: ath12k: Fix missing station power save configuration
    
    [ Upstream commit 4b66d18918f8e4d85e51974a9e3ce9abad5c7c3d ]
    
    Commit afbab6e4e88d ("wifi: ath12k: modify ath12k_mac_op_bss_info_changed()
    for MLO") replaced the bss_info_changed() callback with vif_cfg_changed()
    and link_info_changed() to support Multi-Link Operation (MLO). As a result,
    the station power save configuration is no longer correctly applied in
    ath12k_mac_bss_info_changed().
    
    Move the handling of 'BSS_CHANGED_PS' into ath12k_mac_op_vif_cfg_changed()
    to align with the updated callback structure introduced for MLO, ensuring
    proper power-save behavior for station interfaces.
    
    Tested-on: WCN7850 hw2.0 PCI WLAN.IOE_HMT.1.1-00011-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1
    
    Fixes: afbab6e4e88d ("wifi: ath12k: modify ath12k_mac_op_bss_info_changed() for MLO")
    Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
    Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
    Link: https://patch.msgid.link/20250908015025.1301398-1-miaoqing.pan@oss.qualcomm.com
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: ath12k: fix WMI TLV header misalignment [+ + +]
Author: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
Date:   Mon Sep 8 09:51:39 2025 +0800

    wifi: ath12k: fix WMI TLV header misalignment
    
    [ Upstream commit 82e2be57d544ff9ad4696c85600827b39be8ce9e ]
    
    When buf_len is not 4-byte aligned in ath12k_wmi_mgmt_send(), the
    firmware asserts and triggers a recovery. The following error
    messages are observed:
    
    ath12k_pci 0004:01:00.0: failed to submit WMI_MGMT_TX_SEND_CMDID cmd
    ath12k_pci 0004:01:00.0: failed to send mgmt frame: -108
    ath12k_pci 0004:01:00.0: failed to tx mgmt frame, vdev_id 0 :-108
    ath12k_pci 0004:01:00.0: waiting recovery start...
    
    This issue was observed when running 'iw wlanx set power_save off/on'
    in MLO station mode, which triggers the sending of an SMPS action frame
    with a length of 27 bytes to the AP. To resolve the misalignment, use
    buf_len_aligned instead of buf_len when constructing the WMI TLV header.
    
    Tested-on: WCN7850 hw2.0 PCI WLAN.IOE_HMT.1.1-00011-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1
    
    Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices")
    Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
    Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
    Link: https://patch.msgid.link/20250908015139.1301437-1-miaoqing.pan@oss.qualcomm.com
    Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

wifi: iwlwifi: fix 130/1030 configs [+ + +]
Author: Johannes Berg <johannes.berg@intel.com>
Date:   Tue Sep 9 12:17:34 2025 +0300

    wifi: iwlwifi: fix 130/1030 configs
    
    commit 2682e7a317504a9d81cbb397249d4299e84dfadd upstream.
    
    The 130/1030 devices are really derivatives of 6030,
    with some small differences not pertaining to the MAC,
    so they must use the 6030 MAC config.
    
    Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220472
    Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220517
    Fixes: 35ac275ebe0c ("wifi: iwlwifi: cfg: finish config split")
    Cc: stable@vger.kernel.org
    Signed-off-by: Johannes Berg <johannes.berg@intel.com>
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Link: https://patch.msgid.link/20250909121728.8e4911f12528.I3aa7194012a4b584fbd5ddaa3a77e483280f1de4@changeid
    Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
x86/cpu/topology: Always try cpu_parse_topology_ext() on AMD/Hygon [+ + +]
Author: K Prateek Nayak <kprateek.nayak@amd.com>
Date:   Mon Sep 1 17:04:15 2025 +0000

    x86/cpu/topology: Always try cpu_parse_topology_ext() on AMD/Hygon
    
    commit cba4262a19afae21665ee242b3404bcede5a94d7 upstream.
    
    Support for parsing the topology on AMD/Hygon processors using CPUID leaf 0xb
    was added in
    
      3986a0a805e6 ("x86/CPU/AMD: Derive CPU topology from CPUID function 0xB when available").
    
    In an effort to keep all the topology parsing bits in one place, this commit
    also introduced a pseudo dependency on the TOPOEXT feature to parse the CPUID
    leaf 0xb.
    
    The TOPOEXT feature (CPUID 0x80000001 ECX[22]) advertises the support for
    Cache Properties leaf 0x8000001d and the CPUID leaf 0x8000001e EAX for
    "Extended APIC ID" however support for 0xb was introduced alongside the x2APIC
    support not only on AMD [1], but also historically on x86 [2].
    
    Similar to 0xb, the support for extended CPU topology leaf 0x80000026 too does
    not depend on the TOPOEXT feature.
    
    The support for these leaves is expected to be confirmed by ensuring
    
      leaf <= {extended_}cpuid_level
    
    and then parsing the level 0 of the respective leaf to confirm EBX[15:0]
    (LogProcAtThisLevel) is non-zero as stated in the definition of
    "CPUID_Fn0000000B_EAX_x00 [Extended Topology Enumeration]
    (Core::X86::Cpuid::ExtTopEnumEax0)" in Processor Programming Reference (PPR)
    for AMD Family 19h Model 01h Rev B1 Vol1 [3] Sec. 2.1.15.1 "CPUID Instruction
    Functions".
    
    This has not been a problem on baremetal platforms since support for TOPOEXT
    (Fam 0x15 and later) predates the support for CPUID leaf 0xb (Fam 0x17[Zen2]
    and later), however, for AMD guests on QEMU, the "x2apic" feature can be
    enabled independent of the "topoext" feature where QEMU expects topology and
    the initial APICID to be parsed using the CPUID leaf 0xb (especially when
    number of cores > 255) which is populated independent of the "topoext" feature
    flag.
    
    Unconditionally call cpu_parse_topology_ext() on AMD and Hygon processors to
    first parse the topology using the XTOPOLOGY leaves (0x80000026 / 0xb) before
    using the TOPOEXT leaf (0x8000001e).
    
    While at it, break down the single large comment in parse_topology_amd() to
    better highlight the purpose of each CPUID leaf.
    
    Fixes: 3986a0a805e6 ("x86/CPU/AMD: Derive CPU topology from CPUID function 0xB when available")
    Suggested-by: Naveen N Rao (AMD) <naveen@kernel.org>
    Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
    Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
    Cc: stable@vger.kernel.org # Only v6.9 and above; depends on x86 topology rewrite
    Link: https://lore.kernel.org/lkml/1529686927-7665-1-git-send-email-suravee.suthikulpanit@amd.com/ [1]
    Link: https://lore.kernel.org/lkml/20080818181435.523309000@linux-os.sc.intel.com/ [2]
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=206537 [3]
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
xhci: dbc: decouple endpoint allocation from initialization [+ + +]
Author: Mathias Nyman <mathias.nyman@linux.intel.com>
Date:   Tue Sep 2 13:53:04 2025 +0300

    xhci: dbc: decouple endpoint allocation from initialization
    
    commit 220a0ffde02f962c13bc752b01aa570b8c65a37b upstream.
    
    Decouple allocation of endpoint ring buffer from initialization
    of the buffer, and initialization of endpoint context parts from
    from the rest of the contexts.
    
    It allows driver to clear up and reinitialize endpoint rings
    after disconnect without reallocating everything.
    
    This is a prerequisite for the next patch that prevents the transfer
    ring from filling up with cancelled (no-op) TRBs if a debug cable is
    reconnected several times without transferring anything.
    
    Cc: stable@vger.kernel.org
    Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver")
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Link: https://lore.kernel.org/r/20250902105306.877476-2-mathias.nyman@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xhci: dbc: Fix full DbC transfer ring after several reconnects [+ + +]
Author: Mathias Nyman <mathias.nyman@linux.intel.com>
Date:   Tue Sep 2 13:53:05 2025 +0300

    xhci: dbc: Fix full DbC transfer ring after several reconnects
    
    commit a5c98e8b1398534ae1feb6e95e2d3ee5215538ed upstream.
    
    Pending requests will be flushed on disconnect, and the corresponding
    TRBs will be turned into No-op TRBs, which are ignored by the xHC
    controller once it starts processing the ring.
    
    If the USB debug cable repeatedly disconnects before ring is started
    then the ring will eventually be filled with No-op TRBs.
    No new transfers can be queued when the ring is full, and driver will
    print the following error message:
    
        "xhci_hcd 0000:00:14.0: failed to queue trbs"
    
    This is a normal case for 'in' transfers where TRBs are always enqueued
    in advance, ready to take on incoming data. If no data arrives, and
    device is disconnected, then ring dequeue will remain at beginning of
    the ring while enqueue points to first free TRB after last cancelled
    No-op TRB.
    s
    Solve this by reinitializing the rings when the debug cable disconnects
    and DbC is leaving the configured state.
    Clear the whole ring buffer and set enqueue and dequeue to the beginning
    of ring, and set cycle bit to its initial state.
    
    Cc: stable@vger.kernel.org
    Fixes: dfba2174dc42 ("usb: xhci: Add DbC support in xHCI driver")
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Link: https://lore.kernel.org/r/20250902105306.877476-3-mathias.nyman@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

xhci: fix memory leak regression when freeing xhci vdev devices depth first [+ + +]
Author: Mathias Nyman <mathias.nyman@linux.intel.com>
Date:   Tue Sep 2 13:53:06 2025 +0300

    xhci: fix memory leak regression when freeing xhci vdev devices depth first
    
    commit edcbe06453ddfde21f6aa763f7cab655f26133cc upstream.
    
    Suspend-resume cycle test revealed a memory leak in 6.17-rc3
    
    Turns out the slot_id race fix changes accidentally ends up calling
    xhci_free_virt_device() with an incorrect vdev parameter.
    The vdev variable was reused for temporary purposes right before calling
    xhci_free_virt_device().
    
    Fix this by passing the correct vdev parameter.
    
    The slot_id race fix that caused this regression was targeted for stable,
    so this needs to be applied there as well.
    
    Fixes: 2eb03376151b ("usb: xhci: Fix slot_id resource race conflict")
    Reported-by: David Wang <00107082@163.com>
    Closes: https://lore.kernel.org/linux-usb/20250829181354.4450-1-00107082@163.com
    Suggested-by: Michal Pecio <michal.pecio@gmail.com>
    Suggested-by: David Wang <00107082@163.com>
    Cc: stable@vger.kernel.org
    Tested-by: David Wang <00107082@163.com>
    Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
    Link: https://lore.kernel.org/r/20250902105306.877476-4-mathias.nyman@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

 
xsk: Fix immature cq descriptor production [+ + +]
Author: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Date:   Thu Sep 4 21:49:07 2025 +0200

    xsk: Fix immature cq descriptor production
    
    [ Upstream commit 30f241fcf52aaaef7ac16e66530faa11be78a865 ]
    
    Eryk reported an issue that I have put under Closes: tag, related to
    umem addrs being prematurely produced onto pool's completion queue.
    Let us make the skb's destructor responsible for producing all addrs
    that given skb used.
    
    Commit from fixes tag introduced the buggy behavior, it was not broken
    from day 1, but rather when xsk multi-buffer got introduced.
    
    In order to mitigate performance impact as much as possible, mimic the
    linear and frag parts within skb by storing the first address from XSK
    descriptor at sk_buff::destructor_arg. For fragments, store them at ::cb
    via list. The nodes that will go onto list will be allocated via
    kmem_cache. xsk_destruct_skb() will consume address stored at
    ::destructor_arg and optionally go through list from ::cb, if count of
    descriptors associated with this particular skb is bigger than 1.
    
    Previous approach where whole array for storing UMEM addresses from XSK
    descriptors was pre-allocated during first fragment processing yielded
    too big performance regression for 64b traffic. In current approach
    impact is much reduced on my tests and for jumbo frames I observed
    traffic being slower by at most 9%.
    
    Magnus suggested to have this way of processing special cased for
    XDP_SHARED_UMEM, so we would identify this during bind and set different
    hooks for 'backpressure mechanism' on CQ and for skb destructor, but
    given that results looked promising on my side I decided to have a
    single data path for XSK generic Tx. I suppose other auxiliary stuff
    would have to land as well in order to make it work.
    
    Fixes: b7f72a30e9ac ("xsk: introduce wrappers and helpers for supporting multi-buffer in Tx path")
    Reported-by: Eryk Kubanski <e.kubanski@partner.samsung.com>
    Closes: https://lore.kernel.org/netdev/20250530103456.53564-1-e.kubanski@partner.samsung.com/
    Acked-by: Stanislav Fomichev <sdf@fomichev.me>
    Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
    Tested-by: Jason Xing <kerneljasonxing@gmail.com>
    Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>
    Link: https://lore.kernel.org/r/20250904194907.2342177-1-maciej.fijalkowski@intel.com
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>