commit 5c986616994475d0e5f56f22dfddd2fadcd2c07b Author: Greg Kroah-Hartman Date: Sun Dec 6 09:19:17 2026 +0900 Linux 7.3.8 Link: https://lore.kernel.org/r/20261204100635.034361255@linuxfoundation.org Tested-by: Ronald Warsow Tested-by: SJ Park Tested-by: Miguel Ojeda Tested-by: Justin M. Forbes Tested-by: Brett A C Sheffield Tested-by: Peter Schneider Tested-by: Benjamin Boortz Tested-by: Ron Economos Tested-by: Joungmin Lee Tested-by: Shuah Khan Signed-off-by: Greg Kroah-Hartman commit 1fd43cb096f3f9ce1e3e5e25ff2c991f3f2c7c17 Author: Mani Tofigh Date: Mon Nov 23 12:21:34 2026 -0500 mm/shmem: don't drop a folio whose swap write failed commit e3464357e282d164ce873bfb4e259996cea3a564 upstream. shmem_swapin_folio() drops a large folio that does not fit the mapping from the swap cache if the folio is neither dirty nor under writeback. The folio can belong to another file and be under swap writeback, when the swap entry was freed and reused before the swap cache lookup. Swap write completion does not take the folio lock. On a failed write, swap_write_end() marks the folio dirty and then ends writeback. Since dirty is tested first, the folio can look clean and written: CPU0 (swapin of file Y) CPU1 (swapout of file X) ----------------------- ------------------------ shmem_swapin_folio() folio_test_dirty() == false swap_write_end(), failed write folio_mark_dirty() folio_end_writeback() folio_test_writeback() == false swap_cache_del_folio() /* X's data is lost */ The next swapin of X reads the slot whose write failed. Test writeback first. Both flags are in folio->flags. If the writeback test sees the write ended, the dirty test then sees the dirty bit set before it. With the fix, a folio whose swap write failed stays in the swap cache. Fixes: fc2c19648d68 ("mm/shmem: fix swapin livelock on a mismatched large swap cache folio") Suggested-by: Chris Mason Cc: stable@vger.kernel.org Signed-off-by: Mani Tofigh Reviewed-by: Nhat Pham Reviewed-by: Baolin Wang Link: https://patch.msgid.link/20261123-shmem-swap-write-failed-v1-1-41a0115dfbf1@columbia.edu Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit 7dfe6731453ed7e135842b83347c1a6e2e1ec5d3 Author: Ruben Wauters Date: Tue Nov 17 14:17:51 2026 +0000 drm/gud: fix potential divide error due to optimisation commit cbea6bdc930b2de974e77e6c3031f67796793625 upstream. Compilers can potentially optmise the read of gdrm->stats_actual_length to two separate reads. As flagged by sashiko, when the rect is flushed the stats_actual_length can reset to zero. If this was to occur between the two reads, the divide error can still be triggered (albeit rarely). Fix this by adding a READ_ONCE around the gdrm->stats_actual_length Fixes: 431c2dffd2b7 ("drm/gud: avoid divide error in gud_stats_debugfs") Cc: Reviewed-by: Thomas Zimmermann Link: https://patch.msgid.link/20261117141943.10540-1-ruben.wauters@linux.dev Signed-off-by: Ruben Wauters Signed-off-by: Greg Kroah-Hartman commit ff88209edcf98af7cf02d7b65025f81729961ad9 Author: Umang Pokhriyal Date: Thu Dec 3 23:52:49 2026 -0500 userfaultfd: validate the whole range before changing write protection [ Upstream commit 28ae0385b638f095109d282b927ac1a51f75c530 ] mwriteprotect_range() checks each VMA as it walks the range. When a later VMA is not registered for write protection, or is a hugetlb VMA the range is not aligned to, the call fails after the earlier VMAs were already changed. When unprotecting, userfaultfd_writeprotect() then skips wake_userfault(), so threads blocked on those pages are not woken although the pages are writable again. An unprivileged process can trigger this with a range that spans an unregistered VMA. It hasn't been seen in practice; it was found while reviewing the userfaultfd range ioctls with an LLM. Validate the whole range first, as mrwprotect_range() already does. Link: https://lore.kernel.org/20261104093457.152245-1-umangpokhriyall@gmail.com Fixes: a1b92a3f1498 ("mm/userfaultfd: support WP on multiple VMAs") Signed-off-by: Umang Pokhriyal Signed-off-by: Andrew Morton Reviewed-by: Mike Rapoport (Microsoft) Cc: Peter Xu Cc: David Hildenbrand Cc: Lorenzo Stoakes Cc: Liam R. Howlett Cc: Vlastimil Babka Cc: Suren Baghdasaryan Cc: Michal Hocko Cc: [ sashal: Replaced vma_is_hugetlb() with is_vm_hugetlb_page() in the new validation loop of mwriteprotect_range(), since the former helper does not exist in this tree. ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit d1a6257dd7167991a3457009419b95e77b68c70b Author: Muchun Song Date: Thu Dec 3 23:28:08 2026 -0500 riscv/mm: fix hotplug page-table destructor handling [ Upstream commit 352fca06aa692848a9b95f43740b4939f495ca4b ] RISC-V uses the same memory-hotplug teardown code for linear-map and vmemmap page tables. Late linear-map allocations run page-table constructors, while vmemmap and early allocations may not. free_pte_table() unconditionally calls pagetable_dtor(), corrupting NR_PAGETABLE accounting for constructor-free tables. free_pmd_table() avoids that for vmemmap using is_vmemmap, but mapping type is not a reliable proxy for constructor state. In particular, it becomes invalid once runtime vmemmap tables use the normal pgalloc helpers. Introduce free_pgtable_page() to select free_reserved_page() for reserved pages and pagetable_free() otherwise. The latter runs the destructor only when PageTable() is set, handling both constructor-backed and constructor-free tables. Link: https://lore.kernel.org/20261023063428.3658761-3-songmuchun@bytedance.com Fixes: c75a74f4ba19 ("riscv: mm: Add memory hotplugging support") Signed-off-by: Muchun Song Signed-off-by: Andrew Morton Reviewed-by: Björn Töpel Reviewed-by: Kevin Brodsky Acked-by: David Hildenbrand (Arm) Cc: Oscar Salvador Cc: Dave Hansen Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Alexandre Ghiti Cc: Björn Töpel Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Alexander Gordeev Cc: Alistair Popple Cc: Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit 335f827343ce42ef619693e0a76482d0f54426ac Author: Jisheng Zhang Date: Thu Dec 3 23:28:07 2026 -0500 riscv: convert pgtable_l4|l5_enabled to inline function [ Upstream commit 79113093e9dc3330a05cfd9b9bca1294bc8d2fa8 ] This is the preparation of optimizing pgtable_l4|l5_enabled(). No functionality change. Signed-off-by: Jisheng Zhang Link: https://patch.msgid.link/20261008150045.28905-3-jszhang@kernel.org Signed-off-by: Paul Walmsley Stable-dep-of: 352fca06aa69 ("riscv/mm: fix hotplug page-table destructor handling") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit 3fdd20c047683c46683163b7b5af0d4177a2918c Author: Zihan Xi Date: Thu Dec 3 22:43:13 2026 -0500 ipvs: avoid stack overflow from recursive connection expiration [ Upstream commit d4e4cd04de2c47ed05f837a26edd20c56be3f097 ] When a controlled IPVS connection expires, its controller may be expired synchronously if it has no remaining controlled connections. A chain of controlled connections can then recurse through ip_vs_conn_expire() and exhaust the kernel stack during namespace cleanup. Continue expiration with the controller after the current connection has been fully cleaned up instead of calling ip_vs_conn_del() recursively. Keep the expiration walk under RCU, preserve the immediate-drop timeout for a controller with its own controller, and switch to deletion mode before the next iteration. This keeps controlled-connection cleanup synchronous while using one stack frame for the whole chain. The timer callback race during connection deletion is handled by the preceding connection-deletion fix. This patch depends on "ipvs: fix problems during connection deletion" to protect the iterative controller cleanup from the timer callback race. Fixes: f9200a52eedf ("ipvs: avoid expiring many connections from timer") Cc: stable@vger.kernel.org Reported-by: Vega Co-developed-by: Luxing Yin Signed-off-by: Luxing Yin Signed-off-by: Zihan Xi Signed-off-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit 485c027641e45ab1aecee9ec55d1b09950aacb77 Author: Julian Anastasov Date: Thu Dec 3 22:43:12 2026 -0500 ipvs: fix problems during connection deletion [ Upstream commit 5ae07c10854f7ac38da02e8313a59dfcfeb44a61 ] Sashiko reports for problem when deleting connections. If connection timer expires, its callback can not be concurrently running but if connection is deleted the callback can be running on another CPU even after all references are released. Before now we continued with the connection freeing, risking the callback to access the deleted connection after it is freed. As ip_vs_conn_del() runs under RCU lock there is no risk for accessing a connection freed by concurrent timer callback. As Sashiko warns, the risk is present if normal connection expires and tries to delete its cp->control chain with ip_vs_conn_del_put() without holding a RCU read lock. It is evident that as the pending timer and the running timer callback do not hold reference for the connection, there are races which is difficult to avoid. Change the connection refcounting as follows: * the connection hashing does not take reference anymore * new connection handoffs its reference to the timer if started in __ip_vs_conn_put_timer(), to hold it while it is pending. * if user finds connection in hash table it gets reference and can handoff this reference to the pending timer if this timer is started in __ip_vs_conn_put_timer(), otherwise puts its reference if the timer was already pending which is the common case. * the pending timer handoffs its reference to the running timer callback implicitly. By this way, the timer callback in the common case has the last reference. In rare cases, while the timer callback is running and before it changes refcnt from 1 to 0, other users can get reference and to handoff it again to the pending timer they arm. In this case, the expiration is deferred for later time. As result, cp->refcnt accounts all current connection users and the pending and running timer. Two paths can try to delete the connection: the normal expiration path and ip_vs_conn_del() if it successfully steals the connection reference from the pending timer. refcount_dec_if_one() will tell us if we were the last active user with no packets accessing the connection and no pending/running timers. Change ip_vs_conn_unlink() to directly unhash the connection because when we are the last user the connection's forwarding method can not change. Use smp_acquire__after_ctrl_dep() after refcount_dec_if_one() and before reading the connection fields. ip_vs_conn_expire() does not need to call timer_delete() anymore because the pending timer is already accounted in refcnt. Add explicit rcu_read_lock() while deleting the cp->control chain to protect from concurrent timer callback for ct to expire it before us and to cause use-after-free. During such races, try to keep 0 in cp->timeout as it is a request for deleting our cp->control chain immediately. Make sure we do not send timeout 0 (seconds) in the v1 sync message because the backup server will select some large default value which is not desired for small timeouts. Remove the smp_mb__before_atomic() call from __ip_vs_conn_put(), it is from the atomic_dec() era, now refcount_dec() has RELEASE semantics. Link: https://sashiko.dev/#/patchset/cover.1789435989.git.zihanx%40nebusec.ai Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1790266803.git.zihanx%40nebusec.ai Fixes: f9200a52eedf ("ipvs: avoid expiring many connections from timer") Signed-off-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Stable-dep-of: d4e4cd04de2c ("ipvs: avoid stack overflow from recursive connection expiration") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit 10b7761d35d8a28253e62b704699728058d2c3ec Author: Günther Noack Date: Thu Dec 3 22:33:50 2026 -0500 landlock: Fix layer composition of LANDLOCK_ACCESS_FS_REFER [ Upstream commit 0ad8ea7fa7dc0f0d0e45f7ed4933d5433dac4291 ] In landlock_get_fs_access_mask(), only add the LANDLOCK_ACCESS_FS_REFER right if any filesystem access rights are handled at all. This prevents us from accidentally treating non-filesystem layers as if they handled LANDLOCK_ACCESS_FS_REFER. landlock_get_fs_access_mask() is used when initializing the layer masks for doing access right checks, so this bug meant that we unintentionally denied "refer" (e.g., link, rename) operations in layered cases, where the same operation would have been accepted if only either one of the two layers had been enforced. If the rulesets individually allow an operation, the composition of these rulesets should also allow it. The bug only manifests as soon as one other layer handles filesystem access rights. Otherwise, Landlock filesystem path walk is guarded by an early exit for the case that no filesystem-enforcing layer exists. Reported-by: Dwi Siswanto Closes: https://github.com/landlock-lsm/linux/issues/67 Closes: https://github.com/landlock-lsm/go-landlock/issues/66 Fixes: fff69fb03dde ("landlock: Support network rules with TCP bind and connect") Cc: stable@vger.kernel.org Signed-off-by: Günther Noack Link: https://patch.msgid.link/20261113-b4-landlock-refer-nonfs-layer-v3-1-02d7e42bcdfd@gmail.com Signed-off-by: Mickaël Salaün Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit f21469889071e6903f323b577649d2a308212e5e Author: Mickaël Salaün Date: Thu Dec 3 22:33:49 2026 -0500 landlock: Wrap per-layer access masks in struct layer_config [ Upstream commit 68ba67106a3c7529672b7f2189916442a1ee09b5 ] The domain layer FAM stores struct access_masks values directly, while a ruleset stores the equivalent single mutable value. Per-category permissions need additional per-layer data beyond the handled-access bitfields. Introduce struct layer_config as the common value type. Keeping the handled bitfields in its .handled member leaves struct access_masks as a lightweight parameter type for functions that only need those bitfields, while the complete layer can be snapshotted with one assignment. At this point struct layer_config only wraps the four-byte access_masks, so it does not grow the per-domain allocation: the maximum 16-entry FAM remains 64 bytes. No functional change. Cc: Günther Noack Reviewed-by: Günther Noack Reviewed-by: Tingmao Wang Link: https://patch.msgid.link/20261014082718.1435842-3-mic@digikod.net Signed-off-by: Mickaël Salaün Stable-dep-of: 0ad8ea7fa7dc ("landlock: Fix layer composition of LANDLOCK_ACCESS_FS_REFER") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit a7cd7650d10dae35d4aeace96caaeddfb037effe Author: Aleksandr Loktionov Date: Thu Dec 3 22:16:13 2026 -0500 i40e: avoid resetting BQL state when freeing temporary Tx rings in set_ringparam [ Upstream commit e3916fa03f4d300be91468a7b7a608d38b6b3277 ] Temporary Tx rings built by i40e_set_ringparam() while resizing descriptor counts are shallow struct copies of the live vsi->tx_rings[] entries, so they retain the same ring->netdev and ring->queue_index as the live ring they are staged to replace. If an error path frees one of these clones with i40e_free_tx_resources() before i40e_down() has run - either the i40e_setup_tx_descriptors() failure unwind loop, or the free_tx: error label - i40e_clean_tx_ring() will call netdev_tx_reset_queue() on txring_txq(tx_ring), which resolves to the *same* netdev_queue as the live ring because netdev/queue_index alias. That call resets the queue's BQL/dql state (dql_reset(): num_queued = num_completed = 0) while the live ring is still actively transmitting and completing Tx on that same queue. The next time the live ring reports completions for bytes that were queued before the reset, dql_completed() can underflow its own sanity check and hit: BUG_ON(count > num_queued - dql->num_completed); i.e. a guaranteed kernel panic, not just a warning, given a queue with outstanding (queued but not yet completed) Tx traffic at the moment the clone is freed. Reproduced on real hardware by forcing i40e_setup_tx_descriptors() to fail partway through building tx_rings[] while flooding real Tx traffic on the affected queues: kernel BUG at lib/dynamic_queue_limits.c:99! RIP: 0010:dql_completed+0x285/0x2a0 Call Trace: i40e_napi_poll+0x74b/0x1700 [i40e] __napi_poll+0x10a/0x200 net_rx_action+0x2f7/0x380 handle_softirqs+0xcc/0x270 Confirmed the same trigger no longer panics with this fix applied, including repeated resize/traffic cycles. Clear the clone ring netdev before freeing it in both error paths, so i40e_clean_tx_ring()'s existing `if (!tx_ring->netdev) return;` guard skips the netdev_tx_reset_queue() call for the clone. This mirrors the same idiom i40e already uses for XDP Tx rings, which also have no netdev_queue of their own (ring->netdev = NULL in i40e_vsi_setup_tx()). Only the temporary, about-to-be-freed clone is touched; the live ring in vsi->tx_rings[] keeps its netdev. Fixes: 9f65e15b4f98 ("i40e: Move rings from pointer to array to array of pointers") Cc: stable@vger.kernel.org Signed-off-by: Aleksandr Loktionov Tested-by: Alexander Nowlin Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113004602.129864-4-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit 7b9a7bad39837f7f46e1f6b6c2b974ed4e2dc682 Author: Filip Balluch Date: Thu Dec 3 22:16:12 2026 -0500 i40e: fix freeing of TX rings on RX allocation failure [ Upstream commit 4957f668681a2e1e2dab4731d75a2c53c6017319 ] When ethtool -G is used to change ring buffer sizes while the interface is up, i40e_set_ringparam() allocates temporary TX and RX rings. If the RX ring allocation fails, the error path at the free_tx label incorrectly calls i40e_free_tx_resources(vsi->tx_rings[i]), freeing the live TX rings instead of the temporary tx_rings[i]. Since the interface is still up, the next TX completion interrupt causes i40e_clean_tx_irq() to dereference the freed ring descriptors, resulting in a NULL pointer dereference in IRQ context and a kernel panic. This can be reproduced on systems with Intel X710 NICs under memory pressure, where the second port's DMA allocation fails after the first port succeeds. Fix by freeing the temporary tx_rings[i] in the error path instead of the live vsi->tx_rings[i]. Fixes: 74608d17fe29 ("i40e: add support for XDP_TX action") Signed-off-by: Filip Balluch Reviewed-by: Aleksandr Loktionov Tested-by: Alexander Nowlin Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113004602.129864-3-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Stable-dep-of: e3916fa03f4d ("i40e: avoid resetting BQL state when freeing temporary Tx rings in set_ringparam") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit d857014e8660fafcffd77a1ebf553ed040e5ec80 Author: Guenter Roeck Date: Thu Dec 3 22:13:45 2026 -0500 hwmon: (nct6775) Fix target temp and tolerance for NCT6106/6116/6126 [ Upstream commit 73d857b33cdfaf35f8d3f833b36745d91c18db13 ] In nct6775_probe(), the nct6106, nct6116, and nct6126 chip cases leave target_temp_mask, tolerance_mask, and speed_tolerance_limit zero-initialized. As a result, reading pwm*_target_temp from sysfs always returns 0, writing to pwm*_target_temp, pwm*_temp_tolerance, pwm*_crit_temp_tolerance, or fan*_tolerance clamps user-supplied values to 0, and pwm_update_registers() fails to clear existing tolerance bits in REG_FAN_MODE when updating fan control modes. Initialize target_temp_mask to 0xff, tolerance_mask to 0x07, and speed_tolerance_limit to 63 for NCT6106, NCT6116, and NCT6126, matching the hardware register layout shared with NCT5525 and NCT6776+. Fixes: 6c009501ff20 ("hwmon: (nct6775) Add support for NCT6102D/6106D") Fixes: 29c7cb485b32 ("hwmon: (nct6775) Integrate new model nct6116") Fixes: 437b3c2a4bdc ("hwmon: (nct6775) Add support for NCT6126D") Cc: stable@vger.kernel.org Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-76f191d0-4c79-4982-887e-e5c9a2ed7136 Cc: Anton Lundin Signed-off-by: Guenter Roeck [ sashal: Applied the three target_temp/tolerance assignments to the nct6106 and nct6116 cases only, dropping the nct6126 hunk because this tree has no nct6126 support. ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit d36dcfdfa1852a04e068be81b877780f554b9268 Author: Chen, Junjia Date: Thu Dec 3 22:06:45 2026 -0500 drm/xe: Unwrap sync fences before adding them as job dependencies [ Upstream commit e2cdad51ec53dd0f48e7f767cc1390dec69d54d4 ] A timeline syncobj point is a dma_fence_chain node that carries its own fence context, separate from the contexts of the fences it wraps. xe_sync_entry_add_deps() passed that container straight to drm_sched_job_add_dependency(). drm_sched_entity_add_dependency_cb() only drops a dependency when the fence context is one of the entity's own (fence_context or fence_context + 1). A chain node never matches, so a wait on a point whose inner fence is the finished fence of an earlier job on the same exec queue is treated like a cross-queue dependency: the job is held until the previous job has completed on the GPU. Every job queued behind it waits too, and the ring drains before the next batch of jobs is released. Unwrap the fence with dma_fence_unwrap_for_each() and add each unsignaled underlying fence as a dependency, so drm_sched sees the real fence contexts and ignores same-entity fences. Dependencies on other exec queues still wait for completion. drm_sched_job_add_dependency() keeps only the latest fence per context, so the dependency array does not grow with the length of the chain. Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Cc: stable@vger.kernel.org Signed-off-by: Chen, Junjia Reviewed-by: Matthew Brost Signed-off-by: Matthew Brost Link: https://lore.kernel.org/intel-xe/20261028161358.1917359-1-junjia.chen@intel.com/ (cherry picked from commit 3b8860fe2581a8db796150728687ba1c6b78ddab) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit 58f99485576649f4f22053e9c8ae4c6bfe3af1b1 Author: Petr Pavlu Date: Thu Dec 3 22:06:44 2026 -0500 drm/xe: Include error-injection.h for ALLOW_ERROR_INJECTION() [ Upstream commit 291a8fe5d999c3937b9403c70badf847ec336b3a ] Several drivers/gpu/drm/xe/*.c files use ALLOW_ERROR_INJECTION(), which is defined in asm-generic/error-injection.h. They currently rely on this header being included indirectly through linux/module.h -> linux/error-injection.h. Add the missing includes in preparation for removing the linux/error-injection.h include from linux/module.h. Remove also the linux/fault-injection.h include, which commit 91b2c42c214f ("drm/xe: Use fault injection infrastructure to find issues at probe time") mistakenly used to provide the definition of ALLOW_ERROR_INJECTION(). Reviewed-by: Francois Dugast Signed-off-by: Petr Pavlu Stable-dep-of: e2cdad51ec53 ("drm/xe: Unwrap sync fences before adding them as job dependencies") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit 199e15c533b5af453eb035adc640249dd8a018a8 Author: Maíra Canal Date: Thu Dec 3 20:47:44 2026 -0500 drm/vc4: Rebuild the V3D interrupt mask on every power transition [ Upstream commit 83dd19480c105c8bf96c93fb18b2ea554b44445d ] The out-of-memory interrupt is armed once, by bin_bo_alloc(), when the binner BO is allocated. vc4_irq_disable() masks it on the way down, vc4_irq_enable() brings back only the render bits, and bin_bo_alloc() does not run again for a binner BO that is still referenced. An overflow after an autosuspend therefore raises nothing and the binner stalls, until the hangcheck resets the GPU and arms the interrupt again. Therefore, derive the out-of-memory bit in vc4_irq_enable() from whether a binner BO exists, which is the condition bin_bo_alloc() was standing in for. While here, clear the complement of the wanted mask while enabling. V3D_INTENA and V3D_INTDIS are set/clear registers and the driver only ever set bits, so a source left enabled will stay enabled and can reach vc4_irq(), which returns IRQ_NONE for anything outside the three bits it handles. Cc: stable@vger.kernel.org Fixes: 35c8b4b2c0fe ("drm/vc4: Allocate binner bo when starting to use the V3D") Reviewed-by: Iago Toral Quiroga Link: https://patch.msgid.link/20261111-vc4-irq-cleanup-v2-2-aa757bb742f2@igalia.com Signed-off-by: Maíra Canal [ sashal: Adjusted context for a differently worded comment above the V3D_INTENA write in vc4_irq_reset(); the resulting code is identical to upstream. ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit 3433293a705fd166aeaa6554719d8149969c1873 Author: Jing Zhou Date: Thu Dec 3 20:11:19 2026 -0500 drm/amd/display: Seed boot clocks to avoid lowering pre-OS display clocks [ Upstream commit eaf4ff850d97eb608482fa3497f1b89b2e628781 ] [WHY] USB4 DPIA HPD can arrive early in boot, before the first stream commit. Its link detection runs prepare_phy_clocks(), which goes through clk_mgr_exit_optimized_pwr_state() and clk_mgr_optimize_pwr_state() and calls update_clocks(dc->current_state). At that point both dc->current_state->bw_ctx.bw.dcn.clk and clk_mgr->clks are still zero, because init_clocks() memsets them. On the safe_to_lower path, dcn42_update_clocks() clamps the requested DPPCLK to the 100MHz floor and programs it. This drops DPPCLK below what the GOP-lit eDP pipe needs, and the panel flashes white. [HOW] 1. In dcn42_init_clocks() and dcn42b_init_clocks(), seed clk_mgr->clks dispclk/dppclk from the boot snapshot(10kHz units, x10). 2. Add a DC core helper, sync_current_state_clocks_from_clk_mgr(). After every hwss.init_hw() call (legacy_hardware_init, D0 entry in dc_set_power_state, and dc_reinitialize_hardware), it copies clk_mgr->clks into dc->current_state->bw_ctx.bw.dcn.clk for DCN. A later update_clocks() before the first commit then sees the real pre-OS clocks and does not lower them. Raising clocks is still allowed and does not cause a flash. Cc: Nicholas Kazlauskas Cc: Charlene Liu Cc: Mario Limonciello Cc: Alex Deucher Reviewed-by: ChiaHsuan Chung Signed-off-by: Jing Zhou Signed-off-by: Wayne Lin Tested-by: Dan Wheeler Signed-off-by: Alex Deucher (cherry picked from commit 2f289740a04f08a5ce4b5e3c69af6e32ab4a540e) Cc: stable@vger.kernel.org [ sashal: Renamed legacy_hardware_init() to dc_hardware_init() in the dc.c hunk context and function header, since this tree already uses the new name. ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit 57ca2dd0879e8cf13cc91822d8ab207d8058092a Author: Hengyu Liang Date: Thu Dec 3 17:17:21 2026 -0500 fuse: preserve ENOTCONN after failed initialization and disconnect [ Upstream commit 2eb2329f9ce7f29f227656cc2686fe6f1879d11c ] Commit 794e811d1443 ("fuse: split out filesystem part of request sending") moved the INIT failure check into fuse_req_prep(), before the channel checks whether it is still connected. If a daemon closes /dev/fuse before replying to INIT, aborting the channel completes INIT with an error. stat() and open() on the mount then return ECONNREFUSED instead of the previous ENOTCONN. The same change occurs when INIT is rejected before the daemon closes the fd. Record INIT failure in the channel before publishing initialized, and check it in fuse_get_req() after waiting for initialization and checking for disconnection. This preserves ECONNREFUSED for failed INIT while the device remains open, and restores ENOTCONN after disconnection. Set the failure flag only while the channel is connected, since abort also marks it initialized to wake waiters after a successful INIT. Fixes: 794e811d1443 ("fuse: split out filesystem part of request sending") Cc: stable@vger.kernel.org Signed-off-by: Hengyu Liang Signed-off-by: Miklos Szeredi [ sashal: adapted the context for the non-const struct mnt_idmap *idmap parameter type in fs/fuse/req.c when removing fuse_req_prep(); the rest matches upstream. ] Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman commit 1b5732ac09f41966b2599d908778f8d843f510b3 Author: Adrian Ambrozewicz Date: Tue Nov 24 11:20:33 2026 +0200 gpiolib: free the label of lines released after their chip was removed [ Upstream commit 4bc5e234e10866ebaad01ce11ed08f64333dcac0 ] gpiod_free_commit() drops the consumer label only while the chip is still there. A line that user space keeps requested across gpiochip_remove() is released when gdev->chip is already NULL, and its label leaks: unreferenced object (size 32): comm "gpio-hold" backtrace (crc 7ff222d9): desc_set_label gpiod_request_commit gpiod_request linereq_create gpio_ioctl Clear the label before the chip check. The ->free() callback, the flags update and the line state notification need the chip and stay under it. Reproduced with gpio-sim: request a line, set the chip's "live" attribute to 0, then close the request. kmemleak reports up to 30 such objects after 30 cycles; with this change, none after 100. Fixes: 35b545332b80 ("gpio: remove gpio_lock") Cc: stable@vger.kernel.org Reviewed-by: Andy Shevchenko Signed-off-by: Adrian Ambrozewicz Link: https://patch.msgid.link/20261124-gpiolib-chip-removal-v8-2-aambrozewicz@nvidia.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 19354da37c739a8672197aada3294bbdaf16854b Author: Adrian Ambrozewicz Date: Tue Nov 24 11:20:32 2026 +0200 gpiolib: wait for pending label frees before cleaning up desc_srcu [ Upstream commit c901e8fddd3a23353bb12c9d93b9a5fc482ac8f5 ] desc_set_label() frees the old label with call_srcu() on gdev->desc_srcu, and gpiodev_release() calls synchronize_srcu() before cleanup_srcu_struct(). synchronize_srcu() waits for a grace period, not for queued callbacks. Once the srcu_struct uses per-CPU callback lists, a label freed by gpiochip_free_hogs() can still be pending, and cleanup_srcu_struct() warns: WARNING: kernel/rcu/srcutree.c:706 at cleanup_srcu_struct+0x239/0x330, CPU#0: init/1 Call Trace: gpiodev_release device_release kobject_put devres_release_all device_release_driver_internal platform_device_unregister gpio_sim_device_deactivate Use srcu_barrier(), which waits for them. Reproduced with a hogged gpio-sim line, setting the chip live and back on a 4-CPU guest with srcutree.convert_to_big=1: it warns within 60 cycles; with this change, 1000 cycles pass. Fixes: a86d27693066 ("gpiolib: fix the speed of descriptor label setting with SRCU") Cc: stable@vger.kernel.org Reviewed-by: Paul E. McKenney Reviewed-by: Andy Shevchenko Tested-by: Yi Lai Signed-off-by: Adrian Ambrozewicz Link: https://patch.msgid.link/20261124-gpiolib-chip-removal-v8-1-aambrozewicz@nvidia.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit b7436e71f7ccdef4a74f8d3ac1fcb3ea817fd879 Author: Bartosz Golaszewski Date: Tue Nov 10 14:47:04 2026 +0100 gpiolib: don't overwrite the entire flags field in gpiod_free_commit() [ Upstream commit 63d7aedf6add8a24415af4c010588f63fa7296ab ] Use set_mask_bits() to clear all request-related flags in one go instead of risking racing with concurrent users and overwriting any changes they could have done between READ_ONCE() and WRITE_ONCE(). Cc: stable@vger.kernel.org Fixes: 35b545332b80 ("gpio: remove gpio_lock") Reviewed-by: Kent Gibson Link: https://patch.msgid.link/20261110-gpio-desc-flags-atomic-v3-4-2f463bce8086@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 3136cf59d9ab5c37b7626298262f75e4241d8107 Author: Bartosz Golaszewski Date: Tue Nov 10 14:47:03 2026 +0100 gpiolib: clear debounce period before the "requested" flag [ Upstream commit 8509d643ffb7be508568c696c9fe45eb1f84c33c ] The debounce_period_us field is protected by the GPIOD_FLAG_REQUESTED flag, so it should be cleared before the flag, else it could potentially race with a new request. Suggested-by: Kent Gibson Closes: https://lore.kernel.org/all/20261105042905.GB8436@rigel/ Fixes: 81625f362497 ("gpio: cdev: go back to storing debounce period in the GPIO descriptor") Reviewed-by: Kent Gibson Link: https://patch.msgid.link/20261110-gpio-desc-flags-atomic-v3-3-2f463bce8086@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 0179bce5ba084152be9e97bef6517a903d9e47ed Author: Cooper Morgan Date: Wed Dec 2 14:11:47 2026 -0800 drm/amd/display: Saturate refresh rates in v1/v2 FreeSync infopackets commit 76850a457474a629dc0ceffaafb3aed78ff5f469 upstream. The v1 and v2 FreeSync infopackets carry the minimum and maximum refresh rate in one byte each, and build_vrr_infopacket_data_v1() casts the rate in Hz to unsigned char. On a sink whose range goes above 255 Hz the value wraps: a 320 Hz mode is advertised as a 64 Hz maximum. Sinks that treat the field as authoritative misbehave once the wrapped value lands inside their range. An MSI MAG 271QPX32 (48-320 Hz) over native DP looks like a ~720p image upscaled to the full screen at 320 Hz and runs its self-test pattern at 305-315 Hz, while 300 Hz (wrapping to 44 Hz, below its minimum) is fine. Capping the EDID range at 255 Hz, so the packet says 255, gives a correct picture at 320 Hz. Saturate the fields at 255 Hz instead of wrapping. Capping v1 at 255 as a fallback was suggested by oystersuki in the linked issue. Fixes: 98e6436d3af5 ("drm/amd/display: Refactor FreeSync module") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/5988 Reviewed-by: Harry Wentland Signed-off-by: Cooper Morgan Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher (cherry picked from commit 8f91c13d9a14085216725f60b55546fce5c2dd19) Cc: stable@vger.kernel.org (cherry picked from commit 76850a457474a629dc0ceffaafb3aed78ff5f469) [ Cooper: Dropped the KUnit test hunks, since 7.3.y's amdgpu_dm_freesync_test.c predates the tests they extend. The freesync.c change is unchanged. ] Signed-off-by: Cooper Morgan Signed-off-by: Sasha Levin commit e8cda3ff1cea289a684be26f3c0efebe2c0d0fa4 Author: Martin Belanger Date: Wed Dec 2 10:56:03 2026 -0500 nvme-tcp: consume TLS records without application data commit 687e743e4089b2a854982b321cb2d681ae5d6136 upstream. A peer may send a TLS record without application data at any time after the handshake: a NewSessionTicket, a KeyUpdate or an alert. tls_sw_read_sock() cannot pass such a record to nvme_tcp_recv_skb(). It returns -EINVAL and leaves the record at the head of the receive queue. nvme_tcp_try_recv() then starts error recovery, and the controller reconnects. TLS 1.3 allows a server to send a NewSessionTicket at any time after the handshake (RFC 8446, section 4.6.1). Alerts can also arrive at any time. On -EINVAL, read the record with recvmsg(), which reports the record type. Discard handshake messages other than KeyUpdate. Log alerts, and fail the queue on a fatal alert. Fail the queue on a KeyUpdate, which nvme-tcp cannot answer, and on any other record type. recvmsg() takes the socket lock, so release it around the read. Handle these records in one helper, also for the records that arrive ahead of the ICResp. A warning alert ahead of the ICResp no longer fails the connection. On a poll queue, nvme_tcp_poll() and nvme_tcp_io_work() can both see the record while the socket lock is released. A queue flag makes sure that only one of them reads it. svc_tcp_recvfrom() in sunrpc handles -EINVAL from read_sock() the same way. Fixes: be8e82caa685 ("nvme-tcp: enable TLS handshake upcall") Cc: stable@vger.kernel.org Signed-off-by: Martin Belanger Reviewed-by: Hannes Reinecke Signed-off-by: Keith Busch Signed-off-by: Martin Belanger Signed-off-by: Sasha Levin commit 14f08f062966d3deadde08e548d0ef4f17392a8a Author: Martin Belanger Date: Wed Dec 2 10:56:02 2026 -0500 nvme-tcp: move the TLS record read loop into a helper commit 76afef5e29221e68f9a19df767f94b092c31e974 upstream. Move the read loop out of nvme_tcp_skip_tls_record() into a new helper, nvme_tcp_drain_tls_record(). The next patch uses the helper to read TLS records that arrive on a live queue. No functional change. Cc: stable@vger.kernel.org Signed-off-by: Martin Belanger Reviewed-by: Hannes Reinecke Signed-off-by: Keith Busch Signed-off-by: Martin Belanger Signed-off-by: Sasha Levin commit ffca1cb9cef1b4621c2ca330b7d34b8fe67f37dd Author: Martin Belanger Date: Wed Dec 2 10:56:01 2026 -0500 nvme-tcp: use an aligned buffer for the TLS record type commit 1193566c35ead643e954ff8356bb54b1cd78378a upstream. The buffers that receive the TLS record type are char arrays. put_cmsg() and tls_get_record_type() access them as struct cmsghdr, which needs a stricter alignment than a char array has. Use a union with struct cmsghdr, sized with CMSG_SPACE(), as svc_tcp_recv_cmsg() and xs_tls_read_record() in sunrpc do. Fixes: 2837966ab2a8 ("nvme-tcp: control message handling for recvmsg()") Cc: stable@vger.kernel.org Signed-off-by: Martin Belanger Reviewed-by: Hannes Reinecke Signed-off-by: Keith Busch [ Martin: resolved a context conflict next to nvme_tcp_cpu_queues ] Signed-off-by: Martin Belanger Signed-off-by: Sasha Levin commit 0c6d023d7c801857db61b417330212ed65dc73dc Author: Miguel Ojeda Date: Wed Dec 2 17:25:04 2026 +0100 x86/rust: use `-Zindirect-branch-cs-prefix` for RETPOLINE builds commit 1eaa31fa41125db78a50abef7f0a35aa22af40d0 upstream. The C compiler is asked to add a `cs` prefix to the `call` and `jmp` instructions that go through the indirect thunks for the `r8`-`r15` registers, which makes them 6 bytes long instead of 5. That gives `patch_retpoline()` enough room to inline them, e.g. as `lfence; call *%r11` for `spectre_v2=retpoline,lfence`. However, Rust code does not get the prefix, e.g. for a `CONFIG_MITIGATION_RETPOLINE=y` build: $ objdump -dr rust/kernel.o ... e2b: e8 00 00 00 00 call e30 <...> e2c: R_X86_64_PLT32 __x86_indirect_thunk_r11-0x4 Moreover, since commit 4a1e02b15ac1 ("x86,retpoline: Optimize patch_retpoline()"), `emit_indirect()` assumes there is enough room for the inlined sequence -- e.g. with `spectre_v2=retpoline,lfence`, the kernel warns and dies while patching a site inside `core`: WARNING: arch/x86/kernel/alternative.c:736 at apply_retpolines+0x2ee/0x400, CPU#0: swapper/0/0 ... Call Trace: ? _RNvMs6_NtNtCshS2CUL9MEDn_4core3fmt8buildersNtB5_9DebugList21finish_non_exhaustive+0x5b/0xd0 ... alternative_instructions+0x1d/0x60 arch_cpu_finalize_init+0x5a/0xb0 start_kernel+0x1f4/0x280 Similarly, paranoid FineIBT rewrites each kCFI call site into a fixed 20-byte sequence, i.e. the 14 bytes of the kCFI check plus a 6-byte call. For a 5-byte call, that overwrites the first byte of the next instruction, corrupting Rust code: SMP alternatives: Using paranoid FineIBT CFI ... Oops: double fault: 0000 [#1] ... RIP: 0010:_RNvNtCsdVypMZsLRAh_4core3fmt5write+0x1e9/0x210 Code: ... b8 68 81 16 9f 41 3b 43 f5 2e 4d 8d 5b f0 75 fd 41 ff e3 c0 eb 02 b0 01 ... ... Kernel panic - not syncing: Fatal exception in interrupt Non-paranoid FineIBT is not affected, since it only rewrites the kCFI check and leaves the call itself to `apply_retpolines()`. We added support for `-Zindirect-branch-cs-prefix` [1][2] in Rust 1.91.0 [3]. Thus pass it for `RETPOLINE` builds when possible, which makes all sites indeed get the prefix: e3c: 2e e8 00 00 00 00 cs call e42 <...> e3e: R_X86_64_PLT32 __x86_indirect_thunk_r11-0x4 The kernel above boots fine with `spectre_v2=retpoline,lfence`, inlining the Rust sites as well. For older Rust compilers, set the LLVM module flag instead, which has the same code-generation effect. This means that every Rust version that the kernel supports gets the prefix, that the kernel boots fine with `spectre_v2=retpoline,lfence`, and that paranoid FineIBT no longer corrupts. In addition, add it to our target modifier workaround for `rustdoc`. Cc: stable@vger.kernel.org # 6.18.y+ Link: https://github.com/rust-lang/rust/issues/116852 [1] Link: https://github.com/rust-lang/compiler-team/issues/899 [2] Link: https://github.com/rust-lang/rust/pull/140740 [3] Reported-by: Kent Overstreet Acked-by: Borislav Petkov Link: https://patch.msgid.link/20261018175457.87803-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda Signed-off-by: Sasha Levin commit d3fb99546e1c7032a60b07ef43a628daa8d72017 Author: Gyeyoung Baek Date: Wed Dec 2 23:31:07 2026 +0900 accel/rocket: Fix drm_mm UAF on close vs in-flight job commit c3fe8795ecd844d0bf76102217bec01cce01b715 upstream. The drm_mm and its mutex live in rocket_file_priv, which rocket_postclose() frees on fd close. But a BO held by an in-flight job is only freed after close, from the drm_sched free_job worker, and its destructor then accesses the already freed drm_mm and mutex. BUG: KASAN: slab-use-after-free in __mutex_trylock_common+0x90/0x1e8 Workqueue: .npu drm_sched_free_job_work [gpu_sched] Call trace: __mutex_lock rocket_gem_bo_free rocket_job_cleanup rocket_job_free drm_sched_free_job_work [gpu_sched] Move drm_mm and the mutex out of rocket_file_priv into the kref-managed rocket_iommu_domain (renamed to rocket_vm). Their lifetime now matches the vm's: as long as a BO or job references the vm, the address-space state stays alive. Fixes: 658ebeac3351 ("accel/rocket: Add IOCTL for BO creation") Cc: stable@vger.kernel.org Signed-off-by: Gyeyoung Baek Reviewed-by: Tomeu Vizoso [tomeu: Rebased on the BO creation error path fix] [tomeu: Fixes points at the commit that added the drm_mm to rocket_file_priv] Signed-off-by: Tomeu Vizoso Link: https://patch.msgid.link/20261101073700.1261966-1-gye976@gmail.com Signed-off-by: Gyeyoung Baek Signed-off-by: Sasha Levin commit 0495a29d896562d73094c0235fbb4446c4292ce7 Author: Guangshuo Li Date: Wed Dec 2 23:31:06 2026 +0900 accel/rocket: put IOMMU domain on BO creation failure commit 90035d3f26e011e16fcf9c5071571f0d956b5219 upstream. rocket_ioctl_create_bo() takes an IOMMU domain reference for each newly created BO. The normal GEM object release path drops that reference from rocket_gem_bo_free(). However, the BO creation error paths free the object with drm_gem_shmem_object_free(), which bypasses the driver's GEM .free callback. Those paths therefore release the shmem object without dropping the IOMMU domain reference. Drop the domain reference explicitly on the BO creation error path before freeing the shmem object. Fixes: 658ebeac3351 ("accel/rocket: Add IOCTL for BO creation") Signed-off-by: Guangshuo Li Reviewed-by: Tomeu Vizoso Signed-off-by: Tomeu Vizoso Link: https://patch.msgid.link/20260708114354.753817-1-lgs201920130244@gmail.com Signed-off-by: Gyeyoung Baek Signed-off-by: Sasha Levin commit 3d86b74d6396e8af86241af22fb678c3ea7f2f2b Author: Donggeun Yoo Date: Sat Oct 3 19:30:29 2026 +0900 userfaultfd: clear the inherited uffd bit in move_swap_pte() commit 50abb4245e1ecdd679aef504543bdbc055dc9247 upstream. UFFDIO_MOVE on a swapped-out page installs the source PTE at the destination unchanged, so a uffd bit set on a write-protected or RWP-protected source lands in a destination VMA that was never registered for either. Nothing clears it there, and userspace sees: - /proc//pagemap reports the page as uffd-tracked (bit 57), both while it is swapped out and after it is faulted back in. - MADV_COLLAPSE fails with EINVAL on a range containing it, because the collapse scan bails on a swap entry with the uffd bit set. - With CONFIG_PAGE_TABLE_CHECK, faulting the page in warns. do_swap_page() carries the bit into the present PTE and, since the destination isn't WP-registered, also makes it writable: WARNING: mm/page_table_check.c:202 at __page_table_check_ptes_set+0x185/0x1e0 Call Trace: set_ptes+0x67/0xc0 do_swap_page+0x990/0xfe0 __handle_mm_fault+0x7d0/0xeb0 handle_mm_fault+0x9c/0x250 do_user_addr_fault+0x207/0x650 exc_page_fault+0x65/0x150 asm_exc_page_fault+0x26/0x30 Reaching it takes UFFDIO_MOVE out of a WP- or RWP-protected area into one that isn't, on a page that is swapped out at the time. It hasn't been seen in practice. A resident page doesn't carry the bit, because move_present_ptes() builds the destination PTE from dst_vma->vm_page_prot. Clear it on the moved swap entry as well, then re-arm it if the destination is RWP-registered. The WP case has been there since v6.8, where UFFDIO_MOVE was added. Link: https://lore.kernel.org/20261003103030.63380-1-donggeunyoo.kernel@gmail.com Link: https://lore.kernel.org/20261003103030.63380-2-donggeunyoo.kernel@gmail.com Fixes: adef440691ba ("userfaultfd: UFFDIO_MOVE uABI") Signed-off-by: Donggeun Yoo Signed-off-by: Andrew Morton Acked-by: David Hildenbrand (Arm) Acked-by: Mike Rapoport (Microsoft) Assisted-by: LLM Cc: Peter Xu Cc: Suren Baghdasaryan Cc: Andrea Arcangeli Cc: Lorenzo Stoakes Cc: Liam R. Howlett Cc: Vlastimil Babka Cc: Michal Hocko Cc: Shuah Khan Cc: Kiryl Shutsemau Cc: Signed-off-by: Greg Kroah-Hartman mm/userfaultfd.c | 1 + 1 file changed, 1 insertion(+) commit f1880d435f6f9c0c588d0c2afd3fdccd6ab9c776 Author: Shuai Liu <847807867@qq.com> Date: Thu Nov 19 13:08:14 2026 +0800 xfrm: interface: drop non-IP packets before pskb_inet_may_pull() commit e509726660dd06ce107437aecf7c106c9d3fc1e7 upstream. AF_XDP sockets bound to an xfrm interface submit skbs with skb->protocol unset (0) and skb->network_header still 0 from the __alloc_skb() zero-initialization; skb_reserve() only moves data NET_SKB_PAD bytes into the headroom. Since commit 86de3a1118a16 ("xfrm: interface: validate the IP header on xmit"), xfrmi_xmit() calls pskb_inet_may_pull() unconditionally. For such a skb, pskb_inet_may_pull_reason() selects nhlen = 0 for the unknown protocol and pskb_may_pull_reason() receives len = skb_network_offset(skb) = network_header - data = -64, which as unsigned int exceeds INT_MAX and trips the DEBUG_NET_WARN_ON_ONCE(len > INT_MAX) in pskb_may_pull_reason(): WARNING: ./include/linux/skbuff.h:2856 at pskb_may_pull_reason [inline] WARNING: ./include/linux/skbuff.h:3286 at pskb_network_may_pull_reason [inline] WARNING: ./include/net/ip_tunnels.h:483 at pskb_inet_may_pull_reason [inline] WARNING: ./include/net/ip_tunnels.h:488 at pskb_inet_may_pull [inline] WARNING: ./include/net/ip_tunnels.h:488 at xfrmi_xmit+0x1844/0x1eb0 net/xfrm/xfrm_interface_core.c:534 RIP: 0010:pskb_may_pull_reason include/linux/skbuff.h:2856 [inline] Call Trace: __dev_direct_xmit+0x4b6/0x730 net/core/dev.c:5164 __xsk_generic_xmit net/xdp/xsk.c:1288 [inline] xsk_generic_xmit+0x27d8/0x47a0 net/xdp/xsk.c:1344 xsk_poll+0x326/0x670 net/xdp/xsk.c:1472 The packet is dropped by the pull returning PKT_TOO_SMALL and hitting the default case afterwards anyway, so the only visible effect is the warning; reject unknown protocols before the pull to restore the pre-86de3a1118a16 behavior of dropping them silently via the switch default. Reported-by: syzbot+d29af9ef5c96a3f5e96c@syzkaller.appspotmail.com Closes: https://syzbot.org/bug?extid=d29af9ef5c96a3f5e96c Fixes: 86de3a1118a16 ("xfrm: interface: validate the IP header on xmit") Cc: stable@vger.kernel.org Signed-off-by: Shuai Liu <847807867@qq.com> Acked-by: Steffen Klassert Link: https://patch.msgid.link/tencent_46F20906773869221623F9FA26275C133107@qq.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit 0edea1dd1df77b9d63237de7d6d7b8add3d569b8 Author: Zhao Gongyi Date: Fri Sep 18 18:12:49 2026 +0800 ext4: fix OOB memmove in ext4_xattr_set_entry commit e290c77088e6f829f7d1d88c915f2a2fb22241e6 upstream. A corrupted filesystem can leave an inode marked as having inline data while the system.data xattr is missing. ext4_destroy_inline_data_nolock() then asks ext4_xattr_set_entry() to remove an entry even though ext4_xattr_ibody_find() left the search state at the insertion position. In the syzkaller reproducer, the old xattr value offset is smaller than min_offs. ext4_xattr_set_entry() then computes val - first_val for memmove(), the length wraps to a huge size_t, and memmove() can run out of the xattr buffer. This results in an out-of-bounds memmove and a kernel page fault. A crafted corrupted ext4 image can trigger this while inline data is being converted out of the inode. Treat the inconsistent inline/xattr state as filesystem corruption before updating the xattr entry. The issue was found by syzkaller and reproduced with the generated C reproducer. The crash signature is: BUG: unable to handle page fault for address: ffff8880074cf000 RIP: 0010:memmove+0x28/0x1b0 Call Trace: ext4_xattr_set_entry+0xe2f/0x1e90 fs/ext4/xattr.c:1761 ext4_xattr_ibody_set+0x3d6/0x5d0 fs/ext4/xattr.c:2268 ext4_destroy_inline_data_nolock+0x288/0x5b0 fs/ext4/inline.c:467 ext4_convert_inline_data_nolock+0x178/0xe80 fs/ext4/inline.c:1222 ext4_convert_inline_data+0x52a/0x610 fs/ext4/inline.c:2083 ext4_fallocate+0x1a0/0x3ba0 fs/ext4/extents.c:4752 Reject the missing system.data xattr before destroying inline data, and validate the old value offset before ext4_xattr_set_entry() reaches the memmove(). The crash was reproduced on unpatched 7.3.0-rc3 and 6.6.122 kernels. With this fix applied to both versions, the same syzkaller C reproducer ran for 120 seconds without triggering KASAN, Oops, a memmove fault, or panic. Fixes: 67cf5b09a46f ("ext4: add the basic function for inline data support") Cc: stable@vger.kernel.org # v3.8+ Signed-off-by: Zhao Gongyi Link: https://patch.msgid.link/20260918101249.43643-1-zhaogongyi@bytedance.com Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman commit 85c4453d2a5b99af6d3bf892b69cf478a5db2066 Author: Guicai Ma Date: Tue Nov 24 00:28:49 2026 -0500 KEYS: Use kfree_sensitive() in keyctl_pkey_e_d_s() commit f779bd424bf27e17cee57c94f068328be29f3662 upstream. keyctl_pkey_e_d_s() frees the temporary 'in' and 'out' buffers with kfree(). For encrypt, decrypt and sign operations these buffers hold plaintext or other sensitive data. Free them with kfree_sensitive() instead. Closes: https://sashiko.dev/#/bug/linux-4199b169-0b8d-4055-9a71-6b5b79e38eb3 Fixes: 00d60fd3b932 ("KEYS: Provide keyctls to drive the new key type ops for asymmetric keys [ver #2]") Cc: stable@vger.kernel.org Signed-off-by: Guicai Ma Link: https://lore.kernel.org/r/20261124052849.940005-1-maguicai@kylinos.cn Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 2ef1a3ce843da291888afc07c978c3875ca3ca58 Author: Jarkko Sakkinen Date: Thu Nov 12 05:44:45 2026 +0200 KEYS: trusted: Update static calls before init commit f8b462c497549e9991299156ed0e019eae8524f1 upstream. Given that the static calls are updated only after ->init() returns, an added trusted key can race with the callback initializations. This can ultimately lead into null dereference as static_call() is used unchecked. Address the bug by updating the static calls before invoking ->init(), and roll back on failure. Cc: stable@vger.kernel.org # v5.15+ Fixes: 31de287345f4 ("KEYS: trusted: Rollback init_trusted() consistently") Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 7109ce8d0621aa34e60182ca813ae75cab226591 Author: Jarkko Sakkinen Date: Thu Nov 12 05:44:45 2026 +0200 KEYS: trusted: TEE: Synchronize session lifetime commit b8d381d5ed7980db0bcdccdb61bb65f10f08f907 upstream. The parent TEE device can remove the client device while live instances keep trusted.ko loaded. Guard session context state with a mutex, publish pvt_data.dev before registering key_type_trusted and sanitize pvt_data on probe failure and removal. When an active TEE has not been bound, reject seal, unseal and get_random with -ENODEV. Cc: stable@vger.kernel.org # v5.15+ Fixes: 0a95ebc91305 ("KEYS: trusted: Introduce TEE based Trusted Keys") Reviewed-by: Sumit Garg Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit f484f069d2f4ba862991050f595fe89e5a99dba3 Author: Sinan Turunc Date: Sat Nov 21 11:13:07 2026 +0000 KEYS: serialise key instantiation against keyctl_chown_key() commit 899af9ffd2671351e5402d572934dd59b5e91ae5 upstream. keyctl_chown_key() looks up the target key by calling lookup_user_key() with the KEY_LOOKUP_PARTIAL flag. That flag lets a caller with CAP_SYS_ADMIN change the UID of an uninstantiated key during construction. When the UID changes, keyctl_chown_key() replaces key->user under key->sem and drops the old reference with key_user_put(). __key_instantiate_and_link() and key_reject_and_link() hold key_construction_mutex during instantiation, but neither function takes key->sem. Both functions increment key->user->nikeys, and __key_instantiate_and_link() also calls key->type->instantiate() without holding key->sem. When a key is in quota and its size changes, key_payload_reserve() reads key->user seven times without key->sem. Those reads include spin_lock_irqsave(&key->user->lock, flags) at the start and spin_unlock_irqrestore(&key->user->lock, flags) at the end. If keyctl_chown_key() swaps key->user between those two calls, key_payload_reserve() unlocks the new owner's spinlock and leaves the old spinlock held. By source inspection, key_user_put() can also kfree() the old struct key_user while instantiation still dereferences it. That struct key_user use-after-free was found by reading the code and did not trigger during our KASAN runs. ===================================== WARNING: bad unlock balance detected! 7.4.0-rc2-g23c62304dde2 #3 Not tainted ------------------------------------- request-key/163 is trying to release lock (&candidate->lock) at: [] key_payload_reserve+0x29f/0x370 but there are no more locks to release! other info that might help us debug this: locks held by request-key/163: 2, on CPU#3: #0: ffffffff871c10a0 (key_construction_mutex){+.+.}-{4:4}, at: __key_instantiate_and_link+0x38/0x370 #1: ffff88800de4a8b8 (&candidate->lock){..-.}-{3:3}, at: key_payload_reserve+0x160/0x370 Call Trace: lock_release+0x286/0x2e0 _raw_spin_unlock_irqrestore+0x1a/0x50 key_payload_reserve+0x29f/0x370 generic_key_instantiate+0x42/0x230 __key_instantiate_and_link+0xd7/0x370 key_instantiate_and_link+0x40d/0x4b0 keyctl_instantiate_key_common+0x2d2/0x450 keyctl_instantiate_key+0x167/0x180 __do_sys_keyctl+0x391/0x550 Take key->sem for write with down_write_nested(&key->sem, 2) inside key_construction_mutex in __key_instantiate_and_link() and key_reject_and_link(). Fixes: 5801649d8b83 ("[PATCH] keys: let keyctl_chown() change a key's owner") Cc: stable@vger.kernel.org Signed-off-by: Sinan Turunc Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20261121111246.3478-1-enscrpt@pm.me Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 5ee4a727f1b7446590ae8e91687f012881625cf0 Author: Guicai Ma Date: Thu Nov 19 21:24:47 2026 -0500 KEYS: Fix userspace buffer overflow in keyctl_pkey_e_d_s() commit 484dc27f031229b374446cf038fa9c7a84d0f725 upstream. Commit cb481e59ea6c ("KEYS: fix overflow in keyctl_pkey_params_get_2()") changed keyctl_pkey_params_get_2() to set params->out_len to the maximum output size of the operation instead of uparams.out_len, so that the kernel buffer allocated in keyctl_pkey_e_d_s() is large enough. Because uparams.out_len is no longer kept, keyctl_pkey_e_d_s() copies ret bytes to _out without checking whether the result fits in the caller's buffer. If a smaller out_len was passed, copy_to_user() writes past the end of _out instead of failing with -EOVERFLOW. uparams.out_len cannot simply be required to be at least the maximum output size in keyctl_pkey_params_get_2(), since KEYCTL_PKEY_DECRYPT with enc=pkcs1 can return a plaintext shorter than max_dec_size into a matching smaller buffer. Pass uparams.out_len back to keyctl_pkey_e_d_s() and return -EOVERFLOW before copy_to_user() if ret exceeds it. Cc: stable@vger.kernel.org # v7.2+ Fixes: cb481e59ea6c ("KEYS: fix overflow in keyctl_pkey_params_get_2()") Signed-off-by: Guicai Ma Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 86e4352fc9162def475deb054b021fffba3638a0 Author: Henry Martin Date: Tue Nov 24 10:57:59 2026 +0800 KEYS: Fix crash on big_key read commit 1bcff832c48d83c5132662bec83bda37f566d8a2 upstream. big_key_update() reserves quota with the raw payload length and then destroys the old payload before instantiating the new one. For a payload of N < 16 bytes that reserve releases 16-N bytes, so the reserve of 16 done by generic_key_instantiate() charges them again and can fail with -EDQUOT once the payload is already destroyed. big_key_destroy() keeps payload->length but clears path and data, so the key stays positive with a stale length that KEYCTL_READ and KEYCTL_REVOKE then follow: kernel BUG at fs/open.c:1145! Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI RIP: 0010:dentry_open+0x7b/0x90 big_key_read+0x141/0x280 Instantiate the new payload first and destroy the old one only on success; a positive key's reservation is already 16 bytes, so it cannot fail. This issue was discovered by Tencent CodeBuddy Security. Cc: stable@vger.kernel.org Fixes: b6f61c314649 ("keys: Implement update for the big_key type") Signed-off-by: Henry Martin Reviewed-by: Jarkko Sakkinen Reviewed-by: Guicai Ma Tested-by: Guicai Ma Link: https://lore.kernel.org/r/20261124025759.39344-1-bsdhenrymartin@gmail.com Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit ff697a3c563eab27eae2b35832a19b2f9a4996bc Author: Jarkko Sakkinen Date: Mon Nov 23 22:54:48 2026 +0200 KEYS: Fix asym key overflow in keyctl_pkey_verify() commit 94cd215923495a0e1031b86dc7d246ef3c33cc73 upstream. While verifying a variable-length signature shorter than info.max_sig_size, memdup_user() reads past the end of the caller's _in2 and passes trailing bytes to ->asym_verify_signature(). Set params->in2_len to uparams.in2_len in the KEYCTL_PKEY_VERIFY case. Cc: stable@vger.kernel.org # v7.2+ Closes: https://sashiko.dev/#/bug/linux-dd9ad2ca-a846-4d0d-89d6-aa262ffd40f1 Fixes: cb481e59ea6c ("KEYS: fix overflow in keyctl_pkey_params_get_2()") Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 3ca4cd43881de68e23c3e7b62b81c788d01e0f33 Author: Abhiraj Dutta Date: Mon Nov 23 21:17:57 2026 -0500 ALSA: hda/realtek: Fix duplicate LEDs on HP Spectre x360 16-f2xxx commit 0ad50746fc640b68c24454500a513c4fd6293d75 upstream. The EU0XXX fixup already sets up the mute and mic-mute LEDs, so chaining ALC245_FIXUP_HP_X360_MUTE_LEDS after it registers both LEDs twice (hda::mute_1 and hda::micmute_1 appear). Use the EU0XXX fixup directly. The original commit message also got the SSID wrong: under SOF the PCI SSID is 103c:891e, not 103c:0000. Fixes: e30ec632e1f0 ("ALSA: hda/realtek: Add quirk for HP Spectre x360 2-in-1 Laptop 16-f2xxx") Cc: stable@vger.kernel.org Signed-off-by: Abhiraj Dutta Link: https://patch.msgid.link/20261123-hp-spectre-16-f2-led-fix-v1-1-a2a333dceeb5@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit cc7cbed639579f5be5989d28a12f0a754fd4d5f7 Author: Abhiraj Dutta Date: Sun Nov 22 17:02:47 2026 -0500 ALSA: hda/realtek: Add quirk for HP Spectre x360 2-in-1 Laptop 16-f2xxx commit e30ec632e1f0e1fb92b3f0d727f5bc0c00ada6eb upstream. The HP Spectre x360 16-f2xxx (SSID 103c:891e) has the same speaker problem as the 14-eu0xxx and 16-aa0xxx: the BIOS marks the treble speaker pin 0x14 as unconnected, so only the bass speakers on 0x17 play. The mute and mic-mute LEDs don't work either. Use the existing EU0XXX pin fixup and chain ALC245_FIXUP_HP_X360_MUTE_LEDS. The mute LED is on COEF 0x0b bits 2-3 and the mic-mute LED on GPIO2 (active low), which is what that fixup already handles. Unlike the 16-aa0xxx, the bass speaker amp works without toggling GPIO0, so the EU0XXX variant is enough. Under SOF the PCI SSID on this machine reads as 103c:0000, so the entry is matched against the codec SSID. Tested on a 16-f2xxx: all four speakers play and both LEDs follow the mute state. Cc: stable@vger.kernel.org Signed-off-by: Abhiraj Dutta Link: https://patch.msgid.link/20261122-hp-spectre-16-f2-quirk-v1-1-2011ef8986fb@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit 76ff57699b2ddd71c06b4078c5a396b1c6f42919 Author: Parmjot Singh Date: Sun Nov 22 19:19:08 2026 +1300 ALSA: hda/realtek: Enable mute LEDs on HP Envy x360 15-ew0xxx commit 2c2f36d275fefdea7e1dfc251b4fee246298dedc upstream. The HP ENVY x360 2-in-1 Laptop 15-ew0xxx (103c:8a2a) has speaker and mic mute LEDs that are left unconfigured by the existing two-amplifier quirk. On its ALC245 codec the speaker LED uses coefficient 0x0b bits 3:2 and the mic LED uses active-low GPIO 2. Select the existing combined CS35L41 I2C and x360 mute LED fixup for this board. On an equivalent Arch Linux 7.2.14 backport, both physical LEDs responded, both native ALSA LED triggers followed the onboard mixer switches, and both CS35L41 amps loaded their protection firmware. Codex helped trace the ALSA LED controls, prepare the change and write the commit message. The LEDs were verified on the laptop. Fixes: aa8e3ef4fe53 ("ALSA: hda/realtek: Add quirks for various HP ENVY models") Cc: stable@vger.kernel.org Signed-off-by: Parmjot Singh Link: https://patch.msgid.link/20261122061908.130239-1-parmjotsinghrobot@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit 0ec4a3ce39cc8ffcf58d79d049316231efb0c332 Author: Oleg Antonyan Date: Sun Nov 22 14:18:37 2026 +0100 ALSA: hda/realtek: Fix headset mic on ASUS Zenbook S 13 UX5304MA commit 896ec6bbe7dd2f29aff1a12eb318a6828be1edd8 upstream. The ASUS Zenbook S 13 UX5304MA (1043:1c33) uses an ALC294 codec with CS35L41 amplifiers over SPI. Its BIOS leaves pin 0x19 unconfigured, so the headset mic on the combo jack does not work. Use ALC294_FIXUP_ASUS_SPI_HEADSET_MIC like the UX3405MA and UX3402VA. It configures the headset mic pin and chains to ALC245_FIXUP_CS35L41_SPI_2 to keep the speakers working. Tested on a UX5304MA: headset mic, internal mic and speakers work. Fixes: 61cbc08fdb04 ("ALSA: hda/realtek: Add quirks for ASUS 2024 Zenbooks") Cc: stable@vger.kernel.org Signed-off-by: Oleg Antonyan Link: https://patch.msgid.link/20261122-ux5304ma-headset-mic-v1-1-80589ae749a8@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit a93182bfa319f2ba8e6dc945409dae180e13e498 Author: Akhil Arul Date: Fri Nov 20 18:27:29 2026 +0530 ALSA: hda/tas2781-spi: Set tas_hda->dev in probe commit d1458f8c2282975f2bd7467cd3c3cf4c0c58c1ca upstream. tas2781_hda_remove() is shared by the I2C and SPI drivers and uses tas_hda->dev for component_del() and for the runtime PM calls. The I2C probe sets that field, the SPI probe does not, so for SPI it stays NULL from the devm_kzalloc(). Unbinding the device through sysfs then warns in component_del() and crashes on the NULL device in pm_runtime_get_sync(): WARNING: drivers/base/component.c:839 at component_del+0x149/0x170 Call Trace: tas2781_hda_remove+0x16/0x60 [snd_hda_scodec_tas2781] device_release_driver_internal+0x19e/0x200 unbind_store+0xa4/0xb0 Oops: general protection fault, kernel NULL pointer dereference 0x1d1 RIP: 0010:__pm_runtime_resume+0x1a/0x90 tas2781_hda_remove+0x23/0x60 [snd_hda_scodec_tas2781] The same path runs from the driver remove callback and from the component_add() failure path in tas2781_hda_spi_probe(). Before the common library was introduced, the SPI driver had its own remove function that used tas_priv->dev. Set tas_hda->dev in tas2781_hda_spi_probe(), as the I2C driver does. Tested the probe/unbind path with KASAN and lockdep enabled: without this change, unbinding the device gives the warning and oops above; with it, unbind, bind and unbind again complete without any splat. Fixes: 28a09d9e42c5 ("ALSA: hda/tas2781: Create an independent lib to save the shared parts for both SPI and I2C driver") Reported-by: Carmel Okun Closes: https://lore.kernel.org/linux-sound/AS2PR02MB10038DB2CE8CAE659D35B9F1AC8792@AS2PR02MB10038.eurprd02.prod.outlook.com/ Cc: stable@vger.kernel.org Signed-off-by: Akhil Arul Link: https://patch.msgid.link/20261120125729.135171-1-akhilarul324@gmail.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit bb23595e493dc30348b6386724b5c34e4dbcc86a Author: Hengyu Liang Date: Wed Nov 25 13:10:05 2026 -0500 ALSA: pcm: oss: Refine slave hw_params after setting format commit ddea524e437eae0d5581482a90565b4c1e6d4b24 upstream. Commit 93d7d38fa61d ("ALSA: aloop: add DSD formats") added DSD_U8 to the formats of snd-aloop. Before that, its narrowest format had 16 bits. However, snd_pcm_oss_change_params_locked() sets the slave format with _snd_pcm_hw_param_set(), which does not refine the parameters, while the access, rate and channels before it are set with refining helpers. snd_pcm_oss_period_size() then reads a buffer size maximum that is still computed for the narrowest format, now DSD_U8, so the OSS period doubles. With the default U8 client format, the doubled period no longer fits in the format plugin, and snd_pcm_plugin_alloc() returns -ENOMEM. As of now, an OSS program that asks snd-aloop for 8 channels at 192 kHz gets ENOMEM from SNDCTL_DSP_SPEED and from every later ioctl on the same file. The issue can be reproduced with this program, where card 1 is snd-aloop: #include #include #include #include int main(void) { int fd = open("/dev/dsp1", O_WRONLY | O_NONBLOCK); int ch = 8, rate = 192000, blk = 0; ioctl(fd, SNDCTL_DSP_CHANNELS, &ch); if (ioctl(fd, SNDCTL_DSP_SPEED, &rate) < 0) perror("SNDCTL_DSP_SPEED"); if (ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &blk) < 0) perror("SNDCTL_DSP_GETBLKSIZE"); printf("block size %d\n", blk); return 0; } Before that commit, it prints "block size 65536". After that commit, the result is: SNDCTL_DSP_SPEED: Cannot allocate memory SNDCTL_DSP_GETBLKSIZE: Cannot allocate memory block size 0 This patch will set the format with snd_pcm_hw_param_set(), which refines the parameters, as is done for the channels just before. Fixes: 93d7d38fa61d ("ALSA: aloop: add DSD formats") Cc: Signed-off-by: Hengyu Liang Link: https://patch.msgid.link/20261125181005.3683575-1-hengyul@cs.unc.edu Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit 8bf8384e53772a1d101989d416a80c8ba01c7266 Author: Rongen Wang Date: Thu Nov 26 18:18:33 2026 +0900 ALSA: timer: Protect the slave instance flags with the timer lock commit 8e324d767bdc5ab38b0e1e921e786ff9ea514188 upstream. snd_timer_start_slave() and snd_timer_stop_slave() set and clear SNDRV_TIMER_IFLG_RUNNING in timeri->flags while holding only timeri_lock. For a slave that is linked to a master, the interrupt path updates the same word under timer->lock: snd_timer_process_callbacks() sets SNDRV_TIMER_IFLG_CALLBACK before it calls the instance callback and clears it afterwards. Both sides do a plain read-modify-write, so when they overlap one of the two updates is lost. If the set of SNDRV_TIMER_IFLG_CALLBACK is lost, snd_timer_close_locked() does not wait for the callback that is still running, the owner frees the instance, and the interrupt path clears the flag in the freed object: BUG: KASAN: slab-use-after-free in snd_timer_process_callbacks+0x269/0x2b0 Read of size 4 at addr ffff888007e5cc10 by task poc/90 snd_timer_process_callbacks+0x269/0x2b0 snd_timer_interrupt+0x7b8/0x1100 snd_utimer_ioctl+0x7c/0xb0 Freed by task 91: kfree+0x127/0x3b0 __snd_timer_user_ioctl.isra.0+0xe93/0x28f0 If the clear is lost instead, the flag stays set: the instance gets no further callbacks, and closing it spins in the drain loop of snd_timer_close_locked() with register_mutex held, which blocks every other open and close of an ALSA timer. Take timer->lock around the whole flag update of a linked slave, as snd_timer_start1() and snd_timer_stop1() do for master instances. The callers hold timeri_lock, so timeri->timer is stable, and the lock order is the one these functions already use. A slave that is not linked to a master cannot be reached from any timer and needs no additional protection. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Rongen Wang Link: https://patch.msgid.link/20261126-alsa-timer-slave-flags-v2-1-8e07a536fea3@nitrohex.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit 31eb351d94f8cdaa1d5ef3c844f1da3fc5957b57 Author: Takashi Iwai Date: Wed Nov 25 15:10:56 2026 +0100 ALSA: usb-audio: Don't queue playback URBs after stop commit 5a6fcabe156e91c6ef2435a74f2d16e6dd39f7c7 upstream. Although we've tried to address the corrupted ready_list for the playback URBs due to the concurrent start/stop of streams, there seems still a slight race: namely, in snd_complete_urb(), the driver checks the EP check via ep_state_running() and process push_back_to_ready_list() only when the EP isn't stopped. But since the EP state change can still happen between the EP state check and push_back_to_ready_list(), push_back_to_ready_list() may queue the URBs unexpectedly even after the EP gets stopped. This may result in a list corruption when the stream is restarted. The addition to the list itself is properly protected by a lock, so as a stop-gap, just add the EP state check again before actually adding to the list. In a long-term, we should reorganize the code to cover the EP state changes more consistently, but this should suffice for the particular race, at least. Reported-by: Miloslav Brada Closes: https://lore.kernel.org/awZs88beIhMcOchv@genesis.transkript.cz Cc: Link: https://patch.msgid.link/20261125141057.2094719-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit 9565121f334838a6dd25dbec5b09afd3a46acf95 Author: Takashi Iwai Date: Wed Nov 25 14:54:52 2026 +0100 ALSA: oss: Fix deadlock at unregistering (again) commit dda2d9cd1fcd9ea1e4a93657e7386fde37d7e2ba upstream. The recent code refactoring using guard() re-introduced a potential deadlock at unregistering OSS device that had been fixed onceby the commit 97d917879d7f ("ALSA: oss: Fix potential deadlock at unregistration"). The unregister_sound_special() call must be done outside the sound_oss_mutex. Fix the regression by changing guard() with scoped_guard() to limit the range. Fixes: 742ecf3ce1ac ("ALSA: core: Use guard() for locking") Cc: Link: https://patch.msgid.link/20261125135453.2088984-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit 7119ffe26734a620d97572d4540c8a5f26048721 Author: Suyuan Wang Date: Sun Nov 22 13:46:30 2026 +0000 ALSA: fireworks: Abort the transaction on a bus reset commit 890eff85e8a01012e1d3b6c54cba787416331381 upstream. When snd_efw_transaction_bus_reset() marks a transaction as STATE_BUS_RESET, snd_efw_transaction_run() sleeps and resends the command, but leaves the state as it is. The response to the resent command is then ignored, and the next wait returns at once, so the loop keeps resending the command without a retry limit until sending fails. Fireworks devices also accept AV/C commands, and the AV/C general specification says that a bus reset discards any transaction in progress. Do the same as for FCP: end the transaction on a bus reset and return -EAGAIN. ERROR_DELAY_MS has no users left, so drop it. Found with a static analysis tool and checked by hand. Suggested-by: Takashi Sakamoto Fixes: bde8a8f23bbe ("ALSA: fireworks: Add transaction and some commands") Cc: stable@vger.kernel.org Co-developed-by: Kaixuan Li Signed-off-by: Kaixuan Li Signed-off-by: Suyuan Wang Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20261122-firewire-busreset-v2-2-e104d785c8a1@gmail.com Signed-off-by: Greg Kroah-Hartman commit a4e2b6f23421936b4c6afb547423487c856ace12 Author: Takashi Iwai Date: Tue Nov 24 13:55:56 2026 +0100 ALSA: hda/realtek: Fix regression on another Lenovo Legion 16IRX9H model commit 1e04af2e3e17d62bc6d82ee890a3218341cae9d1 upstream. There is yet another Lenovo Legion 16IRX9H model with the codec SSID 17aa:38cb that suffers from the same regression as stated in the commit 0b4d69e8d2b5 ("ALSA: hda/realtek: Fix regression on Lenovo Legion 16IRX9H"). Cover this device in the same way, too. Fixes: f2293e7b2ddd ("ALSA: hda/realtek: Enable all four speaker amps on Lenovo ThinkBook X G2 IAH") Cc: Reported-by: Edward Bentall Closes: https://lore.kernel.org/CACw1+JLf_0i+GvJ4POkFUrPo_AWNHp9X2aCxyQVFRcdrKbKVxQ@mail.gmail.com Link: https://patch.msgid.link/20261124125606.570355-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit 8c11a0ce6f579d36628459f0b4dd2c91fc104731 Author: Suyuan Wang Date: Sun Nov 22 13:46:29 2026 +0000 ALSA: firewire-lib: Abort the FCP transaction on a bus reset commit 5e8802bf480da76634a8ac929c29af7b7acde615 upstream. When fcp_bus_reset() marks a transaction as STATE_BUS_RESET, fcp_avc_transaction() sleeps and resends the command, but leaves the state as it is. The response to the resent command is then ignored, and the next wait returns at once, so the loop keeps resending the command without a retry limit until sending fails. The AV/C Digital Interface Command Set General Specification 4.2 says that a target which detects a bus reset discards any AV/C transaction in progress without returning a response. So instead of resending, end the transaction on a bus reset and return -EAGAIN, so that the caller can start the sequence again. ERROR_DELAY_MS and have no users left after this, so drop them. Found with a static analysis tool and checked by hand. Suggested-by: Takashi Sakamoto Fixes: 31ef9134eb52 ("ALSA: add LaCie FireWire Speakers/Griffin FireWave Surround driver") Cc: stable@vger.kernel.org Co-developed-by: Kaixuan Li Signed-off-by: Kaixuan Li Signed-off-by: Suyuan Wang Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20261122-firewire-busreset-v2-1-e104d785c8a1@gmail.com Signed-off-by: Greg Kroah-Hartman commit ee5b425c8a0f3a3e347efbb05c252e02ef5fffae Author: Vasileios Almpanis Date: Fri Jul 31 20:26:45 2026 +0200 usb: gadget: f_uac1_legacy: fix double close of the ALSA devices commit ba4bbac98e65c6998cac4ea2b63baf2159d00a8c upstream. f_audio_bind() records that the ALSA files are open in the function instance flag opts->bound, but keeps the file pointers in the per-function gaudio card. Its error path calls gaudio_cleanup(), which closes the files without clearing the filp pointers or opts->bound. A failed bind does not destroy the usb_function, configfs_composite_bind() puts it back on cfg->func_list, so the next write to UDC binds the same f_audio, skips gaudio_setup() because opts->bound is still set, and on failure closes the files a second time. Dropping the config symlink after a failed bind closes them again via f_audio_free(). BUG: KASAN: slab-use-after-free in filp_flush+0x31/0x190 fs/open.c:1464 Read of size 8 at addr ffff888045f01990 by task syz-executor659/5617 Call Trace: filp_close+0x1d/0x40 fs/open.c:1484 gaudio_close_snd_dev drivers/usb/gadget/function/u_uac1_legacy.c:263 [inline] gaudio_cleanup+0x54/0xf0 drivers/usb/gadget/function/u_uac1_legacy.c:305 f_audio_bind+0x4a0/0x630 drivers/usb/gadget/function/f_uac1_legacy.c:792 usb_add_function+0x290/0x930 drivers/usb/gadget/composite.c:333 configfs_composite_bind+0xde0/0x1410 drivers/usb/gadget/configfs.c:1802 gadget_bind_driver+0x2ca/0x9e0 drivers/usb/gadget/udc/core.c:1662 gadget_dev_desc_UDC_store+0x1c9/0x2f0 drivers/usb/gadget/configfs.c:300 Clear filp, substream and card in gaudio_close_snd_dev() so cleanup is idempotent, and close the devices on the bind error path only if that bind opened them, resetting opts->bound as well. Fixes: f3a3406b3f56 ("usb: gadget: f_uac1: convert to new function interface with backward compatibility") Cc: stable Reported-by: syzbot+df868600fe111c5ff79f@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=df868600fe111c5ff79f Signed-off-by: Vasileios Almpanis Link: https://patch.msgid.link/20260731-alsa-v1-1-95eb93ba32ec@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman commit 1514be318a2c3b63503925f375b9b8e74b9ec4c2 Author: Dave Airlie Date: Mon Aug 24 16:34:01 2026 +1000 i915/vma: use kfree_rcu to make sure vma are freed after a rcu grace period commit 4cd3c5bdf16789fc8c8736ed1a1a645b8cecb3b6 upstream. There is a race in the vma lookup and the vma freeing that can race object close against object execbuffer vma lookups. execbuffer2 and close on two threads can be raced, so the radix tree lookup and tryget in eb_lookup_vma can be raced against a freed vma. The rcu protection in the eb lookup doesn't help because we don't use rcu around the free path. This patch adds rcu protection around the vma destruction path. We could also probably use SLAB_TYPESAFE_BY_RCU but there may be other submarined vma races in other code that this might not fix, so let's just force the rcu on free. Cc: stable@vger.kernel.org Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman commit 4f17151d63232ebc5c873fd3438c1356e28309fc Author: Michael S. Tsirkin Date: Mon Nov 30 17:32:00 2026 -0500 vhost: reject used ring batches larger than the ring commit 700737df3b825a1b9d0724acfc62b177f1e723df upstream. A compliant driver never has more than vq->num buffers in flight at once, so a batch accumulated before used->idx advances never exceeds vq->num. Reject used count > vq->num in vhost_add_used_n()/vhost_add_used_n_in_order(). Cc: stable@vger.kernel.org Reported-by: Seohyeon Maeng Reported-by: minki@morningstarsec.dev Reported-by: YanXin Li Fixes: e2b3b35eb989 ("vhost_net: batch used ring update in rx") Fixes: 4afb52c2af44 ("vhost_net: batch update used ring for datacopy TX") Fixes: bfcde6b64769 ("vhost: fix dirty logging for in-order used ring entries") Cc: Jason Wang Cc: Eugenio Pérez Message-ID: <66327153423e98bd10778bac1f29c26ba633e02a.1796163071.git.mst@redhat.com> Signed-off-by: Michael S. Tsirkin Signed-off-by: Greg Kroah-Hartman commit 52b397e5508b808109fa718233859704b1b3df95 Author: Michael S. Tsirkin Date: Mon Nov 30 17:14:57 2026 -0500 Revert "vhost: split out-of-order used ring batches at every wrap" commit 9842e945a0991c81993ce50926cc5a277ec1e5ba upstream. This reverts commit 5570a998b884c988dbe105430d7e2d8e9411e37e. Commit 5570a998b884 ("vhost: split out-of-order used ring batches at every wrap") addressed completion batches larger than the ring on the out-of-order path, but did not cover all paths (such as the in-order dirty-log replay loop). Revert it; a follow-up patch will address all paths in a more consistent manner. Cc: stable@vger.kernel.org Fixes: 5570a998b884 ("vhost: split out-of-order used ring batches at every wrap") Signed-off-by: Michael S. Tsirkin Signed-off-by: Greg Kroah-Hartman commit 3aeb92f46cc66ccc1decb0cc774cb896e8710acc Author: Aamir Ahmed Date: Tue Nov 3 10:54:40 2026 +0000 vhost: Run TIF_NOTIFY_RESUME work in the vhost_task loop commit f20d30ff369de1f995546d11888d2b70b089afa4 upstream. Since commit e1fad12dcb66 ("sched/fair: Switch to task based throttle model"), a throttled task is only dequeued when TWA_RESUME task_work runs on its way back to user mode. vhost workers never return to user mode, and vhost_task_fn() only runs task_work via get_signal() when a signal is pending. A busy vhost worker therefore ignores its cgroup's cpu.max, while its runtime is still charged to the group, throttling the group's other tasks (typically the VM's vCPUs) harder. This also fixes memory.high and block cgroup throttling for vhost workers, which are handled in resume_user_mode_work() as well. Run pending notify-resume work at the top of the worker loop, as io-wq does in io_run_task_work(). Commit 12013e3d4695 ("KVM: powerpc: Use generic xfer to guest work function") fixed the same problem for KVM. Fixes: e1fad12dcb66 ("sched/fair: Switch to task based throttle model") Cc: stable@vger.kernel.org # 6.18+ Reviewed-by: Shakeel Butt Tested-by: Shakeel Butt Assisted-by: LLM Signed-off-by: Aamir Ahmed Reviewed-by: Bradley Morgan Signed-off-by: Michael S. Tsirkin Message-ID: Signed-off-by: Greg Kroah-Hartman commit d24ee5f18a7a263efb05ba111e7b24b8758deabc Author: Xu Rao Date: Fri Nov 20 11:38:24 2026 +0800 vhost/net: Fix receive queue test in busy poll commit cdf84b850584574fc81bd80990d3bf1cf81b6a00 upstream. sock_has_rx_data() returns a positive value when receive data is available. For sockets without a peek_len() callback, however, its fallback returns skb_queue_empty(), which has the opposite meaning. An AF_PACKET SOCK_RAW socket is accepted by get_raw_socket() as a vhost-net backend, and its socket operations do not provide peek_len(). With busy polling enabled for this backend, an empty receive queue is treated as ready and a nonempty queue as not ready. This can make vhost_net_busy_poll() stop polling prematurely or fail to stop for queued receive data, and invert its receive-side scheduling decision. TUN and TAP backends provide peek_len() and are unaffected. Negate skb_queue_empty() so the fallback matches the callback and the readiness checks in vhost_net_busy_poll(). The issue was found during AI-assisted code review. The helper's incorrect result was confirmed on x86_64 running 6.6.0-amd64-desktop using a temporary diagnostic module containing the original and fixed helpers. An AF_PACKET SOCK_RAW socket, without PACKET_RX_RING, was bound to loopback in a private network namespace. Across three cycles of sending and receiving a 60-byte frame, the original helper returned 1 for an empty queue and 0 for a queued frame. The fixed helper returned 0 and 1 respectively, matching socket readability in all nine checks. This tests helper copies on real sockets, not the running vhost-net busy-poll path; the vhost-net module was not replaced. The patched drivers/vhost/net.o was also build-tested on the net tree with x86_64 GCC 12.3 and W=1 under allmodconfig and allyesconfig. No end-to-end vhost tests or kernel selftests were run. Fixes: 1576d9860599 ("tun: switch to use skb array for tx") Cc: stable@vger.kernel.org Signed-off-by: Xu Rao Acked-by: Eugenio Pérez Link: https://patch.msgid.link/1B3A1B72438119BC+20261120033824.681219-1-raoxu@uniontech.com Signed-off-by: Willem de Bruijn Signed-off-by: Greg Kroah-Hartman commit 32298d07256e57a6c7a433db41bc5c65663ec829 Author: Po-Hao Huang Date: Wed Sep 9 14:59:53 2026 +0800 wifi: rtw89: modify active scan rule for 6GHz band [ Upstream commit 0788bad5d012b164e5eabf5da206dea4fa67db1c ] Remove the cancellation of active scan with specific SSID when receiving beacons/probe responses of that SSID. Per IEEE Std 802.11ax 26.17.2.3.3, only active scan of direct BSSID should be cancelled. Previously the cancellation causes hidden AP under same ESS couldn't be found. Signed-off-by: Po-Hao Huang Signed-off-by: Ping-Ke Shih Link: https://patch.msgid.link/20260909070004.35353-5-pkshih@realtek.com Signed-off-by: Sasha Levin commit 52550818564aaa5b60b3cf7dfa281ac5117c08ac Author: Kuniyuki Iwashima Date: Sun Nov 1 06:35:22 2026 +0000 ipv6: Flush exception route while replacing nexthop. [ Upstream commit 9401b428b5d4dfe1fd5752973fd02b4e9cd05536 ] The following creates a cyclic reference between IPv6 route and nexthop: 1. create a nexthop A 2. create a nexthop group w/ A 3. create an IPv6 route with the nexthop group 4. create an exception route w/ A 5. replace A with a new nexthop B in the nexthop group 6. remove the IPv6 route 7. replace B with A in the nexthop group 8. remove the nexthop group Then, removing a device tied to the route gets stuck and triggers the splat below. [0] At 5., fib6_nh_release_dsts() is called, but it does not flush exception routes, so the nexthop A continues to grab the IPv6 route reference. nh_A->rt6i_exception_bucket[] -> rt6_ex->rt6i->from At 6., fib6_purge_rt() calls rt6_flush_exceptions(), but it only purges exceptions tied to nexthop B. Also, the route is unlinked from the nexthop group by list_del_init(&rt->nh_list). -> f6i->nh -> nhg->nh_entries[] At 8., __remove_nexthop_fib() cannot find the IPv6 route, and remove_nexthop_group() calls list_del_init(&nhge->nh_list) to unlink the group from the nexthop A's nhe->grp_list. nhg->nh_entries[] -> nh_A -> ... -> f6i Here, the nexthop A is reachable from net->nexthop.devhash[], but remove_nexthop_from_groups() cannot find the nexthop group, leaking the whole chain. Let's call fib6_nh_flush_exceptions() in fib6_nh_release_dsts(). [0]: unregister_netdevice: waiting for gre6 to become free. Usage count = 4 ref_tracker: netdev@000000009652f190 has 1/3 users at dst_alloc+0x14b/0x490 ip6_rt_cache_alloc+0x27b/0x670 __ip6_rt_update_pmtu+0x572/0x850 ip6_tnl_xmit+0x8c5/0x1b70 __gre6_xmit+0x7af/0xaa0 ip6gre_tunnel_xmit+0x685/0xdc0 dev_hard_start_xmit+0x204/0x5a0 __dev_queue_xmit+0xe8a/0x2550 ip6_finish_output+0x232/0x570 ip6_output+0x226/0x3b0 ip6_send_skb+0x133/0x250 rawv6_push_pending_frames+0x503/0x6f0 rawv6_sendmsg+0xdf0/0x1310 sock_sendmsg_nosec+0xde/0x130 __sys_sendto+0x27f/0x320 __x64_sys_sendto+0xd9/0xf0 Fixes: 7bf4796dd099 ("nexthops: add support for replace") Reported-by: Jason Zhang Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20261101064418.2055158-2-kuniyu@google.com Reviewed-by: Ido Schimmel Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit b7d0290832c460d1864347dd13046ae6c1d4aecb Author: Kuniyuki Iwashima Date: Sat Sep 26 03:33:52 2026 +0000 ipv6: Remove FIB6_EXCEPTION_BUCKET_FLUSHED. [ Upstream commit c66d93e68728cfb5f40b40d0f24129d7768faf43 ] The FIB6_EXCEPTION_BUCKET_FLUSHED logic has been dead since added. Commit 0346ec2f080b ("ipv6: Prevent rt6_insert_exception() for dying fib6_info.") restored the original race protection in rt6_insert_exception() by reusing fib6_info.fib6_destroying. The flag now prevents two races for per-cpu and exception routes. Let's remove FIB6_EXCEPTION_BUCKET_FLUSHED and set fib6_destroying in fib6_purge_rt(). Signed-off-by: Kuniyuki Iwashima Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20260926033355.3295550-1-kuniyu@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 70685ee4396c6a9fb5db3499cabcf204ce24539c Author: Zhan Xusheng Date: Fri Oct 2 23:30:59 2026 +0800 vdso/math64: Use OPTIMIZER_HIDE_VAR() in __iter_div_u64_rem() [ Upstream commit c1b910b270fee8930865410455f71e273f4c602c ] __iter_div_u64_rem() open-codes an empty asm() to keep the compiler from turning the subtraction loop into a modulo operation. That is what OPTIMIZER_HIDE_VAR() is for, so use it and reflow the comment. The macro lives in linux/compiler.h, which this header did not include. vdso/math64.h is reached from linux/math64.h, whose includes are linux/types.h, linux/math.h, asm/div64.h and vdso/math64.h; none of them guarantees linux/compiler.h. x86 happens to get it through asm/div64.h -> linux/log2.h, m68k's asm/div64.h only pulls in asm-generic/div64.h and linux/types.h, so the macro is undeclared there and the build fails with -Werror=implicit-function-declaration. Include linux/compiler.h so the header no longer depends on its includer. This is a no-op for the vDSO, where lib/vdso/gettimeofday.c already gets it through linux/build_bug.h, and vdso/unaligned.h sets the same precedent by including linux/compiler_types.h. Reported-by: kernel test robot Signed-off-by: Zhan Xusheng Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20261002153104.1347978-2-zhanxusheng@xiaomi.com Closes: https://lore.kernel.org/oe-kbuild-all/202609300626.zwNjKaO6-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202609301300.uAawkHuh-lkp@intel.com/ Signed-off-by: Sasha Levin commit f1319fe3358bdb0f22b85aa3572e8e3e51f7afc4 Author: Kyle Zeng Date: Mon Nov 9 21:44:11 2026 -0800 tracing: Validate user addresses in faultable buffer copies commit c62206dfe9c80490de8cc2d211fb28eea4958240 upstream. trace_user_fault_read() uses __copy_from_user() when no custom copy function is supplied. That primitive assumes the source address has already been validated, but the helper only checks the destination buffer size. A caller that passes an unchecked kernel address can therefore cause mapped kernel memory to be copied into the tracing buffer. The original syscall-array tracing implementation exposed this path to syscall arguments before the syscall validated them. Use copy_from_user() for the default copy as documented. Non-user addresses then fail the copy and follow the existing NULL-return path. Successful user copies, buffer bounds, and preemption and migration retry rules are unchanged. Cc: stable@vger.kernel.org Fixes: 64cf7d058a005 ("tracing: Have trace_marker use per-cpu data to read user space") Link: https://patch.msgid.link/20261110054411.75788-1-kylebot@openai.com Signed-off-by: Kyle Zeng Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit c4e0e701ecdd4fdfd4205ff54221cb8727aea175 Author: Vincent Donnefort Date: Tue Nov 17 08:29:32 2026 +0000 tracing: Take trace_access_lock() in tracing_buffers_ioctl() commit 2891516d90b4dc9d41aa55fde08882e40c7c0336 upstream. tracing_buffers_ioctl() calls ring_buffer_map_get_reader() without trace_access_lock, breaking concurrent readers. Take trace_access_lock() around ring_buffer_map_get_reader(), matching the other consuming readers. Cc: stable@vger.kernel.org Fixes: cf9f0f7c4c5b ("tracing: Allow user-space mapping of the ring-buffer") Reported-by: Kyuwon Cho Closes: https://lore.kernel.org/all/179485165154.2547186.6129837870360499372@gmail.com/ Link: https://patch.msgid.link/20261117082932.3441173-1-vdonnefort@google.com Signed-off-by: Vincent Donnefort Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 56ca039905c288dee8142ee1e86e6064a71903dd Author: David Carlier Date: Thu Nov 19 08:01:39 2026 +0000 tracing: Ignore .function on the function trace event commit 56ce4ed6316cae9536ea891d6686b92f1d930c00 upstream. For the function event, parse_pred() handles the .function suffix before the ftrace_event_is_function() case, so "ip.function == schedule" builds a predicate with no regex. Setting it through perf then dereferences the NULL pred->regex in ftrace_function_set_filter_pred(). The "ip" field of that event already takes a function name, so ignore the suffix there and let the function event case handle it. Cc: stable@vger.kernel.org Fixes: cfb58e278c6a ("tracing/filters: Dynamically allocate filter_pred.regex") Link: https://patch.msgid.link/20261119080139.131834-1-devnexen@gmail.com Suggested-by: Steven Rostedt Signed-off-by: David Carlier Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit de11ccef343fbab2d03d1f5cba0fa10b011ced24 Author: Baek Kyu, Kim Date: Fri Oct 30 02:31:27 2026 +0900 tracing: Free tracer resources on instance creation failure commit a20691808762d48ae38191cf856878e4c901b553 upstream. Creating a tracefs instance can allocate private tracer nodes, copied flags and option arrays before trace_array_create_dir() returns. If a later allocation fails, trace_array_create_systems() frees the trace_array without releasing those private allocations. The failed instance is never registered, so normal removal cannot reclaim them. Free the tracer nodes and option arrays when trace_array_create_dir() fails, then continue through the existing trace_array cleanup. Share the option array cleanup with normal instance removal. Earlier failures still use out_free_tr because the tracer list is not yet initialized there. Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261029173127.387835-1-pocj8ur4in@gmail.com Fixes: 428add559b69 ("tracing: Have tracer option be instance specific") Signed-off-by: Baek Kyu, Kim Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit fc6ded4ee9795bc84af4452c553f72e80293b2c7 Author: David Carlier Date: Thu Oct 22 21:53:16 2026 +0100 tracing: Drop the synthetic event ref when clearing hist triggers commit 2b3bed9617bb71c9b1893d9f54ef8df59a239224 upstream. clear_event_triggers() frees a hist trigger on a synthetic event without dropping the se->ref taken by event_hist_trigger_parse(). Removing an instance with such a trigger leaves the synthetic event busy forever. Cc: stable@vger.kernel.org Fixes: 4b147936fa50 ("tracing: Add support for 'synthetic' events") Link: https://patch.msgid.link/20261022205405.1228742-1-devnexen@gmail.com Signed-off-by: David Carlier Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit faf3e9353406b546f24880aea1f2096e971096b9 Author: Steven Rostedt Date: Wed Nov 18 12:25:20 2026 -0500 tracing: Do not allow user events to add a system name commit 761a77e09577bc7e5fdaff1d11bbff3486a87bf9 upstream. User events currently do not support the addition of a system name, but the parsing does not check to see if one is specified. A kprobe can add its own system name with the following command: ~# echo 'p:mysystem/kprobe_event schedule a=%ax' >> dynamic_events ~# ls events/mysystem enable filter kprobe_event But if one tries to do the same with user events: ~# echo 'u:user_events/test u32 a' >> dynamic_events ~# ls events/user_events ls: reading directory 'events/user_events/': Invalid argument enable filter It corrupts the file system as the event added had a '/' in the name. Until user events support specifying system names, just return -EINVAL to prevent the corrupted file system from happening: ~# echo 'u:user_events/test u32 a' >> dynamic_events -bash: echo: write error: Invalid argument Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261118122520.4a689710@gandalf.local.home Acked-by: Beau Belgrave Fixes: 7f5a08c79df35 ("user_events: Add minimal support for trace_event into ftrace") Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit e323f7cf65350b6ad5f6f7b1e020a3f8668cfbd0 Author: Jaewon Jung Date: Wed Oct 28 16:44:54 2026 +0900 tracing: Avoid undefined shifts for zero histogram map size commit cae7fb0d853eff05c70b08ef9e7ecb18867f8945 upstream. Reject size=0 before calling roundup_pow_of_two(). include/linux/log2.h documents roundup_pow_of_two() as: - the result is undefined when n == 0 With CONFIG_UBSAN_SHIFT=y, a size=0 histogram trigger reports: UBSAN: shift-out-of-bounds in include/linux/log2.h shift exponent 64 is too large for 64-bit type 'long unsigned int' Tested on x86_64 QEMU: size=0 is rejected without UBSAN warnings, and the histogram modifier and parser tests pass. Fixes: 7ef224d1d0e3 ("tracing: Add 'hist' event trigger command") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261028074610.2212374-1-jaewon8868@gmail.com Signed-off-by: Jaewon Jung Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit f05936e02b9737003be8c57ef4ef8d3c62e8540f Author: Steven Rostedt Date: Thu Nov 19 12:43:19 2026 -0500 tracing: Add notrace to event functions that hook to ftrace commit 39bc1fdbce1e5f435f8d02d57a9415735690bb1f upstream. A few functions in trace_events.c are used to hook to the ftrace function hooks. Before CONFIG_FUNCTION_SELF_TRACING was added, these functions were not marked for tracing because the entire directory was set to "notrace". But now that certain files can be traced by ftrace when the CONFIG_FUNCTION_SELF_TRACING config is set, individual functions that use ftrace must be annotated with "notrace" otherwise they can trigger a triple fault when called. Annotate the trace_events.c functions that are attached to ftrace with "notrace. Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261119124319.3a8bfe50@gandalf.local.home Fixes: f93a7d0caccd6 ("ftrace: Allow tracing of some of the tracing code") Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 127d3772a68ee3254931d13386bdbfc5c97eb740 Author: Kyle Zeng Date: Tue Oct 6 15:56:42 2026 -0700 tracing/filters: Treat zero-length dynamic strings as empty commit 97adb02064c6e3f378523b35563848cedbc23ec7 upstream. The regex callbacks use a length of zero for NUL-terminated strings of unknown size, such as the trailing buffer in a trace_marker record. However, filter_pred_strloc() and filter_pred_strrelloc() pass the length from a data locator directly to those callbacks. A zero-length locator has no data and need not point at a NUL byte. In particular, syscall entry events can contain an empty captured array or a failed user-string copy. Matching such a field with an equality, prefix, or substring filter can read beyond the record. The per-CPU perf trace buffer is reused, so an unprivileged counting syscall event can disclose bytes left by a previous kernel tracepoint even when raw sampling is denied and exclude_kernel prevents counting that tracepoint. Handle both locator formats through a common helper. For a zero-length field, pass an empty string and its actual size to the regex callback. This gives all matching modes the empty-string semantics without reading the locator's target. Keep nonzero fields and the legacy trace_marker unknown-length convention unchanged. Fixes: 10f20e9f9da9 ("tracing: Have zero size length in filter logic be full string") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261006225642.58778-1-kylebot@openai.com Assisted-by: Codex:gpt-6-astra Signed-off-by: Kyle Zeng Reviewed-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit d467d1977d15c824baae3a47e3291d38649f536e Author: Masami Hiramatsu (Google) Date: Thu Oct 29 10:37:53 2026 +0900 tracing/filters: Handle out-of-range CPU for OP_NE in cpumask comparison commit 87e0a196153e983a4d95903e7422b7d766cd37cf upstream. In filter_pred_##size##_cpumask(), if the event's scalar CPU value is out of range (cpu >= nr_cpu_ids), it unconditionally returns 0. However, if the predicate operation is OP_NE (e.g., field != CPUS{0,1}), an out-of-range CPU cannot match any valid CPU in the user-provided cpumask and the condition is satisfied. Returning 0 produces a false negative. Return "pred->op == OP_NE" instead of 0 when cpu >= nr_cpu_ids. Cc: stable@vger.kernel.org Fixes: 3cbec9d7b93d ("tracing/filters: Enable filtering a scalar field by a cpumask") Link: https://patch.msgid.link/179323787340.740114.14434420599496956193.stgit@devnote2 Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 3e47f61a95c8152e88616fc5c3eca4279d7a8d1b Author: Masami Hiramatsu (Google) Date: Thu Oct 29 10:37:35 2026 +0900 tracing/filters: Fix MATCH_END_ONLY regex matching for fixed-size strings commit b82178ad9e282e20c3f3636bde5c52143ed5b933 upstream. regex_match_end() calculates string length as "len - 1", assuming @len is the string length including trailing '\0'. For dynamic strings (filter_pred_strloc) and pointer strings (filter_pchar), this assumption holds and allows O(1) constant-time suffix matching. However, for fixed-size string fields (FILTER_STATIC_STRING) and "comm" (FILTER_COMM), the callers pass the buffer capacity rather than the actual string length (field->size for filter_pred_string, and TASK_COMM_LEN for filter_pred_comm). Because these buffers hold null-terminated strings (e.g. prev_comm in sched_switch holding "bash" in a 16-byte buffer), regex_match_end() tests against the tail of the buffer capacity (typically trailing '\0' padding at offset 13) rather than the actual string end. Consequently, suffix matching like comm ~ "*sh" or prev_comm ~ "*sh" fails for all strings shorter than the buffer capacity. Furthermore, for trace events like ftrace/print (trace_marker), the "buf" field is defined with size 0, denoting an unbounded NUL-terminated string. regex_match_end() and regex_match_end_str() return 0 when len is 0, causing suffix matching to fail on ftrace/print events as well. To fix this without penalizing dynamic and pointer strings with an unnecessary scan on every event: - Introduce regex_match_end_str() using strnlen(str, len) for fixed-size buffers (FILTER_COMM and FILTER_STATIC_STRING with field->size > 0). - Introduce regex_match_end_dynstr() using strlen(str) for unbounded strings (FILTER_STATIC_STRING with field->size == 0). Assign these match callbacks in parse_pred() when MATCH_END_ONLY is requested. Cc: stable@vger.kernel.org Fixes: a3291c14ecf0 ("tracing/filters: Fix MATCH_END_ONLY filter matching") Fixes: 10f20e9f9da9 ("tracing: Have zero size length in filter logic be full string") Link: https://patch.msgid.link/179323785497.740114.7643531772387726730.stgit@devnote2 Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit c31d48892fc391c0b1a9e11c5d025970c48f0bb7 Author: Masami Hiramatsu (Google) Date: Thu Oct 29 11:30:11 2026 +0900 tracing/filters: Fix false success return in process_system_preds() commit 5d4eeee1697e63cc0010cf34910a72c0f4776e42 upstream. In process_system_preds(), "fail" was initialized to true to indicate whether any event in the subsystem successfully applied the filter. However, "fail = false;" was placed at the end of the event loop outside the error check, unconditionally clearing "fail" on every iteration even when process_preds() returned an error. As a result, if every event in the subsystem fails to match the filter (e.g., an invalid field), process_system_preds() returns 0 (success) instead of -EINVAL. Consequently, create_system_filter() considers the operation successful and silently resets the subsystem filter display to the default global filter message instead of reporting the parse error. Fix this by clearing "fail" only when at least one event filter succeeds. Consolidate the cleanup logic in fail and fail_mem by using ret initialized to -ENOMEM, setting ret to -EINVAL in fail, and falling through to fail_mem, freeing any replaced filters via delay_free_filter() if !list_empty(&filter_list->list). Cc: stable@vger.kernel.org Fixes: 80765597bc58 ("tracing: Rewrite filter logic to be simpler and faster") Link: https://patch.msgid.link/179324101176.752804.17624386967710135045.stgit@devnote2 Suggested-by: Steven Rostedt Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit fe907b4ab4afdb2e09671964204ca923db872025 Author: Masami Hiramatsu (Google) Date: Thu Oct 29 10:38:11 2026 +0900 tracing/filters: Check for missing operand after operator in parse_pred() commit 42647658bdd8434a90c1b63391081396f36820ba upstream. In parse_pred(), after matching the operator and skipping whitespace, the filter string may terminate (str[i] == '\0') if the operand is missing (e.g. "ip ==" or "common_pid =="). For function events, the loop 'for (i++; str[i]; i++)' unconditionally increments 'i' past the NUL terminator, causing an out-of-bounds read. For other event types, allocating a predicate only to fail later during value parsing is wasteful. Check if 'str[i]' is NUL immediately after skipping whitespace after the operator, and report FILT_ERR_INVALID_FILTER. Cc: stable@vger.kernel.org Fixes: 80765597bc58 ("tracing: Rewrite filter logic to be simpler and faster") Link: https://patch.msgid.link/179323789181.740114.16161070743864669086.stgit@devnote2 Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 727af8c940884d73c55892edcdc08d5230125cd8 Author: David Carlier Date: Sat Oct 31 21:24:35 2026 +0000 tracing/user_events: Don't free an event that a dynamic event still references commit 0fbdc293697a5d72dc985e533eef5155a1b264cc upstream. An eprobe takes a reference on the call of the event it attaches to, and kprobe, uprobe, fprobe and synth events all refuse to go away while trace_event_dyn_busy() says such a reference exists. user_events never checks it, so a user event can be freed under an eprobe: echo 'u:test u32 a' >> dynamic_events echo 'e:ep user_events/test a=$a' >> dynamic_events echo '-:user_events/test u32 a' >> dynamic_events echo '-:eprobes/ep' >> dynamic_events The last write drops the reference on the freed call. If the last fd of a non-persistent event closes while such a reference is held, the delayed destroy now fails. Mark the event persistent then, so it can still be deleted once the reference is gone instead of being leaked. Return -EBUSY from destroy_user_event() in that case. Fixes: 7f5a08c79df3 ("user_events: Add minimal support for trace_event into ftrace") Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261031212453.16116-1-devnexen@gmail.com Signed-off-by: David Carlier Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 45c44537d86ff335a853a109c88500ccd3388957 Author: Chaosheng Qu Date: Wed Oct 14 16:10:34 2026 +0800 tracing/osnoise: Don't start a kthread in timerlat user-space mode commit 5f855410554564ca05903979e6dab96e754d8773 upstream. In timerlat user-space mode (NO_OSNOISE_WORKLOAD) the workload is a user task reading timerlat_fd, so there is no per-CPU kernel thread to run. start_kthread() only checks for that in the osnoise branch: if (timerlat_enabled()) { snprintf(comm, 24, "timerlat/%d", cpu); main = timerlat_main; } else { /* if no workload, just return */ if (!test_bit(OSN_WORKLOAD, &osnoise_options)) { ... return 0; } ... } start_per_cpu_kthreads() guards against this mode itself, but osnoise_hotplug_workfn() calls start_kthread() directly. Bringing a CPU online in user-space mode therefore starts a timerlat/N thread and sets its bit in kthread_cpumask while OSN_WORKLOAD is clear. stop_kthread() uses that bit to decide what the recorded task is: if (cpumask_test_and_clear_cpu(cpu, &kthread_cpumask) && !WARN_ON(!test_bit(OSN_WORKLOAD, &osnoise_options))) { kthread_stop(kthread); } else if (!WARN_ON(test_bit(OSN_WORKLOAD, &osnoise_options))) { kill_pid(kthread->thread_pid, SIGKILL, 1); put_task_struct(kthread); } The bit is set but OSN_WORKLOAD is not, so the first WARN_ON() fires and the && short-circuits into the user-task branch. A running kernel thread is SIGKILLed and its task_struct is put without ever being stopped, so it keeps executing until it is freed underneath itself. Any write to osnoise/options reaches this: osnoise_options_write() stops the per-CPU threads before applying the new value, so stop_kthread() still sees OSN_WORKLOAD clear. Re-writing the value that is already set triggers it just as well as changing it. echo NO_OSNOISE_WORKLOAD > osnoise/options echo timerlat > current_tracer echo 0 > /sys/devices/system/cpu/cpu1/online echo 1 > /sys/devices/system/cpu/cpu1/online echo NO_OSNOISE_WORKLOAD > osnoise/options The offline/online pair is required, otherwise no kthread is recorded and no bit is set. Running this on 7.3-rc7 with KASAN gives a WARNING in stop_kthread() followed by a slab-use-after-free in update_se(); leaving out the hotplug step produces neither. Keep the check in start_kthread(), where the related hotplug bug was fixed in 0bb0a5c12ecf, instead of adding another copy to the callback. Cc: stable@vger.kernel.org Fixes: e88ed227f639 ("tracing/timerlat: Add user-space interface") Link: https://patch.msgid.link/20261014081034.12702-1-chaosheng.qu.linux@gmail.com Signed-off-by: Chaosheng Qu Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 3d8621ab0ea41939169f2a899b033e288fd7296d Author: koraynilay Date: Mon Nov 16 16:45:26 2026 +0100 smb: client: fix times assignments in cifs_posix_to_fattr() commit 8b456f136a76a29fee8d36934740cb7f7fb5c837 upstream. Currently cifs_posix_to_fattr() wrongly sets SMB's CreationTime to fattr->cf_ctime. Fix this by setting fattr->cf_createtime to SMB's CreationTime and fattr->cf_ctime to SMB's ChangeTime, matching the behaviour of __dir_info_to_fattr(). This patch also fixes a few related issues reported by sashiko on another patch (see Sashiko Link tag). Reproducers for these bugs, with /tmp as the local filesystem folder exported as [test] in ksmbd.conf and /mnt as the smb folder mounted with mount -t cifs: mount -t cifs //127.0.0.1/test /mnt -o username=ciao,password=c,posix Issue 1: ctime clobbered by CreationTime during readdir mkdir -p /mnt/dir touch /mnt/dir/file sleep 4 chmod 644 /mnt/dir/file stat -c "ctime and btime before readdir: %Z %W" /mnt/dir/file ls -lc /mnt/dir > /dev/null stat -c "ctime and btime after readdir: %Z %W" /mnt/dir/file stat -c "ctime and btime on disk: %Z %W" /tmp/dir/file output before the fix, notice how ctime is the same as btime after the readdir, while it's 4 seconds ahead (because of the sleep 4) before the readdir (on disk timestamps are not touched): ctime and btime before readdir: 1794842068 1794842064 ctime and btime after readdir: 1794842064 1794842064 ctime and btime on disk: 1794842068 1794842064 output after the fix: ctime and btime before readdir: 1794842908 1794842904 ctime and btime after readdir: 1794842908 1794842904 ctime and btime on disk: 1794842908 1794842904 Issue 2: btime and ptime wiped out by readdir [ no reproducer as it only happens after the linked patch series is applied, since it needs cifs_i->createtime = fattr->cf_createtime in cifs_fattr_to_inode() ] Issue 3: in-memory inode aliasing (flock bypass on hardlink via readdir) mkdir -p /mnt/dir1 /mnt/dir2 echo "test" > /mnt/dir1/h1 ln /mnt/dir1/h1 /mnt/dir2/h2 exec 3< /mnt/dir1/h1 flock -x -n 3 # get exclusive lock ls /mnt/dir2 > /dev/null exec 4< /mnt/dir2/h2 flock -x -n 4 if [ $? -eq 0 ];then echo "acquired: duplicate in-memory inode" else echo "blocked: same inode" fi output before the fix: acquired: duplicate in-memory inode output after the fix: blocked: same inode Fixes: 3d519bd1269f ("cifs: plumb smb2 POSIX dir enumeration") Cc: stable@vger.kernel.org Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20261115180343.576773-1-koray.fra%40gmail.com?part=10 Link: https://lore.kernel.org/all/20261115180343.576773-11-koray.fra@gmail.com/ Assisted-by: Gemini:3.8-flash-high antigravity-cli-1.5.7 Signed-off-by: koraynilay Reviewed-by: Namjae Jeon Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 8a72206aae231a8ddc6f197c9dc4655b7ee89039 Author: koraynilay Date: Thu Nov 12 12:16:37 2026 +0100 smb: client: fix negative timestamps being read from smb commit 6a75ce0866bb1efe67947fc5536a476381d7a9d9 upstream. When reading a timestamp before epoch 0, cifs converts it from NT format to Unix format without normalizing it, leading to the nanoseconds field to be used as a negative number, which leads to a garbled stat command output. This bug also violates a struct timespec64 invariant, as documented in the set_normalized_timespec64() kernel-doc: [...] * Note: The tv_nsec part is always in the range of 0 <= tv_nsec < * NSEC_PER_SEC. * For negative values only the tv_sec field is negative ! */ Reproducer, with /tmp as the local filesystem folder exported as [test] in ksmbd.conf and /mnt as the smb folder mounted with mount -t cifs: mount -t cifs //127.0.0.1/test /mnt -o username=user,password=pass touch -d "1969-07-20 20:17:40.123456789" /tmp/test.txt stat -c "Server local (/tmp): %y" /tmp/test.txt stat -c "CIFS client (/mnt): %y" /mnt/test.txt --cached=never smbclient //127.0.0.1/test -U user%pass -c "allinfo test.txt" which prints (stat output is garbled because of negative value): Server local (/tmp): 1969-07-20 20:17:40.123456789 +0000 CIFS client (/mnt): 1969-07-20 20:17:41.()*+,--00 +0000 altname: TESTT~K6.TXT [...] access_time: Sun Jul 20 20:17:40 1969 UTC write_time: Sun Jul 20 20:17:40 1969 UTC [...] Fix this by using set_normalized_timespec64() in cifs_NTtimeToUnix(). Fixes: 2ae83bf93882 ("[CIFS] Fix setting time before epoch (negative time values)") Cc: stable@vger.kernel.org Assisted-by: Gemini:3.8-flash-high antigravity-cli-1.5.3 Signed-off-by: koraynilay Reviewed-by: Namjae Jeon Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 182cb05e7d0b1dd3c2e93dbcb3b9ceb2d2ae0c1a Author: Siddharth Chintamaneni Date: Tue Nov 17 00:17:33 2026 +0000 smb: client: fix busy dentry on unmount from persistent handle reopen commit 340ca61e9d31c31403013dc9190550d615844828 upstream. During unmount, cifs_kill_sb() waits on cifs_sb->outstanding_rreq for in-flight netfs I/O requests and oplock breaks to complete before flushing serverclose_wq and fileinfo_put_wq. While cifs_kill_sb() is waiting on outstanding_rreq, any cifsFileInfo referenced by an in-flight request (req->cfile) remains on tcon->openFileList. On a mount using persistent handles, if a reconnect runs on cifsiod_wq during this window, smb2_reconnect_server() calls cifs_reopen_persistent_handles(), which walks tcon->openFileList and takes a new reference on open_file via cifsFileInfo_get() to reopen the handle over the network: Thread 1 (umount) Thread 2 (cifsiod_wq) Thread 3 (workers) ----------------- --------------------- ------------------ cifs_kill_sb() wait(outstanding_rreq) [blocks: rreq == 1] smb2_reconnect_server() cifs_reopen_persistent_handles() finds open_file on list cifsFileInfo_get(open_file) [cfile->count: 1 -> 2] cifs_reopen_file() cifs_free_request() cifsFileInfo_put() [cfile->count: 2 -> 1] dec(outstanding_rreq) [wakes: rreq == 0] flush(serverclose_wq) flush(fileinfo_put_wq) kill_anon_super(sb) -> generic_shutdown_super() BUG: Dentry still in use (1) VFS: Busy inodes after unmount! Fix this by incrementing cifs_sb->outstanding_rreq when cifs_reopen_persistent_handles() takes a reference on open_file and decrementing it after cifsFileInfo_put(open_file), so wait_var_event() in cifs_kill_sb() waits for any in-progress persistent handle reopen to finish and queue its final put before draining fileinfo_put_wq. Fixes: 340cea84f691 ("cifs: open files should not hold ref on superblock") Cc: stable@vger.kernel.org Reported-by: Adam Kim Signed-off-by: Siddharth Chintamaneni Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 58441721c22999829ef24a43185d7d8008adc85e Author: Siddharth Chintamaneni Date: Tue Nov 17 00:17:32 2026 +0000 smb: client: fix busy dentry and inode on unmount from late oplock break commit a10ec8dba77799a0460a4b3dfcac040ac452a325 upstream. During unmount, cifs_kill_sb() flushes cifsoplockd_wq and deferredclose_wq before waiting on cifs_sb->outstanding_rreq for in-flight netfs I/O requests to finish their cleanup_work in cifs_free_request(). While cifs_kill_sb() is waiting on outstanding_rreq, any cifsFileInfo referenced by an in-flight request (req->cfile) still has cfile->count >= 1 and remains on tcon->openFileList. If the SMB server sends a lease or oplock break for that file during this window, the demultiplex thread (cifsd) finds cfile on tcon->openFileList and calls cifs_queue_oplock_break(cfile), which takes a new reference on cfile and queues cfile->oplock_break onto cifsoplockd_wq after cifsoplockd_wq was already flushed: Thread 1 (umount) Thread 2 (cifsd) Thread 3 (workers) ----------------- ---------------- ------------------ cifs_kill_sb() flush(cifsoplockd_wq) flush(deferredclose_wq) wait(outstanding_rreq) [blocks: rreq == 1] SMB2 Lease Break finds cfile on list cifs_queue_oplock_break() queue(cifsoplockd_wq) cifsFileInfo_get(cfile) [cfile->count: 1 -> 2] cifs_oplock_break() ihold(inode) cifs_free_request() cifsFileInfo_put() [cfile->count: 2 -> 1] dec(outstanding_rreq) [wakes: rreq == 0] flush(serverclose_wq) flush(fileinfo_put_wq) kill_anon_super(sb) -> generic_shutdown_super() BUG: Dentry still in use (1) VFS: Busy inodes after unmount! Furthermore, cifs_oplock_break() itself holds the inode via ihold() after dropping cfile and may initiate writeback via filemap_fdatawrite(), spawning new netfs I/O requests. Fix this by counting queued oplock breaks in cifs_sb->outstanding_rreq from when cifs_queue_oplock_break() queues the work until cifs_oplock_break() finishes, so wait_var_event() in cifs_kill_sb() waits for both in-flight I/O requests and any late oplock breaks to complete. Fixes: 340cea84f691 ("cifs: open files should not hold ref on superblock") Cc: stable@vger.kernel.org Reported-by: Adam Kim Signed-off-by: Siddharth Chintamaneni Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 1b0ad6a7629630dc37815b655522d833ae5a728f Author: Suyuan Wang Date: Mon Nov 16 04:06:23 2026 +0000 smb: client: fail SMB2 responses with a bad signature commit 2a5bd7a2bbb787483cd69ecf099e2b591e3633b2 upstream. smb2_check_receive() checks the response signature when signing is on, but a failed check is only logged: rc = smb2_verify_signature(&rqst, server); if (rc) cifs_server_dbg(VFS, "SMB signature verification returned ...", rc); ... return map_smb2_to_linux_error(mid->resp_buf, log_error); The status from the response is returned as usual, and the caller goes on to use a response whose signature is wrong. This is the path for synchronous and compound requests and for smb2_writev_callback(). On a signed but unencrypted connection, anyone who can modify the traffic can change e.g. a directory listing or file attributes, and the client accepts it. Return the verification error instead. That alone is not enough for compound_send_recv(), which still hands the response buffer to the caller after check_receive() fails. smb2_compound_op() then maps the status from that buffer again and copies the payload out, and other callers look at the buffer on error too, e.g. smb2_open_file() parses a symlink target out of a STATUS_STOPPED_ON_SYMLINK response. So also mark the mid MID_RESPONSE_MALFORMED, and have compound_send_recv() handle it like a mid in a bad state: mark the earlier mids cancelled, so that a CREATE which did succeed gets its handle closed, and don't pass any response on. Unlike the SMB1 fix in commit dc96f01d54cc ("smb: client: terminate session upon failed client required signing"), don't reconnect: this runs in the thread that sent the request, and only cifsd should call cifs_reconnect(). And fail the request whichever side required signing, since a response with a bad signature can't be trusted either way. Found with a static analysis tool and checked by hand. Reported-by: Daniel Birtwhistle Closes: https://lore.kernel.org/linux-cifs/SN4PR22MB28883DAF57E0B4D4BFB1C22AEEC42@SN4PR22MB2888.namprd22.prod.outlook.com/ Fixes: 3c1bf7e48e9e ("CIFS: Enable signing in SMB2") Cc: stable@vger.kernel.org Co-developed-by: Kaixuan Li Signed-off-by: Kaixuan Li Signed-off-by: Suyuan Wang Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 80e80d00b40687245f8de67476b6de44cfd089c3 Author: Suyuan Wang Date: Thu Nov 19 04:00:48 2026 +0000 smb: client: don't use read data that failed signature verification commit a1a0ef3ba8e802060bfc2b0ebf131a2cf98c3b71 upstream. When smb2_readv_callback() finds a bad signature, it sets the error in rdata->result but leaves rdata->got_bytes alone. Further down, a short read that reaches the remote EOF clears the error again: size_t trans = rdata->subreq.transferred + rdata->got_bytes; if (trans < rdata->subreq.len && rdata->subreq.start + trans >= netfs_read_remote_i_size(inode)) { rdata->result = 0; and got_bytes is then added to subreq.transferred. So the last part of a file, or all of a small one, is returned even though its signature is wrong. Clearing got_bytes is not enough on its own. If the read starts at or past the cached remote size, for example because the file has grown on the server since the size was last fetched, the check above still matches and the error turns into EOF, or into a zero-filled tail when NETFS_SREQ_CLEAR_TAIL is set. Clear got_bytes when the signature check fails, as the retry path in the same function already does, and only treat a short read as hitting the remote EOF when the read itself succeeded. That is what commit 1da29f2c39b6 ("netfs, cifs: Fix handling of short DIO read") describes: "clear the error if a short read occurred without error and the read-to file position is now at the remote inode size". Found with a static analysis tool and checked by hand. Fixes: 1da29f2c39b6 ("netfs, cifs: Fix handling of short DIO read") Cc: stable@vger.kernel.org Co-developed-by: Kaixuan Li Signed-off-by: Kaixuan Li Signed-off-by: Suyuan Wang Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 669c028ac8c5d430ca15f53c96dd9ca6399bf7ae Author: ozgun kultekin Date: Tue Nov 17 16:21:59 2026 -0800 smb: client: do not let the server grow a write subrequest commit f834c81f108f8bdb0e3aa8375a536fb6dda56c70 upstream. smb2_writev_callback() takes the byte count from the SMB2 WRITE response, masks it with 0xFFFF if it is larger than the request (for old OS/2 servers), and then copies it into wdata->subreq.len. A server can return a count that is still larger than the request after the mask, for example 0x8002 for a 5-byte write or 0xFFFF for a 4 KiB write, and the subrequest then covers data that was never sent. netfs uses the subrequest length to decide how far the write collector may advance. With a grown subrequest the collector moves collected_to past the data that was issued: netfs_writeback_unlock_folios() walks folio_queue slots that were never filled, and rolling_buffer_delete_spent() frees folio_queue segments that later in-flight subrequests still use. This is a use-after-free that a malicious or broken server triggers from an ordinary write: BUG: KASAN: slab-use-after-free in netfs_limit_iter+0xed4/0x1040 Read of size 1 at addr ff11000010561511 by task kworker/u8:4/63 Workqueue: events_unbound netfs_write_collection_worker netfs_limit_iter+0xed4/0x1040 netfs_retry_writes+0x1410/0x1e90 netfs_write_collection+0x2647/0x3880 netfs_write_collection_worker+0x1cd/0x3e0 Allocated by task 141: netfs_folioq_alloc+0x39a/0x470 rolling_buffer_init+0x29/0xc0 netfs_create_write_req+0x12f/0x840 Freed by task 42: rolling_buffer_delete_spent+0xb1/0x220 netfs_write_collection+0x1f62/0x3880 Never change the subrequest length from the response. If the count is still larger than the request after the mask, fail the write with -EIO and record it with a new write_overlarge trace point, like the read path does with read_overlarge. A short count still returns -ENOSPC as before. The folio_queue form of the use-after-free exists since commit cd0277ed0c18 ("netfs: Use new folio_queue data type and iterator instead of xarray iter"). Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib") Cc: stable@vger.kernel.org Signed-off-by: ozgun kultekin Reviewed-by: Namjae Jeon Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit 4f61811bb2d46293337ba7e05215a691720fef88 Author: Fredric Cover Date: Thu Nov 12 04:21:36 2026 +0000 smb: client: convert path_consumed to mount charset units commit 3a191eec3627acd558640cf4092e9e337aa15291 upstream. path_consumed in a DFS referral counts bytes of the canonical path, which is in the DFS cache charset (utf8). dfs_parse_target_referral() applies it as an offset into full_path, which is in the mount charset. When the mount charset is not utf8, each non-ASCII character in the consumed part that encodes longer in utf8 than in the mount charset makes the offset too large, so leading characters of the prefix path are dropped. For example, with iocharset=iso8859-1, mounting //srv/dfs/café é/sub yields the prefix "ub" instead of "sub" and the mount fails with -ENOENT. (A single accented character only worked because the offset happened to land after the delimiter.) Translate the count in parse_dfs_target(), where both strings are available, by matching path components: count the delimiters in the consumed part of the canonical path and find the same position in the mount charset path. Delimiters are ASCII in both and are not affected by remapping. If the consumed bytes are identical in both strings, which is the case for utf8 mounts and ASCII-only prefixes using the default backslash delimiter, the value is used unchanged. This assumes the server reports PathConsumed on a component boundary; a translated value that ends mid-component is rounded up to the next boundary. Tested against Samba on a KASAN kernel: with iocharset=iso8859-1, links with 0 to 3 accented characters followed by a tail, a two-level tail, an accented tail, a link in a subdirectory, and mapposix with an accented name; iso8859-15 and cp932 mounts; and iocharset=utf8 controls. Not tested against Windows servers, with posixpaths, or with reserved characters under mapchars/mapposix. Signed-off-by: Fredric Cover Cc: stable@vger.kernel.org Signed-off-by: Paulo Alcantara Signed-off-by: Greg Kroah-Hartman commit adef8115fe28d0c094cff10ff98a83c714c99c54 Author: Stanley Jhu Date: Thu Oct 29 15:08:38 2026 +0800 scsi: ufs: sysfs: Propagate runtime PM resume errors commit 93891d1c486efcef2267c32e6e73ca2fd243704e upstream. All 14 ufshcd_rpm_get_sync() callers in ufs-sysfs.c resume the UFS device W-LUN and ignore the return value. For example, for a UFS descriptor read: 1. The W-LUN is runtime suspended. 2. User space reads a UFS descriptor attribute in sysfs. 3. ufs_sysfs_read_desc_param() calls ufshcd_rpm_get_sync(). 4. The W-LUN runtime resume fails and the W-LUN stays suspended. 5. ufshcd_rpm_get_sync() returns a negative errno, which is ignored. 6. ufs_sysfs_read_desc_param() sends a query UPIU while the W-LUN is still suspended. The other sysfs callers follow the same sequence. They send other query UPIUs, or read a host register in ufshcd_read_hci_reg(). Switch all 14 sysfs callers to ufshcd_rpm_resume_and_get() and return the error after releasing any held buffer and hba->host_sem. Fixes: aef80fd1da32 ("scsi: ufs: sysfs: Resume the proper SCSI device") Fixes: b9d104465a6c ("scsi: ufs: Prepare to add HCI capabilities sysfs") Fixes: 600edc6620a4 ("scsi: ufs: sysfs: Make max_number_of_rtt read-write") Fixes: 6c4148ce7cc1 ("scsi: ufs: wb: Add explicit flush sysfs attribute") Fixes: 500d4b742e0c ("scsi: ufs: core: Add WB buffer resize support") Fixes: ae7795a8c258 ("scsi: ufs: core: Add HID support") Fixes: 1fd2e77b8897 ("scsi: ufs: core: Add device level exception support") Cc: stable@vger.kernel.org # needs "scsi: ufs: core: Introduce ufshcd_rpm_resume_and_get() helper" Signed-off-by: Stanley Jhu Reviewed-by: Bart Van Assche Reviewed-by: Peter Wang Link: https://patch.msgid.link/20261029040003.2100003-4-stanleyjhu@google.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit b590082da3f606a38695566308a40046ae8cb8e8 Author: Stanley Jhu Date: Thu Oct 29 15:08:40 2026 +0800 scsi: ufs: hwmon, debugfs: Propagate runtime PM resume errors commit 9eb89611d95914e47cec62826e4000396df0f953 upstream. ufs_hwmon_read(), ufs_hwmon_write(), and ufs_debugfs_get_user_access() resume the UFS device W-LUN with ufshcd_rpm_get_sync() and ignore its return value. For example, for a hwmon temperature read: 1. The W-LUN is runtime suspended. 2. User space reads temp1_input of the UFS hwmon device. 3. ufs_hwmon_read() calls ufshcd_rpm_get_sync(). 4. The W-LUN runtime resume fails and the W-LUN stays suspended. 5. ufshcd_rpm_get_sync() returns a negative errno, which is ignored. 6. ufs_hwmon_read() sends an attribute query UPIU while the W-LUN is still suspended. ufs_hwmon_write() and the debugfs writers that use ufs_debugfs_get_user_access() (exception_event_mask and tx_eq_ctrl) follow the same sequence. Convert all three call sites to ufshcd_rpm_resume_and_get() and release hba->host_sem before returning the error, ahead of __acquire(ufs_debugfs) in ufs_debugfs_get_user_access(). Fixes: b294ff3e3449 ("scsi: ufs: core: Enable power management for wlun") Fixes: e88e2d32200a ("scsi: ufs: core: Probe for temperature notification support") Fixes: adbabdcf0db0 ("scsi: ufs: core: Add support to retrain TX Equalization via debugfs") Cc: stable@vger.kernel.org # needs "scsi: ufs: core: Introduce ufshcd_rpm_resume_and_get() helper" Signed-off-by: Stanley Jhu Reviewed-by: Bart Van Assche Reviewed-by: Peter Wang Link: https://patch.msgid.link/20261029040003.2100003-6-stanleyjhu@google.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit a3607811e624304e87d7835081de9f6beb37aef8 Author: Stanley Jhu Date: Thu Oct 29 15:08:36 2026 +0800 scsi: ufs: core: Restore jiffies conversion of device management timeouts commit ebf5cab0dd223a36a09742a91be4fea97e46c816 upstream. Before commit 08b12cda6c44 ("scsi: ufs: core: Switch to scsi_get_internal_cmd()"), ufshcd_wait_for_dev_cmd() converted the millisecond timeout with msecs_to_jiffies() before waiting for the command. That commit moved the timeout to the block layer and assigns the millisecond value to rq->timeout as is, but rq->timeout is in jiffies. A 1500 ms query timeout (QUERY_REQ_TIMEOUT_DEFAULT) becomes 6 s with CONFIG_HZ=250 and 15 s with CONFIG_HZ=100, and NOP_OUT_TIMEOUT and ADVANCED_RPMB_REQ_TIMEOUT grow the same way. Restore the conversion with msecs_to_jiffies(). Fixes: 08b12cda6c44 ("scsi: ufs: core: Switch to scsi_get_internal_cmd()") Cc: stable@vger.kernel.org # v6.19+ Signed-off-by: Stanley Jhu Reviewed-by: Bart Van Assche Reviewed-by: Peter Wang Link: https://patch.msgid.link/20261029040003.2100003-2-stanleyjhu@google.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit ad8b975350e2d39559a50d650f3e9d0751a1e6ed Author: Stanley Jhu Date: Thu Oct 29 15:08:30 2026 +0800 scsi: ufs: core: Keep clock-gating hold on failed W-LUN runtime resume commit 6da1bc55c060bec3163b0e6077f3ac9641f8100c upstream. 1. __ufshcd_wl_suspend() takes one ufshcd_hold() reference and sets hba->clk_gating.is_suspended while the UFS device W-LUN enters RPM_SUSPENDED. 2. Since commit eef1d74bf88f ("PM: runtime: Only set runtime_error on suspend callback failures"), a failed runtime resume (for example START STOP UNIT completing with an error) leaves the W-LUN in RPM_SUSPENDED with power.runtime_error == 0, while __ufshcd_wl_resume() already clears hba->clk_gating.is_suspended and calls ufshcd_release(). 3. The next W-LUN runtime resume runs __ufshcd_wl_resume() again without an intervening suspend and calls ufshcd_release() a second time, dropping a reference it does not own and underflowing hba->clk_gating.active_reqs on UFSHCD_CAP_CLK_GATING hosts. Keep hba->clk_gating.is_suspended and the suspend hold across a failed W-LUN runtime resume, so the hold stays paired with the W-LUN RPM_SUSPENDED state and the next successful resume releases it. Fixes: eef1d74bf88f ("PM: runtime: Only set runtime_error on suspend callback failures") Cc: stable@vger.kernel.org # v7.3+ Signed-off-by: Stanley Jhu Reviewed-by: Brian Norris Reviewed-by: Peter Wang Link: https://patch.msgid.link/20261029040002.2100002-1-stanleyjhu@google.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit e980cc3eb45be5fb05faa68b93b5d243375262c9 Author: Stanley Jhu Date: Thu Oct 29 15:08:37 2026 +0800 scsi: ufs: core: Introduce ufshcd_rpm_resume_and_get() helper commit cbab12e5b4a7f49d5add4301de275351269cd431 upstream. ufshcd_clkscale_enable_store() and ufshcd_auto_hibern8_update() resume the UFS device W-LUN with ufshcd_rpm_get_sync() and ignore its return value. For clkscale_enable: 1. The W-LUN is runtime suspended and clock scaling is disabled. 2. User space writes 1 to clkscale_enable. 3. ufshcd_clkscale_enable_store() calls ufshcd_rpm_get_sync(). 4. The W-LUN runtime resume fails and the W-LUN stays suspended. 5. ufshcd_rpm_get_sync() returns a negative errno, which is ignored. 6. ufshcd_clkscale_enable_store() enables clock scaling and resumes devfreq while the W-LUN is still suspended. For auto_hibern8: 1. The W-LUN starts a runtime suspend. 2. User space writes a new value to auto_hibern8. 3. ufshcd_auto_hibern8_update() sees that the W-LUN is not yet suspended and calls ufshcd_rpm_get_sync(). 4. ufshcd_rpm_get_sync() waits for the runtime suspend to finish and then runs the W-LUN runtime resume. 5. The W-LUN runtime resume fails and the W-LUN stays suspended. 6. ufshcd_rpm_get_sync() returns a negative errno, which is ignored. 7. ufshcd_auto_hibern8_update() writes REG_AUTO_HIBERNATE_IDLE_TIMER while the W-LUN is still suspended. Add ufshcd_rpm_resume_and_get() wrapping pm_runtime_resume_and_get() so failed resumes drop the usage reference automatically, and return early in ufshcd_clkscale_enable_store() and ufshcd_auto_hibern8_update() when it fails. Fixes: b294ff3e3449 ("scsi: ufs: core: Enable power management for wlun") Cc: stable@vger.kernel.org Signed-off-by: Stanley Jhu Reviewed-by: Bart Van Assche Reviewed-by: Peter Wang Link: https://patch.msgid.link/20261029040003.2100003-3-stanleyjhu@google.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit 275980b91ea16bde9eb18e791a87fc252643908f Author: Stanley Jhu Date: Thu Oct 29 15:08:39 2026 +0800 scsi: ufs: bsg: Abort ufs_bsg_request() when runtime resume fails commit 2b8541edf7c43f0294c45d2e687bbc1288292f4e upstream. ufs_bsg_request() resumes the UFS device W-LUN with ufshcd_rpm_get_sync() and ignores its return value: 1. The W-LUN is runtime suspended. 2. User space submits a BSG request. 3. ufs_bsg_request() calls ufshcd_rpm_get_sync(). 4. The W-LUN runtime resume fails and the W-LUN stays suspended. 5. ufshcd_rpm_get_sync() returns a negative errno, which is ignored. 6. ufs_bsg_request() dispatches the BSG command while the W-LUN is still suspended. Use ufshcd_rpm_resume_and_get() and jump to out_complete on error so the BSG job is completed via bsg_job_done() with the failure code without dropping an unacquired runtime PM reference. Fixes: b294ff3e3449 ("scsi: ufs: core: Enable power management for wlun") Cc: stable@vger.kernel.org # needs "scsi: ufs: core: Introduce ufshcd_rpm_resume_and_get() helper" Signed-off-by: Stanley Jhu Reviewed-by: Bart Van Assche Reviewed-by: Peter Wang Link: https://patch.msgid.link/20261029040003.2100003-5-stanleyjhu@google.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit 17738e8bb3cc40f2197bf8857f78a2e0016c6145 Author: Praneeth Balasubramanian Date: Thu Oct 29 13:54:56 2026 -0700 scsi: target: iscsi: Check for existing sessions only after authentication commit 48d3b732e5ad3fffe74e033d9a3cf47ebaa314b0 upstream. In the operational-negotiation path (CSG=1), iscsi_target_handle_csg_one() calls iscsi_target_check_for_existing_instances() before iscsi_conn_authenticated(). An initiator can therefore send a first Login PDU with CSG=1, TSIH=0 and no CHAP exchange, carrying the InitiatorName and ISID of an existing session. The target reinstates that session, which tears down the legitimate initiator's connection. Only afterwards does it reject the login with AUTH_FAILED. iscsi_check_for_session_reinstatement() matches on ISID, InitiatorName and SessionType only. The InitiatorName is not secret, and open-iscsi ISIDs are a fixed OUI followed by a small session counter. A remote peer with no credentials can thus repeatedly disconnect a CHAP-authenticated session and keep its I/O failing. The comment above iscsi_target_check_for_existing_instances() already states the intended invariant: NOTE: We check for existing sessions or connections AFTER the initiator has been successfully authenticated in order to protect against faked ISID/TSIH combinations. The security-negotiation path (CSG=0) honours this, calling the check only once authentication completes. Move the CSG=1 call below the authentication check so both paths behave the same. When authentication is not required, iscsi_conn_authenticated() returns true and behaviour is unchanged. Fixes: e48354ce078c ("iscsi-target: Add iSCSI fabric support for target v4.1") Cc: stable@vger.kernel.org Signed-off-by: Praneeth Balasubramanian Link: https://patch.msgid.link/20261029205456.1211532-1-praneethb2002@gmail.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit 7332323b0a8478a71a855f1034ed09a5deec2e5a Author: Shao Mingyin Date: Mon Oct 26 19:49:55 2026 +0800 scsi: target: Fix NULL pointer dereference in target_dev_alua_lu_gp_store() commit fe5988e8708e1d42cb844bd9ac8f0a51388061fc upstream. Writing "NULL" to the alua_lu_gp attribute clears the ALUA LU group association of a device. The attribute can be written again after the association has already been cleared. In that case lu_gp_mem->lu_gp and lu_gp_new are both NULL, but the code still calls __core_alua_attach_lu_gp_mem(), which dereferences the NULL lu_gp pointer: BUG: kernel NULL pointer dereference, address: 0000000000000000 ... __core_alua_attach_lu_gp_mem target_dev_alua_lu_gp_store Clearing an already cleared association is a no-op, so return early when there is no association left to clear. Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6") Signed-off-by: Shao Mingyin Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261026194955694FnXGoQ352dstLk5HPBqCG@zte.com.cn Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit ee12e6f0ca4e01ad9c8dcbd05ab5cf8d71a4fe00 Author: Shao Mingyin Date: Mon Oct 26 19:51:33 2026 +0800 scsi: target: Fix NULL pointer dereference in core_alua_do_port_transition() commit c0bb6614132c64205a3c40c32dc1494c1bfeffe1 upstream. core_alua_do_port_transition() assumes that the device has an ALUA LU group member and that the member is associated with an LU group. Neither is guaranteed: internal-use HBAs never allocate dev_alua_lu_gp_mem, and the association with an LU group is dropped when "NULL" is written to the device's alua_lu_gp attribute. The configfs path can reach the second case. After clearing the LU group association, writing the implicit ALUA access state of a target port group calls core_alua_do_port_transition(), which dereferences the NULL lu_gp in atomic_inc(&lu_gp->lu_gp_ref_cnt). Return -ENODEV when the device has no LU group association instead. Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6") Signed-off-by: Shao Mingyin Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261026195133237y2UxJLoV1FK6aD1zrFbIU@zte.com.cn Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit 5ccc9f858fdf50501c0fce0ae2b48c4175855472 Author: Ciro Iriarte Date: Sat Oct 31 22:21:39 2026 -0300 scsi: target: core: Parse APTPL res_type and res_scope as hex commit 08f08a6d49efc422258edba802faa4fc7677309e upstream. core_scsi3_update_aptpl_buf() saves the reservation holder's type and scope to the APTPL metadata file as zero-padded hex ("res_type=%02x", "res_scope=%02x"), but target_pr_res_aptpl_metadata_store() reads them back with "%d" tokens and match_int(), which parse with base 0. A leading zero selects octal, so match_token() parses only the "0" of "res_type=08", the trailing "8" makes the token not match, and the field is ignored as unknown. An Exclusive Access - All Registrants holder (type 0x8) is left with type 0 and the write fails with -EINVAL and Illegal PR type: 0x00 for reservation holder Userspace that restores APTPL state by writing the saved records back to pr/res_aptpl_metadata (rtslib-fb does this when it recreates a storage object) therefore loses every type 8 reservation across a target restart, and with rtslib the storage object creation fails. The other valid types (1, 3, 5, 6, 7) and scope 0 only work because their octal and decimal values coincide. Keep the on-disk format and parse both fields as hex. The valid type and scope values have the same hex and decimal representation, so records written in decimal by hand keep working. Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6") Cc: stable@vger.kernel.org Signed-off-by: Ciro Iriarte Link: https://patch.msgid.link/ea903e6c-09b5-4a11-80e8-6e1387f39ef5@gmail.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit e1755b73e7c0b9e9b52bd245207e85b087b1a025 Author: Shao Mingyin Date: Fri Nov 6 23:00:20 2026 +0800 nvmet: zns: return the namespace lookup error for Identify commit 687f3014afcd5826fa3d8f40b445f647b5a379b6 upstream. nvmet_execute_identify_ns_zns() jumps to done when nvmet_req_find_ns() fails, and that label overwrites status with a successful copy of the zeroed identify data. An Identify with CNS 05h and CSI 02h for a missing NSID therefore completes with SUCCESS and zeroed data instead of Invalid Namespace. Return the lookup error instead. Fixes: aaf2e048af27 ("nvmet: add ZBD over ZNS backend support") Cc: stable@vger.kernel.org Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit 7b51a8248888b3821c33b7ca71c0e63b492abc41 Author: Shao Mingyin Date: Fri Nov 6 23:00:19 2026 +0800 nvmet: zero the entire Get Log Page transfer buffer commit ad606ae5635b68e324005aaa06421be752619dab upstream. Several fixed-size Get Log Page handlers copy only the log structure and leave the rest of the host buffer untouched. The transport buffers are not zeroed, so a host requesting more bytes than the structure receives stale kernel memory. Zero the entire transfer length before filling the buffer in the Supported Log Pages, Commands Supported and Effects, Supported Features, Endurance Group, Rotational Media Information and Reservation handlers. For the Error log, also clamp the ring walk to the requested length and propagate copy failures instead of completing with success. The Rotational Media Information handler now accepts a buffer larger than its fixed structure. Fixes: 11ad507784ed ("nvmet: add error log page cmd handler") Fixes: 83acb24e6de7 ("nvmet: implement supported log pages") Fixes: 0866bf0c3778 ("nvmet: add commands supported and effects log page") Fixes: e973c91727d4 ("nvmet: implement supported features log") Fixes: 266b652c65b4 ("nvmet: implement endurance groups") Fixes: 5fd075cdaf36 ("nvmet: implement rotational media information log") Fixes: 5a47c2080a73 ("nvmet: support reservation feature") Cc: stable@vger.kernel.org Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit e170b3bc2a0517a1ba42405d32cb37a234e39ebd Author: Shao Mingyin Date: Thu Nov 12 22:01:06 2026 +0800 nvmet: use overflow-safe range checks in the file backend commit bcd5316e708d418f03707c183571549ad878cfff upstream. The file backend shifts a host-supplied SLBA to form a byte offset before checking it against the namespace size. The shift can discard high bits: with a 4 KiB block size, SLBA 2^52 + 1 becomes offset 4096. The range check then accepts a command aimed outside the namespace and the backend accesses data at the wrapped offset. Reject overflowing LBA-to-byte conversions and check the transfer length against the remaining namespace size without adding it to the offset. Apply the checks to reads, writes, discard and write zeroes. Fixes: 9c891c139894 ("nvmet: check fileio lba range access boundaries") Cc: stable@vger.kernel.org Signed-off-by: Shao Mingyin Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit 55698744b5f9c065e5f34a660867f2f88177ebf3 Author: Guixin Liu Date: Mon Nov 9 10:26:46 2026 +0800 nvmet: use GFP_KERNEL for PR allocations commit 976311c5594a7a26047891f087ad59a804e02baa upstream. nvmet_pr_update_reg_attr() and nvmet_pr_alloc_and_insert_pc_ref() allocate with GFP_ATOMIC, but both run in sleepable context: the PR command handlers execute from the transport workqueues and take the pr_sem semaphore, and the pc_ref allocation is reached from the connect and configfs paths. The latter function even passes GFP_KERNEL to the percpu_ref_init() in the same scope, so the GFP_ATOMIC only raises the failure rate for no reason. Switch both allocations to GFP_KERNEL. Fixes: 5a47c2080a73 ("nvmet: support reservation feature") Cc: stable@vger.kernel.org Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Reviewed-by: Nilay Shroff Signed-off-by: Guixin Liu Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit f5fb082e505ca602640deb4242dafccfba14152c Author: Shao Mingyin Date: Sat Nov 14 02:02:58 2026 +0800 nvmet: roll back queue bindings on connection failure commit 3f82752e089283eb8204b9d2ebd8246077031173 upstream. nvmet_install_queue() publishes the SQ controller pointer before claiming the CQ. If the CQ is already connected, it leaves the SQ pointer and the controller reference taken for it behind on failure. An install_queue() callback failure also leaves the CQ bound after clearing the SQ pointer. The reference taken in nvmet_install_queue() is in addition to the one the caller already holds: the caller's put releases the reference acquired before the call, while this one belongs to the CQ binding. It is not released on this path, so the controller stays alive and a Connect retry on the same queue keeps finding the stale binding. Clear the tentative SQ binding and release the extra reference on a CQ conflict. On a transport installation failure, destroy the CQ binding as well, so its controller table entry and reference are released. Link: https://lore.kernel.org/all/20261106015842.3534898-6-kanie@linux.alibaba.com/ Fixes: bb78836b3a7c ("nvmet: fabrics: add CQ init and destroy") Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit b033f8e91355c6dd5e0d25c4b52f813868b09766 Author: Shao Mingyin Date: Thu Nov 12 22:01:05 2026 +0800 nvmet: handle short reads and writes in the file backend commit 1738de07a79b9abdcffe03571c442033b80e7fed upstream. When the file backend falls back to its bvec mempool, large requests are submitted in synchronous chunks. A short completion advances the file position by the full chunk length and is eventually overwritten with the total request length. The target reports success for an incomplete write or returns unread buffer contents as valid data. The common completion path has another short-I/O case: a zero-byte return, such as a read at EOF after the backing file is truncated, is passed to errno_to_nvme_status() and becomes success. Stop at any incomplete chunk and convert nonnegative short completions to -EIO in both paths. Preserve negative errors and full completions. Fixes: d5eff33ee6f8 ("nvmet: add simple file backed ns support") Fixes: c6aa3542e010 ("nvmet: add error log support for file backend") Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit e5293314b07fd3831f2bb3c66dee243e0a261289 Author: Shao Mingyin Date: Sat Nov 14 02:02:49 2026 +0800 nvmet-tcp: only wait for in-capsule data for inline SGLs commit 9dac3b1aa2a99e126a5504b7f5bc781c8b2771e0 upstream. nvmet-tcp decides whether to wait for in-capsule data using only the write direction and SGL length. A write using a transport SGL can fit within inline_data_size without carrying any in-capsule data. The response path then withholds its R2T, leaving the command stuck. If request initialization fails, the same length-only test both withholds the error response and attempts to drain inline data that will never arrive. This can also consume the following PDU as data or a digest. Require an offset data-block SGL in both checks. Share a helper that only uses command and port fields, as the completion callback can run before nvmet_req_init() has finished. Fixes: bdaf13279192 ("nvmet-tcp: fix a segmentation fault during io parsing error") Fixes: 872d26a391da ("nvmet-tcp: add NVMe over TCP target driver") Cc: stable@vger.kernel.org Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit b01c139d9f8244904f39b3d34fad80d56f7caa4b Author: Shao Mingyin Date: Sat Nov 14 02:02:53 2026 +0800 nvmet-fcloop: free the LS request when delivery fails commit 8c1f99419b6cc51892e259497c8e10a5d079621a upstream. fcloop_h2t_ls_req() allocates a fcloop_lsreq from lsreq_cache and hands it to nvmet_fc_rcv_ls_req(). That function only takes ownership on success and returns an error without invoking any completion callback when the target port is shutting down, the LS payload is too large, or the target has no free LS request slot. The error is returned as-is, so the fcloop_lsreq is leaked; every failed LS during a target port teardown or an LS slot exhaustion loses one slab object. The target-to-host direction already frees the request when nvme_fc_rcv_ls_req() fails. Do the same here. Fixes: 772042dd38ee ("nvmet-fcloop: allocate/free fcloop_lsreq directly") Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit 3235b1dcb7990aeb4494d4f19a9ca11939962b36 Author: Shao Mingyin Date: Sat Nov 14 02:02:55 2026 +0800 nvmet-fc: reject duplicate queue IDs on Create Connection commit 153eac284ebf68be74993643e9b2fe2f9b2b1d88 upstream. nvmet_fc_alloc_target_queue() stores the new queue with WARN_ON(assoc->queues[qid]); assoc->queues[qid] = queue; The queue ID comes straight from the Create Connection LS and is only checked against NVMET_NR_QUEUES. A remote initiator can send a second Create Connection for a queue ID that already exists, or send queue ID 0 which was already created as the admin queue by Create Association. The WARN fires and the old pointer is overwritten: the old queue's base reference is never put, so its workqueue, nvmet_sq and nvmet_cq are never released. For the admin queue this also leaves the controller reference unreachable from nvmet_fc_delete_target_assoc(), so the controller and its subsystem reference leak permanently. Publish the queue with cmpxchg() and destroy the newly created queue if the slot is already taken, returning the normal queue allocation error to the initiator. This keeps the existing error path and makes both duplicate and admin queue IDs fail cleanly. Fixes: c53432030d86 ("nvme-fabrics: Add target support for FC transport") Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit d94074446ad4873fb0f992d855a915a7d7f6bd50 Author: Yaohan Li Date: Thu Nov 5 19:41:49 2026 +0800 nvme: stop asynchronous event work before ANA teardown commit 9b657c565984f28976b1e471e3ce2f81cc269238 upstream. NVMe ANA work has several producers, including ANA AER completion, namespace scanning and failover processing. An AER completion can queue ana_work for an ANA notice and can separately queue async_event_work, which sends the AEN uevent and submits the next asynchronous event request. These work items access controller-owned state during asynchronous processing. This issue was investigated and the fix was developed with AI assistance (ZCode/GLM-4). Fixes: 0d0b660f214dc ("nvme: add ANA support") Cc: stable@vger.kernel.org Signed-off-by: Yaohan Li Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit 45567cfdab260d2b1103776879f2ab0a309d2c23 Author: Shao Mingyin Date: Thu Nov 5 21:58:07 2026 +0800 nvme: reject invalid reconnect_delay sysfs values commit f92fe8dea19c743eb9e4d998ae0384344dd40091 upstream. nvme_ctrl_reconnect_delay_store() stores whatever kstrtou32() accepted into opts->reconnect_delay without validating it. The nvme-fabrics option parser refuses reconnect_delay values that are zero or negative, and the rest of the driver relies on that: nvme_ctrl_loss_tmo_store() computes opts->max_reconnects = DIV_ROUND_UP(ctrl_loss_tmo, opts->reconnect_delay); Writing 0 to reconnect_delay and then a positive value to ctrl_loss_tmo therefore divides by zero in the kernel. In addition, a value larger than INT_MAX is truncated to a negative int in the assignment and silently bypasses the checks done by the fabrics parser. Reject zero and values that do not fit into the signed int field. Fixes: 764075fdcb2f ("nvme: expose reconnect_delay and ctrl_loss_tmo via sysfs") Cc: stable@vger.kernel.org Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit 7c3ffd197dc9f53e15f9b6776634512ef8af768f Author: Yingjie Wang <1075151112@qq.com> Date: Fri Nov 6 14:25:16 2026 +0800 nvme: avoid wrapping admin_timeout and io_timeout commit 4a5aeebf1a00360bcc53c9e29fcd8d47aefa4c1d upstream. NVME_ADMIN_TIMEOUT and NVME_IO_TIMEOUT multiply the admin_timeout and io_timeout module parameters by HZ in unsigned int arithmetic, and nvme_fw_act_work() does the same through secs_to_jiffies(). The parameters accept any unsigned int, so values above UINT_MAX / HZ wrap. With HZ=1000, io_timeout=4294968 becomes 704 jiffies, and a controller created afterwards times out I/O after 0.7 seconds instead of about 49.7 days. On 32-bit systems, results above MAX_JIFFY_OFFSET are also unsafe relative delays and can be treated as already expired. These large values are used in practice. AWS documents nvme_core.io_timeout=4294967295 for EBS volumes and says Amazon Linux uses it by default. With HZ=1000, the current code happens to wrap this setting to 4294966296 jiffies, which still behaves as a long timeout on 64-bit systems. Add nvme_timeout_to_jiffies(), which caps the seconds value so that the result fits the u32 timeout fields and stays within MAX_JIFFY_OFFSET for 32-bit timers, and use it for both macros and for the firmware activation wait. On 64-bit kernels every timeout that did not wrap is unchanged. Larger values saturate instead of being rejected so that the documented setting keeps a long timeout. Fixes: 8ae4e4477d8f ("nvme: update timeout module parameter type") Cc: stable@vger.kernel.org Signed-off-by: Yingjie Wang <1075151112@qq.com> Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit 6bf4f76db6da2525838f629cb015010fe4f3bafe Author: Shao Mingyin Date: Sat Nov 14 02:02:50 2026 +0800 nvme-tcp: require the R2T offset to match the data sent commit 347d50d92e25d4b9c50c5f5c1d8b727b9c88d12c upstream. nvme_tcp_handle_r2t() rejects offsets below data_sent but accepts larger offsets. The send iterator still points at data_sent, so the next H2CData PDU carries bytes from that position while advertising the larger offset. A target that accepts the PDU can place the data at the wrong position; the Linux target rejects it and fails the connection. Require the R2T offset to equal data_sent, rejecting the invalid request before transmitting data with a mismatched offset. Fixes: 3f2304f8c6d6 ("nvme-tcp: add NVMe over TCP host driver") Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit 99e98ff2550b54416deb1b7e16c48878707e4b98 Author: Shao Mingyin Date: Sat Nov 14 02:02:47 2026 +0800 nvme-loop: release the target request when SG setup fails commit f2937481c28033e10e8a29b8742a767e73c696df upstream. nvme_loop_queue_rq() calls nvmet_req_init(), which takes a reference on the submission queue percpu ref, pins the namespace and, for a reservation-enabled namespace, takes a per-controller PR reference. If sg_alloc_table_chained() then fails under memory pressure, the function returns BLK_STS_RESOURCE without calling nvmet_req_uninit(). blk-mq retries the same request and nvmet_req_init() overwrites req->ns and req->pc_ref, leaking the queue, namespace and PR references taken by the failed attempt each time this happens. Release the request before returning BLK_STS_RESOURCE. Fixes: 3a85a5de29ea ("nvme-loop: add a NVMe loopback host driver") Cc: stable@vger.kernel.org Reviewed-by: Christoph Hellwig Signed-off-by: Shao Mingyin Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit 958749a36446192caf6b677c58d15dfd4717f3b9 Author: Shao Mingyin Date: Mon Nov 9 22:59:19 2026 +0800 nvme-auth: use the parsed offset for the DH-CHAP key commit f7141618d5d0b51bc2a64961bab738a0fe57e83f upstream. nvme_auth_parse_key() accepts the DH-HMAC-CHAP key with if (sscanf(secret, "DHHC-1:%hhd:%*s:", &key_hash) != 1) return -EINVAL; and then skips a hardcoded ten characters: key = nvme_auth_extract_key(secret + 10, key_hash); The ten characters assume that the hash identifier is exactly two characters long. A string such as "DHHC-1:1:" still makes sscanf() return 1, and secret + 10 then points one byte past the NUL terminator of the buffer. nvme_auth_extract_key() starts with strlen(secret), so it reads past the end of the allocation. The sysfs dhchap_secret and dhchap_ctrl_secret stores only require seven characters and a "DHHC-1:" prefix, so a short value reaches this code (even though the nvme-fabrics option parser rejects secrets shorter than eleven characters). Use the %n conversion to obtain the real offset after the "DHHC-1::" prefix and reject a string where the prefix is not complete. This accepts both one and two character hash identifiers and never starts the key past the terminator. Fixes: f50fff73d620 ("nvme: implement In-Band authentication") Cc: stable@vger.kernel.org Signed-off-by: Shao Mingyin Reviewed-by: Hannes Reinecke Reviewed-by: Christoph Hellwig Signed-off-by: Keith Busch Signed-off-by: Greg Kroah-Hartman commit 1adfb36bb0399e1e68c8c9018d127be299ad6b8b Author: Joas Antonio dos Santos Date: Thu Nov 12 16:23:27 2026 +0000 net: usb: smsc75xx: reject frames without a full header and FCS commit 1b02f90976d4bdf8c67d19dadf31b4bba05eb66f upstream. smsc75xx_rx_fixup() takes the frame length from the RX command word supplied by the device and strips the FCS by using "size - 4" for the allocation, skb_put() and memcpy() of each frame that is not the last one in the URB. The length is only checked against an upper bound and against skb->len, so a device can report a length field of 2..5, which gives a size of 0..3 after RXW_PADDING is subtracted. size is a u32, so "size - 4" then wraps to 0xfffffffc..0xffffffff. __netdev_alloc_skb() adds NET_SKB_PAD to the unsigned length, which wraps back to a small value and the allocation succeeds. skb_put() adds the length to the 32-bit skb->tail and skb->len, which also wrap, so the skb_over_panic() check does not fire. The following memcpy() then tries to copy almost 4 GiB from the URB buffer into that small allocation and writes far beyond it. A malicious or malfunctioning USB device can use this to corrupt kernel memory or crash the machine. A frame that holds an FCS but less than an Ethernet header is not valid either. usbnet drops it when it is the last frame in the URB, but the other frames go straight to usbnet_skb_return(), where eth_type_trans() reads an Ethernet header that was never copied into the new skb. Reject frames that are too short to hold an Ethernet header and an FCS, which covers both cases with one check. The driver does not set FLAG_RX_ASSEMBLE, so usbnet already counts rx_errors when smsc75xx_rx_fixup() returns 0. Also count rx_length_errors for these frames, as usbnet does for the short frames it drops itself. Found by LLM-assisted source review. Fixes: 1b3b2d9e772b ("net: usb: smsc75xx: stop lying about skb->truesize") Cc: stable@vger.kernel.org Signed-off-by: Joas Antonio dos Santos Reviewed-by: Andrew Lunn Link: https://patch.msgid.link/20261112-smsc75xx-rx-fcs-v3-1-6ad0378d0384@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit b26ab2af284493bd3e0c3dc7d8e978dc8ac8738b Author: Zxyan Zhu Date: Sat Nov 14 09:55:54 2026 +0800 net: stmmac: re-enable on-chip parity checkers for XGMAC ASP 0x2 commit 9c9863f9b9f120b771a908849157791a32eadb02 upstream. Commit 669a55560e4b ("net: stmmac: Check more MAC HW features for XGMAC Core 3.20") made dwxgmac3_safety_feat_config() bail out early for asp == 0x2, assuming that configuration has no parity protection. Per the DWC_xgmac databook, the ASP field of MAC_HW_Feature3 selects: 0x1 (AS_EPPE): all automotive safety features, with ECC and parity ports on the external application interface 0x2 (AS_NEPPE): all automotive safety features, without ECC or parity ports on the external application interface 0x3 (AS_PPE): all automotive safety features, with parity ports on the external application interface The reset value of the field is defined as: (DWCXG_ASP_ALL && DWCXG_ASP_PPE == 1) ? "3" : (DWCXG_ASP_ALL && DWCXG_ASP_PPE == 0) ? "2" : (DWCXG_ASP_ALL && DWCXG_ASP_PPE == 2) ? "1" : "0" so ASP 0x2 implies DWCXG_ASP_ALL = 1, where the internal FSM state parity and timeout (MAC_FSM_Control) and the on-chip data-path parity (MTL_DPP_CONTROL) features exist; only the ports on the external application interface are absent. The early return therefore skips enabling safety checkers that are present in the hardware. Drop 0x2 from the condition so the FSM and data-path parity checkers are enabled again. Also update the safety feature descriptions printed by stmmac_dma_cap_show() to spell out that ASP 0x1/0x2/0x3 differ only in the ECC or parity ports on the external application interface; the previous wording, "All Safety Features without ECC or Parity", suggests the on-chip checkers are absent from an ASP 0x2 device. Keep the early return for ASP 0x4 (EASP), which selects only ECC protection for external memory and has no on-chip parity features. Tested on XGMAC 3.10 and 3.40 cores. Fixes: 669a55560e4b ("net: stmmac: Check more MAC HW features for XGMAC Core 3.20") Cc: stable@vger.kernel.org Signed-off-by: Zxyan Zhu Reviewed-by: Maxime Chevallier Reviewed-by: Nicolai Buchwitz Link: https://patch.msgid.link/20261114015554.2187341-1-zxyan0222@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 0dd5c4d5c32ab1f3f256f56ebf6eb5c316e08a8a Author: Christian Schmidbauer Date: Sat Nov 14 14:36:37 2026 +0100 net: stmmac: honour Rx checksum errors in the AF_XDP zero-copy path commit fcfc52fcf89a3076c3a9afbbc70c0fecd2b5fc8d upstream. Commit ee0aace5f844 ("net: stmmac: Correctly handle Rx checksum offload errors") taught stmmac_rx() to honour the csum_none status, but stmmac_dispatch_skb_zc() still ignores it and sets CHECKSUM_UNNECESSARY for every IP frame whenever the checksum offload engine (CoE) is enabled. Since commit fe4042797651 ("net: stmmac: dwmac4: stop hardware from dropping checksum-error packets") dwmac4 delivers such frames instead of dropping them, so this path receives them. Mark the skb CHECKSUM_NONE when csum_none is set, as stmmac_rx() does. Fixes: bba2556efad6 ("net: stmmac: Enable RX via AF_XDP zero-copy") Cc: Signed-off-by: Christian Schmidbauer Reviewed-by: Maxime Chevallier Link: https://patch.msgid.link/20261114133640.3285413-2-opensource@grische.xyz Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit b5000815a5fb4de50960f4c4fbf4faab0d8e42af Author: Christian Schmidbauer Date: Sat Nov 14 14:36:39 2026 +0100 net: stmmac: dwmac1000: stop hardware from dropping checksum-error packets commit 2dd48c4615a67ebb1762c2b0d79801be1949fcfb upstream. When the checksum offload engine (CoE) is enabled, the dwmac1000 MAC silently drops any frame for which the engine detects a checksum error, before the driver sees it. This breaks VXLAN over IPv6 with zero UDP checksums, which RFC 6935 and RFC 6936 allow for tunnels. Set DMA_CONTROL_DT so that such frames are delivered instead of dropped, as commit fe4042797651 ("net: stmmac: dwmac4: stop hardware from dropping checksum-error packets") did for dwmac4. CoE remains enabled, so the driver still sees the error status and marks the skb CHECKSUM_NONE for the stack to verify. Set the bit only with enhanced descriptors. The normal descriptor parser does not report a checksum-only error to the stack, so cores that use it keep dropping such frames in hardware anyway. Tested on an Aruba AP-325 (ipq806x-gmac-dwmac) with Rx checksum offload on. Link: https://lore.kernel.org/all/20250625132117.1b3264e8@kernel.org/ Link: https://github.com/freifunk-gluon/gluon/issues/3783 Fixes: 47dd7a540b8a ("net: add support for STMicroelectronics Ethernet controllers.") Cc: # 6.6.x: ee0aace5f844: net: stmmac: Correctly handle Rx checksum offload errors Cc: # 6.6.x Signed-off-by: Christian Schmidbauer Reviewed-by: Maxime Chevallier Tested-by: Maxime Chevallier Link: https://patch.msgid.link/20261114133640.3285413-4-opensource@grische.xyz Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit e469eea4282016e833c2550563c46c7a9c1e6c15 Author: Christian Schmidbauer Date: Sat Nov 14 14:36:38 2026 +0100 net: stmmac: dwmac1000: don't discard frames with only a checksum error commit 596c9408682feba536d7f39de97959807eb3ba1c upstream. On dwmac1000 with enhanced descriptors, the hardware sets the Error Summary (ES) bit of the Rx descriptor not only for L2 errors but also for an L3/L4 checksum error. enh_desc_get_rx_status() returns discard_frame whenever ES is set, and since commit 1b746ce8b397 ("net: stmmac: don't overwrite discard_frame status") the checksum status is only evaluated for good frames. Return discard_frame only when ES comes with one of the L2 error bits. A frame with only a checksum error is then reported as csum_none and reaches the stack as CHECKSUM_NONE, so the stack verifies the checksum itself. This matches dwmac4, whose Error Summary bit does not cover checksum errors. RDES0 bit 7 is not in the mask, because depending on the core and on Rx checksum offload it reports a timestamp, an IP header checksum error or a giant frame, and enh_desc_get_rx_status() cannot tell which. In threshold Rx mode, a giant frame that fits one buffer therefore reaches the stack with a verified FCS. Also remove the pr_err that enh_desc_get_rx_status() prints when bit 7 is set. Once the MAC stops dropping checksum-error frames, any host on the link can flood the kernel log by sending frames with a bad IPv4 header checksum. This prepares for setting DMA_CONTROL_DT, which makes the MAC deliver checksum-error frames instead of dropping them in its Rx FIFO. Fixes: 1b746ce8b397 ("net: stmmac: don't overwrite discard_frame status") Cc: # 6.6.x: ee0aace5f844: net: stmmac: Correctly handle Rx checksum offload errors Cc: # 6.6.x Signed-off-by: Christian Schmidbauer Reviewed-by: Maxime Chevallier Tested-by: Maxime Chevallier Link: https://patch.msgid.link/20261114133640.3285413-3-opensource@grische.xyz Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit fa13bfecfb4b254ee7d0bf1b342399356b3f63a4 Author: Arun Iyengar Date: Fri Nov 13 17:13:40 2026 +0000 net: stmmac: drop the rest of the frame when napi_build_skb() fails commit ece404eac250fc4be7aa4cec82e8c248cca83c28 upstream. If napi_build_skb() fails on the first buffer of a frame that spans several descriptors, stmmac_rx() drops that buffer but goes on with the next descriptor of the same frame as if a new frame started there. The rest of the frame is then passed up the stack as a frame of its own. A frame spans several descriptors when it does not fit in the RX buffers of one descriptor. Mark the frame as errored instead, so that its remaining descriptors are discarded like those of a frame with a receive error. The frame is counted once in rx_dropped and once against the NAPI budget. Found while working on the sun8i EMAC jumbo frame series, where frames over 2032 bytes span several descriptors. Tested on an Orange Pi Zero2 (dwmac-sun8i, MTU 4070), w/ jumbo series and error injection. Fixes: ec222003bd94 ("net: stmmac: Prepare to add Split Header support") Cc: stable@vger.kernel.org Signed-off-by: Arun Iyengar Reviewed-by: Maxime Chevallier Link: https://patch.msgid.link/20261113-stmmac-rx-skb-fail-v1-1-fcaae89f2d2c@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 28393c7f1c07d4877312572234b2b9f7a82c7fe7 Author: Chris J Arges Date: Wed Nov 18 08:32:27 2026 -0600 net: prevent receive header offset overflow during decapsulation commit b10c986f1769287270de248548476f6dc2275d59 upstream. Repeated decapsulation can leave skb->data far from skb->head while the remaining packet data is still valid. Since the skb header positions are 16-bit offsets, a later header update can truncate and make header access use unrelated bytes and eventually crash. Limit receive headroom to 32 KiB. This is well beyond the headroom of normal packets while allowing the networking stack to pull enough headers in a single pass without overflowing 16-bit header offsets. Tunnel decapsulation re-enters __netif_receive_skb_core(), so its check protects nested IPIP and GRE. FOU and GUE bypass receive core, so check their IPv4 and IPv6 resubmission paths too. Together, these checks prevent 16-bit header-offset truncation in cases of repeated decapsulation. Report these rejections with the SKB_RX_HEADROOM drop reason. Fixes: 1a37e412a022 ("net: Use 16bits for *_headers fields of struct skbuff") Cc: stable@kernel.org Suggested-by: Eric Dumazet Signed-off-by: Chris J Arges Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261118-prevent_rx_header_offset_overflow-v1-1-92a5be55f994@cloudflare.com Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit 28005d0ea033a95d752db8cd35495d3dade5f5ae Author: Mateusz Jończyk Date: Sun Nov 15 22:40:45 2026 +0100 net: phy: realtek: fix listing of sysfs directory tree commit f16d85cd3de9d0c761b74155b4cbe2f20d3dcf80 upstream. On git master, listing the contents of sysfs produces an error: root@mateusz-debian:/sys# LANG=C find -iname foobar find: './module/realtek/drivers': Input/output error root@mateusz-debian:/sys# LANG=C ls -1 ./module/realtek/drivers ls: reading directory './module/realtek/drivers': Input/output error 'mdio_bus:Generic FE-GE Realtek PHY' 'mdio_bus:RTL8201CP Ethernet' 'mdio_bus:RTL8201F Fast Ethernet' 'mdio_bus:RTL8208 Fast Ethernet' 'mdio_bus:RTL8211B Gigabit Ethernet' [...] Investigation shows that the forward slash in the driver name is the culprit. Fix it. Cc: stable@vger.kernel.org Fixes: f0667918d5fc ("net: phy: realtek: add support for RTL8261D") Signed-off-by: Mateusz Jończyk Reviewed-by: Andrew Lunn Link: https://patch.msgid.link/20261115214045.3704-1-mat.jonczyk@o2.pl Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 17a2ac3259f5714231c10d0efa1bf6a96a6fd916 Author: Eric Dumazet Date: Fri Nov 13 13:46:23 2026 +0100 net: openvswitch: use skb_set_transport_header_careful() in parse_ipv6hdr() commit b9b77e2430032c21cc82b7da3a0bc0d8e74e6c26 upstream. skb->transport_header is a 16-bit offset from skb->head, and U16_MAX is reserved as the "not set" value. skb_set_transport_header() silently truncates an offset that does not fit. parse_ipv6hdr() stores the payload offset found by ipv6_find_hdr(), which depends on the extension headers found in the packet. Should the value be truncated, key_extract_l3l4() would parse the L4 header at the wrong place. Since commit 3744b0964d52 ("ipv6: Implement limits on extension header parsing") a single chain is bounded to IP6_MAX_EXT_HDRS_CNT headers (24576 bytes), so this needs a large skb->data - skb->head on top of it, for instance after several nested decapsulations, each of them possibly pulling its own extension header chain. No reproducer was written, this is hardening. Use skb_set_transport_header_careful() and return -EPROTO if the offset can not be stored. As for other ipv6_find_hdr() failures, the caller then sets the transport header to the network header and does not parse L4. While at it, use payload_ofs directly, since nh_ofs + nh_len == payload_ofs. Fixes: 1a37e412a022 ("net: Use 16bits for *_headers fields of struct skbuff") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet Reviewed-by: Ilya Maximets Reviewed-by: Aaron Conole Link: https://patch.msgid.link/20261113124625.4010206-4-edumazet@kernel.org Reviewed-by: Justin Iurman Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit f94887d5555cca08d51a62b8859cf8dcab0c18f5 Author: Nathan Chancellor Date: Sat Nov 14 21:38:26 2026 -0700 net: microchip: encx24j600: Avoid unsequenced accesses to jiffies in encx24j600_tx() commit 5ec918f8d66a0311c52cc767ade67e7019beb176 upstream. After a recent improvement in clang to warn on unsequenced accesses to volatile variables [1], an instance appears in encx24j600_tx(), which can break the build with CONFIG_WERROR=y / W=e: drivers/net/ethernet/microchip/encx24j600.c:898:14: error: unsequenced accesses to volatile qualified 'jiffies' [-Werror,-Wunsequenced] 898 | jiffies, jiffies - dev_trans_start(dev)); | ~~~~~~~ ^ Per C11 5.1.2.3.2, accessing a volatile object is a side effect. Per C11 6.5.2, unsequenced side effects on the same scalar object are undefined behavior. Per C11 6.5.2.2.10/12, the evaluation of arguments in a function call is indeterminately sequenced, meaning any side effects in the arguments are unsequenced. Add a local variable to hold the value of jiffies before the function call so that there are no unsequenced side effects, clearing up the warning. Cc: stable@vger.kernel.org Fixes: 04fbfce7a222 ("net: Microchip encx24j600 driver") Closes: https://github.com/ClangBuiltLinux/linux/issues/2196 Link: https://github.com/llvm/llvm-project/commit/955715460eaf9188c241c74750637fc82dfcc423 [1] Signed-off-by: Nathan Chancellor Reviewed-by: Andrew Lunn Link: https://patch.msgid.link/20261114-encx24j600-wunsequenced-v1-1-c978fc36cacd@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 4eeee54b4e4cf8fc2a3ad9c2b5a614cd765a1858 Author: Anthony Pighin Date: Thu Nov 12 09:31:40 2026 -0500 net: gianfar: clear the pending Rx skb when freeing the Rx ring commit c35761f43c582460b45429f51be5c2a0f07ed9af upstream. gfar_clean_rx_ring() keeps a frame that spans several Rx buffers in rx_queue->skb between NAPI polls. When the interface is stopped (close, MTU change, reset), free_skb_rx_queue() frees that skb but leaves the pointer set, and nothing clears it when the rings are set up again. After the restart, gfar_clean_rx_ring() picks up the stale pointer. The first buffer it sees has RXBD_FIRST set, so the overrun handling frees the skb a second time. By then the skb has usually been reallocated, so the second free releases another owner's skb and data while they are still in use. Clear rx_queue->skb after freeing it. Hit during development, as intermittent kernel panics in our automated regression on an NXP LS1021A board (eTSEC), in an L2 Ethernet traffic test that shuts and re-enables ports. It was seen on 6.6, 6.12 and 6.18 based kernels, crashing in unrelated places such as kmem_cache_alloc() called from build_skb() in gfar_poll_rx_sq(). With the fix, the same test ran 90 bounces with no warnings or crashes. Fixes: 75354148ce69 ("gianfar: Add paged allocation and Rx S/G") Cc: stable@vger.kernel.org Signed-off-by: Anthony Pighin Reviewed-by: Daniel Machon Link: https://patch.msgid.link/20261112143140.1395197-1-anthony.pighin@nokia.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 2abf939263a0bc3a659e5a6b7a3fe15ffdc1dda3 Author: Svyatoslav Nikolenko Date: Thu Nov 12 16:58:20 2026 -0800 net: e1000: fix warning in iounmap on probe failure commit cf704cc62ffaf9206f1cbc12c2a3baec316b0ac1 upstream. In e1000_probe(), the error unwinding path at err_sw_init unconditionally calls iounmap(hw->ce4100_gbe_mdio_base_virt). On non-CE4100 hardware, hw->ce4100_gbe_mdio_base_virt remains NULL. Passing NULL to iounmap() triggers a WARN_ON_ONCE on x86 architectures. Furthermore, on CE4100 hardware, if probe fails before or during MDIO mapping, ce4100_gbe_mdio_base_virt is also NULL. Fix this by adding a NULL pointer check before calling iounmap() on hw->ce4100_gbe_mdio_base_virt. iounmap(hw->hw_addr) remains unconditional because every code path reaching err_sw_init occurs after hw->hw_addr has been successfully mapped. Reported-by: syzbot+ca1ef9e2e234b8d3599b@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=ca1ef9e2e234b8d3599b Fixes: 13acde8fffc0 ("e1000: cleanup CE4100 MDIO registers access") Cc: stable@vger.kernel.org Signed-off-by: Svyatoslav Nikolenko Reviewed-by: Aleksandr Loktionov Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113005823.130021-4-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 118bd0dce280a6b6cdc3b531a5a5c443c89fc8ae Author: Daniel Wade Date: Sun Nov 15 23:32:11 2026 +1030 net: bridge: fix skb leak of reinjected link-local frames commit 98382d41f92f048cf3cbb7af415f48a722b19ebc upstream. br_handle_frame() passes the link-local frames it neither forwards nor delivers (01:80:c2:00:00:02 to 0d and 0f, unless set in the group forward mask) through NF_HOOK() at NF_BR_LOCAL_IN. Since commit 3b2e2904deb3 ("net: bridge: fix per-port af_packet sockets") the okfn only learns the source and returns 1, which becomes RX_HANDLER_PASS. That commit sent the nf_queue case to RX_HANDLER_CONSUMED, which is right for the synchronous return, but the frame comes back: on reinjection nf_reinject() calls the okfn and ignores its return value, because every other okfn consumes the skb. This one no longer does, so nothing frees the frame. NFQA_CFG_F_FAIL_OPEN leaks it the same way with no verdict at all, when the queue or the listener's socket is full. Each frame leaks an skb, and one sent from a local socket keeps that socket charged, so neither it nor the network namespace holding it is freed. Bridge, rule and queue need only CAP_NET_ADMIN in a netns, so with user namespaces an unprivileged user can exhaust kernel memory. nf_reinject() cannot free the skb on a 1 from the okfn, because other okfns return NET_RX_DROP, which is 1, after freeing it. Call nf_hook() instead of NF_HOOK() and do the learning and the RX_HANDLER_PASS return in br_handle_frame() on 1, as the 0x00 and 0x0e cases already do and as vrf_rcv_nfhook() does. The okfn then runs only for a reinjected frame, which br_handle_frame() has already reported consumed and cannot pass on the port, so it learns from the frame and frees it. These frames were not delivered before this change either. Also set *pskb before the new RX_HANDLER_PASS, as the other such returns do; skb_share_check() may have replaced the skb, and the commit above added that return without the assignment. Discovered by an AI code review agent and reproduced on unmodified mainline under KASAN: an unprivileged user in a new user and network namespace bridged a veth, queued link-local frames to an NFQUEUE listener that accepted every one, and leaked an skb per frame. With this patch the reinjected frames are freed and nothing leaks. Fixes: 3b2e2904deb3 ("net: bridge: fix per-port af_packet sockets") Cc: stable@vger.kernel.org Signed-off-by: Daniel Wade Reviewed-by: Xia Yan Acked-by: Nikolay Aleksandrov Link: https://patch.msgid.link/20261115130211.7724-1-danjwade95@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 0cef7451219aca028c27eb00fcb5ac0fb129bbf9 Author: Daejun Park Date: Tue Nov 10 09:38:17 2026 +0900 xfs: wait for direct I/O before swapping extents commit 844bc1167f1b2d19d9495a556599af24dc4468bd upstream. An AIO direct write drops the iolock before its bios complete. XFS_IOC_SWAPEXT does not wait for it. The write can land in blocks that the swap moved to the temporary file. Once xfs_fsr frees them, the write corrupts whatever reuses them. Wait for direct I/O first, as exchange-range does. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Daejun Park Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman commit ea77e9d99687f52af7a10661ed3aa5781cf46314 Author: Rik van Riel Date: Wed Nov 4 10:01:15 2026 -0500 xfs: keep successful near rt allocations commit f9bfe5af596a5ef6fc745c30bda41f9a109ed16d upstream. XFS realtime allocations first attempt to allocate space near where other parts of a file already are. If that allocation succeeds, it does not have to do a global search for free space. Unfortunately, a code cleanup a while ago causes xfs_rtallocate_rtg to unconditionally do the global search, even when the search for a nearby extent has succeeded. Fix it by running the global search only when the near search did not find available space. Found by noticing higher kernel CPU use and examining the profile. Fixes: fd048a1bb391d ("xfs: rework the rtalloc fallback handling") Cc: stable@vger.kernel.org # v6.12 Reported-by: Christian Andres Saide Signed-off-by: Rik van Riel Reviewed-by: Christoph Hellwig Reviewed-by: Carlos Maiolino Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman commit 477ce7768df315166d1b90cc0f4cb4e46ea9bcf9 Author: Hengyu Liang Date: Thu Nov 12 05:20:18 2026 -0500 xfs: fix f_bfree underflow in statfs() commit f0b9e58eee233547e5d77e467ccee89d7a59dd63 upstream. Commit dd324cb79e54 ("xfs: refactor xfs_fs_statfs") made xfs_statfs_data() limit f_bfree with max(0LL, ...) instead of max_t(int64_t, 0, ...). However, the value is an unsigned difference, so max() never picks 0. As of now, when the free block counter is below the count of unavailable blocks, statfs() reports f_bfree and f_bavail close to 2^64 instead of 0, and df prints negative sizes. A similar issue happened before and was fixed by commit 237aac4624aa ("xfs: ensure f_bfree returned by statfs() is non-negative"). Perhaps the refactored code needs that fix as well. The issue can be reproduced on a new 2 GiB filesystem mounted on /mnt: for i in $(seq 3000); do head -c 65536 /dev/zero > /mnt/s$i; done dd if=/dev/zero of=/mnt/big bs=1M xfs_io -x -c 'resblks 100000000' /mnt for i in $(seq 1 2 3000); do rm /mnt/s$i; done sync df -h /mnt Before commit dd324cb79e54 ("xfs: refactor xfs_fs_statfs"), the result is: Filesystem Size Used Avail Use% Mounted on /dev/vda 2.0G 2.0G 0 100% /mnt After that commit, the result is: Filesystem Size Used Avail Use% Mounted on /dev/vda 2.0G -64Z -24K 100% /mnt This patch will compare the difference as a signed value again. Fixes: dd324cb79e54 ("xfs: refactor xfs_fs_statfs") Cc: stable@vger.kernel.org # v6.14 Signed-off-by: Hengyu Liang Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman commit 87e3897a271d29263c903ac4e0263c9b0002b5c9 Author: Daejun Park Date: Mon Nov 9 17:26:56 2026 +0900 xfs: break layouts before swapping extents commit 0d8026c7ac0c79a8ebe2942a3c3114c06aced734 upstream. XFS_IOC_SWAPEXT does not break pNFS layouts. A client can keep writing to blocks that the swap moved to the temporary file. xfs_fsr frees those blocks when it closes that file. The writes then land in whatever reuses them. Lock with xfs_ilock2_io_mmap(), as the exchange-range ioctls do. Fixes: 781355c6e5ae ("xfs: recall pNFS layouts on conflicting access") Cc: stable@vger.kernel.org Signed-off-by: Daejun Park Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman commit 961cac97b7d151029048424c1ee144568850e0bf Author: Ding Feng Date: Thu Nov 19 11:10:26 2026 +0800 zonefs: ignore RLIMIT_FSIZE above LLONG_MAX in zonefs_write_check_limits() commit fb5289b697c965581104bafdd875b969a1db3e79 upstream. zonefs_write_check_limits() follows generic_write_check_limits() and has the same problem: it stores rlimit(RLIMIT_FSIZE), an unsigned long, in a loff_t, so a soft limit between 2^63 and RLIM_INFINITY is negative and every write fails with -EFBIG and raises SIGXFSZ. Keep the limit unsigned and apply it only when it is at most LLONG_MAX, as the generic helper now does. Fixes: ebfd68cd0c1e ("zonefs: Fix O_APPEND async write handling") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-5-5 Frama-C Signed-off-by: Ding Feng Signed-off-by: Damien Le Moal Signed-off-by: Greg Kroah-Hartman commit d103633c69e530918fa4d616639efe6f4195ca80 Author: Ard Biesheuvel Date: Thu Oct 29 14:50:23 2026 +0100 arm64: Drop stdint.h type overrides from asm/neon-intrinsics.h commit a041bdbe1f3a8efa8a527a89c84d3771232b4942 upstream. None of the users of NEON intrinsics include anymore, and so there is no longer a need to override __INT64_TYPE__ and __UINT64_TYPE__ in order to make the definitions of int64_t and uint64_t provided by the compiler's freestanding compatible with the kernel's. So drop the overrides. This also means that uint64_t now matches the type that Clang uses for 64-bit quantities in the prototypes of its NEON builtins, and so the -Wincompatible-pointer-types warnings that are currently being disabled for all NEON intrinsics code will no longer occur. So drop the pragma that disables them as well. Signed-off-by: Ard Biesheuvel Tested-by: Nathan Chancellor Reviewed-by: Eric Biggers Cc: Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit bad512c9c5aa0ba4e42193e3752a621a5e774a3d Author: Ard Biesheuvel Date: Thu Oct 29 14:50:22 2026 +0100 xor: arm/arm64: Move NEON xor_gen() dispatch into the glue code commit 14e3460321430a3f9ed2260f3c6198bdeaba5792 upstream. The NEON intrinsics code in xor-neon.c and arm64/xor-eor3.c includes xor_impl.h for the definition of __DO_XOR_BLOCKS(), which pulls in via and . This only works because asm/neon-intrinsics.h overrides the compiler's predefined macros that uses to define the C99 types, so that they match the kernel's definitions in . So instead, follow the approach taken by LoongArch, and instantiate the dispatch routines using DO_XOR_BLOCKS() in the glue code, which already includes the kernel headers, and does not use NEON intrinsics itself. This requires the NEON routines that handle a fixed number of sources to be exposed to the glue code, which means that the arm64 glue code can use __xor_neon_2() directly for the EOR3 flavor as well, and so the __xor_eor3_2() alias can be dropped. This makes the NEON intrinsics code independent of the kernel's own headers, which will allow the macro overrides in asm/neon-intrinsics.h to be removed. Signed-off-by: Ard Biesheuvel Tested-by: Nathan Chancellor Reviewed-by: Eric Biggers Cc: Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 9d89ac8d10b097bb4a1360b5f310e45b91b95e69 Author: Krystian Kaniewski Date: Fri Sep 4 14:12:59 2026 +0200 xarray: fix index jumping backwards in xas_find() commit a4e667346a8d91e629a2ca9affc70dc28978f4a1 upstream. A bug in the XArray iterator xas_find() causes the iterator's index (xas->xa_index) to jump backwards when iterating over a multi-index entry (like a THP) that resides in a non-leaf node and is concurrently split. When iterating over a multi-index entry in a non-leaf node, xas_load() sets xas->xa_offset to the base offset of the entry, but leaves xas->xa_index at the requested index. When the caller subsequently wants to advance to the next entry, xas_find() is called. xas_find() attempts to synchronize xas->xa_offset with xas->xa_index before advancing. However, the fixup logic was incorrectly restricted to leaf nodes (!xas->xa_node->shift). Because the THP resides in a non-leaf node, the fixup is skipped. As a result, xas_find() simply increments xas->xa_offset and recalculates xas->xa_index based on this new offset. This causes xas->xa_index to jump backwards. If the THP was concurrently split, the entry at the new offset is a node pointer, so xas_find() descends into it and returns the folio at the backwards index. The caller (filemap_map_pages()) then calculates the PTE pointer based on this backwards index, resulting in an invalid memory access such as an out-of-bounds read or use-after-free on a page-table page freed via tlb_remove_table_rcu(). A userspace access that faults in a file-backed mapping can trigger this path. When the index moves backwards, filemap_map_pages() can calculate a PTE outside the page locked for fault-around and dereference a freed page-table page, resulting in a KASAN-detected use-after-free read. To fix this, check if xas->xa_offset matches get_offset(xas->xa_index, xas->xa_node). If it does not and the node is a non-leaf node, set xas->xa_offset to get_offset(xas->xa_index, xas->xa_node) before advancing. Also add test cases in test_xarray to verify xas_find() behavior when iterating over and splitting multi-index entries. Link: https://lore.kernel.org/20260904121301.200049-1-krystianmkaniewski@gmail.com Fixes: b803b42823d0 ("xarray: Add XArray iterators") Reported-by: syzbot+b72767277f29b6407083@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=b72767277f29b6407083 Closes: https://syzkaller.appspot.com/ai_job?id=a01c56bd-74d0-411c-afb4-ee6f0cb6cb61 Signed-off-by: Krystian Kaniewski Signed-off-by: Andrew Morton Tested-by: Jose Fernandez (Anthropic) Link: https://lore.kernel.org/20261104-jf-filemap-v2-pedro-reply-r2-74c87c6fbcf@linux.dev Cc: Matthew Wilcox (Oracle) Cc: Mike Rapoport Cc: Signed-off-by: Greg Kroah-Hartman commit 66fa8a37079aae84091d585fc2472990e0d60805 Author: Tony Luck Date: Thu Nov 19 10:45:24 2026 -0800 x86/resctrl: Add SNC support for Granite Rapids "D" CPU commit 0833bc1d4ad71144500f6ca8601672580624f24f upstream. Sub-NUMA Cluster (SNC) mode divides available RMID counters between NUMA nodes that share an instance of an L3 cache. Granite Rapids "D" CPUs can enable SNC mode, so Linux must adjust when SNC is enabled. Update the table of SNC capable CPU models. Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov (AMD) Cc: Link: https://patch.msgid.link/20261119184524.12846-1-tony.luck@intel.com Signed-off-by: Greg Kroah-Hartman commit 90e1d3d2dd67eebc26c3aa6c72b5e645b0af00e1 Author: Adrian Schlegel Date: Mon Oct 12 21:33:05 2026 +0200 x86/mce: Do not treat cache hierarchy errors as memory errors commit 29b74cf57f432d60da2b79c827f1379125409611 upstream. On Intel and Zhaoxin, mce_is_memory_error() also returns true for cache hierarchy errors. All callers expect it to report memory errors only. The CEC uses it to count corrected DRAM errors. A corrected cache error only names the cache line that was affected, not a faulty DRAM page. With a faulty CPU core, the CEC therefore soft-offlines healthy pages. On an i9-9900K this caused about 500 soft-offline attempts per hour. Report only memory controller errors on Intel and Zhaoxin, as is already done for AMD. Fixes: fa92c5869426 ("x86, mce: Support memory error recovery for both UCNA and Deferred error in machine_check_poll") Signed-off-by: Adrian Schlegel Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Qiuxu Zhuo Reviewed-by: Tony Luck Reviewed-by: Yazen Ghannam Reviewed-by: Sohil Mehta Cc: Link: https://patch.msgid.link/20261012193305.38931-1-me@adrianschlegel.com Signed-off-by: Greg Kroah-Hartman commit 6c9d2df0faf089b2c54b590c6bb4e4f986c3cf4e Author: Richard Weinberger Date: Thu Jun 25 11:06:27 2026 +0200 x86/Kconfig: Enable ROX also when STRICT_KERNEL_RWX is present commit ae3398a7da224e1cb14a04ce8e9da66fc2948121 upstream. Running a kernel with CONFIG_MODULES=n causes the W+X page detection to trigger: x86/mm: Found insecure W+X mapping at address 0xffffffffc033a000 The W+X pages come from __its_alloc() with type being EXECMEM_MODULE_TEXT. Without ARCH_HAS_EXECMEM_ROX pgprot is PAGE_KERNEL instead of PAGE_KERNEL_ROX. Fixes: 47410d839fcda ("x86/Kconfig: only enable ROX cache in execmem when STRICT_MODULE_RWX is set") Suggested-by: Mike Rapoport (Microsoft) Signed-off-by: Richard Weinberger Signed-off-by: Borislav Petkov (AMD) Acked-by: Peter Zijlstra (Intel) Acked-by: Mike Rapoport (Microsoft) Tested-by: Vinny Horgan Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260625090627.1501095-1-richard@nod.at Signed-off-by: Greg Kroah-Hartman commit 32c4ca4fd4a2e98d34fd31cda0424a65de6305cb Author: WeitaoWang-oc Date: Sat Oct 17 02:10:16 2026 +0800 x86/apic/msi: Fix MSI interrupt affinity configuration commit 068d82afd070beb8ea32c8ee64d685af7d3f36e2 upstream. The two step update sequence in msi_set_affinity() is required for MSI interrupts which cannot be migrated atomically, i.e. devices which do not provide MSI masking. The MSI message update writes address and data registers separately, so such a device can raise an interrupt in between, which results in a message built from half updated state: a stray interrupt on a stale vector and a possibly lost device interrupt. The update sequence is selected by a per interrupt quirk flag, which is set for interrupts which cannot use reservation mode. Reservation mode is only enabled for maskable interrupts, i.e. devices which provide MSI-X or mask support, so the quirk flag is the inverse of the reservation mode bit. The removal of the quirk flag replaced the flag check with a reservation mode check, but dropped the negation of the removed condition: - if (!irqd_msi_nomask_quirk(irqd) || ...) + if (!irqd_can_reserve(irqd) || ...) As the quirk flag is the inverse of the reservation mode bit, the replacement inverted the condition and selects the wrong update path for every interrupt: non-maskable interrupts take the direct update path again, which reopens the race, while maskable interrupts needlessly go through the two step update. Restore the original condition so that the direct update path is selected when reservation mode is enabled, which also matches the comment above the check: direct update is possible when the MSI is maskable, which is the case when the reservation mode bit is set. [ bp: Massage commit message. ] Fixes: b56ebe7c896d ("x86/apic/msi: Fix misconfigured non-maskable MSI quirk") Signed-off-by: Weitao Wang Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Koichiro Den Acked-by: Thomas Gleixner Cc: stable@vger.kernel.org # v6.1+ Link: https://patch.msgid.link/20261016181016.3850-1-WeitaoWang-oc@zhaoxin.com Signed-off-by: Greg Kroah-Hartman commit 99e05c2155bbd0881196a4cfa16d2565016174b9 Author: Antonio Borneo Date: Mon Nov 16 14:24:02 2026 +0100 watchdog: stm32_iwdg: set driver data before requesting interrupt commit 25c38ab9e6b69cfdc13aeff19470f7d0893b1702 upstream. The interrupt handler accesses the driver data, which is currently set after devm_request_irq() returns. If the watchdog was started by the bootloader and a pretimeout interrupt is pending, the handler can run before the driver data is set, resulting in a NULL pointer dereference. Move the IRQ request after setting the driver data to ensure it is available when the interrupt handler runs. Fixes: 3ab1663af6c1 ("watchdog: stm32_iwdg: Add pretimeout support") Cc: stable@vger.kernel.org Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20261106163429.618392-1-antonio.borneo%40foss.st.com?part=3 Signed-off-by: Antonio Borneo Link: https://patch.msgid.link/20261116132416.1184447-2-antonio.borneo@foss.st.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 042f96c8162f742a6265fb78e1f076403c5b43d5 Author: Antonio Borneo Date: Mon Nov 16 14:24:03 2026 +0100 watchdog: stm32_iwdg: serialize accesses to EWCR register commit abbf55699ff6a8830b864aa1fab9f24edc9e72a6 upstream. On STM32MP1xx platforms, EWCR contains both the pretimeout interrupt configuration and a write-only bit used to acknowledge the interrupt. On SMP systems, the read-modify-write operation in the pretimeout IRQ handler can race with writes that update the pretimeout configuration. Protect these accesses with a spinlock to prevent concurrent updates. Don't use the helpers reg_read()/reg_write() in the critical sections as they rely on relaxed memory access, which are not ordered against locking. Fixes: 3ab1663af6c1 ("watchdog: stm32_iwdg: Add pretimeout support") Cc: stable@vger.kernel.org Signed-off-by: Antonio Borneo Link: https://patch.msgid.link/20261116132416.1184447-3-antonio.borneo@foss.st.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 07ef71f1e2f7ee5816afe7d0e01a727f358a562e Author: Zhao Feng Date: Wed Nov 11 16:32:36 2026 +0800 watchdog: npcm: fix sleeping clock call in restart handler commit 4e83ea5b22193fd0db8bcee5682935f1d528705e upstream. The watchdog .restart callback runs in atomic context: it is invoked from the restart handler chain via atomic_notifier_call_chain(), under an RCU read-side critical section, on every reboot or restart. Since commit af084fdccfaf ("watchdog: npcm: Enable clock if provided"), npcm_wdt_restart() calls clk_prepare_enable(), and clk_prepare() takes a mutex unconditionally, so kernels built with CONFIG_DEBUG_ATOMIC_SLEEP=y report BUG: sleeping function called from invalid context on every reboot. Worse, a panic-time restart can block on prepare_lock and never issue the reset at all. Get the clock with devm_clk_get_optional_prepared() at probe time and keep it prepared for the lifetime of the driver, so the restart handler only needs clk_enable(), which is safe in atomic context. With the clock permanently prepared, npcm_wdt_start() and npcm_wdt_stop() are simplified to clk_enable()/clk_disable() as well. Fixes: af084fdccfaf ("watchdog: npcm: Enable clock if provided") Cc: stable@vger.kernel.org Signed-off-by: Zhao Feng Link: https://patch.msgid.link/20261111083236.248-1-zhaofeng2@cmss.chinamobile.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit c467652f687e5be0ef4140c6f9d0ddd6209299ab Author: Miklos Szeredi Date: Tue Nov 3 17:19:10 2026 +0100 virtiofs: fix use-after-free of fs->tag on device removal commit 6df984631391616dafd9b989a3505d93ca4fd235 upstream. The virtio_fs object is refcounted via its kobject, so a mount can keep it alive well beyond the lifetime of the virtio device binding. The tag string, however, was allocated with devm_kmalloc() and is therefore freed by devres_release_all() as soon as the device is unbound, i.e. right after virtio_fs_remove() returns (see device_unbind_cleanup() in drivers/base/dd.c). virtio_fs_get_tree() looks up the instance, takes a kobject reference and then drops virtio_fs_mutex before doing the sleepable part of the mount (allocations, fuse_conn_init(), sget_fc()). A concurrent device removal can complete in that window: CPU 0 (mount) CPU 1 (remove) ------------- -------------- virtio_fs_get_tree() virtio_fs_find_instance() // reference taken, mutex dropped virtio_fs_remove() list_del_init(&fs->list); // driver core unbinds device // devres frees fs->tag virtio_fs_fill_super() mutex_lock(&virtio_fs_mutex); if (list_empty(&fs->list)) pr_info(... fs->tag); <-- use-after-free The virtio_fs object itself is still valid here, only its tag has been freed behind its back. Fix the lifetime mismatch at the source: allocate the tag with kmalloc() and free it from virtio_fs_ktype_release(), so that it lives exactly as long as the object embedding it. All probe error paths already drop the final kobject reference, so they are covered. Merely dropping the tag from the error message would paper over this instance while leaving a devres pointer embedded in an object that routinely outlives its device. The other readers of fs->tag are unaffected: tag_show() is fenced off by the kobject_del() in virtio_fs_remove(), the automatic KOBJ_REMOVE uevent is emitted from __kobject_del() while the device is still bound, and both virtio_fs_add_instance() and virtio_fs_find_instance() only walk instances still on virtio_fs_instances. Fixes: a62a8ef9d97d ("virtio-fs: add virtiofs filesystem") Cc: Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-0328b3a1-043b-468e-8425-6a613d91b5ef Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman commit 13226cacd346efcb8b8c5b1fd4898f793b9a6882 Author: Michael S. Tsirkin Date: Fri Nov 6 09:11:07 2026 -0500 vhost: split out-of-order used ring batches at every wrap commit 5570a998b884c988dbe105430d7e2d8e9411e37e upstream. When a completion batch larger than the remaining space in the used ring is added without VIRTIO_F_IN_ORDER, vhost_add_used_n_ooo() splits it at the ring boundary only once. vhost-net can batch up to VHOST_NET_BATCH TX completions, so with a queue smaller than half the batch the tail of the second chunk runs past the end of the used ring and into whatever follows it in the vhost owner's address space: with a 32 entry queue, last_used_idx % 32 == 3 and a 64 entry batch, three used entries are written past the ring. To fix, keep splitting the remaining batch at each wrap until it is exhausted. Cc: stable@vger.kernel.org Reported-by: Seohyeon Maeng Cc: minki@morningstarsec.dev Fixes: 2b3b35eb989 ("vhost_net: batch used ring update in rx") Fixes: 4afb52c2af44 ("vhost_net: batch update used ring for datacopy TX") Cc: Jason Wang Signed-off-by: Michael S. Tsirkin Signed-off-by: Greg Kroah-Hartman commit 1aded8c35716a3f9b19fbfe71003992a99103a75 Author: Matt Turner Date: Wed Nov 11 19:28:56 2026 -0500 vgacon: Fall back to the dummy console if mapping VGA memory fails commit e3512c7628621f7048a9615d21fd7cf63173c518 upstream. On Alpha, setup_arch() registers vgacon whenever CONFIG_VGA_CONSOLE is enabled. On Marvel (EV7) systems whose SRM console is serial, no VGA hose is set, so marvel_ioremap() finds no hose for 0xb8000 and returns NULL. vgacon_startup() then probes video memory through that NULL pointer and oopses in console_init(): Unable to handle kernel paging request at virtual address 0000000000000000 pc is at vgacon_startup+0x174/0x910 VGA_MAP_MEM() is ioremap() on Alpha and powerpc and can fail. Treat failure like a failed probe and fall back to the dummy console. If a VGA card is present, locate_and_init_vga() still switches to vgacon once PCI is up. Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Matt Turner Reviewed-by: Magnus Lindholm Tested-by: Magnus Lindholm Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit 3c2b6af5d0b596807fb498d11dc6ce7089e34f0b Author: Mike Rapoport (Microsoft) Date: Sat Oct 31 20:14:03 2026 +0200 userfaultfd: clear uffd state in child PTEs if uffd is released during fork commit 111894c595a078d8481db34f3355e8531990668e upstream. With UFFD_FEATURE_EVENT_FORK the userfaultfd context is duplicated for the child process, the child VMAs are registered with the new context, and uffd protection state from the parent PTEs is copied into the child. If the parent's userfaultfd is released before the fork event is read, userfaultfd_release_new() resets the VMA flags but keeps uffd state in the child PTEs. This leaves the child's VMAs in an inconsistent state: they are not registered with userfaultfd but their mappings carry uffd protection state. If the child registers the range with userfaultfd again, the stale state turns into protection the child never asked for. When a write fault makes such a PTE writable without copying the page, the uffd bit remains set and page_table_check_pte_flags() warns about it. Split resolving of the uffd PTE state out of userfaultfd_clear_vma() and call it from userfaultfd_release_new() before resetting the VMA. Link: https://lore.kernel.org/20261031-uffd-prot-bits-fork-event-v2-1-c448e57df417@kernel.org Fixes: f369b07c8614 ("mm/uffd: reset write protection when unregister with wp-mode") Signed-off-by: Mike Rapoport (Microsoft) Signed-off-by: Andrew Morton Reviewed-by: Jose A. Perez de Azpillaga Tested-by: Jose A. Perez de Azpillaga Reviewed-by: Tal Zussman Tested-by: Tal Zussman Cc: Peter Xu Cc: Signed-off-by: Greg Kroah-Hartman commit 668bf1729e335af0995163afcd305386cbd96a7a Author: Eric Dumazet Date: Fri Nov 13 13:46:25 2026 +0100 udp: use skb_set_transport_header_careful() in __udp6_lib_err_encap() commit 02f578b736f1524ed73ef879fb1cf1ba4a875aa4 upstream. skb->transport_header is a 16-bit offset from skb->head, and U16_MAX is reserved as the "not set" value. skb_set_transport_header() silently truncates an offset that does not fit. __udp6_lib_err_encap() stores @offset, computed by icmpv6_notify() from the extension headers of the packet embedded in an ICMPv6 error. Should the value be truncated, the tunnel encap_err_lookup() and err_handler() callbacks would read the UDP header at the wrong place. Since commit 3744b0964d52 ("ipv6: Implement limits on extension header parsing") a single chain is bounded to IP6_MAX_EXT_HDRS_CNT headers (24576 bytes), so this needs a large skb->data - skb->head on top of it, for instance after several nested decapsulations, each of them possibly pulling its own extension header chain, since @offset is relative to the IPv6 header embedded in the ICMPv6 error. No reproducer was written, this is hardening. Use skb_set_transport_header_careful() and return an error if the offset can not be stored, in which case udpv6_err() ignores the ICMPv6 error. Do this before changing the network header, so that nothing has to be restored on failure. Fixes: a36e185e8c85 ("udp: Handle ICMP errors for tunnels with same destination port on both endpoints") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet Reviewed-by: Stefano Brivio Link: https://patch.msgid.link/20261113124625.4010206-6-edumazet@kernel.org Reviewed-by: Justin Iurman Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit 611cd5f81ff15d8bf9d634c800ad0dfa5c6d209b Author: Shao Mingyin Date: Sun Nov 15 00:33:52 2026 +0800 ublk: dispatch the next fetch after a batch failure commit a6f37fb3f5747bb7cca5cd6630dfeea4435022a1 upstream. When a batch fetch fails, for example because its provided-buffer group is empty, ublk_batch_dispatch() removes the failed fetch and returns. Pending I/O tags stay in evts_fifo even if another fetch with usable buffers is already queued. With no new I/O or fetch submission to select it, that fetch and the outstanding block requests cannot make progress. Claim the next queued fetch under evts_lock before completing and freeing the failed one, then schedule its dispatch in the proper task context. Marking it active before dropping the lock also prevents cancellation from taking it before its task work is queued. Fixes: a4d883755399 ("ublk: add UBLK_U_IO_FETCH_IO_CMDS for batch I/O processing") Cc: stable@vger.kernel.org Signed-off-by: Shao Mingyin Reviewed-by: Ming Lei Link: https://patch.msgid.link/20261115003352168cE_tyVxSyZV124AM31htL@zte.com.cn Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman commit c600378e250b5fc907019779bb4e013e2b0b9233 Author: Sankara Tankala Date: Fri Nov 13 21:10:01 2026 +0530 thermal: int340x: processor_thermal: Fix Nova Lake-S PCI device ID commit 22139b5a46353184f43d120b569b01447843d363 upstream. Nova Lake-S uses the same processor thermal PCI device ID as Nova Lake-H, 0xD703. The 0xAD03 ID added for Nova Lake-S is the Arrow Lake-S ID (PCI_DEVICE_ID_INTEL_ARL_S_THERMAL). The ARL-S entry comes first in the PCI ID table, so the NVL-S entry never matched. However, proc_thermal_rfim_add() matches on the device ID alone, so Arrow Lake-S, which has DLVR, wrongly gets the Nova Lake DLVR register map. Replace the separate NVL_H and NVL_S IDs with a single NVL ID, 0xD703, and drop the 0xAD03 entries. Fixes: af1b80b94126 ("thermal: int340x: processor_thermal: Add Nova Lake processor thermal device") Fixes: dbd911a07f14 ("thermal: intel: int340x: Add DLVR support for Nova Lake") Cc: stable@vger.kernel.org Signed-off-by: Sankara Tankala Acked-by: Srinivas Pandruvada Link: https://patch.msgid.link/20261113154001.2081-1-sankara.narayana@intel.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 73ff5ef507e68550c04a85df3b21d6cc3dd03e77 Author: Juan Agustin Niccolini Date: Wed Nov 11 12:47:03 2026 -0500 tcp: Fix the SO_REUSEPORT bind cache admitting a conflicting socket commit f675070191f202010b010160b509a543dd232ae6 upstream. When the port is in the FASTREUSEPORT_STRICT state, inet_csk_get_port() skips the bind conflict check if sk_reuseport_match() finds the new socket's address covered by the socket cached in tb->fast_*. This is only safe if both sockets match on everything inet_bind_conflict() reads. The cache misses some of it: - It does not record sk_bound_dev_if or sk_reuse. - It records the family and IPV6_V6ONLY but never compares them with the new socket, so a cached v6only [::] (or 0.0.0.0) socket covers a dual-stack [::] socket. As a result, an unprivileged user can bind and listen on a port that another user is listening on, for example a dual-stack [::] socket on top of a 0.0.0.0 listener: victim: bind(0.0.0.0:P), listen() attacker: SO_REUSEPORT + IPV6_V6ONLY, bind([::]:P) /* fills cache */ attacker: SO_REUSEPORT, bind([::]:P), listen() /* should fail */ Only take the fast path when the new socket matches the cached one in family, IPV6_V6ONLY, bound device and SO_REUSEADDR. Identical SO_REUSEPORT listeners, the workload this cache was added for, still skip the scan (binding 16384 of them: 9.80 ms before, 9.86 ms after, 5874 ms with the full check every time). Fixes: 637bc8bbe6c0 ("inet: reset tb->fastreuseport when adding a reuseport sk") Cc: stable@vger.kernel.org Signed-off-by: Juan Agustin Niccolini Reviewed-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20261111174704.24312-2-juanagusnicco@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 0cb8c52195165db7f987c7a3f48fc20c534af688 Author: Sebastian Reichel Date: Tue Nov 10 01:41:58 2026 +0100 spi: Fix runtime PM imbalance on pump transfer message error commit bb5caf7a2e0b2dae8e8905d32fc376703eabcfc4 upstream. The current SPI message pumping code may drop the runtime PM twice when an SPI message cannot be sent: spi_master spi2: noqueue transfer failed rockchip-spi feb20000.spi: Runtime PM usage count underflow! Fix the problem by always keeping the runtime PM count increased when exiting __spi_pump_transfer_message(), as the caller handles decreasing it. Note, that the function already keeps the RPM usage counter increased for the error paths following after the prepare_transfer_hardware step. Cc: stable@vger.kernel.org Fixes: bef4a48f4ef7 ("spi: Fix null dereference on suspend") Signed-off-by: Sebastian Reichel Tested-by: Alexander Shiyan Link: https://patch.msgid.link/20261110-spi-runtime-pm-fix-v1-1-8601ebb2f6a8@collabora.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit c0e849198c41cb5875bc85074fd5660ff65f2adf Author: Stephen Smalley Date: Fri Nov 6 13:29:13 2026 -0500 selinux: check MAP_SHARED_VALIDATE mappings as shared commit beb0ae6bcd7505e2e61babe5d98a8dd3b3f03c7f upstream. selinux_mmap_file() only recognizes MAP_SHARED as a shared mapping, but MAP_SHARED_VALIDATE is also a shared mapping type. The mmap flags reach this hook before the mm code processes the mapping type. Consequently, a writable MAP_SHARED_VALIDATE mapping was failing to check the file write permission at mmap time, and a writable executable file mapping was wrongly checking process execmem permission as if it were private. Cc: stable@vger.kernel.org Link: https://github.com/SELinuxProject/selinux-kernel/issues/78 Fixes: 1c9725974074 ("mm: introduce MAP_SHARED_VALIDATE, a mechanism to safely define new mmap flags") Signed-off-by: Stephen Smalley Signed-off-by: Paul Moore Signed-off-by: Greg Kroah-Hartman commit ffb59a68c65eddcb4dcfa1898df2ce84ba1c5cb6 Author: Günther Noack Date: Fri Nov 13 21:23:25 2026 +0100 selftests/landlock: Test that layering does not break refer commit 047e27306d268d6972f8242b69f50e5814b09282 upstream. Regression test to exercise that layered Landlock domains do not accidentally deny the LANDLOCK_ACCESS_FS_REFER access right. This used to be the case when layering a non-filesystem ruleset with a filesystem-enforcing ruleset. In that case, REFER operations that would have been allowed for the individual rulesets would get denied when layering the same rulesets. Link: https://github.com/landlock-lsm/linux/issues/67 Link: https://github.com/landlock-lsm/go-landlock/issues/66 Fixes: fff69fb03dde ("landlock: Support network rules with TCP bind and connect") Cc: stable@vger.kernel.org Signed-off-by: Günther Noack Link: https://patch.msgid.link/20261113-b4-landlock-refer-nonfs-layer-v3-3-02d7e42bcdfd@gmail.com Signed-off-by: Mickaël Salaün Signed-off-by: Greg Kroah-Hartman commit e50399af141a0421c6f91ef47b1836c06751a218 Author: SJ Park Date: Mon Nov 2 06:46:26 2026 -0800 selftests/damon/sysfs_memcg_path_leak: define ksft_skip commit c8c47f4072bdcff783cedd5a8565242a212af058 upstream. sysfs_memcg_path_leak test uses $ksft_skip without defining it. As a result, the test is marked as passed while it was skipped, like below. $ ./sysfs_memcg_path_leak.sh Run as root $ echo $? 0 Users who run the test could therefore wrongly believe the test was run and passed while it was skipped. Define the value at the beginning of the test. After this patch, the exit code reflects the skip. $ ./sysfs_memcg_path_leak.sh Run as root $ echo $? 4 Link: https://lore.kernel.org/20261102144627.88843-4-sj@kernel.org Fixes: dfa3cf0bc018 ("selftets/damon: add a test for memcg_path leak") Signed-off-by: SJ Park Signed-off-by: Andrew Morton Closes: https://sashiko.dev/#/bug/linux-a0456336-0608-4fec-ac22-0ee61d1d6a91 Reviewed-by: Aveline Noir Tested-by: Aveline Noir Cc: Shuah Khan Cc: Wang Xiaolei Cc: # 6.17.x Signed-off-by: Greg Kroah-Hartman commit 9815683e77bf62c692473f70040b0bb86e248913 Author: Eric Dumazet Date: Fri Nov 13 13:46:24 2026 +0100 sctp: use skb_set_transport_header_careful() in sctp_v6_err() commit 13391f1a8c584e7c1addaea3fd47105d92cc724c upstream. skb->transport_header is a 16-bit offset from skb->head, and U16_MAX is reserved as the "not set" value. skb_set_transport_header() silently truncates an offset that does not fit. sctp_v6_err() stores @offset, computed by icmpv6_notify() from the extension headers of the packet embedded in an ICMPv6 error. Should the value be truncated, sctp_err_lookup() would read the SCTP header at the wrong place. Since commit 3744b0964d52 ("ipv6: Implement limits on extension header parsing") a single chain is bounded to IP6_MAX_EXT_HDRS_CNT headers (24576 bytes), so this needs a large skb->data - skb->head on top of it, for instance after several nested decapsulations, each of them possibly pulling its own extension header chain, since @offset is relative to the IPv6 header embedded in the ICMPv6 error. No reproducer was written, this is hardening. Use skb_set_transport_header_careful() and ignore the ICMPv6 error if the offset can not be stored. Do this before changing the network header, so that nothing has to be restored on failure. Fixes: 1a37e412a022 ("net: Use 16bits for *_headers fields of struct skbuff") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet Link: https://patch.msgid.link/20261113124625.4010206-5-edumazet@kernel.org Reviewed-by: Justin Iurman Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit 26a474ee173efb90a7cd42878ad1dd24a920b56e Author: Yves Bieri Date: Thu Nov 12 18:21:49 2026 +0100 sctp: do not free a new asoc peeled off while sendmsg slept commit f2540da93a113d3f0a70fd0961e00eb849ce8342 upstream. When sctp_sendmsg() creates a new association and sending on it fails with anything but -ESRCH, it frees the association. The send can sleep in sctp_wait_for_sndbuf(), which releases the socket lock, and meanwhile another thread can peel the new association off to a new socket. The wait then returns -EPIPE, and sctp_sendmsg() frees an association that now belongs to the peeled-off socket, without holding that socket's lock. If the peeled-off socket frees the association first, e.g. on close(), sctp_sendmsg() frees it a second time. Otherwise a syscall running concurrently on the peeled-off socket can use it after sctp_sendmsg() freed it. Both are reachable by an unprivileged user. The double free on net with KASAN: BUG: KASAN: double-free in sctp_tsnmap_free+0x5c/0x80 sctp_association_free+0x1eb/0x750 sctp_sendmsg+0x15ff/0x2020 Freed by task 836: sctp_association_free+0x1eb/0x750 sctp_primitive_ABORT+0x85/0xe0 sctp_close+0x22a/0x8d0 Commit dfcb9f4f99f1 ("sctp: deny peeloff operation on asocs with threads sleeping on it") fixed this double free by denying the peeloff. Commit cea0cc80a677 ("sctp: use the right sk after waking up from wait_buf sleep") replaced that check, and commit a0ff660058b8 ("sctp: return error if the asoc has been peeled off in sctp_wait_for_sndbuf") reverted it to return -EPIPE, without restoring the check. Fix this by holding a reference on the new association while sending on it, and by freeing it on error only if this socket still owns it. asoc->base.sk only changes in sctp_sock_migrate(), which runs with this socket locked, so the ownership check is stable. The reference keeps the check safe if the new owner frees the association meanwhile. Userspace still gets -EPIPE, and the association stays with the socket it was peeled off to. This was found by Xint Code, an AI code review agent, and reproduced as an unprivileged user on net with KASAN (trace above), without modifying the kernel or using error injection. With this patch the sender gets -EPIPE and the association keeps working on the peeled-off socket. Without a peeloff, a failed send that created the association (EAGAIN, EINTR) still frees it, and a peer ABORT while the sender sleeps still frees it exactly once. The SCTP selftest sctp_vrf.sh passes. The reproducer is available on request. Fixes: a0ff660058b8 ("sctp: return error if the asoc has been peeled off in sctp_wait_for_sndbuf") Cc: stable@vger.kernel.org Signed-off-by: Yves Bieri Acked-by: Xin Long Link: https://patch.msgid.link/20261112172149.27355-1-yves.bieri@theori.io Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit ebc67db17ae2e576688e02e68ea55b6c50509d46 Author: Cen Zhang Date: Fri Oct 30 12:48:56 2026 +0800 ocfs2: serialize inode journal access with shutdown commit f277230d002d03ed98b814b735f9d3d01b42020a upstream. The downconvert thread can run inode cleanup until ocfs2_dlm_shutdown() stops it, but unmount shuts down the journal earlier. A final dentry post-unlock put can therefore enter ocfs2_clear_inode() while the journal is being destroyed. ocfs2_ci_fully_checkpointed() loads osb->journal before taking trans_inc_lock. Journal shutdown neither takes that lock for removal nor waits for the downconvert thread before freeing the journal: Downconvert thread Unmount ------------------ ------- dentry post-unlock; final iput() ocfs2_checkpoint_inode() load osb->journal ocfs2_journal_shutdown() free journal; clear pointer read the transaction ID The checkpoint wait queue is embedded in that journal, and the final jbd2_journal_release_jbd_inode() also needs its JBD2 journal to remain alive for the whole call. Protecting only the pointer load would leave those longer uses unprotected. Read and clear osb->journal under trans_inc_lock when checking checkpoint progress. Treat a removed journal as checkpointed. Move checkpoint waiters to the existing mount-owned checkpoint_event and wake it after checkpoint progress and journal removal, so the queue outlives the journal. The commit thread also waits there and rechecks its condition when woken. Serialize the final JBD2 inode release against JBD2 destruction and the journal free with a mount-owned rw_semaphore. Take the write side only after stopping the commit thread, and drop it before the journal inode's final iput(), whose cleanup can take the read side. Inode cleanup holds the read side only around the JBD2 release, outside checkpoint waits and DLM lock teardown. KASAN report as below: Oops: general protection fault, probably for non-canonical address 0xdffffc000000000e: 0000 [#1] SMP KASAN NOPTI KASAN: null-ptr-deref in range [0x0000000000000070-0x0000000000000077] CPU: 0 UID: 0 PID: 587 Comm: ocfs2dc-33CAF04 Not tainted 7.3.0-rc4-next-20260921-pmb-ocfs2-functional-v1+ #1 PREEMPT(lazy) Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:ocfs2_clear_inode+0x8ae/0x1630 Code: fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 27 0c 00 00 49 8d 7d 70 48 8b 43 c8 48 ba 00 00 00 00 00 fc ff df 48 89 f9 48 c1 e9 03 <80> 3c 11 00 0f 85 f0 0b 00 00 49 3b 45 70 0f 88 62 03 00 00 e8 49 RSP: 0018:ffff888118d3f878 EFLAGS: 00010212 RAX: 0000000000000001 RBX: ffff88811a5edc60 RCX: 000000000000000e RDX: dffffc0000000000 RSI: 0000000000000001 RDI: 0000000000000070 RBP: ffff888116134000 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff8965765f R11: 0000000000000001 R12: ffff88811a5ed400 R13: 0000000000000000 R14: ffff88811a5edbf8 R15: ffff88811a5ed408 FS: 0000000000000000(0000) GS:ffff8881fd4dc000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ff35b66f2c0 CR3: 00000001092ae005 CR4: 0000000000770ef0 PKRU: 55555554 Call Trace: ? __pfx_ocfs2_clear_inode+0x10/0x10 ? __pfx_ocfs2_inode_is_valid_to_delete+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? __lock_acquire+0x5a3/0x2140 ocfs2_evict_inode+0x1ed/0x11e0 ? inode_wait_for_writeback+0x14c/0x330 ? __pfx_ocfs2_evict_inode+0x10/0x10 ? lock_acquire+0x190/0x300 ? srso_alias_return_thunk+0x5/0xfbef5 ? find_held_lock+0x2b/0x80 ? evict+0x347/0x9f0 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_release+0xc8/0x290 ? _raw_spin_unlock+0x23/0x40 ? __pfx_ocfs2_evict_inode+0x10/0x10 evict+0x38b/0x9f0 ? __pfx_evict+0x10/0x10 ? lock_acquire+0x190/0x300 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_release+0xc8/0x290 ? __pfx_inode_just_drop+0x10/0x10 iput+0x680/0xb80 ocfs2_dentry_lock_put+0xc2/0x110 ? __pfx_ocfs2_dentry_post_unlock+0x10/0x10 ocfs2_process_blocked_lock+0x1fb/0x420 ? __pfx_ocfs2_process_blocked_lock+0x10/0x10 ? __pfx_pmbd_probe_hit_cookie+0x10/0x10 ? lock_release+0xc8/0x290 ? srso_alias_return_thunk+0x5/0xfbef5 ? lockdep_hardirqs_on_prepare+0xeb/0x1a0 ? srso_alias_return_thunk+0x5/0xfbef5 ocfs2_downconvert_thread+0x32b/0x780 ? do_raw_spin_lock+0x130/0x270 ? __pfx_ocfs2_downconvert_thread+0x10/0x10 ? __kthread_parkme+0xc1/0x220 ? srso_alias_return_thunk+0x5/0xfbef5 ? lock_release+0xc8/0x290 ? __pfx_autoremove_wake_function+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? __kthread_parkme+0x177/0x220 ? __pfx_ocfs2_downconvert_thread+0x10/0x10 kthread+0x351/0x460 ? srso_alias_return_thunk+0x5/0xfbef5 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x659/0x940 ? __pfx_ret_from_fork+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? __switch_to+0x74f/0xf70 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 Modules linked in: ---[ end trace 0000000000000000 ]--- Link: https://lore.kernel.org/pm-ocfs2-objects-candidate-0004-v8-dbcb8f80b8df476084d6@gmail.com Fixes: da5e7c87827e ("ocfs2: cleanup journal init and shutdown") Signed-off-by: Cen Zhang Signed-off-by: Andrew Morton Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Heming Zhao Cc: Jia-Ju Bai Cc: Cc: Signed-off-by: Greg Kroah-Hartman fs/ocfs2/inode.c | 17 +++++++++-------- fs/ocfs2/journal.c | 30 ++++++++++++++++++++++-------- fs/ocfs2/journal.h | 17 +++++++++-------- fs/ocfs2/ocfs2.h | 1 + fs/ocfs2/super.c | 1 + 5 files changed, 42 insertions(+), 24 deletions(-) commit 7e97cf72ca313a169dc271c9841ef45c1adba634 Author: Zhiyuan Zhang Date: Wed Nov 11 02:34:44 2026 +0000 ocfs2: fix kernel BUG in ocfs2_page_mkwrite() when write_end fails commit 5158f371faceb185235ba42882e67a840cfd7f48 upstream. syzbot reported a kernel BUG in the ocfs2 write fault path: (syz.0.17,5578,0):ocfs2_write_end_nolock:1945 ERROR: status = -30 kernel BUG at fs/ocfs2/mmap.c:106! Call Trace: do_page_mkwrite+0x147/0x310 mm/memory.c:3879 do_shared_fault mm/memory.c:6145 [inline] handle_mm_fault+0x1a53/0x3750 mm/memory.c:6943 __ocfs2_page_mkwrite() calls ocfs2_write_begin_nolock() and then ocfs2_write_end_nolock(), and uses BUG_ON() to assert that the latter returns the full length. But ocfs2_write_end_nolock() can fail: since commit 7f27ec978b0e ("ocfs2: call ocfs2_journal_access_di() before ocfs2_journal_dirty() in ocfs2_write_end_nolock()") it gets journal access to the inode buffer again, because the handle may have been restarted since ocfs2_write_begin_nolock(). That fails with -EROFS or -EIO once the journal has been aborted or jbd2 has seen write errors on the device. The syzbot reproducer gets there by shrinking the backing loop device to zero with LOOP_SET_STATUS while writing to a shared file mapping. Handle the failure instead of crashing. ocfs2_write_end_nolock() leaves the mmap folio locked, because ocfs2_unlock_folios() skips it when w_target_locked is set so that it can be returned with VM_FAULT_LOCKED, and do_page_mkwrite() does not unlock it either when ->page_mkwrite() returns an error. So unlock it and fail the fault; the faulting task gets SIGBUS, like for the other errors in this function. For an mmap write ocfs2_write_end_nolock() returns either len or a negative errno: inline data has already been converted to extents by ocfs2_write_begin_nolock(), and copied is equal to len. The BUG matters for local mounts, where the filesystem is expected to go read-only and keep running after a journal abort. On clustered mounts ocfs2_abort() panics the node anyway as soon as it notices the aborted journal. Link: https://lore.kernel.org/20261111023444.22688-1-zhiyuanzhang912@gmail.com Fixes: 7f27ec978b0e ("ocfs2: call ocfs2_journal_access_di() before ocfs2_journal_dirty() in ocfs2_write_end_nolock()") Signed-off-by: Zhiyuan Zhang Signed-off-by: Andrew Morton Reported-by: Closes: https://syzkaller.appspot.com/bug?extid=42984127d45ad96219de Reviewed-by: Joseph Qi Reviewed-by: Heming Zhao Cc: Mark Fasheh Cc: Joel Becker Cc: yangwenfang Cc: Signed-off-by: Greg Kroah-Hartman fs/ocfs2/mmap.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) commit ac3146bad3bb17aedc9cfb1504ead9aa33a8321b Author: Cen Zhang Date: Thu Oct 29 14:56:48 2026 +0800 ocfs2: advance locking_state through the live cursor commit fffc86cbe3ebfd7fea3937f8698e4322b3137984 upstream. locking_state copies each lock resource under ocfs2_dlm_tracking_lock so its containing inode or quota object can be freed during the dump. The copied l_debug_list pointers do not have that lifetime protection. Yet ocfs2_dlm_seq_next() follows them to find the next record. Remounting read-only can free a quota-info object while a debugfs read is between the snapshot and the next iterator callback: locking_state reader Quota suspension -------------------- ---------------- snapshot current lock resource copy l_debug_list.next remove next resource from live list free quota-info object seq_next(): follow copied link read freed lock resource Advance through the live dummy cursor instead. List removal updates its links under the tracking lock. Position it after the resource being copied before releasing the lock, and never walk the snapshot's links. Reuse the per-open snapshot for a nonzero seq_start() position, including read continuation and buffer retries. Rewind the live cursor only when seq_file starts at index zero; seq_lseek() traverses from there through seq_next(). Clear the snapshot's l_ops marker at end of list so later reads remain at EOF. This avoids replaying the list prefix under the tracking lock on each read, without adding a new cursor or position field. KASAN report as below: BUG: KASAN: slab-use-after-free in ocfs2_dlm_next_res.isra.0+0x1b1/0x1d0 Read of size 8 at addr ffff888117ea9838 by task python3/489 CPU: 3 UID: 0 PID: 489 Comm: python3 Not tainted 7.3.0-rc4-next-20260921-pmb-bt-functional-v1+ #1 PREEMPT(lazy) Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, arch_caps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0x93/0xd0 print_report+0xce/0x630 ? ocfs2_dlm_next_res.isra.0+0x1b1/0x1d0 ? srso_alias_return_thunk+0x5/0xfbef5 ? __virt_addr_valid+0x20e/0x420 ? ocfs2_dlm_next_res.isra.0+0x1b1/0x1d0 kasan_report+0xe0/0x110 ? ocfs2_dlm_next_res.isra.0+0x1b1/0x1d0 ocfs2_dlm_next_res.isra.0+0x1b1/0x1d0 ? __pfx_ocfs2_dlm_next_res.isra.0+0x10/0x10 ? __pfx_do_raw_spin_lock+0x10/0x10 ocfs2_dlm_seq_next+0xb8/0x4c0 ? srso_alias_return_thunk+0x5/0xfbef5 seq_read_iter+0x92f/0x1110 ? srso_alias_return_thunk+0x5/0xfbef5 seq_read+0x362/0x5a0 ? __pfx_seq_read+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? selinux_file_permission+0x11d/0x540 full_proxy_read+0x11f/0x180 ? __pfx_full_proxy_read+0x10/0x10 vfs_read+0x1a0/0xc20 ? srso_alias_return_thunk+0x5/0xfbef5 ? kmem_cache_free+0x242/0x580 ? __pfx_vfs_read+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? putname+0x93/0xe0 ? srso_alias_return_thunk+0x5/0xfbef5 ? do_sys_openat2+0x12a/0x1b0 ? __pfx_do_sys_openat2+0x10/0x10 ksys_read+0x111/0x200 ? __pfx_ksys_read+0x10/0x10 ? irqentry_exit+0xbe/0x820 ? srso_alias_return_thunk+0x5/0xfbef5 ? trace_hardirqs_on_prepare+0x11d/0x150 do_syscall_64+0x114/0x620 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0266dbb687 Code: 48 89 fa 4c 89 df e8 58 b3 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff RSP: 002b:00007ffccf76fc40 EFLAGS: 00000202 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007f0266d27780 RCX: 00007f0266dbb687 RDX: 0000000000000001 RSI: 00007f0266a53200 RDI: 0000000000000004 RBP: 00007f0266d27700 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000001 R13: 00007f0266a53200 R14: 0000000000000004 R15: 00007f0266b651e0 Allocated by task 547: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 __kasan_kmalloc+0xaa/0xb0 __kmalloc_cache_noprof+0x28d/0x610 ocfs2_local_read_info+0x181/0x1580 dquot_load_quota_sb+0x68b/0x1000 dquot_load_quota_inode+0x227/0x3e0 ocfs2_enable_quotas+0x27c/0x520 ocfs2_fill_super+0x21f9/0x38f0 get_tree_bdev_flags+0x35d/0x5f0 vfs_get_tree+0x93/0x320 fc_mount+0x1d/0x200 path_mount+0x592/0x1e00 __x64_sys_mount+0x24b/0x2d0 do_syscall_64+0x114/0x620 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 577: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3b/0x60 __kasan_slab_free+0x5f/0x80 kfree+0x308/0x580 ocfs2_local_free_info+0x47b/0x800 dquot_disable+0x5d9/0x17a0 ocfs2_susp_quotas.isra.0+0x22c/0x2b0 ocfs2_reconfigure+0x284/0xd00 reconfigure_super+0x3ca/0xa70 path_mount+0x16ae/0x1e00 __x64_sys_mount+0x24b/0x2d0 do_syscall_64+0x114/0x620 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888117ea9800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 56 bytes inside of freed 1024-byte region [ffff888117ea9800, ffff888117ea9c00) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x117ea8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x200000000000040(head|node=0|zone=2) page_type: f5(slab) raw: 0200000000000040 ffff888100042dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 0200000000000040 ffff888100042dc0 dead000000000100 dead000000000122 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 0200000000000003 fffffffffffffe01 00000000ffffffff 00000000ffffffff head: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888117ea9700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888117ea9780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888117ea9800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888117ea9880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888117ea9900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Link: https://lore.kernel.org/pm-ocfs2-objects-candidate-0053-v7-ec41d4bbd38bb4d795a8@gmail.com Fixes: ccd979bdbce9 ("[PATCH] OCFS2: The Second Oracle Cluster Filesystem") Signed-off-by: Cen Zhang Signed-off-by: Andrew Morton Suggested-by: Joseph Qi Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Heming Zhao Cc: Jia-Ju Bai Cc: Cc: Signed-off-by: Greg Kroah-Hartman fs/ocfs2/dlmglue.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) commit 3804f5bc5c159c257ca111b36bdc18d22f75b1b8 Author: Cen Zhang Date: Thu Oct 29 15:00:13 2026 +0800 ocfs2/dlmfs: keep the superblock alive during lock work commit e9e66aa5ef1a76ec92fe41c5eb16fda7a39db279 upstream. Queued dlmfs lock work holds an inode reference, but no active reference to its superblock. The workqueue is drained on module exit rather than on each dlmfs unmount, and an inode reference does not stop superblock shutdown: generic_shutdown_super() reports the busy inode and goes on. DLM callback / worker Unmount --------------------- ------- queue lock work; igrab(inode) worker delayed drop last active superblock ref kill_anon_super() report the busy inode free the superblock finish lock work iput(inode) access the inode's freed superblock Flushing the workqueue from a dlmfs kill_sb would not be enough: a blocking AST can queue new work for an inode that is still alive after the flush and before eviction, and that work again holds only an inode reference. Take an active superblock reference before acquiring the queued inode reference, with the atomic_inc_not_zero() on s_active that grab_super() and the NFS and procfs superblock walkers use. Decline to queue if the superblock is already shutting down; the inode is then being evicted and user_dlm_destroy_lock() tears the lock down. The existing l_lock and USER_LOCK_QUEUED flag serialize this with other queue attempts. Each execution drops its inode reference before releasing the active superblock reference, outside l_lock. If that releases the last active reference, the unmount completes on the worker; it only waits for DLM replies and never for this workqueue. Only the relevant frames of the report are kept: Oops: general protection fault, probably for non-canonical address 0xfbd59c0000000026: 0000 [#1] SMP KASAN NOPTI KASAN: maybe wild-memory-access in range [0xdead000000000130-0xdead000000000137] Workqueue: user_dlm user_dlm_unblock_lock RIP: 0010:iput+0x246/0xc10 Call Trace: user_dlm_unblock_lock+0x503/0xa50 process_one_work+0x9a8/0x1b40 worker_thread+0x65c/0xe40 Link: https://lore.kernel.org/pm-ocfs2-objects-candidate-0054-v6-c3887cceae3b039e591e@gmail.com Fixes: 8df08c89c668 ("[PATCH] OCFS2: The Second Oracle Cluster Filesystem") Signed-off-by: Cen Zhang Signed-off-by: Andrew Morton Reviewed-by: Joseph Qi Cc: Mark Fasheh Cc: Joel Becker Cc: Heming Zhao Cc: Jia-Ju Bai Cc: Cc: Signed-off-by: Greg Kroah-Hartman fs/ocfs2/dlmfs/userdlm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) commit 13c798f13f5e9b115833dfca57301a32cbd05b9f Author: Miguel Ojeda Date: Sat Nov 14 01:17:08 2026 +0100 objtool/rust: add more `noreturn` Rust functions for Rust 1.101.0 commit 1846c049cfe325abe0be8d1ea50eda16aa02d1a8 upstream. Starting with Rust 1.101.0 (expected 2026-12-24), `objtool` may report: rust/kernel.o: warning: objtool: _R..._6kernel3pci2ioINtB7_6DeviceNtNtB9_6device5BoundE8cfg_size() falls through to next function _R..._6kernel3oppNtB5_3OPP18from_raw_opp_owned() (and others) due to calls to the `noreturn` symbol: core::panicking::unreachable_default_msg Rust now outlines the constant messages of the panicking macros [1], thus `unreachable!()` (i.e. without arguments) calls that new function instead of `core::panicking::panic`, which is already in the list. The same change introduced the equivalent `noreturn` functions for `panic!()`, `todo!()` and `unimplemented!()`, which lead to the same warning when those are used: core::panicking::panic_default_msg core::panicking::todo_default_msg core::panicking::unimplemented_default_msg Thus add the mangled ones to the list so that `objtool` knows they are actually `noreturn`. See commit 56d680dd23c3 ("objtool/rust: list `noreturn` Rust functions") for more details. Cc: stable@vger.kernel.org # 6.12.x (Rust is pinned in older LTSs) Cc: Josh Poimboeuf Cc: Peter Zijlstra Link: https://github.com/rust-lang/rust/pull/163766 [1] Reviewed-by: Gary Guo Link: https://patch.msgid.link/20261114001708.80599-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda Signed-off-by: Greg Kroah-Hartman commit 0e330ce529e5cff33d962154b47cea52d9c13f18 Author: Karl Mehltretter Date: Sun Nov 8 20:20:41 2026 +0100 parisc: irq: Trace hardirq state in do_cpu_irq_mask() commit a739c9192173c0437ed3c76f87f5a39532ef9fe1 upstream. intr_extint calls do_cpu_irq_mask() with PSW[I] already clear. Since commit 044d0d6de9f5 ("lockdep: Only trace IRQ edges"), its local_irq_disable() then skips trace_hardirqs_off(), and lockdep assertions fail in the timer tick: WARNING: kernel/rcu/tree.c:2739 at rcu_sched_clock_irq+0x618/0x1f84 The return to a context with PSW[I] set has not been annotated since TRACE_IRQFLAGS_SUPPORT was enabled. Annotate both transitions. Fixes: 366dd4ea9d5f ("parisc: Fix ftrace function tracer") Signed-off-by: Karl Mehltretter Cc: stable@vger.kernel.org # v5.9+ Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit c3048fb555d6970676a1042e70b87180944e8e2d Author: Karl Mehltretter Date: Sat Nov 14 19:02:50 2026 +0100 parisc: Fix register corruption in 32-bit dynamic ftrace commit e9c14351f84f2ddf4aae2914979c0378bc14460a upstream. The 32-bit dynamic ftrace trampoline allocates a 64-byte frame. ftrace_caller() saves %r26 at offset 20, which overlaps the third argument's spill slot for ftrace_function_trampoline(). In the failing build, GCC spills org_sp_gr3 into that slot, overwriting saved %r26 with the original stack pointer. Tracing preempt_count_add() then passes that pointer as val and corrupts the preempt count. Allocate two frames on 32-bit, as 64-bit already does, and update the generated trampoline instruction to match. Fixes: 6ca6366220ed ("parisc: add dynamic ftrace") Cc: stable@vger.kernel.org Signed-off-by: Karl Mehltretter Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit 68010fb03ea081e5ae9a2af20b0516668154e946 Author: Boyan Liu Date: Wed Oct 28 14:16:51 2026 +0800 scsi: sd_zbc: Cap zone report count by buffer size commit 612293fb469c81408829e6325bae25725968986f upstream. sd_zbc_report_zones() limits descriptor parsing to the requested zone count and the device-reported ZONE LIST LENGTH, but not to the number of descriptors that fit in the allocated report buffer. A malicious or malfunctioning device can report an oversized length and cause out-of-bounds reads while the descriptors are parsed: BUG: KASAN: slab-out-of-bounds in sd_zbc_report_zones (drivers/scsi/sd_zbc.c:256) Read of size 8 at addr ffff88802c8d2610 by task kworker/u8:2/37 Call Trace: sd_zbc_report_zones (drivers/scsi/sd_zbc.c:256) blk_revalidate_disk_zones (block/blk-zoned.c:2354) sd_zbc_revalidate_zones (drivers/scsi/sd_zbc.c:566) sd_revalidate_disk (drivers/scsi/sd.c:3898) sd_probe (drivers/scsi/sd.c:4101) Cap the descriptor count with min3() over the remaining requested zones, the device-reported count, and max_in_buf derived from buflen. This matches nvme_ns_report_zones() and preserves iteration over reports that require multiple commands. Use shared constants for the REPORT ZONES header and zone descriptor sizes. [mkp: define constants] Fixes: d41003513e61 ("block: rework zone reporting") Cc: stable@vger.kernel.org Reported-by: co+4a4f9998e2b4b490@bugs.sh Signed-off-by: Boyan Liu Link: https://patch.msgid.link/20261028061651.110435-1-yymhvert@gmail.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit 40c52902934290d862c405ef82a54e50c324fc9a Author: Shao Mingyin Date: Mon Oct 26 19:54:09 2026 +0800 scsi: rdac: Keep the error status when controller lookup fails commit 46846939d5f33c9333612662c52475f92e753407 upstream. initialize_controller() records SCSI_DH_RES_TEMP_UNAVAIL when get_controller() fails, but then overwrites it with SCSI_DH_OK unconditionally. It therefore reports success with h->ctlr == NULL and rdac_bus_attach() continues with check_ownership(), which dereferences h->ctlr: BUG: kernel NULL pointer dereference, address: 0000000000000000 ... check_ownership rdac_bus_attach get_controller() only fails when its GFP_ATOMIC allocation fails, so the crash happens exactly when memory is already scarce. Only report success after the controller was found and the device was added to its list. Fixes: 327825574132 ("scsi_dh_rdac: switch to scsi_execute_req_flags()") Signed-off-by: Shao Mingyin Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261026195409354OWEI2b6HO7swSphvv1FOc@zte.com.cn Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit 045c3ec50e0e830b756c48f364b0387696284992 Author: Milan P. Gandhi Date: Thu Nov 5 17:54:01 2026 +0530 scsi: mpi3mr: Validate reply frame size bounds commit e550f2b2b4aab4c5f12db89d04d8978ce4ed7b4e upstream. Firmware provides reply_frame_size in dwords, which the driver multiplies by 4 to compute facts.reply_sz (u16). If the reported size exceeds U16_MAX / 4, the multiplication overflows u16 before assignment, causing under-allocated DMA reply buffers. Furthermore, several paths assume a minimal reply frame size: - logdata_entry_sz calculations underflow or hit zero when reply_sz <= 20 bytes, leading to zero-size allocations and divide-by-zero crashes. - Unsolicited status descriptors and fixed replies (such as struct mpi3_iounit_control_reply, 64 bytes) require at least 16 dwords. Validate reply_frame_size in mpi3mr_issue_iocfacts() to ensure it is within [16, U16_MAX / 4] dwords before processing facts data. Fixes: 824a156633df ("scsi: mpi3mr: Base driver code") Cc: stable@vger.kernel.org Signed-off-by: Milan P. Gandhi Link: https://patch.msgid.link/20261105122401.266559-1-mgandhi@redhat.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Greg Kroah-Hartman commit 73df3b6c11815b196c091a3abc4c4cedfb4963d2 Author: Jiale Yao Date: Wed Oct 28 12:48:25 2026 +0800 s390/dcssblk: Initialize device semaphore before sysfs registration commit 64ee7f863655e67f26947420516daba4e232675d upstream. device_create_file() makes the add and remove attributes writable before the device list semaphore is initialized. A sysfs write racing module initialization can therefore acquire an uninitialized rwsem. Initialize the semaphore before registering the root device and its attributes. [hca@linux.ibm.com: Use DECLARE_RWSEM() instead of moving init_rwsem()] Cc: stable@vger.kernel.org Acked-by: Alexander Gordeev Signed-off-by: Jiale Yao Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Greg Kroah-Hartman commit 71d24fd877bc55ce1cd1a60eff11e6685c6fec82 Author: Gerald Schaefer Date: Wed Oct 21 14:04:26 2026 +0200 s390/appldata: Fix error handling in appldata_generic_handler() commit 0f01f3156f260a5fbce3b4017e1f1ff93cb29465 upstream. appldata_generic_handler() always returns 0 after starting or stopping monitor recording. So "echo {0,1} > /proc/sys/appldata/{os,mem,net_sum}" returns success even when DIAG 0xDC failed. A failed start would keep ops->active as 0, so reading the sysctl later would correctly reflect this. A failed stop would falsely set ops->active to 0 and decrement module refcount. This would allow the data gathering module to be removed, and the data buffer to be freed, while z/VM monitor service is still collecting data from that buffer. Fix this by returning -EIO when appldata_diag() failed, and only set ops->active to 0 and decrement module refcount when it succeeded on stop path. Cc: stable@vger.kernel.org Signed-off-by: Gerald Schaefer Reviewed-by: Heiko Carstens Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Greg Kroah-Hartman commit 7e83a458c66dd8ed71a0268a6980d75cb3c0eb38 Author: Peder Bergan Date: Tue Nov 17 18:57:06 2026 +0100 rust: str: tie Formatter to its backing buffer commit cf2212fd3053857f800cc22d903118d522131ca8 upstream. Formatter::new() returns a Formatter whose lifetime is independent of the borrow of its backing buffer. Safe code can therefore drop the buffer and then write through the formatter, causing a use-after-free. Tie the buffer borrow to the formatter's lifetime so that the borrow checker rejects such callers and prevents overlapping mutable access. Fixes: 87482d6d9104 ("rust: str: allow `str::Formatter` to format into `&mut [u8]`.") Cc: stable@vger.kernel.org Reported-by: Georgios Androutsopoulos Closes: https://github.com/Rust-for-Linux/linux/issues/1261 Signed-off-by: Peder Bergan Reviewed-by: Gary Guo Reviewed-by: Andreas Hindborg Reviewed-by: Alice Ryhl Link: https://patch.msgid.link/20261117-formatter-lifetime-v2-1-e216d86ffb57@gmail.com Signed-off-by: Miguel Ojeda Signed-off-by: Greg Kroah-Hartman commit 812a92125e5804b4b50862b9e305e8fb9ffe4c51 Author: Marwan Mohamed Zein Date: Sat Nov 14 15:21:55 2026 +0200 rust: iov: fix return lifetime of `copy_from_iter_raw()` commit df71affdd95ea60fa3fb31e666389a53fd3297db upstream. The returned slice is derived from `out`, but lifetime elision ties it to `self` because this is a method. Explicitly bind the return lifetime to `out` so the returned slice cannot outlive its backing buffer. Fixes: 06cb58b310ea ("rust: iov: add iov_iter abstractions for ITER_SOURCE") Cc: stable@vger.kernel.org Reported-by: spidermana Closes: https://github.com/Rust-for-Linux/linux/issues/1265 Signed-off-by: Marwan Mohamed Zein Link: https://patch.msgid.link/20261114132156.49243-1-marawanzein222@gmail.com [ Reworded title. - Miguel ] Signed-off-by: Miguel Ojeda Signed-off-by: Greg Kroah-Hartman commit 85c71b76ec0bb82565509b4e33ad264466112ece Author: Vladimir Kondratiev Date: Wed Nov 11 12:41:21 2026 +0200 riscv: unaligned: fix __setup handlers commit 27fc871b963183d9371cc838c1a543033d91357f upstream. Returning -EINVAL from a __setup() callback cause invalid unaligned_scalar_speed= and unaligned_vector_speed= values to be treated as handled. obsolete_checksetup() treats any non-zero return value from setup_func() as success, so an unrecognized argument is silently accepted instead of being reported as an unknown boot option. __setup() handlers return 0 on failure. Fixes: aecb09e091dc ("riscv: Add parameter for skipping access speed tests") Signed-off-by: Vladimir Kondratiev Reviewed-by: Jisheng Zhang Link: https://patch.msgid.link/20261111-fix-riscv-unaligned-v1-1-0722514fc1e4@mobileye.com Cc: stable@vger.kernel.org Signed-off-by: Paul Walmsley Signed-off-by: Greg Kroah-Hartman commit 893dcade95f99e0b777d4cf787307636f2a735d6 Author: Guobin Zhang Date: Tue Oct 20 19:24:25 2026 +0800 riscv: signal: protect regs->status RMW from concurrent preemption commit 018fe0700c569b50465b27d68deee7e9157e8e5f upstream. __fstate_clean() performs a non-atomic read-modify-write (RMW) on task_pt_regs(current)->status to clear the FS bits. This RMW is unprotected - it runs with preemption enabled and IRQs on during signal delivery (setup_rt_frame -> fstate_save) and sigreturn (restore_fp_state -> fstate_restore). If a reschedule IPI or timer interrupt triggers preemption between the load and store of this RMW, __switch_to_vector() calls riscv_v_vstate_set_restore() which modifies the VS bits of the same regs->status. When the preempted task resumes, it stores back the stale value captured before preemption, overwriting the VS update and restoring VS=DIRTY while TIF_RISCV_V_DEFER_RESTORE remains set - a combination that should never occur and leads to vector state corruption. The race window: __fstate_clean (signal path) set_restore (schedule path) ----------------------------- ----------------------------- ld a0, regs->status // VS=DIRTY, FS=DIRTY <- preempted (reschedule IPI) regs->status VS = INITIAL set TIF_RISCV_V_DEFER_RESTORE <- resumed andi a0, ~FS ori a0, FS_CLEAN // stale a0 still has VS=DIRTY sd a0, regs->status // overwrites VS=INITIAL with VS=DIRTY -> result: VS=DIRTY + DEFER -> ANOMALY Fix by adding preempt_disable/enable in fstate_save() and fstate_restore(), which covers the RMW in __fstate_clean(), and around the RMW in fstate_off(). Add fstate_{save,restore}_preempt_off() for code that already runs with preemption disabled (the scheduler and kernel_mode_fpu). riscv_v_vstate_set_restore() has the identical hazard: it is called from __restore_v_state() (sigreturn path) with preemption enabled, and it can race the same way against the scheduler's own call to riscv_v_vstate_set_restore() for the same task in __switch_to_vector(). Wrap that call site with preempt_disable/enable as well. Add WARN_ON_ONCE(preemptible()) to riscv_v_vstate_restore() to catch any future unprotected callers at development time. Suggested-by: Andy Chiu Signed-off-by: Guobin Zhang Reviewed-by: Andy Chiu Link: https://patch.msgid.link/20261020-vector_fpu_regs_status_rmw_fix-v2-1-474a59155e96@intel.com Cc: stable@vger.kernel.org Signed-off-by: Paul Walmsley Signed-off-by: Greg Kroah-Hartman commit 7ef9a99128e820bfb525e94109d6bdb785d9506c Author: Marek Szyprowski Date: Wed Nov 4 11:46:03 2026 +0100 riscv: mm: reserve the DTB before scanning reserved memory commit fc91dacd0c2b4f9ca7e0ce30016f5aee6256cba5 upstream. early_init_fdt_scan_reserved_mem() allocates memory from memblock while it scans /reserved-memory: the reserved_mem array, and the regions that are placed dynamically by size. On RISC-V the DTB was only reserved after that scan, so memblock could hand out the memory the DTB occupies while the DTB was still being parsed. Reserve the DTB before the scan, so that memblock never allocates from it. Fixes: ef69d2559fe9 ("riscv: Move early dtb mapping into the fixmap region") Closes: https://lore.kernel.org/all/b71ac175-fba5-4f61-bbdb-0b98dec9ccee@samsung.com/ Signed-off-by: Marek Szyprowski Link: https://patch.msgid.link/20261104104604.3370384-1-m.szyprowski@samsung.com Cc: stable@vger.kernel.org Signed-off-by: Paul Walmsley Signed-off-by: Greg Kroah-Hartman commit 0eb9192a7e6a139702bac35d6857ccf1f626629c Author: Yunhui Cui Date: Thu Oct 22 16:32:12 2026 +0800 riscv: Fix SR_SUM leakage across context switches commit 807b09be9c8f234ce758bcf43101f34e0a036b83 upstream. __switch_to() saves the sstatus value of prev and restores the SR_SUM bit of next with csrs. However, csrs only sets bits. If prev has SR_SUM set and next has SR_SUM clear in its saved state, the old SR_SUM bit remains set in sstatus. This lets next run with user memory access enabled even though its saved SR_SUM state is clear. Use csrrc to save the sstatus value of prev and clear SR_SUM from the live CSR before restoring the saved SR_SUM state of next. This keeps prev's SR_SUM state intact, while preventing it from leaking to next. Fixes: 788aa64c01f1 ("riscv: save the SR_SUM status over switches") Cc: stable@vger.kernel.org Signed-off-by: Yunhui Cui Reviewed-by: Jisheng Zhang Reviewed-by: Andy Chiu Reviewed-by: Yicong Yang Link: https://patch.msgid.link/20261022083212.84721-1-cuiyunhui@bytedance.com Signed-off-by: Paul Walmsley Signed-off-by: Greg Kroah-Hartman commit 7ad2c25d3c7d430d3e2001faf08af1a2f6451188 Author: Vincent Donnefort Date: Fri Nov 13 15:27:10 2026 +0000 ring-buffer: Skip remote reader page swap when on tail commit 2a6d7231c79ecb0e6a1d4e6549302e0c47175d22 upstream. When the reader page is also the tail, swap should not be permitted or it would insert the tail behind the head, breaking the integrity of the ring buffer. While __rb_get_reader_page() does correctly prevent this situation, the simple_ring_buffer implementation misses it. Once the reader catches up with the tail, make simple_ring_buffer_swap_reader_page() return 0. The remote reader now can expect an unchanged reader. When it is the case, there's nothing more to read. Also, when the simple_ring_buffer writer moves the tail to a new page, it resets the new tail counters and more specifically page::commit. As moving the tail unblocks page swap, order the page reset before the tail_page update. This ensures the reader can't swap the reader page with the new tail and observe a stale commit value. Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261113152729.837429-2-vdonnefort@google.com Fixes: 2e67fabd8b77 ("ring-buffer: Introduce ring-buffer remotes") Fixes: 34e5b958bdad ("tracing: Introduce simple_ring_buffer") Signed-off-by: Vincent Donnefort Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 2f8ce31aef14f81a30056f6a18200914f1daa8a1 Author: Vincent Donnefort Date: Fri Nov 13 15:27:12 2026 +0000 ring-buffer: Order remote page commit with data and timestamp commit d1a4551c99aa6a29c1c4e6466dfebaa4449ad0ed upstream. __rb_get_reader_page_from_remote() uses page::commit to check if more data is available for consumption. However, it needs to make sure that data and page::time_stamp are not stale. Enforce page::commit order with page::data and page::time_stamp, and defer updating read_stamp on page swap until rb_page_size() confirms committed data is present. Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261113152729.837429-4-vdonnefort@google.com Fixes: 2e67fabd8b77 ("ring-buffer: Introduce ring-buffer remotes") Fixes: 34e5b958bdad ("tracing: Introduce simple_ring_buffer") Signed-off-by: Vincent Donnefort Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit ae8c0b48ddcbbaa86fdcfdcb267a29bd4d6f7395 Author: Amit Machhiwal Date: Thu Nov 19 00:02:35 2026 +0530 ring-buffer: Do not check si_mem_available() before deferred init completes commit abf7185109d3986c1f945641d2fb20e44527f7c6 upstream. With CONFIG_DEFERRED_STRUCT_PAGE_INIT=y, only about one memory section per node is initialized early in boot (16 MiB on powerpc). The rest is initialized on demand by deferred_grow_zone() when an allocation would otherwise fail, or later by page_alloc_init_late(). Until then NR_FREE_PAGES can be close to zero, because early allocations (SLUB, vmalloc, ftrace records) use up the first section. si_mem_available() is derived from NR_FREE_PAGES, so it under-reports. __rb_allocate_pages() returns -ENOMEM when si_mem_available() is below the requested size. This check wrongly fails the buffers allocated for the boot CPU in early_trace_init() and for secondary CPUs in smp_init(), both of which run before page_alloc_init_late(). The resulting boot log shows: ERROR: Failed to allocate trace buffer ERROR: tracer: failed to allocate ring buffer! Skip the check until SYSTEM_FREEING_INITMEM on CONFIG_DEFERRED_STRUCT_PAGE_INIT kernels. The allocation itself still fails if memory really is short. This is the second half of the fix for the early boot crash reported on ppc64le KVM guests. Commit b3b974008388 ("tracing: Do not initialize tracefs work if tracing is disabled") stopped the NULL pointer dereference in __find_event_file() that followed the failed allocation. This patch fixes the allocation failure itself. Cc: stable@vger.kernel.org Fixes: 2a872fa4e9c8 ("ring-buffer: Check if memory is available before allocation") Link: https://patch.msgid.link/20261118183235.63310-1-amachhiw@linux.ibm.com Reported-by: Michal Suchánek Closes: https://lore.kernel.org/all/arYskzbiaNzBR9MD@kunlun.suse.cz/ Reviewed-by: Vincent Donnefort Signed-off-by: Amit Machhiwal Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 76cce1119ddeb2ca809a403acb4cf4d54d62c586 Author: Vincent Donnefort Date: Fri Nov 13 15:27:11 2026 +0000 ring-buffer: Check remote reader page commit before meta entries commit 27d44f1c58092c56cf38adf831ca4cfe05b4a03c upstream. __rb_get_reader_page_from_remote() bails out when rb_num_of_entries() is zero before verifying if there is more data committed on the current reader_page (rb_page_size()), while simple_ring_buffer updates page::commit before meta::entries. As a consequence, a race between the writer and reader could lead to __rb_get_reader_page_from_remote() returning NULL, while more data is available for reading on the ring buffer. CPU0 (writer) CPU1 (reader) ------------- ------------- local_set(&page->commit, write); __rb_get_reader_page_from_remote() !rb_read_remote_meta_page() return NULL; simple_rb_meta_inc(meta->entries, 1); This is an issue for rb_advance_reader() which always expects rb_get_reader_page() to return a page. Fix this issue by swapping the checks in __rb_get_reader_page_from_remote(): first it verifies if there is more to read in the current reader page, then it verifies if there's anything at all in the ring buffer. Also, if the reader observes the meta::entries update before page::commit while the writer moves tail_page, it could swap reader_page out and drop unread events. Order page::commit before meta::entries on the writer and rb_read_remote_meta_page() before rb_page_size() on the reader size. Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261113152729.837429-3-vdonnefort@google.com Fixes: 2e67fabd8b77 ("ring-buffer: Introduce ring-buffer remotes") Fixes: 34e5b958bdad ("tracing: Introduce simple_ring_buffer") Signed-off-by: Vincent Donnefort Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 3a5ffd5e9c4626e3e81ee81b20bf18ba5fc3e2c8 Author: Bradley Morgan Date: Wed Sep 23 17:56:31 2026 +0000 powerpc32/modules: Reserve a PLT entry for ftrace_regs_caller commit dc6eb6f08be536223e8289c7a8b1f515b1355721 upstream. Commit 7dfbfb87c243 ("powerpc/ftrace: Activate HAVE_DYNAMIC_FTRACE_WITH_REGS on PPC32") made count_relocs() undercount the PLT entries the loader consumes: module_finalize_ftrace() now creates two trampolines (mod->arch.tramp for ftrace_caller() and mod->arch.tramp_regs for ftrace_regs_caller()), while count_relocs() reserves only one entry for ftrace. So the core .plt ends up one ppc_plt_entry (16 bytes) short. The walk in do_plt_call() scans for a free slot with "while (entry->jump[0])" and has no bound check, so once the last reserved slot is used up, the walk steps past the end of the section and patch_instruction() writes the 4-instruction trampoline into whatever module memory follows the .plt. Count the second entry, mirroring what module_64.c does for the same pair of stubs. Signed-off-by: Bradley Morgan Fixes: 7dfbfb87c243 ("powerpc/ftrace: Activate HAVE_DYNAMIC_FTRACE_WITH_REGS on PPC32") Reviewed-by: Christophe Leroy (CS GROUP) Cc: stable@vger.kernel.org Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20260923175631.235276-1-brads@mainlining.org Signed-off-by: Greg Kroah-Hartman commit 76cffb5722819bb6d4f2c1c79b742d3e20cc2402 Author: Nathan Chancellor Date: Sun Nov 15 14:18:07 2026 -0700 powerpc/xmon: Avoid unsequenced accesses to tsk in show_task() commit 9ea01307e6c824eb0b8934d95d52bbacae17887d upstream. After a recent improvement in clang to warn on unsequenced accesses to volatile variables [1], an instance appears in show_task(), which can break the build with CONFIG_PPC_WERROR=y / CONFIG_WERROR=y / W=e: arch/powerpc/xmon/xmon.c:3262:3: error: unsequenced accesses to volatile qualified 'tsk' [-Werror,-Wunsequenced] 3261 | printf("%16px %16lx %16px %6d %6d %c %2d %s\n", tsk, | ~~~ 3262 | tsk->thread.ksp, tsk->thread.regs, | ^ Per C11 5.1.2.3.2, accessing a volatile object is a side effect. Per C11 6.5.2, unsequenced side effects on the same scalar object are undefined behavior. Per C11 6.5.2.2.10/12, the evaluation of arguments in a function call is indeterminately sequenced, meaning any side effects in the arguments are unsequenced. tsk was made volatile in commit a2305e3de819 ("powerpc: mark local variables around longjmp as volatile") to ensure its value in show_tasks() was properly restored after returning from a potential longjmp(). Aside from that, the value is not being modified through other means, so rename the volatile parameter and add a local variable named tsk to hold its value throughout show_task(), clearing up the warning. Cc: stable@vger.kernel.org Fixes: a2305e3de819 ("powerpc: mark local variables around longjmp as volatile") Closes: https://github.com/ClangBuiltLinux/linux/issues/2199 Link: https://github.com/llvm/llvm-project/commit/955715460eaf9188c241c74750637fc82dfcc423 [1] Signed-off-by: Nathan Chancellor Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261115-xmon-wunsequenced-v1-1-42ae3fe45bf4@kernel.org Signed-off-by: Greg Kroah-Hartman commit 45c59e0290434bdb4a44f11c8999cfca80c7f7e5 Author: Jiale Yao Date: Thu Oct 29 13:29:48 2026 +0800 powerpc/eeh: NUL-terminate force recovery input commit f294ebd827e7a2b831b1eef4aaf437f07b2c235e upstream. eeh_force_recover_write() can fill its entire stack buffer from userspace and then pass the unterminated data to strncmp() and sscanf(). This can make the string helpers read beyond the buffer. Reserve the last byte and initialize the buffer so every accepted input is NUL-terminated. Propagate copy errors before parsing as well. Fixes: 954bd99435b8 ("powerpc/eeh: Add eeh_force_recover to debugfs") Cc: stable@vger.kernel.org Signed-off-by: Jiale Yao Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261029052948.2525048-1-yaojiale02@163.com Signed-off-by: Greg Kroah-Hartman commit 883bfd21b3c7226666585d6fe4252a0492f5c1f8 Author: Paul Moses Date: Fri Oct 30 06:48:50 2026 +0000 perf record: Reject CPU indices equal to the mask size commit 82b4a28e758816365405e01d9ed09027d13ef77a upstream. record__mmap_cpu_mask_init() rejects CPU indices greater than nbits but accepts nbits itself. Valid indices end at nbits - 1. When nbits is a multiple of BITS_PER_LONG, __set_bit() accesses the word immediately past the bitmap allocation. User specified recording thread masks reach this write before they are intersected with the selected CPU mask. For example, an affinity mask containing CPU 64 overruns a bitmap allocated for 64 possible CPUs. ==40343==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7bbab4000018 at pc 0x6195de57af45 bp 0x7ffe25545d20 sp 0x7ffe25545d18 READ of size 8 at 0x7bbab4000018 thread T0 Reject indices greater than or equal to nbits before setting a bit. Fixes: cbd7bfc7fd99acdd ("tools/perf: Fix out of bound access to cpu mask array") Signed-off-by: Paul Moses Acked-by: Namhyung Kim Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Athira Rajeev Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: stable@vger.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Greg Kroah-Hartman commit eafafeb2f9cf99f044729ea5747771fd614a1ef8 Author: Yehyeong Lee Date: Sun Oct 25 10:37:48 2026 +0900 RDMA/srpt: widen the indirect RDMA context counters commit 013eb66a8ef25ef531bf41d79815948ab4938571 upstream. srpt_send_ioctx::n_rdma and ::n_rw_ctx are u8, and neither of the values stored in them is bounded by 255. n_rw_ctx counts the INDIRECT descriptors a command carries, and the count guard in srpt_get_desc_tbl() admits data_out_desc_cnt plus data_in_desc_cnt, so up to 510. At 256 descriptors n_rw_ctx wraps to zero, and srpt_release_cmd() frees the contexts only when it is non-zero, so every scatterlist and RDMA context the command allocated leaks. n_rdma is not a descriptor count at all. It is the sum of the rdma_rw_ctx_init() return values, which is the number of work requests each context needs, accumulated by ioctx->n_rdma += ret. A handful of descriptors for large transfers can pass 255 on their own, with no unusual descriptor count involved. A wrapped n_rdma is then handed to atomic_sub_return(ioctx->n_rdma, &ch->sq_wr_avail) and tested by WARN_ON(ioctx->n_rdma <= 0), so the send queue work request accounting drifts too. Make both counters int, the type the values they accumulate already have. Fixes: b99f8e4d7bcd ("IB/srpt: convert to the generic RDMA READ/WRITE API") Cc: stable@vger.kernel.org Reviewed-by: Bart Van Assche Signed-off-by: Yehyeong Lee Link: https://patch.msgid.link/20261025013748.3755639-4-yhlee@isslab.korea.ac.kr Signed-off-by: Leon Romanovsky Signed-off-by: Greg Kroah-Hartman commit 7b15d76fa2374df54724817d215b0f4919926379 Author: Yehyeong Lee Date: Sun Oct 25 10:37:47 2026 +0900 RDMA/srpt: reject zero-length buffer descriptors commit 252fc17ff4fbc2c6ead5e2f9404c9d0c490f0965 upstream. srpt_alloc_rw_ctxs() takes each buffer descriptor length straight from the wire and hands it to target_alloc_sgl(), which has no length check of its own. For the single descriptor of a DIRECT request, and for the last descriptor of an INDIRECT table, chainable is false, so a zero length makes sgl_alloc_order() compute nalloc zero. kmalloc_objs() answers that with ZERO_SIZE_PTR, which is not NULL, so the allocation looks like it succeeded and sg_init_table(sgl, 0) runs. That reaches sg_init_marker(), which does sg_mark_end(&sgl[nents - 1]) with nents unsigned, so the index is 4294967295 rather than minus one and the read modify write of page_link lands far outside any allocation. Oops: general protection fault, probably for non-canonical address 0xdffffc03fffffffe: 0000 [#1] KASAN PTI KASAN: probably user-memory-access in range [0x0000001ffffffff0-0x0000001ffffffff7] CPU: 0 UID: 0 PID: 43 Comm: kunit_try_catch Tainted: G N 7.3.0-12378-g6fba331225f5-dirty #1 PREEMPT(lazy) Tainted: [N]=TEST RIP: 0010:sgl_alloc_order+0xb6/0x370 Code: ef 01 4c 89 e2 49 89 c4 31 f6 49 c1 e7 05 48 89 c7 e8 ae e0 cb ff 4d 01 e7 48 b8 00 00 00 00 00 fc ff df 4c 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 6b 02 00 00 49 bc 00 00 00 00 00 fc ff df 49 8b RSP: 0000:ffff888002d4fa38 EFLAGS: 00010202 RAX: dffffc0000000000 RBX: 0000000000001000 RCX: 0000000000000000 RDX: 00000003fffffffe RSI: 0000000000000000 RDI: 0000000000000010 RBP: 0000000000000000 R08: ffff888002b158a0 R09: 0000000000000000 R10: 0000000000000010 R11: 0000000000000037 R12: 0000000000000010 R13: ffff888002d6803c R14: 0000000000000000 R15: 0000001ffffffff0 FS: 0000000000000000(0000) GS:0000000000000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffff88802f1c8000 CR3: 000000002e458000 CR4: 00000000000006f0 Call Trace: target_alloc_sgl+0x2b/0x70 srpt_alloc_rw_ctxs+0x2ef/0x870 srpt_test_parse+0x114/0x580 ? __pfx_srpt_test_parse+0x10/0x10 ? srpt_test_ctx_init_direct+0x17d/0x280 srpt_direct_len0_test+0xa4/0x280 ? __pfx_srpt_direct_len0_test+0x10/0x10 ? __set_cpus_allowed_ptr+0x181/0x240 ? __pfx_read_tsc+0x10/0x10 ? ktime_get_ts64+0x192/0x250 kunit_try_run_case+0x1ca/0x4b0 ? __pfx_kunit_try_run_case+0x10/0x10 ? kthread_affine_node+0x24b/0x370 ? __pfx_kthread_affine_node+0x10/0x10 ? __pfx_kunit_try_run_case+0x10/0x10 ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 kunit_generic_run_threadfn_adapter+0x7b/0xe0 kthread+0x36e/0x500 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x34d/0x620 ? __pfx_ret_from_fork+0x10/0x10 ? __switch_to+0x22/0xdd0 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x19/0x30 The KUnit harness that forces this is not part of this patch. A zero length descriptor elsewhere in a table is chainable, so one entry is allocated and that write does not happen, but the entry count comes back zero and the mapping in rdma_rw_ctx_init() then refuses it. The target core never hands the same allocator a zero length. Its own call in transport_generic_new_cmd() sits behind a cmd->data_length test. Reject a descriptor whose length is zero. The existing unwind label covers the first iteration, where its loop body does not run because nothing has been allocated yet. Fixes: b99f8e4d7bcd ("IB/srpt: convert to the generic RDMA READ/WRITE API") Cc: stable@vger.kernel.org Signed-off-by: Yehyeong Lee Link: https://patch.msgid.link/20261025013748.3755639-3-yhlee@isslab.korea.ac.kr Reviewed-by: Bart Van Assche Signed-off-by: Leon Romanovsky Signed-off-by: Greg Kroah-Hartman commit 652909a0ac32214b51718482b73676da27e280be Author: Yehyeong Lee Date: Sun Oct 25 10:37:46 2026 +0900 RDMA/srpt: bound the indirect descriptor table to the IU commit 82d46dedf750addfad5480f79165cacb81c89650 upstream. srpt_get_desc_tbl() takes the number of INDIRECT descriptors from idb->table_desc.len, which the initiator controls, and checks it only against data_out_desc_cnt + data_in_desc_cnt, two more initiator fields. Both are u8, so the pair admits up to 510 descriptors, and nothing compares the table against the receive IU it has to live in. srpt_alloc_rw_ctxs() then walks idb->desc_list for that many entries. With the default srp_max_req_size of 8276 the table fits as long as the additional CDB is short, but ADDITIONAL CDB LENGTH is an initiator field too, and at its maximum of 252 bytes 510 descriptors end at 48 + 252 + 20 + 510 * 16 = 8480, which is past the end of the object. BUG: KASAN: slab-out-of-bounds in srpt_alloc_rw_ctxs+0x631/0x870 Read of size 4 at addr ffff888002d6a05c by task kunit_try_catch/43 CPU: 0 UID: 0 PID: 43 Comm: kunit_try_catch Tainted: G N 7.3.0-12378-g6fba331225f5-dirty #1 PREEMPT(lazy) Tainted: [N]=TEST Call Trace: dump_stack_lvl+0x3f/0x50 print_report+0xcd/0x620 ? alloc_pages_node_noprof+0xa2/0x140 ? srpt_alloc_rw_ctxs+0x631/0x870 kasan_report+0xde/0x110 ? srpt_alloc_rw_ctxs+0x631/0x870 srpt_alloc_rw_ctxs+0x631/0x870 srpt_test_parse+0x114/0x580 ? __pfx_srpt_test_ctx_common.constprop.0+0x10/0x10 ? __pfx_srpt_test_parse+0x10/0x10 ? srpt_test_ctx_init.constprop.0+0x4cb/0x6c0 srpt_test_run.constprop.0+0xc1/0xa60 ? pick_task_fair+0x126/0x1950 ? __pfx_srpt_test_run.constprop.0+0x10/0x10 ? update_curr.constprop.0+0x4a/0x390 ? __set_cpus_allowed_ptr+0x181/0x240 ? __pfx_read_tsc+0x10/0x10 ? ktime_get_ts64+0x192/0x250 kunit_try_run_case+0x1ca/0x4b0 ? __pfx_kunit_try_run_case+0x10/0x10 ? kthread_affine_node+0x24b/0x370 ? __pfx_kthread_affine_node+0x10/0x10 ? __pfx_kunit_try_run_case+0x10/0x10 ? __pfx_kunit_generic_run_threadfn_adapter+0x10/0x10 kunit_generic_run_threadfn_adapter+0x7b/0xe0 kthread+0x36e/0x500 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x34d/0x620 ? __pfx_ret_from_fork+0x10/0x10 ? __switch_to+0x22/0xdd0 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x19/0x30 Allocated by task 43: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 __kasan_slab_alloc+0x6e/0x70 kmem_cache_alloc_noprof+0xfc/0x2b0 srpt_test_ctx_common.constprop.0+0x46f/0x9b0 srpt_test_ctx_init.constprop.0+0x30/0x6c0 srpt_test_run.constprop.0+0xb6/0xa60 kunit_try_run_case+0x1ca/0x4b0 kunit_generic_run_threadfn_adapter+0x7b/0xe0 kthread+0x36e/0x500 ret_from_fork+0x34d/0x620 ret_from_fork_asm+0x19/0x30 The buggy address belongs to the object at ffff888002d68000 which belongs to the cache srpt-kunit-iu of size 8276 The buggy address is located 8 bytes to the right of allocated 8276-byte region [ffff888002d68000, ffff888002d6a054) The KUnit harness that forces this is not part of this patch. A table_desc.len below one descriptor is the other way in. It gives nbufs zero, which the count check admits and a span check cannot catch either, since an empty table fits in any IU. srpt_alloc_rw_ctxs() then returns success with n_rw_ctx zero, no scatterlist is chained, and srpt_write_pending() reaches ib_post_send() with an empty work request list. rvt_post_send() evaluates !wr->next before the loop that tests wr against NULL, so an rdmavt device faults there whenever its send queue is idle. Reject a table that does not fit by comparing the span it occupies against byte_len, and reject an empty one. The span is the table offset plus struct_size(idb, desc_list, nbufs), and nbufs is at most 510 once the existing count check has passed, so it cannot saturate. The header always lies inside the allocated buffer, since the largest offset srpt_get_desc_buf() can return is 48 + 252 and the header is 20 bytes, so it ends at 320 while srp_max_req_size is at least MIN_MAX_REQ_SIZE, which is 996. It does not always lie inside the bytes the initiator actually sent, which is why the span starts at the table offset and covers the header as well. Fixes: a42d985bd5b2 ("ib_srpt: Initial SRP Target merge for v3.3-rc1") Cc: stable@vger.kernel.org Signed-off-by: Yehyeong Lee Link: https://patch.msgid.link/20261025013748.3755639-2-yhlee@isslab.korea.ac.kr Reviewed-by: Bart Van Assche Signed-off-by: Leon Romanovsky Signed-off-by: Greg Kroah-Hartman commit a9dea1b18aba2fef64de55ba7459c70da71c209e Author: Deep Shah Date: Mon Nov 2 06:44:37 2026 +0000 RDMA/siw: Fix use-after-free in siw_mem_id2obj() commit a70672b9b3ac7d8945f67cd199c1bb680d5d5f64 upstream. siw_mem_id2obj() finds a siw_mem with xa_load() under rcu_read_lock() and then takes a reference with kref_get_unless_zero(). This is only safe if the object stays allocated until RCU readers are done with it. siw_free_mem() frees it with kfree() as soon as the last reference is dropped, so a lookup that races with the final put reads freed memory. This happens when an MR is deregistered while an incoming RDMA WRITE looks up its STag: BUG: KASAN: slab-use-after-free in siw_mem_id2obj+0xe5/0x310 Read of size 4 at addr ff110001042aed88 by task repro-rcu2/90 Call Trace: siw_mem_id2obj+0xe5/0x310 siw_proc_write+0x282/0x430 siw_tcp_rx_data+0x12e/0xbf0 __tcp_read_sock+0x12c/0x440 siw_qp_llp_data_ready+0x147/0x260 Allocated by task 89: siw_mr_add_mem+0xb2/0x2a0 siw_reg_user_mr+0x19f/0x380 ib_uverbs_reg_mr+0x2a7/0x4c0 Freed by task 89: kfree+0x301/0x530 siw_dereg_mr+0x31/0x50 ib_dereg_mr_user+0xb9/0x200 Free siw_mem with kfree_rcu(). A lookup that loses the race then sees a zero refcount and fails. The umem or PBL is still released at the last put, since a failed lookup never touches it. Fixes: 2251334dcac9 ("rdma/siw: application buffer management") Cc: stable@vger.kernel.org Signed-off-by: Deep Shah Link: https://patch.msgid.link/20261102064437.23976-1-deepshah146@gmail.com Signed-off-by: Leon Romanovsky Signed-off-by: Greg Kroah-Hartman commit 7821168324a800ca9f728b4a7b308b043296889b Author: Jaeyeong Lee Date: Wed Nov 4 08:50:33 2026 +0000 RDMA/rtrs: Register client event handler after capability check commit 90d95fbc1bcc8464f6d8c6891c62bad4c0dc2d58 upstream. rtrs_clt_ib_dev_init() registers dev->event_handler before checking IB_DEVICE_MEM_MGT_EXTENSIONS. If the device does not provide that capability, init returns -ENOTSUPP and rtrs_ib_dev_find_or_add() frees dev through out_free_pd without calling the deinit callback. The embedded event handler therefore remains on the IB device's list after its storage has been freed. A later IB event walks the dangling list entry and accesses freed memory. The issue was found by static analysis. A focused out-of-tree test module on an x86_64 QEMU/KASAN kernel temporarily cleared only IB_DEVICE_MEM_MGT_EXTENSIONS on a SIW device, exercised the real rtrs_clt_ib_dev_init() callback through rtrs_ib_dev_find_or_add(), restored the capabilities, and dispatched IB_EVENT_DEVICE_FATAL. KASAN reported an 8-byte slab-use-after-free read in ib_dispatch_event_clients(), with both the allocation and free originating in rtrs_ib_dev_find_or_add(). Move the capability check before event handler registration. The check is a prerequisite for successful client initialization. Registration cannot fail and init returns success immediately afterwards, so every installed handler is now owned by a successfully initialized device and is removed by the existing deinit callback. Fixes: 667db86bcbe8 ("RDMA/rtrs: Register ib event handler") Cc: stable@vger.kernel.org Signed-off-by: Jaeyeong Lee Link: https://patch.msgid.link/179378222423.73361.3247716499619173751@jaeyeong.cc Acked-by: Jack Wang Signed-off-by: Leon Romanovsky Signed-off-by: Greg Kroah-Hartman commit 93607c388fd8cd0380cb4d8a28ea1dbddd154f9f Author: Moshe Shemesh Date: Thu Nov 12 15:27:19 2026 +0200 RDMA/mlx5: Skip vport context query on FW without ib_virt support commit e7732ec135b501e87ab060d992b3b5f2ec4396c9 upstream. Since commit b02289b3d60f ("RDMA: Validate grh_required when handling AVs"), mlx5_port_immutable() unconditionally issues QUERY_HCA_VPORT_CONTEXT on InfiniBand ports to read grh_required. Devices that do not support the InfiniBand virtualization interface (ib_virt cleared) are not guaranteed to implement this command. For example, Connect-IB with FW 10.10.5020 rejects it and mlx5_ib fails to probe: mlx5_core 0000:01:00.0: mlx5_cmd_out_err:810:(pid 731): QUERY_HCA_VPORT_CONTEXT(0x762) op_mod(0x0) failed, status bad operation(0x2), syndrome (0x3590f5), err(-22) infiniband mlx5_0: Couldn't create per-port data mlx5_ib.rdma: probe of mlx5_core.rdma.0 failed with error -12 All other HCA vport context users in mlx5_ib are already gated on ib_virt, either directly, as in set_has_smi_cap(), mlx5_ib_get_plane_num() and mlx5_ib_modify_port(), or via mlx5_use_mad_ifc(), which selects MAD_IFC for port queries when ib_virt is not supported. Skipping the query loses nothing. grh_required indicates a GID-based vport, which only exists with InfiniBand virtualization. Without ib_virt the port is always LID-based and the field is zero, even on firmware that accepts the command. This also matches the behavior before b02289b3d60f, when grh_required was filled in only by mlx5_query_hca_port() and was never set on the MAD_IFC path. Fixes: b02289b3d60f ("RDMA: Validate grh_required when handling AVs") Cc: stable@vger.kernel.org Reported-by: Tony Battersby Closes: https://lore.kernel.org/all/064dfa67-8fd4-40f0-b925-6d1e0cd42e6a@cybernetics.com/ Tested-by: Tony Battersby Signed-off-by: Moshe Shemesh Signed-off-by: Edward Srouji Link: https://patch.msgid.link/20261112-moshe-ib-virt-guard-v1-1-6d2caf8bdb1b@nvidia.com Signed-off-by: Leon Romanovsky Signed-off-by: Greg Kroah-Hartman commit b82941bc9e0cdc96c3a788d67ffab212356eefc4 Author: Dezhen Lu Date: Tue Nov 3 15:28:04 2026 +0100 RDMA/mlx5: Fix DevX umem page size truncation for pages >= 4G commit b5c11bf9759834731440806708143c40638dc2ff upstream. devx_umem_find_best_pgsize() computes the page size in an unsigned long but returns it as unsigned int, and devx_umem_reg_cmd_alloc() stores it in an unsigned int. When the DMA mapping of the umem is contiguous and aligned to 4 GiB or more, and the umem length is a multiple of that size, ib_umem_find_best_pgoff() selects a page size >= 2^32. Since the value is a power of two, the truncation turns it into 0 and the registration fails with -EINVAL. The umem log_page_size field is 5 bits wide on top of MLX5_ADAPTER_PAGE_SHIFT, so the command can encode these page sizes. Seen on two GH200 nodes (ConnectX-7, firmware 32.38.3056 and 32.43.1014) with a dma-buf exported from cudaMalloc memory: registering 4 GiB or 8 GiB umems at 4 GiB-aligned offsets of the dma-buf fails with EINVAL every time, while 2 GiB umems at the same offsets and ibv_reg_dmabuf_mr() of the same ranges succeed. Restricting the user pgsz_bitmap to <= 2 GiB makes all of them succeed. Other large physically contiguous buffers, such as a 16 GiB hugetlb page on an arm64 kernel with 64K base pages, should hit the same path. Use unsigned long for the page size, as commit f0c2427412b4 ("RDMA/mlx5: Fix page_size variable overflow") already did for the MR paths. The bug was found by an AI coding assistant (Claude Opus 5.5, Anthropic) during an audit of 32-bit truncations of page sizes and offsets in drivers/infiniband/core and drivers/infiniband/hw/mlx5. The assistant also wrote the reproducer and this patch. The reproducer was run on the GH200 nodes described above. Fixes: 7610ab57de56 ("RDMA/mlx5: Allow larger pages in DevX umem") Cc: stable@vger.kernel.org Signed-off-by: Dezhen Lu Link: https://patch.msgid.link/20261103142804.67210-1-dezhen.lu@student.uni-tuebingen.de Reviewed-by: Jason Gunthorpe Signed-off-by: Leon Romanovsky Signed-off-by: Greg Kroah-Hartman commit 57ca98c3577632dc242f8db10a275ba23c2852f6 Author: Abhijit Gangurde Date: Fri Oct 30 13:54:02 2026 +0530 RDMA/ionic: Use a linear QID space when udma_shift is zero commit 687a1e161457b267963f8334fd143896515cec25 upstream. Firmware reports udma_shift as the log2 of the number of queues in a queue group. A value of zero means the queues are not striped across two UDMAs, so the QID space is linear and the device has one UDMA. The interleaved bitid/qid transform treats bit 0 as the UDMA selector when the group shift is zero. QID 1 then becomes bitid 1 << half_qid_shift, and freeing that QID releases the wrong allocator index. Skip the transform and select one UDMA so QP and CQ allocation uses the QID directly. Fixes: e8521822c733 ("RDMA/ionic: Register device ops for control path") Reported-by: Keith Lucas Link: https://lore.kernel.org/r/20261021161651.4020222-1-haakon.bugge@oracle.com Cc: stable@vger.kernel.org # 6.18 Signed-off-by: Abhijit Gangurde Link: https://patch.msgid.link/20261030082402.841751-1-abhijit.gangurde@amd.com Signed-off-by: Leon Romanovsky Signed-off-by: Greg Kroah-Hartman commit 0fea22ca3b5ca58e3cd6d9896b8a33abacab4ed8 Author: Nathan Chancellor Date: Sat Nov 14 21:26:10 2026 -0700 rcu/nocb: Avoid unsequenced accesses to jiffies in show_rcu_nocb_state() commit c3f98ff6309a29979e1867bc3c9d4172755ca122 upstream. After a recent improvement in clang to warn on unsequenced accesses to volatile variables [1], an instance appears in show_rcu_nocb_state(), which can break the build with CONFIG_WERROR=y / W=e: In file included from kernel/rcu/tree.c:5123: kernel/rcu/tree_nocb.h:1651:3: error: unsequenced accesses to volatile qualified 'jiffies' [-Werror,-Wunsequenced] 1650 | jiffies - rdp->nocb_bypass_first, | ~~~~~~~ 1651 | jiffies - rdp->nocb_nobypass_last, | ^ Per C11 5.1.2.3.2, accessing a volatile object is a side effect. Per C11 6.5.2, unsequenced side effects on the same scalar object are undefined behavior. Per C11 6.5.2.2.10/12, the evaluation of arguments in a function call is indeterminately sequenced, meaning any side effects in the arguments are unsequenced. Add a local variable to hold the value of jiffies before the function call so that there are no unsequenced side effects, clearing up the warning. Cc: stable@vger.kernel.org Fixes: f7a81b12d6af ("rcu/nocb: Print no-CBs diagnostics when rcutorture writer unduly delayed") Closes: https://github.com/ClangBuiltLinux/linux/issues/2192 Link: https://github.com/llvm/llvm-project/commit/955715460eaf9188c241c74750637fc82dfcc423 [1] Signed-off-by: Nathan Chancellor Reviewed-by: Joel Fernandes Signed-off-by: Joel Fernandes Signed-off-by: Greg Kroah-Hartman commit 34fd333186ffd7123de89755df35e4ab11e557b4 Author: Nathan Chancellor Date: Sun Nov 15 21:45:22 2026 -0700 qca_spi: Avoid unsequenced accesses to jiffies in qcaspi_netdev_tx_timeout() commit 695d0824cb6b27ff1a1cdeabb2d5138f00b15251 upstream. After a recent improvement in clang to warn on unsequenced accesses to volatile variables [1], an instance appears in qcaspi_netdev_tx_timeout(), which can break the build with CONFIG_WERROR=y / W=e: drivers/net/ethernet/qualcomm/qca_spi.c:805:16: error: unsequenced accesses to volatile qualified 'jiffies' [-Werror,-Wunsequenced] 805 | jiffies, jiffies - dev_trans_start(dev)); | ~~~~~~~ ^ Per C11 5.1.2.3.2, accessing a volatile object is a side effect. Per C11 6.5.2, unsequenced side effects on the same scalar object are undefined behavior. Per C11 6.5.2.2.10/12, the evaluation of arguments in a function call is indeterminately sequenced, meaning any side effects in the arguments are unsequenced. Printing jiffies on its own is not that useful for debugging transmit timeouts, so get rid of it to clear up the warning. Cc: stable@vger.kernel.org Fixes: 291ab06ecf67 ("net: qualcomm: new Ethernet over SPI driver for QCA7000") Closes: https://github.com/ClangBuiltLinux/linux/issues/2197 Link: https://github.com/llvm/llvm-project/commit/955715460eaf9188c241c74750637fc82dfcc423 [1] Signed-off-by: Nathan Chancellor Acked-by: Stefan Wahren Reviewed-by: Nick Desaulniers Link: https://patch.msgid.link/20261115-qca_spi-wunsequenced-v2-1-8cf32f12d546@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 3623f4a286a5df36f3cf9d62311790ad178008ad Author: Shrikanth Hegde Date: Wed Nov 18 10:44:17 2026 +0530 PPC32: Fix hard_irq_disable to follow tracing and lockdep state commit 2672bdcc7857073722c4772831a24b14832ee88a upstream. On PPC32, the code for hard_irq_disable has diverged and it doesn't do lockdep/tracing anymore, leading to use of both local_irq_disable and hard_irq_disable on PPC32 to overcome those. That is un-necessary, instead simply calling local_irq_disable is enough. It disables EE bit and does lockdep tracking. Subsequent patch uses this API in KVM code to avoid the warnings. Wider use of it is possible, but it will be taken subsequently. Cc: stable@vger.kernel.org # v7.2+ Suggested-by: Ritesh Harjani (IBM) Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Shrikanth Hegde Reviewed-by: Mukesh Kumar Chaurasiya (IBM) Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261118051419.783878-2-sshegde@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 857f77fbcc101bafda32d7c66c6e36c2ca1aa674 Author: David Hildenbrand (Arm) Date: Thu Nov 12 23:53:22 2026 +0100 mm/mmu_gather: flush pending references early before the folio limit commit 317bd7d28b248fd4d4e14614d7c30b17a36ef4d7 upstream. When a task zaps mappings (e.g., MADV_DONTNEED), it can drop the PT lock and defer dropping the folio references. In the meantime, page faults can refault pagecache folios, creating more references for the same folios. These deferred references can build up over multiple VMAs. Let's just request a flush after enqueueing folios whose refcount reached a certain threshold. Start flushing well before new references are refused, regardless of the caller's privileges. When returning "true" from __tlb_remove_folio_pages_size(), PTE zapping will flush the TLB before dropping the PT lock, but drop the references afterwards. Refaults can still race with that, but flushing early reduces the risk of letting others hit the limit. This is a temporary measure until we have something better. Reported-by: Chris Mason Fixes: 800d8c63b2e9 ("shmem: add huge pages support") Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS") Fixes: 793917d997df ("mm/readahead: Add large folio readahead") Cc: stable@vger.kernel.org Reviewed-by: Jose A. Perez de Azpillaga Reviewed-by: Lance Yang Reviewed-by: Pedro Falcato Link: https://patch.msgid.link/20261112-refcount_overflow_stable-v4-3-ad3deef0bd23@kernel.org Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit 423b36750eabe1403f4782cb6d6a9dd5a7c83b86 Author: David Hildenbrand (Arm) Date: Thu Nov 12 23:53:24 2026 +0100 mm/gup: limit pagecache folio refcount when grabbing references commit 2d9bcd380585abc436f055fbb618b34f98882004 upstream. Let's add __folio_ref_count_over_limit() checks in fast and slow GUP before acquiring additional references or pins. Keep it simple and use the check for all folio types. Also propagate try_grab_folio() errors when grabbing additional references in __get_user_pages() and in memfd_pin_folios(), so hitting the limit returns -ENOMEM instead of -EFAULT and -EINVAL, respectively. Keep the existing invalid-refcount warnings. Fixes: 800d8c63b2e9 ("shmem: add huge pages support") Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS") Fixes: 793917d997df ("mm/readahead: Add large folio readahead") Cc: stable@vger.kernel.org Reviewed-by: Jose A. Perez de Azpillaga Reviewed-by: Pedro Falcato Link: https://patch.msgid.link/20261112-refcount_overflow_stable-v4-5-ad3deef0bd23@kernel.org Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit 4a5ea8b18be1aa2dd2ad5ea51d5023d320397265 Author: David Hildenbrand (Arm) Date: Thu Nov 12 23:53:21 2026 +0100 mm: limit pagecache folio refcount when splicing into pipes commit c6c9a4c1c9a1669693330205cb9d86fafd3cf235 upstream. Similar to mapping pagecache folios into page tables, let's reject additional references when splicing folios into a pipe if the refcount is at its limit. This will prevent more cases of possible folio refcount overflows with large pagecache folios. Introduce folio_get_checked() for checked reference acquisition when the caller already holds a reference. It warns and fails on a non-positive refcount and rejects additional references at the limit. Add __folio_ref_count_over_limit() so folio_get_checked() can reuse the refcount instead of having to read it a second time. Use folio_get_checked() in splice_folio_into_pipe() and fuse_ref_folio(), returning -EFAULT on failure, like we already do for pipe-buffer duplication. Similarly, make try_get_page() use it instead. Likely try_get_page() should be renamed (or removed) later, as it doesn't match the folio_try_get() semantics and is confusing. If we hit the limit after splicing some data, return the number of bytes already spliced. Teach the callers to handle errors, and stop filemap_splice_read() if we only spliced part of a folio, so we don't skip ahead to the next folio: note that we wouldn't run into this scenario before as we always spliced the requested range. The check in try_get_page() also covers pipe-buffer duplication by tee() and partial pipe-to-pipe splicing. Note that we deliberately will not fall back to the slow path of copying the folio, particularly as the folio might have an invalid refcount. If it is ever really required, we can revisit. Fixes: 800d8c63b2e9 ("shmem: add huge pages support") Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS") Fixes: 793917d997df ("mm/readahead: Add large folio readahead") Cc: stable@vger.kernel.org Reviewed-by: Jose A. Perez de Azpillaga Reviewed-by: Pedro Falcato Link: https://patch.msgid.link/20261112-refcount_overflow_stable-v4-2-ad3deef0bd23@kernel.org Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit 33bd8d2b188eae1684334c09bf1342b3001243e7 Author: David Hildenbrand (Arm) Date: Thu Nov 12 23:53:20 2026 +0100 mm: limit pagecache folio refcount when mapping pages commit 26b8f029ce5224dd5c5f45a4bc964a209c259914 upstream. With large file folios, overflowing the folio mapcount and refcount became possible more easily. For anon folios it is currently not really an issue: each large anon folio can only be mapped once into a process; on 4k kernels it would be more processes than usually allowed on a system, and on 16k or 64k kernels the processes alone would consume hundreds of GiB. Something to be sorted out at some point, but it's not as urgent. Being able to overflow the refcount is not really big news, but it's about time that we do something about it because some modern technology might find ways to abuse it :) One of the enablers for that was commit ddc58f27f9ee ("mm: drop tail page refcounting"), however, file thp support was added later. File folios can be mapped multiple times into the same process, allowing for processes to hold many references to the same folio. As a short-term solution, let's introduce two folio refcount limits: one for ordinary consumers and one for admins. Leave some headroom before the refcount goes negative, which we really don't want (having the mapcount go negative is also not expected). Start reporting SIGBUS and a ratelimited warning if we run into limits. When restoring mappings from migration entries, instead zap the pte/pmd entry. We allow for slightly exceeding the limit to keep things simpler. During fork(), prefer not copying page table entries over failing fork. For fault-around, check in next_uptodate_folio() before trying to lock the folio. Export folio_ref_count_over_limit_slowpath() using EXPORT_SYMBOL_GPL right away so modules can use it through try_get_page(), where we will use it next. Use has_capability_noaudit(current, CAP_SYS_RESOURCE), so filesystem credential overrides do not affect access to the admin reserve, and to not generate auditing messages simply because we access optional reserves. Don't grant access to the admin reserve from kernel threads, from interrupt context, where "current" is just the interrupted task, or with IRQs disabled, as even unaudited capability checks can take locks. This is far from ideal, but better than all easy alternatives we can backport comfortably. For now it fixes the big problem: letting the refcount (+mapcount) go negative and cause trouble. This is only a temporary fix. Keep the mapping checks explicit and separate from reference acquisition: most are expected to disappear when we rework the underlying refcounting. Check order 0 folios as well for consistency: each folio_add_file_rmap*() and folio_dup_file_rmap*() needs a prior check. Adjust the check in folio_get() to just check for invalid refcounts and drop folio_ref_zero_or_close_to_overflow(): we really don't want negative refcounts or negative mapcounts. Convert to VM_WARN_ON_FOLIO as we touch it. Also, just document -EHWPOISON for copy_present_ptes() while at it. Note: When zapping file migration entries, uffd-wp is preserved using PTE markers, but uffd-rwp protection is lost because there is no corresponding marker. try_to_unmap() already has the same problem when unmapping file folios, so we'll happily ignore it. Reported-by: Chris Mason Fixes: 800d8c63b2e9 ("shmem: add huge pages support") Fixes: 99cb0dbd47a1 ("mm,thp: add read-only THP support for (non-shmem) FS") Fixes: 793917d997df ("mm/readahead: Add large folio readahead") Cc: stable@vger.kernel.org Reviewed-by: Jose A. Perez de Azpillaga Acked-by: Zi Yan Reviewed-by: Pedro Falcato Link: https://patch.msgid.link/20261112-refcount_overflow_stable-v4-1-ad3deef0bd23@kernel.org Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit 8b2f9e6508c80be57f68b9853a851e94553a7f2f Author: Muchun Song Date: Fri Oct 23 14:34:25 2026 +0800 mm: fix missing page-table destructor in pagetable_free() commit 2a700ab992286e1d3893289909ec46569a725257 upstream. Patch series "mm: Fix page-table teardown during memory hot-remove", v3. Memory hot-remove can free page-table pages allocated through paths with different constructor state. Some paths run the page-table constructor, while generic sparse-vmemmap population may not. The x86, RISC-V, and arm64 teardown paths did not handle that distinction consistently, leaving constructor/destructor accounting unbalanced. Make pagetable_free() handle any remaining constructor state before freeing a page-table page. Callers that already ran pagetable_dtor() have cleared that state, so the destructor is not run twice. The RISC-V and arm64 fixes then use this common helper for their memory-hot-remove paths. The architecture fixes depend on the common MM change in patch 1, so this remains a single series. I expect it to go through the MM tree, with review or acks from the relevant architecture maintainers. This patch (of 4): Since commit 49f599666420 ("mm: call ctor/dtor for kernel PTEs"), pte_alloc_one_kernel() runs the page-table constructor for kernel PTE tables. HVO (HugeTLB Vmemmap Optimization) uses pte_alloc_one_kernel() when splitting a PMD. Restoring the vmemmap backing pages does not collapse the PTE table, so a later memory hot-remove eventually frees it through pagetable_free() on x86-64. That releases the page without running the matching destructor and leaves NR_PAGETABLE elevated. Make pagetable_free() the common free-side primitive for page-table pages. It checks PageTable() and runs the destructor only when the constructor state is still present. Callers that explicitly ran pagetable_dtor() have already cleared PageTable(), so they are not destructed twice; pages that never ran a constructor are freed directly. Link: https://lore.kernel.org/20261023063428.3658761-1-songmuchun@bytedance.com Link: https://lore.kernel.org/20261023063428.3658761-2-songmuchun@bytedance.com Fixes: 49f599666420 ("mm: call ctor/dtor for kernel PTEs") Signed-off-by: Muchun Song Signed-off-by: Andrew Morton Reviewed-by: Jose A. Perez de Azpillaga Reviewed-by: Kevin Brodsky Acked-by: Dave Hansen Acked-by: David Hildenbrand (Arm) Reviewed-by: Anshuman Khandual Cc: Oscar Salvador Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Alexandre Ghiti Cc: Björn Töpel Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Alexander Gordeev Cc: Alistair Popple Cc: # bf9e4e30f353: x86/mm: use pagetable_free() Signed-off-by: Greg Kroah-Hartman commit 61284656569e002abd5105d72f84ae491a4198cd Author: Mike Rapoport (Microsoft) Date: Sun Nov 1 10:24:02 2026 +0200 mm/vma: undo userfaultfd unmap preparation when unmapping fails commit f987d9f38a46216d45326b7a61c619c574b45837 upstream. vms_gather_munmap_vmas() collects VMAs to unmap and calls userfaultfd_unmap_prep() for each of these VMAs. This takes a reference to the userfaultfd context, raises ctx->mmap_changing and queues an UFFD_EVENT_UNMAP on the caller's list. If gathering fails half way, e.g. because one of the VMAs is sealed, or the operation fails after the VMAs were gathered, the original mappings stay intact but the queued events remain on the list. Depending on the caller they are either delivered although nothing was unmapped (munmap(), mremap(), mmap(MAP_FIXED)), or silently dropped (brk()). In the latter case the userfaultfd context and the mm_struct it pins are leaked and mmap_changing is never lowered, so UFFDIO_COPY, UFFDIO_ZEROPAGE and all other ioctls that check mmap_changing fail with -EAGAIN forever. With mseal() this is trivially triggered by an unprivileged process. Collect the events in do_vmi_align_munmap() on a local list and splice it to the caller's list only when the unmap completes, because mremap() may already have events for earlier unmaps on that list. Drop the pending events with a new userfaultfd_unmap_abort() helper when do_vmi_align_munmap() or __mmap_setup() fail. Link: https://lore.kernel.org/20261101-uffd-unmap-abort-v1-1-1588d7a7c61a@kernel.org Fixes: 65ac132027a8 ("userfaultfd: fix regression in userfaultfd_unmap_prep()") Signed-off-by: Mike Rapoport (Microsoft) Signed-off-by: Andrew Morton Reported-by: Noah Weinberger Reviewed-by: Tal Zussman Tested-by: Tal Zussman Cc: Liam R. Howlett Cc: Lorenzo Stoakes Cc: David Hildenbrand Cc: Jann Horn Cc: Pedro Falcato Cc: Peter Xu Cc: Vlastimil Babka Cc: Signed-off-by: Greg Kroah-Hartman commit 5336ba67fe2be6a01fd0282a9c42c763d28665e6 Author: David Hildenbrand (Arm) Date: Wed Nov 11 22:59:59 2026 +0100 mm/userfaultfd: fix PTE table overruns in UFFDIO_MOVE commit 169169e26ab498e4a3ee07313e986176f4bc52f0 upstream. With a folded PMD, pmd_addr_end() simply returns the supplied end. move_present_ptes() can therefore walk past the source or destination PTE table during UFFDIO_MOVE. pmd_addr_end() is only intended for page table traversal, in patterns like "next = pmd_addr_end(addr, end);". With folded PMDs, a higher level has already clamped the range to the PTE table. Folded PMDs are uncommon, but can occur even on arm64, for example with 64K pages and a 42-bit virtual address space. Extract the calculation from folio_pte_range() into pte_table_clamped_end() and use it to clamp both ranges. This preserves the wraparound handling from commit f681d4580d5c ("mm: fix address wraparound when scanning large folio PTEs"). Fixes: 50944692052b ("userfaultfd: opportunistic TLB-flush batching for present pages in MOVE") Cc: stable@vger.kernel.org Reported-by: Chris Mason Reviewed-by: Baolin Wang Link: https://patch.msgid.link/20261111-pte_table_clamped_end-v1-1-2dbe339c487a@kernel.org Reviewed-by: Lokesh Gidra Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit 5b5a235ff8dd7064761982bfe41b4bea85e6b78e Author: Mani Tofigh Date: Tue Oct 27 16:33:32 2026 -0400 mm/shmem: fix swapin livelock on a mismatched large swap cache folio commit fc2c19648d681cc5fb00efa938b78460c2e5b44d upstream. On a SWP_SYNCHRONOUS_IO swap device, a large shmem folio can be left in the swap cache over swap slots that another file now uses. Reading that other file then loops forever in shmem_get_folio_gfp(): shmem_swapin_folio() finds the large folio, rounds the index and the swap entry down to the folio's size, finds no matching entry in the file and returns -EEXIST, and the retry finds the same folio again. Since the task keeps the mapping locked, a munmap() of the same mapping waits forever. The folio is left behind when the slots are freed and reused while the swapin is still allocating it: Task A (reads X) Task B ---------------- ------ shmem_swapin_folio() allocate a large folio for X's slots punch a hole in X /* X's slots freed */ swap out file Y /* Y reuses those slots */ add the folio to the swap cache over those slots shmem_confirm_swap() fails /* -EEXIST, the folio stays in the swap cache */ Task C (reads Y) ---------------- shmem_swapin_folio() finds the large folio rounds down to its start, where Y has no entry /* -EEXIST, retried forever */ Before commit c246d236b18b ("mm/shmem: never bypass the swap cache for SWP_SYNCHRONOUS_IO"), a direct swapin that failed this way freed its folio instead of leaving it in the swap cache. do_swap_page() already drops a large swap cache folio that does not fit for anonymous memory. Do the same in shmem_swapin_folio() and on a -EEXIST, remove a large folio that is not anonymous/dirty/under-writeback from the swap cache so that the retry swaps in a folio that fits. The reproducer below fills a small brd swap device so that a 64K shmem folio and the 4K pages of another file land in the same slots, and races a read of the first file with a hole punch and a swapout of the second. This bug was identified and confirmed with the help of a deterministic hypervisor currently under development, but the non-deterministic C reproducer can typically trigger it in the 2-4s time range. With the fix, nothing is triggered after 600 seconds. Link: https://lore.kernel.org/20261027-shmem-swapin-mismatch-v1-1-84e30aa3b9e5@columbia.edu Fixes: c246d236b18b ("mm/shmem: never bypass the swap cache for SWP_SYNCHRONOUS_IO") Signed-off-by: Mani Tofigh Signed-off-by: Andrew Morton Reviewed-by: Baolin Wang Cc: Hugh Dickins Cc: Kairui Song Cc: Chris Li Cc: Kemeng Shi Cc: Nhat Pham Cc: Baoquan He Cc: Barry Song Cc: Youngjun Park Cc: David Hildenbrand Cc: Tal Zussman Cc: Signed-off-by: Greg Kroah-Hartman commit 35a9e6a2336756a0e3adf926c63fba78ad8ef6bb Author: David Hildenbrand (Arm) Date: Wed Nov 11 23:00:00 2026 +0100 mm/rmap: fix PTE table overruns during batched unmap commit d8bbf585893c7868234b71d7e7f32484ed0d8458 upstream. With a folded PMD, pmd_addr_end() simply returns the supplied end. folio_unmap_pte_batch() can therefore walk past the PTE table when unmapping a large folio. Folded PMDs are uncommon, but can occur even on arm64, for example with 64K pages and a 42-bit virtual address space. Use pte_table_clamped_end() to clamp the range to the PTE table and VMA boundaries. Fixes: 354dffd29575 ("mm: support batched unmap for lazyfree large folios during reclamation") Cc: stable@vger.kernel.org Reported-by: Chris Mason Reviewed-by: Baolin Wang Link: https://patch.msgid.link/20261111-pte_table_clamped_end-v1-2-2dbe339c487a@kernel.org Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit cd0a9095b21144dfc2db9697f662607b09e44d75 Author: David Hildenbrand (Arm) Date: Wed Nov 11 23:00:01 2026 +0100 mm/rmap: fix PTE table overruns during batched reference checks commit 2d9b9352ef885837f246225e9b814a05e9ed2a4a upstream. With a folded PMD, pmd_addr_end() simply returns the supplied end. folio_referenced_one() can therefore walk past the PTE table when checking references to a large folio. Folded PMDs are uncommon, but can occur even on arm64, for example with 64K pages and a 42-bit virtual address space. Use pte_table_clamped_end() to clamp the range to the PTE table and VMA boundaries. Fixes: 52e054f71840 ("mm: rmap: support batched checks of the references for large folios") Cc: stable@vger.kernel.org Reported-by: Chris Mason Reviewed-by: Baolin Wang Link: https://patch.msgid.link/20261111-pte_table_clamped_end-v1-3-2dbe339c487a@kernel.org Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit 56e42c66c97b34036032b5beb089d5ab03befc60 Author: Ridong Chen Date: Tue Oct 27 12:32:14 2026 +0800 mm/migrate: move NR_KERNEL_FILE_PAGES on cross-node migration commit 4ac11db025da54f389796920b253221d1afe6aac upstream. NR_KERNEL_FILE_PAGES counts page cache folios of mappings flagged AS_KERNEL_FILE (currently the btrfs btree inode). It is a per-node counter: filemap_add_folio() adds to folio_pgdat() of the new folio and filemap_unaccount_folio() subtracts from folio_pgdat() of the folio being removed. __folio_migrate_mapping() does not move it when such a folio is migrated to another node, so the source node keeps the count forever and the destination node underflows once the folio is freed. btree folios are migratable through btree_migrate_folio(), so demotion, DAMON-based migration (DAMOS_MIGRATE_{HOT,COLD}) or memory offlining all hit this. Reproducer, on a QEMU guest with two memory tiers (node0 is DRAM with all CPUs, node1 is a CPU-less slower node described via HMAT) and /sys/kernel/mm/numa/demotion_enabled set: 1. mount a btrfs and create 20000 empty files, so that btree folios are cached on node0; 2. echo 2G > /sys/devices/system/node/node0/reclaim, which demotes them to node1; 3. umount and drop caches. nr_kernel_file_pages in /sys/devices/system/node/nodeN/vmstat after each step: without this patch with this patch node0 node1 node0 node1 1. cached 1868 0 1868 0 2. demoted 1868 0 36 1832 3. dropped 1832 0 (*) 0 0 (*) the counter has underflowed to -1832; negative values read as 0. The global value in /proc/vmstat is 0 after step 3 in both cases. Move it together with the other node-keyed page cache counters. It is a node-only counter, so use the node accessor, matching how it is accounted elsewhere. Interrupts are disabled here, as for the zone counters below. This was pointed out by Shivank while reviewing the NR_FILE_THPS fix for the same function. Link: https://lore.kernel.org/20261027043214.2248986-1-ridong.chen@linux.dev Fixes: e3a9ac4e866e ("mm: add vmstat for kernel_file pages") Signed-off-by: Ridong Chen Signed-off-by: Andrew Morton Suggested-by: Shivank Garg Acked-by: David Hildenbrand (Arm) Reviewed-by: Shivank Garg Acked-by: Zi Yan Acked-by: Shakeel Butt Cc: Matthew Brost Cc: Joshua Hahn Cc: Byungchul Park Cc: Gregory Price Cc: Ying Huang Cc: Alistair Popple Cc: Boris Burkov Cc: Signed-off-by: Greg Kroah-Hartman commit bd595ed05bc1e7e1d9a1e6b92fc41450433afb36 Author: Ridong Chen Date: Sun Oct 25 19:02:09 2026 +0800 mm/migrate: move NR_FILE_THPS on cross-node migration commit a2108a958143de74b4e5ddca12b01f05ecd030f9 upstream. When a page cache folio is migrated to another node, __folio_migrate_mapping() moves the per-node and per-memcg counters that are keyed off the folio's node: NR_FILE_PAGES, NR_SHMEM, NR_SHMEM_THPS, NR_SWAPCACHE and NR_FILE_DIRTY. NR_FILE_THPS is not moved, although __filemap_add_folio() charges it to the source node and filemap_unaccount_folio() takes it off whatever node the folio lives on when it is removed. Commit 0b52c420350e ("mm: fix shmem THP counters on migration") added the NR_SHMEM_THPS case but not its file-backed counterpart. Now that ext4, xfs, btrfs and erofs can all have PMD-sized page cache folios, migrating them via NUMA balancing, mbind(), migratepages, demotion or memory offlining leaks FileHugePages on the source node and underflows it on the destination, in both /sys/devices/system/node/nodeN/meminfo and memory.numa_stat. The global value is unaffected, which is why this went unnoticed. Reproducer, on a 2-node QEMU guest with THP set to "always": 1. read a 256M ext4 file through a MADV_HUGEPAGE mapping while bound to node 0, so its page cache is 128 PMD-sized folios on node 0; 2. move the mapping to node 1 with mbind(MPOL_MF_MOVE); 3. unmap the file and drop its page cache. nr_file_hugepages in /sys/devices/system/node/nodeN/vmstat after each step (in units of PMD-sized folios): without this patch with this patch node0 node1 node0 node1 1. cached 128 0 128 0 2. migrated 128 0 0 128 3. dropped 128 0 (*) 0 0 (*) the counter has underflowed to -128; negative values read as 0. Without the patch the 128 folios stay accounted to node 0 forever, and every further round adds another 128. The same happens to the per-memcg per-node counter: after step 3, memory.stat of the cgroup shows "file_thp 0", while memory.numa_stat still shows "file_thp N0=268435456 N1=0". With the patch both are 0. Move NR_FILE_THPS together with NR_FILE_PAGES, using the same condition filemap_unaccount_folio() uses to take it off, so that THPs in the swap cache are left alone. Link: https://lore.kernel.org/20261025110209.4105994-1-ridong.chen@linux.dev Fixes: d68eccad3706 ("mm/filemap: Allow large folios to be added to the page cache") Signed-off-by: Ridong Chen Signed-off-by: Andrew Morton Acked-by: David Hildenbrand (Arm) Cc: Zi Yan Cc: Matthew Brost Cc: Joshua Hahn Cc: Byungchul Park Cc: Gregory Price Cc: Ying Huang Cc: Alistair Popple Cc: Matthew Wilcox (Oracle) Cc: "Garg, Shivank" Cc: Signed-off-by: Greg Kroah-Hartman commit e63aec5cf04c45af992016b63bc3392bf04136f6 Author: Andrew Morton Date: Fri Oct 30 12:10:46 2026 -0400 mm/mempolicy: use one node set for interleave weights commit d7e3ce464470d0ff90b4a0ac87df9b3b7d8258da upstream. Switching weighted interleave back to automatic mode while memory is being onlined can cause a kernel divide error on x86, and a panic if panic_on_oops is set. reduce_interleave_weights() scans N_MEMORY three times, but hotplug can cause N_MEMORY to change at runtime - and torn reads on that nodemask can cause a total sum of zero bandwidth. A node that was hot-unplugged and then hotplugged back can then cause this loop to generate a div/0. Record the nodes visited while summing their bandwidth, then use that same set when scaling and reducing the weights. This gives us a consistent state even if N_MEMORY changes. Link: https://lore.kernel.org/20261030161046.1497894-1-gourry@gourry.net Fixes: e341f9c3c841 ("mm/mempolicy: Weighted Interleave Auto-tuning") Signed-off-by: Andrew Morton Signed-off-by: Gregory Price (Meta) Reviewed-by: Joshua Hahn Cc: David Hildenbrand Cc: Zi Yan Cc: Rakie Kim Cc: Ying Huang Cc: Harry Yoo Cc: Signed-off-by: Greg Kroah-Hartman commit 1c069765216eb7894cf7227c8ab55366575d37bf Author: David Hildenbrand (Arm) Date: Fri Oct 30 23:29:13 2026 +0100 mm/memory-failure: fix folio refcount leak and min_order_for_split() locking commit cd5f5bf781b4ead6a6571818d5613ea2ed0145f3 upstream. hwpoison code can end up calling min_order_for_split() without holding the folio lock. There isn't really something that would prevent concurrent truncation. Consequently folio->mapping can get set to NULL after checking for "!folio->mapping", and if the compiler reloads folio->mapping, mapping_min_folio_order() would try to dereference NULL. While very unlikely to happen in practice, let's just enforce that min_order_for_split() is called with the folio lock held. We can significantly cleanup the calling hwpoison code, and just get rid of try_to_split_thp_page() to hold the folio lock for a bit longer. Just work on folios now, which further cleans up the code. We just have to be careful about doing the page_folio() after splitting, which we have to do already either way. Do not change the way we split for now, this needs more thought and should be done separately. Cleaning this up we fix another issue: in soft_offline_in_use_page(), we would currently have leaked a folio reference. In min_order_for_split(), document and assert that we need the folio lock. Drop the questionable VM_BUG_ON_PAGE(!page_count(p), p) check entirely. While updating the comment in soft_offline_in_use_page(), just drop the "NOTE" part that does not add any value to current code. The folio->mapping problem was identified by Sashiko, and Li Youhong reported it by sending a proposal fix. This likely does not really warrant CCing stable, but I expect little conflicts when doing the backport, so let's just CC stable because of the refcount leak. Link: https://lore.kernel.org/20261030-try_to_split_thp_page-v2-1-c957c9b42eab@kernel.org Fixes: 689b8986776c ("mm/memory-failure: improve large block size folio handling") Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Andrew Morton Reported-by: Li Youhong Closes: https://lore.kernel.org/r/20260804035828.2684059-1-dayou5941@163.com Acked-by: Usama Arif Reviewed-by: Lorenzo Stoakes (ARM) Reviewed-by: Zi Yan Reviewed-by: Baolin Wang Acked-by: Miaohe Lin Cc: Liam R. Howlett Cc: Ryan Roberts Cc: Dev Jain Cc: Barry Song Cc: Lance Yang Cc: Naoya Horiguchi Cc: Wei Yang Cc: Nico Pache Cc: Luis Chamberlain Cc: Tal Zussman Cc: Signed-off-by: Greg Kroah-Hartman commit d99ba78ef66cb478e5049ff12a1f8eb124973d96 Author: David Hildenbrand (Arm) Date: Tue Nov 3 19:31:44 2026 +0100 mm/memfd: handle GUP pins more reliably when write-sealing commit d369ba5a46c65c54b94c94713ca1fb4ad6a87ebf upstream. memfd_wait_for_pins() detects GUP references by comparing a folio's actual refcount with its expected refcount. As spelled out by folio_expected_ref_count(), obtaining the expected refcount when there can be concurrent folio (un)mapping is racy. So it is possible that a changing folio mapcount can race with our check for GUP references, and F_SEAL_WRITE might succeed even if there are some, allowing file contents to be modified after sealing. For folios with a reliable pincount, detect FOLL_PIN references using folio_maybe_dma_pinned() before falling back to the refcount comparison. For small folios without that, the 1024 pinning BIAS makes it very hard (although not impossible) to misguide the refcount comparison. This improves FOLL_PIN detection for folios with a pincount. Handling FOLL_GET and small folios requires a more fundamental change. Fortunately, most interfaces that allow for GUP'ing such pages use FOLL_PIN, in particular interfaces using FOLL_LONGTERM. However, we still have some FOLL_GET leftovers ... Fixes: 05f65b5c7090 ("shm: wait for pins to be released when sealing") Cc: stable@vger.kernel.org Cc: Chris Mason Reviewed-by: Lorenzo Stoakes (ARM) Link: https://patch.msgid.link/20261103-fixes_core_2-v1-1-f332954f1df4@kernel.org Reviewed-by: Lance Yang Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit cd9d1c7195796c22ae549ba2e53e7983167f4cd9 Author: David Hildenbrand (Arm) Date: Thu Nov 5 19:16:44 2026 +0100 mm/khugepaged: don't map folios that are not uptodate in MADV_COLLAPSE commit 043a2260b96ffc13121a1dd65282e67eb2e1d8a8 upstream. madvise(MADV_COLLAPSE) can map PMD-sized pagecache folios that are not uptodate. For example, shmem fallocate() can put such folios into the page cache. collapse_file() already refuses to proceed with folios that are not uptodate. Let's just do the same in try_collapse_pte_mapped_thp() and skip such folios, leaving handling to the page faults. Note that collapse_file() effectively clears shmem folios through shmem_get_folio(); let's keep this fix simple and simply let the page fault path deal with that. Fixes: 34488399fa08 ("mm/madvise: add file and shmem support to MADV_COLLAPSE") Reported-by: Chris Mason Cc: stable@vger.kernel.org Reviewed-by: Lorenzo Stoakes (ARM) Acked-by: Hugh Dickins Acked-by: Zi Yan Reviewed-by: Zach O'Keefe Reviewed-by: SJ Park Reviewed-by: Baolin Wang Reviewed-by: Lance Yang Reviewed-by: Kiryl Shutsemau (Meta) Link: https://patch.msgid.link/20261105-set_huge_pmd_uptodate-v1-1-a78d8a1b7117@kernel.org Reviewed-by: Pedro Falcato Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit c403bf19836149ae9d113d400e20cc78e10cf3c1 Author: Kuniyuki Iwashima Date: Wed Oct 28 19:39:19 2026 +0000 mm/kasan: detect double-free involving kfree_rcu_sheaf() commit e212c463eee96b2568d8c85ca4ee63049dbb18f2 upstream. Patch series "mm/kasan: Detect double-free involving kfree_rcu_sheaf().", v3. Recently, syzbot has reported several weird use-after-free splats. What they have in common is that "Freed by" points to rcu_free_sheaf(), whereas the object shown in "Call Trace:" and "Allocated by" is never supposed to be freed via kfree_rcu(). This means the object was a victim of a double-free somewhere else and was silently poisoned by rcu_free_sheaf() after being reallocated. This happens because kfree_rcu_sheaf() queues an object into the RCU sheaf without invoking any KASAN hooks. This series enables KASAN to detect double-free involving kfree_rcu_sheaf() immediately and adds KUnit tests for it. This patch (of 2): syzbot reported a weird use-after-free splat. [0] In the report, an object in the kmalloc-64 cache was freed via rcu_free_sheaf() while it was still in use, even though the object should always be freed with kfree() (in xfrm_hash_free()), implying that the object was a victim of a double-free involving kfree_rcu() somewhere else. When kvfree_call_rcu() frees an object via kfree_rcu_sheaf() and queues it into pcs->rcu_free, debug facilities are skipped, e.g., kasan_slab_pre_free(), kasan_record_aux_stack(), debug_rcu_head_queue(), etc. As a result, KASAN cannot detect the double-free at the call site. If the object is still in the KASAN quarantine when the sheaf is flushed, KASAN can detect the double-free in rcu_free_sheaf(), but with no trace of the suspect. Worse yet, once the object is evicted from the quarantine and reallocated before the sheaf is flushed, rcu_free_sheaf() silently poisons the live object, resulting in a false-positive use-after-free report on the new user. If __kfree_rcu_sheaf() simply calls kasan_slab_pre_free(), we can detect the second kfree_rcu(), but only while the object is poisoned in the KASAN quarantine after the first free: kfree() --(poisoned)--------------------> kfree_rcu() kfree_rcu() -> rcu_free_sheaf() -(poisoned)-> kfree_rcu() An object queued in pcs->rcu_free remains unpoisoned until the sheaf becomes full and rcu_free_sheaf() runs after the RCU grace period, so a subsequent kfree_rcu() or kfree() before rcu_free_sheaf() cannot be detected by shadow bytes alone: kfree_rcu() -(unpoisoned)-> kfree_rcu() -> rcu_free_sheaf() (too late!) kfree_rcu() -(unpoisoned)-> kfree() -> rcu_free_sheaf() (too late!) These cases can be detected if we call debug_rcu_head_queue() before kfree_rcu_sheaf(), but ODEBUG splat only shows the second free. To detect these cases with KASAN, we just need a 1-bit flag to indicate the state, which can reuse an unused bit in struct kasan_track.pid. (PID_MAX_LIMIT is 1<<22) The bit is marked along with recording the stack trace when deferring slab frees in kfree_rcu_sheaf() and checked in check_slab_allocation() so that any double-free pattern above can be detected immediately. Link: https://lore.kernel.org/20261028194014.3671161-1-kuniyu@google.com Link: https://lore.kernel.org/20261028194014.3671161-2-kuniyu@google.com Link: https://lore.kernel.org/all/6ac959ee.70ed5d86.2ac85.007d.GAE@google.com/ #[0] Fixes: ec66e0d59952 ("slab: add sheaf support for batching kfree_rcu() operations") Signed-off-by: Kuniyuki Iwashima Signed-off-by: Andrew Morton Acked-by: Vlastimil Babka (SUSE) Tested-by: Alexander Potapenko Reviewed-by: Alexander Potapenko Reviewed-by: Andrey Ryabinin Cc: Harry Yoo Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Vincenzo Frascino Cc: Hao Li Cc: Christoph Lameter Cc: David Rientjes Cc: Roman Gushchin Cc: Signed-off-by: Greg Kroah-Hartman commit a2af83aa18e0de5e9233ac4a5c2e4a73c5a1711d Author: Kuniyuki Iwashima Date: Wed Oct 28 19:39:20 2026 +0000 mm/kasan/kunit: add double-free tests involving kfree_rcu_sheaf() commit 97a5aa11cc0cfe4dedd436c32793320b490c4331 upstream. The new test cases verify that KASAN immediately detects all three combinations of double-free involving kfree_rcu_sheaf(): 1. kmem_cache_free() -> kfree_rcu() 2. kfree_rcu() -> kmem_cache_free() 3. kfree_rcu() -> kfree_rcu() Each test also evicts the object from the KASAN quarantine and reallocates it as a victim object before flushing the RCU sheaf to ensure the live victim object is not poisoned by the rejected double-free. Without the patch, all tests fail to detect the 2nd free, and the victim is poisoned: # kmem_cache_double_free_rcu_1: EXPECTATION FAILED at mm/kasan/kasan_test_c.c:1096 KASAN failure expected in "kfree_rcu(p, rcu)", but none occurred ... # kmem_cache_double_free_rcu_1: EXPECTATION FAILED at mm/kasan/kasan_test_c.c:1156 Expected (<...snipped READ_ONCE()...>&(victim->i)); }) == 42, but <...snipped READ_ONCE()...>victim->i == 117729280 (0x7046800) # kasan: pass:0 fail:3 skip:0 total:3 # Totals: pass:0 fail:3 skip:0 total:3 not ok 1 kasan In all cases, KASAN logs a false-positive use-after-free splat at READ_ONCE(victim->i), and it has no information about the suspect; the two stack traces ("Call Trace:" and "Allocated by") are of the live victim, and "Freed by" is of the RCU task. BUG: KASAN: slab-use-after-free in __kmem_cache_double_free_rcu+0x9ee/0xaf0 Read of size 4 at addr ffff8881076c2938 by task kunit_try_catch/513 ... Freed by task 0: ... __rcu_free_sheaf_prepare+0xf6/0x240 rcu_free_sheaf_nobarn+0x31/0xe0 rcu_core+0x75e/0x16b0 With the patch, all tests can detect the 2nd free immediately and prevent the victim from being poisoned: # kasan: pass:3 fail:0 skip:0 total:3 # Totals: pass:3 fail:0 skip:0 total:3 ok 1 kasan All the stack traces point to the same object for double-free, and the two free traces are shown in "Call Trace:" and "Freed by" (or "Last potentially related work creation:" in the 2nd/3rd test cases). BUG: KASAN: double-free in kvfree_call_rcu+0xb6/0x3c0 Free of addr ffff888108495938 by task kunit_try_catch/511 ... Call Trace: ... check_slab_allocation+0x10d/0x120 __kfree_rcu_sheaf+0x1c/0x2d0 kvfree_call_rcu+0xb6/0x3c0 __kmem_cache_double_free_rcu+0x310/0xaf0 Allocated by task 511: ... kmem_cache_alloc_noprof+0x14f/0x3c0 __kmem_cache_double_free_rcu+0x152/0xaf0 Freed by task 511: ... kmem_cache_free+0x14f/0x3c0 __kmem_cache_double_free_rcu+0x2c6/0xaf0 Notably, in the 2nd/3rd test cases, we can detect the 2nd free before the object is poisoned: Memory state around the buggy address: ffff888106dc7800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888106dc7880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888106dc7900: fc fc fc fc fc fc fc 00 00 00 fc fc fc fc fc fc ^ ... ok 2 kmem_cache_double_free_rcu_2 Link: https://lore.kernel.org/20261028194014.3671161-3-kuniyu@google.com Fixes: ec66e0d59952 ("slab: add sheaf support for batching kfree_rcu() operations") Signed-off-by: Kuniyuki Iwashima Signed-off-by: Andrew Morton Reviewed-by: Alexander Potapenko Cc: Harry Yoo Cc: Andrey Ryabinin Cc: Vlastimil Babka Cc: Harry Yoo Cc: Andrey Konovalov Cc: Dmitry Vyukov Cc: Vincenzo Frascino Cc: Hao Li Cc: Christoph Lameter Cc: David Rientjes Cc: Roman Gushchin Cc: Signed-off-by: Greg Kroah-Hartman commit 50f7a3f70ee7b2149942b49d8110b92273f9efdd Author: Zi Yan Date: Tue Nov 10 22:19:25 2026 -0500 mm/huge_memory: prevent losing PG_waiters in __split_folio_to_order() commit 7183af7f01c839ecef87840a90c0d8c5843f37d7 upstream. __split_folio_to_order() calls prep_compound_page() on each new head page to create a compound page after clear_compound_head(). prep_compound_page() uses non atomic __SetPageHead(). It is mostly OK, since the folio is locked and frozen and no one else is supposed to modify the folio's flags. However, code calling migration_entry_wait() can reach the folio by PFN, then access its flags. It is because softleaf_entry_wait_on_locked() used by migration_entry_wait() sets PG_waiters concurrently without taking a reference and the frozen refcount during split cannot block it. Meanwhile, __SetPageHead() does a plain read and write, so PG_waiters atomically set by softleaf_entry_wait_on_locked() will be lost if the set happens after __SetPageHead()'s read and before its write. One example code interleaving: CPU0: __split_folio_to_order(new_order>0) CPU1: do_swap_page() 1. clear_compound_head(new_head) new_head->compound_info = 0 (page_folio(new_head) == new_head now) 2. migration_entry_wait() softleaf_to_folio(entry) page_folio() -> new_head (not the old head any more) 3. prep_compound_page(new_head, new_order) __SetPageHead(new_head) tmp = new_head->flags.f <-- load; PG_waiters == 0 in tmp 4. folio_set_waiters(new_head) set_bit(PG_waiters, &flags.f) enqueue on waitqueue, sleep 5. new_head->flags.f = tmp | (1UL << PG_head) <-- store; overwrites step 4, PG_waiters == 0 again Later, folio_unlock(new_folio) sees no PG_waiters, skips folio_wake_bit(), and CPU1 can remain blocked indefinitely. Fix it by setting PG_head along with other flags in new_folio->flags before smp_wmb() and clear_compound_head(). The remaining compound page metadata is set after clear_compound_head(). In that way, after clear_compound_head() makes new_folio visible, nothing overwrites the PG_waiters from softleaf_entry_wait_on_locked() by modifying new_folio->flags non-atomically. While at it, use data_race() to suppress the KCSAN issue reported by Ye Liu's patch (the second Closes) on reading folio->flags in __split_folio_to_order(). Suggested-by: Kiryl Shutsemau Reported-by: David Hildenbrand Closes: https://lore.kernel.org/all/DMHE8BEEER1H.2BIY52NXATPIA@nvidia.com/ Reported-by: Ye Liu Closes: https://lore.kernel.org/all/20261029-data_race_huge_mem-v1-1-112e331291c1@linux.dev/ Fixes: c010d47f107f6 ("mm: thp: split huge page to any lower order pages") Cc: stable@vger.kernel.org Signed-off-by: Zi Yan Reviewed-by: David Hildenbrand (Arm) Reviewed-by: Kiryl Shutsemau (Meta) Reviewed-by: Baolin Wang Reviewed-by: Ye Liu Link: https://patch.msgid.link/20261110-fix-split_folio_to_order-race-v4-1-cc5042f33408@nvidia.com Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit 1daab7958a994dcc007012205a864c2c655ac926 Author: Jose Fernandez (Anthropic) Date: Sat Oct 31 04:33:59 2026 +0000 mm/filemap: stop fault-around when the walk steps back commit cf5518aa1832d82b391ac2492863ae6a7315827c upstream. filemap_map_pages() can dereference a PTE pointer outside the page table it locked. KASAN has reported this as a use-after-free read [1]. The same path can also write out of bounds. When the stray entry reads as none, the fault-around loop maps a page there with set_pte_range(). Its fault-around loop walks the page cache and moves vmf->pte by the change in index. A lower index moves it back. xas_find() can step back to a lower index when a multi-index entry is split during the walk. [1] fixes xas_find(), but the loop still relies on the walk never stepping back. Stop the fault-around when the walk steps back. ->fault() maps the faulting page if the loop did not. Link: https://lore.kernel.org/20261031-jf-mm-filemap-map-pages-lower-bound-v2-1-21029744e589@linux.dev Link: https://lore.kernel.org/20260904121301.200049-1-krystianmkaniewski@gmail.com [1] Fixes: 6b24ca4a1a8d ("mm: Use multi-index entries in the page cache") Signed-off-by: Jose Fernandez (Anthropic) Signed-off-by: Andrew Morton Reviewed-by: Jan Kara Cc: Matthew Wilcox (Oracle) Cc: David Hildenbrand Cc: Krystian Kaniewski Cc: Pedro Falcato Cc: Signed-off-by: Greg Kroah-Hartman commit e74b868d53c2368dd5d081b4b85f30143527ad7b Author: Wang Xiaolei Date: Mon Nov 2 06:46:25 2026 -0800 mm/damon/tests/sysfs-kunit: fix leaked pid reference in add_targets test commit 9d2cc214935ad78b8f54bf886f0b4e3f387fa44f upstream. damon_sysfs_test_add_targets() creates its monitoring context with damon_new_ctx(), which leaves ctx->ops zero-initialized. Since DAMON_OPS_VADDR is zero, damon_target_has_pid() returns true for the context, and damon_sysfs_add_targets() therefore calls damon_set_target_pid() for each target it adds. That function grabs a reference to the target's struct pid via find_get_pid(). The test then tears the context down with damon_destroy_ctx(), which releases such a reference from ctx->ops.cleanup_target(). For the vaddr operations set that callback is damon_va_cleanup_target(), and it is the only place where the reference is put. The test never selects an operations set, though, so cleanup_target is NULL and both references -- one for each of the two damon_sysfs_add_targets() calls -- are leaked on every run of the test. Running the test with CONFIG_DEBUG_KMEMLEAK enabled reports the leaked struct pid objects as unreferenced. Fix this by selecting the vaddr operations set for the context before adding the targets, mirroring what the sysfs interface does. damon_select_ops() fails if the vaddr operations set is not registered, in which case the test cannot exercise the pid handling and skips itself. Link: https://lore.kernel.org/20261102144627.88843-3-sj@kernel.org Fixes: b8ee5575f763 ("mm/damon/sysfs-test: add a unit test for damon_sysfs_set_targets()") Signed-off-by: Wang Xiaolei Signed-off-by: SJ Park Signed-off-by: Andrew Morton Reviewed-by: SJ Park Cc: Michal Hocko Cc: Mike Rapoport Cc: Suren Baghdasaryan Cc: Vlastimil Babka Cc: "Liam R. Howlett" Cc: Brendan Higgins Cc: David Gow Cc: Aveline Noir Cc: # 6.7.x Signed-off-by: Greg Kroah-Hartman commit d4e7a84fa44350445f2f87eb770907011887ecac Author: Aveline Noir Date: Mon Nov 2 06:46:24 2026 -0800 mm/damon/core: reset watermark wait state on each iteration commit 5fe092741502770107a0be7b3885ce55f7761f01 upstream. Patch series "mm/damon: fix watermark state, kunit pid leak and selftest fake pass". Three hotfixes for core, kunit and selftest. Fix kdamond deactivation from missed watermark reset with patch 1. Fix pid leak in kunit test with patch 2. Fix a selftest wrongly passing when it should skip, with patch 3. Note for reviewers. This series is a collection of fixes that were initially developed by different people. Changelog is in each patch. This patch (of 3): Found while reviewing the DAMON source code that if an online commit removes all schemes while kdamond is waiting for watermark activation, the scheme loop becomes empty but min_wait_time keeps the previous positive value. kdamond then keeps sleeping instead of resuming monitoring without schemes. The way to wake up the kdamond again without DAMON is bit complicated. Install a scheme having watermarks that can activate the kdamond again, and remove the scheme again. Doable but cumbersome and complicated. Initialize min_wait_time and init_wait_time on each loop iteration so the wait is calculated from the current schemes and an empty scheme list resumes monitoring. Link: https://lore.kernel.org/20261102144627.88843-1-sj@kernel.org Link: https://lore.kernel.org/20261102144627.88843-2-sj@kernel.org Fixes: da87878010e5 ("mm/damon/sysfs: support online inputs update") Signed-off-by: Aveline Noir Signed-off-by: SJ Park Signed-off-by: Andrew Morton Reviewed-by: SJ Park Cc: Wang Xiaolei Cc: # 5.19.x Signed-off-by: Greg Kroah-Hartman commit 5c7aa51492a8ff59af19d3b2c95c638eeeeb1b7c Author: Mani Tofigh Date: Mon Oct 26 11:19:22 2026 -0400 mm, swap: stop cluster list scans once swapoff clears SWP_WRITEOK commit 53a6f71c147a445a6c305513acaa25f2e01a44e9 upstream. SWP_WRITEOK is cleared under si->lock when swapoff starts so that no new swap entries are allocated from the device, and try_to_unuse() then waits for writeback of the folios that still use the device. However, an order-0 allocation that chose the device can race with swapoff clearing the flag and then loop forever. It takes a cluster from the fragment cluster list of a higher order with isolate_lock_cluster(), the allocation from that cluster fails because SWP_WRITEOK is clear, and relocate_cluster() puts the cluster back on the same list, so the loop keeps finding clusters on it. The looping task is in reclaim, and it may have set writeback on a folio whose write has been queued but not yet submitted. swapoff then waits for that folio, while the reclaiming task, stuck in the loop, never reaches the point where it submits the write: CPU0 (reclaim) CPU1 (swapoff) -------------- -------------- shrink_folio_list() pageout(F) /* F under writeback, write not submitted */ folio_alloc_swap(G) /* order 0 */ swap_alloc_slow() del_from_avail_list(si, true) si->flags &= ~SWP_WRITEOK try_to_unuse() folio_wait_writeback(F) cluster_alloc_swap_entry() isolate_lock_cluster() /* allocation fails: !SWP_WRITEOK */ relocate_cluster() /* repeats forever */ swap_write_submit() /* never reached */ This results in a soft lockup on CPU0 and a swapoff that never returns. isolate_lock_cluster() used to check SWP_WRITEOK under si->lock until commit 07adc4cf1ecd ("mm, swap: implement dynamic allocation of swap table") removed that check. Restore the check. Since swapoff clears the flag under the same lock, isolate_lock_cluster() then returns NULL, which ends the scan; the swap slot allocation for G fails, and reclaim goes on to submit the write of F. Given that this is a race, its reproducibility is non-deterministic. We reproduce it by using a non-rotational swap device that is not synchronous, with 64K mTHP enabled, where one CPU repeatedly pages out two 64K folios and a 4K page with madvise(MADV_PAGEOUT), while other CPUs run swapoff and swapon on the same device. In my tests it triggers within 20s in each run, and with the fix applied, it runs for 300s without any hang/kernel report. This bug was found and reproduced deterministically using a deterministic hypervisor that is currently under development. Link: https://lore.kernel.org/20261026-swapoff-writeok-v1-1-4f4cd420aa33@columbia.edu Fixes: 07adc4cf1ecd ("mm, swap: implement dynamic allocation of swap table") Signed-off-by: Mani Tofigh Signed-off-by: Andrew Morton Acked-by: Kairui Song Cc: Chris Li Cc: Kemeng Shi Cc: Nhat Pham Cc: Baoquan He Cc: Barry Song Cc: Youngjun Park Cc: Tal Zussman Cc: Kairui Song Cc: Signed-off-by: Greg Kroah-Hartman commit 21b36da4a06288a8939a8cd45a5941e6b289b744 Author: Gautam Menghani Date: Mon Oct 12 13:59:18 2026 +0530 KVM: PPC: Book3S HV: XICS: Update irq_type for cleanup to work commit b9d9a8741752c5b42c65b1c8dffba867889b74e5 upstream. In kvmppc_xive_connect_vcpu(), if any failures are encountered, the control flow jumps to the 'bail' label where kvmppc_xive_cleanup_vcpu() is called. This cleanup function exits prematurely since vcpu->arch.irq_type is set to KVMPPC_IRQ_DEFAULT at this point. This ends up resulting in wasted memory. Fix this by setting irq_type to KVMPPC_IRQ_XICS before vcpu configuration starts. This makes XICS initialization symmetrical to XIVE initialization done in kvmppc_xive_native_connect_vcpu(). Fixes: 5af50993850a ("KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller") Cc: stable@vger.kernel.org # 4.12+ Signed-off-by: Gautam Menghani Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261012082922.218799-3-gautam@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit dfa561b869230e82a6fe2dc3a76e54ec6e19a0f3 Author: Gautam Menghani Date: Mon Oct 12 13:59:19 2026 +0530 KVM: PPC: Book3S HV: XICS: Avoid NULL ptr deref in kvmppc_xive_cleanup_vcpu() commit 7279692d70f3e399b3dd2d07ffa365e9f533761f upstream. In kvmppc_xive_connect_vcpu() if there is a failure before xc->vp_ipi_data is setup, it can result in a NULL pointer dereference in kvmppc_xive_cleanup_vcpu() when accessing the MMIO page in xive_vm_esb_load(). Fix this by adding a check before masking the VP IPI before accessing the MMIO pages. Fixes: 5af50993850a ("KVM: PPC: Book3S HV: Native usage of the XIVE interrupt controller") Cc: stable@vger.kernel.org # 4.12+ Signed-off-by: Gautam Menghani Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261012082922.218799-4-gautam@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 0604ef30f356502d351d32b3d033547bc5621ad5 Author: Gautam Menghani Date: Mon Oct 12 13:59:20 2026 +0530 KVM: PPC: Book3S HV: Take SRCU read lock around kvmppc_h_page_init() call commit b04be22bf6ea06b92bff7850328a8057b8d964ae upstream. Since there is no srcu read lock around kvmppc_h_page_init(), a "suspicious rcu_dereference_check() usage" can be triggered by running host linux with CONFIG_PROVE_RCU=y and the following code in the guest: plpar_hcall_norets(H_PAGE_INIT, H_ZERO_PAGE, phys_addr, 0); ============================= WARNING: suspicious RCU usage 7.0.0-dirty #227 Not tainted ----------------------------- ./include/linux/kvm_host.h:1074 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 2, debug_locks = 1 1 lock held by qemu-system-ppc/2093: #0: c000000354197ab0 (&vcpu->mutex){+.+.}-{3:3}, at: kvm_vcpu_ioctl+0x10c/0xaf0 stack backtrace: CPU: 30 UID: 0 PID: 2093 Comm: qemu-system-ppc Not tainted 7.0.0-dirty #227 PREEMPT(full) Hardware name: IBM,9080-HEX POWER10 (architected) 0x800200 0xf000006 of:IBM,FW1060.60 (NH1060_158) hv:phyp pSeries Call Trace: [c00000033e1bf430] [c000000001b3dbd4] dump_stack_lvl+0xc8/0x130 (unreliable) [c00000033e1bf470] [c0000000003da964] lockdep_rcu_suspicious+0x1f4/0x290 [c00000033e1bf520] [c000000000231424] gfn_to_memslot+0x1b4/0x1c0 [c00000033e1bf560] [c00000000023637c] kvm_clear_guest+0x9c/0x110 [c00000033e1bf5c0] [c0000000002714a4] kvmppc_h_page_init+0x160/0x1a0 [c00000033e1bf610] [c00000000026c040] kvmppc_pseries_do_hcall+0x1930/0x1940 [c00000033e1bf6d0] [c00000000026fb18] kvmppc_vcpu_run_hv+0x268/0x800 [c00000033e1bf7a0] [c000000000246b30] kvmppc_vcpu_run+0x30/0x50 [c00000033e1bf7c0] [c000000000241ed4] kvm_arch_vcpu_ioctl_run+0x364/0x530 [c00000033e1bf860] [c00000000022b870] kvm_vcpu_ioctl+0x1b0/0xaf0 [c00000033e1bfa50] [c0000000009b4514] sys_ioctl+0x144/0x190 [c00000033e1bfab0] [c000000000034330] system_call_exception+0x170/0x370 [c00000033e1bfe50] [c00000000000d05c] system_call_vectored_common+0x15c/0x2ec Fix this by taking a srcu read lock around kvmppc_h_page_init(). Fixes: 2d34d1c3bbfd ("KVM: PPC: Book3S HV: Implement virtual mode H_PAGE_INIT handler") Cc: stable@vger.kernel.org # 5.2+ Signed-off-by: Gautam Menghani Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261012082922.218799-5-gautam@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit e10943e18823d286e09f3fa7857c87fef60627bd Author: Gautam Menghani Date: Mon Oct 12 13:59:17 2026 +0530 KVM: PPC: Book3S HV: Ensure that calls to idr_alloc are synchronized commit d8c6ab0aeeca7cc2adfcf0ce1f796c6a86314ec0 upstream. Calls to idr_alloc() in __prealloc_nested() are not currently synchronized. According to the documentation [1], the caller should provide their own locking to prevent concurrent modifications to the idr to prevent bugs. __prealloc_nested() calls idr_alloc() with GFP_KERNEL which can sleep and mmu_lock is a spinlock. So idr_alloc() cannot be moved under mmu_lock. In such cases the idr Documentation says: If you need to take a lock while allocating a new ID from the IDR, you may need to pass a restrictive set of GFP flags, which can lead to the IDR being unable to allocate memory. To work around this, you can call idr_preload() before taking the lock, and then idr_preload_end() after the allocation. Hence preload the idr memory with idr_preload() before taking mmu_lock, which allows us to use idr_alloc(..., GFP_NOWAIT) under the spinlock. This also allows to kill __prealloc_nested() and __add_nested(), as they are not needed anymore with idr_preload(). [1]: lib/idr.c Fixes: c0f00a18e2a8 ("KVM: PPC: Book3S HV Nested: Change nested guest lookup to use idr") Cc: stable@vger.kernel.org # 5.19+ Co-developed-by: Ritesh Harjani (IBM) Signed-off-by: Ritesh Harjani (IBM) Signed-off-by: Gautam Menghani Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261012082922.218799-2-gautam@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 3d988e0161c769e328f54077bc8d3a48c3c8fb5c Author: Amit Machhiwal Date: Thu Oct 15 00:22:15 2026 +0530 KVM: PPC: Book3S HV: Disable preemption around host-side HPT lock users commit 4e6e66ecf62185828f731914000a6b0baff355db upstream. A previous change ("KVM: PPC: Book3S HV: Add preempt_disable() around virtual-mode HPTE bit-lock users") at [1] added preempt_disable() around guest vCPU HPT hcalls and page fault handlers executed in virtual mode. This ensures vCPU threads cannot be preempted while holding HPTE_V_HVLOCK or the reverse-map lock. However, several host-side virtual-mode paths in book3s_64_mmu_hv.c also acquire HPTE_V_HVLOCK and lock_rmap() in process context with preemption enabled. Specifically, kvm_unmap_rmapp() and kvm_age_rmapp() take both locks during MMU notifier callbacks and memslot flushes, while resize_hpt_rehash_hpte() acquires HPTE_V_HVLOCK during HPT resizing. If a host thread is preempted while holding either bit-lock, any guest vCPU thread scheduled on the same CPU spinning for the same lock with preemption disabled will never yield, resulting in a permanent CPU hang. Fix this by disabling preemption across these host-side critical sections. For kvm_unmap_rmapp() and kvm_age_rmapp(), place preempt_disable() before lock_rmap() so that both the rmap chain lock and the subsequent HPTE_V_HVLOCK bit-lock are held under a single non-preemptible window. To preserve the ABBA lock ordering between the two locks, re-enable preemption after dropping the rmap lock on any retry or early-exit path before spinning on cpu_relax(), allowing the lock holder to be scheduled. For kvm_htab_write(), the HPT migration restore path, replace the direct calls to kvmppc_do_h_remove() with kvmppc_virtmode_do_h_remove(), a thin wrapper that brackets kvmppc_do_h_remove() with preempt_disable() and preempt_enable(), mirroring the existing kvmppc_virtmode_do_h_enter() helper. For resize_hpt_rehash_hpte(), place preempt_disable() before the try_lock_hpte() spin loop and preempt_enable() after unlock_hpte() at the function exit. [1] https://git.kernel.org/powerpc/c/abbbe5ff83e7c9ed3a4d61b73011f1df7bf87907 Fixes: 6165d5dd99db ("KVM: PPC: Book3S HV: add virtual mode handlers for HPT hcalls and page faults") Cc: stable@vger.kernel.org # v5.14+ Signed-off-by: Amit Machhiwal Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261014185215.71832-1-amachhiw@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 8f327d22a65cd5d70a09f5823c8208b21a3c32a8 Author: Gautam Menghani Date: Mon Nov 2 14:46:59 2026 +0530 KVM: PPC: Book3S HV: Avoid spurious interrupts caused by LPCR_MER bit commit 9751c361cb234f000261879b1b5015bf08f6a428 upstream. A huge number of spurious interrupts can be seen immediately after a KVM on PowerNV guest boots up in XIVE mode. $ cat /proc/interrupts | grep SPU SPU: 223705 192439 273526 147623 Spurious interrupts This bug was introduced by commit ecd10702baae5 ("KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE"). The root cause is that once LPCR_MER bit is set, it is supposed to be reset by software. But when a vCPU starts running with LPCR_MER set, the vCPU does not exit back to the host until the decrementer expires or there is an hcall, etc. This is because KVM on PowerNV guests have support for native XIVE, so they are not dependent on host for interrupt emulation. Due to this behaviour, a huge number of spurious interrupts are seen since LPCR_MER continues to be set and LPCR_MER cannot be reset until the vCPU exits to the host. Fix this behaviour by not using the LPCR_MER bit whenever native XIVE is available (currently in case of KVM on PowerNV only), as the XIVE hardware can present interrupts to the KVM guest vCPU directly. So the LPCR_MER functionality is not required. This reduces the number of spurious interrupts drastically. Fixes: ecd10702baae5 ("KVM: PPC: Book3S HV: Handle pending exceptions on guest entry with MSR_EE") Cc: stable@vger.kernel.org # 6.8+ Reported-by: Timothy Pearson Closes: https://lore.kernel.org/linuxppc-dev/582904882.11159.1786719390349.JavaMail.zimbra@raptorengineeringinc.com Signed-off-by: Gautam Menghani Reviewed-by: Ritesh Harjani (IBM) Signed-off-by: Madhavan Srinivasan Link: https://patch.msgid.link/20261102091700.253381-1-gautam@linux.ibm.com Signed-off-by: Greg Kroah-Hartman commit 23113263dce2fc08724ba19666c1fad0dfdbd291 Author: Darong Lu Date: Mon Nov 9 10:06:47 2026 +0800 ipvs: wait grace period before reusing destinations commit 5367e14e92bbb0779612d36cce7c6e95d3bc5e68 upstream. An IPVS destination can be removed from a service and immediately reused from dest_trash before an RCU grace period has elapsed. Reusing its n_list or d_list can make existing readers follow links into another service or real-server hash chain. The grace-period cookie is also saved when a live destination is unhashed for an edit and consumed when it is rehashed. Describe rcu_state as the cookie for an unlink, covering both trash and rehash cases. When a destination is retrieved from dest_trash, ip_vs_add_dest() currently restarts its estimator before waiting for the grace period. If the estimator was on a tick chain, ip_vs_stop_estimator() removed est->list with hlist_del_rcu(), so an estimator kthread can still be traversing that node. ip_vs_start_estimator() rewrites the node on its temporary list on success, or initializes it on failure, before the current wait. A reader can then follow the changed link or stop traversing the chain early. Wait immediately after retrieving the destination, before starting its estimator. The conditional grace-period wait then covers the destination list, real-server hash and estimator list on both estimator success and failure paths. Fixes: bcbde4c0a755 ("ipvs: make the service replacement more robust") Cc: stable@vger.kernel.org Reported-by: Vega Reported-by: Darong Lu Co-developed-by: Jiayuan Chen Signed-off-by: Jiayuan Chen Signed-off-by: Darong Lu Signed-off-by: Ren Wei Signed-off-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman commit 2a9112bcae65ef1238a377f8af03e153643161d8 Author: Axel Mierczuk Date: Tue Nov 3 11:57:45 2026 -0500 ipvs: validate cport in received sync records commit 1d1e8bc81f790a48cd643b1b1762de43334d4f14 upstream. Local templates have cport 0 and IP_VS_CONN_F_NO_CPORT clear, so ip_vs_conn_in_get() cannot match them. A template received over the unauthenticated sync protocol with a nonzero cport can reach the protocol state machine. Before template state validation, this could cause out-of-bounds reads, crashes and kernel data leaks. Ordinary records with cport 0 and IP_VS_CONN_F_NO_CPORT clear, or with a nonzero cport and IP_VS_CONN_F_NO_CPORT set, create connections that incoming lookups cannot match. The latter also keeps the cport-zero fallback in ip_vs_conn_in_get() enabled. Reject all three cases. Continue accepting ordinary connections with cport 0 and IP_VS_CONN_F_NO_CPORT. The companion commit f96e91748f63 ("ipvs: filter some flags received in the backup server") rejects template records carrying IP_VS_CONN_F_NO_CPORT. Fixes: 87375ab47cd0 ("[IPVS]: ip_vs_ftp breaks connections using persistence") Cc: stable@vger.kernel.org Suggested-by: Julian Anastasov Signed-off-by: Axel Mierczuk Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman commit 1576ce977aec384a19815402e1985f22d62d9aac Author: Axel Mierczuk Date: Tue Nov 3 11:57:46 2026 -0500 ipvs: skip cport 0 connections in ip_vs_conn_out_get() commit 5c8d6e2596e0935e2ace0b94e86ffb99e8434cd9 upstream. ip_vs_conn_out_get() does not filter templates. A template with cport 0 is matched by a packet sent to client port 0 that traverses the out hook, and handle_response() then runs ip_vs_set_state() and the timeout update on a connection that must never see packets. A backup server receives such templates over the unauthenticated sync protocol. An ordinary connection scheduled for a client that uses source port 0 has cport 0 as well and is matched the same way. Apply the rule used by __ip_vs_conn_in_get(): a lookup for client port 0 matches only connections flagged IP_VS_CONN_F_NO_CPORT, which still wait for their cport, and a lookup for a nonzero client port matches only connections without this flag. Test p->vport, which was already compared with cp->cport, instead of reading cp->cport again. ip_vs_ftp_out() relies on the first case: it looks up the data connection with client port 0 to find the IP_VS_CONN_F_NO_CPORT entry created for an earlier PASV or EPSV reply. That lookup keeps working. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Suggested-by: Julian Anastasov Signed-off-by: Axel Mierczuk Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman commit be95d81f0d73e65a66ac4e866128714322893a94 Author: Zihan Xi Date: Mon Oct 5 13:06:19 2026 +0000 ipvs: reject FTP control ports as data ports commit a107e150e105836bb5349cdee14541d4995009ea upstream. The FTP helper must not treat a configured control port as a data port. Accepting such a port can leave IPVS connections in a state that leads to recursive expiration and kernel stack exhaustion. Reject zero and configured control ports before creating passive data connections. For active mode, reject a zero client port and a derived data port that is itself a configured control port. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Reported-by: Vega Co-developed-by: Luxing Yin Signed-off-by: Luxing Yin Signed-off-by: Zihan Xi Signed-off-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman commit 6151ea8582873cf540e9b52802056ab15a432e40 Author: Theodor Arsenij Larionov Trichkine Date: Thu Oct 15 23:09:02 2026 +0300 ipvs: ftp: skip conntrack templates in ip_vs_ftp_out commit 4656934d460da68382cf91766a1ff2d0610554ae upstream. A CT target hooked after conntrack attaches its template to a packet that conntrack left without an entry. On an IPVS FTP PASV/EPSV reply, ip_vs_ftp_out() then mangles with the template and creates an expectation with the template as master. Deleting the CT rule frees the template and leaves the expectation, so a later expectation flush reads freed memory: BUG: KASAN: slab-use-after-free in nf_ct_unlink_expect_report Reachable with CAP_NET_ADMIN in a user namespace. Skip templates, as nft_ct and nfnetlink_queue do. Fixes: f4bc17cdd205 ("ipvs: netfilter connection tracking changes") Cc: stable@vger.kernel.org Signed-off-by: Theodor Arsenij Larionov Trichkine Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Greg Kroah-Hartman commit 71b38ef839873d57dd24098247b185061671b6f7 Author: Eric Dumazet Date: Fri Nov 13 13:46:22 2026 +0100 ipv6: mcast: use skb_set_transport_header_careful() in ipv6_mc_check_exthdrs() commit 425b1fe50b71628299d33faff28057e7fa4c60c7 upstream. skb->transport_header is a 16-bit offset from skb->head, and U16_MAX is reserved as the "not set" value. skb_set_transport_header() silently truncates an offset that does not fit. ipv6_mc_check_exthdrs() stores the offset returned by ipv6_skip_exthdr(), which depends on the extension headers found in the packet. Should the value be truncated, ipv6_mc_check_icmpv6() and ipv6_mc_check_mld_msg() would then validate and parse the MLD message at the wrong place. Since commit 3744b0964d52 ("ipv6: Implement limits on extension header parsing") a single chain is bounded to IP6_MAX_EXT_HDRS_CNT headers (24576 bytes), so this needs a large skb->data - skb->head on top of it, for instance after several nested decapsulations, each of them possibly pulling its own extension header chain. No reproducer was written, this is hardening. Use skb_set_transport_header_careful() and treat such a packet as broken (-EINVAL). Fixes: 9afd85c9e455 ("net: Export IGMP/MLD message validation code") Cc: stable@vger.kernel.org Signed-off-by: Eric Dumazet Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261113124625.4010206-3-edumazet@kernel.org Reviewed-by: Justin Iurman Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit d69944e2b34d34e623b0d1b8d33815788c7bdc1e Author: Eric Dumazet Date: Fri Nov 13 13:46:21 2026 +0100 ipv6: gro: limit the number of extension headers commit 050f2adb60434a2b4dee2cf3350269379a32cf72 upstream. Hyunwoo Kim reported that a long chain of IPv6 extension headers can push the transport header offset of a GRO packet beyond what the 16-bit skb->transport_header can store. The truncated offset is later used by gro_receive_network_flush() to locate the network header of a packet held in the GRO list, leading to an out-of-bounds read. Since commit 3744b0964d52 ("ipv6: Implement limits on extension header parsing"), ip6_protocol_deliver_rcu() drops packets carrying more than IP6_MAX_EXT_HDRS_CNT extension headers, but ipv6_gro_pull_exthdrs() was left unbounded. There is no point trying to aggregate packets that the stack is going to drop anyway if they are locally delivered. Apply the same limit in ipv6_gro_pull_exthdrs(). When the limit is hit, @proto still designates an extension header. Extension header offloads have no gro_receive() callback, so ipv6_gro_receive() takes its existing "goto out" path with flush set, and the packet is given to the normal receive path. Local delivery drops it with SKB_DROP_REASON_IPV6_TOO_MANY_EXTHDRS, while forwarded packets are simply not aggregated. An extension header being at most 2048 bytes, this bounds a chain to 24576 bytes. Note that offsets can still accumulate over nested encapsulations, so the places storing them should be hardened separately. Fixes: 4b0ebbca3e16 ("net: gro: move L3 flush checks to tcp_gro_receive and udp_gro_receive_segment") Cc: stable@vger.kernel.org Reported-by: Hyunwoo Kim Link: https://lore.kernel.org/netdev/avTTQNyvwPP6LtGx@v4bel/ Signed-off-by: Eric Dumazet Cc: Daniel Borkmann Cc: David Ahern Cc: Ido Schimmel Tested-by: Hyunwoo Kim Reviewed-by: Ido Schimmel Reviewed-by: Aaron Conole Link: https://patch.msgid.link/20261113124625.4010206-2-edumazet@kernel.org Reviewed-by: Justin Iurman Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit 5c44e08a99ec75c3c8639a1f098b3fbde79eec77 Author: Jaeyeong Lee Date: Thu Nov 12 04:32:17 2026 +0000 net/tls: serialize context removal in tls_device_down() commit 81c8333141b9aa465d98bb4c035284556e699701 upstream. tls_device_down() moves each context to tls_device_down_list while holding tls_device_lock. It then drops its reference and removes the context after releasing the lock. tls_device_queue_ctx_destruction() removes contexts from the same list under tls_device_lock. If it removes an adjacent context while tls_device_down() is deleting its node, the two list updates can interleave. One update can then target a context freed by the other path, causing a use-after-free write. Drop the reference and remove the context in the existing tls_device_lock critical section. Keep tls_device_free_ctx() after releasing the lock. This issue was found with a static analysis tool. Fixes: f6336724a4d4 ("net/tls: Remove the context from the list in tls_device_down") Cc: stable@vger.kernel.org Signed-off-by: Jaeyeong Lee Link: https://patch.msgid.link/20261112043209.102404-1-lee@jaeyeong.cc Signed-off-by: Paolo Abeni Signed-off-by: Greg Kroah-Hartman commit d23a2fd0a265249795776d09f2f610ac2c1baa06 Author: Nathan Chancellor Date: Sat Nov 14 21:30:07 2026 -0700 mptcp: Avoid unsequenced accesses to jiffies in mptcp_reset_tout_timer() commit 728a2abd15a767f662a44030931ea7b2959b4e88 upstream. After a recent improvement in clang to warn on unsequenced accesses to volatile variables [1], an instance appears in mptcp_reset_tout_timer(), which can break the build with CONFIG_WERROR=y / W=e: net/mptcp/protocol.c:3044:20: error: unsequenced accesses to volatile qualified 'jiffies' [-Werror,-Wunsequenced] 3044 | tcp_jiffies32 + jiffies + mptcp_close_timeout(sk); | ~~~~~~~~~~~~~ ^ Per C11 5.1.2.3.2, accessing a volatile object is a side effect. Per C11 6.5.2, unsequenced side effects on the same scalar object are undefined behavior. Per C11 6.5.3, unless otherwise specified, side effects and value computations of subexpressions are unsequenced within expressions. Add an explicit sequence point by splitting the addition expression in half, eliminating the undefined behavior and clearing up the warning. Cc: stable@vger.kernel.org Fixes: 76a13b315709 ("mptcp: invoke MP_FAIL response when needed") Closes: https://github.com/ClangBuiltLinux/linux/issues/2193 Link: https://github.com/llvm/llvm-project/commit/955715460eaf9188c241c74750637fc82dfcc423 [1] Signed-off-by: Nathan Chancellor Reviewed-by: Matthieu Baerts (NGI0) Link: https://patch.msgid.link/20261114-mptcp-wunsequenced-v1-1-707a73a6c172@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit dc0c2343e53d3d17f5761dccfcbe030a51bf2a87 Author: Liam R. Howlett (Google) Date: Mon Nov 2 21:07:24 2026 -0500 maple_tree: update internal warning and bug_on code commit f51d35b81fb572c551e82ff72575d6dbb8e35ba9 upstream. When CONFIG_DEBUG_MAPLE_TREE is set, call WARN_ON() once per site after the custom information is dumped about the tree. Without using the kernel's WARN_ON calls, syzbot will not catch issues detected by this code. The BUG_ON variants now stop instead of dumping and continuing. Update the non-debug code to call WARN_ON_ONCE() as well. The userspace tests asserted on dump_stack() but only print on WARN_ON(), so make WARN() fatal in maple-shared.h and have the maple test exit with the result of maple_tree_seed(). Link: https://lore.kernel.org/20261103020724.2614498-4-liam@infradead.org Fixes: f0a1f866aba1 ("maple_tree: add debug BUG_ON and WARN_ON variants") Signed-off-by: Liam R. Howlett (Google) Signed-off-by: Andrew Morton Reported-by: Lorenzo Stoakes Reviewed-by: Lorenzo Stoakes (ARM) Cc: Chris Mason Cc: Alice Ryhl Cc: Andrew Ballance Cc: Signed-off-by: Greg Kroah-Hartman commit 40e12f0c34b5b109e79be700a016f662b252cb7f Author: Liam R. Howlett (Google) Date: Mon Nov 2 21:07:22 2026 -0500 maple_tree: fix rcu reader NULL dereference after the tree is emptied commit e8a71f284ba7eeddd9475bb0b65200e95428b497 upstream. Patch series "maple_tree fixes for 7.3", v2. Two bugs found by an LLM review, and one problem Lorenzo Stoakes reported off list. An RCU reader that restarts after its node dies can dereference NULL if the tree was emptied, or holds a single entry in the root pointer. Patch 1 fixes it and patch 2 adds a test. With CONFIG_DEBUG_MAPLE_TREE, MT_WARN_ON() and the other WARN macros print the tree and call dump_stack() rather than WARN(), so syzbot never sees them. Patch 3 makes them WARN once per call site, after the dump, and makes the BUG macros BUG() after theirs. The userspace tests make WARN() fatal to keep failing as they did on dump_stack(). This patch (of 3): RCU readers may hit a NULL dereference if the tree is emptied while the walker is restarted from a dead node. Avoid the NULL dereference by checking for an emptied/pointer tree (0->ptr, 1-ULONG_MAX -> NULL) and set the maple state limits correctly. A reader of /proc//maps racing with an munmap() of the whole address space can hit this. The first implementation has the same problem in both directions. Initial fix was generated by LLM and sent by Chris Mason in private. [akpm@linux-foundation.org: fix reverse iterator state when the root disappears] Link: https://lore.kernel.org/20261104104137.2058705ac29734a7ab5666c1@linux-foundation.org Link: https://lore.kernel.org/20261103020724.2614498-1-liam@infradead.org Link: https://lore.kernel.org/20261103020724.2614498-2-liam@infradead.org Fixes: 54a611b60590 ("Maple Tree: add new data structure") Signed-off-by: Liam R. Howlett (Google) Signed-off-by: Andrew Morton Reported-by: Chris Mason Cc: Lorenzo Stoakes Cc: Alice Ryhl Cc: Andrew Ballance Cc: Signed-off-by: Greg Kroah-Hartman commit 77c0a8d869888dc134c9e73b3f6e291ad3c686ce Author: Joas Antonio dos Santos Date: Tue Nov 10 09:03:23 2026 +0000 mac802154: llsec: reject secured frames with security level 0 commit 3e8c853c959e9637ed66ae1e55e0d3bb97372cc5 upstream. mac802154_llsec_decrypt() handles every received frame that has the Security Enabled bit set. The security level is taken from the auxiliary security header of the frame and is not required to be non-zero. The only check that looks at level 0 rejects the frame only if level 0 is not allowed by the matching seclevel entry, the entry has device_override set and the device is not seclevel_exempt: if (!(seclevel.sec_levels & BIT(hdr.sec.level)) && (hdr.sec.level == 0 && seclevel.device_override && !dev->dev.seclevel_exempt)) { Otherwise the frame reaches llsec_do_decrypt(), which sends every level other than IEEE802154_SCF_SECLEVEL_ENC to llsec_do_decrypt_auth(). There ieee802154_sechdr_authtag_len() returns 0 for level 0 and req = aead_request_alloc(llsec_tfm_by_len(key, authlen), GFP_ATOMIC); looks for a transform with an authentication tag size of 0. The key only has transforms for tag sizes 4, 8 and 16, so llsec_tfm_by_len() runs into its BUG(). The frame is not authenticated at that point. A station in radio range can crash a node that has llsec enabled if it sends a frame that matches a configured key entry and a device table entry (source address, key id mode and key id are sent in the clear and can be observed), uses a frame type that has a seclevel entry and carries a frame counter that is not lower than the stored one. No key material is needed. The frame counter of that device is also updated before the BUG() is reached. A frame with the Security Enabled bit set and security level 0 carries no protection and cannot be processed by the incoming security procedure. Reject it before any key or device state is looked up. The transmit side already leaves such frames alone in mac802154_llsec_encrypt(). Found by LLM-assisted source review. Fixes: 4c14a2fb5d14 ("mac802154: add llsec decryption method") Cc: stable@vger.kernel.org Signed-off-by: Joas Antonio dos Santos Reviewed-by: Miquel Raynal Link: https://patch.msgid.link/20261110-llsec-seclevel-none-v1-1-06ef143e467f@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit a081af204a37010fc00bc867943d7c1e49a17381 Author: Ard Biesheuvel Date: Thu Oct 29 14:50:21 2026 +0100 lib/crc: Don't include in NEON intrinsics code commit ff049836f05f5e46f702858a7cb949998e85a310 upstream. The kernel's definitions of uint64_t and int64_t in are based on [unsigned] long long, whereas the ones provided by , which is included by , are based on [unsigned] long on arm64. On 32-bit ARM, a similar mismatch exists for intptr_t. Including both into the same compilation unit currently only works because asm/neon-intrinsics.h overrides the predefined macros that the compiler's freestanding uses to define these types. In order to be able to get rid of those overrides, stop including into the CRC64 NEON intrinsics code. Instead, use for the definition of size_t, and rely on to provide the u8 and u64 types used in the prototype of crc64_nvme_neon(), which is shared with code that does include . Use uint64_t for the arrays of constants that are passed to vld1q_u64(), so that they match its prototype regardless of how uint64_t is defined. No change in generated code. Signed-off-by: Ard Biesheuvel Reviewed-by: Thomas Huth Tested-by: Nathan Chancellor Reviewed-by: Eric Biggers Cc: Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 655b23837c3e7a324766c4dfa6da920cb8b61996 Author: Alice Ryhl Date: Wed Nov 18 13:09:18 2026 +0000 kbuild: rust: disable function merging unconditionally commit 73bdf8773de4af2c2b7f49370191ae6d5aeddea5 upstream. Function merging causes various different issues: * For CONFIG_CFI there's an LLVM bug causing functions with different CFI hashes to get merged. This can lead to crashes at runtime. * For gendwarfksyms it causes functions with different CRCs to get merged. This leads to broken MODVERSIONS information if the function changes in the future so that it can no longer be merged. * Wrong backtraces when a crash occurs in a merged function. * Possibly also issues with pahole/BTF as the merged function's debug info is lost. These issues are new to Rust because in clang, function merging is off by default, so these things have never come up before. Because of this, turn this option off for all configurations. [ The LLVM bug is tracked at [1]. Nick asked what function merging refers to here, and Alice writes [2]: No, this isn't linker ICF. rustc doesn't pass --icf, and in any case kbuild invokes rustc with --emit=obj and does the final link itself, so rustc's linker arguments never come into play. What I'm referring to is LLVM's MergeFunctions IR pass (llvm/lib/Transforms/IPO/MergeFunctions.cpp). It runs as part of the optimization pipeline, within a single codegen unit, before any object file is emitted. Clang only enables it with the cc1-only flag -fmerge-functions, which the kernel never passes, so C code in the kernel never sees it. rustc, however, enables it by default whenever optimizing for speed or size (opt-level 2, 3, s or z), which covers both kernel configurations. It uses the "aliases" mode: when two functions have identical bodies, one is deleted and its symbol becomes a GlobalAlias to the other. You can turn it off with -Zmerge-functions=disabled. - Miguel ] Link: https://lore.kernel.org/all/avy_9SPRaPSKD8b4@google.com/ Fixes: ac61506bf2d1 ("rust: Use gendwarfksyms + extended modversions for CONFIG_MODVERSIONS") Signed-off-by: Alice Ryhl Cc: stable@vger.kernel.org Reviewed-by: Gary Guo Reviewed-by: Sami Tolvanen Link: https://github.com/llvm/llvm-project/issues/217629 [1] Link: https://lore.kernel.org/rust-for-linux/CAH5fLgidhnPbP=xXQ3162w6q0U6rWHPZ9Mu6-E5va4_CXyanOg@mail.gmail.com/ [2] Link: https://patch.msgid.link/20261118-rust-merge-functions-v1-1-fe86126522b9@google.com Signed-off-by: Miguel Ojeda Signed-off-by: Greg Kroah-Hartman commit 90ba03fb8268c31d8e28dc2eb9889f3d51f5cb1b Author: Henry Martin Date: Thu Nov 12 12:24:15 2026 +0800 ip6mr: prevent info-leak in ip6mr_cache_report() commit ea538b5790eed4f042ea787ea761cb1a695f8138 upstream. The non-WHOLEPKT branch copies the IPv6 header at offset 0 and then appends 40 bytes with skb_put(), but the mrt6msg is written at offset 0 after skb_reset_transport_header(), so the appended 40 bytes are never initialized. They hold stale heap contents. The report is queued to the mroute6 socket and copied into the IP6MRA_CREPORT_PKT netlink attribute, disclosing the stale bytes to user space. The stale bytes can contain kernel heap and image pointers, and the report is reachable from an unprivileged user namespace (MRT6_INIT in a new netns, plus the non-root RTNLGRP_IPV6_MROUTE_R group). Use skb_put_zero() instead, as the IPv4 code does since commit 4f34002e2e376 ("ipmr: prevent info-leak in pmr_cache_report()"). This issue was discovered by Tencent CodeBuddy Security. Fixes: 7bc570c8b4f75 ("[IPV6] MROUTE: Support multicast forwarding.") Cc: stable@vger.kernel.org Signed-off-by: Henry Martin Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261112042415.617221-1-bsdhenrymartin@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 4dc1bf0097e3f6530facf62dfe8d3ff19a962592 Author: David Hildenbrand (Arm) Date: Thu Nov 12 23:53:23 2026 +0100 iommufd: fix cleanup when adding memfd folio pins fails commit b8ba6cc9943222676d46ac77d3d3de2685a55bf8 upstream. folio_add_pins() can fail after memfd_pin_folios() succeeded pinning a folio. Upcoming folio refcount limit checks will make this easier to trigger. Let's fix three problems in the error handling: 1. pfn_reader_release_pins() uses the allocated array size instead of the number of folios returned by memfd_pin_folios(). With large folios, cleanup can unpin uninitialized entries. Remember the number of returned folios and use that during cleanup. 2. pin_memfd_pages() returns on failure without releasing the pins acquired by the current call. Release the per-page pins for folios already expanded into the page array, and the single pins for the remaining folios. 3. pfn_reader_next() returns on failure before updating batch_end_index, even if the batch already contains successfully expanded folios. Update it before propagating the error so cleanup releases those pins as well. Fixes: 92687c793644 ("iommufd: pfn_reader for file mappings") Cc: stable@vger.kernel.org Reviewed-by: Lance Yang Reviewed-by: Jason Gunthorpe Link: https://patch.msgid.link/20261112-refcount_overflow_stable-v4-4-ad3deef0bd23@kernel.org Signed-off-by: David Hildenbrand (Arm) Signed-off-by: Greg Kroah-Hartman commit 0fd8427ed85840c9947a292ac510b37538c9102a Author: Juan Parrado Date: Mon Nov 9 11:21:27 2026 +0100 Input: xpad.c - add support for Hyperkin Xenon, Hori Taiko Controller DX, and 8BitDo M30 commit 9def7caa2e55d0c5708385ae0d0039e9eaa26c47 upstream. Add specific support to various controllers: - HORI Taiko Controller DX - 8BitDo M30 Wired Controller for Xbox - Hyperkin Xenon Controller Signed-off-by: Juan Parrado Link: https://patch.msgid.link/20261109102127.9417-1-jparrado1817@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman commit 20fee2967c10fdb701026b323eebe68610473da2 Author: Juan Parrado Date: Mon Nov 9 20:41:18 2026 +0100 Input: xpad - add support to Hori Real Arcade Pro 4 commit 9cfed185db8f1c12bf2629fb37c77d85bf93b193 upstream. The HORI Real Arcade Pro 4 in PC mode is currently recognized by xpad.c as a 'Generic X-Box pad' and works out of the box. However, this generic name does not match the actual device name, making it difficult for users to distinguish this controller when multiple devices are connected. Tested on physical hardware. The proposed change works perfectly as is. The MAP_TRIGGERS_TO_BUTTONS parameter does not work here. Other arcade sticks use an identical configuration, such as the 'Street Fighter IV FightPad' and the 'Hori Real Arcade Pro.EX Premium VLX'. Signed-off-by: Juan Parrado Link: https://patch.msgid.link/20261109194118.18127-1-jparrado1817@gmail.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman commit 721dcf7b5d35c76411c72f8c439bba310de9e5e2 Author: Sergei Kuznetsov Date: Fri Oct 23 19:13:14 2026 +0700 Input: xpad - add GameSir G7 Pro support commit d1eb0afa9140c740ff29985f9b89b1926b1b502d upstream. Add the GameSir G7 Pro (0x3537:0x109c) in Xbox mode, connected through its 2.4G dongle. The controller uses the GIP protocol and was already bound through the GameSir vendor match, but showed up as "Generic X-Box pad" and its Share button was not reported. Set MAP_SHARE_BUTTON so the Share button is reported as KEY_RECORD. Signed-off-by: Sergei Kuznetsov Link: https://patch.msgid.link/20261023121314.8024-1-kernel@phnx47.net Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman commit ef34dc7b3aa96c4f7c8fc33b25da4588216c6dfc Author: Yuan Yao Date: Fri Nov 13 19:22:02 2026 +0800 Input: trackpoint - add new TP JYT_NDT device variant id 7 commit ce8010f11f3ea62f8675e9bc921ee485aef82019 upstream. The new trackpoint variant id 7 is found on Lenovo Thinkpad X14 Gen1 laptop(Product Name: 21XMA006CD), it belongs to JYT_NDT with confirmation from Vishnu Sankar in Lenovo. now it's incorrectly probed as Generic or Logitech PS/2 mouse. Add the variant id 7 to match the TP_READ_ID command return value, probe the device as trackpoint correctly. BEFORE: input: PS/2 Generic Mouse as /devices/platform/i8042/serio1/input/input63 AFTER: psmouse serio1: trackpoint: JYT_NDT TrackPoint firmware: 0xa1, buttons: 3/3 input: TPPS/2 JYT_NDT TrackPoint as /devices/platform/i8042/serio1/input/input8 Signed-off-by: Yuan Yao Link: https://patch.msgid.link/20261113112202.10304-2-yaoyuan@linux.alibaba.com Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman commit 64d9d755027570b41df8723cfbf25c1792531902 Author: Liu Chao Date: Fri Nov 6 15:51:29 2026 +0800 Input: goodix - reject a bak_ref length that cannot hold the checksum commit b3249e446d47c65dc09611705ad4d0a7587405ac upstream. driver_num and sensor_num are taken from the touchscreen config. A config with driver_num 1 and sensor_num 0 yields a bak_ref length of 0, for which devm_kzalloc() returns ZERO_SIZE_PTR. That pointer passes the !ts->bak_ref check and the subsequent ts->bak_ref[ts->bak_ref_len - 1] = 1 writes before the allocation. Reject a length that leaves no room for the trailing checksum before allocating, and skip saving a bak_ref that was never allocated. Without the second check a rejected length leaves bak_ref NULL while bak_ref_len still holds the bogus value, and goodix_save_bak_ref() then writes through the same index on suspend. Fixes: 09182ed20c04 ("Input: goodix - add support for controllers without flash") Cc: stable@vger.kernel.org Signed-off-by: Liu Chao Link: https://patch.msgid.link/20261106075129.3106093-1-liuc63@xiaopeng.com Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman commit f042751d07c06ac17dc7480f8a32b9ba3decac8d Author: Ivan Verbovoy Date: Mon Nov 9 19:15:55 2026 +0200 Input: da7280 - do not advertise FF_GAIN commit c1f4db7e869ce7dafd1811a75b392740985e1199 upstream. The driver sets FF_GAIN in the device's force feedback capabilities but provides no set_gain() callback. input_ff_event() checks the capability bit, not the callback, before calling ff->set_gain(), so an EV_FF/FF_GAIN event written to the event node by any process with write access to it calls through a NULL pointer. The driver has no global gain to set: a constant effect carries its own level, and a periodic effect plays a pattern from the device's waveform memory. Drop FF_GAIN from the capabilities, so that input_ff_event() ignores such an event. Fixes: cd3f609823a5 ("Input: new da7280 haptic driver") Cc: stable@vger.kernel.org Signed-off-by: Ivan Verbovoy Link: https://patch.msgid.link/20261109-da7280-fixes-v1-1-09cc3650261c@gmail.com Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman commit 29df82e0de075e12916c630edceed3e74d8b5713 Author: Wentao Liang Date: Sun Nov 8 06:45:47 2026 +0000 Input: cyapa - fix runtime PM leak in cyapa_update_rt_suspend_scanrate() commit f5f8cc539f8b2bd5324c03dfce8cca57284653e6 upstream. pm_runtime_get_sync() unconditionally increments the runtime PM usage counter. If mutex_lock_interruptible() is interrupted, the function returns without dropping that reference, so the usage count stays elevated for as long as the driver is bound and the device can no longer be autosuspended. Drop the reference on the error path. Use pm_runtime_put_autosuspend() rather than the synchronous variant there: nothing has been done to the device on this path, so there is nothing to wait for, and with the 2 s autosuspend delay the driver configures the put only arms the autosuspend timer instead of suspending the device. Fixes: 672865080a8f ("Input: cyapa - add runtime power management support") Cc: stable@vger.kernel.org Signed-off-by: Wentao Liang Link: https://patch.msgid.link/1794120347.2701234.vulab@iscas.ac.cn Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman commit e439fd7cbd38765d5e840532469e8c749eca51c5 Author: Ziheng Wei Date: Sun Nov 15 16:02:03 2026 +0800 hwmon: (w83792d) Fix incorrect struct cast in show_temp1() and store_temp1() commit d4f7d626cc1a966dca930a5ba07e8c4739adceb0 upstream. On big-endian architectures, accessing the temp1_max and temp1_max_hyst sysfs attributes in the w83792d hardware monitoring driver uses a huge out-of-bounds index, because show_temp1() and store_temp1() downcast the attribute to the wrong struct. The driver defines the temp1_* attributes with SENSOR_DEVICE_ATTR_2(), which initializes them as struct sensor_device_attribute_2 (where the index is an 8-bit u8). The temp1_input attribute has index 0, temp1_max has index 1 and temp1_max_hyst has index 2. However, show_temp1() and store_temp1() downcast the attribute to struct sensor_device_attribute (where the index is a 32-bit int) and use it to index data->temp1[]. Because both structs start with struct device_attribute, container_of() resolves to the same base address, but the field widths differ. On big-endian architectures, reading the 32-bit int from the memory layout of the two u8 fields yields index << 24: 0x01000000 for temp1_max and 0x02000000 for temp1_max_hyst, instead of 1 and 2. data->temp1[] has only 3 elements, so the access runs off the end of the array by up to 32 MiB. Fix the type casts in show_temp1() and store_temp1(). Confirmed on a big-endian s390x QEMU guest with the driver bound to an emulated chip: temp1_max and temp1_max_hyst read 0 instead of the register values. Not tested on real hardware. Fixes: 1f8dae31fe8d ("[PATCH] hwmon: w83792d use arrays of attributes") Cc: stable@vger.kernel.org Signed-off-by: Ziheng Wei Link: https://patch.msgid.link/20261115080203.910033-4-zihengw03@163.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit a1d5e8ff3c8350804f1d6715fd71b45366903015 Author: Ziheng Wei Date: Sun Nov 15 16:02:02 2026 +0800 hwmon: (w83791d) Fix incorrect struct cast in show_temp1() and store_temp1() commit fb47eb0528d275362b01423ceb956e3ce1f9d715 upstream. On big-endian architectures, accessing the temp1_max and temp1_max_hyst sysfs attributes in the w83791d hardware monitoring driver uses a huge out-of-bounds index, because show_temp1() and store_temp1() downcast the attribute to the wrong struct. The driver defines the temp1_* attributes with SENSOR_ATTR_2(), which initializes them as struct sensor_device_attribute_2 (where the index is an 8-bit u8). The temp1_input attribute has index 0, temp1_max has index 1 and temp1_max_hyst has index 2. However, show_temp1() and store_temp1() downcast the attribute to struct sensor_device_attribute (where the index is a 32-bit int) and use it to index data->temp1[]. Because both structs start with struct device_attribute, container_of() resolves to the same base address, but the field widths differ. On big-endian architectures, reading the 32-bit int from the memory layout of the two u8 fields yields index << 24: 0x01000000 for temp1_max and 0x02000000 for temp1_max_hyst, instead of 1 and 2. data->temp1[] has only 3 elements, so the access runs off the end of the array by up to 32 MiB. Fix the type casts in show_temp1() and store_temp1(). Confirmed on a big-endian s390x QEMU guest with the driver bound to an emulated chip: temp1_max and temp1_max_hyst read 0 instead of the register values. Not tested on real hardware. Fixes: 9873964d6eb2 ("[PATCH] HWMON: w83791d: New hardware monitoring driver for the Winbond W83791D") Cc: stable@vger.kernel.org Signed-off-by: Ziheng Wei Link: https://patch.msgid.link/20261115080203.910033-3-zihengw03@163.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit df74eaaadcbe75a1d85bde1afca5867abd7f3ca9 Author: Wayne Ho Date: Fri Nov 13 13:48:57 2026 +0800 hwmon: (sht3x) Fix overflow when writing alert limits commit e6872defbb2eb1dc61b3ea168ca13e1362efbd86 upstream. limit_write() encodes the limits with 32-bit arithmetic, which overflows for the largest accepted values: (130000 + 45000) * 24543 = 4295025000 > U32_MAX 100000 * 42950 = 4295000000 > U32_MAX Writing 130000 to temp1_max therefore programs -45 degrees C, and writing 100000 to humidity1_max programs 0 %RH, so a limit set to its maximum makes the alert fire instead of never firing. Reading the attributes back returns the cached values, so this is not visible from sysfs. Use 64-bit arithmetic and clamp each result to its field width. Even with 64-bit arithmetic, 130000 encodes to 0x200, which overflows the 9-bit temperature field, and 100000 encodes to 0x10000, which is still 0 after masking. Prepared with the help of an AI coding assistant (Claude); I reproduced the bug and tested the fix on hardware. Fixes: 7c84f7f80d6f ("hwmon: add support for Sensirion SHT3x sensors") Cc: stable@vger.kernel.org Reported-by: Sashiko Closes: https://lore.kernel.org/linux-hwmon/20260725222229.EA69B1F000E9@smtp.kernel.org/ Signed-off-by: Wayne Ho Link: https://patch.msgid.link/20261113054857.97048-1-wayneho219@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 57e58462fcb206859280591ae824aa5a9ef366b1 Author: Guenter Roeck Date: Mon Nov 9 18:14:18 2026 -0800 hwmon: (nct6775) Fix tolerance bitmask when reading REG_FAN_MODE commit 39cd14ca605d1aa55a0ad26767014a88b5c39f20 upstream. On NCT6775, bits 0..3 of REG_FAN_MODE hold the temperature or fan speed tolerance (tolerance_mask is 0x0f), whereas on NCT5525, NCT6106, NCT6116, NCT6126, and NCT6776+, only bits 0..2 hold the temperature tolerance or low 3 bits of speed tolerance (tolerance_mask is 0x07). However, nct6775_update_pwm() masks fanmodecfg with a hardcoded 0x0f. When bit 3 of REG_FAN_MODE is set on chips where tolerance_mask is 0x07, nct6775_update_pwm() includes bit 3 in temp_tolerance[0] and target_speed_tolerance, corrupting reported tolerance values and causing pwm_update_registers() to OR bit 3 back into REG_FAN_MODE. Mask fanmodecfg with data->tolerance_mask instead of 0x0f in nct6775_update_pwm(). Fixes: cdcaeceb74ff ("hwmon: (nct6775) Add support for automatic fan control") Cc: stable@vger.kernel.org Reported-by: Sashiko Cc: Anton Lundin Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit afa870b60e9a0d0a3a0fa87b2b6acde2c7b39418 Author: Guenter Roeck Date: Mon Nov 9 18:13:26 2026 -0800 hwmon: (nct6775) Fix swapped temperature tolerance register writes commit 3cc60eb1b9aa07da81593f8f027efefb67185144 upstream. sensor_dev_template_pwm_temp_tolerance uses index 0 (backed by REG_FAN_MODE via pwm_update_registers()) while sensor_dev_template_pwm_crit_temp_tolerance uses index 1 (backed by REG_CRITICAL_TEMP_TOLERANCE). However, store_temp_tolerance() checks if (index) with inverted branches. As a result, writing to pwm*_temp_tolerance writes the new tolerance to REG_CRITICAL_TEMP_TOLERANCE instead of REG_FAN_MODE, while writing to pwm*_crit_temp_tolerance updates REG_FAN_MODE with temp_tolerance[0] and leaves REG_CRITICAL_TEMP_TOLERANCE unchanged. Invert the index check in store_temp_tolerance() so index 0 updates fan mode registers via pwm_update_registers() and index 1 writes to REG_CRITICAL_TEMP_TOLERANCE. Fixes: cdcaeceb74ff ("hwmon: (nct6775) Add support for automatic fan control") Cc: stable@vger.kernel.org Reported-by: Sashiko Cc: Anton Lundin Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 3ad954b6e31c6eebfaed2c6f277e99ed7ea4b83c Author: Ziheng Wei Date: Sun Nov 15 16:02:01 2026 +0800 hwmon: (nct6775) Fix incorrect struct cast in beep callbacks commit 07571b42cf41d0e42fb890713340a8f0a3c03d56 upstream. On big-endian architectures, writing the in[1-*]_beep, fan[1-*]_beep and temp[1-*]_beep sysfs attributes in the nct6775 hardware monitoring driver always changes channel 0 due to an incorrect struct downcast in the beep store callbacks. The driver defines these sysfs attributes using SENSOR_TEMPLATE(), which initializes them as struct sensor_device_attribute (where the index is a 32-bit int). However, the sysfs store callbacks nct6775_store_beep() and store_temp_beep() incorrectly downcast the attribute to a struct sensor_device_attribute_2 (where the index is an 8-bit u8). Because both structs start with struct device_attribute, container_of() resolves to the same base address. On big-endian architectures, reading the 8-bit index field from the memory layout of a 32-bit int fetches the most significant byte (which is 0), rather than the intended channel number. This type mismatch causes all beep writes to change the beep setting of channel 0, regardless of which channel the user targeted. Fix the type casts in the two store callbacks. Not runtime-tested: the only big-endian machine available to me (s390x under QEMU) cannot build the platform driver (no HAS_IOPORT). Fixes: 30846993047b ("hwmon: (nct6775) Add support for beep attributes") Cc: stable@vger.kernel.org Signed-off-by: Ziheng Wei Link: https://patch.msgid.link/20261115080203.910033-2-zihengw03@163.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 662ab99d3a4cf64269f7068a51509ca564019c02 Author: Rosen Penev Date: Tue Nov 17 20:04:17 2026 -0800 hwmon: (dell-smm) Reject out-of-range pwm values commit 7494b0c50c9fcd9f9f5235777bb506dd45676557 upstream. dell_smm_write() scales the value written to pwmN with DIV_ROUND_CLOSEST(val, data->i8k_pwm_mult) before clamping the result to the valid fan states. The rounding adds i8k_pwm_mult / 2 to val first, which overflows for values near LONG_MAX and wraps to a large negative number. That is then clamped to 0, so writing a huge value turns the fan off instead of running it at the highest speed. With the default fan_max of 2, writing any value from LONG_MAX - 63 up to LONG_MAX selects fan state 0. The pwm range is well defined, so return -EINVAL for values outside 0 to 255, as is the convention for pwm attributes. Fixes: e7f5f275c62a ("i8k: Implement hwmon based fan speed control") Cc: stable@vger.kernel.org Signed-off-by: Rosen Penev Link: https://patch.msgid.link/20261118040417.19049-1-rosenp@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 7ebf2da99520ddf690feafea30431791eb4cbd5d Author: Rosen Penev Date: Fri Nov 13 22:20:23 2026 -0800 hwmon: (dell-smm) Reject a fan_max that the BIOS cannot take commit 69624d7d821ec7d3f9801e86acf555a8edc82f99 upstream. The fan_max module parameter is used without any range check, unlike fan_mult. dell_smm_init_hwmon() allocates the nominal speed table with devm_kmalloc_array(dev, data->i8k_fan_max + 1, ...) and fan_max=4294967295 wraps the count to 0. devm_kmalloc() then returns ZERO_SIZE_PTR, which the first successful nominal speed call writes through. Values above 255 are also meaningless: the fan state is passed to the BIOS as fan | (speed << 8), so the higher bits end up in other parts of the request. Large values that do not wrap still cost one SMM call per state and fan while probing. Fail probing if the maximum fan state does not fit in a byte, like the existing check for fan_mult. Fixes: 81474fc2fae9 ("i8k: Add support for configurable maximum fan speed value") cc: stable@vger.kernel.org Signed-off-by: Rosen Penev Link: https://patch.msgid.link/6d3b86acf6713e9286e60ecf788582e840946238.1794633179.git.rosenp@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit c3a07e7c5f90f8cc8d90b86c30bd21453472be31 Author: Vítor Hugo Silva Date: Wed Nov 18 09:29:28 2026 +0000 hwmon: (ads7871) Add error handle from spi_setup() commit 449cdc5e29c63aa66b41ce8c2783f6b0d84c62b0 upstream. The ads7871 probe() ignores the spi_setup() error return value and it attempts to write to registers even if spi_setup() fails. Return the setup error before accessing any registers. AI was used for peer-review the patch. Fixes: e0c70b8078629 ("hwmon: add TI ads7871 a/d converter driver") Cc: stable@vger.kernel.org Signed-off-by: Vítor Hugo Silva Link: https://patch.msgid.link/20261118092928.163553-1-vitorhg20080@gmail.com Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 1fa4433ce805ef575db997faacad1c17cc7f14e8 Author: Guenter Roeck Date: Sun Nov 15 16:26:32 2026 -0800 hwmon: Use per-device lockdep keys commit f17d77541c909b7c03fa29095d45f23a79699879 upstream. Currently, mutex_init(&hwdev->lock) in __hwmon_device_register() assigns a single static lockdep key to all hardware monitoring device locks. If one hardware monitoring device accesses another hardware monitoring device (for example, pwm-fan controlling a PWM output provided by adt7470), lockdep sees two instances of the same lock class acquired in sequence and reports a false-positive recursive locking warning. Give each struct hwmon_device its own dynamic struct lock_class_key, registered via lockdep_register_key() and initialized with mutex_init_with_key() before any error path that calls hwmon_dev_release(), and cleaned up with mutex_destroy() and lockdep_unregister_key() in hwmon_dev_release(). This allows nested locking across distinct hwmon devices while preserving full lockdep deadlock and self-recursion detection. Fixes: 3ad2a7b9b15d ("hwmon: Serialize accesses in hwmon core") Cc: stable@vger.kernel.org Cc: Davíð Steinn Geirsson Signed-off-by: Guenter Roeck Signed-off-by: Greg Kroah-Hartman commit 9467a00cc8bbcde2717680669ac20c41b8e37ef1 Author: Xuanqiang Luo Date: Thu Nov 12 16:45:58 2026 -0800 iavf: fix QoS capabilities memory leak commit 65f6ffb9001bf539aebd478798460477980b60c4 upstream. Commit 4c1a457cb8b0 ("iavf: add support to exchange qos capabilities") allocates adapter->qos_caps during probe, but iavf_remove() does not free it. This leaks the allocation whenever an iavf device is removed. Free adapter->qos_caps in iavf_remove(). Fixes: 4c1a457cb8b0 ("iavf: add support to exchange qos capabilities") Cc: stable@vger.kernel.org Reviewed-by: Jedrzej Jagielski Signed-off-by: Xuanqiang Luo Reviewed-by: Aleksandr Loktionov Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113004602.129864-5-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 578fee1ca7cc7b7fae261e2549f9c3ff7e22e56c Author: Xuanqiang Luo Date: Thu Nov 12 16:45:59 2026 -0800 iavf: fix ASQ command buffer leak on init failure commit 2a1f106379a90ce7ac63f96a57c241a4cf20a983 upstream. iavf_alloc_adminq_asq_ring() allocates cmd_buf before the remaining ASQ resources. If iavf_alloc_asq_bufs() or iavf_config_asq_regs() fails, the unwind path elides cmd_buf while freeing the other allocations. The ASQ count is not set until initialization succeeds, so the shutdown path cannot reclaim the buffer. Free cmd_buf in the common unwind path. Fixes: d358aa9a7a2d ("i40evf: init code and hardware support") Cc: stable@vger.kernel.org Signed-off-by: Xuanqiang Luo Reviewed-by: Jedrzej Jagielski Reviewed-by: Aleksandr Loktionov Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113004602.129864-6-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 52d10148488eceab332de7602bd5f31c0ac8afff Author: Xuanqiang Luo Date: Thu Nov 12 16:46:00 2026 -0800 iavf: add missing PTP adjustment callbacks commit adbc4d0fff640541d7071421ac59dbd70da33b18 upstream. The PTP hardware clock documentation requires drivers to implement all callbacks and return -EOPNOTSUPP for unsupported features. The iavf driver registers a PHC without adjtime or adjfine callbacks. A userspace clock_adjtime(2) request reaches ptp_clock_adjtime(), where ADJ_SETOFFSET calls adjtime and ADJ_FREQUENCY calls adjfine. The missing callbacks can therefore cause a NULL dereference. Provide both callbacks and return -EOPNOTSUPP for the unsupported operations. Fixes: d734223b2f0d ("iavf: add initial framework for registering PTP clock") Link: https://docs.kernel.org/driver-api/ptp.html#writing-clock-drivers Link: https://lore.kernel.org/all/20260826101004.100979-1-xuanqiang.luo@linux.dev/ Cc: stable@vger.kernel.org Signed-off-by: Xuanqiang Luo Reviewed-by: Vadim Fedorenko Acked-by: Jacob Keller Tested-by: Rafal Romanowski Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113004602.129864-7-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 9d9949b5fce77ef428f6507627ce953839b2a31e Author: Sung Byeongchan Date: Sat Nov 7 18:36:01 2026 +0900 ieee802154: require CAP_NET_ADMIN for SIOCSIFADDR commit a0abc1e4c9d5b8b846abe4293b7bca578736da8a upstream. PF_IEEE802154 DGRAM sockets are available to ordinary init-net processes. Their family-specific SIOCSIFADDR path calls the netdev ioctl directly and does not pass through the generic network-device setter capability check. An unprivileged process can therefore change the PAN ID and short address of a separately administrator-owned down WPAN interface. In a local fakelb fixture, uid 1000 changed both identifiers and the values remained active through a later administrator interface open in three of three fresh KASAN boots. Require CAP_NET_ADMIN in the socket network namespace before processing SIOCSIFADDR. Keep SIOCGIFADDR and all existing state and value checks unchanged. The fixed kernel rejected the same unprivileged request with -EPERM and preserved the administrator identity in three of three matched boots. Administrator SET, running-device, invalid-value, wrong-device, cleanup, later-open and recovery controls passed in all baseline and fixed runs. The demonstrated impact is local cross-principal WPAN identity and policy modification after privileged device setup. Memory corruption, disclosure, RCE and LPE were not demonstrated. Fixes: 9ec767160357 ("net: add IEEE 802.15.4 socket family implementation") Cc: stable@vger.kernel.org Signed-off-by: Sung Byeongchan Reviewed-by: Miquel Raynal Link: https://patch.msgid.link/20261107093601.619363-1-tjdqudcks0424@naver.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 8c4b97a80672c8803cf89c79c23c8a2f909fe7d3 Author: Joas Antonio dos Santos Date: Mon Nov 2 13:03:56 2026 +0000 hugetlbfs: move hugetlbfs_free_inode tracepoint to ->destroy_inode() commit ccf8bda05b19dc144bc7051936b08573476499ee upstream. hugetlbfs_free_inode() calls trace_hugetlbfs_free_inode(), and the hugetlbfs__inode event class records inode->i_sb->s_dev. ->free_inode() runs from an RCU callback (destroy_inode() queues i_callback() with call_rcu()), and Documentation/filesystems/porting.rst says that this callback "is *NOT* ordered wrt superblock destruction; as the matter of fact, the superblock and all associated structures might be already gone". put_super() frees the superblock with call_rcu() followed by a workqueue item (destroy_super_rcu() -> destroy_super_work()). syzbot hit this with the event enabled: BUG: KASAN: slab-use-after-free in trace_event_raw_event_hugetlbfs__inode+0x45b/0x4c0 include/trace/events/hugetlbfs.h:36 Read of size 4 at addr ffff888038850010 by task syz-executor952/6134 hugetlbfs_free_inode+0x15e/0x1f0 fs/hugetlbfs/inode.c:1182 i_callback+0x46/0x80 fs/inode.c:317 rcu_do_batch kernel/rcu/tree.c:2650 [inline] rcu_core+0x5f0/0x1220 kernel/rcu/tree.c:2919 Allocated by task 6134: alloc_super fs/super.c:326 [inline] sget_fc+0x1ba/0x1f60 fs/super.c:874 hugetlbfs_get_tree+0x1e7/0x2b0 fs/hugetlbfs/inode.c:1431 Freed by task 855: kfree+0x22b/0x6d0 mm/slub.c:6923 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 Emit the event from hugetlbfs_destroy_inode() instead. destroy_inode() calls ->destroy_inode() synchronously, before it queues the RCU callback, while the superblock is still alive; hugetlbfs_destroy_inode() already dereferences inode->i_sb there. ->free_inode() is left with only the kmem_cache_free(). Since the event no longer fires from ->free_inode(), rename it to hugetlbfs_destroy_inode so that its name matches where it is emitted, as suggested by David and Muchun. Found by syzbot; analysed and tested with the syzbot C reproducer on an arm64 KASAN kernel. Link: https://lore.kernel.org/20261102-b4-hugetlbfs-trace-v4-1-72371825bb5e@gmail.com Fixes: 014ad7c42a69 ("hugetlbfs: use tracepoints in hugetlbfs functions.") Signed-off-by: Joas Antonio dos Santos Signed-off-by: Andrew Morton Reported-by: Closes: https://lore.kernel.org/all/6ae27525.5451848c.f7707.0001.GAE@google.com/ Suggested-by: David Hildenbrand Suggested-by: Muchun Song Reviewed-by: Muchun Song Acked-by: David Hildenbrand (Arm) Cc: Oscar Salvador Cc: Hongbo Li Cc: Signed-off-by: Greg Kroah-Hartman commit 1adbc20273a6462ef4eee4e8a5f093d01519324d Author: Amaan Cheval Date: Thu Nov 12 14:44:50 2026 +0530 gve: refuse XDP on queue formats without XDP support commit 92c569c28b63067da0276f67f711a3ac20a62aca upstream. Commit d8a8ca14c937 ("gve: add XDP_TX and XDP_REDIRECT support for DQ RDA") enabled XDP on DQO-RDA by dropping the queue_format check from verify_xdp_configuration(), which until then refused every format but GQI-QPL. Nothing replaced it: gve_set_netdev_xdp_features() advertises no XDP features for DQO-QPL and GQI-RDA and gve_xdp_xmit() rejects both, but the core only checks that ndo_bpf exists, so a native XDP program, and an AF_XDP socket on top of it, can still be attached on a queue format the driver does not support. The DQO-QPL RX path was never written for that. Its page accounting assumes the driver keeps a reference of its own across every handoff: gve_xdp_done_dqo() passes the buffer to xdp_do_redirect() and then recycles it with gve_reuse_buffer(), so a redirect target that releases the buffer synchronously, such as an AF_XDP socket in copy mode, can drop the page's last reference when pagecnt_bias runs out. The page is then freed while it is still DMA-mapped and registered in the QPL, and the driver posts it back to the device. GQI-RDA is no better off: an XDP_TX there goes through gve_tx_fill_xdp(), which copies the frame into tx->tx_fifo, but a raw-addressing TX ring never allocates that FIFO, so the first XDP_TX writes through a NULL tx_fifo.base. Refuse XDP setup in gve_verify_xdp_configuration() whenever the driver advertises no XDP features for the current queue format, which today means DQO-QPL and GQI-RDA. A zero-copy XSK pool bind is already refused by the core for the same reason, and a copy-mode bind never reaches the driver and is harmless without a program. Fixes: d8a8ca14c937 ("gve: add XDP_TX and XDP_REDIRECT support for DQ RDA") Cc: stable@vger.kernel.org Reviewed-by: Joshua Washington Signed-off-by: Amaan Cheval Tested-by on v2: Link: https://patch.msgid.link/20261112091451.22969-2-amaan.cheval@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit 4a10fd3d87fb7da767a761bd6031166cac6f97ce Author: Amaan Cheval Date: Thu Nov 12 14:44:51 2026 +0530 gve: fix RX page refcount overflow from INT_MAX pagecnt_bias commit 3946899dbeac2397fdd1727d74a3547d2b13caf3 upstream. gve's GQI and DQO-QPL RX paths set every RX page's refcount to INT_MAX and hand references to the stack by decrementing page_info->pagecnt_bias, to avoid an atomic op per packet. This leaves no room for anyone else: while a fresh page's buffer sits in an skb its refcount is already INT_MAX, so a single get_page() from the stack overflows it to negative. splice() of received TCP data into a pipe takes such a reference, and the onward splice into a socket then fails: skb_splice_from_iter() sees page_count() < 1, sendpage_ok() fails and the send returns -EIO (since commit 2e910b95329c ("net: Add a function to splice pages into an skbuff for MSG_SPLICE_PAGES")). tee() of the pipe fails with -EFAULT via try_get_page(). On GQI the reuse check gve_rx_can_recycle_buffer() also sees page_count() < pagecnt_bias, WARNs and calls gve_schedule_reset(), so a task that merely pins a fresh RX page (e.g. holds spliced data in an undrained tee() pipe) can reset the NIC. Use USHRT_MAX in a u16, as igb, igc, ixgbe, i40e and hns3 do: the bias only has to make the per-packet atomic rare, so a small value keeps page_count() far below INT_MAX however many references the stack takes. Refill by adding a fixed batch and setting the bias to it, which keeps the rule `references = page_count() - bias` intact. Refilling at 0 hands the driver's last reference to the consumer once every USHRT_MAX handoffs rather than once every INT_MAX, which is only safe because every consumer on these paths holds its reference until the driver has recycled the buffer. The previous patch keeps it that way by blocking XDP on DQO-QPL, so this one depends on it. Trees before 6.17, without commit d8a8ca14c937 ("gve: add XDP_TX and XDP_REDIRECT support for DQ RDA"), still refuse XDP on every format but GQI-QPL in verify_xdp_configuration(), so there this patch stands alone. Reproduced on gVNIC in GQI-QPL mode (GCE n2-standard-8, 6.12) and in DQO-RDA mode (GCE c3-standard-8, 6.12, where DQO-RDA still uses the bias) with the help of relay.py -- a small splice(2) TCP proxy -- relaying a download while the RX ring is refilled with fresh pages: ethtool -G eth0 rx 512 && ethtool -G eth0 rx 1024 # fresh RX pages ./relay.py $HOST 8080 & # splice()s both ways for i in $(seq 200); do curl -so /dev/null \ --connect-to $HOST:80:127.0.0.1:8080 http://$HOST/file; done Most downloads failed with EIO before the fix (tee() with EFAULT) and all completed after it. relay.py is at the Link below. This bug was found and fixed with the help of an AI coding assistant (Claude Code) over an interactive session; it read the driver and splice/pipe code and ran the tests above. Link: https://github.com/amaanc/kernel-bias Fixes: 9b8dd5e5ea48 ("gve: DQO: Add RX path") Fixes: 58401b2a46e7 ("gve: Add rx buffer pagecnt bias") Fixes: 82fd151d38d9 ("gve: Reduce alloc and copy costs in the GQ rx path") Cc: stable@vger.kernel.org Reviewed-by: Harshitha Ramamurthy Tested-by: Harshitha Ramamurthy Reviewed-by: Maciej Fijalkowski Signed-off-by: Amaan Cheval Tested-by on v2: Link: https://patch.msgid.link/20261112091451.22969-3-amaan.cheval@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman commit f942471febd82ad5400aefa938d9bc8a0796a833 Author: Bartosz Golaszewski Date: Tue Nov 10 14:47:01 2026 +0100 gpiolib: don't overwrite the entire flags field in gpiod_get_direction() commit 8ed87a9adf48703b5729f9d020eb15fa79ffb099 upstream. gpiod_get_direction() snapshots desc->flags with READ_ONCE(), updates FLAG_IS_OUT in the local copy and writes the whole word back with WRITE_ONCE(). Any bit that a concurrent user sets or clears atomically in between - for instance: FLAG_USED_AS_IRQ from gpiochip_lock_as_irq() - is silently lost. Update FLAG_IS_OUT with a single atomic assign_bit() directly on desc->flags. The earlier READ_ONCE() snapshot is only used for the open-drain check and stays. Cc: stable@vger.kernel.org Fixes: 2559f2e09211 ("gpio: reinforce desc->flags handling") Reviewed-by: Kent Gibson Link: https://patch.msgid.link/20261110-gpio-desc-flags-atomic-v3-1-2f463bce8086@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 9ff0d7f9880559379633e2bc1608fa11158e42ea Author: Bartosz Golaszewski Date: Tue Nov 10 10:29:34 2026 +0100 gpiolib: keep the line state workqueue alive until device release commit 2e002a1d05b1979006f3c46eb6cb5cc36e5630ac upstream. gpiod_line_state_notify() races with a concurrent gpiochip_remove() which unconditionally destroys the line state workqueue causing a use-after-free situation where queue_work() can schedule a work on a freed workqueue. Keep the line state workqueue alive until GPIO device release. Cc: stable@vger.kernel.org Fixes: 07c61d4da43f ("gpiolib: notify user-space about in-kernel line state changes") Closes: https://sashiko.dev/#/bug/linux-d0e9e518-2348-4fe3-857d-f3d61a42f159 Link: https://patch.msgid.link/20261110-gpio-line-state-wq-uaf-v2-1-ce6d8266656e@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 709519b50bd9c11b1dbec7e81b26881131faf8ef Author: Lianjie Wang Date: Thu Nov 5 04:56:32 2026 +0900 gpio: virtio: compute the line names size in a size_t commit 9e3032dc4d92e6214ae687b4c474de9270ce74a2 upstream. virtio_gpio_get_names() computes the size of the GET_LINE_NAMES response as sizeof(*res) + gpio_names_size in an int, where gpio_names_size is a u32 from the config space. A gpio_names_size of 0xffffffff makes the size 0, devm_kzalloc() returns ZERO_SIZE_PTR, and reading the status byte of the response through it oopses: Oops: general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] RIP: 0010:_virtio_gpio_req+0x2b8/0x550 Call Trace: virtio_gpio_probe+0xc2a/0xfc0 virtio_dev_probe+0xa7a/0xc50 Compute the size with struct_size() into a size_t. Fixes: 3a29355a22c0 ("gpio: Add virtio-gpio driver") Cc: stable@vger.kernel.org Signed-off-by: Lianjie Wang Acked-by: Viresh Kumar Link: https://patch.msgid.link/20261104195632.1702765-2-lian@is.s.u-tokyo.ac.jp Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 408ae5857fd399c09ff39e169263cbb39a5716f4 Author: Lianjie Wang Date: Thu Nov 5 04:56:31 2026 +0900 gpio: virtio: bound the line names block by its configured size commit 74aee8e06277df39ec10ed043bae0ed5b7a83864 upstream. virtio_gpio_get_names() walks the line names that the device returns in a block of gpio_names_size bytes, which the driver ends with a NUL, and checks each name only after stepping past it. If the block holds fewer than ngpio names, the walk reaches the end of the block after the last name, and the next iteration starts strlen() at the byte after the allocation. With a block that holds one name for four lines, KASAN reports: BUG: KASAN: slab-out-of-bounds in strlen+0x57/0x70 Read of size 1 at addr ffff8880026687c0 by task swapper/0/1 Call Trace: strlen+0x57/0x70 virtio_gpio_probe+0xcb4/0xfc0 virtio_dev_probe+0xa7a/0xc50 Allocated by task 1: devm_kmalloc+0x6e/0x280 virtio_gpio_probe+0xc06/0xfc0 The buggy address is located 0 bytes to the right of allocated 64-byte region [ffff888002668780, ffff8880026687c0) Check that a name starts inside the block before reading it. Fixes: 3a29355a22c0 ("gpio: Add virtio-gpio driver") Cc: stable@vger.kernel.org Signed-off-by: Lianjie Wang Acked-by: Viresh Kumar Link: https://patch.msgid.link/20261104195632.1702765-1-lian@is.s.u-tokyo.ac.jp Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit af9ead495614009ce08e81f7b35cfc7cf8aba719 Author: Bartosz Golaszewski Date: Tue Nov 10 14:47:02 2026 +0100 gpio: shared: use atomic set_bit() for descriptor flags commit 7d1d799d6251bc8cd1d5cfc881b0c09060b6b90d upstream. Use the atomic set_bit() instead of __set_bit() on desc->flags so that every modification of the field uses atomic bitops. No functional change as these run before any line of the chip can be requested. Cc: stable@vger.kernel.org Fixes: eb374f764a70 ("gpio: provide gpiod_is_shared()") Fixes: a060b8c511ab ("gpiolib: implement low-level, shared GPIO support") Reviewed-by: Kent Gibson Link: https://patch.msgid.link/20261110-gpio-desc-flags-atomic-v3-2-2f463bce8086@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 9dcd5cdcd1ab696006a135ccbf95b8349527a4aa Author: David Thompson Date: Fri Nov 13 13:44:44 2026 -0500 gpio: mlxbf2: Disable interrupts around the chip lock in direction ops commit f95bdff1d53471159e3c7112c5de4f6240772521 upstream. mlxbf2_gpio_lock_acquire() takes the generic GPIO chip lock with gpio_generic_chip_lock(), a plain raw_spin_lock() that leaves interrupts enabled. The same lock is also taken with the irqsave variant by the IRQ callbacks (irq_set_type, irq_enable, irq_disable), which run with the IRQ descriptor lock held. This creates a possible deadlock that lockdep reports as an IRQ lock inversion: CPU0 CPU1 ---- ---- lock(&chip->lock) lock(irq_desc->lock) lock(&chip->lock) lock(irq_desc->lock) If a GPIO interrupt arrives on CPU0 while it holds the chip lock during a direction change, the interrupt handler spins on the descriptor lock that CPU1 holds, while CPU1 spins on the chip lock held by CPU0. This was seen during probe of pwr-mlxbf. acpi_dev_gpio_irq_get() sets the pin to input through mlxbf2_gpio_direction_input(), and then irq_set_irq_type() runs with the descriptor lock held. Use the irqsave variant for the chip lock in mlxbf2_gpio_lock_acquire() and its release counterpart, and pass the saved flags from mlxbf2_gpio_direction_input() and mlxbf2_gpio_direction_output(). This matches the IRQ callbacks, so interrupts stay disabled for the whole ModeX update. Fixes: 2b725265cb08 ("gpio: mlxbf2: Introduce IRQ support") Cc: stable@vger.kernel.org Signed-off-by: David Thompson Link: https://patch.msgid.link/20261113184444.3431-1-davthompson@nvidia.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit 61fa9e1ca084f2b3ecaf3b51d0d5e8768f081e39 Author: Alexandre Becholey Date: Fri Nov 13 14:44:58 2026 +0000 gpio: ljca: Validate the pin index of interrupt events commit e6e2181c6920ff59ded349a100f80cf85d074601 upstream. ljca_gpio_event_cb() takes the pin index of every item in a GPIO interrupt event from the device and passes it to set_bit() on the reenable_irqs bitmap, which is only LJCA_MAX_GPIO_NUM (64) bits long. The index is a u8, so a malfunctioning or malicious device can set bits past the end of the bitmap, in the members that follow it in struct ljca_gpio_dev: the output_enabled bitmap, the connect_mode pointer and the irq_lock mutex. connect_mode is later dereferenced and written to by ljca_gpio_set_config() and ljca_irq_set_type(), so the device can flip bits of a kernel pointer that is then used for a write. Until commit 4c4e6ea4a120 ("gpio: ljca: Fix duplicated IRQ mapping") an index without an IRQ mapping made irq_find_mapping() fail and the handler returned before set_bit(). Since that change nothing checks the index. A device bound to usb-ljca can trigger this by sending one GPIO interrupt event, once the gpiochip is registered, with an index that sets a bit of connect_mode which is still clear in a kernel pointer: 175 (bit 47) on arm64, 174 (bit 46) on x86_64. The next GPIO line request then faults in ljca_gpio_set_config(). With dummy_hcd and KASAN, on arm64 (torvalds/master 067c5c24cef2): Unable to handle kernel paging request at virtual address ffff7000023dfd30 pc : ljca_gpio_set_config (drivers/gpio/gpio-ljca.c:212) and on x86_64 (torvalds/master 7e1392a42ea2, nokaslr): BUG: unable to handle page fault for address: ffffc8800f5452b8 RIP: 0010:ljca_gpio_set_config (drivers/gpio/gpio-ljca.c:212) Ignore event items whose pin index is not below the number of GPIOs of the chip. That number never exceeds LJCA_MAX_GPIO_NUM, because usb-ljca rejects larger values at enumeration, so set_bit() stays inside the bitmap. Valid items in the same event are still handled. The bug was found by AI agents (Claude Mythos and Claude Opus models). The analysis and the patch were reviewed by a human, who also reproduced the bug on x86_64 and aarch64 with current master. Fixes: 4c4e6ea4a120 ("gpio: ljca: Fix duplicated IRQ mapping") Cc: stable@vger.kernel.org Signed-off-by: Alexandre Becholey Link: https://patch.msgid.link/20261113144432.1354180-1-alex@becholey.ch Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit d486575d9c44ac8abcf43283cf97ceb98f8803e4 Author: Bartosz Golaszewski Date: Tue Nov 10 14:47:05 2026 +0100 gpio: cdev: don't overwrite the whole flags field when configuring lines commit fa8bc4aa06674e78a4ee702966419aa4fdd8dc94 upstream. linehandle_flags_to_desc_flags() and gpio_v2_line_config_flags_to_desc_flags() read the flags word with READ_ONCE(), modify the local copy and write it back with WRITE_ONCE(). The per-request config_mutex does not exclude sysfs, the irq core or drivers touching the same descriptor, so bits they set or clear concurrently can be lost. Build the mask of bits owned by the line configuration and their new values locally and apply them with gpiod_update_flags(). The whole group changes in a single atomic step. While at it: rename the functions whose semantics changed from "conversion" to "flags update" accordingly. Cc: stable@vger.kernel.org Fixes: b7adfb6076ff ("gpio: cdev: update flags at once when reconfiguring from user-space") Reviewed-by: Kent Gibson Link: https://patch.msgid.link/20261110-gpio-desc-flags-atomic-v3-5-2f463bce8086@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman commit aeb5671e6a2f4045400f2a7c465909f44be5b7d1 Author: Junyoung Jang Date: Tue Nov 17 22:51:35 2026 +0900 fuse: skip dcache instantiation for readdirplus names with embedded NUL commit ae932b1f5727004f585d603e0cbab7e0725c04cf upstream. FUSE READDIRPLUS can pass a length-bearing qstr with an embedded NUL to d_splice_alias(). Unlike verify_dirent_name() in fs/readdir.c, this path can create a dentry whose d_name.len extends past the NUL. For such a name, strscpy() in inotify_handle_inode_event() and the fanotify name-copy helpers stop early. The kmalloc() and kvmalloc() event-name buffers retain uninitialized bytes within the recorded name length, which copy_event_to_user() and copy_fid_info_to_user() can expose. Some FUSE servers include a terminating NUL in namelen. Follow nfs_prime_dcache() in commit 78d04af4995a1 ("NFS: nfs_prime_dcache must validate the filename") by skipping dcache instantiation without failing getdents(). Return -EIO from fuse_direntplus_link() so parse_dirplusfile() sends FUSE_FORGET for the unused lookup reference and continues readdir. Fixes: 0b05b18381ee ("fuse: implement NFS-like readdirplus support") Cc: stable@vger.kernel.org Co-developed-by: Gwanhyun Lee Signed-off-by: Gwanhyun Lee Signed-off-by: Junyoung Jang Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman commit 239a7d535a13a303fdf0d8ccea676c9bebbd49c5 Author: Leon Ming Date: Wed Oct 28 20:37:00 2026 -0700 fuse: set dentry epoch before making the dentry visible commit fea42fae07822cd717ba4b3082834bb5908bf911 upstream. fuse_lookup(), create_new_entry(), fuse_create_open() and fuse_direntplus_link() set the dentry epoch only after d_splice_alias() or d_instantiate() has made the dentry visible. A new dentry starts at epoch 0 and the connection at epoch 1, so in that window a concurrent lookup can find the dentry, fail fuse_dentry_revalidate() and d_invalidate() it. The original lookup then returns an unhashed dentry, and readlink() of /proc/self/fd/N on an O_PATH fd for it says " (deleted)" for a file that exists. Anything that resolves real paths with open(O_PATH) + readlink() can pick up the bogus path; TypeScript's native compiler (tsgo) intermittently fails to find installed packages this way. It got much more common after commit 5a6baf204610 ("fuse: fix uninit-value in fuse_dentry_revalidate()") zeroed the initial epoch; before that, slab garbage usually passed the check. Set the epoch before the dentry is published, and keep setting it on any alias that d_splice_alias() returns; the dentry that loses to an alias is dropped without ever being visible, so setting it too is harmless. With 32 processes making concurrent first lookups of 6000 files on a fresh squashfuse_ll mount (UML, 16 CPUs), 1652 of 10.75M lookups came back "(deleted)" before this patch and none after. Fixes: 2396356a945b ("fuse: add more control over cache invalidation behaviour") Cc: stable@vger.kernel.org Signed-off-by: Leon Ming Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman commit 6483ed325599f42a101704e1446a01741e796903 Author: Miklos Szeredi Date: Fri Nov 20 11:33:01 2026 +0100 fuse: limit name size in listxattr commit 7f7b822d09c5590defcc61a37ffbd5a3533ed518 upstream. Limit the size of names to XATTR_NAME_MAX. Return -EIO to the listxattr() caller if the server exceeds this limit. Fixes: 92a8780e1136 ("[PATCH] FUSE - extended attribute operations") Cc: stable@vger.kernel.org Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman commit f605929a6cba99c71c5f2da575f084f99e8f51c5 Author: Miklos Szeredi Date: Mon Nov 2 15:11:04 2026 +0100 fuse: fix possible UAF in fuse_direntplus_link() commit 9191c2c1a76a759ac97be72481fdd4f9e920c902 upstream. In fuse_direntplus_link() a use-after-free occurs on struct fuse_inode when linking a newly allocated in-lookup dentry during FUSE_READDIRPLUS processing fails inside d_splice_alias(). When d_in_lookup(dentry) is true, fuse_iget() returns an inode with an incremented reference count and fi->nlookup, which is then passed to d_splice_alias(). Inside d_splice_alias_ops(), if the directory inode has an existing alias and splicing fails with -ELOOP in d_ancestor() or -ESTALE in __d_unalias(), the function drops the alias reference via dput(new) and unconditionally consumes the caller's inode reference via iput(inode) before returning the error pointer. If the existing alias is concurrently unhashed and dropped, iput(inode) drops the final inode reference and evicts the inode immediately via fuse_evict_inode(), sending a FUSE_FORGET request for fi->nlookup and freeing struct fuse_inode via RCU. Because fuse_direntplus_link() subsequently checks !IS_ERR(inode) outside an RCU read-side critical section, it dereferences the freed inode to acquire fi->lock and decrement fi->nlookup, and its caller parse_dirplusfile() then invokes fuse_force_forget() on the error return, issuing a duplicate FUSE_FORGET request to the server. Fixes: b8bd342d50cb ("fuse: nlookup missing decrement in fuse_direntplus_link") Cc: stable@vger.kernel.org #v6.6+ Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-0a00a32c-3732-46fe-9cdb-3c67a11903cc Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman commit 281021e4805f7d7dd1c54b1e2cb84a9738642719 Author: Hungyu Lin Date: Tue Nov 3 08:34:25 2026 +0000 fuse: clear the old EOF tail before writeback-cache writes commit d9013d15b9379b323f1bcdfff7e7d96df537268a upstream. Buffered writeback-cache writes go through iomap_file_buffered_write(), but do not clear cached data between the old EOF and the write position. If a shared mapping dirtied the tail of the old EOF page, an extending write can expose those bytes as file contents instead of zeros. A later writeback can also send them to the server. Clear the gap under the existing inode lock before the buffered write. Use the same page-cache cleanup as fuse_perform_write() does for write-through writes, leaving the write range itself untouched. Fixes: 4d99ff8f12eb ("fuse: Turn writeback cache on") Cc: stable@vger.kernel.org Signed-off-by: Hungyu Lin Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman commit b5d211945d930fb8457ea10b2ce3256b9e16372b Author: Weiming Shi Date: Mon Oct 26 08:46:05 2026 -0700 fbdev: vfb: Validate framebuffer geometry and memory size commit b438bb88f65a8b464ad08057873db9605cdae945 upstream. FBIOPUT_VSCREENINFO can supply a virtual width large enough to overflow get_line_length()'s int multiplication and bypass the video-memory limit, allowing fbcon to write past the framebuffer. The offset additions can also wrap, while an excessive videomemorysize module parameter can be truncated when PAGE_ALIGN() is assigned to unsigned int. Limit virtual geometry and offsets to 8192 x 8192 and cap video memory at 512 MiB, keeping the stride, framebuffer-size, and generic fbdev drawing calculations within their destination types. KASAN reports: BUG: KASAN: vmalloc-out-of-bounds in sys_fillrect drivers/video/fbdev/core/sysfillrect.c:24 Write of size 8 at addr ffa0000001671000 by task poc/198 sys_fillrect drivers/video/fbdev/core/sysfillrect.c:24 bit_clear_margins drivers/video/fbdev/core/bitblit.c:247 fbcon_clear_margins.constprop.0 drivers/video/fbdev/core/fbcon.c:1410 fbcon_switch drivers/video/fbdev/core/fbcon.c:2261 redraw_screen drivers/tty/vt/vt.c:994 fbcon_modechanged drivers/video/fbdev/core/fbcon.c:2693 fbcon_update_vcs drivers/video/fbdev/core/fbcon.c:2732 Cc: stable@vger.kernel.org Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: co+b0df61d49532b2ee@bugs.sh Suggested-by: Helge Deller Assisted-by: LLM Signed-off-by: Weiming Shi Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit 5cec9b0e3f7f8b0f2fced1019ae59ea1bc82c143 Author: Tim Douglas Date: Tue Nov 17 20:58:59 2026 -0500 fbdev: valkyriefb: keep the framebuffer mapping size fixed commit fa9bebccf45571bd710b0591359b28d5354e7e7a upstream. When /dev/fb0 is mapped before a depth change, as with Xorg's fbdev driver, the mapping may be too short for the new mode. At 640x480, a full frame at 16 bpp is 600 KiB, so drawing it through the original 300 KiB mapping from 8 bpp can fault. Set smem_len to the usable video RAM by subtracting the 4 KiB offset already applied to smem_start, then keep that size across mode changes. On a Performa 6200CD using a kernel with local platform support, a write past the mapping caused a fault during an Xorg test at 16 bpp. With the corrected mapping size in the test kernel, twm and xterm were displayed successfully in Xorg at 640x480 and 16 bpp. In a test on a Quadra 630 in MAME with Linux v7.4-rc3, /dev/fb0 was mapped at 8 bpp and the depth was changed to 16 bpp with the original mapping still in place. A SIGSEGV was reported during the 16 bpp draw before the fix, and all 480 lines were drawn afterward. AI assistance was used to investigate the mapping size and draft the fix. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Tim Douglas Cc: stable@vger.kernel.org Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit e4f25ecf9018bdbc2b5f028a147804270efbb01c Author: Xue Haolin Date: Tue Nov 17 11:17:14 2026 +0800 fbdev: sstfb: Error out if pixclock equals zero commit f37d206e145d25607c6a8e920d7bb643d203a1f7 upstream. The userspace program could pass any values to the driver through ioctl() interface. If the driver doesn't check the value of pixclock, it may cause divide-by-zero error. sstfb_check_var() calls PICOS2KHZ(var->pixclock) which expands to 1000000000UL / var->pixclock. If var->pixclock is zero, this causes a divide-by-zero exception. Fix this by checking whether pixclock is zero at the beginning of sstfb_check_var(), before it is used as a divisor. This is similar to CVE-2022-3061 in i740fb which was fixed by commit 15cf0b82271b ("video: fbdev: i740fb: Error out if 'pixclock' equals zero"), and the fix in savagefb by commit 04e5eac8f3ab ("fbdev: savage: Error out if pixclock equals zero"). Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Xue Haolin Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit ad5748202d3035b1aa8a46932d5592b7412d9330 Author: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Date: Mon Nov 2 16:57:24 2026 +0800 fbdev: smscufx: keep the usb_device alive while ufx_data is in use commit e8645fe7419828fd95a90171149c565c1bb72911 upstream. ufx_usb_probe() stores the usb_device pointer in dev->udev without taking a reference, and ufx_usb_disconnect() does not wait for in-flight control transfers. A mode set or blank request that runs while the device is being unplugged - through ufx_ops_set_par() or ufx_ops_blank() on an open /dev/fbN file - keeps issuing synchronous control messages for the whole ufx_set_vid_mode() sequence, including two msleep(1) delays in ufx_config_pix_clk(). Once the disconnect callback returns, the USB core may release the usb_device, and the next ufx_reg_write()/ufx_reg_read() dereferences dev->udev through __create_pipe(): general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] SMP KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037] RIP: __create_pipe include/linux/usb.h:2031 Call Trace: ufx_set_vid_mode ufx_ops_set_par fb_set_var fb_set_var_from_user store_rotate Take a reference to the usb_device in ufx_usb_probe() and drop it in ufx_free(), so dev->udev and dev->gdev stay valid until the last ufx_data user is gone. The control transfers then fail with -ENODEV instead of dereferencing freed memory. Also return early from ufx_set_vid_mode() while the device is inactive, matching the other transmit paths. That check alone is not enough, because it is not serialized against ufx_usb_disconnect() and the transfer sequence continues after it; it only avoids a long series of failing transfers. Fixes: 3c8a63e22a08 ("Add support for SMSC UFX6000/7000 USB display adapters") Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Cc: stable@vger.kernel.org Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit 9b475df6ac3a4c23bf5b44adf2ac2f3962d20702 Author: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Date: Mon Nov 2 16:48:30 2026 +0800 fbdev: smscufx: don't free registered framebuffer on probe error commit ed52e47133f72195f246a9f70c98e47431bb566d upstream. register_framebuffer() can return an error after the framebuffer has already been installed: do_register_framebuffer() bumps info->count, creates /dev/fbN and stores the fb_info in registered_fb[] before it returns the result of the console takeover, and that takeover may fail. ufx_usb_probe() treats any error as "nothing was registered" and unwinds through reset_active, which releases the fb_info and drops both references to struct ufx_data, freeing @dev. The framebuffer stays registered and can still be opened, so the next open() of /dev/fbN reaches ufx_ops_open() with info->par pointing at freed memory: refcount_t: addition on 0; use-after-free. WARNING: lib/refcount.c:25 at refcount_warn_saturate Call Trace: kref_get ufx_ops_open drivers/video/fbdev/smscufx.c:1033 fb_open drivers/video/fbdev/core/fb_chrdev.c:351 chrdev_open ... refcount_t: underflow; use-after-free. WARNING: lib/refcount.c:28 at refcount_warn_saturate Call Trace: ufx_ops_release drivers/video/fbdev/smscufx.c:1135 fb_release drivers/video/fbdev/core/fb_chrdev.c:378 __fput Reuse the "has this fb_info been registered" test that ufx_setup_modes() already uses: take the error path only when refcount_read(&info->count) says the core did not register the framebuffer. A failed console takeover is not fatal for the driver, so report it and keep the framebuffer registered; the disconnect callback will unregister it normally. Fixes: 3c8a63e22a08 ("Add support for SMSC UFX6000/7000 USB display adapters") Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Cc: stable@vger.kernel.org Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit 02510983258d5d8371507c93c47e469a0261eff1 Author: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Date: Mon Nov 2 17:29:25 2026 +0800 fbdev: smscufx: allocate the size advertised in smem_len commit ae14fe6f367a9779e108449b4af41791bd6aaa47 upstream. ufx_realloc_framebuffer() allocates line_length * yres bytes but records PAGE_ALIGN(line_length * yres) in info->fix.smem_len. ufx_ops_set_par() clears the framebuffer by writing smem_len bytes, so the write runs past the end of the vmalloc() allocation whenever the mode size is not page aligned: BUG: KASAN: vmalloc-out-of-bounds in ufx_ops_set_par Write of size 2 at addr ffffc90005518600 Call Trace: ufx_ops_set_par ufx_usb_probe usb_probe_interface This runs from the probe path, before any client can open the device: with the fallback mode of 800x600 at 16 bpp the framebuffer is 960000 bytes and PAGE_ALIGN() adds 2560 bytes that were never allocated. Allocate the page aligned size that is published in smem_len instead, so the buffer covers every byte the driver and the framebuffer core can reach through smem_start and smem_len. Fixes: 3c8a63e22a08 ("Add support for SMSC UFX6000/7000 USB display adapters") Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Cc: stable@vger.kernel.org Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit de5e817f13620cd4e6454e3eb971c02dc9af972f Author: Jianqiang Zou Date: Sun Nov 1 10:41:42 2026 +0000 fbdev: radeonfb: reject a zero pixclock in radeonfb_check_var() commit b3f1631d362539cfe14571ccfd7db919ffbc08c7 upstream. radeonfb_set_par() derives the dot clock from the user supplied struct fb_var_screeninfo: dotClock = 1000000000 / pixClock; where pixClock is copied from mode->pixclock. A zero pixclock bypasses the existing validation and makes the kernel divide by zero in radeonfb_set_par(). The driver does have a check for this: fb_validate_mode() returns -EINVAL when pixclock is 0, but radeon_match_mode() only calls it when the output has no scaler and an EDID-derived mode database is available: if (has_rmx == 0 && rinfo->mon1_modedb) if (fb_validate_mode(...)) return -EINVAL; mon1_modedb is only filled in when an EDID is read, so when no EDID-derived mode database is available the validation is skipped and the invalid mode reaches radeonfb_set_par(). Reject a zero pixclock in radeonfb_check_var() before matching the mode. fb_set_var() calls it on the FBIOPUT_VSCREENINFO path before ->fb_set_par(), so the invalid value is rejected before the mode is applied. This is the same check other fbdev drivers use (i740fb, arkfb, s3fb). Reproduced on Linux 7.3.0 using a custom QEMU PCI stub device with vendor/device ID 1002:5955; no physical Radeon hardware was used. A single FBIOPUT_VSCREENINFO with pixclock = 0 is enough to trigger the divide error. Signed-off-by: Jianqiang Zou Cc: stable@vger.kernel.org Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit 6e214be28008f9e567a4a0dfdfa49de06d798340 Author: Tim Douglas Date: Tue Nov 17 20:25:57 2026 -0500 fbdev: macmodes: compare the pixel clock of each candidate mode commit 3e973ab62c86d620b2db9e90eb8fc3b065929e6e upstream. In the second pass through the mode table in mac_var_to_vmode(), the requested pixel clock period was compared with the first mode's period at every step. The last mode at that resolution was therefore returned even when its period was too short. Compare against the current candidate's period. Tested on a Performa 6200CD using a kernel with local platform support. With video=valkyriefb:vmode:10 (800x600 at 60 Hz), the measured refresh rate was about 72 Hz before the fix and 60 Hz afterward. At 640x480, 67 Hz was also selected for a 60 Hz request before the fix. AI assistance was used to investigate the mode-table walk and draft the fix. Signed-off-by: Tim Douglas Fixes: d876c11a0fd4 ("fbdev: mac_var_to_mode() fix") Cc: stable@vger.kernel.org Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit 43a8f0f520210f44c431734f0e76b806dbe050df Author: Steffen A. Mork Date: Sun Nov 1 15:13:27 2026 +0100 fbdev: fm2fb: Fix iomem access commit 7d4a8a804cd1a3bcaa1a9a38e87517ead3130ca1 upstream. This driver has not been tested for at least twenty years. In the meantime, the frame buffer API has been updated. This patch addresses this issue and makes the driver functional again. Signed-off-by: Steffen A. Mork Cc: stable@vger.kernel.org Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit 42663aa34cbf1fb1b9ba3f8f068ae88edbcc77f2 Author: Suyuan Wang Date: Wed Nov 18 14:07:31 2026 +0000 fbdev: cobalt_lcdfb: Don't read info after framebuffer_release() commit 2c8b0da3209955b42280ef60d8e0470dc788c0d8 upstream. When devm_platform_get_and_ioremap_resource() fails, cobalt_lcdfb_probe() releases the framebuffer and then dereferences it for the return value: framebuffer_release(info); return PTR_ERR(info->screen_base); framebuffer_release() frees info, so info->screen_base is read from freed memory. Save the error code before releasing info. Found with a static analysis tool and checked by hand. Fixes: d2386d9e3eb4 ("fbdev: cobalt_lcdfb: Request memory region") Cc: stable@vger.kernel.org Co-developed-by: Kaixuan Li Signed-off-by: Kaixuan Li Signed-off-by: Suyuan Wang Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit 91ed2027a44fb62e157de151a60f7ac1befdcc82 Author: Miro Kropacek Date: Fri Nov 13 10:56:16 2026 +1000 fbdev: atafb: Restrict SuperVidel handling to the Falcon commit f0486dd91e27d2eaf62abbd0c2af73a9c04eac48 upstream. A framebuffer at 0xa0000000 or above is taken as being in SuperVidel RAM. A TT with a VME graphics card such as the Nova has its framebuffer there too, so in 8bpp it gets the Falcon palette registers instead of the card's VGA DAC, and in 8, 16 and 32bpp the SuperBlitter, which it does not have. The SuperVidel exists only for the Falcon, so check for the Falcon video hardware as well. Fixes: 51df976c3268 ("fbdev: atafb: Add support for further video bit depths on atafb:external") Fixes: d463633d63e6 ("fbdev: atafb: Add support for SuperVidel's SuperBlitter") Cc: stable@vger.kernel.org # v7.3+ Reported-by: Christian Zietz Signed-off-by: Miro Kropacek Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit 014cf2bd31612766ac42169d8151d627e3e517ab Author: Eric Biggers Date: Tue Nov 10 13:20:11 2026 -0800 fscrypt: Initialize ->ci_master_key before publication commit 2de253924266eeedb798fb662173726c90b0cf04 upstream. fscrypt_prepare_setflags() assumes that if the key for an inode with a v2 encryption policy has been set up, then ->ci_master_key is non-NULL. This is a reasonable assumption, but it does not take into account the very short gap in fscrypt_setup_encryption_info() between the inode's fscrypt_inode_info being set and ->ci_master_key being initialized. Thus, a NULL pointer dereference was possible. Fix this by closing the gap: make fscrypt_setup_encryption_info() initialize ->ci_master_key before publication. If it loses the cmpxchg race afterwards, set it back to NULL so that put_crypt_info() continues to have the same behavior. Fixes: b1c0ec3599f4 ("fscrypt: add FS_IOC_REMOVE_ENCRYPTION_KEY ioctl") Cc: stable@vger.kernel.org Reported-by: Ada Smith Link: https://patch.msgid.link/20261110212011.35487-1-ebiggers@kernel.org Signed-off-by: Eric Biggers Signed-off-by: Greg Kroah-Hartman commit 669f757f0528a62915dd992f3c2b5d1783491e41 Author: Breno Leitao Date: Thu Nov 12 07:18:42 2026 -0800 fgraph: Do not mark index 0 in every shadow stack frame commit 65f42f1fa03829e0ab1473369461a7aabf525cb2 upstream. We are seeing this warning on an arm64 host: WARNING: kernel/trace/fprobe.c:676 at fprobe_return+0x260/0x2c8, CPU#16: FuncSched/3281330 Call trace: fprobe_return+0x260/0x2c8 (P) ftrace_return_to_handler+0x2bc/0x5a8 return_to_handler+0x20/0x48 futex_wait+0xa4/0x218 do_futex+0xb4/0x1d0 __arm64_sys_futex+0x15c/0x278 The theory is that function_graph_enter_regs() sets BIT(0) in the bitmap of every frame, a leftover of an old tail-call check, while the return path calls the retfunc of every set bit. A reproducer on linux-next supports the theory. On a fresh boot, with no other fgraph user yet: cd /sys/kernel/tracing echo 'f:fpexit vfs_read%return' >> dynamic_events echo 1 > events/fprobes/fpexit/enable # fprobe_graph_ops: index 0 echo vfs_write > set_ftrace_filter echo function_graph > current_tracer # function_graph: index 1 echo x > /dev/null # WARN on vfs_write return Removing the bit was agreed in the review of the series that added it [0], but the line stayed. Drop it now. [0] https://lore.kernel.org/all/20240527093436.7060d358a64cc2ea3213b07b@kernel.org/ Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261112-fgraph-bit0-v1-1-695ad14f4b1e@debian.org Fixes: 7aa1eaef9f42 ("function_graph: Allow multiple users to attach to function graph") Signed-off-by: Breno Leitao Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 358c5740958729b69687b14ff2106962f429009d Author: Vineet Gupta Date: Wed Oct 21 10:44:05 2026 -0700 fgraph: Allocate shadow stacks inline with GFP_NOWAIT commit 700e5c063fd765fd09c1007ec8a927bddd82798b upstream. When ftrace graphing is turned on, all tasks in the system missing return stack page are assigned one. This is done in a simplistic multi-sweep loop of FTRACE_RETSTACK_ALLOC_SIZE (currently 32) tasks at a time as follows: start_graph_tracing() do { alloc_retstack_tasklist } while (-EAGAIN); alloc_retstack_tasklist() alloc x32 # GFP_KERNEL, may sleep rcu_read_lock() # preempt off for_each_process_thread walk N_total, no cond_resched t->ret_stack = new_page rcu_read_unlock() # preempt enable but no explicit yield Each successive iteration of loop invokes for_each_process_thread() which doesn't support cursor based resume and always restarts from the init_task. Thus each successive loop needs to skip the tasks assigned ret_stack in prior sweeps and thus take longer and longer to find the candidate 32 tasks. And while the loop end calls rcu unlock, and re-enables preemption briefly, there is no explicit yield. The total number of iterations turn out to be N_total * N_null / (2 * FTRACE_RETSTACK_ALLOC_SIZE) where N_total is the number of threads on the system and N_null the number of those whose ret_stack is still NULL. After boot with no fgraph user that is every thread. This is not a tracing-only path. Since commit 4346ba160409 ("fprobe: Rewrite fprobe on function-graph tracer") fprobe is built on fgraph, so an ordinary kprobe_multi BPF attach that flips ftrace_graph_active from 0 to 1 pays the whole cost inside one bpf() syscall. Commit 2c67dc457bc6 ("tracing: fprobe: optimization for entry only case") narrows that to return and session probes but does not remove it. A host running hundreds of thousands of threads, with the current batch size of 32, turns the ftrace_graph_active 0 -> 1 transition into a multi-second, and eventually multi-minute, operation which showed up as RCU stall and softlockup_panic on heavily loaded Meta Fleet machines with preemption disabled. rcu: INFO: rcu_sched self-detected stall on CPU rcu: 0-....: (20718 ticks this GP) (t=21000 jiffies g=913 q=8 ncpus=8) CPU: 0 UID: 0 PID: 160141 Comm: bpftrace ___slab_alloc+0x549/0xa20 kmem_cache_alloc_noprof+0x16c/0x340 register_ftrace_graph+0x3d7/0x6c0 register_fprobe_ips+0x2d5/0x310 bpf_kprobe_multi_link_attach+0x218/0x7e0 __sys_bpf+0x267a/0x27a0 Fix this by allocating inline with GFP_NOWAIT instead of pre-allocating a fixed batch. GFP_NOWAIT does not sleep, so it is legal inside the RCU read-side critical section. A single sweep now serves every task, so the walk becomes O(N) rather than O(N_total * N_null), and the retry loop is no longer the normal path. The pre-allocated array remains as the fallback when GFP_NOWAIT fails. The runs below never needed it, so it was exercised with failslab injection: at a 100% failure rate every task falls back and -EAGAIN retries ~1560 times for 50000 threads, with no stall or splat. smp_store_release() is a drop-in replacement for the smp_wmb() and plain store it replaces. Measured on a 60-core Sapphire Rapids machine running a PREEMPT_LAZY kernel (CONFIG_PREEMPT_DYNAMIC=y, mode lazy), timing the write that drives the ftrace_graph_active 0 -> 1 transition. Threads are spawned while fgraph is inactive so every one of them has ret_stack == NULL, and the loop was instrumented to count sweeps: threads before after sweeps time sweeps time 100000 3126 15.3 s 1 0.019 s 200000 6253 59.1 s 1 0.047 s 400000 12503 227.8 s 1 0.092 s The sweep count is 1 throughout. Time now scales linearly with the thread count at roughly 230 ns per task, which is the allocation and initialisation of one shadow stack. Fixes: f201ae2356c7 ("tracing/function-return-tracer: store return stack into task_struct and allocate it dynamically") Suggested-by: Peter Zijlstra Signed-off-by: Vineet Gupta Tested-by: Vineet Gupta Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261021174406.2891598-2-vineet.gupta@linux.dev Acked-by: Andrii Nakryiko Acked-by: Masami Hiramatsu (Google) Signed-off-by: Steven Rostedt Signed-off-by: Greg Kroah-Hartman commit 57c76b3a32f5ba8617e43faca6eaa3e8ce6e015e Author: Yao Yiqi Date: Tue Nov 10 21:59:59 2026 +0800 fbcon: Avoid cancel_delayed_work_sync() in atomic context commit b3a3f241dace3d4a775e1401b53a3f6d304534f0 upstream. fbcon_cursor() can be reached from the console printing path, which runs in atomic context. When the VT software cursor is enabled (vc_cursor_type & CUR_SW), it calls fbcon_del_cursor_work(), which uses cancel_delayed_work_sync() and therefore may sleep. With CONFIG_DEBUG_ATOMIC_SLEEP enabled, the following is reported: BUG: sleeping function called from invalid context at kernel/workqueue.c:4722 in_atomic(): 1, irqs_disabled(): 1, non_block: 0 ... __cancel_work_sync fbcon_del_cursor_work fbcon_cursor hide_cursor vt_console_print console_unlock ... Make the default helper safe: fbcon_del_cursor_work() only stops blinking, using cancel_delayed_work(), which is allowed in any context. Every "stop blinking" call site keeps using it, including fbcon_cursor(). Only fbcon_release(), which is about to free @par and must ensure that no callback is still using it, calls the separate fbcon_del_cursor_work_sync(). New call sites therefore get the safe variant by default. cancel_delayed_work() does not wait for a callback that is already running. Since fb_flashcursor() re-arms itself, a callback that has already been dequeued by process_one_work() can queue the work again after fbcon_del_cursor_work() returns. Add a cursor_blink_on flag to struct fbcon_par: fbcon_add_cursor_work() sets it, fbcon_del_cursor_work() clears it, and fb_flashcursor() checks it after taking console_lock and returns without drawing or re-arming once blinking has been stopped. Keep the requeue inside the console_lock section so that the flag check and the requeue are not split by a concurrent stop. Fixes: 3b0fb6ab25dd ("fbcon: Use delayed work for cursor") Cc: stable@vger.kernel.org Assisted-by: Opencode:deepseek-v4.1-flash Signed-off-by: Yao Yiqi Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman commit e5e36d82f58848d611deaf8bb3370ef730eb7d0a Author: Sang-Heon Jeon Date: Fri Nov 6 01:01:58 2026 +0900 fault-inject: fix boot failure with fault injection boot parameters commit 27538caf7f72ce93be9c352148dba4f2274cf300 upstream. Since commit e9bc360b105c ("fault-inject: use prandom where cryptographically secure randomness is not needed"), setup_fault_attr() calls prandom_init_once(), which calls kmalloc() and schedule_work(). But setup_fault_attr() can be called from __setup handlers before slab and workqueues are initialized, so any fault injection boot parameter leads to boot failure. So use DO_ONCE_LITE() instead. Link: https://lore.kernel.org/20261105160209.1504867-1-ekffu200098@gmail.com Fixes: e9bc360b105c ("fault-inject: use prandom where cryptographically secure randomness is not needed") Signed-off-by: Sang-Heon Jeon Signed-off-by: Andrew Morton Reviewed-by: Akinobu Mita Cc: Signed-off-by: Greg Kroah-Hartman lib/fault-inject.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) commit 7f6b618132c045a90b6f4e4787aef880ed5041d4 Author: Aristeu Rozanski Date: Thu Nov 12 10:11:20 2026 -0800 EDAC/i5000: Fix slot number passed to determine_mtr() commit a088b092a8962db62327690ae2d0d68827e81229 upstream. When the logic mapping branch/slot/channel was reworked back in 64e1fdaf55d6 ("i5000_edac: Fix the logic that retrieves memory information") i5000_init_csrows() was not updated and kept passing twice the number of slots to determine_mtr(), which leads to accessing past the end of i5000_pvt.b1_mtr[]. This was found by KASAN. Fixes: 64e1fdaf55d6 ("i5000_edac: Fix the logic that retrieves memory information") Signed-off-by: Aristeu Rozanski Signed-off-by: Andrew Luebke Signed-off-by: Borislav Petkov (AMD) Tested-by: Andrew Luebke Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/20220921181009.oxytvicy6sry6it7@redhat.com Signed-off-by: Greg Kroah-Hartman commit 90b0f1f09b3e95c1148c2d9ac7f7135454df7e25 Author: Marek Szyprowski Date: Mon Oct 26 10:54:13 2026 +0100 dma: swiotlb: Serialize restricted DMA pool initialization commit 7ad92b81b415de806957b19828fc4777a9cf2216 upstream. Multiple devices can share the same restricted DMA pool, in which case the io_tlb_mem structure is allocated and initialized by the first device attached to it and stored in rmem->priv. To avoid the potential race, serialize the check and initialization of rmem->priv with a mutex. Fixes: 0b84e4f8b793 ("swiotlb: Add restricted DMA pool initialization") Closes: https://sashiko.dev/#/bug/linux-6fda7589-591d-4a68-b6e1-b1561f867319 Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20261026095423.966856-3-m.szyprowski@samsung.com Signed-off-by: Marek Szyprowski Signed-off-by: Greg Kroah-Hartman commit a3e4f06c394bc7a4dc7b004ae5b79d674c6a220f Author: Marek Szyprowski Date: Tue Nov 3 16:50:15 2026 +0100 dma: swiotlb: Round restricted DMA pool size down to IO_TLB_SEGSIZE commit 5b4b87935bf9c6c81b603558c2e167fc27c22a1b upstream. All other paths creating a swiotlb pool ensure that nslabs is a multiple of IO_TLB_SEGSIZE, and the swiotlb code relies on that. Since commit 0b84e4f8b793 ("swiotlb: Add restricted DMA pool initialization") a restricted pool can have an arbitrary size taken from the device tree. If the pool size is not a multiple of IO_TLB_SEGSIZE, the last segment is partial and swiotlb_release_slots() reads mem->slots[index + nslabs], which is one past the end of the slots array when the freed buffer ends at the end of the pool: BUG: KASAN: slab-out-of-bounds in swiotlb_release_slots Read of size 2 Round the pool size down to a multiple of IO_TLB_SEGSIZE, wasting a bit of memory, and warn about it. Reported-by: Giorgi Kobakhia Closes: https://lore.kernel.org/all/20261026032007.1957949-1-gkobakhi@asu.edu/ Fixes: 0b84e4f8b793 ("swiotlb: Add restricted DMA pool initialization") CC: stable@vger.kernel.org Reviewed-by: Michael Kelley Link: https://lore.kernel.org/r/20261103155016.1107958-1-m.szyprowski@samsung.com Signed-off-by: Marek Szyprowski Signed-off-by: Greg Kroah-Hartman commit 9893f37b4b71b68663ca67d781761a2567cfc54f Author: Marek Szyprowski Date: Mon Nov 9 18:06:02 2026 +0100 dma: swiotlb: Properly tear down the default pool on exit commit 7d4a177d0d9bc0ca04caec9293ccb902a853cc47 upstream. With CONFIG_SWIOTLB_DYNAMIC enabled, the default memory pool is added to the io_tlb_default_mem.pools RCU list during initialization. When an IOMMU takes over DMA translation, swiotlb_exit() tears the default pool down and clears it with memset(), but leaves its node on the pools list. The list then contains a zeroed entry with a NULL next pointer, and any later walk of the list, for example mem_used() when reading the io_tlb_used debugfs file, dereferences an invalid pointer and crashes. swiotlb_exit() also leaves the io_tlb_default_mem fields that describe the pool. io_tlb_default_mem.nslabs and can_grow stay set, so is_swiotlb_allocated() and is_swiotlb_active() keep returning true, and swiotlb_find_slots() can schedule dynamic pool allocation after teardown. Without CONFIG_SWIOTLB_DYNAMIC, a later mapping can reach the zeroed defpool and hit BUG_ON(area_index >= pool->nareas). Before the pool data was split out of struct io_tlb_mem, swiotlb_exit() cleared the whole structure, including nslabs. Clear can_grow and cancel any pending dyn_alloc work, then remove the default pool from the list and subtract its slots from nslabs, and wait for an RCU grace period before clearing it, so that no reader can still see it. Without CONFIG_SWIOTLB_DYNAMIC, reset nslabs directly. As a result, with CONFIG_SWIOTLB_DYNAMIC swiotlb no longer silently keeps working through dynamic or transient pools after an IOMMU has turned it off, so for example dma-iommu bouncing for untrusted devices reports that bounce buffers are inactive, as it did before the dynamic pools support. Fixes: 158dbe9c9a3d ("swiotlb: separate memory pool data from other allocator data") Fixes: 62708b2ba405 ("swiotlb: add a flag whether SWIOTLB is allowed to grow") Fixes: 1aaa736815eb ("swiotlb: allocate a new memory pool when existing pools are full") Closes: https://sashiko.dev/#/bug/linux-f75998aa-65ea-4596-9bb4-fa83773012a3 Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20261109170603.385791-1-m.szyprowski@samsung.com Signed-off-by: Marek Szyprowski Signed-off-by: Greg Kroah-Hartman commit 557636864f6adc6f96c0123fb0614a2598d13390 Author: Marek Szyprowski Date: Mon Oct 26 10:54:15 2026 +0100 dma-pool: release CMA pages on atomic_pool_expand() error path commit ca010d38da7bf05a4572a54c2c16d6d64a758c3a upstream. atomic_pool_expand() may allocate the pool backing pages from CMA via dma_alloc_from_contiguous(), but the error path unconditionally frees them with __free_pages(). This hands CMA pages to the buddy allocator while leaving them marked as allocated in the CMA bitmap, permanently leaking CMA capacity on every failed expansion. Try dma_release_from_contiguous() first and fall back to __free_pages() only for pages that did not come from CMA, as the code did before CMA allocation was temporarily removed from the pool. Fixes: d7e673ec2c8e ("dma-pool: Only allocate from CMA when in same memory zone") Closes: https://sashiko.dev/#/bug/linux-fdfc6e83-15e4-4980-9818-691b034397e7 Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20261026095423.966856-5-m.szyprowski@samsung.com Signed-off-by: Marek Szyprowski Signed-off-by: Greg Kroah-Hartman commit e84bc6b9436ad91d6c620242d62290328009d733 Author: Marek Szyprowski Date: Mon Oct 26 10:54:12 2026 +0100 dma-coherent: serialize reserved memory pool initialization commit 494f40ffabcdc8d9fa4012b2c972690f25a0a40f upstream. Multiple devices can share the same "shared-dma-pool" reserved memory region, in which case the dma_coherent_mem structure is created by the first device attached to it and stored in rmem->priv. To avoid the potential race, serialize the check and initialization of rmem->priv with a mutex. Fixes: 7bfa5ab6fa1b ("drivers: dma-coherent: add initialization from device tree") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20261026095423.966856-2-m.szyprowski@samsung.com Signed-off-by: Marek Szyprowski Signed-off-by: Greg Kroah-Hartman commit 1bc5784162e5ed7c94f3ce1ca0efb41ab34ddc2d Author: Zhongqiu Han Date: Tue Nov 10 21:58:14 2026 +0800 cpufreq: Skip inactive policies in cpufreq_driver_target() commit c5bdb87573726d3a10c58bb3ae09daf017be2297 upstream. A policy obtained with cpufreq_cpu_get() may become inactive before cpufreq_driver_target() acquires its rwsem, which may lead to a NULL pointer dereference: CPU X CPU Y (last CPU in policy) cpufreq_cpu_get() cpufreq_offline() __cpufreq_offline() ->exit() /* frees freq_table */ policy->freq_table = NULL cpufreq_driver_target() __cpufreq_driver_target() __target_index() policy->freq_table[index] /* NULL dereference */ Before commit 2372784542cb ("cpufreq: Drop 'freq_table' argument of __target_index()"), __cpufreq_driver_target() returned an error if policy->freq_table was NULL. Since the offline path clears it under the policy rwsem, which cpufreq_driver_target() also holds, that check was sufficient to prevent the crash. The race has been reachable in-tree since commit c210063b40ac ("cpufreq: mediatek: Add opp notification support"), which added the first caller of cpufreq_driver_target() that can run concurrently with CPU offline. Address this by making cpufreq_driver_target() return -EBUSY if the policy is inactive after acquiring its rwsem, in analogy with the checks in cpufreq_get(), refresh_frequency_limits() and the sysfs show() and store() callbacks. Reported-by: Sashiko Closes: https://sashiko.dev/#/patchset/20261104153042.3987338-1-zhongqiu.han%40oss.qualcomm.com Fixes: 2372784542cb ("cpufreq: Drop 'freq_table' argument of __target_index()") Fixes: c210063b40ac ("cpufreq: mediatek: Add opp notification support") Cc: 5.19+ # v5.19+ Signed-off-by: Zhongqiu Han Link: https://patch.msgid.link/20261110135814.621355-1-zhongqiu.han@oss.qualcomm.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit b1bc8b77294abef0af8acdf9481daa56ddfa084a Author: Sumit Gupta Date: Tue Nov 10 15:42:46 2026 +0530 cpufreq: CPPC: Set CPPC Enable register in cpu_init() commit 7cca01c39cc89f6ef39079484d26b6d99287a610 upstream. As per ACPI 6.x s8.4.6.1.4 (CPPC Enable Register): "If supported by the platform, OSPM writes a one to this register to enable CPPC on this processor. If not implemented, OSPM assumes the platform always has CPPC enabled." The driver never writes this register. CPPC therefore stays disabled on platforms such as NVIDIA GB10 that wait for OSPM to enable it. Call cppc_set_enable() in cppc_cpufreq_cpu_init(). Fail init if enabling CPPC fails. If init fails after CPPC is enabled, disable it again. The register is optional, so -EOPNOTSUPP is not an error. Fixes: 5477fb3bd1e8 ("ACPI / CPPC: Add a CPUFreq driver for use with CPPC") Cc: All applicable # ab482f1bac6b "ACPI: CPPC: Refactor register value get and set ABIs" Signed-off-by: Sumit Gupta Reviewed-by: Christian Loehle [ rjw: Subject tweak ] Link: https://patch.msgid.link/20261110101246.3665797-1-sumitg@nvidia.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit f313e4c3e41bbafe7f574e9f57783423e72fa5fd Author: Mickaël Salaün Date: Wed Jul 8 12:57:10 2026 +0200 clang-format: Fix formatting of guard() commit b2a9f2d43bbdf6dcf178e300c815816a4fe4447d upstream. The previous fix was overzealous and included guard() along with scoped_guard(), but only the later takes curly braces. The original fix introduced this issue: - guard(rcu)(); + guard(rcu) + (); This is especially visible with security/landlock/*.[ch] which is fully formatted with clang-format. Cc: Andrew Morton Cc: Günther Noack Cc: Ingo Molnar Cc: Miguel Ojeda Cc: Peter Zijlstra Cc: stable@vger.kernel.org Fixes: 99df2a8eba34 ("clang-format: fix formatting of guard() and scoped_guard() statements") Closes: https://lore.kernel.org/r/20260702.Eibibi4the9j@digikod.net Reviewed-by: Bart Van Assche Link: https://patch.msgid.link/20260708105713.2073335-1-mic@digikod.net Signed-off-by: Mickaël Salaün Signed-off-by: Greg Kroah-Hartman commit d4fef96cc2e0ec721ee72727044c38fb0fa0be11 Author: Jiri Olsa Date: Wed Nov 18 09:44:49 2026 +0100 bpf: Restrict uprobe ctx writes to the registers ptrace can set commit ca44731a7009da1dbcdf1979438d1985d93331d1 upstream. Since commit 7384893d970e ("bpf: Allow uprobe program to change context registers") a uprobe program can write any field of struct pt_regs. Some of those fields are not plain user registers. The exit to user space loads them into the CPU: arch field exit path ptrace ------ ------ ------------------------------- ------------------ riscv status csrw CSR_STATUS, a0 not in the regset arm64 pstate msr spsr_el1, x22 valid_user_regs() x86-64 cs, ss (cs & 3) == 0: iretq to ring 0 set_segment_reg() x86-64 flags iretq loads IF and IOPL set_flags() On riscv a program that sets sstatus.SPP in pt_regs.status makes ret_from_exception return to user code in supervisor mode. On x86-64 a program that writes a kernel selector to cs makes iretq return to ring 0. ptrace guards these fields, but the bpf verifier does not. Add arch_uprobe_regs_writable(). Each arch lists the registers that ptrace can set to any value, and kprobe_prog_is_valid_access() rejects writes to any other offset when the program is loaded: arm64: x0 to x30, sp, pc riscv: epc, ra to t6 x86-64: r15 to di, ip, sp The default is no writes, so arches without a list (and 32-bit x86) lose ctx writes for uprobe programs. Reads are not affected. flags on x86-64 and pstate on arm64 become read-only, including the condition bits that ptrace would let a debugger change. orig_ax is read-only too. Kprobe programs that write ctx were already rejected when they were attached. Those that write one of these fields now fail to load. Fixes: 7384893d970e ("bpf: Allow uprobe program to change context registers") Reported-by: rtm@csail.mit.edu Suggested-by: Alexei Starovoitov Signed-off-by: Jiri Olsa Signed-off-by: Alexei Starovoitov Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20261118084451.12590-2-jolsa@kernel.org Closes: https://lore.kernel.org/bpf/30318.1794850523@30-11-166.wireless.csail.mit.edu/ Signed-off-by: Greg Kroah-Hartman commit 1910f75d974097e2d2befd84284f5c66d7b0ad81 Author: Xu Rao Date: Tue Nov 10 11:07:56 2026 +0800 Bluetooth: MGMT: Fix runtime config status opcode commit 4728474344793dd67956e03a2cb244b71383ef7c upstream. The Set Default Runtime Configuration command uses opcode 0x004e, but set_def_runtime_config() reports its invalid-parameter status with the Set Default System Configuration opcode, 0x004c. A management client that matches Command Status events to its pending request by opcode therefore cannot associate the response with the request it sent. Runtime configuration parameters are not implemented, so the command still returns MGMT_STATUS_INVALID_PARAMS. Use MGMT_OP_SET_DEF_RUNTIME_CONFIG for the status event so the response identifies the command that was actually handled. Fixes: aececa645dc7 ("Bluetooth: mgmt: Add commands for runtime configuration") Signed-off-by: Xu Rao Cc: stable@vger.kernel.org Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman commit 6decdb985a21d16cd69e70c4a816b003f2249f58 Author: Joas Antonio dos Santos Date: Tue Nov 10 03:55:41 2026 +0000 Bluetooth: hci_qca: clear qca_memdump when discarding dump packets commit 45a25a1bfd267d9e420119a48e5291d7882395df upstream. qca_controller_memdump() frees qca_memdump when a memdump packet with a non-zero sequence number arrives while QCA_MEMDUMP_COLLECTION is not set, but leaves qca->qca_memdump pointing at the freed object. The next run of the work reads the stale pointer into its local variable, skips the allocation and uses the freed memory. Another packet with a non-zero sequence number frees it a second time, and a packet with sequence number 0 writes ram_dump_size, current_seq_no and received_dump into it. The original code cleared the pointer here; the assignment was dropped when the condition was changed to test QCA_MEMDUMP_COLLECTION. All other places that free the structure clear the pointer. A controller that sends two memdump events without a leading sequence number 0 can trigger a use-after-free or double free of a kmalloc object. Found by LLM-assisted source review. Fixes: 06d3fdfcdf5c ("Bluetooth: hci_qca: Add qcom devcoredump support") Cc: stable@vger.kernel.org Signed-off-by: Joas Antonio dos Santos Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman commit 54f9b9e1bdd042c4a1391c3252cc2411a55b8471 Author: Stanley Jhu Date: Wed Nov 4 19:27:44 2026 +0800 block: Keep RPM_ACTIVE in blk_pre_runtime_resume() when already active commit 657d7c48b84f2ef0bf885b47cf2318823bc72970 upstream. Since commit eef1d74bf88f ("PM: runtime: Only set runtime_error on suspend callback failures"), a failed runtime resume leaves dev->power.runtime_error at 0 with runtime_status set to RPM_SUSPENDED, so later runtime resume requests run sdev_runtime_resume() again: 1. A runtime suspend increments q->pm_only from 0 to 1 and sets q->rpm_status to RPM_SUSPENDED. 2. The first runtime resume fails in the driver callback, and blk_post_runtime_resume() sets q->rpm_status to RPM_ACTIVE and calls blk_clear_pm_only(), decrementing q->pm_only from 1 to 0 so recovery commands can enter the queue (intended since commit 6e1fcab00a23 ("scsi: block: pm: Always set request queue runtime active in blk_post_runtime_resume()")). 3. A retried runtime resume calls blk_pre_runtime_resume(), which overwrites q->rpm_status from RPM_ACTIVE to RPM_RESUMING, so blk_post_runtime_resume() sees old_status != RPM_ACTIVE and calls blk_clear_pm_only() a second time without a matching blk_set_pm_only(). 4. q->pm_only underflows from 0 to -1 (triggering WARN_ON_ONCE in blk_clear_pm_only()), blocking non-PM requests in blk_queue_enter() and __bio_queue_enter() while the device is RPM_ACTIVE, and the next runtime suspend increments q->pm_only from -1 to 0, letting non-PM requests dispatch while RPM_SUSPENDED. This hits the UFS device well-known LUN by default and SCSI disks with manage_runtime_start_stop enabled (ATA and FireWire sbp2 defaults). Transition q->rpm_status to RPM_RESUMING in blk_pre_runtime_resume() only when it is RPM_SUSPENDED, and call blk_clear_pm_only() in blk_post_runtime_resume() only when old_status is RPM_RESUMING, pairing each clear with a completed runtime suspend. Tested on QEMU ARM64 UFS in SDB and MCQ modes by injecting runtime-resume START STOP UNIT failures on the UFS device well-known LUN, confirming zero pm_only underflows and balanced runtime PM cycles. Fixes: eef1d74bf88f ("PM: runtime: Only set runtime_error on suspend callback failures") Cc: stable@vger.kernel.org # v7.3+ Reviewed-by: Bart Van Assche Signed-off-by: Stanley Jhu Acked-by: Rafael J. Wysocki (Intel) Link: https://patch.msgid.link/20261104112744.1630864-1-stanleyjhu@google.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman commit 457f968d71e4102442b5303278ca53cdc15a15e5 Author: Alex Kazinsky Date: Fri Nov 13 15:08:40 2026 +0400 blk-iocost: Fix overflow in donation weight calculation commit a56d5a485be4a9d52f0d7b3ed0dc3521367cb986 upstream. hweight_after_donation() receives usage as u32, clamped to the range [1, WEIGHT_ONE]. Since WEIGHT_ONE is 1 << 16, multiplying it by usage equal to WEIGHT_ONE wraps the 32-bit unsigned result to zero before it is passed to div64_s64(). This makes new_hwi zero, which is then clamped to 1, incorrectly reducing the cgroup's in-use weight to the minimum. Cast WEIGHT_ONE to s64 before multiplication to preserve the full product. Found by Linux Verification Center (linuxtesting.org) with SVACE static analysis tool. Fixes: f1de2439ec43 ("blk-iocost: revamp donation amount determination") Cc: stable@vger.kernel.org Signed-off-by: Alex Kazinsky Acked-by: Tejun Heo Link: https://patch.msgid.link/20261113110842.4189035-1-a.kazinsky@ideco.ru Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman commit 3339c5b085bd68b6df1fb9d3e8ff5bb5d28d1297 Author: Niklas Cassel Date: Mon Nov 16 20:10:09 2026 +0100 ata: libata-scsi: fix the INC_512 bit test for SECURITY PROTOCOL IN/OUT commit e2954988bb987c1432806379f602573d2388df93 upstream. ata_scsi_security_inout_xlat() tests the INC_512 bit with cdb[4] & 7. INC_512 is bit 7 of byte 4 of the SECURITY PROTOCOL IN and SECURITY PROTOCOL OUT CDBs (SPC-6, tables 280 and 282), and bits 6:0 of that byte are reserved. Test bit 7 instead. Fixes: 818831c8b22f ("libata: implement SECURITY PROTOCOL IN/OUT") Cc: stable@vger.kernel.org Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20261116191008.2954277-2-cassel@kernel.org Signed-off-by: Niklas Cassel Signed-off-by: Greg Kroah-Hartman commit 9cabf7b6caa2683f9355f3dbd1e1abe03b7393b2 Author: Justinien Bouron Date: Mon Nov 16 12:54:30 2026 -0800 ata: libata-core: Add max sector quirk to INTEL SSDSCKKB240G8 commit a12cc63129380a5364e787d92b30a3257f66c250 upstream. INTEL SSDSCKKB240G8 with firmware version XC311102 runs into FPDMA timeout errors when queue/max_sectors_kb is set to BLK_DEF_MAX_SECTORS_CAP = 4096KiB / 8192 sectors. Similar to model SSDSC2KG480G8, the issue disappears when setting this max size to 8191 sectors, thus apply the same quirk. Firmware version X5A1ME59 for SSDSCKKB240G8 is un-affected by this bug thus keep the quirk specific to firmware XC311102. Fixes: 9b8b84879d4a ("block: Increase BLK_DEF_MAX_SECTORS_CAP") Signed-off-by: Justinien Bouron Reviewed-by: Gunnar Kudrjavets Cc: stable@vger.kernel.org Reviewed-by: Damien Le Moal Link: https://lore.kernel.org/r/20261116205430.44305-1-jbouron@amazon.com Signed-off-by: Niklas Cassel Signed-off-by: Greg Kroah-Hartman commit afa46591f1664ded6d47cff3d4ae5ffa83fae387 Author: Chen Yuxi Date: Tue Nov 17 07:05:16 2026 +0000 ASoC: wm8962: Fix broken headset button caused by wrong guard constant commit fd3b0fc97ea72d027359e7603a1224703cec1864 upstream. Commit e59075211902 ("ASoC: wm8962: Don't report a microphone if it's shorted to ground on plug") guards the mic short report by testing wm8962->mic_status against WM8962_MICDET_STS. But mic_status stores the reported jack status, composed of SND_JACK_MICROPHONE and SND_JACK_BTN_0, which never has WM8962_MICDET_STS set. The guard is therefore always true, so every mic short event reports nothing. Pressing the button on a TRRS headset shorts the mic pin to ground, which used to be reported as SND_JACK_BTN_0. After that commit the button press is silently dropped, breaking the headset button on all wm8962 boards using the mic detect path. Test mic_status against SND_JACK_MICROPHONE instead, restoring the intended behaviour: suppress the report only when no microphone was previously detected, i.e. a TRS plug in a TRRS socket. Fixes: e59075211902 ("ASoC: wm8962: Don't report a microphone if it's shorted to ground on plug") Cc: stable@vger.kernel.org Signed-off-by: Chen Yuxi Reviewed-by: Charles Keepax Reviewed-by: Sebastian Krzyszkowiak Link: https://patch.msgid.link/20261117070516.3861828-1-chenyuxi19@huawei.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit 1826067b4664fffc63f3f0d1db72d52a88d67301 Author: yzddMr6 Date: Sun Nov 15 21:12:57 2026 +0800 ASoC: qcom: q6dsp-lpass-clocks: Set driver data before registering clocks commit bd6e011c8121c909daf51c78b56bb3bf7f467889 upstream. The clk ops of the q6dsp clock controller look up struct q6dsp_cc with dev_get_drvdata(), but q6dsp_clock_dev_probe() sets the driver data only after it has registered the clocks and added the OF clock provider. A consumer that gets and prepares one of the clocks in between dereferences a NULL pointer. fw_devlink does not keep consumers out of that window. The q6prm and q6afe clock controllers are described below the ADSP remoteproc node, and their devices are only created once the ADSP has booted and its GPR/APR services have come up, long after the remoteproc device has bound. fw_devlink therefore makes the remoteproc device the supplier of their consumers. A consumer such as the LPASS LPI pinctrl then just defers until of_clk_get() succeeds, and its retry from the deferred probe worker can run while the clock controller is still in its probe. That happened once on a Xiaomi Pad 8 Pro (SM8750). While the LPI pinctrl probe registered its GPIO chip, gpiolib read a GPIO direction, which runtime resumed the device and prepared its q6prm vote clocks through pm_clk. The prepare op then faulted with a NULL pointer dereference at virtual address 0x350 (trimmed): pc : clk_vote_q6dsp_block+0x24/0x58 [snd_q6dsp_common] lr : clk_core_prepare+0x7c/0x298 Call trace: clk_vote_q6dsp_block+0x24/0x58 [snd_q6dsp_common] (P) clk_core_prepare+0x7c/0x298 clk_prepare+0x28/0x44 pm_clk_resume+0x10c/0x188 pm_generic_runtime_resume+0x2c/0x44 ... __pm_runtime_resume+0x50/0x94 ... lpi_gpio_get_direction+0x4c/0x8c [pinctrl_lpass_lpi] gpiochip_add_data_with_key+0x7b0/0x10dc devm_gpiochip_add_data_with_key+0x38/0x8c lpi_pinctrl_probe+0x2b8/0x320 [pinctrl_lpass_lpi] ... deferred_probe_work_func+0x88/0xc0 0x350 is the offset of desc in struct q6dsp_cc; the driver data pointer it was loaded from was NULL. The oops left the clk prepare_lock held, which blocks every later clk_prepare(), and the system did not finish booting. On mainline the window is short, but it includes a wait for prepare_lock in clk_core_reparent_orphans(), which of_clk_add_hw_provider() calls right after listing the provider. The kernel that hit this had out-of-tree changes to drivers/clk/clk.c that do more work at that point, which makes the window wider. Both q6afe-clocks and q6prm-clocks use q6dsp_clock_dev_probe(). Set the driver data before the first clock is registered. The oops was analysed and the fix written with the help of an AI coding assistant. Fixes: 9ab71ac37240 ("ASoC: qdsp6: q6afe-clocks: move audio-clocks to common file") Cc: stable@vger.kernel.org Signed-off-by: yzddMr6 Reviewed-by: Srinivas Kandagatla Link: https://patch.msgid.link/20261115-upstream-q6dsp-clk-drvdata-v1-1-4d7dbea52e52@gmail.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit a64452374a4befaf563b33eaa0cbc7b1a043a7e5 Author: Julius Bairaktaris Date: Wed Nov 11 09:06:24 2026 +0100 ASoC: qcom: q6asm-dai: reject compress rings larger than the DMA buffer commit 4c15e549b7ad03183d10826da91e9ddc207a02cd upstream. q6asm_dai_compr_open() allocates a fixed 8 MiB DMA buffer, but q6asm_dai_compr_set_params() takes the ring size from the fragment size and count that userspace passes to SNDRV_COMPRESS_SET_PARAMS without checking it against that buffer. The compress core checks the geometry against the runtime buffer only for drivers without a copy callback. q6asm_compr_copy() places each write() at the stream position modulo the ring size, so a ring larger than the DMA buffer lets write() copy user data past its end, and after SNDRV_COMPRESS_NEXT_TRACK the copy starts at the next multiple of the fragment size. Reject a ring larger than the DMA buffer. Fixes: a08cd56a4524 ("ASoC: q6asm-dai: add support to copy callback") Cc: stable@vger.kernel.org Signed-off-by: Julius Bairaktaris Link: https://patch.msgid.link/20261111080624.244291-3-julius@bairaktaris.de Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit bab14fc465c699bf1ba8be571478a7c2a2002fd9 Author: Julius Bairaktaris Date: Wed Nov 11 09:06:23 2026 +0100 ASoC: qcom: q6apm-dai: reject compress rings larger than the DMA buffer commit 3857bc06e5a40c5ebb62917147375a811f010aa0 upstream. q6apm_dai_compr_open() allocates a fixed 8 MiB DMA buffer, but q6apm_dai_compr_set_params() takes the ring size from the fragment size and count that userspace passes to SNDRV_COMPRESS_SET_PARAMS without checking it against that buffer. The compress core checks the geometry against the runtime buffer only for drivers without a copy callback. q6apm_compr_copy() places each write() at the stream position modulo the ring size, so a ring larger than the DMA buffer lets write() copy user data past its end, and after SNDRV_COMPRESS_NEXT_TRACK the copy starts at the next multiple of the fragment size. Reject a ring larger than the DMA buffer. Fixes: c317d148a2b0 ("ASoC: q6dsp: q6apm-dai: Add mmap and copy compress DAI callbacks") Cc: stable@vger.kernel.org Signed-off-by: Julius Bairaktaris Reviewed-by: Srinivas Kandagatla Link: https://patch.msgid.link/20261111080624.244291-2-julius@bairaktaris.de Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit 5aa92939997f6515c15b5cea8dd218f6d87605f5 Author: Marc Herrero Date: Mon Nov 16 20:16:20 2026 +0000 ASoC: qcom: audioreach: use a 32-bit container for S24_LE PCM commit feb416ba626e95b12fc238587f8fee93cae66c9c upstream. SNDRV_PCM_FORMAT_S24_LE carries 24 valid bits in a 32-bit container, but audioreach_shmem_set_media_format() and audioreach_pcm_set_media_format() set bits_per_sample = bit_width = 24 in PARAM_ID_MEDIA_FORMAT and PARAM_ID_PCM_OUTPUT_FORMAT_CFG, which tells the DSP that the samples are packed 3-byte words. q6apm-dai advertises S24_LE, so with a topology that allows it on a playback front end the DSP walks the buffer with the wrong stride. On QCS6490 (Radxa Dragon Q6A) this crashes the ADSP audio_process: PDM: service 'audio_process' crash: 'EX:audio_process:0x2:...' q6apm-lpass-dais ...: Failed to start APM port 113 remoteproc remoteproc0: crash detected in adsp: type fatal error Use the container size (32) for 24-bit data and keep bit_width = 24, alignment = PCM_LSB_ALIGNED and q_factor = 23. With this change S24_LE playback works on the headphone path (codec DMA RX -> LPASS RX macro -> WCD9385), tested with the back end at S16_LE, S24_LE and S32_LE and at 48, 96 and 192 kHz. The DSP then reads each 32-bit word as Q23, so S24_LE samples must be sign-extended into the top byte, as alsa-lib's conversions do. Fixes: 25ab80db6b13 ("ASoC: qdsp6: audioreach: add module configuration command helpers") Cc: stable@vger.kernel.org Reviewed-by: Srinivas Kandagatla Signed-off-by: Marc Herrero Link: https://patch.msgid.link/20261116-q6apm-fixes-v2-1-ea89fb43316a@proton.me Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit b9549d38609e167664d8aefdeed128a09582b5ce Author: Marc Herrero Date: Mon Nov 16 20:16:21 2026 +0000 ASoC: qcom: audioreach: only disconnect the route a mixer control owns commit 562b2cc2aa88e039790248b5f1014c4850a7e528 upstream. Each AudioReach virtual mixer route control (" Audio Mixer ") connects a front-end stream graph to a back-end device graph by storing the source module in the device graph's audioreach_graph_info. Writing 0 to any of these controls clears that link unconditionally, even when the device graph is connected to a different front end. When two front ends can feed the same back end the result therefore depends on write order. On QCS6490 (Radxa Dragon Q6A): - alsactl restore writes 'DISPLAY_PORT_RX_0 Audio Mixer MultiMedia2' = 1 and then 'DISPLAY_PORT_RX_0 Audio Mixer MultiMedia1' = 0, which leaves DisplayPort disconnected although the saved state has it connected; - the UCM HDMI enable sequence writes 'RX_CODEC_DMA_RX_0 Audio Mixer MultiMedia2' = 0, which disconnects MultiMedia1 from the headphones. A PCM started on MultiMedia1 after that never advances (hw_ptr stays at 0). Make audioreach_connect_sub_graphs() only clear the link when it belongs to the control being cleared, using the same test as audioreach_is_vmixer_connected() does for get(). The DAPM mixer state is still updated for every write, so DAPM keeps tracking each route control as before. Fixes: e4977b91cff8 ("ASoC: qdsp6: audioreach: Simplify handing FE and BE graph connections") Cc: stable@vger.kernel.org Signed-off-by: Marc Herrero Reviewed-by: Srinivas Kandagatla Link: https://patch.msgid.link/20261116-q6apm-fixes-v2-2-ea89fb43316a@proton.me Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit 9434b1bcfa63a09dbc32a6c08840bd422022d038 Author: Nicholas E. Andrade Date: Mon Nov 9 10:22:35 2026 -0800 ASoC: amd: acp: fix PDM ring buffer address on ACP7.x resume commit a3d8527ed469a31aeeb02c5e52ed89de410e46e6 upstream. On ACP7.x the DMIC ring buffer lives at ACP7x_DMIC_MEM_WINDOW_START, and acp_dmic_prepare() programs ACP_WOV_RX_RINGBUFADDR accordingly. The system resume path (acp70_pcm_resume() -> restore_acp_pdm_params() -> set_acp_pdm_ring_buffer()) however still uses the pre-ACP7.x calculation, stream->reg_offset + MEM_WINDOW_START (0x6080000). That window is not backed by the PTEs config_acp_dma() writes for the DMIC stream (scratch offset 0x6000, i.e. window 0x4C00000), so after resume the ATU translates DMIC DMA through uninitialised SRAM and the ACP writes to random IOVAs. With the IOMMU enabled, a capture stream held open across s2idle produces a continuous stream of faults until it is closed, and captures nothing useful: snd_acp_pci 0000:c4:00.5: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0018 address=0x1ddeee9942398e20 flags=0x0030] Commit 3ee257aba1d5 ("ASoC: amd: acp: Audio is not resuming after s0ix") fixed the same problem for the I2S restore path in set_acp_i2s_dma_fifo() but left the PDM path unchanged. Select the ACP7.x window there too, matching acp_dmic_prepare(). Tested on a Lenovo ThinkPad P14s Gen 6 AMD (ACP rev 0x71, kernel 7.3.1) by holding arecord -D hw:CARD=acppdmmach,DEV=0 -f S32_LE -r 48000 -c 2 open across s2idle: before the fix, IO_PAGE_FAULTs after every resume and no audio; after, no faults and audio captured correctly after resume. The bug was diagnosed and the fix drafted with the help of an AI coding assistant (Claude); the analysis, change and testing were reviewed and verified by the submitter on the hardware above. Fixes: f6f7d25b1103 ("ASoC: amd: acp: Add pte configuration for ACP7.0 platform") Cc: stable@vger.kernel.org Signed-off-by: Nicholas E. Andrade Link: https://patch.msgid.link/20261109-for-next-v1-1-54a06f391bda@gmail.com Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman commit bd37cca44285a1545c87206ab1081b91f0aab23c Author: Ben Cressey Date: Wed Nov 11 15:26:04 2026 -0800 arm64: kexec: use a typed entry to fix kCFI oops commit b059e957d07b3cab92eef4656988244043f5769a upstream. An arm64 Linux kernel built with CONFIG_CFI=y oopses after "Bye!" on every kexec that relocates the image. Crash images load in place and are not affected. The oops reproduces under QEMU: Unable to handle kernel paging request at virtual address 00000000544bfffc pc : machine_kexec+0x104/0x274 Code: d5182008 d5033fdf aa1303e0 f9418a68 (b85fc110) b85fc110 is "ldur w16, [x8, #-4]", the kCFI check's load of the type hash in front of the callee. Commit efc2d0f20a9d ("arm64: kexec: keep MMU enabled during kexec relocation") made machine_kexec() call the control page's copy of arm64_relocate_new_kernel() indirectly, while TTBR0 maps only that page. The copy starts at the page's first byte, so the load faults. SYM_CODE_START() also gives the routine no hash. SYM_TYPED_FUNC_START() emits the hash inside .kexec_relocate.text, and machine_kexec_post_load() already copies that whole section, at most 4 KiB, to the page's start, so the mapped page holds both hash and entry. The ASSERT from commit dc4824faa265 ("arm64: avoid executing padding bytes during kexec / hibernation") kept the entry first, since C branched to the page's start. Relax it, so the entry need only be in the section. Fix by typing the routine with SYM_TYPED_FUNC_START() and a C prototype, and entering the copy at the symbol's offset in the section. The code is Kees Cook's, as posted in review, with two comments and the ASSERT message reworded. An LLM diagnosed the oops. Fixes: efc2d0f20a9d ("arm64: kexec: keep MMU enabled during kexec relocation") Cc: stable@vger.kernel.org Suggested-by: Kees Cook Link: https://lore.kernel.org/linux-arm-kernel/202609241804.BB23BF10@keescook/ Signed-off-by: Ben Cressey Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 27efd000980472129b1152f0105249fbd3d4eced Author: Ryan Roberts Date: Fri Nov 13 14:50:16 2026 +0000 arm64: cpufeature: Remove Cortex-X4 from the BBML3 allow list commit c6ba16d8157b05e0a05b773422f5d3c5941e22de upstream. Cortex-X4 erratum 3043263 can cause a load or store to livelock when mapping size changes without break-before-make or when contiguous hints are programmed inconsistently. The erratum was previously reported as fixed in r0p3. On that basis, commit 5aa4b625762e ("arm64: Add BBM Level 2 cpu feature") added Cortex-X4 from r0p3. The updated Cortex-X4 SDEN v13, dated 18 June 2026, lists r0p0, r0p1, r0p2 and r0p3 as affected and the erratum as open. Remove the entry so Cortex-X4 observes break-before-make, and record the workaround in the silicon errata registry. Fixes: 5aa4b625762e ("arm64: Add BBM Level 2 cpu feature") Cc: stable@vger.kernel.org Link: https://support.arm.com/documentation/109148/13-0/?lang=en Signed-off-by: Ryan Roberts Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 0495be6a43a88d26125326e49cf7e9370d6c8f29 Author: Ryan Roberts Date: Fri Nov 13 14:50:15 2026 +0000 arm64: cpufeature: Remove Neoverse-V3/AE from the BBML3 allow list commit 4f9280c8db69bc807c6c6c616f1b9853ca9144c7 upstream. Neoverse-V3 and Neoverse-V3AE erratum 3053180 can cause a load or store to livelock when mapping size changes without break-before-make or when contiguous hints are programmed inconsistently. The erratum was previously reported as fixed in r0p2. On that basis, commit 5aa4b625762e ("arm64: Add BBM Level 2 cpu feature") allowed Neoverse-V3 from r0p2, and commit 8fca3852e33d ("arm64: cpufeature: add Neoverse-V3AE to BBML2 allow list") did the same for Neoverse-V3AE. The updated SDENs, MP168 v11 for Neoverse-V3 and MP172 v12 for Neoverse-V3AE, dated 9 June 2026, list r0p0, r0p1 and r0p2 as affected and the erratum as open. There is no fixed revision on which to base either allow-list entry. Remove both entries so these CPUs observe break-before-make, and record the workaround in the silicon errata registry. Fixes: 5aa4b625762e ("arm64: Add BBM Level 2 cpu feature") Fixes: 8fca3852e33d ("arm64: cpufeature: add Neoverse-V3AE to BBML2 allow list") Cc: stable@vger.kernel.org Link: https://support.arm.com/documentation/109231/11-0/?lang=en Link: https://support.arm.com/documentation/109704/12-0/?lang=en Signed-off-by: Ryan Roberts Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman commit 97be5dba192ea95cda8431f2dab13f7eb1d5f579 Author: Muchun Song Date: Fri Oct 23 14:34:28 2026 +0800 arm64/mm: fix destructor for unconstructed hotplug page tables commit 26601a6c80c52c5336cd02b3379710077aeafc4a upstream. Commit c594b83457cc ("arm64: mm: call pagetable dtor when freeing hot-removed page tables") made free_hotplug_pgtable_page() unconditionally run the page-table destructor. This matches page tables allocated by the arm64 mapping code, which runs the corresponding constructors. However, arm64 also uses the generic sparse-vmemmap population code. Runtime intermediate page tables allocated by that code do not run a page-table constructor. Freeing one during memory hot-remove therefore runs a destructor without a matching constructor and corrupts NR_PAGETABLE accounting. Free intermediate page-table pages through pagetable_free(). It runs the destructor only for constructor-backed pages and then releases the page through the page-table freeing path. Link: https://lore.kernel.org/20261023063428.3658761-5-songmuchun@bytedance.com Fixes: c594b83457cc ("arm64: mm: call pagetable dtor when freeing hot-removed page tables") Signed-off-by: Muchun Song Signed-off-by: Andrew Morton Reviewed-by: Kevin Brodsky Acked-by: David Hildenbrand (Arm) Reviewed-by: Anshuman Khandual Reviewed-by: Catalin Marinas Cc: Oscar Salvador Cc: Dave Hansen Cc: Paul Walmsley Cc: Palmer Dabbelt Cc: Albert Ou Cc: Alexandre Ghiti Cc: Björn Töpel Cc: Will Deacon Cc: Mark Rutland Cc: Alexander Gordeev Cc: Alistair Popple Cc: Signed-off-by: Greg Kroah-Hartman commit a94c3474e5a6dc549c8bccdf032c1f3e5bdbdc77 Author: Vineet Gupta Date: Thu Sep 24 21:16:00 2026 -0700 ARC: io: work around GCC PR127718 in __raw_write{w,l}() commit 603b4fd69b4e77770761ea03451e2164186f8590 upstream. The __raw_write{w,l}() accessors use inline asm with an "m" operand for the store destination. GCC's ARC backend lets "m" match any legitimate address, including the register-indexed [b,c] forms that only loads support: stores only have [reg], [reg,s9] and [limm] addressing. With newer GCC (late-combine in GCC 15, combine in GCC 16), a writew() with a scaled, non-constant offset gets stw.as r2,[r0,r1] which the assembler rejects: Error: inappropriate arguments for opcode 'stw' With GCC 16 this breaks even hsdk_defconfig (drivers/net/pcs/ pcs-xpcs-plat.c) and axs101_defconfig. allyesconfig additionally trips in drivers/pinctrl/renesas/pinctrl-rza2.c and drivers/video/fbdev/ s3c-fb.c. Work around it by passing the address in a register and using a fixed [%1] address in the asm template, so the compiler can't pick an addressing mode that stores don't support. This is the minimal fix. The next patch drops the inline asm altogether. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127718 Cc: stable@vger.kernel.org Signed-off-by: Vineet Gupta Signed-off-by: Greg Kroah-Hartman commit c3a7b96be929678d70cd1fc5bdacf3829f6dc823 Author: Christian Loehle Date: Fri Nov 13 13:04:11 2026 +0000 ACPI: CPPC: Reject EPP registers narrower than 8 bits commit 7aca8e31a8fbf2ceffb487cec67ae300b95fa8b1 upstream. The EPP interfaces use an 8-bit preference, but ACPI permits narrower fields. With a 4- or 6-bit SystemMemory field, writing 128 succeeds but stores zero, requesting maximum performance instead. Reject a present EPP register narrower than eight bits during _CPC probe. Use the existing error path to release previously acquired resources and leave the CPU's CPPC descriptor unpublished. Keep absent EPP entries and registers at least eight bits wide on their existing paths. Fail the whole probe instead of disabling only EPP. This also makes amd-pstate's acpi_cpc_valid() check reject the platform before registering its MSR or shared-memory driver. No affected hardware is known or expected and the specification is expected to no longer permit these in the future [1]. Fixes: 922607a2b462 ("cpufreq: CPPC: Add support for autonomous selection") Link: https://github.com/tianocore/edk2/issues/10838 [1] Signed-off-by: Christian Loehle Reviewed-by: Mario Limonciello (AMD) Cc: All applicable [ rjw: Changelog tweak ] Link: https://patch.msgid.link/20261113130411.1433174-1-christian.loehle@arm.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman commit 48f32be2c26822573f52542259f659b7e5e63111 Author: Geoffrey D. Bennett Date: Mon Nov 16 01:30:40 2026 +1030 ALSA: usb-audio: Add always_set_rate quirk for Yamaha MODX M commit dd763c9a7d8ccd6b281e565187017fe619491d49 upstream. The Yamaha MODX M uses a different USB ID for each combination of its audio mode and MIDI version settings: 0499:1772 2 stereo, 44.1-96 kHz, MIDI 1.0 0499:1763 2 stereo, 44.1-96 kHz, MIDI 2.0 0499:1773 5 stereo, 44.1 kHz, MIDI 1.0 0499:1764 5 stereo, 44.1 kHz, MIDI 2.0 With 0499:1773 and 0499:1764 playback is silent. With the always_set_rate quirk flag set for them it plays. 0499:1772 and 0499:1763 play without it. Tested on a MODX M6 with the quirk_flags module parameter set to 0499:1773:always_set_rate and to 0499:1764:always_set_rate. Reported-by: Frank Slotta Closes: https://linuxmusicians.com/viewtopic.php?p=186121 Cc: # 7.3.x Tested-by: Frank Slotta Signed-off-by: Geoffrey D. Bennett Link: https://patch.msgid.link/avnJGI3L/sf7KQCi@m.b4.vu Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit 9339c85835a020076ca034836f7fece66ec89e0c Author: Ye Weihua Date: Mon Nov 16 06:48:49 2026 +0000 ALSA: pcm: oss: Restore params flag after failed reconfiguration commit bc3d6817c5325e76578cdd75e9c08bdadc5f73c4 upstream. snd_pcm_runtime_buffer_set_silence() may fail with -EBUSY when a concurrent PCM transfer is accessing the buffer. The error path releases runtime->oss.buffer and clears the plugins, but leaves runtime->oss.params cleared as well. A subsequent small read/write then skips the reconfiguration and dereferences the released buffer: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 pc : __arch_copy_from_user+0x78/0x23c lr : snd_pcm_oss_write+0x10c/0x340 [snd_pcm_oss] Restore runtime->oss.params on the error path so that the next OSS operation reconfigures and reallocates the buffer. Fixes: 47c27c9c9c72 ("ALSA: pcm: Improve the fix for race of buffer access at PCM OSS layer") Cc: stable@vger.kernel.org Signed-off-by: Ye Weihua Link: https://patch.msgid.link/20261116064850.3540576-1-yeweihua4@huawei.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit bada3a2120bfd350a88fb882482f1df267b3195b Author: Takashi Iwai Date: Wed Nov 18 13:50:23 2026 +0100 ALSA: hda/realtek: Fix regression on Lenovo Legion 16IRX9H commit 0b4d69e8d2b53907ea8640bf7aa8543ae9e7a0c0 upstream. Lenovo Legion 16IRX9H has the very same PCI SSID (17aa:3842) as the recently added quirk for Lenovo Thinkpad X G2 IAH, but it needs a different qurik. Although the quirk for Legion 16IRX9H is present, it's not applied because the PCI SSID 17aa:3842 matches at first and the new quirk for Thinkpad X G2 is taken instead. As a workaround, put the codec SSID matching (17aa:38cd) for Legion before the conflicting PCI SSID quirk entry. Fixes: f2293e7b2ddd ("ALSA: hda/realtek: Enable all four speaker amps on Lenovo ThinkBook X G2 IAH") Cc: Closes: https://lore.kernel.org/CAFjFWEjt+DPJ_gM1uTBZ_NoV6-3mi57ArjZ_Qdah2DqY-GCD1w@mail.gmail.com Link: https://patch.msgid.link/20261118125024.1900126-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman commit c8218d55dd3b3674820e809afe9bc914ca7dd90e Author: Aldo Ariel Panzardo Date: Wed Oct 7 18:20:49 2026 -0300 drm/vmwgfx: close TOCTOU on guest_memory_bo in surface reference ioctl commit 30131b82b062180183a09a97183a944fadab72ee upstream. vmw_gb_surface_reference_internal() checks srf->res.guest_memory_bo for NULL and reads its vma_node offset and base.size outside the cmdbuf_mutex scope that protects the backup pointer. A concurrent backup switch, e.g. from SVGA_3D_CMD_BIND_GB_SURFACE via vmw_resource_unreserve(), drops its reference to the old buffer and installs a new one under cmdbuf_mutex. The unlocked check in the surface reference ioctl can see a transient NULL. The reads after the unlock can return another buffer's offset and size; a further switch can drop that buffer's last reference and free it while the ioctl reads from it. Move the NULL check inside the mutex, and read buffer_map_handle and buffer_size while still holding it. Fixes: a97e21923b42 ("drm/vmwgfx: Hook up guest-backed surfaces") Cc: stable@vger.kernel.org Reported-by: Sashiko Closes: https://lore.kernel.org/r/20260808233347.209DD1F000E9@smtp.kernel.org Signed-off-by: Aldo Ariel Panzardo Reviewed-by: Zack Rusin Signed-off-by: Zack Rusin Link: https://patch.msgid.link/20261007212051.2574235-3-qwe.aldo@gmail.com Signed-off-by: Greg Kroah-Hartman commit 32c83739ab0746985ce6fed3a6e6054fbf5f5d48 Author: Zack Rusin Date: Tue Oct 27 08:07:40 2026 -0400 drm/vmwgfx: validate the framebuffer selected for cursor updates commit d6263d9bfa931dfc7e0dd922a6ee52b5535caa74 upstream. Cursor atomic checks select an update path and look up surfaces through vps->uo. That object is copied from the previous plane state and is only replaced with the new framebuffer's object in prepare_fb(). Switching between snooped surfaces and buffer objects therefore applies the old framebuffer's cursor limits to the new image. KMS clients can also submit a guest-backed surface without a backing BO. The check accepts it, but the MOB update later copies from a NULL source. Zero-sized MOB images pass the check as well, then fail preparation when mapping zero pages, so TEST_ONLY accepts a commit that cannot succeed. Resolve the user object directly from the selected framebuffer in both validation and preparation. Apply the matching cursor limits, reject zero dimensions and require a backing BO for GB-only and MOB images. Recheck the backing BO in preparation before mapping it, while keeping snooped surfaces independent of a BO mapping. Fixes: 965544150d1c ("drm/vmwgfx: Refactor cursor handling") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Tested-by: fausten Link: https://patch.msgid.link/20261027211729.646988-6-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit e8bfd27439d296c40b1879437050088dc4cb06c9 Author: Zack Rusin Date: Tue Oct 27 02:08:24 2026 -0400 drm/vmwgfx: validate GB-only cursor command limits commit 6baeb251d709d5f31f2a0ae89ca5ca054d0e04e7 upstream. Guest-backed devices without cursor MOB support define cursor images with SVGA_CMD_DEFINE_ALPHA_CURSOR. SVGA_REG_CURSOR_MAX_DIMENSION belongs to the cursor MOB register class and reads as zero on devices that do not expose that class. Applying this register to GB-only cursors rejects every nonempty image submitted by KMS clients, leaving Xorg without a hardware cursor. The submission transport also limits the command size. A 96x96 image fits the 40 KiB FIFO image limit, but exceeds the 32 KiB command-buffer limit and causes a device command error when submitted through that transport. Validate GB-only images against SVGA_MAX_CURSOR_CMD_DIMENSION and SVGA_MAX_CURSOR_CMD_BYTES. For command-buffer submission, also bound the whole command by SVGA_CB_MAX_COMMAND_SIZE, including its header. Calculate the image byte count in 64 bits and keep the register-based dimension and MOB size checks for MOB cursors. Fixes: d5ed8749168a ("drm/vmwgfx: enforce cursor size limits for MOB cursors") Cc: stable@vger.kernel.org Reported-by: Yunfeng Li Closes: https://patch.msgid.link/20260830151619.2452307-1-yunfeng.li.nb@gmail.com Assisted-by: LLM Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Tested-by: fausten Link: https://patch.msgid.link/20261027211729.646988-3-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit beea53d7329f742a90c14efbede674f2aadf4c2a Author: Zack Rusin Date: Wed Nov 11 13:41:45 2026 -0500 drm/vmwgfx: validate command body sizes before parsing commit 06069d6d650dbef746eb933e2f4fbfc686b6d330 upstream. vmw_cmd_check verifies that a command's declared size fits in the submitted buffer, but handlers can access fields beyond the declared body. A truncated body can therefore cause relocations to target the next command. Applying those relocations after validation can change an already validated command ID and bypass command restrictions. Legacy query conversion can also overwrite the next command, while texture-state parsing can access fields beyond a truncated final record. Check each handler's minimum body size before accessing command fields. Use the common prefix for shared handlers to preserve shorter command variants, and reject texture-state arrays containing incomplete records. Fixes: fb1d9738ca05 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU") Cc: stable@vger.kernel.org Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Link: https://patch.msgid.link/20261111193836.3161904-1-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit e757563f50deffbf1ec2a4e54b54f17359ac68ef Author: Zack Rusin Date: Mon Oct 26 23:15:33 2026 -0400 drm/vmwgfx: validate backup buffer size in command buffer processing commit c1e6267b9dd3e04f9dc29e500414cc4fc237dec1 upstream. vmw_cmd_res_switch_backup lets userspace bind an arbitrary MOB to a resource without checking that the MOB is large enough for the resource's guest_memory_size. The dirty-tracking bitmap is allocated based on the MOB size, but later accessed using the (larger) surface size, causing an out-of-bounds write in the bitmap that corrupts adjacent slab memory. Add a check that backup_offset + res->guest_memory_size does not exceed the buffer size before allowing the backup switch. DX shaders and stream outputs never set guest_memory_size, and both were allocated with kmalloc(), so the check would read uninitialized memory for SVGA_3D_CMD_DX_BIND_SHADER and SVGA_3D_CMD_DX_BIND_STREAMOUTPUT and could reject valid binds. Allocate both with kzalloc() so their guest_memory_size is 0 and the check only bounds the offset. Fixes: a97e21923b42 ("drm/vmwgfx: Hook up guest-backed surfaces") Cc: stable@vger.kernel.org Reported-by: Zero Day Initiative # ZDI-CAN-34068 Closes: https://lore.kernel.org/all/BYAPR01MB38301CFC012E873340F77E3D80662@BYAPR01MB3830.prod.exchangelabs.com/ Signed-off-by: Zack Rusin Reviewed-by: Ian Forbes Link: https://patch.msgid.link/20261027031533.2241918-1-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit d3e631b19734c342400f818f6d68e1ecefd11225 Author: Aldo Ariel Panzardo Date: Wed Oct 7 18:20:48 2026 -0300 drm/vmwgfx: return an error when a shared GB surface has no backup buffer commit 3a2f97af36754b64083d463a4cee0af26826bec8 upstream. vmw_gb_surface_reference_internal() rejects a surface that has no backup buffer by logging an error and jumping to out_bad_resource, but it never sets ret on that path. ret is still 0 from the earlier successful vmw_surface_handle_reference(), so the ioctl returns success while leaving the reply structure unfilled — user space is handed a "successful" reply that was never produced. DRM_VMW_GB_SURFACE_REF is DRM_RENDER_ALLOW, so an unprivileged local user can reach it. Set ret to -EINVAL and, on the error paths, drop the reference that vmw_surface_handle_reference() took; once the ioctl fails user space no longer releases it via DRM_VMW_UNREF_SURFACE. The unref is guarded by ret so the shared success fall-through keeps the reference the caller still owns, and it also plugs the same leak on the drm_gem_handle_create() failure path. Fixes: 14b1c33e8429 ("drm/vmwgfx: Add new ioctl for GB surface create and reference") Cc: stable@vger.kernel.org Suggested-by: Zack Rusin Signed-off-by: Aldo Ariel Panzardo Reviewed-by: Zack Rusin [zack: aligned a continuation line with the open parenthesis] Signed-off-by: Zack Rusin Link: https://patch.msgid.link/20261007212051.2574235-2-qwe.aldo@gmail.com Signed-off-by: Greg Kroah-Hartman commit f64dddb005d0b3514d213b66249dfe0a8d34ac0b Author: Zack Rusin Date: Tue Oct 27 04:29:38 2026 -0400 drm/vmwgfx: reserve dumb buffers while detaching their surfaces commit 13e766130673ec3b9df8b72ff1dbe6826cac1dfe upstream. vmw_bo_free() detaches the surface associated with a dumb buffer and clears its guest memory binding. It reserves the resource, but does not hold the buffer reservation required by vmw_resource_mob_detach(). TTM releases that reservation before invoking the buffer destructor. KMS clients destroying dumb buffers can therefore trigger the reservation assertion from vmw_resource_mob_detach(). GNOME reaches this path through DRM_IOCTL_MODE_DESTROY_DUMB during cursor and display updates. Reacquire the buffer reservation while detaching the surface and clearing its dirty tracking and guest memory binding. Acquire it after cmdbuf_mutex, following the command validation lock order, and release it before releasing the resource and GEM object. Fixes: d6667f0ddf46 ("drm/vmwgfx: Fix handling of dumb buffers") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Tested-by: fausten Link: https://patch.msgid.link/20261027211729.646988-5-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit 8b27b3fab81807dfe376824db7e3fff1f79b3b52 Author: Zack Rusin Date: Tue Oct 27 14:48:55 2026 -0400 drm/vmwgfx: reserve cursor MOBs before unpinning them commit 8a9b3b4c3a6cc95ea959183e20871d2421a6b986 upstream. vmw_cursor_mob_destroy() unpins cursor MOBs when discarding an image from the plane's cache or destroying the cursor plane. It calls ttm_bo_unpin() without reserving the BO, although TTM requires its reservation to be held when changing pin counts and LRU membership. KMS clients issuing repeated nonblocking cursor updates can exhaust the cache and reach this path. On a lockdep-enabled kernel this triggers reservation assertions in ttm_bo_unpin() and ttm_resource_unevictable(). Reserve the MOB around ttm_bo_unpin(), then release the reservation before dropping the BO reference. Fixes: 485d98d472d5 ("drm/vmwgfx: Add support for CursorMob and CursorBypass 4") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Tested-by: fausten Link: https://patch.msgid.link/20261027211729.646988-7-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit 15978fcadd559d83be8ddedab87a34ef3740459c Author: Zack Rusin Date: Thu Oct 29 02:22:25 2026 -0400 drm/vmwgfx: log MOB limits outside the manager spinlock commit eee4285a8c3c918bbd21791e17f2bb261a709792 upstream. vmw_gmrid_man_get_node reports MOB limit expansion and allocation failures through vmw_host_printf while holding gman->lock. The helper formats its messages with GFP_KERNEL allocations, which may sleep. KDE startup and desktop mode changes can reach this path, producing "BUG: sleeping function called from invalid context" from kvasprintf() while the manager spinlock is held. That's likely a separate bug because KDE shouldn't be using that much memory but to debug that properly stop filling kernel logs with warnings. Defer both host messages until after dropping the spinlock. Capture the failed allocation's page limit and roll back its accounting while locked, then report the error and free the resource after unlocking. Use drm_warn for the guest messages so they identify the device. Fixes: cfdc3458db8a ("drm/vmwgfx: Be a lot more flexible with MOB limits") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Link: https://patch.msgid.link/20261029215700.3009996-1-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit 3e8a3656f4a16f78cf02f670bc236fad4b807133 Author: Zack Rusin Date: Thu Oct 29 01:26:03 2026 -0400 drm/vmwgfx: log missing primary planes only once commit f01848d84577e5860a187eea64f5321acaf1f893 upstream. Stop filling kernel logs due to something that's not even a bug. Some igt tests, e.g. kms_flip trigger this message ~17000 times which makes all the other diagnostics almost impossible to find. Just inform the user about this condition once and let it through afterward. Fixes: a60ccade88f9 ("drm/vmwgfx: Fix crtc's atomic check conditional") Cc: stable@vger.kernel.org Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Link: https://patch.msgid.link/20261029215540.3008997-1-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit b1cf62e367349ea5be71b04a76c79aceead40555 Author: Zack Rusin Date: Tue Oct 27 02:07:05 2026 -0400 drm/vmwgfx: keep cursor mappings and pins with each plane state commit 556271f0ade9d3f1ed0a386f29d3363be294c1fc upstream. Cursor plane states duplicate the user object reference without acquiring its mapping or pin. Preparing the duplicated state nevertheless unmaps that object, and only pins the new buffer if it is not already pinned. Cleanup of an older state can therefore remove a mapping or pin still needed by another cursor commit. Repeated cursor updates from KMS clients can then access an unmapped or movable buffer. Give each prepared state its own mapping, buffer reference and pin, and reset the mapping when duplicating a state. Release only the resources owned by that state in cleanup_fb(). Map the required image extent for every state so resizing a cursor on the same buffer cannot reuse a smaller cached mapping. Unwind the pin and reservation if preparation fails. Fixes: 965544150d1c ("drm/vmwgfx: Refactor cursor handling") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Tested-by: fausten Link: https://patch.msgid.link/20261027211729.646988-2-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit efda1a01de085d0b65e161c43fb11864a0fe248b Author: Tomas M Date: Tue Oct 27 03:23:23 2026 +0200 drm/vmwgfx: include legacy hotspots in GB-only cursor images commit c116d38c3ad3ccdc1153ee7713c0eafd62b1c235 upstream. The guest-backed cursor path without cursor MOB support defines the image using only the hotspot from the plane state. Its position calculation also includes the legacy hotspot supplied through DRM_VMW_CURSOR_BYPASS. Xorg's xf86-video-vmware driver supplies its hotspot through that ioctl and loads the image with drmModeSetCursor(), which does not set a plane hotspot. The mismatched image and position hotspots displace the visible cursor by the legacy offset. Use the combined hotspot for both the GB-only image command and cursor position, matching the legacy and MOB image paths. Fixes: eef295a85082 ("drm/vmwgfx: Restore Guest-Backed only cursor plane support") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Tomas M Reviewed-by: Maaz Mombasawala Tested-by: fausten Signed-off-by: Zack Rusin Link: https://patch.msgid.link/20261027211729.646988-4-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit 9ab129648f1c81d7a0f214bee2cd942fcf5cd714 Author: Vladimir Popov Date: Tue Apr 14 13:55:27 2026 +0300 drm/vmwgfx: fix NULL pointer dereference in vmw_validation_bo_fence() commit 06f8a6708a98dff199ef7ea553b092efc38b4eab upstream. If vmw_execbuf_fence_commands() call fails in vmw_kms_helper_validation_finish(), it sets *p_fence = NULL. If ctx->bo_list is not empty, the caller, vmw_kms_helper_validation_finish(), passes the fence through a chain of functions to dma_fence_is_array(), which causes a NULL pointer dereference in dma_fence_is_array(): vmw_kms_helper_validation_finish() // pass NULL fence vmw_validation_done() vmw_validation_bo_fence() ttm_eu_fence_buffer_objects() // pass NULL fence dma_resv_add_fence() dma_fence_is_container() dma_fence_is_array() // NULL deref Fix this by adding a NULL check in vmw_validation_bo_fence(): if the fence is NULL, fall back to ttm_eu_backoff_reservation()to safely release the buffer object reservations without attempting to add a NULL fence to dma_resv. This is safe because when fence is NULL, vmw_fallback_wait() has already been called inside vmw_execbuf_fence_commands() to synchronize the GPU. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 038ecc503236 ("drm/vmwgfx: Add a validation module v2") Cc: stable@vger.kernel.org Signed-off-by: Vladimir Popov Reviewed-by: Zack Rusin Signed-off-by: Zack Rusin Link: https://patch.msgid.link/20260414105529.9883-1-popov.nkv@gmail.com Signed-off-by: Greg Kroah-Hartman commit 6964343538868869d603b2387af79b3bbd5de28f Author: Jaeyeong Lee Date: Sun Jul 26 13:08:56 2026 -0400 drm/vmwgfx: Erase the detached resource entry on resource release commit c4b134969ce350cdd4e726b5102b85b8a2d6fad5 upstream. vmw_bo_add_detached_resource() stores a raw struct vmw_resource pointer in bo->detached_resources without taking a reference on the resource, and the only place that erases the entry again is vmw_resource_mob_attach(). A resource that is never validated, and therefore never attached to its backing mob, keeps its entry until the buffer object itself is destroyed. vmw_resource_release() detaches the resource from the mob RB tree and drops its reference on the backing buffer object, but leaves the detached_resources entry in place. Userspace can hold an independent GEM handle on that buffer object, either because DRM_VMW_GB_SURFACE_CREATE returned one in rep.buffer_handle, or because DRM_VMW_GB_SURFACE_REF minted one with drm_gem_handle_create(). The buffer object then outlives the surface while still holding a pointer to freed memory. Any later surface lookup for that buffer object dereferences it: vmw_prime_handle_to_fd() vmw_lookup_surface_handle_for_buffer() vmw_lookup_user_surface_for_buffer() vmw_bo_surface() res->func->res_type <-- use-after-free read vmw_bo_surface() walks detached_resources before the mob RB tree, so the stale entry is matched first. The kref_get_unless_zero() in vmw_lookup_user_surface_for_buffer() does not help here: it runs after the dereference, and struct vmw_user_surface is freed with kfree_rcu() on a slab that is not SLAB_TYPESAFE_BY_RCU, so the memory is handed out to unrelated allocations once the grace period elapses. A sequence that reaches this from userspace is to create a guest-backed surface with drm_vmw_surface_flag_create_buffer, never validate it, release it with DRM_VMW_UNREF_SURFACE, and then call DRM_IOCTL_PRIME_HANDLE_TO_FD on the buffer handle returned by the create ioctl. All of the ioctls involved are DRM_RENDER_ALLOW. Erase the entry next to the existing vmw_resource_mob_detach() call, so that a released resource is removed from both containers, mirroring what vmw_resource_mob_attach() does. The dumb buffer teardown path in vmw_bo_free() clears res->guest_memory_bo before dropping its surface reference, so it does not reach this code and is unaffected. Fixes: d6667f0ddf46 ("drm/vmwgfx: Fix handling of dumb buffers") Cc: stable@vger.kernel.org Signed-off-by: Jaeyeong Lee Reviewed-by: Zack Rusin [zack: rebased; dropped the v7.2-rc4 analysis note from the commit message] Signed-off-by: Zack Rusin Link: https://patch.msgid.link/20260725143859.797134-1-finpiler@protonmail.com Signed-off-by: Greg Kroah-Hartman commit 48401cbf1a6a5c77d09d4e053a4980731372d4e1 Author: Aldo Ariel Panzardo Date: Wed Sep 23 09:26:01 2026 -0300 drm/vmwgfx: do not hand the embedded sg_table to the PRIME core commit 030e6d11d3e5eb7328f7a3e8177737a4b1c30654 upstream. vmw_gem_object_get_sg_table() returns vmw_tt->vsgt.sgt when the buffer object has already been DMA mapped. vmw_ttm_map_dma() sets that field to &vmw_tt->sgt, which is a member embedded inside the struct vmw_ttm_tt allocation and not a table of its own. The core owns whatever .get_sg_table returns. drm_gem_map_dma_buf() takes the table and drm_gem_unmap_dma_buf() destroys it in full: dma_unmap_sgtable(attach->dev, sgt, dir, DMA_ATTR_SKIP_CPU_SYNC); sg_free_table(sgt); kfree(sgt); Both are ops of drm_gem_prime_dmabuf_ops, so the core ends up calling kfree() on &vmw_tt->sgt, which is not the start of an allocation. The preceding sg_free_table() also destroys a scatterlist that vmwgfx still considers its own and frees again from vmw_ttm_unmap_dma(). drm_gem_unmap_dma_buf() runs from dma_buf_detach(), including the importer's error path, so a failed import is enough to reach it: exporting a bound buffer with DRM_IOCTL_PRIME_HANDLE_TO_FD and importing it on a second DRM device with DRM_IOCTL_PRIME_FD_TO_HANDLE is sufficient. Both ioctls are DRM_RENDER_ALLOW. Observed on 6.12.101 with KASAN, as uid 65534: BUG: KASAN: invalid-free in drm_gem_unmap_dma_buf+0xb3/0xf0 Free of addr ffff888008290450 by task poc_mm04_sgtabl/321 CPU: 1 UID: 65534 PID: 321 Comm: poc_mm04_sgtabl Not tainted 6.12.101 #4 kasan_report_invalid_free+0x94/0xc0 check_slab_allocation+0x116/0x120 kfree+0x103/0x360 drm_gem_unmap_dma_buf+0xb3/0xf0 dma_buf_detach+0x165/0x510 drm_gem_prime_import_dev+0x33e/0x430 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 80 bytes inside of 144-byte region [ffff888008290400, ffff888008290490) 80 is offsetof(struct vmw_ttm_tt, sgt) and 144 is sizeof(struct vmw_ttm_tt), which identifies the freed pointer as the embedded member. Always return a table the core can own, as the other drivers do. Reusing the cached representation would require copying it into a freshly allocated sg_table, never returning the alias. Fixes: 8afa13a0583f ("drm/vmwgfx: Implement DRIVER_GEM") Cc: stable@vger.kernel.org Signed-off-by: Aldo Ariel Panzardo Reviewed-by: Zack Rusin Signed-off-by: Zack Rusin Link: https://patch.msgid.link/20260923122601.438892-1-qwe.aldo@gmail.com Signed-off-by: Greg Kroah-Hartman commit 5cebc280b79dfa8d92497d6402514e95f94be587 Author: Zack Rusin Date: Thu Oct 29 10:45:07 2026 -0400 drm/vmwgfx: bound MKSSTAT lengths before rounding to pages commit 9725b0454e65f15ae76788f2004a7ba8b493362a upstream. vmw_mksstat_add_ioctl rounds the user-supplied 64bit lengths to page counts before comparing them with the descriptors page arrays. PFN_UP can wrap for lengths near U64_MAX. On 32bit kernels, storing a large page count in size_t can also truncate it to a value that passes the checks. A render-node client can therefore register a descriptor with lengths that exceed its pinned page arrays, including nonzero lengths with no backing pages. Compare each byte length with its page array's capacity before rounding or narrowing it. Compute those capacities in 64 bits and calculate the page counts only after all three lengths have passed validation. Sashiko reported this while reviewing the i386 hypercall changes. Fixes: 7a7a933edd6c ("drm/vmwgfx: Introduce VMware mks-guest-stats") Cc: stable@vger.kernel.org Closes: https://sashiko.dev/#/patchset/4ab10678a8f50053934b62b56af81f881c1d3798.1788414669.git.zack.rusin%40broadcom.com Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Link: https://patch.msgid.link/20261029215738.3010276-2-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit bfa73ced1176650d11f29feab037bb7ab0fc8580 Author: Zack Rusin Date: Thu Oct 29 10:44:49 2026 -0400 drm/vmwgfx: avoid underflow when stripping short GuestInfo replies commit 05ee42f3dd5484415fac587d0efb8fe846b74c2c upstream. vmw_host_get_guestinfo subtracts the two-byte reply prefix using max(reply_len - 2, (size_t)0). Since reply_len is unsigned, a one-byte reply wraps to SIZE_MAX instead of being clamped to zero. The subsequent copy can read past the host reply allocation. Theoretically malformed host reply can reach this path when the driver queries the GuestInfo parameter used to enable VKMS. Check the reply length before subtracting the prefix so short replies produce an empty payload and cannot cause an out-of-bounds read. Sashiko reported this while reviewing the i386 hypercall changes. Fixes: 89da76fde68d ("drm/vmwgfx: Add VMWare host messaging capability") Cc: stable@vger.kernel.org Closes: https://sashiko.dev/#/patchset/4ab10678a8f50053934b62b56af81f881c1d3798.1788414669.git.zack.rusin%40broadcom.com Signed-off-by: Zack Rusin Reviewed-by: Maaz Mombasawala Link: https://patch.msgid.link/20261029215738.3010276-1-zack.rusin@broadcom.com Signed-off-by: Greg Kroah-Hartman commit 955a2a1789aea24d0d987a71fb12aac10636d9f5 Author: Maíra Canal Date: Sat Nov 14 16:16:52 2026 -0300 drm/vc4: Look up the async page flip fence before committing the flip commit f9fc6da01a290609428d308033143f1d96ab658f upstream. vc4_async_page_flip_common() ignores dma_resv_get_singleton() failures. By then the plane state already points at the new framebuffer, so the flip is never completed. So, its state leaks, the vblank reference is never dropped and the event is never sent. Look up the fence before changing any state, so the error can be properly returned to userspace. Cc: stable@vger.kernel.org Fixes: d19e00ee06a9 ("drm/vc4: crtc: Fix out of order frames during asynchronous page flips") Reviewed-by: Iago Toral Quiroga Link: https://patch.msgid.link/20261114-vc4-async-flip-fixes-v2-3-d33cbe99ed5d@igalia.com Signed-off-by: Maíra Canal Signed-off-by: Greg Kroah-Hartman commit 5ca01d871e60682240e20f42b935557fbffc9908 Author: Maíra Canal Date: Sat Nov 14 16:16:51 2026 -0300 drm/vc4: Complete async page flips from an ordered workqueue commit 12a321af56c436e299414d8c276457dcf387e0cf upstream. Async page flips complete from a dma_fence callback, which runs in the fence signaling context: the VC4 render job IRQ handler on RPi 0-3 since commit e8941ac97f28 ("drm/vc4: Remove BOs seqnos"), and the V3D IRQ handler on RPi 4-5 since commit d19e00ee06a9 ("drm/vc4: crtc: Fix out of order frames during asynchronous page flips"). Completing the flip may sleep: on RPi 0-3, vc4_bo_dec_usecnt() takes bo->madv_lock, and on all platforms, dropping the last framebuffer reference takes fb_lock and can free the BO. When running the kernel with CONFIG_DEBUG_ATOMIC_SLEEP=y on RPi 3, this triggers the following warning: [ 2511.636319] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:623 [ 2511.636667] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 0, name: swapper/0 [ 2511.636681] preempt_count: 1000002, expected: 0 [ 2511.636689] RCU nest depth: 0, expected: 0 [ 2511.636698] locks held by swapper/0/0: 1, on CPU#0: [ 2511.636711] #0: ffff000037183198 (&fence->inline_lock){-...}-{3:3}, at: dma_fence_signal+0x88/0xec [ 2511.636892] Hardware name: Raspberry Pi 3 Model B Plus Rev 1.3 (DT) [ 2511.636899] Call trace: [ 2511.636991] mutex_lock_nested+0x24/0x30 [ 2511.637002] vc4_bo_dec_usecnt+0x40/0x124 [vc4] [ 2511.637070] vc4_async_page_flip_complete_with_cleanup+0xa0/0xc4 [vc4] [ 2511.637102] dma_fence_signal_timestamp_locked+0x118/0x290 [ 2511.637116] dma_fence_signal+0x9c/0xec [ 2511.637126] vc4_irq_render_job_done+0x24/0x114 [vc4] [ 2511.637158] vc4_irq+0x16c/0x274 [vc4] Make the fence callback only queue a work item on a per-CRTC ordered workqueue and complete the flip from it. Flips with no fence or an already signaled one still complete inline, but only after flushing that workqueue, so they can't complete before earlier flips on the same CRTC whose fence already signaled. Cc: stable@vger.kernel.org Fixes: d19e00ee06a9 ("drm/vc4: crtc: Fix out of order frames during asynchronous page flips") Fixes: e8941ac97f28 ("drm/vc4: Remove BOs seqnos") Reviewed-by: Iago Toral Quiroga Link: https://patch.msgid.link/20261114-vc4-async-flip-fixes-v2-2-d33cbe99ed5d@igalia.com Signed-off-by: Maíra Canal Signed-off-by: Greg Kroah-Hartman commit 1e2183b0583ee027bbbd66452e76a8cfb587225c Author: Maíra Canal Date: Wed Nov 18 18:47:30 2026 -0300 drm/vc4: Start shader code at varying offsets in its BO commit c0e1ed41ad86cf5230d64dc5f2c6d2e3aeb59937 upstream. VC4 is affected by the HW erratum GFXH-16: the QPUs can get stuck in a loop where instruction cache loads are evicted before they are used. The QPUs of a slice share one instruction cache. Shader BOs are page aligned and the code always starts at offset 0, so instructions at the same position in different shaders end up mapping to the same cache sets. When the four QPUs of a slice run four different shaders, their fills evict each other, no instruction executes and the hangcheck resets the GPU. Place each shader's code at one of four offsets, 256 bytes apart, inside its BO, and add the offset when relocating the shader record. Shader code is position independent, as the validator only accepts relative branches. The offsets are tracked per client, so shaders a given client creates in sequence (which tend to run together) start in different sets. Notice that this approach makes the livelock unlikely, but not impossible. The next commit will address the remaining cases. On a Raspberry Pi 3 running the issue's reproducer, GPU resets went from dozens in an hour to none. Cc: stable@vger.kernel.org Fixes: 463873d57014 ("drm/vc4: Add an API for creating GPU shaders in GEM BOs.") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/16652 Reviewed-by: Iago Toral Quiroga Link: https://patch.msgid.link/20261118-vc4-icache-workaround-v1-3-5b8adc2c84fe@igalia.com Signed-off-by: Maíra Canal Signed-off-by: Greg Kroah-Hartman commit 61d03864ad2727e8b6e1d4049aaa75dc02efcf03 Author: Maíra Canal Date: Wed Nov 18 18:47:28 2026 -0300 drm/vc4: Fix off-by-one in the shader record BO handle check commit 1fbbd14add401c70c178f0fa13016a3a53ef0de5 upstream. validate_gl_shader_rec() accepts a shader BO handle equal to exec->bo_count, reading one entry past the end of exec->bo[] and using it as a GEM object. Reject handles that aren't below exec->bo_count. Cc: stable@vger.kernel.org Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.") Reviewed-by: Iago Toral Quiroga Link: https://patch.msgid.link/20261118-vc4-icache-workaround-v1-1-5b8adc2c84fe@igalia.com Signed-off-by: Maíra Canal Signed-off-by: Greg Kroah-Hartman commit 0fa0cd6b06150858a093c8cbc5feb0a20024bd6d Author: Maíra Canal Date: Sat Nov 14 16:16:50 2026 -0300 drm/vc4: Drop BO usecnt before releasing the old FB commit 43b85636ea0d33152bf16816b7601e785723596d upstream. The async page flip completion drops the old FB reference before decrementing its BO usecnt. If that was the last reference, the BO is already freed or recycled into the BO cache when vc4_bo_dec_usecnt() runs, leading to a use-after-free or a refcount underflow. For example, while running glmark2-es2-drm in the Raspberry Pi 3, the following warning appears: [ 459.078834] ------------[ cut here ]------------ [ 459.078855] refcount_t: underflow; use-after-free. [ 459.078952] WARNING: lib/refcount.c:96 at refcount_dec_not_one+0xa0/0xa8, CPU#0: swapper/0/0 [ 459.079316] Call trace: [ 459.079323] refcount_dec_not_one+0xa0/0xa8 (P) [ 459.079335] vc4_bo_dec_usecnt+0x30/0x118 [vc4] [ 459.079371] vc4_async_page_flip_complete_with_cleanup+0xa0/0xc4 [vc4] [ 459.079395] dma_fence_signal_timestamp_locked+0xb0/0x12c [ 459.079408] dma_fence_signal+0x3c/0x6c [ 459.079416] vc4_irq_render_job_done+0x24/0xbc [vc4] [ 459.079440] vc4_irq+0x120/0x138 [vc4] This could happen when userspace removes the old FB and closes its GEM handle while the flip is still pending. Decrement the BO usecnt before releasing the old FB reference. Do this by unifying the two fence callbacks and only decrementing the BO usecnt in VC4_GEN_4. Cc: stable@vger.kernel.org Fixes: 4d12c36fb73b ("drm/vc4: crtc: Move the BO handling out of common page-flip callback") Reviewed-by: Iago Toral Quiroga Link: https://patch.msgid.link/20261114-vc4-async-flip-fixes-v2-1-d33cbe99ed5d@igalia.com Signed-off-by: Maíra Canal Signed-off-by: Greg Kroah-Hartman commit b3fc8ab06e0612028a952829fb335bbcf6a3c0fc Author: Maíra Canal Date: Wed Nov 18 18:47:31 2026 -0300 drm/vc4: Clear the slice caches before resetting a stalled GPU commit af1cf92e8617a7f7aa24b415596cbf64b76a12e7 upstream. Starting shader code at varying offsets makes the GFXH-16 icache livelock unlikely, but not impossible. When the livelock happens, the QPUs make no progress and the hangcheck resets the GPU, losing the job. When the hangcheck finds no progress, clear the slice instruction and uniforms caches and check again before resetting. If the stall is a livelock, clearing the caches can break it and let the job continue. Drop round_jiffies_up() from the hangcheck timer, so checks run every 100 ms instead of at the next whole second. This shortens the screen freeze before the caches are cleared. Long jobs are unaffected: while the control lists advance, the hangcheck won't clear the caches or reset the GPU. Cc: stable@vger.kernel.org Fixes: d5b1a78a772f ("drm/vc4: Add support for drawing 3D frames.") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/16652 Reviewed-by: Iago Toral Quiroga Link: https://patch.msgid.link/20261118-vc4-icache-workaround-v1-4-5b8adc2c84fe@igalia.com Signed-off-by: Maíra Canal Signed-off-by: Greg Kroah-Hartman commit 5c527b509856e9ebcac7dae30ff93a7ea5a82b68 Author: Maíra Canal Date: Wed Nov 18 18:47:29 2026 -0300 drm/vc4: Check for a validated shader before reading its thread mode commit 15da41dff1f66a389d238db60a1c19fa83582d07 upstream. validate_gl_shader_rec() reads the thread mode from the validated_shader of the FS, VS and CS BOs before checking it for NULL. A shader record pointing at a BO not created by DRM_IOCTL_VC4_CREATE_SHADER_BO has no validated_shader, so userspace can trigger a NULL pointer dereference. Check that every shader BO has a validated shader before using it. Cc: stable@vger.kernel.org Fixes: c778cc5df944 ("drm/vc4: Add fragment shader threading support") Reviewed-by: Iago Toral Quiroga Link: https://patch.msgid.link/20261118-vc4-icache-workaround-v1-2-5b8adc2c84fe@igalia.com Signed-off-by: Maíra Canal Signed-off-by: Greg Kroah-Hartman commit ed8c6329d35a48faa5cf68c8c88b11871ce3b8fd Author: Maíra Canal Date: Wed Nov 11 12:05:19 2026 -0300 drm/vc4: Hold a runtime PM reference while allocating the binner BO commit a7d7a25b566635ac1ee6af1c3ef06484cf752c3f upstream. bin_bo_alloc() arms the out-of-memory interrupt once it has allocated the binner BO, and accessing a V3D register requires the block to be powered. vc4_submit_cl_ioctl() already holds a runtime PM reference by the time it reaches vc4_get_bcl(), but vc4_create_bo_ioctl() reaches vc4_grab_bin_bo() without one, so the write can land on a suspended device. Take the reference in vc4_v3d_bin_bo_get(), which covers both callers, and take it before bin_bo_lock so that runtime PM is never waited for with the mutex held. Cc: stable@vger.kernel.org Fixes: 35c8b4b2c0fe ("drm/vc4: Allocate binner bo when starting to use the V3D") Reviewed-by: Iago Toral Quiroga Link: https://patch.msgid.link/20261111-vc4-irq-cleanup-v2-1-aa757bb742f2@igalia.com Signed-off-by: Maíra Canal Signed-off-by: Greg Kroah-Hartman commit 2bfc8490ea6c8896c46d0dca4888f9a0348fe952 Author: Wentao Liang Date: Fri Nov 6 09:20:16 2026 +0000 drm/vc4: Fix firmware reference leak in vc4_hvs_bind() commit af200e91c7b996177aa90981b2f0e794b085d43a upstream. The firmware reference taken via rpi_firmware_get() is leaked when either of the devm_clk_get() calls for the core or display clocks fails, as both error paths return without releasing it. Fix it by moving the firmware lookup below the clock lookups, so that the reference is taken right before the firmware property is read and released immediately afterwards. The rpi_firmware_find_node() call moves with it: the device node reference it returns would otherwise be leaked by those same error paths. The candidate was found by our static analysis tooling, and this change was prepared with assistance from DeepSeek-V4.1-Flash and GPT-6.1-Sol. Fixes: 2a001ca00ad5 ("drm/vc4: hdmi: Rework hdmi_enable_4kp60 detection code") Cc: stable@vger.kernel.org Suggested-by: Maíra Canal Signed-off-by: Wentao Liang Link: https://patch.msgid.link/20261106092016.2282805-1-vulab@iscas.ac.cn Signed-off-by: Maíra Canal Signed-off-by: Greg Kroah-Hartman commit 1ccd377376d705ab2a0c84d9b0113695e0acdc00 Author: Qiang Han Date: Sun Nov 8 06:07:11 2026 +0000 drm/amdkfd: wait for the queue quiesce in concurrent SVM evictions commit 8c417209754a9d2cd8dc1e78c0dfadefd0ad0e82 upstream. With XNACK off, svm_range_evict() leaves the GPU page tables in place and relies on the process's queues being stopped before the MMU notifier returns. Only the first eviction (evicted_ranges == 1) calls kgd2kfd_quiesce_mm(). The quiesce preempts every GPU the process has opened and takes milliseconds. Any other range invalidated in the meantime sees evicted_ranges > 1 and returns at once. The core mm then frees, migrates or reuses the page while the queues still run, and an in-flight SDMA or blit copy accesses it through the old GPU PTE. The result is silent corruption of the copy, or of whatever process now owns the page. Hold a new svms->evict_lock across the first evictor's quiesce, so that concurrent evictions return only after the queues have stopped. This is the scheme amdgpu_amdkfd_evict_userptr() uses with process_info->notifier_lock. evict_lock nests inside prange->lock and is taken nowhere else. Under it, the quiesce path takes the dqm lock, which is already used in MMU notifiers (memalloc_noreclaim). One way to reach this: a pageable hipMemcpy() larger than 1 MiB. ROCclr pins the buffer with hsa_amd_memory_lock(), libhsakmt registers it as a KFD SVM range, and host memory pressure (reclaim, compaction, allocator purge) invalidates the range. Fixes: 8a7c184a16d7 ("drm/amdkfd: svm range eviction and restore") Signed-off-by: Qiang Han Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher (cherry picked from commit d443bd2512c04a5d34c4473ce9ce2f2a6f7bf8f5) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 243660e5e967b8c0499970ff6db8d01a78c5c3e2 Author: Jesse Zhang Date: Tue Nov 3 23:54:21 2026 +0800 drm/amdkfd: keep the DMA addresses of a range intact if splitting fails commit 63b42ad2fdd371ae4a86658295943d60a86a519b upstream. svm_range_split_pages() splits the DMA address array of one GPU after the other, and each split replaces the old range's array by a shorter one. If a later GPU's array can't be allocated, the old range is left with the arrays of the earlier GPUs already shortened, but with its old size. Unmapping it then walks past their end. On navi31 with its iGPU, an SVM range accessible by both GPUs, and unmapping a page in its middle with allocations failing in turn through failslab: BUG: KASAN: slab-out-of-bounds in svm_range_dma_unmap_dev+0x13f/0x170 [amdgpu] Read of size 8 at addr ffff88819ac32800 by task kworker/8:1/171 svm_range_dma_unmap_dev+0x13f/0x170 [amdgpu] svm_range_dma_unmap+0x119/0x2c0 [amdgpu] svm_range_free+0x312/0x520 [amdgpu] svm_range_handle_list_op+0x326/0x500 [amdgpu] svm_range_deferred_list_work+0x338/0x790 [amdgpu] Allocated by task 2749: svm_range_copy_array.constprop.0+0x55/0x190 [amdgpu] svm_range_split+0x388/0x17b0 [amdgpu] svm_range_unmap_split+0x254/0x370 [amdgpu] svm_range_cpu_invalidate_pagetables+0xb29/0x11d0 [amdgpu] The buggy address is located 0 bytes to the right of allocated 2048-byte region [ffff88819ac32000, ffff88819ac32800) Split the arrays of all GPUs first and only replace the old ones once all succeeded. With that the 2759 unmaps of the same sweep give no report. Fixes: f80fe9d3c114 ("drm/amdkfd: map svm range to GPUs") Reviewed-by: Felix Kuehling Signed-off-by: Jesse Zhang Signed-off-by: Alex Deucher (cherry picked from commit 3cbd0b498ac18821ec01c08e39050a4d22ea9eeb) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit c7f095ca9a985d7c0ce01736842ede5b4cadfbdf Author: Apurv Mishra Date: Mon Oct 19 20:18:39 2026 -0400 drm/amdkfd: Don't reuse a VRAM page that is still referenced commit 8cd5429d429eced2441173b3306f7e137a4dc31f upstream. In svm_migrate_copy_to_vram(), skip VRAM pages with a non-zero refcount and leave those pages in system memory for this migration. When an svm_bo is reused, a VRAM page can still be held by an in-flight CPU fault (do_swap_page -> svm_migrate_to_ram). Migrating to VRAM then re-initializes the page via zone_device_page_init(), resetting its refcount. The fault's late put_page() frees the page mid-migration, so migrate_vma_finalize() never restores that PTE. It is left pointing at a freed system page and hmm_range_fault() hits BUG_ON in pfn_swap_entry_to_page() (swapops.h). Signed-off-by: Apurv Mishra Reviewed-by: Philip Yang Signed-off-by: Alex Deucher (cherry picked from commit 1f19aa7acacbce35584dd8f75a30880096fda6a4) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit a844e2c087711e36475f3ac4f39d44ee23fa793a Author: Jesse Zhang Date: Tue Nov 3 20:12:40 2026 +0800 drm/amdkfd: don't check the HMM range when getting its pages failed commit 264b67a79010cd3ffa85603d85e594867a45a01d upstream. When allocating the PFN array fails, amdgpu_hmm_range_get_pages() returns -ENOMEM before setting the notifier of the range, but svm_range_validate_and_map() still checks the range, as it is not NULL, before looking at the error. On navi48, setting SVM attributes with failslab: KASAN: null-ptr-deref in range [0x0000000000000050-0x0000000000000057] RIP: 0010:amdgpu_hmm_range_valid+0x66/0xa0 [amdgpu] svm_range_validate_and_map+0xaef/0x4e40 [amdgpu] svm_range_set_attr+0x193e/0x4610 [amdgpu] kfd_ioctl_svm+0x137/0x320 [amdgpu] Check the error first; it is only 0 when the pages were taken. Fixes: c0de552910bb ("drm/amdkfd: clean up the code to free hmm_range") Reviewed-by: Felix Kuehling Signed-off-by: Jesse Zhang Signed-off-by: Alex Deucher (cherry picked from commit c7036242655cb2c6d14a0d04138536e1ddb5e42c) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit bd66c7a5b12231c18acd57a2cba05920c6285dd9 Author: Perry Yuan Date: Fri Nov 6 11:11:09 2026 +0800 drm/amdkfd: check CRIU SVM priv data bounds before allocating commit 732239b002678d8c534503f52a16afc310095523 upstream. kfd_criu_restore_svm() allocated the per-range metadata before checking that the range fits in the user supplied private data buffer, so an out of range offset cost a pointless kzalloc()/kfree() round trip. Do the bounds check first and return -EINVAL directly. v2: - split the original patch into two, one change per patch (Yifan) Signed-off-by: Perry Yuan Reviewed-by: Yifan Zhang Signed-off-by: Alex Deucher (cherry picked from commit 0c3caec1161e458092364cb448e5bd165a26dcdb) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit d50a10d1ec1d235e0965b0eeeca7fe4e5baf510a Author: David Francis Date: Wed Nov 4 10:25:27 2026 -0500 drm/amdkfd: Acquire cwsr buffer during CRIU resume commit 86aa8332ab2b2296cda98cde189e2ec539c4e1b3 upstream. In normal kfd queue create, a reference to the cwsr svm range is acquired so that this buffer is not freed from underneath the queue. We weren't doing that. After svm ranges are restored in RESUME phase of CRIU, go through all the queues and acquire a reference to the cwsr. Signed-off-by: David Francis Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher (cherry picked from commit 5a00bdd267a5d87307f9aaddabf550f2410c9d40) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 5a56f10d99d03a2d90da54f578caa609a8517aaf Author: David Francis Date: Mon Sep 21 10:25:51 2026 -0400 drm/amdkfd: Acquire buffers in CRIU queue restore (again) commit 37820a7c716636b6ea499cc73875617886f4377f upstream. CRIU queue restore doesn't acquire the bo buffers in the same way normal queue creation does. In normal queue creation, the driver gets an additional reference on the queue's underlying buffers that lasts until the queue is destroyed; this prevents the queue's buffers from being removed from underneath it. Acquire them, but don't get the svm bo. SVM isn't yet fully restored by this point in CRIU and so there's no svm range to get. This will be addressed in the next patch. v2: Don't use checkpoint ctl_stack_size v5: Also avoid cwsr in criu failure path Signed-off-by: David Francis Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher (cherry picked from commit 56ca6fb5b148eb045aef34c4e05f1f56864611d5) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 51c384728e5a598e3261bf1187a500717e34b436 Author: Benjamin Cheng Date: Tue Oct 13 14:39:44 2026 -0400 drm/amdgpu: wait for tlb flush before freeing BO commit 11f1080ba1bd3df2b2539dab878b3e2a0a89681f upstream. On gem object close, we previously only attached the fence of its own clear_freed() call to the BO's resv. If an unmap of this BO happened prior to the close call, clear_freed() would be invoked, leaving vm->freed empty, and no meaningful fence to be attached to the resv. Because of that the memory may be freed before the TLB flush is complete, and give a running userq potential access to a stale address translation. Fix this by attaching the last_tlb_inv fence to the BO's resv. Fixes: a1d201e16940 ("drm/amdgpu: enable GFX-V11 userqueue support") Signed-off-by: Benjamin Cheng Reviewed-by: Christian König Signed-off-by: Alex Deucher (cherry picked from commit ab88e18030a1f2c340f64172287af19d1a48d3cc) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit bf8a8f4ec8ce0adf78019f5bd97c8c1805e0c663 Author: Kanala Ramalingeswara Reddy Date: Wed Oct 28 21:54:53 2026 +0530 drm/amdgpu: use supported SMU clock messages on SMU 15.0.0 commit 6c9ad0fc63930830f12a4ccc9555121cc7db0aee upstream. SMU 15.0.0 no longer implements SMU_MSG_SetHardMinGfxClk, or the SMU_MSG_SetHardMin and SMU_MSG_SetHardMax messages. Sending them makes the clock request fail. Program the GFX hard-min clock with SMU_MSG_SetSoftMinGfxclk, which this SMU firmware still supports. Fixes: c7fc0f372374 ("drm/amd: Enable SMU 15_0_0 support") Signed-off-by: Kanala Ramalingeswara Reddy Acked-by: Alex Deucher Signed-off-by: Alex Deucher (cherry picked from commit a6ae245cea297fae613145d5e4c74145f81f2ee1) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 736bec7c41bc5bd1993e4682362a09a003ee5f09 Author: Jiaming Fan Date: Tue Nov 10 15:15:26 2026 +0000 drm/amdgpu: unwind module init on failure commit be94997dd5558a0e53bee97306d659e9327dcab9 upstream. amdgpu_init() registers the ATPX handler with vga_switcheroo and allocates the ACPI XCC/NUMA info before it initializes KFD, but its error paths do not undo any of that: - when amdgpu_amdkfd_init() fails, only amdgpu_sync_fini() is called; - when pci_register_driver() fails, its result is returned as is, so KFD, the ATPX handler, the ACPI info and the sync slab cache are all left behind. A failed module init frees the module, so vga_switcheroo keeps a pointer to a handler in freed memory and /dev/kfd keeps file operations that point into it. A later amdgpu load cannot register its own ATPX handler, and vga_switcheroo_enable() calls into the stale one. The KFD path is easy to reach since KFD init failures are no longer ignored: kfd_init() returns -EINVAL for an out of range sched_policy or max_num_of_queues_per_device module parameter. Unwind in the reverse order of initialization, starting from the last step that succeeded, with the same calls and in the same order as amdgpu_exit(). amdgpu_amdkfd_fini() is a no-op when KFD was not initialized, which covers the ignored -ENOENT case, and amdgpu_unregister_atpx_handler() only removes a handler that amdgpu registered itself. Fixes: 4259a25341ab ("amdkfd: Only ignore -ENOENT for KFD init failuires") Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") Reviewed-by: Alex Deucher Signed-off-by: Jiaming Fan Signed-off-by: Alex Deucher (cherry picked from commit c2c34905fb40d3bddae0d2539830975781715e25) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 8cd112dabf9ea0591a52e5da821ae6e173466681 Author: Jesse Zhang Date: Wed Nov 4 00:16:11 2026 +0800 drm/amdgpu: release the IMU firmware with the other GFX microcode commit 85bea8c788852be6fd262381006dabd90946bda4 upstream. The IMU firmware of GFX11 and GFX12 is only released when loading the microcode fails. Every unload or unbind of such a device leaks it. On navi31, binding and unbinding the device leaves: unreferenced object 0xffff88810dd6cd80 (size 32): comm "modprobe", pid 2891, jiffies 4294943088 backtrace: _request_firmware+0x207/0xad0 request_firmware+0x3b/0x60 amdgpu_ucode_request+0x150/0x330 [amdgpu] amdgpu_device_init+0x2d70/0xa650 [amdgpu] amdgpu_driver_load_kms+0x1e/0x140 [amdgpu] a struct firmware of 132352 bytes, the size of gc_11_0_0_imu.bin. Release it in the free_microcode() functions; with that it's gone. Fixes: 289bcffb9d76 ("drm/amdgpu: support imu for gfx11") Fixes: 32d163768989 ("drm/amd/amdgpu: imu fw loading support") Fixes: a0f8297068cf ("drm/amdgpu: add imu support for gc 12_1") Reviewed-by: Alex Deucher Signed-off-by: Jesse Zhang Signed-off-by: Alex Deucher (cherry picked from commit ae8aff53de906d98982e3dc3c691a72eb81c844b) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit bb5c467e53191425991d2a54f77eb3b26e2fdf69 Author: Jiaming Fan Date: Tue Nov 10 15:14:59 2026 +0000 drm/amdgpu: only unregister the ATPX handler if we registered it commit 53fc1be11892a8e695937fdbc24db2699d23dabf upstream. amdgpu_register_atpx_handler() registers the ATPX handler with vga_switcheroo only when ATPX is detected, and ignores the result: vga_switcheroo has a single handler slot and refuses a second handler with -EINVAL. amdgpu_unregister_atpx_handler() calls vga_switcheroo_unregister_handler() in either case, and that clears the slot no matter who set it. So unloading amdgpu removes a handler registered by another driver, such as apple-gmux. No AMD GPU is needed for this; loading and unloading amdgpu is enough. Afterwards vga_switcheroo can no longer switch outputs, and a client that uses the vga_switcheroo runtime PM domain, such as nouveau on a non-Optimus machine with a v1 DSM, can dereference the now NULL handler during runtime suspend. Record whether the registration succeeded and unregister only in that case. Fixes: d38ceaf99ed0 ("drm/amdgpu: add core driver (v4)") Reviewed-by: Alex Deucher Signed-off-by: Jiaming Fan Signed-off-by: Alex Deucher (cherry picked from commit fbb6ebeff9d5327e8d06a83a3f7daa88422c9127) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit f0013739987c65425a49a9715fc9b0f686eb7fa3 Author: David Rosca Date: Fri Oct 9 12:56:57 2026 +0200 drm/amdgpu: Fix VCE buffer size check for DPB and input surface commit 87a841d8c0b711519fb76e2412bb293743f602bd upstream. In create command we get pitch and height for DPB, input surface pitch and height is in encode command. Fix the calculation to also consider different luma and chroma pitch. Acked-by: Leo Liu Reviewed-by: Ruijing Dong Signed-off-by: David Rosca Signed-off-by: Alex Deucher (cherry picked from commit 24c0be8ac3ef2eaa20f614b540e41382b5e97afc) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit b31259bed6f244fef1bf2487ce5bedf259aec3fe Author: Erhan Bilgili Date: Thu Nov 12 12:40:49 2026 +0100 drm/amdgpu: Fix UserQ slot availability checks commit cfb11282e0fbf5bd06e3f329f56dddc93e749679 upstream. The compute and DMA queries check each other's disable_uq flags. When the flags differ, this can hide available slots or report slots for disabled UserQs. Check gfx.disable_uq for compute and sdma.disable_uq for DMA. Fixes: 78d0a27ae0e2 ("drm/amdgpu: Add user queue instance count in HW IP info") Reviewed-by: Alex Deucher Signed-off-by: Erhan Bilgili Signed-off-by: Alex Deucher (cherry picked from commit ed4f6b1f8848ad8890fd188da6b2ddfdd538a036) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 317dab6ac8d0dfd2e1c99f6b565a44713f10d8fb Author: Christian König Date: Thu Oct 8 14:10:14 2026 +0200 drm/amdgpu: fix TLB invalidation fence handling v4 commit 566ed98e48be75a76eea34745815a51ba36687a8 upstream. After each unmap it might be necessary to invalidate the TLB to flush out VM changes to the HW and make it visible to executing work. We tracked that as part of the vm->last_update fence, but as pointed out by David it can be that this is overwritten by PDE updates when we have a combined unmap/map operation. In that case userspace doesn't correctly wait for the TLB invalidation to finish leading to all kind of problems (sq_int, page faults etc...). v2: fix ref leaking and error handling as pointed out by AI v3: fix inverted ! pointed out by Benjamin v4: fix || / && pointed out by Benjamin Signed-off-by: Christian König Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher (cherry picked from commit 892f46c7ae70969dbe0e0b88b5864df6f5582b98) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 6146cf4e496489b41afc6cdeea6f768cd8ae6a94 Author: Andrei Krautsou Date: Tue Nov 3 03:01:30 2026 +0300 drm/amdgpu: enable MGCG/FGCG/PERF_CLK for GC 11.0.2 commit 491aa2b083e18ef11d34f776bcb0e396a84f47e4 upstream. GC 11.0.2 (Navi33) never got the GFX MGCG, FGCG and PERF_CLK clock gating flags. GC 11.0.0, 11.0.1 and 11.0.4 have all three, GC 11.0.3 has MGCG. The gfx_v11_0 code behind these flags is shared by all GC 11 parts. Enable them for GC 11.0.2, same as for GC 11.0.0. Without the flags the driver does not clear the override bits in RLC_CGTT_MGCG_OVERRIDE (0x000605e7 under load), so this gating stays off. On RX 7600S the GFX clock is limited by the GFX TDC limit (68 A), in Linux and in Windows. With the gating off each MHz costs more GFX current, so PMFW stops at a lower clock than in Windows. vkpeak fp32-scalar for 300 s, median after the first 60 s, GFX current is about 68 A (TDC limit) in all cases: gfxclk VDDGFX GFLOPS current flags 2030 MHz 800 mV 8915 + MGCG 2261 MHz 873 mV 9921 + MGCG, FGCG, PERF_CLK 2314 MHz 894 mV 10104 Windows 11, AMD driver 910 mV 10157-10186 GFLOPS per MHz is the same, only the current per clock goes down. Windows shows other clock sensors, so there I compare GFLOPS only. With all three flags vkpeak is within 1% of Windows. MGCG gives most of the gain, FGCG and PERF_CLK add about 2% more. Tested on one laptop, ASUS TUF A16 FA617NS (RX 7600S, PMFW 82.97.0), Fedora kernel 7.2.11, Mesa 26.2.5, with the same flags set by a local debug patch. One 300 s vkpeak run for each setting and some gaming, no amdgpu errors in dmesg. Suspend/resume and long runs are not tested yet. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/6082 Signed-off-by: Andrei Krautsou Reviewed-by: Kenneth Feng Signed-off-by: Andrei Krautsou Signed-off-by: Alex Deucher (cherry picked from commit 85e5015b7879c04f7b9aabc865cdf7bcdf3d7470) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 5112515b83e7be925d90f6658c273d34016ed688 Author: Lijo Lazar Date: Wed Oct 7 17:26:35 2026 +0530 drm/amdgpu: Allow cancelling a requested NPS mode commit 9284db9e6ebf300b754b406525576d4848ea96f5 upstream. NPS mode change request doesn't allow to request the current mode. This causes an issue where a user stores a request and later wants to cancel the request by writing the current mode back. The pending request stays the same as before. Allow user to change the mode by comparing against the cached request. Writing the current mode back clears the pending request without asking for a reload. Fixes: 012be6f22c01 ("drm/amdgpu: Add sysfs interfaces for NPS mode") Signed-off-by: Lijo Lazar Reviewed-by: Asad Kamal Signed-off-by: Alex Deucher (cherry picked from commit 595b5879f1bf776a8c2d085253d3bff2d19dfb57) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit f86b4314b18ee4e66eae4bdfec927c934c3b915e Author: Allen Pan Date: Mon Nov 2 15:52:40 2026 -0500 drm/amd/display: Update DCN42B stutter latency to match DCN42 commit 007e7bf5692d93535adf943cd93c0e49b4e20e9d upstream. [Why] The DCN42B stutter latencies do not match DCN42, which can lead to underflow and stutter issues. [How] Update the DCN42B LPDDR5/LPCAMM2 stutter latencies to the same values DCN42 already uses. Cc: Dillon Varone Cc: Charlene Liu Cc: Mario Limonciello Cc: Alex Deucher Reviewed-by: ChiaHsuan Chung Signed-off-by: Allen Pan Signed-off-by: Wayne Lin Tested-by: Dan Wheeler Signed-off-by: Alex Deucher (cherry picked from commit c6b576ac64cedc990f3885efa85603fe5998da3f) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit ceb420eaa0d97ee8a96e0332db0ea98244ee2969 Author: Hugo Sales Date: Thu Oct 29 16:54:20 2026 +0000 drm/amd/display: Take every stream out of self-refresh before a modeset commit 09b6bf1a04cc6bbcbb8bb29fa1e38fa8a9f8d1dc upstream. Commit 3c108046e1d6 ("drm/amd/display: Add power module on Linux") dropped amdgpu_dm_psr_disable_all() and amdgpu_dm_replay_disable_all() from amdgpu_dm_commit_streams(). Since then, a modeset only disables self-refresh on the CRTCs in the commit, so an eDP on another CRTC stays in PSR through dc_commit_streams() Commit 6ee90e88b976 ("drm/amd/display: PSR eDP p-state warning occurs intermittently after unplug DP") added that disable-all for this very case. With it gone, turning off or unplugging an HDMI monitor while the eDP is in PSR hangs DMUB on a Cezanne laptop (DCN 2.1), on the first try: dc_dmub_srv_log_diagnostic_data: DMCUB error Error queueing DMUB command: status=2 The eDP then stays frozen until a GPU reset Do the same through the power module's events. When a CRTC that is or was active needs a modeset, raise the PSR and Replay pause events on every stream mod_power tracks and wait for self-refresh to exit, before amdgpu_dm_mod_power_update_streams() changes the stream set. Clear them on the commit's streams after amdgpu_dm_mod_power_setup_streams(), since enabling a stream clears psr_feature_enabled until then. Use psr_event_pause and replay_event_pause rather than the hw_programming events, which a fast update on the eDP can clear in amdgpu_dm_enable_self_refresh() while the modeset is still running Fixes: 3c108046e1d6 ("drm/amd/display: Add power module on Linux") Reviewed-by: Ray Wu Signed-off-by: Hugo Sales Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher (cherry picked from commit 5d90fdb959505b5f42f2dec699521ac56b4174be) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 5aad587527211ea74b937b598d12c6ace5b8380c Author: Egor Perevoshchikov Date: Sat Oct 31 07:00:50 2026 +0300 drm/amd/display: Restore PSR-SU guard in power module commit 57decaa0e378bf2481eae5f49293a5202976a19e upstream. Commit a5ce8695d6d1 ("drm/amd/display: Avoid configuring PSR granularity if PSR-SU not supported") restricted DSC slice-height configuration to PSR-SU. The power-module integration removed that guarded caller. Its replacement in mod_power_psr_notify_mode_change() calls psr_su_set_dsc_slice_height() unconditionally and ignores its return value. On PSR1 links with a DSC slice configuration, this applies a PSR-SU-only alignment check even though selective update is not enabled. If the calculated DSC slice height is not a multiple of the nonzero advertised SU Y granularity, the helper triggers an assertion. It also sets dsc_slice_height before failing the check, so the caller passes this SU-specific value into PSR1 setup despite the failure. Restore the PSR version guard and failure handling in the new caller. PSR1 proceeds with the zero-initialized DSC slice height, while PSR-SU retains its alignment validation and stops setup if that validation fails. Fixes: 3c108046e1d6 ("drm/amd/display: Add power module on Linux") Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/3027 Reviewed-by: Ray Wu Signed-off-by: Egor Perevoshchikov Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher (cherry picked from commit 83558fcf83cc911e09962ea17c883add596766c0) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 980135ba4b4342a827befe330f00c08ee0adb571 Author: Wenjing Liu Date: Wed Nov 4 14:39:45 2026 -0500 drm/amd/display: Read DRAM channel width from SMU init table commit 3846f4542b4ba5a95405527d1e68864a9e9f3fcf upstream. [Why] The channel count came from the SMU init table but the channel width came from VBIOS vram info. Both values need to describe the same memory type. [How] Add DramChannelWidthBytes to MemoryConfig_t, using a reserved slot so the layout is unchanged. Populate the channel width in bw_params from the init table instead of VBIOS vram info. Cc: Dillon Varone Cc: Mario Limonciello Cc: Alex Deucher Reviewed-by: ChiaHsuan Chung Signed-off-by: Wenjing Liu Signed-off-by: Wayne Lin Tested-by: Dan Wheeler Signed-off-by: Alex Deucher (cherry picked from commit 37d64c58f610d771b7ab8cfbf7d9f5606939947b) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit de5818e8a0d70020fac8ec65699556c33e8d5a5b Author: Davey Hughes Date: Wed Oct 28 15:54:12 2026 -0700 drm/amd/display: Keep FreeSync flip timing across plane resets commit fff46a322847a54cf11d5af3d7fc7fa07bc71b29 upstream. dm_update_plane_state() replaces the DC plane with a newly allocated one whenever the plane is reset. The new plane's flip timing is zero, and mod_freesync_handle_preflip() runs before DC stores the new plane's first flip timestamp, so FreeSync takes the 32-bit microsecond timestamp itself as the last render time: the monotonic clock modulo about 71.6 minutes. On a panel with below-the-range compensation (BTR), that engages BTR and pins the frame time at the BTR mid-point (13.447 ms on a 48-165 Hz panel). A panel without BTR (max refresh below twice the min) goes through the fixed refresh path instead and locks to its max refresh after six frames. It takes a reset on every flip to keep the panel there, and color management changes reset the plane. DRM sets color_mgmt_changed whenever a color property is given a different blob, even one with the same contents, and KWin 6.8.1 with HDR enabled and its color accuracy setting at "Prefer efficiency" sets a new GAMMA_LUT blob on every commit (current KWin master no longer does). Plane resets for CRTC color changes, added by commit 7316c4ad2996 ("drm/amd/display: Reset planes for color management changes"), and later for plane color properties and colorops, made this reachable on every flip. Copy the flip timing from the old DC plane into the new one when the plane stays on the same CRTC. Do it in amdgpu_dm_commit_planes() before the preflip, after drm_atomic_helper_wait_for_dependencies() has waited for the previous commit, so the copy holds that commit's flip and does not race with DC writing it. This covers both the BTR and the fixed refresh path. A plane that is newly enabled or moved to another CRTC still starts without history. Fixes: 180db303ff46 ("drm/amd/display: Add below the range support for FreeSync") Reviewed-by: Harry Wentland Signed-off-by: Davey Hughes Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher (cherry picked from commit 4acf82d2a2dcca2d7df8649ecafb3da6c1245003) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit bf13a9cf02314505a0ecb0cf8ea633dae4366b07 Author: Austin Zheng Date: Wed Sep 23 14:58:32 2026 -0400 drm/amd/display: Flip dml2_core_utils_get_segment_horizontal_contiguous() Inputs commit 8bcb6863ac318dfadf622598171c79a020fdd7ff upstream. [Why/How] Parameters for dml2_core_utils_get_segment_horizontal_contiguous() should be flipped. Should be swizzle mode then bytes per pixel. Cc: Dillon Varone Cc: Mario Limonciello Cc: Alex Deucher Reviewed-by: ChiaHsuan Chung Signed-off-by: Austin Zheng Signed-off-by: Wayne Lin Tested-by: Dan Wheeler Signed-off-by: Alex Deucher (cherry picked from commit 8e985b38672c3de9355dd8f166527f96e472706c) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 5ef929cc2e90b1a2bb76b99df4bb72a550cc9a01 Author: Jackie Liu Date: Mon Oct 26 19:10:47 2026 +0800 drm/amd/display: Fix logger leak on perf trace allocation failure commit 5b148562d193fd63e5d1ae3c442d3d54403c7e51 upstream. dc_construct_ctx() allocates a logger and stores an alias in dc->dml.logger before allocating the performance trace object. If dc_perf_trace_create() fails, the function frees dc_ctx without releasing the logger. Since dc->ctx is assigned only after the trace allocation succeeds, dc_destruct() cannot reclaim the logger on this error path. Free the logger before discarding dc_ctx and clear dc->dml.logger to avoid leaving a dangling alias after the failed construction. Fixes: 5d72e247e58c ("drm/amd/display: switch DC over to the new DRM logging macros") Reviewed-by: Wayne Lin Signed-off-by: Jackie Liu Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher (cherry picked from commit ac088505e74932f276ea6e3bbe19713e5770e7a1) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 1ff7f07d7581138a933f69786a179ce6459af56d Author: Paul Menzel Date: Tue Oct 27 21:52:22 2026 +0100 drm/amd/display: Don't warn about vendor infoframe for non-infoframe sinks commit 2b784f5e78694d4d852053b3eef3de3f0ff1d02e upstream. With an EIZO EV2781 connected over HDMI to an AMD Ryzen 3 2200G (Raven) on an MSI B350M MORTAR (MS-7A37), Linux logs at every boot since v6.16: amdgpu 0000:30:00.0: [drm] Failed to setup vendor infoframe on connector HDMI-A-1: -22 Commit 6027cbee1900 ("drm/amd/display: Add error check for avi and vendor infoframe setup function") started to log the return value of drm_hdmi_vendor_infoframe_from_display_mode(). With `frame` and `mode` being non-NULL, the helper only fails with -EINVAL, if the sink does not support HDMI infoframes, that means, if `connector->display_info.has_hdmi_infoframe` is false, and its kernel-doc says, that this error can be safely ignored. drm_parse_hdmi_vsdb_video() only sets `has_hdmi_infoframe`, if the HDMI VSDB has HDMI_Video_present set, and drm_parse_hdmi_forum_scds() sets it for sinks with an HF-SCDB. So an HDMI sink, whose VSDB lacks HDMI_Video_present, triggers the warning, although nothing failed. The EIZO EV2781 is such a sink. Its HDMI VSDB has a payload of only seven bytes (source physical address, Supports_AI, and a maximum TMDS clock of 250 MHz), so the byte with HDMI_Video_present is absent, and the EDID has no HF-SCDB: 67 03 0c 00 10 00 80 32 Only warn, if the sink supports HDMI infoframes. The infoframe setup itself is unchanged. Fixes: 6027cbee1900 ("drm/amd/display: Add error check for avi and vendor infoframe setup function") Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/5025 Reviewed-by: Wayne Lin Signed-off-by: Paul Menzel Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher (cherry picked from commit 2abfc667f622eb7132b139db2e175642713662f8) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit e67af5e2d908aa7413c4d3ec38d5944bc4b7022b Author: Adrian Betschart Date: Thu Oct 29 08:45:58 2026 +0100 drm/amd/display: Apply the HDMI RGB range default only to HDMI signals commit 6fd6e75162065c7ac9a4a7f3cf303574f0505d97 upstream. Since d23f735d0eac, Broadcast RGB "Automatic" selects limited range on CTA modes when display_info.is_hdmi is set. That flag comes from an HDMI VSDB in the EDID and says nothing about the link, so a native DisplayPort monitor whose EDID carries an HDMI VSDB now gets limited range on CTA modes too. Monitors that ignore the DP range signal show grey blacks, where 7.2 sent full range. Require an HDMI signal as well, as the original commit intended. DP++ passive adapters drive an HDMI signal and keep the HDMI behaviour; native DP, DP MST and active DP-to-HDMI converters get full range again. Reported and analysed by Andrés Rodríguez in the issue below. Fixes: d23f735d0eac ("drm/amd/display: Default HDMI RGB output to limited range on CTA modes") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/6052 Reviewed-by: Wayne Lin Signed-off-by: Adrian Betschart Signed-off-by: Wayne Lin Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Alex Deucher (cherry picked from commit 39f37a2346410a33edf4af17a873ac96bb5244ce) Cc: stable@vger.kernel.org # 7.3 Signed-off-by: Greg Kroah-Hartman commit 0373c161b31cfe68027702fa874d8389344a089a Author: Hugo Sales Date: Tue Nov 3 13:15:57 2026 +0000 drm/amd/display: Add the AUX backlight minimum once on the custom curve commit 988ab04d773ac089588ce17742f491e9ee8b1793 upstream. On an AUX backlight, convert_brightness_from_user() maps the user level through the ATIF custom brightness curve with convert_custom_brightness(), which rescales the result to user_min..user_max. convert_brightness_from_user() then rescales it again, from 0..user_max to user_min..user_max, so the minimum goes in twice. On the 1..512 nits AUX fallback range, a request for 0 gives 1998 millinits instead of 1000 Rescale the curve's output to 0..user_max and leave the offset to the caller Fixes: 8dbd72cb7900 ("drm/amd/display: Export full brightness range to userspace") Reviewed-by: Ray Wu Signed-off-by: Hugo Sales Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher (cherry picked from commit 5f95ef2cfd208ca7efe446abfc9e3144dc5ce4fa) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 768c93fdfbebc34b8e638029c832cbb04a09e315 Author: Abdulla Bubshait Date: Wed Oct 28 16:26:41 2026 -0400 drm/amd/display: Abort DPMS ON when enabling the link fails commit 4aa51b904cac06fe2c82623ce24d80853af730f6 upstream. Since commit 843049bac7c0 ("drm/amd/display: Split DPMS ON into parts"), link_set_dpms_on_enable_link() returns DC_DPMS_FAILED_HANDSHAKE when enable_link() fails and the stream enable has to be aborted: any failure other than link training, or a link training failure on DP MST. The link has already been disabled at that point. The step loop in link_set_dpms_on() treats DC_DPMS_FAILED_HANDSHAKE like DC_DPMS_SUCCESS and goes on to link_set_dpms_on_post_enable_link(). Before the split, this path returned right after disable_link(), because MST displays can't proceed without link training. Now, for failed MST handshakes MST slots are still allocated. When the link trains again later, the new payload starts after the leaked slots so ACT never completes, and the display stays black until reboot. Replugging or power-cycling the monitor does not recover it. Seen on Navi 33 (DCN 3.2.1) with a DP 2.1 MST monitor (Odyssey Neo G9) at UHBR10 x4 with DSC. Link training sometimes fails on DPMS wake. With this change, the failed attempt leaves no payload behind, and the next modeset after the sink reconnects bring the monitor back up. Return early on DC_DPMS_FAILED_HANDSHAKE, as for DC_DPMS_SKIPPED_HANDSHAKE. This restores the pre-split behaviour. Link training failures on non-MST signals still return DC_DPMS_SUCCESS and continue as before. Closes: https://gitlab.freedesktop.org/drm/amd/-/work_items/6047 Fixes: 843049bac7c0 ("drm/amd/display: Split DPMS ON into parts") Reviewed-by: Wayne Lin Signed-off-by: Abdulla Bubshait Signed-off-by: Wayne Lin Signed-off-by: Alex Deucher (cherry picked from commit ece3dae13fb106684f8248f88387b1fbcfef8206) Cc: stable@vger.kernel.org # 7.3 Signed-off-by: Greg Kroah-Hartman commit 6802a9849071db6e576b3e05924cf8dad99be5cc Author: Ivan Lipski Date: Wed Oct 28 11:11:11 2026 -0400 drm/amd/display: Fix __udivdi3 link error in DCN6 DML2 commit d489c42c9bd542b3fbbda97b97dc9a0b07010eb3 upstream. [Why&How] dchub_v2_get_sop_total_available_bandwidth_KBps() and dchub_v2_is_qos_bandwidth_supported_by_sop() divide 64-bit integers by 100. On 32-bit builds this emits a call to __udivdi3, which the kernel does not link. Use double-cast division instead. Fixes: 7f7d7ea1fa51 ("drm/amd/display: Add new sources for DCN6") Cc: Linlin Yang Cc: Mario Limonciello Cc: Alex Deucher Cc: Dillon Varone Signed-off-by: Ivan Lipski Reviewed-by: Alex Hung Signed-off-by: Alex Deucher (cherry picked from commit 83e7c8cb33363f2a2f893758c630f9a805ac4573) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 361e3f50f44d068876cdbe53c807ff67e19f0644 Author: Timur Kristóf Date: Tue Oct 6 19:03:52 2026 +0200 drm/amdgpu/vce1: Fix checking whether VCE1 is idle commit 4807d0757c1e8ef8aff6d0e65d99f3820fea9833 upstream. It turns out that the VCE_STATUS register bits that we used to check whether VCE1 is idle are actually not useful: VCE_STATUS.JOB_BUSY doesn't exist until VCE3 VCE_STATUS.UENC_BUSY seems to be stuck high on Cape Verde Instead, do the following: Check that the read and write pointer matches for each ring. Check VCE_STATUS.VCPU_REPORT bits to check busy status. Finally, also check SRBM_STATUS2.VCE_BUSY just in case, although this one seems bogus on VCE1. Fixes: d4a640d4b9f3 ("drm/amdgpu/vce1: Implement VCE1 IP block (v2)") Acked-by: David Rosca Signed-off-by: Timur Kristóf Signed-off-by: David Rosca Signed-off-by: Alex Deucher (cherry picked from commit 0db6125a171f81422736850e3a7fefdf23380073) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 658558b5297888abb7af4157cd024138f2021937 Author: Wang Jiang Date: Tue Nov 10 16:34:53 2026 +0800 drm/amdgpu/gfx_v9_0: Add gfxoff quirk for Lenovo Picasso 318F commit 24916f2c98f86c90db617d0e828d930d7a35577e upstream. GFXOFF causes gfx ring timeout and desktop freeze on Lenovo 90NYA05DCD (Ryzen 5 3400G, Picasso). Add a quirk entry with ANY_REV marker to disable gfxoff for subsystem 17aa:318f regardless of chip revision. Reviewed-by: Alex Deucher Signed-off-by: Wang Jiang Signed-off-by: Alex Deucher (cherry picked from commit 32a647c3218d8bb5bf03f68784fbc405c1e5fbd3) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 466291cf53266633ef9e551dffe96a2dc2003ad5 Author: Joshua Horne Date: Mon Nov 9 21:01:45 2026 -0500 drm/amd/pm: send smu8 sclk level indices, not the level mask commit 535f6852652e3239c8688491ccd0ed4b6e09d14f upstream. smu8_force_clock_level() passes the pp_dpm_sclk level mask straight to PPSMC_MSG_SetSclkSoftMin and PPSMC_MSG_SetSclkSoftMax, which take a level index, as the other smu8 callers do through smu8_get_sclk_level(). In manual mode, "echo 0 > pp_dpm_sclk" thus selects level 1, "echo 2" selects level 4, and masks above the highest level index are out of range for the SMU, so e.g. "echo 3", "echo 7" or "echo 0 1 2 3 4 5 6 7" do not select the requested levels. The original single level version sent 1 << level and had the same problem. Send the lowest and highest level in the mask, as smu10 does, and reject levels above those the SMU has enabled, as smu10 and vega20 do. Fixes: d7341ef66870 ("drm/amd/powerplay: add some hwmgr functions for sysfs interface on Carrizo") Reviewed-by: Alex Deucher Signed-off-by: Joshua Horne Signed-off-by: Alex Deucher (cherry picked from commit 8ff6b368360adb24ccf145047b0261dfae77f28a) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 5ce06bf13e9650103d5ee9ae6c2e6ca4cbd66f85 Author: Igor Paunovic Date: Tue Sep 22 10:01:05 2026 +0200 accel/rocket: number the cores by devicetree position, not bind order commit 97e48904cbdb32e4a66bd60d26ce45657f58bc46 upstream. rocket_job_hw_submit() programs the S_POINTER registers of a core with an extra bit derived from core->index, the way the vendor driver derives it from the hardware number of the core. rocket_probe() sets core->index to the slot the core takes in rdev->cores[], which is the order the cores bind in. The two agree only while the cores that bind are a prefix of the core nodes in the devicetree, in devicetree order. Unbind them and bind them back with a different core first, have one core's probe deferred behind a sibling's, or disable a core other than the last one, and every task submitted to a core whose slot is not its hardware number times out after 500 ms. The reset that follows does not help, and the inference finishes with wrong output. Observed on an Orange Pi 5 Plus with a KASAN build, over all six bind orders of the three cores: only the devicetree order ran clean. The other five produced 27 to 141 "NPU job timed out". In four of them no output tensor changed with the input, and the harness gave up before its first measured round; the fifth got through a six-second run with 27 timeouts and a wrong top-1 class. All but one of the timeouts land on the cores whose slot is not their hardware number, in proportion to the tasks the scheduler hands them, and in both directions of the mismatch. Number the cores by their position among the core nodes in the devicetree instead, which is what the hardware number is. The wrong value has been assigned since the driver was added, but it only reached the hardware once the extra bit was introduced, hence the Fixes tag below. Fixes: 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL") Cc: stable@vger.kernel.org Assisted-by: LLM sparse Signed-off-by: Igor Paunovic Reviewed-by: Heiko Stuebner [tomeu: shortened the comments and dropped checkpatch from Assisted-by] Reviewed-by: Tomeu Vizoso Signed-off-by: Tomeu Vizoso Link: https://patch.msgid.link/20260922080114.44662-3-royalnet026@gmail.com Signed-off-by: Greg Kroah-Hartman commit 7afe08917db543e5f16aa0ce90c3557876592249 Author: Thomas Hellström Date: Mon Oct 19 11:56:52 2026 +0200 drm/xe: Don't abort the shrinker walk on -EBUSY commit 9de430b6fbbdfeee1a5eec33edf53f52c13c869b upstream. xe_bo_shrink() returns -EBUSY for bos that can't currently be shrunk, for example imported dma-bufs, bos whose vm is currently validating, bos that are still busy after the wait timeout, or bos whose backup fails. The shrinker LRU walk treats any negative return value as fatal and aborts, which also skips the remaining shrinker passes. As a result, a single such bo, like an imported dma-buf on the XE_PL_TT LRU, prevents reclaim of all bos behind it on the LRU. Skip bos for which xe_bo_shrink() returns -EBUSY and continue the walk, like the TTM LRU walk does. v4: - Patch introduced. Fixes: 00c8efc3180f ("drm/xe: Add a shrinker for xe bos") Cc: Christian König Cc: Matthew Brost Cc: Rodrigo Vivi Cc: intel-xe@lists.freedesktop.org Cc: # v6.15+ Assisted-by: LLM Signed-off-by: Thomas Hellström Reviewed-by: Matthew Brost Link: https://patch.msgid.link/20261019095655.3501-2-thomas.hellstrom@linux.intel.com (cherry picked from commit 846f333b3e0b48065f96bee74ffa0b9d390ed05f) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman commit ad7f42b9dd023b78401e033cea192f33fbe7d94d Author: Sanjay Yadav Date: Wed Nov 11 14:34:02 2026 +0530 drm/xe/query: Use ordered clock reads for engine cycles cpu_delta commit 65ef9dec511c018bcbe5993e9749c52c26e573e2 upstream. cpu_delta is meant to bound the time taken to read the engine timestamp register, but it is measured with local_clock(), which on x86 is a plain RDTSC that is not ordered against loads. Either end of the window can thus be sampled while an earlier MMIO read is still in flight. A reproducer looping on DRM_XE_DEVICE_QUERY_ENGINE_CYCLES on BMG reports cpu_delta as low as 18 ns, while the MMIO read alone takes > 1.5 us. Use ktime_get_raw_ns() at both ends instead. Its clocksource read is ordered (rdtsc_ordered() on x86). With this, the reproducer reports min/median cpu_delta of 1567/1745 ns and no short values. Fixes: 7793d00d1bf5 ("drm/xe: Correlate engine and cpu timestamps with better accuracy") Cc: # v6.8+ Cc: Umesh Nerlige Ramappa Cc: Matthew Brost Cc: Rodrigo Vivi Suggested-by: Aleksander Czerwionka Signed-off-by: Sanjay Yadav Reviewed-by: Umesh Nerlige Ramappa Signed-off-by: Umesh Nerlige Ramappa Link: https://patch.msgid.link/20261111090401.975803-2-sanjay.kumar.yadav@intel.com (cherry picked from commit 146dec4ce1f0794fefe5ad1d549655745358b515) Signed-off-by: Matthew Brost Signed-off-by: Greg Kroah-Hartman commit 909234c3fa83ccc568bd34f7e1a6909e1785ab90 Author: Matthew Auld Date: Thu Oct 15 11:34:16 2026 +0100 drm/xe/madvise: use already clamped pat_index commit eeae08f98bda4350baa5a76f37b23fab4fa426f7 upstream. Pass the nospec-clamped pat_index to check_pat_args_are_sane() instead of the raw args->pat_index.val, and fold into the preceding DRM_XE_MEM_RANGE_ATTR_PAT block. Assisted-by: LLM Reported-by: Sashiko Closes: https://sashiko.dev/#/message/sashiko-outbox-172627%40kernel.org Fixes: 016ccdb674b8 ("drm/xe/uapi: Reject coh_none PAT index for CPU cached memory in madvise") Signed-off-by: Matthew Auld Cc: Alan Previn Cc: Tejas Upadhyay Cc: # v7.2+ Reviewed-by: Matthew Brost Reviewed-by: Tejas Upadhyay Link: https://patch.msgid.link/20261015103415.442931-2-matthew.auld@intel.com (cherry picked from commit 3be1bd59ced603d2e6a6ba9a4fe274308cea9965) Signed-off-by: Matthew Brost Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman commit 5b73d3f04a7d0d48adab8c6c440a7ef222356a53 Author: Zongyao Bai Date: Mon Nov 16 11:22:19 2026 -0800 drm/xe/guc: Treat CT-disabled TLB invalidation as cancelled commit b865310c41f5b68c7de3bec86f205ba8cd284fd1 upstream. During a GT reset the GuC CT channel goes through two states before it is enabled again: gt_reset_worker() xe_uc_stop() ENABLED -> STOPPED send: -ECANCELED xe_tlb_inval_reset() do_gt_reset() do_gt_restart() xe_uc_sanitize_reset() STOPPED -> DISABLED send: -ENODEV GuC load, CT enable DISABLED -> ENABLED xe_tlb_inval_issue() treats -ECANCELED as "undelivered, report done", but -ENODEV is propagated to the caller. A userptr invalidation from an MMU notifier (e.g. munmap() on a fault-mode VM) issued in the DISABLED window thus trips the XE_WARN_ON() in xe_vma_userptr_do_inval() and taints the kernel: Tile0: GT1: GT: reset started WARNING: drivers/gpu/drm/xe/xe_userptr.c:133 at xe_vma_userptr_do_inval+0x340/0x4a0 [xe] RAX: 00000000ffffffed xe_vma_userptr_invalidate_start+0x4b7/0x7c0 [xe] __mmu_notifier_invalidate_range_start+0x247/0x370 unmap_vmas+0x1af/0x1c0 unmap_region+0x91/0xf0 ... The TLB invalidation ops contract is that the backend returns -ECANCELED when it is mid-reset. The reset invalidates all TLBs, so there is nothing left to do. Map -ENODEV to -ECANCELED in send_tlb_inval() so that every GuC TLB invalidation type handles it the same way, instead of only send_tlb_inval_ggtt_full() as done so far. The CT is also DISABLED across system suspend and runtime suspend. On resume from system suspend the GuC is reloaded with all TLBs invalid, so nothing is lost there either; user space and the MM kernel threads are frozen by then, so such a request is not expected anyway. A request issued while runtime suspended violates the PM rules and is still reported by the "Missing outer runtime PM protection" warning in xe_tlb_inval_fence_init(). Fixes: db16f9d90c1d ("drm/xe: Split TLB invalidation code in frontend and backend") Cc: stable@vger.kernel.org # v6.18+ Cc: Matthew Brost Signed-off-by: Zongyao Bai Reviewed-by: Shuicheng Lin Link: https://patch.msgid.link/20261116192220.3872267-2-zongyao.bai@intel.com Signed-off-by: Shuicheng Lin (cherry picked from commit c17474e39028c7fb5cd6b2fb0f0413d07b1bf232) Signed-off-by: Matthew Brost Signed-off-by: Greg Kroah-Hartman commit c4d20650fc69015052c207818e2ee52f8738fd50 Author: Thomas Hellström Date: Wed Nov 11 11:09:29 2026 +0100 drm/xe/dma-buf: Validate BOs on export to charge the exporter commit 22e05ee854e1bdacebcfa36ecd3f33ec80cf897a upstream. xe_gem_prime_export() calls ttm_bo_setup_export() to make sure the exporter is charged for the memory backing an exported BO. However, that only populates a TTM_PL_SYSTEM tt. A BO that has been evicted, or that has deferred backing, will instead get its memory allocated when the importer maps it. For p2p imports this happens through xe_bo_validate() in xe_dma_buf_map(), so the importer, not the exporter, is charged for the allocation. Call xe_bo_validate() at export time instead, so that the BO is moved into its preferred placement and the exporter is charged. Do the purgeable checks and the validation in the same xe_validation_guard() transaction, to avoid locking the BO twice. The commit message and code was drafted using LLM. Link: https://patchwork.freedesktop.org/patch/747480/?series=172524&rev=1 Fixes: 91494dee1091 ("xe: populate buffers before exporting them.") Cc: Matthew Brost Cc: Matthew Auld Cc: Dave Airlie Cc: Rodrigo Vivi Cc: intel-xe@lists.freedesktop.org Cc: stable@vger.kernel.org # v6.18+ Reviewed-by: Matthew Auld Link: https://patch.msgid.link/20261111100929.2228-1-thomas.hellstrom@linux.intel.com Signed-off-by: Thomas Hellström (cherry picked from commit 451162b9f6570d19da1c5944aa0a0e3e8f17773d) Signed-off-by: Matthew Brost Signed-off-by: Greg Kroah-Hartman commit e5bf059ad88a45de729b8aad8cf5df36b0146c36 Author: Thomas Zimmermann Date: Tue Nov 10 09:45:19 2026 +0100 drm/vblank: timer: Do not block within critical section commit f02d1f70d361c42d09569e51612d6be5ffceb7d6 upstream. Remove try-to-cancel loop from drm_crtc_vblank_start_timer() to avoid a possible livelock while spinning within the loop. Hold interval_lock when starting and forwarding the vblank timer's hrtimer to avoid forwarding an already queued timer. The vblank helper drm_vblank_disable_and_save() and the vblank IRQ handler hold the spin lock vblank_time_lock at some point. This can result in a deadlock if the vblank timer's disable code in drm_crtc_vblank_cancel_timer() calls hrtimer_cancel() directly: the helper waits for the timer function to complete and the timer function waits for the helper to release vblank_time_lock. drm_crtc_vblank_cancel_timer() works around this problem by calling hrtimer_try_to_cancel() instead. For re-enabling the vblank timer, drm_crtc_vblank_start_timer() currently waits for the vblank timer to stop. It runs into the same locking problem while waiting for the timer function to complete. Resolve the locking problem by removing hrtimer_try_to_cancel() from drm_crtc_vblank_start_timer(). Hold interval_lock while starting or forwarding the hrtimer. Without holding interval_lock, drm_crtc_vblank_start_timer() could set an interval and start the hrtimer; while a concurrent timer function forwards the timer with the old interval. This can corrupt the ordering of the hrtimer's internal queue. Holding the lock prevents this from happening. When starting the vblank timer, it is still possible that an already running timer sends out a vblank event at the previous vblank interval. This is merely an inconsistency and not critical. Closes: https://lore.kernel.org/dri-devel/20260914111129.300691F00898@smtp.kernel.org/ Suggested-by: Ville Syrjälä Signed-off-by: Thomas Zimmermann Reviewed-by: Zack Rusin Fixes: 74afeb812850 ("drm/vblank: Add vblank timer") Cc: Louis Chauvet Cc: Javier Martinez Canillas Cc: David Airlie Cc: Simona Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: dri-devel@lists.freedesktop.org Cc: # v6.19+ Link: https://patch.msgid.link/20261110084710.503870-2-tzimmermann@suse.de Signed-off-by: Greg Kroah-Hartman commit 4711c83e53c1cc74c706f614f02e5303bba44d5f Author: Markus Schneider-Pargmann (TI) Date: Tue Nov 3 14:15:33 2026 +0100 drm/tilcdc: Fix suspend/resume drvdata commit b4d01c788bfa50dc65ffb5fbc9db4135004c0e01 upstream. drvdata contains a pointer to a struct tilcdc_drm_private and not a pointer to a struct drm_device anymore. Note that this breaks suspend/resume at the moment, it hangs on acquiring a mutex. Interpret drvdata correctly as struct tilcdc_drm_private as is done in the rest of the driver. Fixes: 3301302060da ("drm/tilcdc: Modernize driver initialization and cleanup paths") Cc: stable@vger.kernel.org Signed-off-by: Markus Schneider-Pargmann (TI) Reviewed-by: Kory Maincent Reviewed-by: Luca Ceresoli Link: https://patch.msgid.link/20261103-v7-4-topic-am335lpm-tilcdc-v1-1-b7f91f9c9a05@baylibre.com Signed-off-by: Luca Ceresoli Signed-off-by: Greg Kroah-Hartman commit 3a03c2ad2e7c2b151b3ce08e70bcc33e52a6a143 Author: Fei Yu Date: Mon Nov 9 09:48:52 2026 +0800 drm/syncobj: Limit the number of handles and use kvmalloc for user-sized arrays commit 6ca87397aeebcfae3057653c3e7c008ccb0bb926 upstream. The syncobj ioctls allocate several temporary arrays whose size is taken directly from the u32 count_handles provided by userspace: - handles and syncobjs in drm_syncobj_array_find() - points and entries in drm_syncobj_array_wait_timeout() - points and chains in drm_syncobj_timeline_signal_ioctl() These are kmalloc() allocations, so a count above KMALLOC_MAX_SIZE / element size trips the WARN_ON_ONCE_GFP() in ___kmalloc_large_node(): WARNING: mm/slub.c:5459 at ___kmalloc_large_node+0x10c/0x170 mm/slub.c:5459 Call Trace: __kmalloc_large_node_noprof+0x18/0x90 mm/slub.c:5502 __do_kmalloc_node mm/slub.c:5519 [inline] __kmalloc_noprof+0x3f6/0x710 mm/slub.c:5556 _kmalloc_noprof include/linux/slab.h:995 [inline] _kmalloc_array_noprof include/linux/slab.h:1211 [inline] drm_syncobj_array_find+0x3a/0x440 drivers/gpu/drm/drm_syncobj.c:1241 drm_syncobj_timeline_wait_ioctl+0x18a/0x640 drivers/gpu/drm/drm_syncobj.c:1356 drm_ioctl_kernel+0x2df/0x3b0 drivers/gpu/drm/drm_ioctl.c:817 drm_ioctl+0x70e/0xba0 drivers/gpu/drm/drm_ioctl.c:914 The wait entries are 64 bytes each on 64-bit, so with a 4 MiB KMALLOC_MAX_SIZE a wait on more than about 64K handles already fails today, with a warning. Fix this in two parts: - Reject more than DRM_SYNCOBJ_MAX_HANDLES (1M) handles with -EINVAL in drm_syncobj_array_find(), which every ioctl taking a handle array goes through. The limit is a fixed number, so it is the same on all architectures. It is above what these ioctls can handle today: with a 4 MiB KMALLOC_MAX_SIZE the 8-byte arrays already fail above 512K handles on 64-bit, so no request that succeeds now is rejected. A static_assert() makes sure that the largest per-handle allocation, the wait entries, stays below the INT_MAX size limit of kvmalloc(). - Switch the six allocations to kvmalloc(), so that handle counts up to the limit (64 MiB of wait entries for 1M handles) no longer depend on physically contiguous memory. Using kvmalloc() alone is not enough: the reproducer asks for more than INT_MAX bytes, which hits the WARN_ON_ONCE() in __kvmalloc_node_noprof() instead. Fixes: 3e6fb72d6cef ("drm/syncobj: Add a syncobj_array_find helper") Reported-by: syzbot+95416f957d84e858b377@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=95416f957d84e858b377 Suggested-by: Christian König Cc: stable@vger.kernel.org Signed-off-by: Fei Yu Reviewed-by: Christian König Signed-off-by: Christian König Link: https://lore.kernel.org/r/20261109014852.2127723-1-fei.yu@intel.com Signed-off-by: Greg Kroah-Hartman commit 38880ddda2d8b6bd62c63cd753f730b063980fa1 Author: Tvrtko Ursulin Date: Mon Nov 9 16:07:43 2026 +0000 drm/sched: Ensure stopped entity cannot be re-added to the run-queue commit 7e2645d5c05ac03f240685fe76a2c04733d36a1a upstream. When entities are torn down in drm_sched_entity_kill() a multi-step process is undertaken to synchronize with a drm_sched_run_job_work() consuming jobs from the same entity. First the entity is marked as stopped and removed from the run-queue, with both the entity and run-queue lock correctly taken. The process then waits for the entity idle via the completion after which point it assumes it is the only accessor to the entity in question. What can happen however in drm_sched_run_job_work() if there are at least two outstanding runnable jobs on an entity, is that drm_sched_entity_pop_job() can re-add it to the run-queue due the unconditial add to the rbtree via drm_sched_rq_update_fifo_locked(). What is required is that the teardown starts after the run job has selected the entity and that it gets to it's completion waiting stage before the run job goes to dequeue a job, and for the run job to be able to de-queue a job before teardown has consumed too many. Run job will then see there is another job pending (after the one about to be de-queued) and it will re-add the entity to the run-queue. Run job will then signal the completion and entity teardown will proceed incorrectly thinking it's removal of the entity was final. End result is a pointer to an entity about to be freed dangling forever in the rbtree. drm_sched_run_job_work() drm_sched_entity_kill() drm_sched_select_entity stops and removes entity wait_for_completion drm_sched_entity_pop_job -> re-adds to run-queue due more jobs complete_all drm_sched_entity_queue_pop ... fini entity ... drm_sched_run_job_queue drm_sched_select_entity - UAF This race existed ever since the FIFO policy was first added. Lets mirror the guard from drm_sched_rq_add_entity() in drm_sched_rq_pop_entity() and close this gap. Signed-off-by: Tvrtko Ursulin References: https://sashiko.dev/#/patchset/20261020154123.33631-1-tvrtko.ursulin@igalia.com?part=7 Fixes: 08fb97de03aa ("drm/sched: Add FIFO sched policy to run queue") Cc: Luben Tuikov Cc: Christian König Cc: Andrey Grodzovsky Cc: Matthew Brost Cc: Danilo Krummrich Cc: Philipp Stanner Cc: David Airlie Cc: Simona Vetter Cc: stable@vger.kernel.org # v6.2+ Signed-off-by: Philipp Stanner Link: https://patch.msgid.link/20261109160743.17020-1-tvrtko.ursulin@igalia.com Signed-off-by: Greg Kroah-Hartman commit 664cdeef30529e968fb2fdc6599a483716ca5949 Author: Jiaming Fan Date: Tue Nov 10 15:19:10 2026 +0000 drm/radeon: only unregister the ATPX handler if we registered it commit 83876755d089321e426a58f365a31b27b2c77f3b upstream. radeon_register_atpx_handler() registers the ATPX handler with vga_switcheroo only when ATPX is detected, and ignores the result: vga_switcheroo has a single handler slot and refuses a second handler with -EINVAL. radeon_unregister_atpx_handler() calls vga_switcheroo_unregister_handler() in either case, and that clears the slot no matter who set it. So unloading radeon removes a handler registered by another driver, such as apple-gmux. No Radeon GPU is needed for this; loading and unloading radeon is enough. amdgpu is another such driver: when radeon and amdgpu are both loaded and both detect ATPX, only the first one gets the slot, and unloading the other one clears it. Afterwards vga_switcheroo can no longer switch outputs, and a client that uses the vga_switcheroo runtime PM domain, such as nouveau on a non-Optimus machine with a v1 DSM, can dereference the now NULL handler during runtime suspend. Record whether the registration succeeded and unregister only in that case. amdgpu has the same problem and gets the same fix. Fixes: 6a9ee8af344e ("vga_switcheroo: initial implementation (v15)") Reviewed-by: Alex Deucher Signed-off-by: Jiaming Fan Signed-off-by: Alex Deucher (cherry picked from commit f90ef5de500fa47d8e2371d429700f0275e0b88d) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit ded9c39dd26bea0d47285242349c0cfe2ed73974 Author: Andrey Misiurov Date: Mon Nov 9 16:52:15 2026 +0100 drm/radeon: Bound GPIO I2C table entry count from VBIOS commit 7345797c8652c976d18dc4be4bae632557c3bc38 upstream. radeon_atombios_i2c_init() derives the number of GPIO I2C entries from the size field of the VBIOS GPIO_I2C_Info table and stores a bus for every valid entry in rdev->i2c_bus[i], which has RADEON_MAX_I2C_BUS (16) slots. A table that claims more than 16 entries makes it write past the end of the array into the rest of struct radeon_device. A size smaller than the common header wraps the subtraction and the loop walks far past the table. radeon_lookup_i2c_gpio() uses the same calculation. Reject undersized tables and cap the entry count at RADEON_MAX_I2C_BUS. Fixes: f376b94fbc0a ("drm/radeon/kms: unify i2c handling") Reviewed-by: Alex Deucher Signed-off-by: Andrey Misiurov Signed-off-by: Alex Deucher (cherry picked from commit ad5ddb2f77ff5e80b3c793f062dc1cad9907a2b9) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman commit 24bd15e8cbe1e16c288ee5a55a6d284119874e2a Author: Mohamed Ahmed Date: Wed Nov 18 01:43:50 2026 +0400 drm/nouveau: do not return early from a synchronous VM_BIND commit b1939b201353d803f09a8eb07aa69e44f8441701 upstream. A synchronous VM_BIND waits for its job with an interruptible wait and ignores the result. On a signal the ioctl returns 0 while the job is still queued. Userspace can then use the new mappings before the page tables are written, and the channel can take an MMU fault. Wait uninterruptibly. A synchronous job takes no syncobjs, so only the jobs queued before it on the same scheduler can delay it. Fixes: b88baab82871 ("drm/nouveau: implement new VM_BIND uAPI") Cc: stable@vger.kernel.org Signed-off-by: Mohamed Ahmed Tested-by: Thomas Andersen Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie Link: https://patch.msgid.link/20261117214352.337961-2-mohamedahmedegypt2001@gmail.com Signed-off-by: Greg Kroah-Hartman commit c2f5b9c19351ee91dda7ff1dda6049331ed60321 Author: Mohamed Ahmed Date: Wed Nov 18 01:43:52 2026 +0400 drm/nouveau/instmem: map only the part of BAR2 that is used commit 7488ee210542b918b9c5749a29fd1502c49a0665 upstream. The io_mapping covers the whole BAR2 resource. With GSP-RM and with NvBar2Halve the BAR2 address space covers only its lower half. The driver maps nothing in the upper half, and a mapping that already exists there would give the io_mapping its type. Size the io_mapping to the BAR2 address space. The range does not change where BAR2 is not halved. Fixes: 34e27b90552a ("nouveau/instmem: use iomapping interface for instmem handling") Cc: stable@vger.kernel.org Signed-off-by: Mohamed Ahmed Tested-by: Thomas Andersen Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie Link: https://patch.msgid.link/20261117214352.337961-4-mohamedahmedegypt2001@gmail.com Signed-off-by: Greg Kroah-Hartman commit 515ddd56c93277babc6b57855b9694e95e967940 Author: Joe Finzel Date: Fri Oct 23 11:38:05 2026 +0200 drm/nouveau/gsp: only handle GSP interrupts routed to the host commit 54d3ff1b5ac08d0e28029b93a1719ddd9ff670a4 upstream. The GSP's interrupt handler takes every pending interrupt the RISC-V IRQMASK enables as its own, without looking at IRQDEST, which says whether an interrupt goes to the host or to the GSP itself. One that belongs to GSP-RM, pending when the host's handler runs for the message queue, is reported as unknown, cleared and masked off with IRQMCLR, taking it away from the firmware: nouveau 0000:01:00.0: gsp: intr 00040000 NVIDIA's driver reads the interrupts routed to the host as IRQSTAT & IRQMASK & IRQDEST (kflcnRiscvReadIntrStatus_TU102() and _GA102()). Do the same, with IRQDEST from NVIDIA's register headers next to IRQMASK on each falcon. Seen once in a few boots on an RTX 3070 Ti (GA104, GSP-RM 570.144), before the login prompt. There IRQMASK reads 0x01049042 and IRQDEST 0x01000040: 0x00040000 is enabled but routed to the GSP. Fixes: 830531e94712 ("drm/nouveau/gsp/r535: add interrupt handling") Cc: stable@vger.kernel.org Signed-off-by: Joe Finzel Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie Link: https://patch.msgid.link/20261023-nouveau-gsp-irqdest-v1-1-5dd6131faa14@sudmix.de Signed-off-by: Greg Kroah-Hartman commit a4f0c5e62a54e7e11f43978fa30a71cd56e65175 Author: Dave Airlie Date: Wed Nov 11 16:00:05 2026 +1000 drm/nouveau/disp: Set drm_mode_config_funcs.atomic_(check|commit) (attempt 2) commit ed7fb901fce31588bd12ab95adc36ebcb51bc8ea upstream. commit 604826acb3f5 attempted to add these flags but commit 6c65db809796 reverted it due to it failing on hw from pre-atomic times. So use a second set of functions. original commit msg from Lyude: "Apparently we never actually filled these in, despite the fact that we do in fact technically support atomic modesetting. Since not having these filled in causes us to potentially forget to disable fbdev and friends during suspend/resume, let's fix it." Reported-by: Ruben Wauters Closes: https://gitlab.freedesktop.org/drm/nouveau/-/work_items/517 Fixes: 6c65db809796 ("Revert "drm/nouveau/disp: Set drm_mode_config_funcs.atomic_(check|commit)"") Cc: stable@vger.kernel.org Reviewed-by: Lyude Paul Signed-off-by: Dave Airlie Link: https://patch.msgid.link/20261111-nouveau-atomic-fix-v1-1-118e65d3a2f5@redhat.com Signed-off-by: Greg Kroah-Hartman commit 0ff40b222539bc4fc7a801b55be4a7cf6883ae23 Author: Mohamed Ahmed Date: Wed Nov 18 01:43:51 2026 +0400 drm/nouveau/bar: take the GSP-RM flush pointer from the BAR2 io_mapping commit 4ffab70118f8691ee68c1a24091a36c16957b6dd upstream. r535_bar_new_() maps the first page of BAR2 with ioremap(), to flush BAR2 writes with a read while flushFBZero is not mapped. On x86 with PAT, a mapping that overlaps an existing one gets its type. The instmem io_mapping is created later, so with GSP-RM it is also mapped UC- and its writes are not write-combined. Take the flush pointer from the io_mapping. A new bar2.oneinit hook sets it up once the BAR2 page tables are bootstrapped and the io_mapping exists. Fixes: 34e27b90552a ("nouveau/instmem: use iomapping interface for instmem handling") Cc: stable@vger.kernel.org Signed-off-by: Mohamed Ahmed Tested-by: Thomas Andersen Reviewed-by: Dave Airlie Signed-off-by: Dave Airlie Link: https://patch.msgid.link/20261117214352.337961-3-mohamedahmedegypt2001@gmail.com Signed-off-by: Greg Kroah-Hartman commit d7ec9078d3324ba6b828ed774f57581c80a46ee2 Author: Shigeaki Asai Date: Sun Oct 4 23:50:17 2026 +0900 drm/meson: encoder_dsi: load ENCL gamma table while ENCL is disabled commit 0cb7f6d9e4b1d0a411b628ccf78695ad41c66570 upstream. meson_encoder_dsi_atomic_enable() programmed the ENCL gamma LUT right after meson_venc_mipi_dsi_mode_set(), i.e. while the ENCL timing generator was already running (ENCL_VIDEO_EN=1). Writing the LUT during active video stalls the hardware: L_GAMMA_CNTL_PORT WR_RDY/ADR_RDY deassert and the ENCL line counter (ENCL_INFO_READ) freezes, so every remaining write times out (~8s total at boot) and the panel ends up with a corrupted gamma table (wrong colors). Instrumented boots on the ODROID-GO Ultra (S922X) show: failing: start: VIDEO_EN=1 INFO 0000001a->002d0000 GAMMA_CNTL=00000030 stall: INFO 002d0000->002d0000 GAMMA_CNTL=00000000 (VID_CLK_CNTL2 / VIID_CLK_CNTL / VIID_CLK_DIV unchanged, i.e. the ENCL clock is still running) fixed: start: VIDEO_EN=0 INFO 00000000->00000000 GAMMA_CNTL=00000030 no stall, no timeout Whether it failed depended only on timing, which is why enabling lock debugging (LOCKDEP etc.) appeared to "fix" it most of the time. It happens regardless of the bootloader (mainline or Hardkernel vendor U-Boot). The function already writes ENCL_VIDEO_EN=0 right afterwards before re-enabling the encoder, so simply move meson_encl_load_gamma() after that write. This matches the order used by the vendor U-Boot's own LCD driver, which never times out. Tested on the ODROID-GO Ultra with mainline U-Boot: 5 cold boots + 3 warm reboots, no timeouts, correct colors, LOCKDEP disabled. Fixes: 42dcf15f901c ("drm/meson: add DSI encoder") Cc: stable@vger.kernel.org Tested-by: John Williams Signed-off-by: Shigeaki Asai Reviewed-by: Neil Armstrong Signed-off-by: Neil Armstrong Link: https://patch.msgid.link/20261004-meson-gamma-v1-1-6347558e2bb3@docomonet.jp Signed-off-by: Greg Kroah-Hartman commit a5e3324848ad8c413909723c44d4119b299cbc22 Author: Imre Deak Date: Thu Oct 29 13:30:17 2026 +0200 drm/i915/ptl+: Fix TypeC detection for eDP on port B commit b8c29d1e64a712decce01e3671bf7e6ec6bd70a0 upstream. On PTL+ platforms with eDP on TypeC, port B's DDI is connected to a C20 TypeC PHY. Identify PHY B as TypeC and map port B to TC_PORT_1 when eDP TypeC support is enabled. Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/9196 CC: stable@vger.kernel.org # 6.14+ Reviewed-by: Mika Kahola Signed-off-by: Imre Deak Link: https://patch.msgid.link/20261029113017.618286-7-imre.deak@intel.com (cherry picked from commit 20e3d954f70486bf14000fc1a6dac7c34e6e4f07) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman commit 4db3e3090ad9304e08c628d0eb477a928203ad69 Author: Imre Deak Date: Thu Oct 29 13:30:15 2026 +0200 drm/i915/ptl+: Add TypeC HPD pin selection for port B commit 899f7dc007391b8e3fd514b30645cdb263970db3 upstream. Handle the TypeC PHY on port B case while mapping the port to an HPD pin. This prepares for an upcoming change that will set port B's PHY type to TypeC on PTL+ platforms with an eDP panel connected to a TypeC PHY. Keep the existing port >= PORT_TC1 case and its HPD pin mapping for DG2, where PORT_TC1 has a non-TypeC PHY. CC: stable@vger.kernel.org # 6.14+ Reviewed-by: Mika Kahola Signed-off-by: Imre Deak Link: https://patch.msgid.link/20261029113017.618286-5-imre.deak@intel.com (cherry picked from commit 0f35ced2b44db21527cdb80065e80693fb0ab563) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman commit 0c43b1af3248e5a3bd38bc9911d98e3929cbe307 Author: Jouni Högander Date: Mon Nov 2 12:00:50 2026 +0200 drm/i915/psr: Clear CFF state on flip flush commit 9bf9ced37e60a6c947a481385cd9ed919f14cf36 upstream. An ORIGIN_FLIP flush can clear the last busy frontbuffer bits without running _psr_flush_handle(), leaving the CFF state flag set. Clear CFF state when no frontbuffer bits remain busy, and queue PSR work only when inactive and not paused. Fixes: 805f04d42a6b ("drm/i915/display/psr: Use continuos full frame to handle frontbuffer invalidations") Cc: # v5.19+ Signed-off-by: Jouni Högander Reviewed-by: Mika Kahola Link: https://patch.msgid.link/20261102100051.272137-4-jouni.hogander@intel.com (cherry picked from commit 233e3453eb705c0434f6f8467f211f0250c5832b) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman commit dc1e98a72db59e1fd83d80d31df94fdc2091fe28 Author: Jouni Högander Date: Mon Nov 2 12:00:49 2026 +0200 drm/i915/psr: Re-arm PSR after flush commit 4247f4e2c10eac8c17fc23c2db0e14911b1ba5ff upstream. An ORIGIN_FLIP flush can clear the last busy frontbuffer bits without queuing the work that re-arms PSR. Queue the re-arm work after each flush when PSR is inactive and no frontbuffers are busy. Move also pipe_frontbuffer_bits ==0 check to done right after pipe frontbuffer bits are figured out. Anyways nothing is currently done after in intel_psr_flush if the bits are 0. v2: Do not re-activate PSR on other pipe frontbuffer bits. Fixes: ef39826c12b4 ("drm/i915/display: Fix glitches when moving cursor with PSR2 selective fetch enabled") Cc: # v5.16+ Tested-by: Ambica Pramod Signed-off-by: Jouni Högander Reviewed-by: Mika Kahola Link: https://patch.msgid.link/20261102100051.272137-3-jouni.hogander@intel.com (cherry picked from commit 731ed8af13bdead02924b39a8c01d5f60d6a2e68) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman commit af03da938c045c9d6645820a2a3f3f75449a9a97 Author: Imre Deak Date: Thu Oct 29 13:30:14 2026 +0200 drm/i915/pps: Reset PPS state after TypeC port init on resume commit af8b4d4817678a255ee310dbca983193cc09a075 upstream. Resetting the PPS state involves acquiring an AUX power domain reference. On TypeC ports, the AUX power domain depends on the TypeC mode of the port using the PPS. An upcoming change will set the port/PHY type to TypeC for eDP ports on PTL+ platforms with an eDP DDI mapped to a TypeC PHY. Prepare for this by resetting the PPS state on resume only after initializing the port's TypeC mode. CC: stable@vger.kernel.org # 6.14+ Reviewed-by: Mika Kahola Signed-off-by: Imre Deak Link: https://patch.msgid.link/20261029113017.618286-4-imre.deak@intel.com (cherry picked from commit 43eb42b332fe48ab8649bd5e4e0ef351473d8a4a) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman commit ae758fb2bbfc08398680b3170b4492d0f4578b4e Author: Imre Deak Date: Thu Oct 29 13:30:13 2026 +0200 drm/i915/pps: Hold a TypeC link reference for PPS VDD commit 2e28d9e416d3e9cfd3cb90addc2b0107fa000c33 upstream. On TypeC ports, the AUX power domain reference held for PPS VDD requires the TypeC mode to remain unchanged. Hold a TypeC link reference for the lifetime of the PPS VDD power reference. This prepares for an upcoming change that will use the TypeC port type for eDP on TypeC ports. Allow the additional PPS link reference when sanitizing the TypeC mode. CC: stable@vger.kernel.org # 6.14+ Reviewed-by: Mika Kahola Signed-off-by: Imre Deak Link: https://patch.msgid.link/20261029113017.618286-3-imre.deak@intel.com (cherry picked from commit 3e2444989824139e342aa9affd10cd920255aabc) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman commit 5dd2a11b5cfd740482b0532802587864a6e7dfd9 Author: Imre Deak Date: Fri Oct 30 13:44:56 2026 +0200 drm/i915/mtl+: Use PHY type to identify TypeC ports in PLL ID lookup commit 522b0bdda49901113293f8b7e1aeb1c96ec41d85 upstream. Use the PHY type to identify TypeC ports in the PLL ID lookup function. This ensures that port B takes the TypeC path when an upcoming change sets its PHY type to TypeC on PTL+ platforms with an eDP panel connected to a TypeC PHY. Keep the existing port >= PORT_TC1 case for BMG, where PORT_TC1 has a a TypeC DDI (and so uses the TypeC DDI register addresses, has a C20 PHY and the corresponding TC port -> PLL ID mapping), but this C20 PHY is not a TypeC PHY (i.e. it's not controlled by the TypeC Subsystem and so the driver doesn't need to run the TypeC PHY connect/disconnect, power-on/power-off sequences for the PHY). v2: Keep handling the BMG TypeC DDI but non-TypeC PHY cases. (Sashiko) CC: stable@vger.kernel.org # 6.14+ Reviewed-by: Mika Kahola Signed-off-by: Imre Deak Link: https://patch.msgid.link/20261030114456.651066-1-imre.deak@intel.com (cherry picked from commit 493091a94dca1d832dc0349d1d7e7b3ad369cee7) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman commit 98218993a744dba66c37e2412641fafec65b27c9 Author: Hanson Wang Date: Fri Nov 6 18:23:15 2026 +0800 drm/i915/dsb: Realign GOSUB only for QW slots 6 and 7 commit 715f145f6204363a50853eb15719dc860db0bc01 upstream. intel_dsb_gosub_align() moves free_pos to the next cacheline unconditionally, but only clears the skipped bytes when at most two QW slots remain. Wa_16024917128 forbids GOSUB in slots 6 and 7 only. A larger gap is still executed. A Panther Lake DSB dump showed nonzero data in that gap, with the tail at 0x58 and GOSUB at 0x80. Advance free_pos only when the instruction would land in slot 6 or 7, and fill that gap with NOPs. Emit GOSUB in place for every other slot. intel_dsb_align_tail() still clears the rest of the cacheline. Update free_pos inside the existing gap check in intel_dsb_align_tail() as well, so the two helpers keep the same shape. Fixes: 2c41d62f6fb1 ("drm/i915/dsb: Implement intel_dsb_gosub()") Cc: stable@vger.kernel.org # v6.17+ Signed-off-by: Hanson Wang Signed-off-by: Ville Syrjälä Link: https://patch.msgid.link/20261106102315.1361645-1-hanson.wang@ugreen.com (cherry picked from commit a2f5df6c5468b4f65e58c4125bba3f0e3cdc6aa1) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman commit 02b6de6554cfb80d8047ab22f28d20575b330b81 Author: Imre Deak Date: Thu Oct 29 13:30:12 2026 +0200 drm/i915/dp_aux: Take the TypeC port lock after the PPS lock commit 5a3ffd06d47d3a7694288327855d6faff42ec3c0 upstream. An upcoming change will need to acquire a TypeC port link reference along with an AUX power domain reference when enabling PPS VDD for the port during an AUX transfer. Acquiring the link reference requires holding the TypeC port lock. To allow the PPS VDD code to take this lock itself, acquire the TypeC port lock in the AUX transfer function only after locking PPS and enabling VDD. CC: stable@vger.kernel.org # 6.14+ Reviewed-by: Mika Kahola Signed-off-by: Imre Deak Link: https://patch.msgid.link/20261029113017.618286-2-imre.deak@intel.com (cherry picked from commit 86fabed8d8cf7db734a9a3f63af5f500cf0ed139) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman commit 14d9d288e6e4b632d3746996a20a08bea04a1557 Author: Jouni Högander Date: Mon Nov 2 12:00:51 2026 +0200 drm/i915/display: Flush the fbdev frontbuffer commit f1f5942c3fdac3bb553d0019f60d11ca35f9b836 upstream. fbdev invalidates on set_par, blank, pan_display and restore, but never flushes. On i915, unrelated rendering may clear the bits; Xe has no ORIGIN_CS invalidation, so PSR and FBC can remain disabled indefinitely. Flush after these operations; they are already complete. Fixes: 44e694958b95 ("drm/xe/display: Implement display support") Cc: Maarten Lankhorst Cc: # v6.8+ Signed-off-by: Jouni Högander Reviewed-by: Mika Kahola Link: https://patch.msgid.link/20261102100051.272137-5-jouni.hogander@intel.com (cherry picked from commit ab965cbc781e4f4f8f81e48d01e0a0d78c94d369) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman commit 39fdc94eced6f42fd25c21e7344012262dc743c2 Author: Ville Syrjälä Date: Thu Nov 5 14:47:37 2026 +0200 drm/i915/cdclk: Ignore SWF18 in SKL CDCLK sanitization commit 9e7a9295c90e28e1bb6e88b76aaa91839266352b upstream. Currently on SKL/derivatives we are checking whether the VBIOS/GOP programmed the SWF18 scratch register appropriately. SWF18 is where the VBIOS/GOP should stuff some information about what outputs it enabled. A related register SWF06 is where the VBIOS/GOP is supposed to stuff the maximum CDCLK frequency. I think only SWF06 is really used by the Windows driver (and even that only up to and including ADL), the other stuff it doesn't even look at. Apparently at least some coreboot based systems don't set these scratch registers up at all. SWF18 not being populated leads us to reprogram the CDCLK PLL during driver initialization, while the display pipes are still potentially active. We also set CDCLK to its minimum frequency, under the assumption that nothing actually needs a higher CDCLK frequency when it hasn't even been correctly initialized. Due to some other changes in the code we may no longer force a full CDCLK recalculation and reprogramming upon the first atomic commit, so CDCLK can remain at a potentially too low a frequency indefinitely. To fix this let's just stop looking at SWF18 completely. We don't look at that register on any other platform either, and neither does Windows from what I can see. We also do an actual readout of the CDCLK state from the hardware so we should be able to spot if anything is wrong enough to need reprogramming. v2: Rewrite the commit message to mix up SWF06 vs. SWF18 Cc: stable@vger.kernel.org Fixes: ba91b9eecb47 ("drm/i915/cdclk: Decouple cdclk from state->modeset") Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/16595 Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/17423 Signed-off-by: Ville Syrjälä Link: https://patch.msgid.link/20261105124737.24456-1-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola (cherry picked from commit a6e9767ca2e353277aa06d4c796093ef71a191b6) Signed-off-by: Joonas Lahtinen Signed-off-by: Greg Kroah-Hartman commit a1967779804c78b113a544e625e03483b13f73e4 Author: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Date: Thu Oct 29 15:33:11 2026 +0800 drm/gud: avoid divide error in gud_stats_debugfs commit 431c2dffd2b7c1240a6e579f0c74104cd2e17329 upstream. gud_stats_debugfs() computes the compression ratio by dividing the accumulated uncompressed length by stats_actual_length. That counter is zero until the first framebuffer flush has completed, so reading the stats debugfs file on a display which negotiates LZ4 compression raises a divide error before any frame has been sent. The wrap-around reset in gud_flush_rect() also clears the counter for a moment, which a concurrent read can observe. Copy the counter into a local variable and skip the ratio computation when it is zero. Fixes: 40e1a70b4aed ("drm: Add GUD USB Display driver") Cc: stable@vger.kernel.org Co-developed-by: Bin Yu Signed-off-by: Bin Yu Co-developed-by: Cheng Wen Signed-off-by: Cheng Wen Signed-off-by: YuanZhe Liu <25031212351@stu.xidian.edu.cn> Acked-by: Ruben Wauters Link: https://patch.msgid.link/20261029073311.14556-1-25031212351@stu.xidian.edu.cn Signed-off-by: Ruben Wauters Signed-off-by: Greg Kroah-Hartman commit e3ae87106078ff21cecdb51d9388d3ba14c876c9 Author: Fernand Sieber Date: Thu Nov 12 18:15:46 2026 +0200 sched/core: Rank DL server picks as deadline in the core-wide pick [ Upstream commit edf8ee40167473828c1ae20ab9c6442f2e66dded ] Commit 4b26cfdd3956 ("sched/core: Fix priority checking for DL server picks") made the core-wide selection rank a task picked through a DL server as deadline, so that a fair task competing with RT tasks under core scheduling still gets its server's bandwidth. It keys on p->dl_server, which pick_task() used to set. Since commit bd9bbc96e835 ("sched: Rework dl_server"), pick_task() records the server in rq->dl_server and p->dl_server is only set once the task is switched in. The core-wide selection still ranks each sibling's pick with prio_less(), so a task the sibling's server has just picked ranks as a plain fair or ext task and loses to an RT task on another sibling. The server's CPU then runs a task with the RT task's cookie or is forced idle, and the fair task gets none of the server's bandwidth for as long as the RT task runs. Rank each sibling's pick by the server it came through, rq_i->dl_server. prio_less() keeps using p->dl_server for the core tree, whose tasks are not being picked. Fixes: bd9bbc96e835 ("sched: Rework dl_server") Signed-off-by: Fernand Sieber Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://patch.msgid.link/20261112161548.78189-4-sieberf@amazon.com Signed-off-by: Sasha Levin commit d31d17df54f254b9f1303306524bf4f86f04f053 Author: Zizhi Wo Date: Mon Nov 2 16:04:20 2026 +0800 block: fix BLKSECDISCARD zero-length range causing page cache invalidation [ Upstream commit aea1c2ec03b399434ff1bafbb2f0d5076f74ce03 ] Commit 697ba0b6ec4a ("block: fix integer overflow in BLKSECDISCARD") fixed the start+len overflow via check_add_overflow() but did not handle the start=0, len=0 case. There, start + len = 0, so end = 0 passes all checks, and truncate_bdev_range()->truncate_inode_pages_range() is then called with lend=UINT64_MAX, whitch is the "truncate to the end of file" sentinel, so the entire page cache is invalidated. Fix this by replacing the validation with blk_validate_byte_range(), which already rejects a zero-length range and is what BLKDISCARD uses. This also switches the alignment check from a hardcoded 512 to bdev_logical_block_size(). Fixes: 0bd1ed4860d0 ("block: pass inclusive 'lend' parameter to truncate_inode_pages_range") Signed-off-by: Zizhi Wo Reviewed-by: Yu Kuai Reviewed-by: Christoph Hellwig Reviewed-by: Bart Van Assche Link: https://patch.msgid.link/20261102080420.3774409-1-wozizhi@huaweicloud.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 39013fae076171bf3a1d5957dfb73fbb91fc9d86 Author: Sasha Levin Date: Thu Nov 26 18:17:06 2026 -0500 selftests/ublk: use the configured kernel UAPI headers [ Upstream commit d9667b1a6a3387ef934667b9a2e6c099eee0e4f1 ] With generated headers in an output directory, the hardcoded source-tree include path falls through to distribution headers. New ublk flags and structure members, including UBLK_F_IO_DESC_SIZE, are then missing. Use KHDR_INCLUDES to consume the headers from the kernel under test, and add the headers target as an order-only prerequisite of the ublk programs, as nolibc-test does, so that a standalone build installs them first. Baseline builds fail on the missing definitions; GCC 14 and Clang 21 builds succeed with the output-directory headers and target liburing development files available. Fixes: e371b9d3368c ("selftests: ublk: kublk: fix include path") Signed-off-by: Sasha Levin Reviewed-by: Ming Lei Link: https://patch.msgid.link/20261126231706.1303486-1-sashal@kernel.org Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 55b0355613d8d8cb500f80887bfbed682c29c008 Author: Sasha Levin Date: Tue Nov 3 11:39:28 2026 -0500 selftests: ublk: fix the build and file offsets on 32-bit [ Upstream commit 3197517875fdcfae1e9b5a4dcaf35cbbd66c413c ] kublk puts pointers into 64-bit UAPI and SQE fields with a plain (__u64) cast. ublk builds with -Werror, so it fails to build on 32-bit architectures: batch.c:379:42: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] Cast through uintptr_t. kublk also passes 64-bit user copy offsets, which start at UBLKSRV_IO_BUF_OFFSET (2 GB), to pread() and pwrite(), and with glibc those are truncated to a 32-bit off_t there. Build with -D_FILE_OFFSET_BITS=64 as well. Signed-off-by: Sasha Levin Reviewed-by: Ming Lei Link: https://patch.msgid.link/20261103163928.641519-1-sashal@kernel.org Signed-off-by: Jens Axboe Stable-dep-of: d9667b1a6a33 ("selftests/ublk: use the configured kernel UAPI headers") Signed-off-by: Sasha Levin commit f4f1df62a3bc4ac6fa55c3e4efcda50bc3eaea30 Author: Ming Lei Date: Sun Oct 11 01:35:54 2026 -0500 selftests: ublk: add test for going live over canceled io commands [ Upstream commit bcab0b98566b8f73f8e398d4f12a088b81885459 ] Add ublk_cancel_ready, a small liburing program which sends control commands with kublk's helpers from ctrl.c, and test_generic_18.sh, which runs its modes: mode what it does expected stop_start STOP_DEV before START_DEV START_DEV -EBUSY partial_fetch task A fetches tags 0-2 and START_DEV -EBUSY dies, then task B fetches tag 3 recovery in user recovery, queue 0's END_USER_RECOVERY task dies before queue 1 is -EBUSY ready stop_restart STOP_DEV on a new device, then START_DEV 0, a server starts it reads succeed stop_attached STOP_DEV after open, before FETCH ABORT and FETCH, then a new server START_DEV -EBUSY, then a new one works stop_live_restart STOP_DEV on a live device, then FETCH and START_DEV a new server starts it 0, reads succeed race_start STOP_DEV and START_DEV at the START_DEV 0 and same time, 50 times reads complete, or -EBUSY race_fetch STOP_DEV while a server opens START_DEV 0 and and fetches, then START_DEV, reads succeed, 50 times or -EBUSY race_async_fetch IOSQE_ASYNC FETCH while STOP_DEV no crash (KASAN cancels, then close the ring finds the bug) race_batch_stop STOP_DEV while kublk's batch kublk add returns, server prepares and fetches, started or not 20 times If the device goes live, the test reads it, so an unfixed kernel shows the oops in ublk_queue_cmd(). In stop_live_restart, an unfixed kernel doesn't reset the FETCH round in ublk_ch_release() once the disk is gone, so the new server's FETCH gets -EBUSY. A dying task is a child process which fetches and then calls exec(). exec() cancels the task's uring_cmds before it returns, so the cancel is done once the child is reaped, with no sleep. kublk can't be used: its failure injection kills the whole process, which closes /dev/ublkcN and starts a new round. Link: https://lore.kernel.org/linux-block/20260928-b4-ublk-cancel-stop-v1-0-4a4360232a46@toxicpanda.com/ Signed-off-by: Ming Lei Assisted-by: LLM Link: https://patch.msgid.link/20261011063555.1142277-12-tom.leiming@gmail.com Signed-off-by: Jens Axboe Stable-dep-of: d9667b1a6a33 ("selftests/ublk: use the configured kernel UAPI headers") Signed-off-by: Sasha Levin commit af896bc9212ce692edf527abea84f54498c3b15f Author: Ming Lei Date: Sun Oct 11 01:35:52 2026 -0500 selftests: ublk: move the control command helpers into ctrl.c [ Upstream commit cdf6e5de86a91da6e4d621260bc70e99e2f3a25e ] Move the ublk_ctrl_*() helpers and ublk_setup_ring() out of kublk.c, so a small test program can send control commands without copying them. kublk still links every *.c file, ctrl.c included. ublk_ctrl_deinit() now also exits the control ring, and ublk_ctrl_init() checks the allocation and closes /dev/ublk-control when the ring setup fails. kublk calls them only around its own lifetime, but a test which opens a control handle per thread must not leak. No functional change for kublk. Signed-off-by: Ming Lei Tested-by: Josef Bacik Link: https://patch.msgid.link/20261011063555.1142277-10-tom.leiming@gmail.com Signed-off-by: Jens Axboe Stable-dep-of: d9667b1a6a33 ("selftests/ublk: use the configured kernel UAPI headers") Signed-off-by: Sasha Levin commit e7d31fe3f2d58977b39df0736e119e33ee4f0972 Author: Arun Iyengar Date: Sat Nov 14 00:14:27 2026 +0000 iommu/vsi: Unprepare the clocks when getting the IRQ fails [ Upstream commit 807bf13083be85673963f57cb9375626e0b06f13 ] vsi_iommu_probe() returns without clk_bulk_unprepare() when platform_get_irq() fails. Fixes: 917ace84b770 ("iommu: Add verisilicon IOMMU driver") Signed-off-by: Arun Iyengar Reviewed-by: Benjamin Gaignard Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin commit 30fb22bda73be163f12ae9512078dd0f20a14207 Author: Arun Iyengar Date: Fri Nov 13 20:04:37 2026 +0000 iommu/vsi: Don't resume the IOMMU in its interrupt handler [ Upstream commit 923278dea97476c58ace9f5b7d8429a185ce439a ] The interrupt handler calls pm_runtime_resume_and_get(), which can sleep, in hard IRQ context. Handle the interrupt only if the IOMMU is active. Fixes: 917ace84b770 ("iommu: Add verisilicon IOMMU driver") Signed-off-by: Arun Iyengar Reviewed-by: Benjamin Gaignard Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin commit ed00c15eeea9c7bb69caa3e2172de80f3c877c90 Author: Arun Iyengar Date: Fri Nov 13 20:04:36 2026 +0000 iommu/vsi: Don't leak a runtime PM reference in the TLB flush [ Upstream commit 4ec193a567bf7f09a7a4b3eae4087ab1571f304e ] pm_runtime_get() takes a usage reference even when it fails, e.g. with -EINPROGRESS while a resume runs, and vsi_iommu_flush_tlb() then skips the put. The IOMMU then never suspends again. Flush only an active IOMMU and flush the TLB when the IOMMU is enabled, which covers resume. Fixes: 917ace84b770 ("iommu: Add verisilicon IOMMU driver") Signed-off-by: Arun Iyengar Reviewed-by: Benjamin Gaignard Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin commit e6943abdc1f3d83cd4e1c86c2cb6764b5a099472 Author: Daniel Golle Date: Sun Oct 25 13:27:08 2026 +0000 iommu/vsi: keep the runtime PM callbacks without PM_SLEEP [ Upstream commit 0008c5d5030c4bddad186be9c5c3959f21012a66 ] The runtime PM operations are handed to the driver core through pm_sleep_ptr(), which is NULL unless CONFIG_PM_SLEEP is set. Without system sleep support the IOMMU has no runtime PM callbacks at all: its clocks are never enabled by the driver, the page table is not restored when the power domain comes back, and iommu->enable stays set while genpd powers the domain off. The TLB flush issued from vsi_iommu_map() then writes to the unpowered IOMMU, and the first buffer allocation of the RK3588 AV1 decoder ends in an asynchronous SError. Use pm_ptr(), which keeps the operations whenever CONFIG_PM is set. Fixes: 917ace84b770 ("iommu: Add verisilicon IOMMU driver") Signed-off-by: Daniel Golle Reviewed-by: Benjamin Gaignard Signed-off-by: Joerg Roedel Signed-off-by: Sasha Levin commit 23d0d382b4f9b6c666a555d5479850b53ff0acc1 Author: Sechang Lim Date: Thu Nov 26 10:19:41 2026 +0000 bpf, sockmap: Clear the redirect target after the stream parser runs [ Upstream commit 14f6b10422d640695803c621687f790f6f3d2401 ] A stream parser can call bpf_sk_redirect_{map,hash}(), which store the target socket in skb->_sk_redir. sk_psock_strp_parse() never clears it, and it shares storage with skb->_skb_refdst, so skb_dst_drop() later passes the socket to dst_release(): KASAN: null-ptr-deref in range [0x0000000000000128-0x000000000000012f] RIP: 0010:percpu_counter_add_batch+0x24/0x220 Call Trace: dst_release.part.0+0xc9/0x180 skb_release_head_state+0x1cc/0x2f0 sk_skb_reason_drop+0xbc/0x420 strp_done+0xcf/0x150 sk_psock_destroy+0x85e/0xb10 Drop the dst before the parser runs, as the verdict paths do, and clear the redirect after it. The parser's redirect was never used. Fixes: e3526bb92a20 ("skmsg: Move sk_redir from TCP_SKB_CB to skb") Signed-off-by: Sechang Lim Signed-off-by: Alexei Starovoitov Reviewed-by: Jiayuan Chen Link: https://patch.msgid.link/20261126101950.1682160-1-rhkrqnwk98@gmail.com Signed-off-by: Sasha Levin commit 29907ceae7d5babfe47dc4018e8bb04f27ee6198 Author: Sechang Lim Date: Thu Nov 26 05:30:06 2026 +0000 bpf: Reject kernel threads in bpf_task_work_schedule() [ Upstream commit 3c625090b46b0d683112465a07d95bf5ff71174f ] bpf_task_work_schedule_signal() on a kernel thread sets TIF_NOTIFY_SIGNAL, but the thread never returns to user space, so nothing clears it and signal_pending() stays true. Interruptible sleeps in the thread return immediately. For kthreadd this means spinning at 100% CPU. io_ring_exit_work() waits on ctx->ref_comp interruptibly, assuming a kworker gets no signals. If a prog running in that kworker schedules task work on current, the wait returns -ERESTARTSYS and the ctx is freed while ctx->refs is still switching to atomic: WARNING: lib/percpu-refcount.c:114 at __percpu_ref_exit+0x77/0x110 Workqueue: iou_exit io_ring_exit_work ... BUG: KASAN: slab-use-after-free in rcu_cblist_dequeue+0xd3/0x120 The callback can't run before the thread exits anyway. Reject kernel threads with -EPERM, as bpf_send_signal() does. Fixes: 38aa7003e369 ("bpf: task work scheduling kfuncs") Signed-off-by: Sechang Lim Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261126053016.1145482-1-rhkrqnwk98@gmail.com Signed-off-by: Sasha Levin commit cf6f0ae67972250a8776873e881b4567ad3eb034 Author: Alexei Starovoitov Date: Thu Nov 26 03:38:16 2026 +0000 bpf: Emit nospec after calls and atomics that write to the stack [ Upstream commit 1879b5e505de97e250bb2d7e6914fbdf4032e15b ] check_stack_write_fixed_off() sets nospec_result for BPF_ATOMIC insns and for calls of helpers and kfuncs too. do_check() ends a speculative path there, but bpf_convert_ctx_accesses() emits the nospec only after BPF_MEM stores. Later passes rewrite a call and need its aux data. Put the nospec in front of the next insn. Fixes: d6f1c85f2253 ("bpf: Fall back to nospec for Spectre v1") Fixes: 880442305a39 ("bpf: Introduce load-acquire and store-release instructions") Suggested-by: Luis Gerhorst Signed-off-by: Alexei Starovoitov Acked-by: Luis Gerhorst Link: https://patch.msgid.link/20261126033816.4124847-5-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit ea6d84a862269b4c8ac04c8fae82a76d0529bc9b Author: Alexei Starovoitov Date: Thu Nov 26 03:38:14 2026 +0000 bpf: Treat NOT_INIT as a pointer in __is_pointer_value() [ Upstream commit bbe2012ece4a72d4917dcc9b3461f7573a66c418 ] The blamed commit made __is_pointer_value() use is_pointer_regtype(), which is false for NOT_INIT. mark_reg_invalid() can set a spilled register to NOT_INIT, and check_stack_read_fixed_off() must not handle such a spill like a spilled scalar. Go back to the check for SCALAR_VALUE. Fixes: 1f737e46ca6a ("bpf: Remove artificial limitations on pointer types eligible for spilling") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261126033816.4124847-3-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit c648266256a831b0080ade9e8cf6f9f58bff4661 Author: Alexei Starovoitov Date: Thu Nov 26 03:38:13 2026 +0000 bpf: Undo insn aux changes of a failed speculative path [ Upstream commit fa84f87e42af9ffa3f777d4ea3b8c4f82a5a7436 ] If a check fails on a speculative path, do_check() adds a nospec before the insn and ends the path. The check can have written nospec_result and ctx_field_size of the insn already. The other paths can use the insn with another type of pointer, so these values do not apply to them. Save both fields before the check and restore them. Fixes: d6f1c85f2253 ("bpf: Fall back to nospec for Spectre v1") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261126033816.4124847-2-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 7f64733f9dde85d21ec2c381ce0f54a354551b76 Author: Ard Biesheuvel Date: Thu Nov 26 15:55:24 2026 +0100 efi/libstub: loongarch: Provide 64-bit integer shift helpers for 32-bit [ Upstream commit fe57062e09bc162be9133695d5f1459c1c0e46c0 ] The EFI stub's copy of lib/cmdline.c performs 64-bit shifts in memparse() [which is never actually called from the stub], and so it needs library routines when running on 32-bit CPUs that lack native instructions for this. The LoongArch 32-bit EFI stub build already pulls in the library helpers that are needed for this, but only when CONFIG_EFI_ZBOOT=y, which is not sufficient, given that the same helpers will be needed in the vmlinux build for the builtin copy of the EFI stub. On other architectures, the builtin copy will call vmlinux's versions of those routines, which are exposed to the stub via aliases in the linker script. However, on LoongArch, those are C implementations that may be instrumented and therefore unsuitable for use in the EFI stub. Reported-by: Dmitry Antipov Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/20261122125352.gAcg5yLx-lkp@intel.com/ Fixes: 3d9aba6618d1 ("LoongArch: Adjust build infrastructure for 32BIT/64BIT") Signed-off-by: Ard Biesheuvel Signed-off-by: Sasha Levin commit 5671c3e1dfbd66ea0ed7243180f051f99b43ca2b Author: Breno Leitao Date: Mon Aug 10 04:46:45 2026 -0700 sched/topology: Don't claim sched_domain_shared twice on the same domain [ Upstream commit 40fddc398878c2cf661b7f16d783bfc5b0000642 ] build_sched_domains() lets the asymmetric capacity path claim a sched_domain_shared object on the lowest SD_ASYM_CPUCAPACITY_FULL ancestor, and then unconditionally claims one for the topmost SD_SHARE_LLC domain. When those are the same sched_domain - a system whose single LLC spans CPUs of differing capacity, for example an arm64 machine with one MC domain covering every CPU - init_sched_domain_shared() runs twice on that domain. The second call overwrites sd->shared without dropping the reference the first call took, so the asym blob ends up with a refcount equal to the CPU count and nothing pointing at it. claim_allocations() sees the non-zero refcount and clears the per-CPU slot, so __sds_free() does not reclaim it either, and the object leaks. kmemleak reports one 32-byte object per build_sched_domains() call: unreferenced object 0xffff0000c02432a0 (size 32): comm "swapper/0", pid 1, jiffies 4294667436 hex dump (first 32 bytes): 08 00 00 00 08 00 00 00 00 00 00 00 20 00 00 00 ............ ... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace (crc f4478cb7): kmemleak_alloc+0x44/0xd8 __kmalloc_cache_node_noprof+0x344/0x5d0 build_sched_domains+0x2f8/0x2110 sched_init_domains+0xec/0x160 sched_init_smp+0x48/0x108 kernel_init_freeable+0x1cc/0x2b8 ref and nr_busy_cpus are both the online CPU count and alloc_flags is 0x20, SD_ASYM_CPUCAPACITY, identifying it as the blob the asym path claimed. Only claim a shared object for the LLC domain when the domain does not already have one. sd_init() zero initialises sd->shared for every domain it builds, so a non-NULL sd->shared here means the asym path already claimed this very domain. Cache aware scheduling still finds a shared object on sd_llc, the same one, covering the same span. Reproduced under QEMU/virtme-ng on arm64 with two capacity tiers (capacity-dmips-mhz 0x400 on cpu0-3 and 0x200 on cpu4-7), where the MC domain spans all CPUs and carries both SD_SHARE_LLC and SD_ASYM_CPUCAPACITY_FULL. Leaked sched_domain_shared objects reported by kmemleak, with a kmemleak-test module loaded as a positive control: before after after boot 1 0 after 12 rebuilds via CPU hotplug 13 0 That is exactly one leak per build_sched_domains(), and none once the domain is only claimed once. Fixes: 9e005ed21152 ("sched/topology: Allow multiple domains to claim sched_domain_shared") Signed-off-by: Breno Leitao Signed-off-by: Peter Zijlstra (Intel) Tested-by: André Draszik Link: https://patch.msgid.link/20260810-b4-sched_shared_leak-v1-1-3eacd249d0a3@debian.org Signed-off-by: Sasha Levin commit 6103177570ea57b527f1d6e6f3a54d97f54ae6bb Author: Marco Giunta Date: Sat Nov 21 08:05:10 2026 +0100 ASoC: aw88399: fix register used to disable I2S TX [ Upstream commit 1e5a677a5c53b96abf8004cc4d7ba0387f4e8505 ] aw_dev_i2s_tx_enable() uses I2SCTRL3 when enabling the I2S transmitter but I2SCFG1 when disabling it. Per the datasheet, the I2STXEN bit lives in I2SCTRL3. As a result, the I2S transmitter is never disabled when the device is stopped. Use I2SCTRL3 in both cases, as the vendor Android driver (aw883xx) and aw88166 (which is also derived from aw883xx) do. Fixes: 8ade6cc7e261 ("ASoC: codecs: Add aw88399 amplifier driver") Signed-off-by: Marco Giunta Link: https://patch.msgid.link/SN6PR19MB23038B66A212CA32A4B6B3CCFC472@SN6PR19MB2303.namprd19.prod.outlook.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 71e8bb9854da1dd58179b079f970706172bfb2cc Author: Rosen Penev Date: Wed Nov 25 16:26:50 2026 -0800 gpio: mvebu: validate ngpios before use [ Upstream commit 62a41997c1553b723a7a333c0246d0646ebd2c95 ] If ngpios is read as 0 from device tree, it is passed via irq_alloc_domain_generic_chips() as irqs_per_chip, which leads to a division by zero in DIV_ROUND_UP(d->revmap_size, irqs_per_chip). Reject ngpios == 0 early. Also reject higher than 32, which is the limit. Fixes: fefe7b0923459 ("gpio: introduce gpio-mvebu driver for Marvell SoCs") Signed-off-by: Rosen Penev Link: https://patch.msgid.link/20261126002650.603321-1-rosenp@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit cbbe75569c22f3f6efe454fef849fe35bf88ac5c Author: Sahaj Chaudhari Date: Tue Nov 24 19:06:53 2026 +0530 gpio: davinci: use controller-specific MMIO for BINTEN [ Upstream commit a142f1c5de4b9c03910cc304a26fbbdef69ca422 ] The file-global gpio_base can be overwritten when probes for multiple DaVinci GPIO controllers overlap. The later IRQ setup can then write the BINTEN register of a different controller. Derive the BINTEN address from the current controller's mapped bank instead of shared global state. Fixes: 118150f22d6b ("gpio: davinci: move to platform device") Reviewed-by: Linus Walleij Signed-off-by: Sahaj Chaudhari Link: https://patch.msgid.link/20261124121500.2cd5cbf30f89-2-sahaj123.sc@gmail.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 2247a20d6aa24ff7f2e774868cc680dbe3fdf008 Author: Peter Zijlstra Date: Thu Nov 19 09:51:01 2026 +0000 perf: Fix sigtrap vs fast-switch [ Upstream commit 34dc983cc1628dea5054baa8687477cbb8683e28 ] perf_sigtrap() contains: WARN_ON_ONCE(event->ctx->task != current) The warning assumes that an event's ctx->task always matches the task that ends up running the pending task_work. That assumption can be broken by the context fast-swap path. The failure sequence is: 1. A -> B switch, perf_event_context_sched_out() takes the fast path and does WRITE_ONCE(ctx->task, next) / WRITE_ONCE(next_ctx->task, task). An NMI then hits while the context is swapped, and __perf_event_overflow() queues pending task_work on the *current* task (A), even though the event now belongs to B's swapped-in context view. 2. B -> A switch. Because A now has pending task_work, nr_no_switch_fast is non-zero, so the slow path is taken and ctx->task is *not* swapped back. 3. A returns to user mode, task_work runs perf_pending_task() -> perf_sigtrap(), and event->ctx->task no longer equals current, tripping the WARN_ON_ONCE(). Therefore; the task_work_add() should in fact use event->ctx->task, rather than current. They are always the same, except in this narrow window between perf_event_task_sched_out() and switch_to(). Fixes: c5d93d23a260 ("perf: Enqueue SIGTRAP always via task_work.") Reported-by: Tengda Wu Tested-by: Tengda Wu Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/20261125161342.GP2669272%40noisy.programming.kicks-ass.net Signed-off-by: Sasha Levin commit 5a0463734a6be9dbc039cf5c052278e9a5641383 Author: Peter Zijlstra Date: Thu Nov 19 09:51:01 2026 +0000 perf: Fix sigtrap for software events [ Upstream commit 38606d2911f7f2fe80388315da0c4a7fc98af0f8 ] perf_sigtrap() contains: WARN_ON_ONCE(event->ctx->task != current) The warning assumes that an event's ctx->task always matches the task that ends up running the pending task_work. That assumption can be broken by the context fast-swap path. The failure sequence is: 1. A -> B switch, perf_event_context_sched_out() takes the fast path and does WRITE_ONCE(ctx->task, next) / WRITE_ONCE(next_ctx->task, task). An NMI then hits while the context is swapped, and __perf_event_overflow() queues pending task_work on the *current* task (A), even though the event now belongs to B's swapped-in context view. 2. B -> A switch. Because A now has pending task_work, nr_no_switch_fast is non-zero, so the slow path is taken and ctx->task is *not* swapped back. 3. A returns to user mode, task_work runs perf_pending_task() -> perf_sigtrap(), and event->ctx->task no longer equals current, tripping the WARN_ON_ONCE(). The nr_no_switch_fast bits hard rely on perf_pmu_disable() actually working. It turns out the software events do not implement the pmu::pmu_{dis,en}able() methods and generally ignore the state, making the above scenario worse in that an overflow can happen in the middle of swapping task contexts, making it impossible to reconstruct state. Ensure software and tracepoint events respect the disable state. Fixes: ca6c21327c6a ("perf: Fix missing SIGTRAPs") Fixes: c5d93d23a260 ("perf: Enqueue SIGTRAP always via task_work.") Reported-by: Tengda Wu Signed-off-by: Peter Zijlstra (Intel) Tested-by: Tengda Wu Link: https://patch.msgid.link/20261125161342.GP2669272%40noisy.programming.kicks-ass.net Signed-off-by: Sasha Levin commit 198c0d563279b2aaef2de60ad2ed5cc0632528f5 Author: Tengda Wu Date: Thu Nov 19 09:51:00 2026 +0000 perf: Prevent duplicate sigtrap task work enqueue [ Upstream commit e4c5112f01816b0ac6d74724545eca1195788c38 ] The sigtrap handling in __perf_event_overflow() checks event->pending_work before calling task_work_add(), but only sets pending_work after the task work has been queued. This leaves a window where an NMI can interrupt task_work_add() and re-enter __perf_event_overflow() for the same (software/tracepoint) event. Since pending_work is still zero, the nested invocation can enqueue the same pending_task again. The re-entrant call path looks like this: __perf_event_overflow() task_work_add() __perf_event_overflow() task_work_add() The nested invocation may enqueue pending_task before the outer invocation does. When the outer invocation resumes, it inserts the same task work entry again, potentially creating a cycle in the task work list. As a result, perf_pending_task() may be executed repeatedly, leading to unbalanced event reference counting. Fix this by atomically claiming pending_work with cmpxchg_local() before calling task_work_add(). This ensures that only one invocation can enqueue the task work, even when another overflow occurs re-entrantly from an NMI. Notably: sigtrap events must be per-task, meaning that the there is no concurrency, only re-entrancy. [peterz: clarify and rewrite] Fixes: c5d93d23a260 ("perf: Enqueue SIGTRAP always via task_work.") Signed-off-by: Tengda Wu Signed-off-by: Peter Zijlstra (Intel) Link: https://patch.msgid.link/45bd71c976aea1a0e8bf5762dd6b6552e6009439.1795053619.git.wutengda@huaweicloud.com Signed-off-by: Sasha Levin commit 81df8203858bf5db1fa633624fb180192a1defb5 Author: Florian Fainelli Date: Wed Nov 18 10:40:04 2026 -0800 net: dsa: tag_brcm: fix link-local detection with a prepended tag [ Upstream commit ae8e5ef9fa9eeaf4ee0a9a9bde0fc63023d9b154 ] brcm_tag_rcv_ll() checks eth_hdr(skb)->h_dest to avoid marking link-local frames as forwarded by the switch. With a prepended tag, eth_type_trans() sets the MAC header at the start of the tag, so the address checked is the tag plus the first two bytes of the real destination address. Link-local frames such as BPDUs, LLDP or EAPOL are then not recognized and get skb->offload_fwd_mark set, which keeps the bridge from forwarding them in software to the other ports of the switch when it is configured to do so. Read the destination address after the tag instead when the tag is prepended. Tags embedded after the source address are not affected. Fixes: 762e7e174da9 ("net: dsa: tag_brcm: do not mark link local traffic as offloaded") Signed-off-by: Florian Fainelli Link: https://patch.msgid.link/20261118184004.1916105-1-florian.fainelli@broadcom.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit ce7bbf8e3b2cc6b7c07021c4a3b9b6ac467594f7 Author: Shravya KN Date: Wed Nov 18 16:24:08 2026 +0530 tg3: Fix heap overflow in unbuffered NVRAM write path [ Upstream commit 0323a427052447e2c41c650fc98a6c04bf417e5d ] tg3_nvram_write_block_unbuffered() reads a whole NVRAM page into a buffer of pagesize bytes, copies the caller's data into it at page_off, and writes the page back. The copy size was clamped to pagesize rather than to the room left in the page, pagesize - page_off, so a write at an offset that is not page aligned, as ETHTOOL_SEEPROM allows, copies past the end of the buffer and corrupts the kernel heap. Clamp size to pagesize - page_off. Also advance buf by size on each iteration. Without this, a write that spans more than one page programmed every page after the first with the data of the first page, and a write that did not start on a page boundary lost the tail of the data without reporting an error. Reject an nvram_pagesize that is smaller than 4 or not a power of two. The page mask is pagesize - 1, which is only a valid mask for a power of two. A page size of 0, which tg3_get_nvram_info() leaves unset for an unhandled flash vendor, also made the loop issue erase commands at address 0 forever with the rtnl and NVRAM locks held. ethtool -E now fails with -EINVAL in these cases. This was found by an AI code review scan. It has not been observed on hardware, but it can be reached with ethtool -E on devices with unbuffered flash. Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Shravya KN Signed-off-by: Pavan Chebbi Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261118105408.1076095-4-pavan.chebbi@broadcom.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 7db0291197f9b307ed030f0c4b7d71d38ec09a6b Author: Pavan Chebbi Date: Wed Nov 18 16:24:07 2026 +0530 tg3: Skip management FW version when APE firmware is not ready [ Upstream commit 70e57e1255e06fd7a22d45dd2bf854200fcbd575 ] When the APE firmware is not present or not ready, for example when the NCSI component is missing in the NVRAM, tg3_read_fw_ver() still calls tg3_read_dash_ver() after tg3_probe_ncsi(). The signature and ready checks that tg3_read_dash_ver() used to make were moved into tg3_probe_ncsi(), which only sets the NCSI flag and does not stop the caller. The driver then reads the APE firmware version register, which holds no valid data in this state, and ethtool -i shows an invalid "DASH" string with a garbage version. Make tg3_probe_ncsi() return whether valid, ready APE firmware was found, and read the version only in that case. Otherwise just report the bootcode version. This was seen by a user on BCM5719/BCM5720 with no NCSI component in the NVRAM. With this change, ethtool -i displays only the bootcode version. Fixes: 165f4d1cb3d7 ("tg3: Fix the setting of the APE_HAS_NCSI flag") Signed-off-by: Pavan Chebbi Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261118105408.1076095-3-pavan.chebbi@broadcom.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 3814dc660178b3629454a9f3321cb8f73d9e1e8d Author: Pavan Chebbi Date: Wed Nov 18 16:24:06 2026 +0530 tg3: Don't fail probe if 31-bit coherent DMA mask is unsupported [ Upstream commit 686b8dbcedf8773dc505f9f315a0551c0bca70a3 ] Commit 614f4d166eee ("tg3: Set coherent DMA mask bits to 31 for BCM57766 chipsets") lowered the coherent DMA mask to 31 bits as a workaround for a spurious address overflow error in the hardware. The result of dma_set_coherent_mask() is fatal to probe, so on platforms that cannot satisfy such a mask the device fails to probe: tg3 0000:01:00.0: Unable to obtain 64 bit DMA for consistent allocations tg3 0000:01:00.0: probe with driver tg3 failed with error -5 This was reported on a Mac mini (Macmini6,2, BCM57766) running a kernel built without CONFIG_ZONE_DMA and with IOMMU passthrough as the default. Without CONFIG_ZONE_DMA, dma_direct_supported() only accepts a mask narrower than 32 bits if it covers the highest physical memory address, so with direct mapping a 31-bit coherent mask is rejected whenever memory extends above 2GB. Treat the 31-bit mask as best effort. If it is refused, warn and fall back to the mask used before 614f4d166eee, so that the device still probes. Platforms that accept the mask are unaffected. Where it is refused, 614f4d166eee never protected the device, it only stopped it from probing, so this restores the behaviour of kernels before that commit. Warn when a status block lands at an address matching the pattern described in 614f4d166eee, so that a resulting TX timeout can be identified. Fixes: 614f4d166eee ("tg3: Set coherent DMA mask bits to 31 for BCM57766 chipsets") Reported-by: Rui Salvaterra Link: https://lore.kernel.org/netdev/CALjTZvYKHWrD5m+RXimjxODvpFPw7Cq_EOEuzRi1PZT9_JxF+g@mail.gmail.com/ Signed-off-by: Pavan Chebbi Reviewed-by: Simon Horman Link: https://patch.msgid.link/20261118105408.1076095-2-pavan.chebbi@broadcom.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit aac2b3975560f8aa63665ae858efed248a71487d Author: Felipe Pereira Stival Date: Wed Nov 18 17:35:48 2026 -0300 tls: don't hide a queued KeyUpdate from poll() [ Upstream commit 285ca329ad4bfc32d0f383340c40a40c8157ac7c ] When application data and a KeyUpdate are both queued, the recv() for the data can also decrypt the KeyUpdate. That makes a rekey pending, and the KeyUpdate is left on rx_list because its record type differs. tls_sk_poll() reports no read events while a rekey is pending, so the socket doesn't poll readable although a recvmsg() would return the KeyUpdate. A reader that waits for a read event before each recv() never reads it, never provides the new key and receives nothing more. Report read events for records on rx_list while a rekey is pending, since they are already decrypted. Keep ignoring the records still in the strparser, so once the KeyUpdate has been read there are no read events until the new key is provided, as before. Update the documentation to say so. Found with a level-triggered epoll reader that does one recv() per read event. Without this patch it gets the data and then no read event for the KeyUpdate; with it, the KeyUpdate is reported and the rekey completes. Fixes: 47069594e67e ("tls: implement rekey for TLS1.3") Signed-off-by: Felipe Pereira Stival Reviewed-by: Simon Horman Reviewed-by: Sabrina Dubroca Link: https://patch.msgid.link/20261118-v0idpwn-tls-poll-parked-keyupdate-v1-1-8e25101e7be6@gmail.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 98cfdd08371696df6edfb553a66cb6f82e869129 Author: Linus Torvalds Date: Wed Nov 25 21:57:38 2026 -0800 net: dpaa2-eth: fix objtool warning and logic bug [ Upstream commit 25faec9ce61c01fb45abf812a222c5b43c3cd5c5 ] This commit came about because I locally had a build with COMPILE_TEST and various runtime hardening features (that don't make sense for a pure build test anyway) disabled - and objtool complained about some of the code as a result: drivers/net/ethernet/freescale/dpaa2/fsl-dpaa2-eth.o: warning: objtool: dpaa2_eth_add_bufs+0x3f8: stack state mismatch: reg1[15]=-1+0 reg2[15]=-2-208 The reason seems to be that without the hardening features, objtool notices that gcc is doing really odd things with the 'page' variable, which is uninitialized in the path where 'ch->xsk_zc' is true. Now, this seems to be just objtool becoming confused about some ugly code, but that code is _also_ actively buggy in a different way, so let's just fix this all. What confuses objtool seems to be the stack slot for the uninitialized 'page' variable - for the case where that variable isn't actually used. There is some shared error handling code that frees the previously allocated page or xsk buffers depending on previous state. That code is ugly and worth fixing: just free the page or buffers in the context where they are actually allocated, not at some common point where you have to wonder "which one is it I'm supposed to free again?". That gets rid of the objtool warning, because now gcc doesn't take messy and incomprehensible source code and turn it into messy and even more incomprehensible object code any more. No more questionable stack frames with CFI information that blows objtool's little mind. But fixing that then makes a real bug more obvious: the freeing of the xsk buffers is buggy. It frees the buffers that never got mapped: for (; i < batch; i++) xsk_buff_free(xdp_buffs[i]); and that looks sane enough: iterate over the unused part of the batch. But it's horrendously wrong, because it updates 'i'. And 'i' isn't some harmless little local loop counter. It's the variable that is supposed to contain how many buffers have been successfully mapped. So now that 'free the buffers we didn't map' loop ends up updating that counter, and after the loop 'i' will be the whole batch we allocated. So that loop first freed the buffers that failed to map, and then as a side effect said "all these buffers I just freed were successfully mapped" and they would be released to hardware. So objtool didn't actually find a real bug. It just found code that was so ugly that it triggered a false positive. And as is often the case with ugly code: people hadn't understood it either, and it was buggy. It's worth noting that the code is still ugly. A variable name like 'i' is perfectly fine for some random anonymous loop iterator that is just that. But when it has serious meaning outside the loop, you should give it a serious name that makes sense non-locally. This does not fix that kind of ugliness. This is just the minimal fix for the objtool warning and the entirely incidental bug it then uncovered. They had nothing in common except for the obfuscated C code contest entry. Fixes: 48276c08cf5d ("net: dpaa2-eth: AF_XDP RX zero copy support") Cc: Robert-Ionut Alexa Cc: Ioana Ciornei Cc: David S. Miller Cc: Andrew Lunn Cc: Jakub Kicinski Cc: Paolo Abeni Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin commit 26e4ae717c76aa147e1c3e28bbab089133f6f169 Author: Jiayuan Chen Date: Mon Nov 23 20:24:31 2026 +0800 tcp: fix negative sk_forward_alloc after MSG_ZEROCOPY append [ Upstream commit e50436deae925d1b95b01936e2499428c4782a6a ] Our local syzbot reported the following warning: WARNING: ./include/linux/ucopysize.h:57 at tcp_sendmsg_locked+0x1e13/0x1f20 Modules linked in: CPU: 3 UID: 0 PID: 377 Comm: syz.2.2248 Not tainted 7.4.0-rc2+ #398 PREEMPT RIP: 0010:tcp_sendmsg_locked+0x1e13/0x1f20 Call Trace: tcp_sendmsg+0x2c/0x50 inet_sendmsg+0x62/0xb0 __sys_sendto+0x2fe/0x350 __x64_sys_sendto+0x7f/0xb0 x64_sys_call+0x1375/0x27e0 do_syscall_64+0xe4/0x470 entry_SYSCALL_64_after_hwframe+0x76/0x7e The problem is here: if (!skb_zcopy_pure(skb)) { copy = tcp_wmem_schedule(sk, copy); if (!copy) goto wait_for_space; } When MSG_ZEROCOPY data is appended to a skb that already holds copied data, only the user length is scheduled, but the pinned pages are then charged by their truesize: skb_zerocopy_iter_stream __zerocopy_sg_from_iter zerocopy_fill_skb_from_iter //truesize += PAGE_ALIGN(copied + start) sk_mem_charge(sk, truesize) //sk_forward_alloc goes negative For example, sending 8 iovecs of 1 byte each schedules 8 bytes and charges 32768 with 4K pages. On a later sendmsg() without MSG_ZEROCOPY, if sk_wmem_schedule() fails (e.g. tcp_mem hard limit is reached), tcp_wmem_schedule() returns min(copy, sk->sk_forward_alloc), which is negative. The negative copy is passed to skb_copy_to_page_nocache() and triggers the warning, and sendmsg() fails with -EFAULT. A few options were considered: 1) Schedule the truesize up front. It is not known before the pages are pinned, it depends on the iovec layout. 2) Do not append zerocopy data to a non pure skb. This splits a small header and its zerocopy payload into two skbs. 3) Schedule the missing part right after the pages are charged. They are already in the skb at this point, so this can not fail. Go with 3). Fixes: 849b425cd091 ("tcp: fix possible freeze in tx path under memory pressure") Signed-off-by: Jiayuan Chen Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20261123122432.297135-1-jiayuan.chen@linux.dev Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 46a1798eee461c7d8839b35e3409a157eb10a645 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:38 2026 +0000 bpf: Check the type of R0 at the exit of a struct_ops program [ Upstream commit 65e362827a6edf078ef8f5d34fbaea2ccb6b7879 ] check_return_code() takes reg->btf for valid when it is not NULL. The field is in a union, so for other types of registers it holds something else, and the verifier follows that as a struct btf. Look at it only when the register is PTR_TO_BTF_ID. Fixes: 8d9f547f74c7 ("bpf: Allow struct_ops prog to return referenced kptr") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-48-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit ada9a68166127ba53e169a7b18f8cdd235db6111 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:37 2026 +0000 libbpf: Fix struct_ops members 59-61 and optional struct_ops maps [ Upstream commit 434ea9c5125a8c3ad16e241687e1983309f99d1c ] expected_attach_type of a struct_ops program is the index of the member. For members 59, 60 and 61 it is equal to an attach type of tracing multi, and attach_btf_obj_fd is overwritten. The load fails when the struct is in a module. Look at the type of the program too. Only the first map of SEC("?.struct_ops") or SEC("?.struct_ops.link") is not created by default. The '?' is skipped in the loop over the variables, so the next ones do not see it. They are created, and their programs are loaded. Look at it once. Fixes: f2aa370dfe57 ("libbpf: Add support to create tracing multi link") Fixes: 5ad0ecbe056a ("libbpf: Struct_ops in SEC("?.struct_ops") / SEC("?.struct_ops.link")") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-47-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 7bb07f4f1cd5778c5aae3bbf241f75013b87a207 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:36 2026 +0000 bpf, sockmap: Hold the psock of the work in sk_psock_backlog() [ Upstream commit 9abfa0ad4f7606619586187152a0479efd306b13 ] The socket can leave its map and come back after the test of SK_PSOCK_TX_ENABLED. sk_psock_get() takes a reference to the new psock then, and the work puts the old one that has none left. The new one and its socket are never freed. Take the reference that is put. Fixes: 8259eb0e06d8 ("bpf, sockmap: Avoid using sk_socket after free when sending") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-46-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 384507f328d2768bcab57b5c3b4fe47bec4d718e Author: Alexei Starovoitov Date: Wed Nov 25 03:29:35 2026 +0000 bpf, sockmap: Keep the parser and sk_data_ready in sync [ Upstream commit b3a433f20f0a247cb2c4664b6e1400253287da63 ] sk_psock_strp_data_ready() takes the psock that the socket has at the call. An update from a program does not wait for the owner of the socket, so that is not always the psock that has set the callback, and it may have no parser. strp_data_ready() dereferences a NULL strp->sk then. Look at SK_PSOCK_RX_STRP_ENABLED, it is set under sk_callback_lock. The event is dropped, as it is when the socket has no psock. A socket can be in a map with a verdict program and not have it, the program was attached after the update. Another map can start the parser then. The delete from the first map restores sk_data_ready and nobody stops the parser: WARNING: net/strparser/strparser.c:451 at strp_done+0xef/0x130 Stop the parser when its callback goes away. The psock can outlive the stop, and a later update must not run strp_init() on works that are still pending. Start the stopped parser again instead. Fixes: 0126240f448d ("bpf: sockmap: Allow update from BPF") Fixes: ef5659280eb1 ("bpf, sockmap: Allow skipping sk_skb parser program") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-45-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 03f781c4021c22cb58c1c87e74ddb0d5ba37a26d Author: Jakub Sitnicki Date: Fri Oct 30 13:01:54 2026 +0100 bpf, sockmap: Fix psock update-side data races on sk->sk_prot and progs [ Upstream commit bcd07fd1673beb873e2bee2731e4ef4d716e70c7 ] The update side of the sockmap psock lifecycle has several unsynchronized accesses to sk->sk_prot and psock prog state that KCSAN flags when the new update-vs-delete race selftest runs. The fix comes from Alexei [1]: * sock_map_link() installed psock programs and called sock_map_init_proto() before taking sk->sk_callback_lock, racing a concurrent teardown's tcp_bpf_update_proto() write of sk->sk_prot. Take the write_lock early, before psock_set_prog() and sock_map_init_proto(), and drop the psock->saved_data_ready gating from prog detection (it is re-checked under the lock before stopping progs). * sock_map_del_link() read psock->saved_data_ready outside the lock. Move the saved_data_ready check under write_lock_bh(&sk->sk_callback_lock) so prog teardown is serialized against the proto restore. * sock_map_psock_get_checked() and sock_map_sk_is_suitable() did plain sk->sk_prot reads. Convert to READ_ONCE() to mark the intentional racy read against the WRITE_ONCE() swap in sock_replace_proto(). With these changes the sock_map_link/psock_set_prog side of the reported KCSAN splats is silenced; the remaining teardown-vs-core-TCP pairings are the separate read-side annotation problem. [1] https://lore.kernel.org/bpf/DMBHB0TQOV1L.38MECMYFGUS5B@gmail.com Suggested-by: Alexei Starovoitov Signed-off-by: Jakub Sitnicki Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261030-bpf-next-v1-2-035eabf8eae7@cloudflare.com Stable-dep-of: b3a433f20f0a ("bpf, sockmap: Keep the parser and sk_data_ready in sync") Signed-off-by: Sasha Levin commit 5a7d628db1b1a51b89a4198d54eade6de082cb47 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:34 2026 +0000 bpf: Keep the MAC header in bpf_skb_change_tail() [ Upstream commit 28ffeb9cb9722f39854f11e5f0511a4a8c12d9fb ] The least length of the skb is the offset of the transport header when it's set, also when that is below the offset of the network header. Callers of tc programs count on a skb that is not shorter than mac_len. Take the bigger one of the two offsets. Fixes: 5293efe62df8 ("bpf: add bpf_skb_change_tail helper") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-44-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 39e7a6cae51aa797873e78876647055b815459ba Author: Alexei Starovoitov Date: Wed Nov 25 03:29:33 2026 +0000 bpf: Take a neighbour of the L3 master in bpf_redirect_neigh() [ Upstream commit c1b5decc73149f69db0b8d28ebcea204249e3b0b ] bpf_redirect_neigh() takes the neighbour from the route, the skb gets the device that the program has named. They are not always the same for IPv4, and the queue of a neighbour is purged with its own device only. When a L3 master was named take a neighbour of that device, as IPv6 does. Its driver drops the header and routes the packet, one entry does for all. Fixes: ba452c9e996d ("bpf: Fix bpf_redirect_neigh helper api to support supplying nexthop") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-43-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 905c8b36242644c3abb8953d4568b9c54abf7401 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:32 2026 +0000 bpf: Clear family and port of a short address for cgroup sockaddr hooks [ Upstream commit 2abc088aae543fa97350df8b2dd5eedf622e380d ] recvmsg() from a unix socket that has no name leaves the buffer of the address as it is, and that is on the stack of the kernel. The program reads user_family and user_port whatever the length is. bpf_sock_addr_set_sun_path() sends the family to user space. Clear the bytes from the length up to 4. Write AF_UNIX next to the path in the kfunc. Fixes: 859051dd165e ("bpf: Implement cgroup sockaddr hooks for unix sockets") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-42-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 1eaf3bad5655d959355fe240e760cfafc377c49b Author: Alexei Starovoitov Date: Wed Nov 25 03:29:31 2026 +0000 bpf: Fix slices behind the end of an XDP packet [ Upstream commit 2fc7a1733992e28d4c89f57e2c237b85b236d83c ] A dynptr keeps the size that the packet had at bpf_dynptr_from_xdp(). When the packet has shrunk since, bpf_dynptr_slice() takes the error of bpf_xdp_pointer() for "not linear" and copies from the frags. A linear packet has none, its skb_shared_info is what the buffer held before. Return NULL. Don't look at the frags of a linear packet for a length of 0 at its end either. Fixes: 66e3a13e7c2c ("bpf: Add bpf_dynptr_slice and bpf_dynptr_slice_rdwr") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-41-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 49eed2bea7b43616b5d2d444d2aa290656da1d60 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:30 2026 +0000 bpf: Fail loads from a network header that was not set [ Upstream commit 766907cdaeefb57faddc5d09a49bdd4ce20a6272 ] skb->network_header is 0 until something sets it. Loads at SKF_NET_OFF and bpf_skb_load_bytes_relative() start at skb->head then, and read headroom that nobody has written. qrtr and AF_XDP in copy mode make such skbs. Fail the load, like for the MAC header. A network header at skb->head counts as set when skb->data or the MAC header is there too. CAN and 6LoWPAN make such skbs. Fixes: 2e07fa9cd3ba ("[SK_BUFF]: Use offsets for skb->{mac,network,transport}_header on 64bit architectures") Fixes: 0f5d82f187e1 ("net/filter: Permit reading NET in load_bytes_relative when MAC not set") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-40-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 0594eb59dea3dc99bab6d0a842a0a609431e500a Author: Alexei Starovoitov Date: Wed Nov 25 03:29:29 2026 +0000 bpf: Clear the data that bpf_msg_push_data() adds [ Upstream commit 401fce9f48b1d684b92dbc08389d7c20bd036280 ] The helper puts a new page into the message as the allocator gave it. Bytes that the program does not write can be read by it, and are sent to the peer. Allocate zeroed memory. Fixes: 6fff607e2f14 ("bpf: sk_msg program helper bpf_msg_push_data") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-39-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 6f98784fa15afa1479f07a6a86fdd687d0e2b5be Author: Alexei Starovoitov Date: Wed Nov 25 03:29:28 2026 +0000 bpf, arm64: Restore the shadow call stack pointer after an exception [ Upstream commit 918bea2c6b682405b20cde0f44e76b0161dde912 ] bpf_throw() does not return, its return address stays on the shadow call stack. The caller of the program takes it for its own. test_progs -t exceptions crashes the kernel with CONFIG_SHADOW_CALL_STACK: Internal error: Oops - FPAC: 0000000072000000 [#1] SMP pc : bpf_test_run+0x410/0x968 JITed code puts nothing on the shadow call stack, and bpf_throw() skips only frames of JITed code. So that address is the only entry that is left behind. Pop it in the prologue of the exception callback. Fixes: 22fc0e80aeb5 ("bpf, arm64: support exceptions") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-38-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 9a2cb210f7c90350735e05073f6f38fce3a94595 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:27 2026 +0000 bpf, x86: Fix the range of BPF code that has a frame pointer [ Upstream commit 1c34522e8b78b3d91b75fd7bd2318c8e7e293a76 ] The ORC unwinder trusts rbp between ksym.fp_start and ksym.fp_end. The JIT sets fp_end to an offset in the code of the exit insn, and fp_start counts the CFI preamble, which is in front of the symbol. The main program of a program with subprogs and trampolines of struct_ops get neither. The range ends at the epilogue, compilers put blocks behind it. So stack traces with BPF code in them are not reliable, and livepatch waits for tasks that sleep there. Behind the prologue of a program only the return has no frame. Record its offset in fp_ret and take all the rest. Count from the start of the symbol, copy the offsets from func[0], and from a struct bpf_tramp_image that struct_ops passes for the time of the call. Fixes: ca45c84afb8c ("bpf: Add bpf_has_frame_pointer()") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-37-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 490fa98ce6bdb2ca85503eec2d2b5dee9ff88fda Author: Alexei Starovoitov Date: Wed Nov 25 03:29:24 2026 +0000 bpf: Require CAP_PERFMON for the dump of all storages of sockets [ Upstream commit f9e4fda5eb350f4a310eb266cad83d55c14b3e1c ] inet_diag dumps values of all sk_storage maps when the request names no map. It takes CAP_BPF and no fd. These are data of other programs, and tracing programs keep addresses and memory of the kernel there. Ask for CAP_PERFMON. "ss --bpf-maps" needs it then. A request with fds of maps works as before. Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-34-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 675c8c95ce0de6528ba9dbdf525956cbbcecc30b Author: Alexei Starovoitov Date: Wed Nov 25 03:29:23 2026 +0000 bpf: Require CAP_PERFMON to pass values of insn_array as memory [ Upstream commit 5fec973f49daeb6f21993d9ea94f1231c975191b ] The value of an insn_array has addresses in the JIT image. Helpers take it for plain memory. Refuse to pass it without CAP_PERFMON. gotox works as before. Fixes: 493d9e0d6083 ("bpf, x86: add support for indirect jumps") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-33-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit d58a00b7f34eca48a9b7fbc986fb230a1aa9075f Author: Alexei Starovoitov Date: Wed Nov 25 03:29:22 2026 +0000 bpf: Require CAP_PERFMON to read pinned maps with special fields [ Upstream commit 398557b30b9cd673a762d284c714b5c6b2769fbe ] A read of a pinned map prints values as they are in memory. bpf_timer, bpf_wq, bpf_list_head and bpf_rb_root are arrays of u64 for BTF and have addresses. Refuse open() of the file. BPF_OBJ_GET works as before. Fixes: b00628b1c7d5 ("bpf: Introduce bpf timers.") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-32-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 3ac5186649c67c675e903ff50dde4314ab0a725b Author: Alexei Starovoitov Date: Wed Nov 25 03:29:21 2026 +0000 bpf: Zero bpf_list_head in copies of map values [ Upstream commit 8252c3517f95f02a8569480563a773e0462dce52 ] Lookups from user space copy the value to a buffer and init special fields there. An empty list_head points to itself. The caller gets the address of the buffer. Fill the fields with zeros. It's what a new element of a map has. bpf_refcount in a value reads as 0. Fixes: 3e81740a9062 ("bpf: Centralize btf_field-specific initialization logic") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-31-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit d105cb4dbc7a3e68b3200d8fde638deeb697d2e2 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:20 2026 +0000 bpf: Require CAP_PERFMON for dumps of xlated insns [ Upstream commit b8aa487429d46a72881933c026a6ca2a8e72d6d2 ] The verifier puts addresses of the kernel to insns: for ksyms, inlined helpers and hidden arguments. The dump of xlated insns hides the ones of maps and calls only, the others look like constants by then. Give no dump, as for a blinded program, to who has no CAP_PERFMON and can't read kallsyms. Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-30-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 09b77547cceaa4a4d56edd4d0f53d62ee022eb86 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:19 2026 +0000 bpf: Limit reads of variables of the kernel [ Upstream commit 419c69483a62c9b91654e9fa32e3782efea5dc7c ] ld_imm64 of a variable that is not a struct gives readable memory, so do bpf_per_cpu_ptr() and bpf_this_cpu_ptr(). Many variables hold addresses, and CAP_BPF is enough to read them. The size comes from BTF, and that can be BTF of the program. Loads from such memory are not probed. Ask for CAP_PERFMON, as for the access to a struct. Addresses of functions and of per-cpu variables can be loaded as before. Take BTF of the kernel and of modules only, libbpf passes no other. Fixes: eaa6bcb71ef6 ("bpf: Introduce bpf_per_cpu_ptr()") Fixes: 541c3bad8dc5 ("bpf: Support BPF ksym variables in kernel modules") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-29-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 9d1d0f6d89daa43e26cc3da68108601258a2141a Author: Alexei Starovoitov Date: Wed Nov 25 03:29:16 2026 +0000 bpf: Give syscall programs without CAP_PERFMON the base helpers only [ Upstream commit 2ff55b023f637d61a56a893b0a3eb534acfb2ffd ] A syscall program needs CAP_BPF only, and it gets all helpers of tracing programs. These don't ask for CAP_PERFMON, the load of a tracing program does. The helpers for loader programs take current for the loader. It's another task in a callback. bpf_kallsyms_lookup_name() answers in a callback of bpf_wq, as a kworker has all capabilities. bpf_sys_close() in a task work closes a file of any process. Give the program the base helpers. It loses bpf_perf_event_output() too. Loader programs are not affected, bpf_sys_bpf() needs CAP_PERFMON already. Fixes: 79a7f8bdb159 ("bpf: Introduce bpf_sys_bpf() helper and program type.") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-26-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 1994d653fc4e9680d1f4f3600fd0dfdc799c8d69 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:14 2026 +0000 bpf: Fix reads past an enum in prints of BTF data [ Upstream commit 6c8d5a113c2341a9fc12a6550c0645d5cda0d56d ] An enum has 1, 2, 4 or 8 bytes. It's read as int, enum64 as u64, whatever the size is. The file of a map in bpffs shows what is behind a key or a value that ends with a short enum. Read as many bytes as the type has. The check of a member of a struct with bitfields takes any enum for 4 bytes, so an enum of 8 bytes can stick out of it. Use the size there too. Short enums are printed by their names. BTF with an enum that sticks out of its struct is refused, compilers don't make it. Fixes: 9eea98497951 ("bpf: fix BTF verification of enums") Fixes: 6089fb325cf7 ("bpf: Add btf enum64 support") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-24-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 4ba8f9000ccc5b54707c447a63aa466a4c6c2b19 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:13 2026 +0000 bpf: Flush TLB when a page of arena replaces the scratch page [ Upstream commit 16829046f0a0df75fe0a0b937771ffa301b650f7 ] A fault of a kfunc maps the scratch page. An allocation at that address puts a new page in its place. flush_tlb_before_set() is empty on x86, so all cpus that have touched the address keep the scratch page in TLB. The program reads junk from the page that it has got, and its writes are lost. The flush takes an IPI. Do it after the lock is dropped when the caller can sleep. Otherwise fail and free the range: the work unmaps the scratch page and flushes TLB. The range is taken until then. As with any deferred free, it stays taken when kmalloc_nolock() of the span fails. Fixes: f64c723741c9 ("bpf: Replace scratch PTE atomically when allocating arena pages") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-23-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 3ce70b4c03ed72306b4a87212fa1b394efaddc5e Author: Alexei Starovoitov Date: Wed Nov 25 03:29:12 2026 +0000 bpf: Refuse mmap() of a part of an arena [ Upstream commit 0cd1f2029b1b9fd7ceb52e3dfec181452cf20be0 ] The first mmap() sets the addresses of an arena that has no map_extra. It can be shorter than max_entries, but all pages stay in the range tree. An allocation without an address gets pages behind the end of the mapping. They can be mapped behind the vmalloc area of the arena. Require the length of the whole arena, as for an arena with map_extra. libbpf and cilium/ebpf map all pages. Fixes: b795379757eb ("bpf: Introduce range_tree data structure and use it in bpf arena") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-22-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 3df697a1c1f06a4e2a5f1a49f63e6a40aed3952e Author: Alexei Starovoitov Date: Wed Nov 25 03:29:10 2026 +0000 bpf: Take bpf_lock with interrupts disabled [ Upstream commit 2c00b6b35af0122f1b1fc0ea029bcb567fd4f1b8 ] A program can disable interrupts with bpf_local_irq_save(). bpf_setsockopt(TCP_CONGESTION) can put the last reference of a struct_ops map there, which removes the symbols of the trampolines with spin_lock_bh(). Use the irqsave lock, as bpf_map_free_id() does. PREEMPT_RT is as before, both locks sleep there. Fixes: 5db69b0fbdc8 ("bpf: Make struct_ops tasks_rcu grace period optional") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-20-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 295c04fb54d2dc63145e76eb3b9c0a7c7dc3c65e Author: Alexei Starovoitov Date: Wed Nov 25 03:29:09 2026 +0000 bpf: Refuse metadata maps of signed programs that can be mapped writable [ Upstream commit c66c8adf3226e02b74a33728d1fa1e911c3f0d21 ] The signature of a program covers the value of its metadata maps. It holds because they are frozen and exclusive. The freeze is not final for an array that user space was allowed to map for writing, which is why bpf_map_mmap() refuses that for read-only maps. A loader writes to its map, so it's not one of those. Refuse a map that has BPF_F_MMAPABLE without BPF_F_RDONLY_PROG. Light skeletons do not set it. Fixes: b707068e0ed9 ("bpf: Verify signed loader metadata at load time") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-19-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 85a497313badffbe306b0aa600e7b09b3aba46b3 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:08 2026 +0000 bpf: Check the attach type when a cgroup link gets another program [ Upstream commit a5e757f6cb34e1be0700359a02567722bcbbf6e3 ] BPF_LINK_UPDATE compares only the type of the program. A program that is verified for one hook runs in another one. In setsockopt the result of bpf_get_retval() is an errno, in getsockopt it is any int. Check expected_attach_type, as the attach does. Fixes: 0c991ebc8c69 ("bpf: Implement bpf_prog replacement for an active bpf_cgroup_link") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-18-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit b08c2e051f488f06d15bbc1fa79fb8dee0bb4fa3 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:07 2026 +0000 bpf: Fix NULL dereference in XDP redirect from async callbacks [ Upstream commit f28ed533106bc01aedba6ba47c0e1a1098c92092 ] bpf_redirect() and bpf_redirect_map() do not take the context, so the timer callback of an XDP program can call them. There is no current->bpf_net_context then: KASAN: null-ptr-deref in range [0x0000000000000038-0x000000000000003f] RIP: 0010:bpf_xdp_redirect+0x5b/0x170 Return XDP_ABORTED, like the tc helpers return TC_ACT_SHOT. It is one more test and branch on a value that is loaded anyway. Fixes: 401cb7dae813 ("net: Reference bpf_redirect_info via task_struct on PREEMPT_RT.") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-17-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit e7571a85dc8752e59a85e70cdc8c9c3b7b6063e0 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:06 2026 +0000 bpf: Do not fill jited line info for a hidden subprog [ Upstream commit 2f2b119ea30dfba27563c1c939eb42b5298a391a ] func_idx of the default exception callback is func_cnt, and the test for hidden subprogs is off by one. The address of the callback goes to jited_linfo[0]. libbpf and bpftool refuse the jited line info of the prog. Fixes: 335d1c5b5452 ("bpf: Implement support for adding hidden subprogs") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-16-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 565c58ceb5d841220384a53a1aa98f9e2eb68c00 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:05 2026 +0000 bpf: Add the symbol of a prog before its id [ Upstream commit f7a40c2de8d4abdea6d1e21122b447b593e28bd9 ] A prog can be taken by its id and run before bpf_prog_kallsyms_add(). bpf_throw() does not find the main prog and oopses: KASAN: null-ptr-deref in range [0x0000000000000568-0x000000000000056f] RIP: 0010:bpf_throw+0x129/0x220 The exception table is found by the same symbol. Add the symbol first. bpf_prog_free() removes it when there is no id. Fixes: 3dec541b2e63 ("bpf: Add support for BTF pointers to x86 JIT") Fixes: f18b03fabaa9 ("bpf: Implement BPF exceptions") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-15-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit e12bce2746af0a4ec423790db8de66afb8766347 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:04 2026 +0000 bpf: Leave nothing behind in the frame of bpf_throw() [ Upstream commit 86cedb416c4651dde27cfb8142541de8dd2801d9 ] bpf_throw() does not return. What is kept for the return stays behind. With fexit on bpf_throw() the trampoline is never freed. With kretprobes and function_graph the next traced function up the stack takes the return address of bpf_throw() for its own. Mark it notrace and NOKPROBE_SYMBOL. kasan_unpoison_task_stack_below() takes the stack for aligned to THREAD_SIZE. The stack for interrupts of x86-64 is aligned to a page. A program that throws in softirq can leave the redzones of bpf_throw() there: BUG: KASAN: stack-out-of-bounds in stack_trace_consume_entry+0x14e/0x170 It is the only frame with redzones that is skipped. Do not instrument it. Fixes: f18b03fabaa9 ("bpf: Implement BPF exceptions") Fixes: ec5290a178b7 ("bpf: Prevent KASAN false positive with bpf_throw") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-14-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit b9ed0b69ed847d948991e97e426a763f800fb9b4 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:02 2026 +0000 bpf: Do not trust the neighbour of tp_btf/neigh_create [ Upstream commit 2c517088d2ef5f9b17fcb2e44a296e36c5a91843 ] ___neigh_create() calls the tracepoint before it tests the result of neigh_alloc(). It is NULL when the table is full. The verifier takes it for a trusted pointer, and a load through it oopses: BUG: kernel NULL pointer dereference, address: 000000000000013c RIP: 0010:bpf_prog_56e3384dcafb1b5b_on_create+0x61/0xc4 Mark it untrusted, loads through it are probed then. PTR_MAYBE_NULL would refuse programs like bpftune, which pass &n->parms to bpf_probe_read_kernel() without a check. The pointer cannot be passed as memory or as a trusted argument any more. Fixes: 838a10bd2ebf ("bpf: Augment raw_tp arguments with PTR_MAYBE_NULL") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-12-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 9b541d3b4e1824448131c0a239b3bd14438855ca Author: Alexei Starovoitov Date: Wed Nov 25 03:29:01 2026 +0000 bpf: Keep the names in front of a number in delegate options [ Upstream commit 4151f3558d6e65d4ae6cf1a431537ed52ad48239 ] The delegate_* mount options of bpffs take names and numbers. A number overwrites the mask, the names in front of it are lost. That is the order in which /proc/mounts shows them. Fixes: 6c1752e0b6ca ("bpf: Support symbolic BPF FS delegation mount options") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-11-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit adb6ff0017bc4d89c124f373e70bb3e288c0f914 Author: Alexei Starovoitov Date: Wed Nov 25 03:29:00 2026 +0000 bpf: Check that a program and a struct_ops map are for the same struct [ Upstream commit 80184a7381c11eae0103f0c432e2adf6a5fd476f ] A map takes a program when the id of the struct and the index of the member are the same. Ids of types are not unique among modules. Compare BTF too. BPF_PROG_ASSOC_STRUCT_OPS takes any struct_ops map, and the callers of bpf_prog_get_assoc_struct_ops() take the result for their own struct. Pass the struct_ops that the caller wants, return NULL for another one. The callers are scx_prog_sched() of sched_ext and bpf_testmod, they change with the prototype. Fixes: f6be98d19985 ("bpf, net: switch to dynamic registration") Fixes: b5709f6d26d6 ("bpf: Support associating BPF program with struct_ops") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-10-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit b5af6856e317ce94b3097125b374372a7c427203 Author: Alexei Starovoitov Date: Wed Nov 25 03:28:59 2026 +0000 bpf: Reserve cookie and ip in the trampoline for tail calls [ Upstream commit bf675c92165500367509fc126338ef3dea4611ed ] The trampoline has a session cookie and the address of the function only when the program that is attached asks for them. After a tail call bpf_get_func_ip() returns what is on the stack, and bpf_session_cookie() points to the first argument, which the trampoline passes to the function: KASAN: maybe wild-memory-access in range [0x4141414141414148-0x414141414141414f] RIP: 0010:vfs_truncate+0x32/0x450 Ask for both when the program has a tail call. Fixes: 9b99edcae5c8 ("bpf: Add bpf_get_func_ip helper for tracing programs") Fixes: eeee4239dbb1 ("bpf: support fsession for bpf_session_cookie") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-9-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit f68ee590c849cf18c03e69695d9cf41d60a08e60 Author: Alexei Starovoitov Date: Wed Nov 25 03:28:58 2026 +0000 bpf: Compare what a hook tells next to its prototype at tail calls [ Upstream commit 98ff9cff0b94050d0404e1c5bee717ab3423a2d4 ] Hooks of one prototype differ in what the verifier assumes: - struct_ops: two structs can have the same index and prototype of a member. Nullable and referenced arguments, filters of kfuncs and the prologue belong to the struct. - tp_btf: which arguments can be NULL. - LSM and iterators: what is trusted, helpers, kfuncs, return values. - A tracer of a program: the context of the target. Compare that. Tracepoints that agree, and tracers of kernel functions, share a prog array as before. Two LSM hooks cannot. Fixes: 28ead3eaabc1 ("bpf: Prevent tail call between progs attached to different hooks") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-8-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 0310f6d591eb82e96f3cc936927562b2ea0bf642 Author: Alexei Starovoitov Date: Wed Nov 25 03:28:57 2026 +0000 bpf: Take the attach type of the target for tail calls of an extension [ Upstream commit 3d6d222bb9794a054188e9304b5c5f0c30a83063 ] A prog array compares expected_attach_type. It is 0 for an extension at the time of the check, so the extension can call programs that were checked for another attach type, and cannot share an array with its target. Take the attach type of the target. Fixes: 4540aed51b12 ("bpf: Enforce expected_attach_type for tailcall compatibility") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-7-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 8b61c76664a0223a0e68d12585216dcbb419485b Author: Alexei Starovoitov Date: Wed Nov 25 03:28:56 2026 +0000 bpf: Check that an extension fits the hook of its target [ Upstream commit f44d0e6a1d684167d4fc58d313077ba21ad6f301 ] An extension runs in the hook of its target, and the checks for the hook do not see it. Tracing, LSM and struct_ops programs are checked against the BTF of their hook. An extension takes the type of its target, but it has no attach_btf and no st_ops, and attach_btf_id and the prototype are those of the function that it replaces: - tp_btf: it can read more arguments than the tracepoint has. - LSM: the range of bpf_get_retval() and bpf_set_retval(), and the helpers that only some hooks have, are looked up by a wrong id. - tp_btf and struct_ops: the load can oops. fentry, fexit, fsession and iterators cannot be extended already. Refuse the rest. freplace of global functions of tp_btf, fmod_ret and LSM programs goes away. Targets of other types load with any expected_attach_type. Do not take their extension for tp_btf or for an iterator. Some properties of a program are looked at when it is attached or run. Nobody looks at those of an extension: - bpf_get_local_storage() returns the storage of the attached program, the extension is verified against its own map. - bpf_override_return() needs a function that allows error injection. - skb->cb is saved, cleared and restored only for programs that access it. Ask for the storage map of the target, at load and at attach. Refuse the attach when the target does not call bpf_override_return() itself, or does not access skb->cb. A tail call counts as an access to skb->cb. Fixes: be8704ff07d2 ("bpf: Introduce dynamic program extensions") Signed-off-by: Alexei Starovoitov Acked-by: Anton Protopopov Link: https://patch.msgid.link/20261125032938.670542-6-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit b5dbfc77095682dae3e87de9894876d95adcba3b Author: Alexei Starovoitov Date: Wed Nov 25 03:28:55 2026 +0000 bpf: Do not allow bpf_d_path() by an id of another BTF [ Upstream commit 1139c7d8ffcd941d4860a75ef37eb1ffd15b4f87 ] For a program that is attached to a program attach_btf_id is an id in the BTF of the target. bpf_d_path_allowed() looks for it in a list of kernel functions, it can match by chance. Do not look at the list when there is a target program. Fixes: 6e22ab9da793 ("bpf: Add d_path helper") Signed-off-by: Alexei Starovoitov Link: https://patch.msgid.link/20261125032938.670542-5-alexei.starovoitov@gmail.com Signed-off-by: Sasha Levin commit 697d4e6150de78bd0f3a56bbc55f19296a57a3d3 Author: Kuniyuki Iwashima Date: Sat Nov 21 20:35:27 2026 +0000 tcp: Don't clear saddr before ->put_port(). [ Upstream commit 1ab3fb564f20b78615a6d88b8c90da292f29e227 ] When CGROUP_INET4_POST_BIND or CGROUP_INET6_POST_BIND prog fails, __inet_bind() / __inet6_bind() calls sk->sk_prot->put_port(). For TCP, __inet_put_port() calls inet_bhashfn_portaddr() to get the corresponding bhash2 bucket. inet_bhashfn_portaddr() requires saddr, but it is cleared before __inet_put_port(), leading to bhash2 lock mismatch. This triggers list corruption or use-after-free by a conccurent thread touching the same bhash2 bucket, e.g. tcp_diag_dump() with TCPF_BOUND_INACTIVE. [0] Let's clear saddr after calling sk->sk_prot->put_port(). [0]: BUG: KASAN: slab-use-after-free in tcp_diag_dump (net/ipv4/tcp_diag.c:415) Read of size 8 at addr ffff88810ae0e7a0 by task a/1007 CPU: 10 UID: 0 PID: 1007 Comm: a Not tainted 7.4.0-rc3-00456-gd5b89d55a322 #295 PREEMPT(lazy) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.17.0-debian-1.17.0-1 04/01/2014 Call Trace: dump_stack_lvl (lib/dump_stack.c:120) print_address_description (mm/kasan/report.c:378) print_report (mm/kasan/report.c:482) kasan_report (mm/kasan/report.c:595) sock_recvmsg (net/socket.c:1154) __sys_recvfrom (net/socket.c:2333) __x64_sys_recvfrom (net/socket.c:2348 net/socket.c:2344 net/socket.c:2344) do_syscall_64 (arch/x86/entry/syscall_64.c:61 arch/x86/entry/syscall_64.c:89) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121) RIP: 0033:0x7f2f268f8e92 Code: 08 0f 85 91 41 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 0f 1e fa 55 bf 01 00 RSP: 002b:00007f2f26874d28 EFLAGS: 00000246 ORIG_RAX: 000000000000002d RAX: ffffffffffffffda RBX: 00007f2f26879ce4 RCX: 00007f2f268f8e92 RDX: 0000000000004000 RSI: 00007f2f26874db0 RDI: 00000000000007d7 RBP: 00007f2f26874d50 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000021 R13: 00007ffcbb216e70 R14: 0000000000000000 R15: 00007ffcbb216f77 Allocated by task 1009: kasan_save_track (mm/kasan/common.c:57 mm/kasan/common.c:79) __kasan_slab_alloc (mm/kasan/common.c:354 mm/kasan/common.c:380) kmem_cache_alloc_noprof (./include/linux/kasan.h:257 mm/slub.c:4720 mm/slub.c:5033 mm/slub.c:5047) inet_bind2_bucket_create (net/ipv4/inet_hashtables.c:162) inet_csk_get_port (net/ipv4/inet_connection_sock.c:573) __inet_bind (net/ipv4/af_inet.c:544) inet_bind_sk (net/ipv4/af_inet.c:470) __sys_bind (net/socket.c:1947 net/socket.c:1978) __x64_sys_bind (net/socket.c:1983 net/socket.c:1981 net/socket.c:1981) do_syscall_64 (arch/x86/entry/syscall_64.c:61 arch/x86/entry/syscall_64.c:89) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121) Freed by task 1009: kasan_save_track (mm/kasan/common.c:57 mm/kasan/common.c:79) kasan_save_free_info (mm/kasan/generic.c:599) __kasan_slab_free (mm/kasan/common.c:267 mm/kasan/common.c:299) kmem_cache_free (./include/linux/kasan.h:239 mm/slub.c:2780 mm/slub.c:6637 mm/slub.c:6764) inet_put_port (net/ipv4/inet_hashtables.c:178) __inet_bind (net/ipv4/af_inet.c:554) inet_bind_sk (net/ipv4/af_inet.c:470) __sys_bind (net/socket.c:1947 net/socket.c:1978) __x64_sys_bind (net/socket.c:1983 net/socket.c:1981 net/socket.c:1981) do_syscall_64 (arch/x86/entry/syscall_64.c:61 arch/x86/entry/syscall_64.c:89) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:121) The buggy address belongs to the object at ffff88810ae0e780 which belongs to the cache tcp_bind2_bucket of size 80 Fixes: 28044fc1d495 ("net: Add a bhash2 table hashed by port and address") Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20261121203537.341320-1-kuniyu@google.com Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit e66fa4789b25d5a81670b6c02d3402b1cf653a50 Author: Eric Dumazet Date: Mon Nov 23 13:44:58 2026 +0100 ipv6: mcast: do not pass uninitialized bytes to dev_mc_add() [ Upstream commit 58f419bfa4c3a6797246a7c4e53a535ee34372ae ] igmp6_group_added() and igmp6_group_dropped() build a link-layer multicast address in an on-stack buffer with ndisc_mc_map(), which fills a number of bytes depending on dev->type. dev_mc_add() and dev_mc_del() then use dev->addr_len bytes of it. Since IPv6 multicast joins and leaves no longer hold RTNL, dev->type and dev->addr_len can change between the two steps, for instance with TUNSETLINK, or when bonding or team change their type. If addr_len grows (eg ARPHRD_ETHER -> ARPHRD_IP6GRE), dev_mc_add() copies uninitialized stack bytes into a netdev_hw_addr, which can later be dumped to user space by /proc/net/dev_mcast and RTM_GETMULTICAST. Zero the buffers. Found by Sashiko AI review of a tun patch, by code inspection only. Kernels built with CONFIG_INIT_STACK_ALL_ZERO=y are not affected. Fixes: 1767bb2d47b7 ("ipv6: mcast: Don't hold RTNL for IPV6_ADD_MEMBERSHIP and MCAST_JOIN_GROUP.") Link: https://lore.kernel.org/netdev/179512665919.3136.5931555157250030152@kernel.org/ Cc: Kuniyuki Iwashima Signed-off-by: Eric Dumazet Reviewed-by: Hangbin Liu Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261123124458.205233-1-edumazet@kernel.org Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit bef8a579cfb341477b2eb594033cf91f4367fe1c Author: Aristo Chen Date: Thu Nov 19 10:07:10 2026 +0000 net: dsa: felix: fix NULL pointer dereference in felix_port_enable() [ Upstream commit 469b61e4be88bc671dabe802e11f706b1ea7aa15 ] DSA registers the user ports in dsa_tree_setup_ports() before it sets conduit->dsa_ptr in dsa_tree_setup_conduit(). On teardown, it clears conduit->dsa_ptr in dsa_tree_teardown_conduit() before dsa_tree_teardown_ports() removes the user ports. RTNL is not held across either pair of steps, so user space can open a user port while conduit->dsa_ptr is NULL. In NPI mode, felix_port_enable() calls felix_cpu_port_for_conduit(). For a physical conduit, that function reads the CPU port index through conduit->dsa_ptr without checking for NULL. This caused an oops on an LS1028A RDB when systemd-networkd tried to open a user port while the switch was being probed again at runtime: [ 166.722423] Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000028 [ 166.816908] Internal error: Oops: 0000000096000004 [#1] SMP [ 166.961766] pc : felix_cpu_port_for_conduit.isra.0+0x90/0xb8 [mscc_felix_dsa_lib] [ 166.969289] lr : felix_port_enable+0x120/0x1a0 [mscc_felix_dsa_lib] The oops left RTNL locked. Later operations that waited for RTNL hung, and the board had to be power cycled. NPI mode uses one CPU port for the whole switch. Changing the conduit of a user port can move the NPI port to another CPU port, and the check in felix_port_enable() keeps user ports that still use the old CPU port down. For a physical conduit, compare dp->cpu_dp->index with the NPI port instead. DSA sets dp->cpu_dp before it registers the user port and clears it only after it removes the user port, so the check keeps working while conduit->dsa_ptr is NULL. As long as the physical conduit is set up, conduit->dsa_ptr and dp->cpu_dp point to the same CPU port, so the check gives the same result as before. LAG conduits keep using felix_cpu_port_for_conduit(), which does not read dsa_ptr for them. Fixes: eca70102cfb1 ("net: dsa: felix: add support for changing DSA master") Signed-off-by: Aristo Chen Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean Link: https://patch.msgid.link/20261119100710.129379-1-aristo.chen@canonical.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit d2ce7f0b08d3af55513312f7ad238bab81918ee8 Author: Leonard Lausen Date: Tue Nov 17 11:08:11 2026 +0000 ipv6: Honor suppress_prefixlength in fib6_lookup() [ Upstream commit 94df5595e31bf4502fe5195748ca55164ac763f0 ] When custom FIB rules are configured, fib6_lookup() performs the lookup via fib6_rule_action_alt() which calls fib6_table_lookup() and only populates the f6i, nh, fib6_flags and fib6_type fields of the FIB result. However, fib6_rule_suppress() only examines the rt6 field, which is only populated when the lookup is performed via one of the callers of fib6_rule_lookup() such as ip6_route_output(). As a result, fib6_lookup() ignores suppress_prefixlength. This was not a problem for nftables until commit 1c32b24c234b ("netfilter: nft_fib_ipv6: switch to fib6_lookup") switched the FIB expression from ip6_route_lookup() / nf_ip6_route() to fib6_lookup(). Since then, with a rule that suppresses the default route in the main table before looking up a VPN table (as commonly configured for WireGuard), the FIB expression returns the suppressed default route instead of the VPN route. Strict reverse path filtering then drops replies received over the VPN. Fix by evaluating suppress_prefixlength against the prefix length of the FIB entry when the lookup is performed via fib6_lookup(). fib_rules_lookup() only invokes the suppress callback when the rule action returns 0. Unlike __fib6_rule_action(), fib6_rule_action_alt() returns 0 for reject routes and instead sets RTF_REJECT in the result. Do not suppress such routes so that they continue to terminate the lookup, as with ip6_route_output() and IPv4. Check the flags in the result rather than in the FIB entry so that blackhole nexthop objects are also covered. suppress_ifgroup is not handled since fib6_table_lookup() does not perform multipath selection and the nexthop it returns might not be the one that is eventually used. Observed during WireGuard use and reproduced on unmodified v7.4-rc2, without instrumentation or error injection. Verified with namespace probes and nft_fib.sh on the rebuilt v7.4-rc2-based kernel. Fixes: 1c32b24c234b ("netfilter: nft_fib_ipv6: switch to fib6_lookup") Link: https://github.com/firewalld/firewalld/issues/1600 Signed-off-by: Leonard Lausen Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261117110813.9894-3-leonard@lausen.nl Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit bbe01743fa7f4e231638acb14b17da9935b86771 Author: Jan Schär Date: Fri Nov 20 14:02:08 2026 +0100 gpiolib: fix inverted trace values in gpiod_get_array_value() [ Upstream commit 601acadb79b62ee52edbd29ec69d8f677dc32dcd ] Almost all trace_gpio_value() calls report the raw value. gpiod_get_array_value_complex() is the only exception; it reports the logical value in traces unless the caller requests raw values. This inconsistency makes GPIO traces confusing. Move the trace call earlier, where the value is still raw. Now, all GPIO traces consistently report raw values. Fixes: eec1d566cdf9 ("gpio: Introduce ->get_multiple callback") Signed-off-by: Jan Schär Link: https://patch.msgid.link/20261120130208.89621-1-jan@jschaer.ch Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 2654124951e8acf54f131e4da5a0939f80ea3075 Author: Alexei Starovoitov Date: Tue Nov 24 20:54:56 2026 +0100 bpf: Save irq flags on the stack when freeing a list head or rb root [ Upstream commit 81c6c8c608b6075846d3bd5b6f57958300a56eda ] bpf_spin_lock() saves the irq flags in the per-cpu variable irqsave_flags, and bpf_spin_unlock() restores them from there. One word per cpu is enough as long as a cpu takes no second bpf_spin_lock before it releases the first. bpf_list_head_free() and bpf_rb_root_free() take a second one. They lock the list or the tree that they free with __bpf_spin_lock_irqsave(), and they can run while a program holds a bpf_spin_lock of its own. bpf_list_add(), bpf_list_push_front(), bpf_list_push_back() and bpf_rbtree_add() drop the node when they fail. The drop frees a node that has no other reference, with its fields, and the node can have a list or a tree itself, like struct foo of the selftests' linked_list.h: bpf_spin_lock(&glock) irqsave_flags = on bpf_list_add(&ghead, foo, prev) prev is not in the list bpf_list_head_free(&foo->head) __bpf_spin_lock_irqsave() irqsave_flags = off bpf_spin_unlock(&glock) restores off The program returns with irqs off. Keep the flags of the two functions in a local variable, and take the lock with __bpf_spin_lock(). Both functions unlock before they drop the nodes, so nothing else runs between the save and the restore. A failed add drops the node since the commit below. Until bpf_list_add() existed, an add failed only for a node that a list or a tree still owned, with a reference of its own, so the drop freed the node only in a race with the release of that reference. bpf_list_add() fails for any node when @prev is not in the list. Fixes: d2dcc67df910 ("bpf: Migrate bpf_rbtree_add and bpf_list_push_{front,back} to possibly fail") Signed-off-by: Alexei Starovoitov Signed-off-by: Kumar Kartikeya Dwivedi Link: https://patch.msgid.link/178849392dfb8ddf82d7ba4259be6113349bdc2e.1795550092.git.memxor@gmail.com Signed-off-by: Sasha Levin commit b6aafd8fde5eefe5da2b46cb8411301c9ae8cb18 Author: Alexei Starovoitov Date: Tue Nov 24 20:54:12 2026 +0100 bpf: net_sched: Defer bpf_kfree_skb() to irq_work with irqs off [ Upstream commit 73f17a98ea707b505b75c45f1ad7535f8d060195 ] bpf_kfree_skb() is also the destructor of an skb kptr. A destructor runs wherever an object or a map value with such a field is freed. That can be with irqs off, for example: - bpf_list_add() drops the new node when @prev is not in the list, while the program holds the bpf_spin_lock of the list, which keeps irqs off. The drop frees a node that has no other reference, with its fields. - bpf_local_storage_map_free() frees the fields of each value under the lock of its bucket, which bpf_selem_unlink_nofail() takes with raw_res_spin_lock_irqsave(). A qdisc program can keep an skb in task storage. The rq lock can be held as well. A program that shares a list with the qdisc program gets there: prog drops the node with ---------------------- ---------------------------------------- sched_ext ops.dispatch bpf_obj_drop() tp_btf/sched_switch bpf_list_add(), @prev is not in the list The check from commit 94c8d1c21be4 ("bpf: Reject bpf_obj_drop() from tracing progs") catches neither. Currently bpf_kfree_skb() calls kfree_skb(), which is not made for that. The destructor of the skb may enable softirqs, take a lock that sleeps on PREEMPT_RT, or wake a task. sock_wfree() wakes the task that waits for the socket to become writable, and under the rq lock that deadlocks: __schedule() holds rq lock, irqs are off bpf_kfree_skb_dtor(skb) kfree_skb(skb) sock_wfree(skb) a task polls the socket for write __wake_up_common_lock() try_to_wake_up() the task belongs on this cpu rq_lock(rq) <- same rq dev_kfree_skb_any() does not solve it. With irqs off it leaves the skb to NET_TX_SOFTIRQ, and raising a softirq outside of an interrupt wakes ksoftirqd: __schedule() holds rq lock, irqs are off bpf_kfree_skb_dtor(skb) dev_kfree_skb_irq_reason(skb) raise_softirq_irqoff() in_interrupt() == 0 wake_up_process(ksoftirqd) ttwu_queue() cpu == this_cpu rq_lock(rq) <- same rq With irqs on it is kfree_skb(), which on PREEMPT_RT must not run with preemption off either, as after bpf_preempt_disable(): bpf_kfree_skb(skb) preempt_count() == 1 sock_wfree(skb) a writer sleeps in sk_wq __wake_up_common_lock() spin_lock_irqsave(&wq_head->lock) Free the skb from an irq_work in these contexts, like bpf_async_refcount_put() does: with irqs off, and on PREEMPT_RT whenever the caller is not preemptible. The skb waits on a lock-less list, linked through skb->ll_node. A shared skb only loses the reference of the caller: as in dev_kfree_skb_irq_reason(), the last reference is the one that may link the skb. The irq_work frees the list with dev_kfree_skb_any(). Without PREEMPT_RT it runs in hard irq context, where dev_kfree_skb_any() leaves the skb to NET_TX_SOFTIRQ and wakes nobody. With PREEMPT_RT it runs in the irq_work thread, where dev_kfree_skb_any() is kfree_skb() and may sleep. Everywhere else bpf_kfree_skb() remains kfree_skb(). Qdisc_ops::enqueue and Qdisc_ops::dequeue run with irqs on, so a qdisc pays for the test of the irq flag and no more. NET_SCH_BPF cannot be a module, so no exit path has to wait for the irq_work. Fixes: 870c28588afa ("bpf: net_sched: Add basic bpf qdisc kfuncs") Signed-off-by: Alexei Starovoitov Signed-off-by: Kumar Kartikeya Dwivedi Link: https://patch.msgid.link/7a28c63f6b3d61442dbee1950f9a76d278a0f5be.1795550039.git.memxor@gmail.com Signed-off-by: Sasha Levin commit 78f7ea24bc0ecc0c94508e74237b68f68ce7af64 Author: Antonio Quartulli Date: Thu Nov 19 16:30:55 2026 +0100 tun: bound the NAPI receive queue [ Upstream commit cc7fe6e741730fef549e484379281736d32746f0 ] With IFF_NAPI, tun_get_user() queues every written packet for NAPI on an unbounded list. When the poll runs asynchronously (threaded NAPI or ksoftirqd) and is slower than the writer, the queue grows until the system runs out of memory. An unprivileged user can do this from its own user and network namespaces, and the queued skbs are not charged to its memcg: in a test VM, a uid 1000 process limited to 128 MB caused a global OOM in ~6 seconds. The socket send buffer does not help: tun sets it to INT_MAX by default, the build_skb() path is only used while it is INT_MAX, and the XDP batch path never checks it. Drop packets once more than netdev_max_backlog of them are queued, like enqueue_to_backlog() does, and count them as rx_dropped; the write still reports success, as for a full backlog. The check sits where packets are queued for NAPI, in tun_get_user() and in tun_xdp_one() for the batches vhost-net passes, so packets consumed by XDP or delivered through IFF_NAPI_FRAGS are not affected. A dropped zerocopy skb completes its buffer when freed. The check is lockless, so concurrent writers can each still add one packet. The NAPI poll moved the whole queue out, processed up to its budget and put the rest back: while it ran, the queue looked empty to writers, so with the poll on another CPU the backlog could still grow without limit. Take at most budget packets instead: the rest stays on the queue writers check. Dropping also schedules NAPI. vhost-net sends with MSG_MORE while it has more packets, and tun_get_user() schedules NAPI only for a packet without it or once more than NAPI_POLL_WEIGHT are queued. With a netdev_max_backlog below that, the queue fills first and the packet without MSG_MORE is dropped too: nothing would schedule NAPI, and the queued packets, with zerocopy also their buffers, would wait forever. Reproducer, as an unprivileged user in a new user and network namespace, without kernel modifications or fault injection: ip tuntap add t0 mode tun; ip addr add 10.11.0.1/24 dev t0 ip link add d0 type dummy; ip addr add 10.20.0.1/24 dev d0 ip link set t0 up; ip link set d0 up; sysctl net.ipv4.ip_forward=1 install ~500 iptables FORWARD rules, to slow down the poll, and a MASQUERADE rule on d0 open t0 with IFF_TUN | IFF_NO_PI | IFF_NAPI echo 1 > /sys/class/net/t0/threaded write() 1400-byte IPv4 packets for 10.20.0.2 in a loop Found by code inspection while analysing the performance of the tun write path. Tested in an x86-64 VM on net, with 1 and 2 vCPUs: the reproducer causes a global OOM without the patch, while with it memory use stays flat and the forwarding rate is unchanged; the tun kselftest passes; a local vhost-net test of the batch, copy and zerocopy paths with netdev_max_backlog set to 8 passes, and fails without the patch; an XDP program on the device sees every packet while the excess is dropped. Still open: neither the packet size nor the queued memory is bounded, and the skbs are not charged to the writer's memcg. A single write can create an skb of several hundred KB, so even one queue can hold a lot, and IFF_MULTI_QUEUE (allowed in a user namespace) and more devices multiply it. This bounds the queue as enqueue_to_backlog() bounds the per-CPU backlog; charging the skbs to the writer is left to a follow-up. Fixes: 943170998b20 ("tun: enable NAPI for TUN/TAP driver") Signed-off-by: Antonio Quartulli Reviewed-by: Willem de Bruijn Link: https://patch.msgid.link/20261119153056.353156-1-antonio@mandelbit.com Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 6c139193914cf16e68d54a2d75a451a266f5c84b Author: Jiayuan Chen Date: Fri Nov 20 17:46:59 2026 +0800 ipv4: fix conntrack defrag forwarding after ip_frag_reinit() [ Upstream commit 3ab5aae0eb60079d17378af5aab0db84ba946e0e ] q.max_size and max_df_size are used by ip_frag_reasm() to set IPCB(skb)->frag_max_size and the DF bit of the reassembled packet. ip_frag_reinit() reuses the queue for a new datagram but does not reset them, so the new datagram inherits them from the old one. On a router with conntrack defrag, if the largest fragment of the old datagram had DF set and was larger than the egress MTU, a new datagram without DF gets DF set after reassembly and is rejected with ICMP_FRAG_NEEDED, even though all its fragments fit. Reset both fields. Fixes: 5f2d04f1f9b5 ("ipv4: fix path MTU discovery with connection tracking") Fixes: d6b915e29f4a ("ip_fragment: don't forward defragmented DF packet") Reviewed-by: Eric Dumazet Signed-off-by: Jiayuan Chen Link: https://patch.msgid.link/20261120094700.46500-1-jiayuan.chen@linux.dev Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 36377a674900c97758d34ca0485243e9fc56dea2 Author: Nicolai Buchwitz Date: Fri Nov 20 23:42:39 2026 +0100 net: systemport: accumulate the DIM packet and byte counters [ Upstream commit 3e7e20beef4ec04f7601e92e78608333f2ab3904 ] net_dim() computes rates from the difference between two samples and needs running totals, but bcm_sysport_desc_rx() passes the counts of the last poll. Adaptive coalescing then picks profiles from wrong rates. Accumulate the counters instead. Fixes: b6e0e875421e ("net: systemport: Implement adaptive interrupt coalescing") Reviewed-by: Florian Fainelli Signed-off-by: Nicolai Buchwitz Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 64eeb829b6c4778eb49f7f3ff8522ab4348384e5 Author: Nicolai Buchwitz Date: Fri Nov 20 23:42:38 2026 +0100 net: systemport: restart DIM from the default profile on start [ Upstream commit 8e428e263fa4fd3a752db8d9e1e584307f446aae ] A close or suspend can cancel the pending profile work and leave DIM in DIM_APPLY_NEW_PROFILE, where net_dim() does nothing. Adaptive coalescing then stays stuck after the next open or resume. The poll also calls net_dim() after napi_complete_done(), so it can queue new work after napi_disable() has returned. Run net_dim() before completing NAPI. Reset the DIM state on start and begin from the default profile, which is what bcm_sysport_init_rx_coalesce() programs. Fixes: b6e0e875421e ("net: systemport: Implement adaptive interrupt coalescing") Signed-off-by: Nicolai Buchwitz Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 8798ad6618386662dffccab77d130524528c3822 Author: Nicolai Buchwitz Date: Fri Nov 20 23:42:37 2026 +0100 net: bcmgenet: reset the Rx discard count with the ring [ Upstream commit e99faa3a16209ea5d0b83cc58b64785efd2d9045 ] Ring init clears the hardware discard counter but not ring->old_discards. Discards after an ifdown and ifup or a resume are then missing from rx_missed. On a CM4, after an ifdown and ifup, 3666 discards showed up as 0 in rx_missed. Reset old_discards together with the ring. Fixes: d26ea6cc48da ("net: bcmgenet: collect Rx discarded packet count") Reviewed-by: Florian Fainelli Signed-off-by: Nicolai Buchwitz Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit c2687f51cfb3b5a4bff1d691fdc879f41ec8ec93 Author: Nicolai Buchwitz Date: Fri Nov 20 23:42:36 2026 +0100 net: bcmgenet: accumulate the DIM packet and byte counters [ Upstream commit a15079369636f4324d2985cede7ce7fbefddf4b3 ] net_dim() computes rates from the difference between two samples and needs running totals, but bcmgenet_desc_rx() passes the counts of the last poll. Adaptive coalescing then picks profiles from wrong rates. On a CM4 at a steady 300 Mbit/s UDP, DIM changed profile about 1000 times in 20 s. With the fix it settles, and Rx interrupts drop from about 4500/s to 2240/s. Accumulate the counters instead. Fixes: 9f4ca05827a2 ("net: bcmgenet: Add support for adaptive RX coalescing") Reviewed-by: Florian Fainelli Signed-off-by: Nicolai Buchwitz Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 433bb0f993597d080124c011a5dd0cc595fbc092 Author: Nicolai Buchwitz Date: Fri Nov 20 23:42:35 2026 +0100 net: bcmgenet: keep DIM from getting stuck after close or suspend [ Upstream commit aa5a537ec43c13e4d2850468b0d88f97cce45dd3 ] A close or WoL suspend cancels the pending profile work and can leave DIM in DIM_APPLY_NEW_PROFILE, where net_dim() does nothing. Adaptive coalescing then stays stuck after the next open or resume, and the profile index no longer matches the hardware. The poll also calls net_dim() after napi_complete_done(), so it can queue new work after napi_disable() has returned. Run net_dim() before completing NAPI and flush the work instead of cancelling it, so the pending profile gets applied. Also reset the DIM state on ring init and start from the default profile, which is what bcmgenet_init_rx_coalesce() programs. Fixes: 9f4ca05827a2 ("net: bcmgenet: Add support for adaptive RX coalescing") Signed-off-by: Nicolai Buchwitz Reviewed-by: Florian Fainelli Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 082d5aa74c5a82e4c75f3fc8fd12c8d1364a94dd Author: Wang Haoran Date: Thu Nov 19 16:15:02 2026 +0800 net: bcmasp: avoid refcount drain on probe [ Upstream commit 846a6d0982be30aaba5268aac14a0c557d70cc23 ] bcmasp_probe() calls of_find_node_by_name(dev->of_node, "ethernet-ports"), which unconditionally drops the from-node reference the caller never held. Every probe or bind cycle that reaches the port scan, including ones that later fail with "No ports found", drains the asp node refcount by one. Once it hits zero, of_node_release() deadlocks in its error printk (%pOF on the parent while holding devtree_lock with IRQs off), so the machine freezes silently with nothing on the console. Use of_get_child_by_name() which leaves the parent reference alone. Fixes: 490cb412007d ("net: bcmasp: Add support for ASP2.0 Ethernet controller") Signed-off-by: Wang Haoran Link: https://patch.msgid.link/1795076102979-9-385853cc@mail.zgclab.edu.cn Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit d289b6765b12666979337d42dd446254116849c6 Author: Florian Fainelli Date: Thu Nov 19 11:03:48 2026 -0800 net: dsa: b53: fix mirror destination and source state tracking [ Upstream commit 320bc9b8e2bc8a5fc75537082529b534ace633e3 ] The mirror capture control register selects one destination for all ingress and egress sources. Adding a rule for another destination currently redirects existing rules. Multiple matchall filters can also share one source bit, but deleting any one of them clears that bit and can disable mirroring while other filters still need it. Reject a different destination while either source mask is occupied, and reference count each port's ingress and egress source bit under RTNL. Program a source on its first reference and clear it on its last one. Check every mirror register access and record a first reference only after programming succeeds. Select the destination before enabling the source, and log deletion failures because the callback returns no error. Use the source masks to retain the destination after a failed source deletion and allow a new destination after a failed capture-control clear. Not all supported switches receive a hardware reset during setup, so clear stale capture and source registers before accepting mirror rules. Introduce b53_mirror_init() together with its b53 and bcm_sf2 setup callers. Rebuild active sources and their destination from the reference counts when setup runs again, preserving rules across bcm_sf2 resume. Propagate initialization failures instead of accepting stale state. This depends on "net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365" for the chip-specific source and capture-port helpers. Fixes: ed3af5fd08eb ("net: dsa: b53: Add support for port mirroring") Signed-off-by: Florian Fainelli Tested-by: Joseph Telaak Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit babc6b5d37a55cb7c07341369d0b43fa4ed4559c Author: Florian Fainelli Date: Thu Nov 19 11:03:47 2026 -0800 net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365 [ Upstream commit 000d468855945953c491810f97fb0bd4166b0b07 ] BCM5325 and BCM5365 use an 11-bit bitmap for the mirror capture port, whereas newer switches use a four-bit port ID. Programming the port number directly can select no destination or the wrong destination, and can select multiple destinations. For example, port 2 requires BIT(2), but writing 2 selects port 1 instead. Use the bitmap encoding on BCM5325 and BCM5365, including translating logical CPU port 5 to hardware bit 8. Apply the corresponding field mask when checking for a conflicting destination, replacing the destination, and clearing it after the last mirror source is removed. Keep the port ID encoding for newer switches. The ingress and egress mirror source masks use the same layout on these switches, with the CPU port at bit 8 and bits 5-7 reserved, so apply the same translation when setting and clearing a source port bit. Fixes: ed3af5fd08eb ("net: dsa: b53: Add support for port mirroring") Signed-off-by: Florian Fainelli Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 172d233c45367bbc52ecddb292686e012ce37088 Author: Florian Fainelli Date: Thu Nov 19 11:03:46 2026 -0800 net: dsa: b53: use the correct override register 2 Gbps bit [ Upstream commit fd2752aac6c2193507af2e96cfc1406b28cade6f ] The IMP and per-port GMII override registers swap the override-enable and 2 Gbps speed bits. Using the IMP speed bit on a GMII port clears its override enable and leaves any previous 2 Gbps selection intact. Select the speed bit alongside the register and enable bit so lower speeds clear the correct bit and 2 Gbps sets it. Fixes: b6a8a5477fe9 ("net: dsa: b53: fix resetting speed and pause on forced link") Fixes: 41af38324341 ("net: dsa: b53: restore the NSP IMP port 2 Gbps mode") Reviewed-by: Jonas Gorski Signed-off-by: Florian Fainelli Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 5e02d49c3fbd5f40196bfeabe0e821fa7afc0765 Author: Florian Fainelli Date: Thu Nov 19 11:03:45 2026 -0800 net: dsa: b53: clear stale state when creating an ARL entry [ Upstream commit c6f0992ff6c2c138ffb1b64f406a66d42615770b ] When an ARL lookup does not find the requested MAC and VID, b53_arl_read() returns the first free bin index but leaves the entry populated with the last bin examined. The multicast add path then ORs the requested port into that unrelated entry's forwarding bitmap, potentially forwarding packets to ports which are not members of the multicast group. Clear the entry before creating a new one. Also return without writing anything when deleting an entry which is not present, instead of writing back stale bin contents. The return value for that case is unchanged (0). Fixes: 5d65b64a3d97 ("net: dsa: b53: Add support for MDB") Signed-off-by: Florian Fainelli Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit b3f66d9991b08b1bcab501859508f0eeef873c17 Author: Florian Fainelli Date: Thu Nov 19 11:03:44 2026 -0800 net: dsa: b53: fix the SRAB grant timeout check [ Upstream commit bd7fc60896b3de8ce677142142c96277377e5167 ] b53_srab_request_grant() polls for a grant up to 20 times, but checks for an iteration count of five to detect a timeout. This rejects a grant received on the sixth poll and reports success when all 20 polls finish without a grant. The latter allows a register access to proceed without ownership of the switch resources. Check for exhaustion of all 20 iterations instead. Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch") Reviewed-by: Jonas Gorski Reviewed-by: Daniel Machon Signed-off-by: Florian Fainelli Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 6eb7aeea90fb6cab45a080ddceda83e88c1837cb Author: Florian Fainelli Date: Thu Nov 19 11:03:43 2026 -0800 net: dsa: b53: initialize the jumbo frame size register offset [ Upstream commit 5d30a02245c375a9c5e557b1b7476710c4a94a2d ] The chip data specifies both the jumbo port mask and frame size register offsets, but b53_switch_init() only copies the former into the device. Since the device is zero-initialized, b53_set_jumbo() writes the frame size to offset zero instead of the chip-specific size register at 0x05 or 0x08. Copy jumbo_size_reg from the chip data along with jumbo_pm_reg so frame size updates reach the intended register. Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch") Reviewed-by: Jonas Gorski Signed-off-by: Florian Fainelli Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 5bfd0b0a82db98b890aa9d4e62fb1ecdf965d7d2 Author: Jakub Kicinski Date: Thu Nov 19 19:46:45 2026 -0800 eth: bnxt_en: restore Tx coalescing after re-allocating the completion ring [ Upstream commit 32756b82fde8f6cc98b174fdcd02c2a61033e263 ] With TPH enabled, queue restart also frees and re-allocates the Tx completion rings which share the NAPI instance with the Rx queue. Same as on the Rx side, the new FW rings start with default interrupt coalescing parameters, and the configured settings are applied again only at the next open or ethtool change. On P5+ chips the Tx completion rings are separate from the Rx ones even in combined channels, and the Tx settings do take effect. On a BCM57508 the completion latency of sparse Tx traffic follows tx-usecs, it's ~20us with tx-usecs 1 and ~220us with tx-usecs 200. Re-program Tx coalescing of each completion ring after allocating it. DIM only manages Rx, the static settings always apply to Tx. Fixes: fe96d717d38e ("bnxt_en: Extend queue stop/start for TX rings") Signed-off-by: Jakub Kicinski Reviewed-by: Pavan Chebbi Link: https://patch.msgid.link/20261120034645.364630-2-kuba@kernel.org Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit 6fa25f4d774b0d8c6e213078820db5137d5fa7ea Author: Jakub Kicinski Date: Thu Nov 19 19:46:44 2026 -0800 eth: bnxt_en: restore Rx coalescing after re-allocating the completion ring [ Upstream commit a6ea69915a230d24e9d9cd8dc0ff0551dab36106 ] With TPH enabled, queue restart frees and re-allocates the Rx completion ring in the FW, to apply the new Steering Tag. The new FW ring starts with default interrupt coalescing parameters. The driver programs coalescing only at open, from ethtool and from DIM, so after a restart the ring ignores the configured settings, while ethtool keeps reporting them. Re-program Rx coalescing of the ring after allocating it. Use DIM's current profile if adaptive coalescing is enabled, the static settings otherwise. The per-ring DIM values may be stale when DIM is off, ethtool changes to static coalescing don't update them. With rx-usecs 1000, re-allocating the ring on a BCM57508 lowers the latency of a 1 byte ping-pong on that queue by ~250us. Latency goes back up once ethtool re-programs coalescing. Fixes: 6b6bf60fc95f ("bnxt_en: Reallocate RX completion ring for TPH support") Signed-off-by: Jakub Kicinski Reviewed-by: Pavan Chebbi Link: https://patch.msgid.link/20261120034645.364630-1-kuba@kernel.org Signed-off-by: Willem de Bruijn Signed-off-by: Sasha Levin commit a4d3ff7239b14419fa00cb05e48a14bbe69d294b Author: Saurabh Sengar Date: Tue Nov 24 10:00:10 2026 -0800 workqueue: Skip redundant unbound updates during CPU bringup [ Upstream commit edf1066ba69c89c42c3007e4230c7b9cb13405a8 ] Before workqueue_init_topology(), all CPUs share the SYSTEM pod, which contains every possible CPU. The effective cpumask and the per-pod cpumask of an unbound workqueue are therefore identical, regardless of which CPUs are online. During this stage, workqueue_online_cpu() walks every possible CPU for every unbound workqueue each time a secondary CPU comes online. The pwq mappings cannot change yet, so this repeats redundant work that scales quadratically with CPU count. On a 640-vCPU Hyper-V VM, each of the 639 secondary CPU-online callbacks walks all 640 possible CPUs for each of the 8 unbound workqueues, giving 3,271,680 unbound_wq_update_pwq() calls that took about 975 ms in total. Skip these updates until workqueue_init_topology(). The pwq mappings already match the effective cpumask, and wq_update_node_max_active() does nothing before topology initialization. workqueue_init_topology() will apply the topology-specific mappings and node limits once ready. Keep worker rebinding and restoration of unbound worker affinity before the guard. CPU hotplug after topology initialization is unchanged. On the same VM running a v7.3 kernel, smp_init() took 1054 ms with this change, compared to 2008 ms without it, a 47.5% reduction. Before After Reduction smp_init() 2008 ms 1054 ms 47.5% Fixes: 84193c07105c ("workqueue: Generalize unbound CPU pods") Signed-off-by: Saurabh Sengar Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin commit 7cda309e96d3e359a7020fb2eebf686c4a302dff Author: Keisuke Tsukuda Date: Tue Nov 24 15:53:39 2026 +0000 KEYS: trusted: caam: propagate protected key option parsing errors [ Upstream commit 1bbbf65c75064aeaff793b7bc218f12c53cbe1a9 ] get_pkey_options() returns -EINVAL for invalid protected key options, such as "key_enc_algo=GG". trusted_caam_seal() and trusted_caam_unseal() ignore this error and return 0. The trusted key core then instantiates a key without a blob for "new", or with a zero-length key for "load". On an i.MX6Q running a 7.4.0-rc2-based kernel, adding a key with "new 32 pk key_enc_algo=GG" succeeds, but KEYCTL_READ returns zero bytes because no blob was created. The key cannot be saved and reloaded. Return the parsing error from both paths. On the patched kernel, "new" and "load" with "key_enc_algo=GG" both fail with -EINVAL, while valid requests succeed. Fixes: a703a4c2a328 ("KEYS: trusted: caam based protected key") Signed-off-by: Keisuke Tsukuda Reviewed-by: Serge Hallyn Link: https://lore.kernel.org/r/20261124155310.32044-1-tkdkei@outlook.jp Signed-off-by: Jarkko Sakkinen Signed-off-by: Sasha Levin commit beb60e4e7db2f64d13c52f342b00d078e4241b6a Author: Marco Giunta Date: Mon Nov 23 18:56:10 2026 +0100 ASoC: aw88166: fix backup restoring the RE value instead of saving it [ Upstream commit b0d43948d45bef795e4769b88179ba598382bc4f ] aw_dev_backup_sec_record() saves the VCALB and RE values so that aw_dev_backup_sec_recovery() can restore them later. However, it passes AW88166_RECOVERY_SEC_DATA for RE, so instead of reading ACR1/ACR2 it writes the stored value back to them. Pass AW88166_RECORD_SEC_DATA instead, as the vendor aw883xx driver does. Fixes: 94e412c28e61 ("ASoC: codecs: Add aw88166 amplifier driver") Signed-off-by: Marco Giunta Link: https://patch.msgid.link/SN6PR19MB230389321D29F0C88582B4F6FC452@SN6PR19MB2303.namprd19.prod.outlook.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 982f91e2d0edc6b92444ae1cffd41bab3c1f217b Author: Andrea Parri Date: Mon Oct 26 19:25:52 2026 +0100 ftrace: Fix lost recursion records in ftrace_record_recursion() [ Upstream commit 7792e21d0a6e2fa819209949e8ba957504bedcd4 ] cached_function is set to the current ip before the cmpxchg() that claims a slot in recursed_functions[]. When that cmpxchg() loses a race for the same slot, the code bumps index and retries via "goto again", but the retry immediately matches its own cached_function write and returns without ever reaching the bumped-index cmpxchg(). Concretely, for two writers racing on the same index: CPU 0 (ip = A) CPU 1 (ip = B) -------------- -------------- cmpxchg(&recursed_functions[index].ip, 0, B); // succeeds cached_function = A; cmpxchg(&recursed_functions[index].ip, 0, A); // fails, old == B index++; goto again; if (A == cached_function) // true: matches A's own store return; // A is dropped, not retried Once dropped this way, cached_function stays set to A, so every later recursion of A also hits the fast path and returns before reaching the retry, until some unrelated ip overwrites the cache. Set cached_function only after the cmpxchg() has claimed the slot. The retry path then leaves the cache untouched and no longer matches its own store. When the cmpxchg() finds ip already present, the writer that installed it sets the cache. The bug was found with the help of an LLM. Link: https://patch.msgid.link/20261026182553.221141-1-parri.andrea@gmail.com Fixes: 773c16705058e ("ftrace: Add recording of functions that caused recursion") Signed-off-by: Andrea Parri Signed-off-by: Steven Rostedt Signed-off-by: Sasha Levin commit 8e8c574b25388a53b1cbc907e13f582f7bbe28eb Author: Michał Grzelak Date: Tue Nov 24 01:43:12 2026 +0100 drm/ttm/tests: do not count pages after pool's teardown [ Upstream commit cb9809483c7f08c8333833ecac11188e41bcc3c9 ] Currently ttm_pool_fini_basic() checks if page count of pool-type's lru list is zero after tearing down its pre-populated pool. After commit 5ffdc8f83613 ("ttm/pool: Don't leak LRU list on shutdown") this check causes NULL dereference because page's lru list is destroyed during pool's teardown which leads to KUnit's crash: [20:08:24] ========== [PASSED] ttm_pool_alloc_basic_dma_addr ========== [20:08:24] [PASSED] ttm_pool_alloc_order_caching_match [20:08:24] [PASSED] ttm_pool_alloc_caching_mismatch [20:08:24] [PASSED] ttm_pool_alloc_order_mismatch [20:08:24] [PASSED] ttm_pool_free_dma_alloc [20:08:24] [PASSED] ttm_pool_free_no_dma_alloc [20:08:25] [ERROR] Test: ttm_pool: missing expected subtest! [20:08:25] [20:08:25] Pid: 80, comm: kunit_try_catch Tainted: G W N 7.4.0-rc4-g401a3e7b64d1 [20:08:25] RIP: 0033:list_lru_count_node+0xe/0x20 [20:08:25] RSP: 00000000a08dbef8 EFLAGS: 00010246 [20:08:25] RAX: 0000000000000001 RBX: 00000000a0803c70 RCX: 0000000000000020 [20:08:25] RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000060853030 [20:08:25] RBP: 0000000060853000 R08: 00000000a08dbe98 R09: 00000000601246ac [20:08:25] R10: 000000009f227d00 R11: 0000000000000000 R12: 0000000060124640 [20:08:25] R13: 0000000060853030 R14: 000000006047c950 R15: 00000000604c6488 [20:08:25] Kernel panic - not syncing: Segfault with no mm [20:08:25] [CRASHED] [20:08:25] [ERROR] Test: ttm_pool: missing subtest result line! [20:08:25] # module: ttm_pool_test [20:08:25] ==================== [CRASHED] ttm_pool ==================== [20:08:25] [ERROR] Test: main: missing expected subtest! [20:08:25] [CRASHED] [20:08:25] [ERROR] Test: main: missing expected subtest! [20:08:25] [CRASHED] [20:08:25] [ERROR] Test: main: missing expected subtest! [20:08:25] [CRASHED] [20:08:25] [ERROR] Test: main: missing expected subtest! [20:08:25] [CRASHED] [20:08:25] ============================================================ [20:08:25] Testing complete. Ran 28 tests: passed: 23, crashed: 5, errors: 6 The crash in turn prevents Xe CI from running IGT. Drop the post-teardown assertion. Fixes: 5ffdc8f83613 ("ttm/pool: Don't leak LRU list on shutdown") Cc: Ian Forbes Cc: Christian König Signed-off-by: Michał Grzelak Reviewed-by: Dave Airlie Link: https://patch.msgid.link/20261124004312.3880264-2-michal.grzelak@linux.intel.com Signed-off-by: Rodrigo Vivi Signed-off-by: Sasha Levin commit 441a2f312d98b7616bd96be5ff35ade74185de68 Author: Marek Vasut Date: Mon Nov 2 06:22:37 2026 +0100 ARM: dts: stm32: Fix STM32MP15xx DHCOM SoM PicoITX overlay application [ Upstream commit add40017961d3f07b36bad48840aaecf57128150 ] Generate the combined STM32MP15xx DHCOM SoM PicoITX and overlay from PicoITX instead of PDK2. Fix the Makefile to use the correct base DT. Fixes: 77a5fde00b9a ("ARM: dts: stm32: Add DT overlays for DH STM32MP13xx/STM32MP15xx DHSOM") Signed-off-by: Marek Vasut Link: https://lore.kernel.org/r/20261102052306.868349-1-marex@nabladev.com Signed-off-by: Alexandre Torgue Signed-off-by: Sasha Levin commit 3aae34fccc3806873c3c2b60bf602bde26717553 Author: Patrick Delaunay Date: Fri Oct 30 10:29:08 2026 +0100 arm64: dts: st: mark STM32MP23 timer as stopping in suspend [ Upstream commit 9eb9bea92c7ea2a8886eeab01cdfe4365bee0328 ] The generic ARM timer, based on STGEN, stops ticking in low-power states such as Stop1. Replace the always-on property with arm,no-tick-in-suspend in the STM32MP23 timer node, matching the STM32MP25 configuration. Fixes: e9b03ef21386 ("arm64: dts: st: introduce stm32mp23 SoCs family") Signed-off-by: Patrick Delaunay Reviewed-by: Amelie Delaunay Link: https://lore.kernel.org/r/20261030102907.1.I0ef2a7ac525ef18fa683368382d93e98cc36ee25@changeid Signed-off-by: Alexandre Torgue Signed-off-by: Sasha Levin commit d343ef2333189f7a35d7434246f810cfe3bd4cbe Author: Patrick Delaunay Date: Thu Nov 19 18:42:11 2026 +0100 arm64: dts: st: add PSCI idle state to STM32MP23 CPU domains [ Upstream commit 0818ec0de18627ff7d2306e5c2843a0358960874 ] Define a PSCI CPU suspend state and reference it from both STM32MP23 CPU power domains. In OSI mode, PSCI power domains are initialized as off. The idle-state allows the CPU power-domain governor to manage them, avoiding probe stalls for devices that depend on the cluster power domain, including SDMMC1. Fixes: e9b03ef21386 ("arm64: dts: st: introduce stm32mp23 SoCs family") Signed-off-by: Patrick Delaunay Reviewed-by: Amelie Delaunay Link: https://lore.kernel.org/all/20261030102907.1.I0ef2a7ac525ef18fa683368382d93e98cc36ee25@changeid/ Link: https://lore.kernel.org/r/20261119184209.v2.1.If2b6b99285c1e60ca11b6e7fccf7d9b130ca20dd@changeid Signed-off-by: Alexandre Torgue Signed-off-by: Sasha Levin commit af418963b6a0116510410bf4ae8e3b2cd20bdecd Author: Patrick Delaunay Date: Thu Nov 19 18:55:45 2026 +0100 arm64: dts: st: add PSCI idle state to STM32MP25 CPU domains [ Upstream commit ab4ce1d0630f677032d7e20d27c80ecfbd9960cb ] Define a PSCI CPU suspend state and reference it from both STM32MP25 CPU power domains. In OSI mode, PSCI power domains are initialized as off. The idle-state allows the CPU power-domain governor to manage them, avoiding probe stalls for devices that depend on the cluster power domain, including SDMMC1. Fixes: 9c8d852dabbd ("arm64: dts: st: add power domain on stm32mp25") Signed-off-by: Patrick Delaunay Tested-by: Amelie Delaunay Reviewed-by: Amelie Delaunay Link: https://lore.kernel.org/r/20261119185544.v2.1.Ia5e0774883d237f5825b7090962b454294922558@changeid Signed-off-by: Alexandre Torgue Signed-off-by: Sasha Levin commit 3d47803288a83efa87ca60400f7339874075dc16 Author: Rodrigo Vivi Date: Fri Nov 20 10:27:54 2026 -0500 drm/xe/hwmon: Unregister hwmon before the device is unplugged [ Upstream commit 72296e02b46a34e52c8b97c5ebf95c2a970373fd ] hwmon was registered with devm, so its sysfs attributes stayed reachable after drm_dev_unplug() until devres teardown. A reader in that window accesses an unplugged device, e.g. the PMT energy read on BMG. Unregister it explicitly in xe_device_remove() and in the probe error path, before the device is unplugged. Removing the attributes waits for in-flight reads, so none can run afterwards. Cc: Karthik Poosa Cc: Michael J. Ruhl Reviewed-by: Michael J. Ruhl Fixes: fb1b70607f73 ("drm/xe/hwmon: Expose power attributes") Link: https://patch.msgid.link/20261120152753.1346010-2-rodrigo.vivi@intel.com Signed-off-by: Rodrigo Vivi (cherry picked from commit 6bae3d8f569445db5e3385b61efa5f9ba9eed3d3) Signed-off-by: Matthew Brost Signed-off-by: Sasha Levin commit 61aef147277a2d39fb62b6593355f81e6e2618fc Author: Rafael J. Wysocki Date: Thu Nov 19 20:56:34 2026 +0100 cpufreq: intel_pstate: Use dedicated lock in set_power_ctl_ee_state() [ Upstream commit 569e1eb36b033f42a9c363ffe4bfbf50bdadae51 ] Commit eee2a44e4e2b ("cpufreq: Improve suspend-resume synchronization") caused lockdep to complain about a possible circular locking dependency because intel_pstate_resume() is now called under cpus_read_lock, and it calls set_power_ctl_ee_state() that acquires intel_pstate_driver_lock which can be held around CPU hotplug locking. Fortunately, this cannot lead to a real deadlock because intel_pstate_resume() does not run in parallel with the other holders of intel_pstate_driver_lock, but in fact set_power_ctl_ee_state() need not use that particular lock either. Moreover, the original purpose of that lock is different, so using it in set_power_ctl_ee_state() is questionable. Accordingly, introduce a dedicated mutex for protecting MSR_IA32_POWER_CTL updates and power_ctl_ee_state accesses and make set_power_ctl_ee_state() use it instead of intel_pstate_driver_lock. Also take it directly in intel_pstate_resume() around the EE state restore. Fixes: eee2a44e4e2b ("cpufreq: Improve suspend-resume synchronization") Reported-by: "Borah, Chaitanya Kumar" Closes: https://lore.kernel.org/linux-pm/efcb1647-46fd-442a-bbda-283560d9df53@intel.com/ Signed-off-by: Rafael J. Wysocki Link: https://patch.msgid.link/2862244.mvXUDI8C0e@rafael.j.wysocki Signed-off-by: Sasha Levin commit 38fac0332e3dbee2a83bcd4e993860959c4919df Author: Ard Biesheuvel Date: Fri Nov 20 16:35:10 2026 +0100 efi/tpm: Allocate the event log from EFI loader data again [ Upstream commit cc919b0db7d322c65067801869bc6354669726dc ] The EFI stub currently allocates the TPM event log as EFI_ACPI_RECLAIM_MEMORY. On x86, this becomes an ACPI data entry in the E820 map. On a Framework Laptop 16 (AMD Ryzen AI 300 Series), the EFI allocator can place this allocation at different physical addresses across boots. Since x86 hibernation validates architecture-specific data from the firmware E820 map, this causes an otherwise valid hibernation image to be rejected on resume with the following error: Hibernate inconsistent memory map detected! PM: hibernation: Image mismatch: architecture specific data Allocating the event log as EFI_LOADER_DATA avoids changing the E820 map, but doing that alone would regress the kexec corruption issue fixed by commit 77d48d39e991 ("efistub/tpm: Use ACPI reclaim memory for event log to avoid corruption"): the E820 map that kexec passes on to the next kernel describes EFI loader data as ordinary RAM, and so the event log may get clobbered before the next kernel gets around to reserving it. So use the x86 implementation of efi_config_table_is_usable() to disregard the TPM event log table after kexec, just like the INITRD table, and go back to allocating it as EFI_LOADER_DATA. This is simpler than preserving the event log across kexec, e.g., by installing the memreserve table on x86 and using efi_mem_reserve_persistent(), and the utility of the event log after kexec is questionable to begin with. This also protects kexec'd kernels from a clobbered event log if the previous kernel predates the change above, and allocated the table from EFI loader data as well. The kexec issue was specific to x86, so other architectures can use EFI loader data as before. Tested-by: Jasmeet (Jazz) Bhatia Fixes: 77d48d39e991 ("efistub/tpm: Use ACPI reclaim memory for event log to avoid corruption") Signed-off-by: Ard Biesheuvel Signed-off-by: Sasha Levin commit 193177868f4784b1cba38cd242ebbc17f530bff5 Author: Ard Biesheuvel Date: Mon Nov 2 13:59:20 2026 +0100 x86/efi: Disregard the INITRD and MEMATTR config tables after kexec [ Upstream commit 6863183e8b65e833f8140e20d526282a725e040e ] When the EFI stub loads the initrd itself, it describes its location and size to the core kernel via a LINUX_EFI_INITRD_MEDIA_GUID configuration table, which is allocated from EFI loader data, just like the initrd. On x86, the stub passes the same information via boot_params as well, which takes precedence, but the core kernel will fall back to the INITRD config table if boot_params does not describe an initrd. The EFI configuration table array is passed on to kexec'd kernels as-is, and so a kexec'd kernel that is booted without an initrd will pick up the INITRD config table that was installed during the original boot, and use the initrd it describes, which no longer exists at that point. Commit 6e62d1c6f2c7 ("efi: Wipe INITRD config table from memory after consumption") mitigated this by wiping the base and size fields of the table once it has been consumed. However, the memory holding the table is released to the page allocator as well, and so it may have been reused by the time the kexec occurs, in which case the kexec'd kernel will interpret whatever happens to be stored there as the base and size of the initrd, e.g., [ 0.000000] efi: ... INITRD=0x7c41cc18 ... [ 0.000000] RAMDISK: [mem 0x9090909090909090-0xd1e7d1e68aaeafff] [ 0.000000] Kernel panic - not syncing: Cannot find place for new RAMDISK of size 4708303772963442675 Crash kernels will find the stale table as well, and wipe it again, i.e., write to the memory of the crashed kernel that they are supposed to capture. Both kexec_file_load() and kexec-tools pass a SETUP_EFI setup_data entry to the next kernel when EFI is enabled, which the x86 EFI code already relies on to detect that it was booted via kexec. Such kernels are entered directly, bypassing the EFI stub, and so any INITRD config table they encounter is necessarily stale. So wire up efi_config_table_is_usable() for x86, and use it to disregard the INITRD config table when a SETUP_EFI setup_data entry is present. While at it, use the same mechanism to disregard the Memory Attributes table after kexec, which is currently achieved by overwriting its address in the firmware's config table array with EFI_INVALID_TABLE_ADDR in efi_reuse_config(). This only happens on 64-bit firmware, and only if the SETUP_EFI entry carries the address of an SMBIOS table, which kexec-tools does not provide on systems that only expose an SMBIOS3 entry point. In that case, the kexec'd kernel will parse the table, which may be stale as well, given that EDK2 based firmware allocates it from EFI boot services data, which is released to the page allocator after boot too, e.g., [ 0.000000] efi: memattr: Unexpected EFI Memory Attributes table version -1958647317 Reviewed-by: Ilias Apalodimas Tested-by: Jasmeet (Jazz) Bhatia Fixes: f4dc7fffa987 ("efi: libstub: unify initrd loading between architectures") Signed-off-by: Ard Biesheuvel Signed-off-by: Sasha Levin commit 6fdc57eb1b2303bfccb7deae64e205f26c5265a4 Author: Karl Mehltretter Date: Tue Nov 24 04:16:42 2026 +0100 cgroup/rstat: disable preemption in css_rstat_updated() [ Upstream commit c99f50e4acf86bfbbe313d79f281d83be1763260 ] BPF programs can call css_rstat_updated() with preemption enabled. The kfunc calls __css_rstat_updated(), which requires preemption to be disabled while it queues an rstat update. A cgroup iterator can hit the lockdep assertion on both RT and non-RT kernels. The cgroup_hierarchical_stats selftest can also hit it on PREEMPT_RT: spin_lock_irqsave() on trace_cgroup_path_lock leaves preemption and interrupts enabled there. Disable preemption in the BPF wrapper after validating the CPU and before calling __css_rstat_updated(). Fixes: 36df6e3dbd7e ("cgroup: make css_rstat_updated nmi safe") Reported-by: Jiayuan Chen Closes: https://lore.kernel.org/r/20251119111402.153727-1-jiayuan.chen@linux.dev/ Signed-off-by: Karl Mehltretter Acked-by: Shakeel Butt Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin commit 25ae90ab12daebfbd1b71fec47eef2dd3259c7ba Author: Waiman Long Date: Mon Nov 23 23:28:00 2026 -0500 tick/sched: Make tick_nohz_full_mask and HK_TYPE_KERNEL_NOISE cpumask consistent [ Upstream commit 884e88175b95a03ea9f4dc8c89acca5d5b33cbd2 ] When the nohz_full boot parameter is first set, the cpu list parameter is passed directly to tick_nohz_full_setup() to set up tick_nohz_full_mask cpumask. Then the HK_TYPE_KERNEL_NOISE cpumask will be set up as the inverse of given cpu list parameter. Some of the timer code and RCU uses tick_nohz_full_mask directly while other timer code, scheduler and other subsystems use the HK_TYPE_KERNEL_NOISE cpumask. With CONFIG_PM_SLEEP_SMP && !CONFIG_PM_SLEEP_SMP_NONZERO_CPU config options, the boot CPU will be cleared from tick_nohz_full_mask if set while the corresponding HK_TYPE_KERNEL_NOISE cpumask isn't touched. The nohz_full entry in kernel-parameters.txt does state that the boot CPU will be forced outside the range to maintain the timekeeping. So it makes sense that the HK_TYPE_KERNEL_NOISE should be modified accordingly. Fix this inconsistency problem by adding a new cpumask_set_cpu() init function to be called by tick_nohz_init() when the boot CPU is cleared from tick_nohz_full_mask. In the special case that "nohz_full=0" and CPU 0 is cleared in tick_nohz_init(), tick_nohz_full_running will be set to false. However, housekeeping_enabled(HK_TYPE_KERNEL_NOISE) will stil be true with housekeeping_cpumask(HK_TYPE_KERNEL_NOISE) equal to cpu_possible_mask. So some unneeded code paths will be activated, but no harm will be done other than wasting some CPU cycles. Another problem that needs further thought but is not handled in this patch is when arch_irq_work_has_interrupt() turns out to be false. When this happens, tick_nohz_full_mask will be cleared and tick_nohz_full_running will be set back to false in tick_nohz_init(). PM_SLEEP_SMP_NONZERO_CPU depends on ARCH_SUSPEND_NONZERO_CPU which can only be set for the PowerPC architecture. Moreover CONFIG_PM_SLEEP_SMP is on by default, it means most kernels will not allow CPU 0 to be set in the tick_nohz_full_mask and hence should be set in HK_TYPE_KERNEL_NOISE cpumask. Fixes: 6f1982fedd59 ("sched/isolation: Handle the nohz_full= parameter") Signed-off-by: Waiman Long Reviewed-by: Frederic Weisbecker Reviewed-by: Ridong Chen Acked-by: Guopeng Zhang Tested-by: Guopeng Zhang Signed-off-by: Tejun Heo Signed-off-by: Sasha Levin commit 565c365a7aa88f3a92042c3e8d03b0fd91aa0007 Author: Shihuang Liu Date: Wed Nov 18 23:35:41 2026 +0800 net: sock_reuseport: Check program type on the migration path [ Upstream commit cbaaeff649b7aa09170cb31db001e5468c2726c0 ] A BPF_PROG_TYPE_SOCKET_FILTER program can be loaded with expected_attach_type set to BPF_SK_REUSEPORT_SELECT_OR_MIGRATE and attached to a SO_REUSEPORT TCP group. Closing a listener that still has queued children then runs it with a struct sk_reuseport_kern context even though it was verified against struct sk_buff, which KASAN reports as a stack-out-of-bounds in ___bpf_prog_run(). Reaching this without CAP_BPF requires kernel.unprivileged_bpf_disabled=0; with CONFIG_BPF_UNPRIV_DEFAULT_OFF=y, the Kconfig default, the sysctl starts at 2. reuseport_migrate_sock() decides from prog->expected_attach_type alone, a field user space sets that does not identify the program type. Require BPF_PROG_TYPE_SK_REUSEPORT there and in reuseport_stop_listen_sock(); socket filters still work as selectors, so the selection path is unchanged. Fixes: d5e4ddaeb6ab ("bpf: Support socket migration by eBPF.") Signed-off-by: Shihuang Liu Signed-off-by: Alexei Starovoitov Reviewed-by: Kuniyuki Iwashima Acked-by: Jakub Kicinski Link: https://patch.msgid.link/20261118153541.172499-1-shlomojune6@gmail.com Signed-off-by: Sasha Levin commit 1885197a1d1aead3fa71e2c1df3cd46cbe33c41e Author: Alexei Starovoitov Date: Mon Nov 23 20:45:42 2026 +0100 bpf: Let the bpf_fastcall boundary cover the longest pattern [ Upstream commit 95d366cb57752fb8821488676f607ebd0050fa9e ] A subprog can have bpf_fastcall patterns of different length: *(u64 *)(r10 - 8) = r2 *(u64 *)(r10 - 16) = r1 call bpf_get_smp_processor_id r1 = *(u64 *)(r10 - 16) r2 = *(u64 *)(r10 - 8) *(u64 *)(r10 - 16) = r1 call bpf_get_smp_processor_id r1 = *(u64 *)(r10 - 16) r0 = *(u64 *)(r10 - 8) For each pattern, take the offset just above its highest spill slot: 0 for the first pattern here, -8 for the second. Currently mark_fastcall_pattern_for_call() keeps the lowest of these offsets in fastcall_stack_off, the bpf_fastcall boundary of the subprog, which is -8 here. check_fastcall_stack_contract() looks only at accesses below the boundary, so the last load, at -8, does not switch the rewrite off. bpf_remove_fastcall_spills_fills() then removes all three pairs of a spill and a fill, and the load reads a slot that nothing wrote, while the verifier took it for a slot with the type of R2. Keep the highest of these offsets instead: every slot of every pattern is below it. Start from S16_MIN, the value that says that nothing is rewritten. Stop at 0, as min() did, because a pattern in code that never runs may end above the frame pointer. Fixes: 5b5f51bff1b6 ("bpf: no_caller_saved_registers attribute for helper calls") Signed-off-by: Alexei Starovoitov Signed-off-by: Kumar Kartikeya Dwivedi Link: https://patch.msgid.link/adbe7671c30f744adf6682d6431b9d818039cefb.1795462417.git.memxor@gmail.com Signed-off-by: Sasha Levin commit a2c28d472e64ae447dfccb7eb4e0423ca9e11215 Author: Amit Patole Date: Thu Nov 5 09:00:36 2026 -0500 jbd2: document the h_invalid handle flag [ Upstream commit 308c3c2ead9b32e959e8b08f6375b19aabad116f ] Commit 61e2a90a910c ("ext4: enable scoped NOFS when starting a handle in nojournal mode") added the h_invalid bit to struct jbd2_journal_handle but did not add it to the kernel-doc comment above the structure, so kernel-doc now warns: include/linux/jbd2.h:523 struct member 'h_invalid' not described in 'jbd2_journal_handle' Describe the new flag. It is set by ext4_get_nojournal() on a handle that is not attached to any journal and is tested by ext4_handle_valid(). The warning was found by running scripts/kernel-doc over the headers pulled into the htmldocs build. An AI coding assistant (Claude Opus 5.5) was used to locate the warning and draft this change; it was verified with scripts/kernel-doc (no warnings left) and checkpatch. Fixes: 61e2a90a910c ("ext4: enable scoped NOFS when starting a handle in nojournal mode") Signed-off-by: Amit Patole Reviewed-by: Jan Kara Link: https://patch.msgid.link/20261105-kdoc-jbd2-h_invalid-v1-1-4bc224f7d0a2@gmail.com Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin commit b56c61b3771cfd0eb6ba8357e60eb416cba1b8e0 Author: Christian Göttsche Date: Mon Sep 28 22:21:59 2026 +0200 jbd2: set JBD2_LOADED under j_state_lock [ Upstream commit 40e53dad45a92e932156de23a69c991f3e2512c9 ] j_flags is protected by j_state_lock, with only quick racy checks done without it. jbd2_journal_load() however sets JBD2_LOADED with a plain read-modify-write after journal_reset() has already started kjournald2, which tests and may update j_flags under the lock. KCSAN reports this while mounting the root file system: BUG: KCSAN: data-race in jbd2_journal_load / kjournald2 write to 0xffff9c6b012c6000 of 8 bytes by task 1 on cpu 3: jbd2_journal_load+0x279/0x3c0 ext4_fill_super+0x34dc/0x5740 get_tree_bdev_flags+0x21d/0x340 ... read to 0xffff9c6b012c6000 of 8 bytes by task 77 on cpu 0: kjournald2+0xc8/0x3e0 kthread+0x1bd/0x200 ... value changed: 0x00000000000000a8 -> 0x00000000000000b8 A concurrent update of another flag, e.g. JBD2_ABORT, could be lost. Take j_state_lock when setting JBD2_LOADED, like the other writers of j_flags do. Fixes: 470decc613ab ("[PATCH] jbd2: initial copy of files from jbd") Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Christian Göttsche Reviewed-by: Jan Kara Link: https://patch.msgid.link/20260928202159.2463182-1-cgoettsche@seltendoof.de Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin commit 9958743fcad52e18f172a870640fa4b052a47dc4 Author: Ojaswin Mujoo Date: Thu Sep 24 13:09:28 2026 +0530 ext4: Fix sparse warning in extents kunit test when EXT4_KUNIT_TESTS=m [ Upstream commit f0a38eb3ebf925386ded88e642bd2c5b3d06534b ] When kunit tests are compiled as modules, the extents kunit test emits a sparse warning: >> fs/ext4/extents-test.c:59:3: sparse: sparse: symbol 'k_ctx' was not declared. Should it be static? Fix this by declaring it as static. Fixes: cb1e0c1d1fad ("ext4: kunit tests for extent splitting and conversion") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202609221900.Pgwrcp41-lkp@intel.com/ Reviewed-by: Baokun Li Reviewed-by: Zhang Yi Reviewed-by: Jan Kara Signed-off-by: Ojaswin Mujoo Link: https://patch.msgid.link/20260924073929.2594339-1-ojaswin@linux.ibm.com Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin commit 7c5a98d7df888b6e13686bd878094162107024e4 Author: Filipe Manana Date: Mon Nov 16 11:24:38 2026 +0000 btrfs: fix delayed inode count leak after failure to delete inode ref [ Upstream commit 3100f46985fd14148e79a0e79912180934ef7231 ] When updating a delayed inode, if we have an inode ref to delete (the flag BTRFS_DELAYED_NODE_DEL_IREF is set) and we fail the deletion of the inode ref item (if it's in another leaf), we abort the transaction and then never release the delayed count for the inode ref deletion (by calling btrfs_release_delayed_iref()), resulting in a permanent leak of the delayed inode. Fix this by jumping to the 'out' label instead and removing the now no longer necessary 'err_out' label. Fixes: 67de11769bd5 ("Btrfs: introduce the delayed inode ref deletion for the single link inode") Link: https://sashiko.dev/#/bug/linux-3520c6eb-7928-477d-b369-9caff2b98d10 Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit b929b3ccf509dba96b45663dc11900d330cd41fa Author: Filipe Manana Date: Fri Nov 13 21:52:42 2026 +0000 btrfs: fix incorrect task accounting on error during io_uring read [ Upstream commit 42de7db475fe895d97934b73a06527a2e4912d93 ] We are passing 'ret' to add_rchar() under the 'out' label, which is meant to take a byte count for accounting, however if we got an error we pass it to add_rchar() too, which is just wrong. Fix thing by passing 'ret' only when it's not an error. Fixes: 34310c442e17 ("btrfs: add io_uring command for encoded reads (ENCODED_READ ioctl)") Link: https://sashiko.dev/#/bug/linux-beb0369e-eb47-41d3-86c1-e79cdc2de157 Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit bb9c51c787a985d7e5f2ca9837545e48b90ed794 Author: Filipe Manana Date: Fri Nov 13 17:36:57 2026 +0000 btrfs: fix blocking allocation for nowait encoded reads of inline extents [ Upstream commit 85c98fd512bb3e2f326f1a1cac30f2fb0af30c6a ] If we are doing a nowait encoded read of an inline extent, we are doing a GFP_NOFS allocation for the temporary buffer, which can block. We are also returning -ENOMEM on failure, which is wrong for a nowait context. Fix this by using GFP_NOWAIT when we are in a nowait context and by returning -EAGAIN instead of -ENOMEM if the allocation fails. Fixes: 973a432637ed ("btrfs: don't sleep in btrfs_encoded_read() if IOCB_NOWAIT is set") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 591bf0b3cb8dfa8f709b50c448cb90ef26837a91 Author: Filipe Manana Date: Fri Nov 13 17:10:54 2026 +0000 btrfs: abort transaction on failure to update inode after hole punching [ Upstream commit 6cd72166183bfc290fd853470232020c4b807aa2 ] If we fail to update the inode we simply release the transaction and don't abort the transaction. This means the transaction can get committed and we will not persist important updates to the inode item such as nbytes (which gets reduced after punching holes) and the timestamps. Fix this by adding the missing abort. Link: https://sashiko.dev/#/bug/linux-d8b4cb7a-8dfe-454f-9b19-a67af28b81bd Fixes: 2aaa66558172 ("Btrfs: add hole punching") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 305c3152318658294447802cab5589a676c9ada1 Author: Filipe Manana Date: Thu Nov 12 20:25:30 2026 +0000 btrfs: fix double release of space when cloning compressed inline extent [ Upstream commit ee020b5f0eb81a86533a16dcaafcee2b97a0f74d ] In copy_inline_to_page(), if we fail to decompress the inline extent, we jump to the out_unlock label and release the reserved data and metadata space with a call to btrfs_delalloc_release_space(). However we leave the range in the inode's io_tree marked as delalloc, which was set by btrfs_reset_extent_delalloc(), and that means when someone later clears the delalloc range, using EXTENT_DO_ACCOUNTING (like btrfs_reset_extent_delalloc() does), it will release again the space. This does not happen for uncompressed inline extents, because after the call to btrfs_reset_extent_delalloc() we can't get any other errors. Link: https://sashiko.dev/#/bug/linux-52478dd4-bd10-48de-baba-a527b38b64aa Fixes: 05a5a7621ce6 ("Btrfs: implement full reflink support for inline extents") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit d8dac89055052eb907efa5f0182fe5d68551998e Author: Filipe Manana Date: Thu Nov 12 17:24:57 2026 +0000 btrfs: fiemap: deal with inline extent in fiemap_find_last_extent_offset() [ Upstream commit fd573263740371f76cad610cbcc70629b27f6c0c ] In the while loop that finds the first file extent item, counting from the end of the file, that is not a hole, we are accessing the disk_bytenr field of each file extent item, which is wrong in case we have an item that represents an inline extent. In that case the inline data starts at the disk_bytenr offset and therefore we are reading user data or in case the inline data is less than 8 bytes, we are accessing another region of the leaf or even beyond the leaf boundaries in case it's the last item. This should be a very rare case, as it implies having an inline extent followed by a hole file extent item (the no-holes feature is not used). Fixes: ac3c0d36a2a2 ("btrfs: make fiemap more efficient and accurate reporting extent sharedness") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit e67fd33b3756907f49903a1278c753d3347d2267 Author: Arnav Kapoor Date: Wed Nov 18 16:01:27 2026 +0530 ASoC: SOF: control: reject out-of-range enum values [ Upstream commit 3092b9e481fedc413bf7acda9edc04b0bd8cb28a ] snd_sof_enum_put() passes the item indexes from user space to the IPC enum_put() op unchecked, and the IPC3 and IPC4 ops store them as they are and send them to the DSP. With the IPC4 sof-hda-generic-2ch.tplg on a Tiger Lake laptop, "Dmic0 Capture TDFB angle set enum" has 13 items but accepts 13 and 0xffffffff, and reads them back. The ALSA mixer-test selftest reports this as a write_invalid failure. Reject indexes past the last item, as snd_soc_put_enum_double() does. Fixes: c3078f539704 ("ASoC: SOF: Add Sound Open Firmware KControl support") Signed-off-by: Arnav Kapoor Link: https://patch.msgid.link/20261118103129.113970-1-kapoorarnav43@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 44aa26a1bef2a7f9e559bf16c3ab5ec654fec0c8 Author: Filipe Manana Date: Tue Nov 10 22:21:19 2026 +0000 btrfs: zstd: fix UAF due to race between putting workspace and reclaim [ Upstream commit 2d8b3d9b210a388129e41757372d70c66ae20a5b ] When we put a workspace with a level matching the requested level, we add it back to the lru list of the workspace manager and set the timer to run the reclaim function (zstd_reclaim_timer_fn()). If that workspace than gets used by some other task, obtained with zstd_find_workspace(), for some compression level lower than the workspace's level, we set the workspace's req_level field to the requested level (done in zstd_find_workspace()) and leave it in the lru list without updating the last_used field of the workspace. Once the last_used field ages past the ZSTD_BTRFS_RECLAIM_JIFFIES value, when zstd_put_workspace() is called it skips the lru update branch because the workspace's req_level does not match its level, and then it sets its req_level to 0 before releasing the workspace manager's lock - and after that and before zstd_put_workspace() does: if (workspace->level == clip_level(ZSTD_BTRFS_MAX_LEVEL)) cond_wake_up(&zwsm->wait); the reclaim function, zstd_reclaim_timer_fn(), can run, see the workspace in the lru list and see that it has a req_level of 0 and an expired last_used time, and therefore call zstd_free_workspace() to free the workspace, right before the task that is putting the workspace executes the code above to read its level. Fix this by reading the workspace's level before unlocking the workspace manager in zstd_put_workspace(). Link: https://sashiko.dev/#/bug/linux-92b08485-a86c-4bb5-9138-fa80c84389f0 Fixes: 3f93aef535c8 ("btrfs: add zstd compression level support") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 397c4d9d026803485f2250c3e8e1ce718114df65 Author: Filipe Manana Date: Tue Nov 10 19:14:34 2026 +0000 btrfs: fix race between concurrent sync direct IO writes [ Upstream commit ad4bb983915d8588dc9dd3aeb60cf58aff574e3b ] If we have a direct IO write within i_size, we lock the inode's VFS lock in shared mode, which allows for concurrent direct IO writes within different ranges of the file, which is an important optimization for many applications such as databases. However if we have a sync direct IO write within i_size, it locks the inode in shared mode and then enters fsync through the call to the iomap_dio_complete() function from iomap using the shared lock. This means that if we have another concurrent direct IO write that locks the inode in shared mode and the fsync is in fast mode (the inode flag BTRFS_INODE_NEEDS_FULL_SYNC is not set), the fsync does not wait for the ordered extent created by the concurrent direct IO write to complete before logging its extent map. The fsync code relies on direct IO writes to create ordered extents and wait for their IO to finish while holding the inode's lock, while the fsync should hold the inode lock in exclusive mode. This means that this race can end up persisting a log tree with file extent items that point to extents that were not yet written when the log is synced. Fix this by always taking the inode lock in exclusive mode if we have a sync write. This issue was identified by Sashiko in the link below, which identifies two different races between direct IO writes and fsync. The race fixed here is the second case identified by Sashiko in the link below. The first race is already being fixed in a separate patch from Josef. Link: https://sashiko.dev/#/bug/linux-ee047626-2fa7-46d5-b543-861136993fc7 Fixes: 939b656bc8ab ("btrfs: fix corruption after buffer fault in during direct IO append write") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit a3d0c05baf40474e84b40530fa50fa6fc744be62 Author: Boris Burkov Date: Tue Sep 15 10:58:33 2026 -0700 btrfs: downgrade the reflink source inode lock for tree walking [ Upstream commit cf02c310d018c7e5363b80dfd68ffdf159f3c914 ] When doing a reflink, we are not writing to the src inode or modifying it in any way, so it is counter-intuitive to have to lock it exclusively. This has the cost of blocking other shared lock users of the src file for the duration of any new writeback since the optimistic pre-flush and all the actual reflinking. So we would like to downgrade the lock to shared as much as possible. There are two important gotchas to do with direct io that must be addressed to make this idea work. The first gotcha is that dio writes that come in under EOF try to take inode->i_rwsem shared, which would result in messed up views of the extents in the reflinked file. Therefore, add "being used as a reflink src" as another inode flag exception for the dio write shared tests that already exist to check for other dangerous conditions. In order to ensure that this flag is visible to the dio writer, reflink must first take i_rwsem exclusive, then set the flag, then downgrade to shared. The second is that dio reads increment inode->i_dio_count which blocks inode_dio_wait() in __generic_remap_file_range_prep(). Therefore, we must remain exclusive to dio reads through finishing the prep or risk starving the clone on a stream of dio readers. There is still O(extents) work in btrfs_clone() which can be done without holding the lock exclusive, so we should downgrade to shared and admit dio readers (and other shared lock users like lseek) after we are finished with inode_dio_wait(). By running concurrent clones and lseeks or dio reads on a src file with 32k extents on a vm, I can demonstrate 100ms+ stalls on the readers without this patch and they go away entirely with the patch. Reviewed-by: Filipe Manana Signed-off-by: Boris Burkov Signed-off-by: David Sterba Stable-dep-of: ad4bb983915d ("btrfs: fix race between concurrent sync direct IO writes") Signed-off-by: Sasha Levin commit d8feed479c15c5ddbe3ff4f691e65060ad00ff8d Author: Boris Burkov Date: Tue Sep 15 10:58:31 2026 -0700 btrfs: pre-flush reflink source before taking inode locks [ Upstream commit 220c44b1b90fbff746472cbb3dde778b02afbef9 ] Consider the following sketch of a shell script: dd if=/dev/urandom of=/mnt/src bs=1M count=4096 cp --reflink=always /mnt/src /mnt/dst & sleep 0.1 # let the clone reach its flush time dd if=/mnt/src of=/dev/null bs=4K count=1 iflag=direct The current logic in reflink ensures the existence and stability of both the src and destination inode by locking them both and then flushing all dirty pages / ordered_extents under the inode lock. This blocks concurrent usage by even readers of the inode locks, like direct reads or seeks for the duration of writeback on the entirety of the two files. We observe this particular contention frequently in the Meta fleet. It is also a relatively common pattern to write the src file, then reflink it while it is still dirty, so that typical path naturally hits this contention. This workload motivates a relatively simple optimization: trigger the unavoidable src flushing outside the locked region. Therefore, do an optimistic btrfs_wait_ordered_range() without the locks while relying on the calls to btrfs_wait_ordered_range() under the locks in btrfs_remap_file_range_prep() to ensure correctness. In the worst case with concurrent writes while unlocked, we can end up doing the writeback twice, which I think is a reasonable price to pay to avoid victimizing innocent readers in a common case. With and without this patch, the above reproducer runs the reflink in the same ~0.5s on my system. Without the patch, the direct read blocks for basically the full duration of the reflink while with the patch it returns in a few milliseconds. Reviewed-by: Filipe Manana Signed-off-by: Boris Burkov Signed-off-by: David Sterba Stable-dep-of: ad4bb983915d ("btrfs: fix race between concurrent sync direct IO writes") Signed-off-by: Sasha Levin commit e17b70f44e01810e39ed3fe759a45bfd2da4599b Author: Cheng Yongkang Date: Mon Oct 26 03:51:09 2026 -0700 btrfs: remove devid kobject when deleting a missing device [ Upstream commit 9383a7fdcb27142d97e65fc76f28475018980b35 ] btrfs_rm_device() removes the sysfs device entry only when device->bdev_file is non-NULL. A missing device (created by add_missing_dev() for an absent disk) has bdev_file == NULL, but btrfs_sysfs_add_device() still registers its devid kobject under /sys/fs/btrfs//devinfo/. When such a device is deleted, btrfs_free_device() frees the btrfs_device while the devid kobject remains registered. The kobject is embedded in the freed btrfs_device and its show functions use container_of() to reach it, so reading any devinfo attribute is a use-after-free: BUG: KASAN: slab-use-after-free in sysfs_kf_seq_show+0x157/0x490 Read of size 8 at addr ffff88801d8172a8 by task poc/9385 ... Freed by task 9385: kfree btrfs_rm_device+0x11ee/0x17b0 btrfs_ioctl_rm_dev+0x265/0x400 Allocated by task 9390: btrfs_alloc_device+0x7e/0x400 device_list_add btrfs_scan_one_device btrfs_control_ioctl The freed object is kmalloc-1k and the faulting access is 680 bytes inside it (offsetof(struct btrfs_device, devid_kobj) = 640 plus offsetof(struct kobject, ktype) = 40), confirming the embedded devid_kobj. btrfs_sysfs_remove_device() already skips the block-device link when device->bdev is NULL and only touches the devid kobject when it is initialized. Call it for missing devices too. Fixes: 668e48af7a94 ("btrfs: sysfs, add devid/dev_state kobject and device attributes") Reviewed-by: Qu Wenruo Assisted-by: LLM Signed-off-by: Cheng Yongkang Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 85175aa8bc1f89c1f84ae47f1f64f365dcdee8da Author: Hugo Sales Date: Sat Nov 14 11:51:52 2026 +0000 cpufreq: intel_pstate: Refresh cpuinfo.max_freq when a CPU goes online [ Upstream commit a636989f93b4f70df0e44dd3025ba13c05266053 ] A write to no_turbo or a change in the HWP capabilities updates policy->cpuinfo.max_freq through intel_pstate_update_max_freq(), which gets the policy with cpufreq_cpu_get(). That returns NULL for an offline CPU, so its policy keeps the old value. When the CPU comes back, the core reuses the policy and calls ->online(), and intel_pstate_cpu_online() doesn't recompute cpuinfo.max_freq either. Before commit 4adcf2e5829f ("cpufreq: intel_pstate: Add ->offline and ->online callbacks"), ->init() ran on every online and set it Turning turbo on while a CPU is offline leaves that CPU at the non-turbo maximum once it's back, while the other CPUs report the turbo frequency. In the reverse order the CPU keeps the turbo maximum with turbo off Set cpuinfo.max_freq at the end of intel_pstate_cpu_online(), after HWP is enabled again, the same way __intel_pstate_update_max_freq() does. cpufreq_online() applies the policy limits after that. Hold the CPU hotplug lock in store_no_turbo(), so a CPU can't come online between the no_turbo store and the update of the online CPUs Fixes: 4adcf2e5829f ("cpufreq: intel_pstate: Add ->offline and ->online callbacks") Reported-by: Ximing Zhang Closes: https://lore.kernel.org/all/20261108071225.54656-1-xzhangjr@gmail.com/ Signed-off-by: Hugo Sales Tested-by: Ximing Zhang [ rjw: Renamed the new function ] Link: https://patch.msgid.link/20261114-intel-pstate-online-max-freq-v1-1-1bbdae2b4986@hsal.es Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit 8cc9483dba79589e618735281afd3fcd1d552b63 Author: Stefan Ghetu Date: Mon Nov 16 11:37:51 2026 +0200 ASoC: fsl_asrc_m2m: allow only one task at a time per stream [ Upstream commit f0277994dbd09cc45d600c2f86cbfde9c17c6fcf ] All tasks of a stream share one pair and one set of DMA channels, and get_caps() advertises a single fragment, but the compress core allows up to 64 tasks. A second task requests the pair again and overwrites the DMA channels. Freeing both tasks then releases the same channels twice and leaves a stale asrc->pair[] entry after close. Return -EBUSY from task_create() while a task exists, and clear the DMA channel pointers once they are released. Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function") Signed-off-by: Stefan Ghetu Reviewed-by: Shengjiu Wang Link: https://patch.msgid.link/20261116093751.138455-6-stefan.ghetu@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 0a42f3fcfc8f1051739c2c4f88cd9b026946e182 Author: Stefan Ghetu Date: Mon Nov 16 11:37:50 2026 +0200 ASoC: fsl_easrc: fix context ownership on repeated hw_params [ Upstream commit f50dfefe6d4dd8cf5e826353de21228b9f073e68 ] hw_params() can be called again without hw_free() in between. fsl_easrc_hw_params() then requests a second context while the stream still owns the first one, which is never released. After close, that easrc->pair[] entry points to freed memory and is dereferenced by fsl_easrc_runtime_resume() on the next open. The EASRC slots depend on the number of channels, so release the owned context before requesting a new one, and make fsl_easrc_release_context() ignore a context it does not own. Fixes: 955ac624058f ("ASoC: fsl_easrc: Add EASRC ASoC CPU DAI drivers") Signed-off-by: Stefan Ghetu Reviewed-by: Shengjiu Wang Link: https://patch.msgid.link/20261116093751.138455-5-stefan.ghetu@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 4ba998aec028fcaa65128dae39bf61dccedb52a8 Author: Stefan Ghetu Date: Mon Nov 16 11:37:49 2026 +0200 ASoC: fsl_asrc_dma: release DMA channels on repeated hw_params [ Upstream commit 0d02516a94b47637acaad8e7a83c3a810402e70a ] fsl_asrc_dma_hw_params() requests new DMA channels on every call and overwrites the previous ones, which are leaked when hw_params() is called again without hw_free(). Its Back-End error path also releases a channel without clearing the pointer, so the following hw_free() releases it a second time. Release the channels of a previous call first, and clear the pointer in the error path. Fixes: 3117bb3109dc ("ASoC: fsl_asrc: Add ASRC ASoC CPU DAI and platform drivers") Fixes: 36124fb19f1a ("ASoC: fsl_asrc_dma: Fix dma_chan leak when config DMA channel failed") Signed-off-by: Stefan Ghetu Reviewed-by: Shengjiu Wang Link: https://patch.msgid.link/20261116093751.138455-4-stefan.ghetu@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 13d5cc43504c0da72ffec66682f2aabf4a9139b9 Author: Andy Shevchenko Date: Fri Sep 18 13:34:09 2026 +0200 ASoC: fsl_asrc: Replace dma_request_slave_channel() by dma_request_chan() [ Upstream commit b045248399d0cd8b6188ce1a5b9d722709ad3ddc ] Replace dma_request_slave_channel() by dma_request_chan() as suggested since the former is deprecated. With this, propagate all possible errors to the caller. Signed-off-by: Andy Shevchenko Reviewed-by: Frank Li Link: https://patch.msgid.link/20260918113727.1898998-6-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown Stable-dep-of: 0d02516a94b4 ("ASoC: fsl_asrc_dma: release DMA channels on repeated hw_params") Signed-off-by: Sasha Levin commit 0d1491d2b85330435623ad14be83d2d2f8c5662b Author: Stefan Ghetu Date: Mon Nov 16 11:37:48 2026 +0200 ASoC: fsl_asrc: fix pair ownership on repeated or failed hw_params [ Upstream commit fbeac9352de6584bd5eb7c23d2f224339772c992 ] hw_params() can be called again without hw_free() in between, and hw_free() is also called after a failed hw_params(). fsl_asrc_request_pair() always takes a new pair, so a second hw_params() leaves the stream in two asrc->pair[] entries. Only one is released, and after close the other points to freed memory, which is dereferenced by fsl_asrc_isr() and fsl_asrc_m2m_suspend(). After a failed hw_params(), fsl_asrc_release_pair() releases a stale index that may belong to another running stream. Keep the owned pair and only update its channels when it is requested again, and ignore a pair the stream does not own on release. Fixes: 3117bb3109dc ("ASoC: fsl_asrc: Add ASRC ASoC CPU DAI and platform drivers") Signed-off-by: Stefan Ghetu Reviewed-by: Shengjiu Wang Link: https://patch.msgid.link/20261116093751.138455-3-stefan.ghetu@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit 81dc34a2b0fd2b56b16af05493908ad7ff872781 Author: Stefan Ghetu Date: Mon Nov 16 11:37:47 2026 +0200 ASoC: fsl_asrc_m2m: fix out-of-bounds write when draining the output FIFO [ Upstream commit 6b3f779dcac4ea16e232019b68650395ad55f5a2 ] asrc_read_last_fifo() checks the FIFO fill level, a number of frames, against a length in bytes, and ignores the frames already drained by previous iterations of its retry loop. With an output length close to the 512 KiB buffer size, which userspace controls through the task input size and formats, the drain writes past the end of the output buffer: 312 bytes for 10 channels of S24_LE with 8 frames left in the FIFO. Check the space needed by all drained frames in bytes. Fixes: 24a01710f627 ("ASoC: fsl_asrc_m2m: Add memory to memory function") Signed-off-by: Stefan Ghetu Reviewed-by: Shengjiu Wang Link: https://patch.msgid.link/20261116093751.138455-2-stefan.ghetu@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin commit b4d85de01c693db484a94407dbbb27df9b6ce4c1 Author: Qu Wenruo Date: Thu Nov 5 11:38:00 2026 +1030 btrfs: fix a race between reflink and compressed writes [ Upstream commit 3b112e8542862db4a92978385e0b9d3fb8064e7a ] [BUG] There is a bug report with a reproducer that can lead to transaction abort. The reproducer requires either large folios or page size larger than block size and compression: BTRFS info (device dm-2): use zstd compression, level 3 ------------[ cut here ]------------ WARNING: fs/btrfs/extent_map.c:443 at btrfs_unpin_extent_cache+0x12a/0x1a0 [btrfs], CPU#0: kworker/u41:1/1073 CPU: 0 UID: 0 PID: 1073 Comm: kworker/u41:1 Tainted: G W E 7.3.0-rc7-custom+ #111 PREEMPT(full) 181cfbec4e757bdd6c595e90a917484279074a92 Workqueue: btrfs-endio-write btrfs_work_helper [btrfs] RIP: 0010:btrfs_unpin_extent_cache+0x12a/0x1a0 [btrfs] Call Trace: btrfs_finish_one_ordered+0x8f9/0xce0 [btrfs 78b39de6ff5f8aabf4d2477512804f86456deeca] btrfs_work_helper+0xc5/0x3a0 [btrfs 78b39de6ff5f8aabf4d2477512804f86456deeca] process_scheduled_works+0x20b/0x480 worker_thread+0x1f7/0x2f0 kthread+0x101/0x130 ret_from_fork+0xd9/0x250 ret_from_fork_asm+0x11/0x20 ---[ end trace 0000000000000000 ]--- BTRFS warning (device dm-2): found extent map for inode 257 (root 5) with unexpected start offset 8192 when unpinning extent range [4096, 12288), generation 12 ------------[ cut here ]------------ WARNING: fs/btrfs/inode.c:3321 at btrfs_finish_one_ordered+0xc4b/0xce0 [btrfs], CPU#0: kworker/u41:1/1073 CPU: 0 UID: 0 PID: 1073 Comm: kworker/u41:1 Tainted: G W E 7.3.0-rc7-custom+ #111 PREEMPT(full) 181cfbec4e757bdd6c595e90a917484279074a92 Workqueue: btrfs-endio-write btrfs_work_helper [btrfs] RIP: 0010:btrfs_finish_one_ordered+0xc4b/0xce0 [btrfs] Call Trace: btrfs_work_helper+0xc5/0x3a0 [btrfs 78b39de6ff5f8aabf4d2477512804f86456deeca] process_scheduled_works+0x20b/0x480 worker_thread+0x1f7/0x2f0 kthread+0x101/0x130 ret_from_fork+0xd9/0x250 ret_from_fork_asm+0x11/0x20 ---[ end trace 0000000000000000 ]--- BTRFS error (device dm-2 state A): Transaction 12 aborted (-EUCLEAN) BTRFS: error (device dm-2 state A) in btrfs_finish_one_ordered:3321: errno=-117 Filesystem corrupted [CAUSE] There is a race between compressed write and regular write inside the same folio, that can lead to incorrect PAGECACHE_TAG_DIRTY tag to be cleared too early. In this example, we have a large folio containing 8 pages (4K page size, 4K block size), with the following layout: 0 8K 16K 24K 32K |//////////| |///| Where [4K, 12K) is dirty, and [20K, 24K) is also dirty. Writeback | Compression worker ----------------------------------+------------------------------------ writepage_delalloc() | |- run_delalloc_compressed() | | | Queueing [4K, 12K) for | | | compression. | | \- btrfs_queue_work() | | | compress_file_range() | | |- extent_range_clear_dirty_for_io() | | \- btrfs_folio_clamp_clear_dirty() | | Now range [4K, 12K) is no longer | | dirty, but also without an OE. \- run_delalloc_cow() | | For the [20K, 24K) | \- submit_one_sector() | |- btrfs_folio_clear_dirty()| | Since [20K, 24K) is the | | last dirty block, the | | folio is no longer dirty | | | |- btrfs_folio_set_writeback() Since the folio is no | longer dirty, the | PAGECACHE_TAG_DIRTY tag | is also cleared. | The above race will lead to a 32K folio that contains [4K, 12K) range that is still under compression (and should still be counted dirty), but without an OE. Then later in the reflink: Reflink | Compression worker ----------------------------------+------------------------------------ btrfs_clone_files() | | Which is to replace [4K, 8K) | | | |- btrfs_wait_ordered_range() | | |- btrfs_fdatawrite_range() | | | Nothing to do, since no | | | DIRTY tag for the folio | | | | | |- filemap_fdatawait_range() | | | The [20K, 24K) finished, | | | So no WRITEBACK tag | | | | | \- lookup OE | | No OE is created for range | | [4K, 12K) | | | | | submit_compressed_extents | | \- submit_one_async_extent | | \- btrfs_alloc_ordered_extent() | | OE for [4K, 12K) created, but | | it's too late. \- btrfs_clone() | Replace file extents for range | [4K, 8K), which will conflict | with the new compressed range | [4K, 12K) | | end_bbio_data_write([4k, 12K)) | \- btrfs_finish_ordered() | | | finish_ordered_fn() | \- btrfs_finish_one_ordered() | \- btrfs_unpin_extent_cache() | em start 8K != 4K return -EUCLEAN, transaction aborted [FIX] Do not clear the folio dirty early during compress_file_range(). The premature clearing is done through extent_range_clear_dirty_for_io(), so remove the folio dirty clearing completely from it. And since what's left is only checking the folio write protection, rename the function to extent_range_check_write_protected() instead, and slightly clean it up, so it doesn't need to return an int. Finally since the range is still dirty now, all run_delalloc_cow() callers pass @pages_dirty = true, we can remove that parameter along other involved functions. Fixes: 1d2fbb7f1f9e ("btrfs: allow compression even if the range is not page aligned") Reported-by: Breno Leitao Link: https://lore.kernel.org/linux-btrfs/ause7k_HjzUWT3D-@gmail.com/ Reviewed-by: Filipe Manana Tested-by: Breno Leitao Signed-off-by: Qu Wenruo Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 4d85c99cbc8f15a8499eab745b31477bb728d50d Author: Binbin Deng <18983559317@163.com> Date: Wed Oct 14 10:37:33 2026 +0800 btrfs: wait for a grace period before freeing a new device [ Upstream commit 38c94b99f8743a5b9aab864a12ecf9a06d36aeb4 ] KASAN reports a slab-use-after-free in btrfs_statfs() walking fs_devices->devices. btrfs_init_new_device() publishes the new device with list_add_rcu() and can fail afterwards, for example with -ENOSPC in init_first_rw_device() when a user with CAP_SYS_ADMIN adds a device that is too small to a seeding filesystem mounted read-only. The error path removes the entry with list_del_rcu() and frees the object in btrfs_free_device() without waiting for a grace period, while btrfs_calc_avail_data_space() and btrfs_ioctl_fs_info() keep reading the device list under rcu_read_lock(). BUG: KASAN: slab-use-after-free in btrfs_statfs+0x11af/0x14a0 Read of size 8 at addr ffff8880096be858 by task poc/252 Call Trace: dump_stack_lvl+0x53/0x70 print_report+0xd0/0x630 ? __pfx__raw_spin_lock_irqsave+0x10/0x10 ? filename_lookup+0x1a9/0x540 ? btrfs_statfs+0x11af/0x14a0 kasan_report+0xce/0x100 ? btrfs_statfs+0x11af/0x14a0 btrfs_statfs+0x11af/0x14a0 statfs_by_dentry+0x117/0x1e0 user_statfs+0xac/0x130 ? __pfx_user_statfs+0x10/0x10 __do_sys_statfs+0x80/0xe0 ? __pfx___do_sys_statfs+0x10/0x10 do_syscall_64+0xf9/0x540 entry_SYSCALL_64_after_hwframe+0x77/0x7f Allocated by task 256: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 __kasan_kmalloc+0x8f/0xa0 __kmalloc_cache_noprof+0x158/0x370 btrfs_alloc_device+0xad/0x3e0 btrfs_init_new_device+0x3e8/0x36e0 btrfs_ioctl+0x150d/0x6c20 __x64_sys_ioctl+0x134/0x1c0 do_syscall_64+0xf9/0x540 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 256: kasan_save_stack+0x33/0x60 kasan_save_track+0x14/0x30 kasan_save_free_info+0x3b/0x60 __kasan_slab_free+0x43/0x70 kfree+0x121/0x380 btrfs_init_new_device+0x4a0/0x36e0 btrfs_ioctl+0x150d/0x6c20 __x64_sys_ioctl+0x134/0x1c0 do_syscall_64+0xf9/0x540 entry_SYSCALL_64_after_hwframe+0x77/0x7f Fix by waiting for an RCU grace period after the device is removed from the list and before it is freed.Place the synchronize_rcu() after dropping the mutexes and before the `error_trans` label. Fixes: 1f78160ce1b1 ("Btrfs: using rcu lock in the reader side of devices list") Reviewed-by: Daniel Vacek Signed-off-by: Binbin Deng <18983559317@163.com> Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 0d8ee20072fd0cf2241107d61d09b01968eb921b Author: Filipe Manana Date: Thu Nov 12 17:10:25 2026 +0000 btrfs: send: fix invalid access to inline extents in clone_range() [ Upstream commit beed53bd3cb5f0b0a0aad453aa6f0b49060ff2dc ] We can't access the disk_bytenr and offset fields of a file extent item that represents an inline extent, since the extent's data starts at the offset of the disk_bytenr field and the offset field is after that, so both fields point either to inline data or beyond the file extent item in case the data is too small. Fix this by not reading the disk_bytenr and offset fields if we are dealing with an inline extent. Link: https://sashiko.dev/#/bug/linux-b662b951-0491-465b-a262-f01a108d8146 Fixes: 040ee6120cb6 ("Btrfs: send, improve clone range") Fixes: d906d49fc5f4 ("Btrfs: send, fix file corruption due to incorrect cloning operations") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 4692a1d5e312a865bade7d4289b2d0cba5c0f6ce Author: Filipe Manana Date: Wed Oct 21 20:34:59 2026 +0100 btrfs: send: fix missing hole punching during incremental send [ Upstream commit 398ee8a011d9187e83fc24738b3391e508da91da ] When using the no-holes feature (enabled by default since btrfs-progs v5.15) and doing an incremental send, we can miss issuing a hole punching command when the following conditions happen: 1) A hole is punched in a tail section of a file extent item that happens to be the last item in a leaf (for example the extent covers the file range [1M, 3M) and a hole is punched in the range [2M, 3M)). Between the end of this file extent item's range and the i_size, there are other file extent items; 2) The next leaf was not modified in the send snapshot, remaining shared with the parent snapshot. In this scenario we are unable to detect a hole was punched and never issue a hole punch command because with no-holes there we don't have an explicit file extent item to mark a hole. Fix this by teaching maybe_send_hole() to detect such case. A test case for fstests will follow soon. Reported-by: Tristan Elvers Link: https://lore.kernel.org/linux-btrfs/CAFoLKK+aErV4p6ZJPnVeH5SHQ5++0f=8ZgxPWe-E-CkeKBs8PA@mail.gmail.com/ Fixes: 16e7549f045d ("Btrfs: incompatible format change to remove hole extents") Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 5084b9044bcf0f97091757a2d08ae01c6dcf8812 Author: Eric Dumazet Date: Wed Nov 18 13:54:43 2026 +0100 tun: flush uc and mc addresses in TUNSETLINK [ Upstream commit 5677cf0e039b3cabf79d5aa10facbdb54aea93c6 ] TUNSETLINK changes dev->type and dev->addr_len, but leaves dev->uc and dev->mc untouched. Entries added with the old addr_len stay in lists and rb-trees that are now searched and dumped with the new addr_len. When addr_len grows (eg ARPHRD_NONE -> ARPHRD_IP6GRE), dumps like /proc/net/dev_mcast and RTM_GETMULTICAST expose bytes of netdev_hw_addr that were never initialized. bonding and team already call dev_uc_flush() and dev_mc_flush() between NETDEV_PRE_TYPE_CHANGE and the type change. Do the same in tun, but only when addr_len changes: if it does not, existing entries are still valid and there is no reason to drop them. Fixes: cca8ea3b05c9 ("net: tun: set tun->dev->addr_len during TUNSETLINK processing") Link: https://lore.kernel.org/netdev/20261116024056.1274402-1-bsdhenrymartin@gmail.com/ Signed-off-by: Eric Dumazet Reviewed-by: Willem de Bruijn Link: https://patch.msgid.link/20261118125443.1137177-1-edumazet@kernel.org Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit 55836d8e6efbcff79c4b8a374f79d18be67dac25 Author: Randy Dunlap Date: Sun Nov 22 16:45:01 2026 -0800 chardev: GPIO common access methods: repair non-kernel-doc comment [ Upstream commit d4dc896fa2bdfd7d1a78911598a0fa3e3c831d92 ] Change a "/**" non-kernel-doc comment to a plain C comment "/*" to avoid 21 warnings like these: Warning: ./include/linux/nsc_gpio.h:2 Cannot find identifier on line: nsc_gpio.c Warning: ./include/linux/nsc_gpio.h:4 Cannot find identifier on line: National Semiconductor GPIO common access methods. Warning: ./include/linux/nsc_gpio.h:6 Cannot find identifier on line: struct nsc_gpio_ops abstracts the low-level access Fixes: fe3a168a2ce1 ("[PATCH] chardev: GPIO for SCx200 & PC-8736x: add gpio-ops vtable") Signed-off-by: Randy Dunlap Acked-by: Jim Cromie Acked-by: Linus Walleij Link: https://patch.msgid.link/20261123004501.1771603-1-rdunlap@infradead.org Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit a099957389549f6594ec221eb6a50a76b5aaf696 Author: Anastasia Eskova Date: Mon Nov 23 11:23:24 2026 +0100 s390/cert_store: Only allow the kernel to create cert_store_key keys [ Upstream commit 23a04cb4f2bdbfc87fc4e1c15450e7f8cfc9842a ] Keys of type cert_store_key can be created by any user with add_key() in any keyring, as the key type has no vet_description() callback. The type is registered whenever CONFIG_CERT_STORE is enabled, even if the machine has no DIAG 320 support. cert_store_key_describe() expects a description in the format created by get_key_description(), i.e. a 64 byte key name followed by the VCE index and the certificate store token. If a key with a shorter description is created, seq_puts() may read beyond the end of the description allocation. Reading /proc/keys may then disclose adjacent kernel heap memory to the user space. Also, a consumer which trusts keys by type can be fooled by keys that were not created from the certificate store. Add a vet_description() callback which only accepts the task currently executing refresh_store(), which creates all valid keys of this type. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Anastasia Eskova Reviewed-by: Jarkko Sakkinen Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin commit 045edec272606ddde9d96dec47bc04c74656aa30 Author: Anastasia Eskova Date: Mon Nov 23 11:23:23 2026 +0100 s390/cert_store: Allocate keyring with link restriction [ Upstream commit 602af7b1c19309330a36ffe787336cb95e040ab1 ] The keyring is linked into the user session keyring on allocation, but keyring_restrict() is only called after all certificates were added. Until then a possessor of the keyring can link arbitrary keys into it. If keyring_restrict() fails, the error is only logged and the keyring stays writable. Allocate the keyring with a restriction which rejects all links, create the certificate keys with KEY_ALLOC_BYPASS_RESTRICTION and drop the late keyring_restrict() call. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Anastasia Eskova Reviewed-by: Jarkko Sakkinen Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin commit 920948b3a45fd11c05517330e66d42ec3b848545 Author: Zhu Jun Date: Fri Nov 20 14:21:07 2026 +0800 tools: gpio: Return success after monitoring requested events [ Upstream commit 1eaf27d99938dd30ea7855174b65e37a2503a349 ] After reading the requested number of events, monitor_device() returns the positive byte count left in ret by read(). main() passes this value through as the exit status, so a successful invocation with -c reports failure. Clear ret when the event limit is reached, keeping read failures on their existing error paths. Fixes: 97f69747d8b1 ("tools/gpio: add the gpio-event-mon tool") Signed-off-by: Zhu Jun Link: https://patch.msgid.link/20261120062107.98391-1-zhujun2@cmss.chinamobile.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit fb9cf0c16bfa8358ba50d63ac652c45d40e6042e Author: Zhu Jun Date: Fri Nov 20 14:20:53 2026 +0800 tools: gpio: Preserve device listing errors in lsgpio [ Upstream commit 809117fc28453aafa7164ad45ea853f900974d08 ] When no chip is selected, lsgpio breaks out of the directory scan on a list_device() failure, then unconditionally resets ret to zero. A chip that cannot be opened or queried is therefore reported as success. Initialize ret to zero before scanning instead, so an empty scan still succeeds and errors from list_device() reach the caller. Fixes: 6d591c46bce0 ("tools/gpio: create GPIO tools") Signed-off-by: Zhu Jun Link: https://patch.msgid.link/20261120062053.98356-1-zhujun2@cmss.chinamobile.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit 408015c400505100cd37565871adad8ccfba7f57 Author: Zhu Jun Date: Fri Nov 20 14:18:27 2026 +0800 tools: gpio-hammer: Accept the maximum number of line offsets [ Upstream commit 0b3f1876d6db7fad0391ce714b315269b0dd5758 ] The offset count is incremented for every -o option, but the final check rejects the maximum itself and reports one extra offset. Only reject counts above the maximum and report the actual count. Fixes: d1ee7e1f5c91 ("tools: gpio-hammer: Avoid potential overflow in main") Signed-off-by: Zhu Jun Link: https://patch.msgid.link/20261120061827.98066-1-zhujun2@cmss.chinamobile.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit e82dd6bd9250beb5fe8454720722997a0cddec13 Author: Antonio Quartulli Date: Sat Nov 14 00:28:41 2026 +0100 tun: complete the zerocopy buffer of packets consumed by XDP [ Upstream commit 3896ae4adf5ffc11ffd0f7f42c3923e8dc195e75 ] When vhost-net passes a zerocopy buffer that tun_get_user() does not use, because the packet spans too many pages, the packet is copied and the buffer completed. If the copy goes through build_skb() and native XDP consumes the packet (DROP, TX or REDIRECT), tun_get_user() returns without completing it: vhost-net never gets the descriptor back, and closing the vhost-net device then blocks forever. Complete it in that case too, as copied. Reproducer: vhost-net with experimental_zcopytx=1 on a tap device with a native XDP_DROP program; send one 806-byte packet as 40 descriptors, each in its own page. The descriptor is never returned and close() of the vhost-net fd does not return. With the patch it is returned. Tested in an x86-64 VM with the reproducer and the tun kselftest. Found by the Sashiko AI review bot, as a pre-existing issue while reviewing an unrelated tun patch, and confirmed with the reproducer. Link: https://sashiko.dev/#/bug/linux-f9997fb6-303f-41d6-93e2-60c392b1856f Fixes: 761876c857cb ("tap: XDP support") Signed-off-by: Antonio Quartulli Link: https://patch.msgid.link/20261113232843.2338734-1-antonio@mandelbit.com Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin commit c1a1d59d85194b3684f395743b72c23f5c22b0ab Author: Bart Van Assche Date: Wed Nov 18 15:09:59 2026 -0800 srcu: Make the srcu_dereference_check() reader lock check conditional [ Upstream commit e2652119b5944e7732ff856ba8057afaa28f5ac8 ] Users of srcu_dereference_check() must either hold an SRCU reader lock or satisfy the lockdep condition 'c', e.g. by holding the update-side lock. However, srcu_dereference_check() calls __srcu_read_lock_must_hold(), which tells the Clang context analyzer that the SRCU reader lock must be held. That requirement is too strict for update-side callers. Hence, only call __srcu_read_lock_must_hold() from srcu_dereference_check() if 'c' is the compile-time constant 0, i.e. if there is no update-side protection. Keep the fake RCU acquire and release around __rcu_dereference_check() and also keep the runtime lockdep check in srcu_dereference_check(). Use const_true() instead of __builtin_constant_p() to test whether 'c' is the constant 0. const_true() is based on __is_constexpr(), a sizeof() trick that the compiler front end always evaluates, so the Clang context analysis sees an integer constant expression. If 'c' is a plain variable, function argument or structure member, Clang may leave __builtin_constant_p(c) for the optimizer to decide. The context analysis then considers the __srcu_read_lock_must_hold() call reachable and reports a false positive. Additionally, const_true() never evaluates a non-constant 'c' at runtime, so the runtime behavior does not change. srcu_dereference() passes 0 as 'c' and hence gets the compile-time check automatically. srcu_dereference_notrace() does not accept a lockdep condition and hence may only be used by SRCU readers. Since it passes 1 as 'c', call __srcu_read_lock_must_hold() explicitly from srcu_dereference_notrace() such that the Clang context analysis keeps verifying at compile time that its callers hold the SRCU reader lock. Fixes: f0b7ce22d718 ("srcu: Support Clang's context analysis") Suggested-by: Paul E. McKenney Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Reviewed-by: Paul E. McKenney Link: https://patch.msgid.link/459250d4f2a6aa38ebab3fb51f6d4a63815bb4a1.1795043161.git.bvanassche@acm.org Signed-off-by: Sasha Levin commit 8dd1366680f18a4acefe5e37c1ae81133891cf64 Author: Bart Van Assche Date: Wed Nov 18 15:09:57 2026 -0800 bit_spinlock: Fix the __bitlock() macro definition [ Upstream commit af1a4ab4bf3bcb969ad5ee9e7fca1d23703adf32 ] Surround the 'bitnum' argument and the entire __bitlock() macro expansion with parentheses because 'bitnum' could be an expression that includes an operator with a lower precedence than the addition operator (e.g. the exclusive-or operator) and to prevent operator precedence issues in callers. Fixes: eb7d96a13bf4 ("bit_spinlock: Support Clang's context analysis") Signed-off-by: Bart Van Assche Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Acked-by: Marco Elver Link: https://patch.msgid.link/38cdec9322fa710f84c018e0b318894c6234c411.1795043161.git.bvanassche@acm.org Signed-off-by: Sasha Levin commit ee5f9ff00f711db73f0167b5fb8b0e9403bfac3c Author: Ian Forbes Date: Wed May 27 15:20:18 2026 -0500 ttm/pool: Don't leak LRU list on shutdown [ Upstream commit 5ffdc8f8361387a1b11553e5c95cd589c67a51f2 ] TTM pool was changed from a regular list to an lru list in the referenced fixes commit. list_lru_init allocates state and it needs to be freed unlike a simple list. Found using the igt@core_hotunplug and kmemleak. Fixes: 444e2a19d7fd ("ttm/pool: port to list_lru. (v2)") Signed-off-by: Ian Forbes Reviewed-by: Christian König Signed-off-by: Dave Airlie Link: https://patch.msgid.link/20260527202018.1223912-1-ian.forbes@broadcom.com Signed-off-by: Sasha Levin commit 93b2b69e1654f5faa27436c46ba579a4c9c31a14 Author: Yifan Feng Date: Tue Nov 17 16:32:05 2026 -0800 tracing/fprobe: Do not let KASAN check the $stackN read [ Upstream commit 49276f7c85ba1c140b2605b816a2596d02b36ba4 ] ftrace_regs_get_kernel_stack_nth() reads the Nth entry of the kernel stack for the $stackN argument of fprobe and tracepoint probe events. That entry can be in the redzone of another stack frame, so with CONFIG_KASAN_STACK every hit of such an event is reported: # echo 'f:fp_read vfs_read $stack10' >> dynamic_events # echo 1 > events/fprobes/fp_read/enable BUG: KASAN: stack-out-of-bounds in process_fetch_insn+0xac9/0xcb0 Use READ_ONCE_NOCHECK(), as arm64 does in regs_get_kernel_stack_nth() for kprobe events. Link: https://lore.kernel.org/all/20261118003205.59804-1-evanfengff@gmail.com/ Fixes: 0566cefe73b9 ("tracing/fprobe: Enable fprobe events with CONFIG_DYNAMIC_FTRACE_WITH_ARGS") Signed-off-by: Yifan Feng Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Sasha Levin commit 653be15b2d35efdf38ec2dc04f1a5af86f1543f6 Author: Eduardo Mucelli Rezende Oliveira Date: Sun Nov 22 01:34:58 2026 +0100 tools/bootconfig: Use the registered global tracing parameter names [ Upstream commit 51934668ca98f1b23c51ce4edea3c61018da342c ] The boot-time tracing guide lists four kernel.* keys that do not match the parameters registered by the tracing code. For example, ftrace2bconf.sh emits kernel.fgraph_max_depth, which bootconfig passes as fgraph_max_depth on the kernel command line. The function-graph tracer registers ftrace_graph_max_depth. Use the registered names in the guide and the exporter. Teach bconf2ftrace.sh to read those names, with the previous script keys as fallbacks so existing replay configurations still work. Link: https://lore.kernel.org/all/fecf6e33d4f7e2ddf031526e7a1abef27e28f754.1795307698.git.edumucelli@gmail.com/ Fixes: 47781947947a ("Documentation: tracing: Add boot-time tracing document") Fixes: 7e66ef0046cc ("tools/bootconfig: Add a script to generate ftrace shell-command from bootconfig") Fixes: 2b86062a34a8 ("tools/bootconfig: Add a script to generates bootconfig from ftrace") Signed-off-by: Eduardo Mucelli Rezende Oliveira Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Sasha Levin commit 0682fd5b30dcd6d914f18f581c79aed7735ef541 Author: Kai Vehmanen Date: Fri Nov 20 17:09:36 2026 +0200 ALSA: hda: intel: Release i915 power also when delayed probe fails [ Upstream commit 0a5550dd94e61852941fb37142f4664ecddef312 ] Commit fbaccb1b19c7 ("ALSA: hda: intel: Don't free card in the probe work") stopped freeing the card from azx_probe_work() when the delayed probe fails, and only disconnects it, leaving the free to azx_remove(). This avoids the double free, but the resources that were released by the card free via azx_free() are now kept until the PCI device is unbound. In particular the display power reference stay held, blocking runtime suspend for i915/xe. Release the display power in the azx_probe_continue() work in all cases. This power reference is only taken for the purpose of the display codec probe. If the display codec probe was successful, it will have taken its own reference. In case of systems with the HDA controller on GPU side (hda->need_i915_power), functionality is same as before - we have to keep power. Fixes: fbaccb1b19c7 ("ALSA: hda: intel: Don't free card in the probe work") Reported-by: Michal Grzelak Link: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/17751 Signed-off-by: Kai Vehmanen Link: https://patch.msgid.link/20261120150937.2187228-1-kai.vehmanen@linux.intel.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit 9b3e3a364c458e43219e24fb43452837dc7a63bf Author: Petr Oros Date: Fri Nov 13 15:12:23 2026 -0800 ice: allow reading the last byte of the NVM and Shadow RAM regions [ Upstream commit dc84cae413bdcebfe130803022b8e02abc2ffa83 ] ice_devlink_nvm_read() rejects a read whose end lands exactly on the region size, so feeding back the size devlink itself reports fails: devlink region show pci/0000:04:00.0/nvm-flash pci/0000:04:00.0/nvm-flash: size 10485760 snapshot [] max 1 devlink region read pci/0000:04:00.0/nvm-flash address 0 length 10485760 Error: ice: Cannot read beyond the region size. shadow-ram behaves the same. The regions are created with those sizes, so a read ending on the size is the whole region and has to be allowed. ice_read_flat_nvm() uses > for its own Shadow RAM check, and so does ixgbe, which grew its region support from this code. Fixes: 3af4b40b0f2f ("ice: implement direct read for NVM and Shadow RAM regions") Signed-off-by: Petr Oros Reviewed-by: Przemek Kitszel Acked-by: Jacob Keller Tested-by: Alexander Nowlin Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113231225.1864810-7-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d1e7b2396d6df2141ec44395f8febd4a0cba9126 Author: Michal Swiatkowski Date: Fri Nov 13 15:12:18 2026 -0800 ice: use global queue index in TC to-queue offload [ Upstream commit 9175e1d6d2f0d4f353682833f78188cb35b80e4d ] Previously index within PF was used, which caused rules to fail on any PF other than PF0. Switch to global queue index by adding first RX queue id from caps. Triggered during code development. Validated on HW by adding different set of to queue rules on various PFs Fixes: 143b86f346c7 ("ice: Enable RX queue selection using skbedit action") Reviewed-by: Aleksandr Loktionov Signed-off-by: Michal Swiatkowski Reviewed-by: Simon Horman Tested-by: Alexander Nowlin Signed-off-by: Tony Nguyen Link: https://patch.msgid.link/20261113231225.1864810-2-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 19765d1eaf7eaef0909cee286c97d8570a75f7cc Author: Uri Dar Date: Wed Nov 18 18:51:55 2026 +0200 net/mlx5: E-Switch, skip vport change work for disabled vports [ Upstream commit 890f23ba87a7ca1aba97c8320770a686e3b689fb ] A vport change work can still be pending when its vport is disabled. For an SF, the vport is then freed in FW and the work's query fails with syndrome 0x29d722. A disabled vport has nothing to sync, so skip the work. Fixes: d970812b91d0 ("net/mlx5: E-switch, Add eswitch helpers for SF vport") Signed-off-by: Uri Dar Reviewed-by: Shay Drory Reviewed-by: Mark Bloch Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261118165155.1946097-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d9781566753615a51e42972d91cff8feef1c5a5a Author: Haishuang Yan Date: Mon Nov 16 20:56:19 2026 +0900 net: do not run out of frags in alloc_skb_with_frags() [ Upstream commit 5924465bb4e986eae6809c899ddaf38d3897f55d ] alloc_skb_with_frags() can need more than MAX_SKB_FRAGS frags for a data_len that passed its size check, and then fails with -ENOBUFS: - the tail is split into one frag per bit set in its page count; - after a failed high-order allocation, the order is lowered without checking that the frags left can hold the rest. tun hits this with large GSO packets from a vhost-net guest. Use one larger page for the tail when splitting it would not fit. Only lower the order if the rest still fits, else retry the same order with direct reclaim. If that retry fails too, the allocation still fails. Found while prototyping >64K TSO in a virtio-net guest. Tested with that guest, page allocation fault injection and the KUnit test in patch 2. Fixes: 09c2c90705bb ("net: allow alloc_skb_with_frags() to allocate bigger packets") Signed-off-by: Haishuang Yan Link: https://patch.msgid.link/20261116115620.18151-2-yanhaishuang@cmss.chinamobile.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit f4ec2842d9e221025f986b5cc18d81e55dcd7619 Author: Han Gao Date: Sat Nov 21 18:38:07 2026 +0800 riscv: efi: Map runtime MMIO with device attributes [ Upstream commit 7d49d6e0898680925ea410cbb9d1a6a0e6441462 ] EFI_MEMORY_MAPPED_IO regions are mapped with PAGE_KERNEL, so device registers end up mapped as normal memory. On Milk-V Pioneer, GetTime() reads the clock controller registers and faults: Oops - load access fault [#1] Workqueue: efi_runtime efi_call_rts status: 0000000200000120 badaddr: 0000007030012000 cause: 0000000000000005 Use PAGE_KERNEL_IO for these regions. Fixes: b91540d52a08 ("RISC-V: Add EFI runtime services") Signed-off-by: Han Gao Signed-off-by: Ard Biesheuvel Signed-off-by: Sasha Levin commit 2e9231bd772fdf78d50b10261d6eb6fbdb1918e3 Author: Igor Opaniuk Date: Sat Nov 14 13:46:11 2026 +0100 net: qrtr: ns: keep notifying local servers after a failed send [ Upstream commit d5b89d55a322b632e2b465b392a4c1d9d338db9c ] ctrl_cmd_bye() and ctrl_cmd_del_client() forward the event to every local server, but stop at the first failed send. Each send goes to a different socket, so a single server with a full receive queue (-ENOSPC) hides the event from all servers after it. Log the failure and carry on. Likewise, keep notifying local lookups when the NEW_SERVER broadcast fails, which can only happen on -ENOMEM. Tested on the Arduino UNO Q (QRB2210). Fixes: 0c2204a4ad71 ("net: qrtr: Migrate nameservice to kernel from userspace") Signed-off-by: Igor Opaniuk Link: https://patch.msgid.link/20261114-upstream-qrtr-hello-gate-fix_b4-v2-1-2fb62c2853bb@oss.qualcomm.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 8e62c0fd56c28dcb3ef859bc0535ae612582df3f Author: Xiangwu Lai Date: Thu Nov 19 15:16:10 2026 +0800 scsi: ufs-mediatek: Restore the M-PHY power state when va09 disable fails [ Upstream commit 71b5da0b45fb83b590f1ec3df5361c7754b0e113 ] In ufs_mtk_mphy_power_on(), the power-off path tears the M-PHY down in two steps before regulator_disable() is called: phy_power_off() puts the PHY PLL and its clocks down, and ufs_mtk_va09_pwr_ctrl() asks the firmware to drop the VA09 supply. If regulator_disable() then fails, the M-PHY stays physically off while host->mphy_powered_on is left set, so the next power-on attempt bails out through the !(on ^ host->mphy_powered_on) check and never powers the M-PHY back up, leaving the UFS host with an unpowered PHY (I/O timeouts, controller lockups). Simply forcing mphy_powered_on to false would trade this for two more problems. First, the regulator core drops the consumer enable count only after a successful disable, so the count stays at 1, the next power-on raises it to 2 and it never returns to zero: va09 is then never physically disabled and the devm-acquired regulator would hit WARN_ON(enable_count) again on release. Second, when the power-off fails during ufs_mtk_suspend(), the error recovery in __ufshcd_wl_suspend() runs ufshcd_host_reset_and_restore() without powering the M-PHY back on, which would run against an unpowered PHY. (Both points were raised by the Sashiko AI review of v2.) Since the va09 regulator stays enabled when its disable fails, restore the M-PHY power state instead: power the PHY back on through ufs_mtk_va09_pwr_ctrl() and phy_power_on() and leave mphy_powered_on set. The next power-off attempt then retries the full sequence and the enable count stays balanced. Found by code inspection while reviewing the va09 error paths of the driver; the failure has not been observed on real hardware. Suggested-by: Peter Wang Link: https://lore.kernel.org/r/sashiko-outbox-220026@kernel.org Fixes: cf137b3ea49a ("scsi: ufs-mediatek: Support VA09 regulator operations") Signed-off-by: Xiangwu Lai Reviewed-by: Peter Wang Link: https://patch.msgid.link/20261119071611.117-3-laixiangwu@cmss.chinamobile.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit 69127b93bbd5f835892c8709c6863a3f0af0d7d4 Author: Xiangwu Lai Date: Thu Nov 19 15:16:09 2026 +0800 scsi: ufs-mediatek: Use devm_regulator_get() for the va09 regulator [ Upstream commit def1745a6a8bc44b39e8670c737c27fd38b3595c ] ufs_mtk_init_va09_pwr_ctrl() obtains the va09 regulator with regulator_get() but the reference is never released with regulator_put(), neither on driver unbind nor on probe failure. The other regulators handled by this driver (dvfsrc-vcore) are already obtained with devm_regulator_get_optional(). Use devm_regulator_get() so that the reference is released automatically when the UFS device is detached. This alone is not enough, though: ufs_mtk_init() powers the M-PHY on, which enables the va09 regulator, and nothing powers it off again on the way out. The variant operations have no .exit callback and ufshcd_pltfrm_remove() only resumes the device. The devm release would then hit WARN_ON(regulator->enable_count) in _regulator_put() and leak the enable reference. Balance the use count by adding an .exit callback which powers the M-PHY off, in the same spirit as the .exit callbacks of ufs-exynos and ufs-qcom. ufshcd_hba_exit() invokes it both on driver unbind and on ufshcd_init() failure after the variant init, so the enable count is always balanced by the time devm releases the regulator. It relies on the state tracking in ufs_mtk_mphy_power_on() and is a no-op if the M-PHY was never powered on. Fixes: cf137b3ea49a ("scsi: ufs-mediatek: Support VA09 regulator operations") Reviewed-by: Peter Wang Signed-off-by: Xiangwu Lai Link: https://patch.msgid.link/20261119071611.117-2-laixiangwu@cmss.chinamobile.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit ea450c46164160a5d68ed024fac05cdcb6a9a3af Author: Dimitri Daskalakis Date: Tue Nov 17 13:54:14 2026 -0800 eth: fbnic: skip freed Tx rings in fbnic_get_ts_stats() [ Upstream commit 729f807b58f6ed646b81cf7fd7939b2271daa33f ] fbnic_stop() frees the NAPI vectors, which clears fbn->tx[] while num_tx_queues is left unchanged. fbnic_get_ts_stats() walks fbn->tx[] without checking for NULL, so asking for timestamping statistics while the interface is down dereferences a NULL ring. This was found by AI and reproduced on HW. # ip link set dev eth0 down; ethtool -I -T eth0 BUG: kernel NULL pointer dereference, address: 0000000000000050 RIP: 0010:fbnic_get_ts_stats+0x38/0x60 Call Trace: tsinfo_prepare_data+0x82/0xb0 ethnl_default_doit+0x213/0x470 genl_family_rcv_msg_doit+0xdd/0x110 ... Fixes: 96f358f75d1a ("eth: fbnic: add ethtool timestamping statistics") Signed-off-by: Dimitri Daskalakis Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261117215416.1901246-4-dimitri.daskalakis1@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit bf9f56320746ec95806459974fba9dd0bf668a3a Author: Dimitri Daskalakis Date: Tue Nov 17 13:54:13 2026 -0800 eth: fbnic: skip disabled Tx rings when setting the queue NAPI [ Upstream commit 561175f45a23527d2853e2b745d40bf963e87dce ] When Rx and Tx channels are not combined, each Rx vector gets a Tx triad whose sub0 is disabled with a q_idx of 0. fbnic_set_netif_napi() and fbnic_reset_netif_napi() don't skip it, so every Rx vector associates Tx queue 0 with its own NAPI, and the netlink queue info reports the wrong NAPI for Tx queue 0. This bug was found by AI and verified on HW. Reproduced with "ethtool -L eth0 combined 0 rx 34 tx 34", and reading the NAPI IDs with "ynl --family netdev --dump queue-get": before: tx 0 napi-id 580, tx 1 napi-id 514, rx 33 napi-id 580 ^^^ rx 33's NAPI, not vector 0's after: tx 0 napi-id 513, tx 1 napi-id 514, rx 33 napi-id 580 Fixes: cf4facfb132a ("eth: fbnic: Add support for XDP queues") Signed-off-by: Dimitri Daskalakis Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261117215416.1901246-3-dimitri.daskalakis1@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d0c7adb9c9e66f1c50df690ea16b9e2f4f4a8cf4 Author: Dimitri Daskalakis Date: Tue Nov 17 13:54:12 2026 -0800 eth: fbnic: wait on the correct queues in fbnic_queue_stop() [ Upstream commit 7bc16d84facd37b44ff508d4970bac6636329eb9 ] fbnic_queue_stop() waits for every queue of the NAPI vector to go idle before tearing it down, using sub0.q_idx as the queue index. We set q_idx on submission queues for Tx, and completion queues on Rx, so this waits on queue 0 for every Rx queue. For non-combined channels, stopping an Rx queue always stops/wakes Tx queue 0. Set the queue id on Tx completion rings so we don't have to distinguish between ring types to get the correct queue id, and don't stop/wake disabled rings. This bug was found by AI and verified on HW. Reproduced by binding a devmem dmabuf to one Rx queue (netdev bind-rx). Added a printk to fbnic_wait_queue_idle(), and traced Tx queue stop/wake with bpftrace. combined 79, bind rxq 1: before: netif_stop_subqueue(1) fbnic_wait_queue_idle(tx, 1) fbnic_wait_queue_idle(rx, 0) netif_wake_subqueue(1) after: netif_stop_subqueue(1) fbnic_wait_queue_idle(tx, 1) fbnic_wait_queue_idle(rx, 1) netif_wake_subqueue(1) rx 34 tx 34, bind rxq 5: before: netif_stop_subqueue(0) fbnic_wait_queue_idle(tx, 0) fbnic_wait_queue_idle(rx, 0) netif_wake_subqueue(0) after: fbnic_wait_queue_idle(tx, 39) fbnic_wait_queue_idle(rx, 5) ^ no more stop/wake of Tx queue 0 (tx 39 is the XDP Tx queue of rxq 5's vector, Rx queues always get an XDP Tx queue) Fixes: da43127a8edc ("eth: fbnic: support queue ops / zero-copy Rx") Signed-off-by: Dimitri Daskalakis Reviewed-by: Björn Töpel Link: https://patch.msgid.link/20261117215416.1901246-2-dimitri.daskalakis1@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 181579d9b29ceb4e1b79bc3511b1970ffa3b9d22 Author: Yevgeny Kliteynik Date: Wed Nov 18 19:32:27 2026 +0200 net/mlx5: DR, Fix out-of-bounds write when sync to HW fails [ Upstream commit 0e56ff4441eea333bfbfeff86ef39038f6e8c378 ] mlx5dr_icm_free_chunk() moves a freed chunk to the "hot" chunks array by writing it to hot_chunks_arr and, once the accumulated hot memory crosses a threshold, triggers a sync to HW that flushes the array. The array is large enough to hold the chunks of a single accumulation cycle, and relies on the sync path to flush it. However, if sync to HW fails, hot chunks array is not cleared, and every subsequent mlx5dr_icm_free_chunk will write past the end of hot_chunks_arr, resulting in an out-of-bounds write and kernel heap corruption. A failed sync to HW also means it is no longer safe to recycle ICM: a chunk's memory may only be returned to the buddy allocator (and thus be reused) after a sync has confirmed that HW no longer references it. The issue was discovered by a fuzzer that repeatedly triggered sync failure, at which point the out-of-bounds write was reported by KASAN: KASAN log excerpt: BUG: slab-out-of-bounds in mlx5dr_icm_free_chunk+0x4cd at call 2 (hot_chunks_num=3 > cap=2). Fix this by putting the pool into an error state on the first failed sync to HW, reporting the failure once. The sync is not retried, and while the pool is in this state: - mlx5dr_icm_free_chunk() doesn't queue freed chunks; the segment is left reserved and is reclaimed when the pool is destroyed. - mlx5dr_icm_alloc_chunk() doesn't serve new chunks. Fixes: 4519fc45beeb ("net/mlx5: DR, Keep track of hot ICM chunks in an array instead of list") Signed-off-by: Yevgeny Kliteynik Reviewed-by: Alex Vesker Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261118173227.1957670-3-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 373eb2e4ad67f34cd974b6b2659b0def241623ac Author: Yevgeny Kliteynik Date: Wed Nov 18 19:32:26 2026 +0200 net/mlx5: HWS, Handle NULL in vport destination action creation [ Upstream commit c0ec15a586556c11583d8e336c3963c231c379c3 ] mlx5hws_action_create_dest_vport() can return NULL. If this happens, xa_insert() will insert a NULL entry into the xarray. The next mlx5hws_action_create_dest_vport() failure will try to insert NULL again, but xa_insert() will return -EBUSY, because we already have NULL entry. In such case the code will go into error flow of action creation, and eventually will cause NULL dereference at hws_action_destroy_hws(). The issue was discovered by code inspection. Fixes: 8e2e08a6d1e0 ("net/mlx5: fs, add support for dest vport HWS action") Signed-off-by: Yevgeny Kliteynik Signed-off-by: Alex Vesker Reviewed-by: Erez Shitrit Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261118173227.1957670-2-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 4007f8292918eeb1e909437903746102167136d5 Author: Eric Dumazet Date: Tue Nov 17 20:06:12 2026 +0530 net: clear skb->mac_len in skb_unset_mac_header() [ Upstream commit 7a505bb0168a132c2a3ab4efff4c6d6474ca3aa1 ] skb_unset_mac_header() marks the mac header as unset but leaves skb->mac_len alone, so an skb can end up with no mac header and a non-zero mac_len. Code that uses mac_len to decide whether a mac header is present is then misled. end_dt_vrf_rcv() (SRv6 End.DT4/End.DT6) unsets the mac header of the decapsulated packet so that the VRF device can rebuild it. The VRF device only does so when a packet sniffer is attached, so without one the skb continues up the stack with mac_len == 14. In xfrm4_remove_tunnel_encap() and xfrm6_remove_tunnel_encap(), skb_mac_header_rebuild() is a no-op for such an skb, and the following if (skb->mac_len) eth_hdr(skb)->h_proto = skb->protocol; writes two bytes at skb->head + 0xffff + offsetof(struct ethhdr, h_proto): BUG: KASAN: slab-out-of-bounds in xfrm4_remove_tunnel_encap+0x17d/0x220 Write of size 2 at addr ffff88805f85800b by task syz-executor/10831 xfrm4_remove_tunnel_encap xfrm_input xfrm4_esp_rcv ip_protocol_deliver_rcu ip_local_deliver_finish seg6_local_input_core lwtunnel_input __netif_receive_skb netif_receive_skb tun_rx_batched tun_get_user __input_process_payload() in net/xfrm/xfrm_iptfs.c has the same three lines and reported as a use-after-free rather than an out-of-bounds. The address written is fixed relative to skb->head, so what it lands in is whatever the allocator placed sixteen pages past the skb: a live object gives slab-out-of-bounds, a freed one or a page back on the buddy free list gives use-after-free, and a different live object gives no report at all. Clearing mac_len at the source makes the guard false at all three sites. Clear mac_len in skb_unset_mac_header() so that all callers leave the skb in a consistent state, and remove the now redundant assignment in skb_carve_reset_headers(). The other callers are on egress paths (__bpf_redirect_neigh(), bpf_lwt_push_ip_encap()) or only reach the helper when the mac header was already unset (bpf_update_srh_state()), and do not read mac_len afterwards. vrf_prepare_mac_header(), the rebuild end_dt_vrf_rcv() unsets the header for, pushes ETH_HLEN and then calls skb_reset_mac_header() and skb_reset_mac_len(), so it recomputes mac_len itself and never reads the stale value. The issue was reported on the list by Piyus Kedia and Kapil Vaswani, who found it by fuzzing with AI assistance and reproduced the KASAN splat on v7.4-rc3. Their reproducer was not published. Fixes: 664d6f86868b ("seg6: add support for the SRv6 End.DT4 behavior") Reported-by: Piyus Kedia Reported-by: Kapil Vaswani Closes: https://lore.kernel.org/netdev/20261116174531.2540348-2-piyus@iiitd.ac.in/ Suggested-by: Kapil Vaswani Suggested-by: Piyus Kedia Tested-by: Piyus Kedia Signed-off-by: Eric Dumazet Signed-off-by: Piyus Kedia Link: https://patch.msgid.link/20261117143612.95112-1-piyus@iiitd.ac.in Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d24ba3abc9c0aef6e9c4225b3ba743b284621403 Author: Gal Pressman Date: Wed Nov 18 16:36:53 2026 +0200 net/mlx5e: Release FIB event work flows before dropping RTNL [ Upstream commit bfccb4e44e4725270ccef366078d7b6063920ff3 ] The FIB event work, neigh update work and the neigh stats work all use flow->tmp_list to hold the encap flows they work on, while RTNL is what keeps them from using it at the same time. mlx5e_tc_fib_event_work() drops RTNL before it is done with its list. A neigh work can then take the same flows while the FIB work is still walking them, and the two overwrite each other's list. Release the flow list before dropping RTNL. The issue was hit once in our regression testing (OVS connection tracking with the VXLAN endpoint on a VF, KASAN build): BUG: KASAN: stack-out-of-bounds in mlx5e_flow_put+0x23/0x80 [mlx5_core] Write of size 4 at addr ffff8881226d7b20 by task kworker/u40:1/20171 Workqueue: mlx5e mlx5e_tc_fib_event_work [mlx5_core] Call Trace: mlx5e_flow_put+0x23/0x80 [mlx5_core] mlx5e_put_flow_list+0x82/0xe0 [mlx5_core] mlx5e_tc_fib_event_work+0x704/0x1fb0 [mlx5_core] process_one_work+0x8df/0x1660 The race was also reproduced with an msleep() inserted between rtnl_unlock() and mlx5e_put_flow_list() to widen the window, a VXLAN encap rule whose endpoint IP is on a VF, and route churn on the endpoint address. Fixes: 8914add2c9e5 ("net/mlx5e: Handle FIB events to update tunnel endpoint device") Signed-off-by: Gal Pressman Reviewed-by: Jianbo Liu Signed-off-by: Tariq Toukan Link: https://patch.msgid.link/20261118143653.1915247-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 92db5cad834f98d1cc0d0f6efddde4957f46eb94 Author: Imre Kaloz Date: Mon Nov 16 00:08:12 2026 +0100 net: marvell: prestera: disable port before changing its MAC mode [ Upstream commit fdb6fcabdbb8247f1647d54fb1b9dc3575d7fcc8 ] prestera_pcs_config() writes a new mode, speed or inband setting to an enabled port. The firmware can then report link down until the port is disabled and enabled again. Disable the port before such a write. 2500BASE-X and SGMII share one MAC mode, so SGMII sets its own speed and the speed is compared as well. Exercising this needs a link partner, so no in-tree test covers it. Before this patch, the SFP+ ports (S-RJ01 module in sfp-52) on a Delta TN48M (98DX3265) with firmware 4.1.0 come up in 21 of 30 attempts. 30 out of 30 with the patch. Fixes: 52323ef75414 ("net: marvell: prestera: add phylink support") Signed-off-by: Imre Kaloz Reviewed-by: Elad Nachman Link: https://patch.msgid.link/20261115230812.29644-1-kaloz@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit e6059bbd47bf74c11c60004579de68ea050e2806 Author: Jiayuan Chen Date: Sun Nov 15 22:45:07 2026 +0800 ipv6, calipso: fix data-race in calipso_cache_add() bucketsize check [ Upstream commit 18a7abf1a0b168ea6a50f08562de2f286d6f5a86 ] Issue found by sashiko when reviewing my data-races patch [1]. This is not a plain READ_ONCE() annotation like the rest of that series but a real fix, so it is sent separately. calipso_cache_add() reads calipso_cache_bucketsize twice: the "<= 0" guard on entry, then the "size < bucketsize" test after taking the bucket lock. A writer can flip it to 0 in between: CPU0 CPU1 calipso_cache_add() calipso_cache_bucketsize == 10 (> 0) proc_dointvec() calipso_cache_bucketsize = 0 spin_lock_bh(&bucket.lock) size(0) < calipso_cache_bucketsize(0) -> false -> else branch, but the bucket is empty On an empty bucket the else branch takes list.prev (the list head itself), list_del()s it and then list_add()s through the now poisoned head: Oops: general protection fault, probably for non-canonical address 0xdead000000000108 RIP: 0010:calipso_cache_add+0x2f0/0x380 Call Trace: calipso_cache_add+0x4c/0x70 netlbl_cache_add+0x4a/0xa0 selinux_netlbl_skbuff_getsid+0x1ac/0x280 selinux_skb_peerlbl_sid+0x7d/0x100 selinux_socket_sock_rcv_skb+0x2d3/0x460 security_sock_rcv_skb+0x86/0x150 sk_filter_trim_cap+0x56/0x730 sock_queue_rcv_skb_reason+0x1e/0x80 rawv6_rcv+0x679/0xb20 raw6_local_deliver+0x1f0/0x5b0 ip6_protocol_deliver_rcu+0x215/0x9a0 ip6_input_finish+0xb0/0x1b0 ip6_input+0xa8/0x250 ipv6_rcv+0x14b/0x1c0 __netif_receive_skb_one_core+0x8f/0xe0 __netif_receive_skb+0x23/0xb0 process_backlog+0x27a/0x950 __napi_poll.constprop.0+0x61/0x2c0 net_rx_action+0x372/0x800 handle_softirqs+0x109/0x570 __do_softirq+0x10/0x18 do_softirq.part.0+0x47/0xd0 __local_bh_enable_ip+0xf0/0x120 __dev_queue_xmit+0x578/0x23f0 neigh_resolve_output+0x278/0x3c0 ip6_finish_output2+0x4b1/0xcb0 ip6_finish_output+0x2b6/0x6b0 ip6_output+0x122/0x400 ip6_local_out+0x61/0xb0 ip6_send_skb+0xa0/0x260 ip6_push_pending_frames+0x2b/0x40 rawv6_sendmsg+0x1b7a/0x2750 inet_sendmsg+0xa1/0xb0 __sys_sendto+0x2fe/0x350 __x64_sys_sendto+0x7f/0xb0 do_syscall_64+0xe1/0x450 entry_SYSCALL_64_after_hwframe+0x76/0x7e Snapshot the sysctl into a local once and use it for both tests, like cipso_v4_cache_add() has since commit dd44f04b9214 ("cipso: Fix data-races around sysctl."). [1] https://lore.kernel.org/netdev/179428999963.994134.16904544500890053668@kernel.org/ Fixes: 4fee5242bf41 ("calipso: Add a label cache.") Signed-off-by: Jiayuan Chen Acked-by: Paul Moore Link: https://patch.msgid.link/20261115144508.71543-1-jiayuan.chen@linux.dev Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 98f9cc31ce4224ef7b3e9cbfb703456d75274ca8 Author: Jingxuan Xie Date: Wed Nov 18 13:54:43 2026 +0000 af_packet: avoid waiting for TPACKET_V3 copies at retirement [ Upstream commit d7f2d9b6c7d0ff0af7d19d889810d35dfe07da90 ] TPACKET_V3 retires a full or expired block while holding sk_receive_queue.lock. prb_retire_current_block() takes blk_fill_in_prog_lock for write to wait for in-flight skb_copy_bits() before publishing the block. On PREEMPT_RT a read lock can be held by a task that has been preempted or is running on another CPU. The packet path or the retirement timer then blocks on the write lock while holding sk_receive_queue.lock, and the receive path resumes only after the copy completes. This was observed as a receive stall of hundreds of milliseconds in a PREEMPT_RT deployment; manual inspection found the same unconditional write_lock() in both the full-block and the timer retirement paths. Try to take the write lock without blocking on PREEMPT_RT. If a copy is still in progress, leave the current block and its metadata untouched: - the retirement timer re-arms itself and retries after the configured interval; - packet allocation returns NULL, so tpacket_rcv() drops this capture record and accounts it in tp_drops, while the original packet remains in the network stack; - a later packet can retire the block once the copier has finished. Do not dispatch the next block while the current block is still open. The existing lock order and completion ordering are preserved, and no new state or worker is introduced. The trade-off is a higher capture drop rate while a copy is in progress; original traffic is unaffected. Non-PREEMPT_RT kernels keep the unconditional write_lock(): there read_lock() disables preemption, so the writer only waits for the copy to finish, not for a scheduled-out task to run again. The stall was reproduced on QEMU arm64 SMP PREEMPT_RT by delaying a copier after frame reservation: without this change the next sender blocks until the copier is released, with this change only that capture record is dropped. Fixes: 632ca50f2cbd ("af_packet: TPACKET_V3: replace busy-wait loop") Signed-off-by: Jingxuan Xie Reviewed-by: Willem de Bruijn Link: https://patch.msgid.link/20261118135443.24767-1-jingxuanxie@deeproute.ai Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit df94ff3ee03028afc5933a9e7eaac0615762ec94 Author: chris@kode54.net Date: Fri Nov 20 04:03:47 2026 -0800 ALSA: usb-audio: Ignore trailing whitespace in quirk_flags [ Upstream commit 9d30450b6ac8cfc827be3d38f4f5ee86f68687ad ] Writing a flag name to the quirk_flags module parameter through sysfs with echo leaves a trailing newline on the string. The parser keeps it as part of the last flag name, so a valid flag is rejected: snd_usb_audio: unknown flag SKIP_IFACE_SETUP while parsing param quirk_flags Numeric flags are not affected because kstrtou64() accepts a trailing newline. Strip leading and trailing whitespace before parsing. Fixes: ffd586126a82 ("ALSA: usb-audio: improve module param quirk_flags") Assisted-by: AI Signed-off-by: Christopher Snowhill Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20261120120356.10909-2-chris@kode54.net Signed-off-by: Sasha Levin commit 63a09baf3c68844f78a17712e60f873182aacefa Author: Takashi Iwai Date: Thu Nov 19 13:23:52 2026 +0100 ALSA: pcm: Fix potential ABBA deadlock at snd_pcm_action_nonatomic() [ Upstream commit bedefcbb8a0827e2758d6fc4a0601756eba7c248 ] snd_pcm_action_nonatomic() is called for PCM PREPARE and other operations, and the function takes snd_pcm_buffer_access_lock() of the given substream (that takes runtime->buffer_mutex internally) at first, followed by the call of snd_pcm_action_group() that takes buffer_mutex of other substreams in the same link group again. Recently Sashiko suggested it may lead to an ABBA deadlock when two different substreams in the same PCM link call it concurrently: CPU0 CPU1 ---- ---- lock(&A->runtime->buffer_mutex) lock(&B->runtime->buffer_mutex) lock(&B->runtime->buffer_mutex) lock(&A->runtime->buffer_mutex) This patch tries to address the potential deadlock. Instead of taking the buffer_mutex of the target substream at first and processing the rest in the loop, take the whole buffer_mutex for each in the loop. This assures the order of the nested mutexes -- the linked list itself is kept intact by the read_rwsem() around snd_pcm_action_nonatomic(). Also, this changes the action in the snd_pcm_action_group() loop from the direct call of mutex_lock(buffer_mutex) to snd_pcm_buffer_access_lock(). This prevents the unexpected state transition or the buffer access during the action, too. Since the target substream is no longer locked before the loop, the lockdep subclass for buffer_mutex in the loop now starts from 0, so that a link group of N substreams uses the subclasses 0..N-1 as before. The subclass for the stream lock case still starts from 1, as the caller holds the target stream lock at subclass 0. Note that this change might have a slight side-effect, though: when some concurrent operations happen during the PREPARE or RESET, now it may return -EBUSY. But this can be seen rather as an expected behavior that was overlooked before the fix. Fixes: 3c3201f8c7bb ("ALSA: pcm: Fix races among concurrent prepare and hw_params/hw_free calls") Reported-by: sashiko-bot@kernel.org Closes: https://lore.kernel.org/sashiko-outbox-221145@kernel.org Signed-off-by: Takashi Iwai Link: https://patch.msgid.link/20261119122356.2134523-2-tiwai@suse.de Signed-off-by: Sasha Levin commit 4f60f1401a8f047f03e4d4a06083154c15c0cb42 Author: Kiran K Date: Fri Nov 20 15:12:49 2026 +0530 Bluetooth: btintel_pcie: Fold MAC_INIT into btintel_pcie_get_mac_access() [ Upstream commit 4fe38719e6738feaa90486e36b0790dd5d960a96 ] MAC_INIT and MAC_ACCESS_REQ are the function control register bits required to acquire MAC access for target reads. Currently, MAC_INIT is set separately by btintel_pcie_mac_init(), which is called right before btintel_pcie_read_device_mem() in btintel_parse_mbox_tlv(), btintel_pcie_read_hwexp() and btintel_pcie_dump_fwtrigger_event(). btintel_pcie_dump_traces() also reads device memory under MAC access, but it never called btintel_pcie_mac_init(), so MAC_INIT was missing on the coredump path. Fold the MAC_INIT handling into btintel_pcie_get_mac_access() so that every user of MAC access programs MAC_INIT. Set MAC_INIT and MAC_ACCESS_REQ with a single register write when either bit is not already set. Drop btintel_pcie_mac_init() along with its three call sites. This also fixes btintel_pcie_dump_traces(). Fixes: 07e6bddb54b4 ("Bluetooth: btintel_pcie: Add support for device coredump") Assisted-by: Copilot:Gemini 4 Argon Reviewed-by: Paul Menzel Signed-off-by: Kiran K Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit f1c9530179ea5335f2a2b5b9a84203e5b9800717 Author: Kiran K Date: Fri Nov 20 15:12:48 2026 +0530 Bluetooth: btintel_pcie: Set only MAC_INIT in btintel_pcie_mac_init() [ Upstream commit b535edbf51782cc38acc2e7a6f5ff590ab865c27 ] btintel_pcie_mac_init() is called prior to reading device memory via target access. To acquire MAC access, only the MAC_INIT and MAC_ACCESS_REQ bits in the function control register need to be programmed. Currently, btintel_pcie_mac_init() also modifies FUNC_ENA, FUNC_INIT, BUS_MASTER_DISCON, and SW_RESET, which are not relevant to MAC access (though doing so had no observed side effects). Leave those bits untouched and only set MAC_INIT if it is not already set. Fixes: b9465e6670a2 ("Bluetooth: btintel_pcie: Read hardware exception data") Assisted-by: Copilot:Gemini 4 Argon Reviewed-by: Paul Menzel Signed-off-by: Kiran K Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit fe0168bd8975969110f0facab49882c5f2c839f3 Author: Thomas de Gruijter Date: Fri Nov 20 02:13:36 2026 +0100 Bluetooth: MSFT: Only enable the advertisement filter with monitors [ Upstream commit 4a8f9b7fb4f503f48e2ccfc67caa8b07d303f8a8 ] msft_do_open() unconditionally enables the MSFT LE advertisement filter on every power on, whether or not any advertisement monitor is registered. On MediaTek MT7922 (USB 0e8d:0616, firmware build 20260724) the controller then drops every LE advertisement: LE Set Extended Scan Enable succeeds, but no LE Extended Advertising Report is ever delivered, so LE discovery and passive scanning find nothing. BR/EDR inquiry is not affected. Sending LE Set Advertisement Filter Enable with Enable set to 0x00 restores reporting immediately. The Microsoft HCI extension specification defines the filter as disabled by default and does not specify what a controller reports while the filter is enabled without any monitor condition. Only enable the filter while at least one monitor is offloaded to the controller, and update it after a monitor is added or removed and after the monitors are re-registered on power on and resume. Like the monitors, the filter state does not survive a power off, so reset the tracked state in msft_do_close() instead of sending a redundant disable on power on. A command is only sent when the wanted state differs from msft->filter_enabled, so this depends on the previous patch keeping that state accurate when the controller reports the filter as already being in the requested state. Fixes: 394566bf1e37 ("Bluetooth: advmon offload MSFT handle filter enablement") Signed-off-by: Thomas de Gruijter Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 1bad236062e5ecd548bf9fe51525eae9c021133c Author: Thomas de Gruijter Date: Fri Nov 20 02:13:35 2026 +0100 Bluetooth: MSFT: Record the filter state on Command Disallowed [ Upstream commit 75d6b9d82c35d35dad9fdd783975be1edd32fe2f ] msft_le_set_advertisement_filter_enable_cb() treats status 0x0C (Command Disallowed) as success: a controller returns it when the advertisement filter is already in the requested state, and some controllers start with the filter enabled. Since commit 493ea69970e2 ("Bluetooth: Convert MSFT filter HCI cmd to hci_sync") the callback is passed the return value of __hci_cmd_sync_status() instead of the HCI status. That function reports Command Disallowed as -EBUSY, so the 0x0C branch is never taken and msft->filter_enabled keeps its old value whenever the filter was already in the requested state. msft_set_filter_enable() also always returns 0, hiding real errors from its callers. Pass the error code to the callback, treat -EBUSY as the filter already being in the requested state, and return real errors from msft_set_filter_enable(). Nothing reads msft->filter_enabled yet, but the next patch relies on it to decide when to change the filter state. The problem was found, with the help of an AI coding assistant (Claude Code with Claude Opus 5.5). Fixes: 493ea69970e2 ("Bluetooth: Convert MSFT filter HCI cmd to hci_sync") Signed-off-by: Thomas de Gruijter Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit f366b17fdc8d88cc5441329d94eaa9c0e606131c Author: Jiale Yao Date: Sat Oct 3 16:11:52 2026 +0800 usb: cdns3: report endpoint reset timeout [ Upstream commit 8f51823de3c9184fd8b7a4430a030eb071f39dae ] cdns3_gadget_ep_disable() discards the endpoint reset poll result and then tests ret, which is still zero. A reset timeout is therefore neither reported nor returned to the caller. Store the poll result in ret so the existing diagnostic and return path expose the timeout. Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") Signed-off-by: Jiale Yao Add: stable@kernel.org Acked-by: Peter Chen Link: https://patch.msgid.link/20261003081152.433499-1-yaojiale02@163.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin commit bf784d3a25b5687ac6e58f232c2b03d723ca03b2 Author: Sang-Hoon Choi Date: Tue Sep 22 03:49:28 2026 +0900 HID: nintendo: release the player ID when LED setup fails [ Upstream commit 10bc1d627c297097cfdc099377f8a13efdfffd86 ] joycon_leds_create() allocates a player ID before allocating the LED names and registering the LEDs. If one of those later steps fails, nintendo_hid_probe() jumps to err_io_stop and skips the ID cleanup. The failed probe leaves the allocated ID in nintendo_player_id_allocator. Use err_ida for this failure, as the power supply and input setup error paths already do. If the ID allocation itself failed, player_id is U32_MAX and ida_free() leaves the allocator untouched. Fixes: 5307de63d71d ("HID: nintendo: use ida for LED player id") Reported-by: Changyul Lee Assisted-by: LLM Signed-off-by: Sang-Hoon Choi Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit 9ca5bd83fd0c082fa460f5276e9b1b0f5db87bcc Author: Mathias Krause Date: Thu Nov 5 18:01:16 2026 +0100 HID: Intel-thc-hid: Fix REGMAP dependency [ Upstream commit 914d46521de1bdd999fb4c6263172c13b2164218 ] intel-thc-{dev,dma}.c make use of the regmap API and related data structures, breaking the build if CONFIG_REGMAP isn't set. Fix that by forcibly enabling REGMAP when this driver gets build. Fixes: 1b2d05384c29 ("HID: intel-thc-hid: Add basic THC driver skeleton") Signed-off-by: Mathias Krause Reviewed-by: Even Xu Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit 20480ea63fce387fd6606c2f78bd5637e42f5baa Author: Eren Çakar Date: Fri Nov 13 11:05:10 2026 +0000 HID: letsketch: skip string descriptors the firmware does not implement [ Upstream commit f2f69bbddd34801cbf6af2e89235ca427f3811c5 ] The Starcom GC-422 is a rebranded LetSketch WP9620C with the same USB ID (6161:4d15), so it binds to this driver. Its firmware ("Vision_V201_180530") does not implement every string descriptor index that the raw mode handshake reads. For those indices usb_string() keeps returning an empty string or -EPIPE, letsketch_get_string() gives up after its retries, and the probe fails: letsketch ...: probe with driver letsketch failed with error -5 The tablet then does not work at all. The handshake only needs the reads to happen, not their contents. Once the retries are used up, report an index that still reads as empty or STALLs as missing with -ENOENT, and let the probe skip it. Other errors still fail the probe as before, and the retries stay in place, so firmware that only fails a read now and then behaves as it did. With this change the GC-422 completes the handshake, switches to raw mode and reports pen position, pressure and the five pad buttons. The change and this message were written with the help of an AI coding assistant (Claude Code); I reviewed them and tested the result on the hardware. Fixes: 33a5c2793451 ("HID: Add new Letsketch tablet driver") Signed-off-by: Eren Çakar Reviewed-by: Hans de Goede Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit 84d6dfee19bec682da7a02e493eb03f7faabde52 Author: Srinivas Pandruvada Date: Mon Nov 9 11:59:49 2026 -0800 HID: sensor-hub: Remove clients before stopping hardware [ Upstream commit 41cb3076a221afba052ae1624ccf62e500706b20 ] Remove MFD clients before stopping the HID hardware so their close calls remain valid. Runtime-PM teardown may cancel a pending autosuspend without running the client suspend callback, leaving hub references after child removal. Clients share one HID open while ref_cnt is nonzero. After removing the children, drain any remaining references and call hid_hw_close() once if the count is nonzero. Then stop the HID hardware. This avoids both a leaked open and the underflow caused by an unconditional close. The pending-request walk runs before hid_hw_stop() disconnects HID-core children such as hidraw. Skip non-platform children and platform children without sensor-hub data before checking pending request state. Fixes: 1df3a401154a ("HID: Delay opening HID device") Reported-by: Semyon Maryasin Closes: https://lore.kernel.org/all/CAM2dg7ewfVJSP4rFyhkCB1Rmd1+X56sAg=eUdbPthG2xrLqwQQ@mail.gmail.com/ Tested-by: Semyon Maryasin Tested-by: Zhang Lixu Signed-off-by: Srinivas Pandruvada Reviewed-by: Jonathan Cameron Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit baf073234b46419e74d76310fd94026b6cdb9ccc Author: Srinivas Pandruvada Date: Mon Nov 9 11:59:48 2026 -0800 HID: sensor: custom: Register enable attribute after misc device [ Upstream commit c6ebe27e3ba09edf956139c741b38e8432be3f67 ] Register the enable_sensor sysfs group only after misc-device setup succeeds. This prevents userspace from opening the sensor hub while probe can still fail, which would otherwise leave the hub open reference unbalanced on unwind. Fixes: 4a7de0519df5 ("HID: sensor: Custom and Generic sensor support") Reported-by: Semyon Maryasin Closes: https://lore.kernel.org/all/CAM2dg7ewfVJSP4rFyhkCB1Rmd1+X56sAg=eUdbPthG2xrLqwQQ@mail.gmail.com/ Tested-by: Semyon Maryasin Tested-by: Zhang Lixu Signed-off-by: Srinivas Pandruvada Reviewed-by: Jonathan Cameron Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit 5b28cd6c5218cc4fef00a74c2e144343be5b7e5c Author: Srinivas Pandruvada Date: Mon Nov 9 11:59:47 2026 -0800 HID: sensor: custom: Serialize misc device reads [ Upstream commit fecb7895fbb1b7891e81a033f0dd1f5f7876dc07 ] The misc device permits only one open file, but threads sharing that file can still read concurrently. Serialize readers to preserve the single-reader assumption of the FIFO while keeping removal independent of a stalled user copy. Fixes: 4a7de0519df5 ("HID: sensor: Custom and Generic sensor support") Reported-by: Semyon Maryasin Closes: https://lore.kernel.org/all/CAM2dg7ewfVJSP4rFyhkCB1Rmd1+X56sAg=eUdbPthG2xrLqwQQ@mail.gmail.com/ Tested-by: Semyon Maryasin Tested-by: Zhang Lixu Signed-off-by: Srinivas Pandruvada Reviewed-by: Jonathan Cameron Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit 6bc583ef1b9f387a190d157607e99639d5f821c4 Author: Srinivas Pandruvada Date: Mon Nov 9 11:59:46 2026 -0800 HID: sensor: custom: Fix state lifetime during removal [ Upstream commit ac6c19392c7996ac8135dba6907c391a4be5beaf ] Open misc device files can outlive platform-device removal. Since the devm-allocated state can be freed while a reader is queued on its wait queue, subsequent file operations may access freed memory. Allocate the state independently of devres and give every open file a reference to keep the FIFO and state alive after removal. On removal, mark the device as disconnected and wake readers; make reads return -ENODEV and polls report hangup and error. Free the FIFO and state when the final reference is released. Unregister the sensor hub callback before tearing down the interface so in-flight raw-event processing finishes before the sensor state can be freed. Fixes: 4a7de0519df5 ("HID: sensor: Custom and Generic sensor support") Reported-by: Semyon Maryasin Closes: https://lore.kernel.org/all/CAM2dg7ewfVJSP4rFyhkCB1Rmd1+X56sAg=eUdbPthG2xrLqwQQ@mail.gmail.com/ Tested-by: Semyon Maryasin Tested-by: Zhang Lixu Signed-off-by: Srinivas Pandruvada Reviewed-by: Jonathan Cameron Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit 4c0c5ca695d33208913a4a24464d36c2c48b864b Author: Shunbo Shi Date: Tue Nov 17 12:50:51 2026 +0000 usb: gadget: f_hid: fix get_req leak when usb_gstrings_attach() fails [ Upstream commit f11175ece1250557ec595ea7a2854f0391cab53d ] In hidg_bind(), hidg->get_req is allocated early; if usb_gstrings_attach() subsequently fails, the function returns directly without freeing the request, leaking it. Unwind through the fail path instead. Fixes: a139c98f760e ("USB: gadget: f_hid: Add GET_REPORT via userspace IOCTL") Signed-off-by: Shunbo Shi Link: https://patch.msgid.link/20261117125051.5646-4-shishunbo@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin commit cbce7eb30bd780002566ab290ccbf2af22c99d06 Author: Shunbo Shi Date: Tue Nov 17 12:50:50 2026 +0000 usb: gadget: f_hid: fix race between userspace report update and GET_REPORT response [ Upstream commit 07ec204e8aecbfee425008832b18d5d720daca6d ] The GET_REPORT response is served by pointing get_req->buf at the data[] array of a report_list entry and calling usb_ep_queue(). The request completes asynchronously, so the controller may still be reading the entry's buffer after get_report_workqueue_handler() drops get_report_spinlock. At the same time, userspace can update that same entry via the GADGET_HID_WRITE_GET_REPORT ioctl: f_hidg_get_report() copies new report data into the entry while holding the spinlock, but the transfer reading the entry is not serialized against that update (the lock was already released by the work handler). The result is that the host can receive a GET_REPORT response that mixes bytes of the old and the new report (a torn write), with no memory-safety violation but corrupted report data on the wire. Serve the response from a dedicated buffer allocated once in hidg_alloc() and freed in hidg_release(). This also removes the now unused get_report member from struct f_hidg. Fixes: a139c98f760e ("USB: gadget: f_hid: Add GET_REPORT via userspace IOCTL") Signed-off-by: Shunbo Shi Link: https://patch.msgid.link/20261117125051.5646-3-shishunbo@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin commit c4d52b75560ce300bf70a45f3363590b37eecf59 Author: Shunbo Shi Date: Tue Nov 17 12:50:49 2026 +0000 usb: gadget: f_hid: fix report_list entries leak [ Upstream commit 19e8981057fb5947697f99a3c6a3f6ff4a2d85a1 ] Each GADGET_HID_WRITE_GET_REPORT ioctl for a report ID that is not yet in hidg->report_list allocates a report_entry and adds it to the list. hidg_release() frees report_desc and set_report_buf, but never walks report_list, so every accumulated entry leaks on function destroy (e.g. when the HID gadget is unbound and the device is removed). Free the entries in hidg_release(). This is safe without extra locking: at release time the function is unbound (the workqueue is already destroyed and userspace has no way to reach the ioctl). Fixes: a139c98f760e ("USB: gadget: f_hid: Add GET_REPORT via userspace IOCTL") Signed-off-by: Shunbo Shi Link: https://patch.msgid.link/20261117125051.5646-2-shishunbo@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin commit 642469abef3a264511d69ea005daf32feb0baf12 Author: Koichiro Den Date: Mon Oct 12 14:30:22 2026 +0200 dmaengine: rcar-dmac: Add missing dma_descriptor_unmap() [ Upstream commit 0ca154b10168d8874b871edf5510640c51b326c3 ] Call dma_descriptor_unmap() right before dma_cookie_complete() in the threaded IRQ completion path. Without this, streaming DMA mappings attached to the descriptor are never released and may eventually exhaust DMA mapping resources (e.g. IOVA with an IOMMU or bounce-buffer slots with SWIOTLB), leading to dma_map_* failures. Also ensure dma_descriptor_unmap() is called in rcar_dmac_chan_reinit() (error/terminate path) to avoid the same type of leaks. Fixes: 87244fe5abdf ("dmaengine: rcar-dmac: Add Renesas R-Car Gen2 DMA Controller (DMAC) driver") Signed-off-by: Koichiro Den [wsa: moved unmap before cookie completion, added Fixes tag] Signed-off-by: Wolfram Sang Reviewed-by: Frank Li Link: https://patch.msgid.link/20261012123020.11320-7-wsa+renesas@sang-engineering.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit 15a0a237a77840d78fb2d47363e23ddb4b69d529 Author: Zhang Shurong Date: Mon Oct 12 14:30:21 2026 +0200 dmaengine: rcar-dmac: Fix PM usage counter imbalance [ Upstream commit d3c108c095712a3b7eab292ef7ea9a57ff5cd5d7 ] pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. We fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Fixes: 87244fe5abdf ("dmaengine: rcar-dmac: Add Renesas R-Car Gen2 DMA Controller (DMAC) driver") Signed-off-by: Zhang Shurong Reviewed-by: Geert Uytterhoeven Reviewed-by: Frank Li Reviewed-by: Laurent Pinchart Signed-off-by: Wolfram Sang Link: https://patch.msgid.link/20261012123020.11320-6-wsa+renesas@sang-engineering.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit e4d4042ef366a049f9cada3ec72fc88633483b5f Author: SeungUk Nam Date: Thu Sep 10 16:48:32 2026 +0900 dmaengine: idxd: Free the minor number when cdev setup fails [ Upstream commit 56cbd7f69ce6037738410a5c50efb7cacf52b0ae ] idxd_wq_add_cdev() allocates a minor number from cdev_ctx->minor_ida for the new struct idxd_cdev. When dev_set_name() or cdev_device_add() fails, the error path calls put_device(), and the release callback idxd_cdev_dev_release() only frees idxd_cdev, so the minor number is never returned to the ida. Leaked numbers accumulate across bind/unbind cycles, up to MINORMASK, for as long as the module stays loaded. Free the minor number before put_device() drops the last reference on that path. Fixes: c311f5e92484 ("dmaengine: idxd: Fix freeing the allocated ida too late") Signed-off-by: SeungUk Nam Reviewed-by: Frank Li Link: https://patch.msgid.link/20260910074832.15729-1-tmddnr49449@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit 2c06ad8dde221b9d9290363391f862a374416c91 Author: Xiangwu Lai Date: Mon Nov 2 18:44:31 2026 +0800 dmaengine: stm32-mdma: Fix runtime PM reference leak in pm_suspend [ Upstream commit 34c8c2ea213aab7b452df93e5b7547f4459a49e9 ] stm32_mdma_pm_suspend() increments the runtime PM usage counter with pm_runtime_resume_and_get(), but when a channel is still enabled it returns -EBUSY directly without dropping the reference. The matching pm_runtime_put_sync() only runs on the success path. Each failed suspend attempt therefore leaks one runtime PM reference, so the device can never runtime suspend afterwards. Drop the reference before returning -EBUSY. Fixes: 7cb819c856d9 ("dmaengine: stm32-mdma: add suspend/resume power management support") Signed-off-by: Xiangwu Lai Reviewed-by: Frank Li Reviewed-by: Amelie Delaunay Link: https://patch.msgid.link/20261102104432.873-1-laixiangwu@cmss.chinamobile.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit c5236444e05addfc7e8ae688e7dabe4d14d5b939 Author: Thaison Phan Date: Wed Nov 18 21:09:33 2026 +0000 tcp: accecn: initialize AccECN fields in syncookie path [ Upstream commit ce28b1a4d137842e428a578269c35d6c84109438 ] cookie_tcp_reqsk_alloc() and bpf_sk_assign_tcp_reqsk() allocate struct request_sock without __GFP_ZERO, leaving saw_accecn_opt, accecn_fail_mode, syn_ect_rcv, and syn_ect_snt uninitialized. When accecn_ok is negotiated in cookie_{v4,v6}_check(), tcp_ecn_openreq_child() reads all four fields to initialize the child socket's AccECN state. In addition, because the temporary request_sock used to send a cookie SYN-ACK is immediately freed, treq->syn_ect_snt is lost. For AccECN connections where the listener marks ECT on the SYN-ACK, leaving syn_ect_snt as 0 causes tcp_accecn_third_ack() to see a mismatch between the expected Not-ECT and the peer's reflected ECT in the ACE field, erroneously flagging TCP_ACCECN_ACE_FAIL_RECV in accecn_fail_mode. Refer to Table 4 of RFC 9768 for more details. Initialize the AccECN fields in cookie_tcp_reqsk_init() to match tcp_openreq_init(). For kernel-generated cookies (!req->syncookie), set syn_ect_snt from the listener's TOS/tclass in cookie_{v4,v6}_check() to match tcp_{v4,v6}_send_synack(); for BPF custom syncookies (req->syncookie), leave syn_ect_snt at 0 (Not-ECT) since the SYN-ACK was built by the BPF program rather than the kernel and bpf_tcp_req_attrs does not report the SYN-ACK ECN codepoint. Found by AI-assisted code inspection comparing tcp_openreq_init() and cookie_tcp_reqsk_init() while investigating the cookie_v6_check() LOOPBACK4_IPV6 bug. Reproduced in a QEMU VM with tcp_syncookies=2, tcp_ecn=3, SLUB_RCU_DEBUG=y, and slub_debug=P, observing bogus tcpi_accecn_fail_mode and tcpi_accecn_opt_seen values in TCP_INFO on the accepted child socket (and tcpi_accecn_fail_mode=0x2 on ECT(0) listeners), and tested with packetdrill AccECN and syncookie selftests. Fixes: 3cae34274c79 ("tcp: accecn: AccECN negotiation") Fixes: b40671b5ee58 ("tcp: accecn: AccECN option failure handling") Signed-off-by: Thaison Phan Reviewed-by: Matthieu Baerts (NGI0) Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20261118210933.2477423-3-thaisonphan@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 36cee16fbb9f608b11d3e1d1f57b5181588d227f Author: Thaison Phan Date: Wed Nov 18 21:09:32 2026 +0000 tcp: initialize ir_rmt_addr and ir_loc_addr in cookie_v6_check() [ Upstream commit 7411fb1929075884648e9db0b9ec7e424c095185 ] Commit a3a128f611a9 ("inet: consolidate inet_csk_clone_lock()") moved the LOOPBACK4_IPV6 initialization for passive IPv6 TCP sockets from tcp_v6_syn_recv_sock() to tcp_v6_init_req(). IPv6 SYN cookie connections allocate a fresh request_sock without __GFP_ZERO and call tcp_v6_syn_recv_sock() without tcp_v6_init_req(), leaving ireq->ir_rmt_addr and ireq->ir_loc_addr uninitialized in cookie_v6_check(). inet_csk_clone_lock() then copies uninitialized slab bytes into sk_daddr, sk_rcv_saddr, and inet_saddr, exposing them to tracepoints and bpf_sock and causing inet_daddr != LOOPBACK4_IPV6 checks (such as IP_OPTIONS in do_ip_setsockopt()) to misclassify native IPv6 child sockets as IPv4-mapped. This was originally noticed via an out-of-tree socket hook observing inet_sk(sk)->inet_saddr != LOOPBACK4_IPV6 on KASAN test runs. KASAN enables SLUB_RCU_DEBUG by default, introducing an RCU grace period that prevents cookie_v6_check() from reusing the warm request_sock initialized during the initial SYN. Upstream, with tcp_syncookies=2, SLUB_RCU_DEBUG=y, and slub_debug=P, sock:inet_sock_set_state shows slab poison instead of 127.0.0.6: ... sock:inet_sock_set_state: family=AF_INET6 protocol=IPPROTO_TCP \ sport=59839 dport=41050 \ saddr=90.90.90.90 daddr=90.90.90.90 \ saddrv6=::1 daddrv6=::1 \ oldstate=TCP_LISTEN newstate=TCP_SYN_RECV Initialize ireq->ir_rmt_addr and ireq->ir_loc_addr to LOOPBACK4_IPV6 in cookie_v6_check() to match tcp_v6_init_req(). Tested against a QEMU reproducer checking inet_sock_set_state and IP_OPTIONS, as well as the packetdrill syncookie selftests. Fixes: a3a128f611a9 ("inet: consolidate inet_csk_clone_lock()") Signed-off-by: Thaison Phan Reviewed-by: Eric Dumazet Link: https://patch.msgid.link/20261118210933.2477423-2-thaisonphan@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d84d791f29570b04d858493e8f425405506038b7 Author: Tariq Toukan Date: Wed Nov 18 16:40:42 2026 +0200 net/mlx5e: SHAMPO: Do not merge packets with different kTLS RX state [ Upstream commit e421df3c838692c0c3503768ec3c9183f6df77aa ] HW-GRO (SHAMPO) sessions are not terminated by HW when the kTLS RX offload indication in the CQE changes. The driver applies the offload metadata of the first packet in the session only, so ciphertext and plaintext can end up in the same skb under a single skb->decrypted indication, and resync requests carried by non-first packets are lost. Do not merge a CQE whose decryption state differs from skb->decrypted, which the first packet of the session sets. Never merge a CQE that carries a resync request or a TLS error, so that each of them starts a session and is handled. The failure was reproduced on ConnectX-7 with HW GRO and kTLS RX offload on and 0.3% loss added by netem on the sender's egress: TlsDecryptError increased and the receiving sockets failed with EBADMSG. With this patch, TlsDecryptError stays 0. Fixes: 92552d3abd32 ("net/mlx5e: HW_GRO cqe handler implementation") Signed-off-by: Tariq Toukan Reviewed-by: Gal Pressman Reviewed-by: Cosmin Ratiu Link: https://patch.msgid.link/20261118144042.1916204-1-tariqt@nvidia.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 1f3485487f378bff352eb67894ff194ab72d5559 Author: Terrence Adams Date: Wed Nov 18 10:03:44 2026 -0800 scsi: pm8001: Offset hardware queue index for MSI-X pre-vector [ Upstream commit 3ad578b22f7a34a2391ca8910dfc931b01cc94f6 ] When MSI-X interrupt vectors are configured in pm8001_setup_msix(), the driver requests vector affinity with .pre_vectors = 1 to reserve Vector 0 for non-affinitized housekeeping interrupts. blk_mq_map_hw_queues() maps hardware queues (hwq 0 to nr_hw_queues - 1) with an offset of 1, mapping hwq 0 to Vector 1, hwq 1 to Vector 2, etc. However, pm80xx_chip_get_q_index() retrieves the queue index directly from blk_mq_unique_tag_to_hwq(tag) without adding 1 for the pre-vector offset. Consequently, commands on hwq 0 are issued with responseQueue 0 (firing unmanaged Vector 0 on CPU 0), while hwq k fires Vector k (the CPU affinitized to hwq k-1). This results in 100% of I/O completion interrupts being delivered to the wrong CPU core, causing heavy cross-CPU IPIs, cache line bouncing, and increased kernel and IRQ CPU processing overhead. Define PM8001_PRE_VECTORS for the reserved housekeeping vector and use it consistently across MSI-X vector allocation, hardware queue setup and mapping, and queue index lookup. Update pm80xx_chip_get_q_index() to accept pm8001_ha and add PM8001_PRE_VECTORS to blk_mq_unique_tag_to_hwq() whenever multi-queue is enabled (number_of_intr > PM8001_PRE_VECTORS), routing completion interrupts to their affinitized CPU cores. Note that offsetting completions by PM8001_PRE_VECTORS routes the highest hardware queue to outbound queue max_q_num - 1, which pm80xx_chip_init() also programs as the fatal error interrupt vector. As a result, process_oq() now reads MSGU_SCRATCH_PAD_1 (and MSGU_SCRATCH_PAD_RSVD_0 when no fatal error is reported) on every interrupt for that queue, matching the behavior before commit 42f22fe36d51 ("scsi: pm8001: Expose hardware queues for pm80xx"). Fixes: 42f22fe36d51 ("scsi: pm8001: Expose hardware queues for pm80xx") Signed-off-by: Terrence Adams Reviewed-by: Bart Van Assche Link: https://patch.msgid.link/20261118180344.1159617-1-tadamsjr@google.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit c13f71581a0b6125a53598a2b103d3ba22938487 Author: Kordian Chmielewski Date: Sat Nov 14 00:58:47 2026 +0100 net: bcm4908_enet: order the TX ring index accesses [ Upstream commit ebe31472ad0a08e19a31a6647b99c6b51f90026c ] Since the TX interrupt was added, poll_tx() runs in its own NAPI and does not take the TX queue lock, so it and start_xmit() share the TX ring with only the two indexes between them. Nothing orders the accesses around those indexes: - poll_tx() reads write_idx, then the descriptor and the slot. On arm64 the later loads may be satisfied first, so poll_tx() may see the new write_idx together with the previous lap's descriptor, which has no OWN, and the previous lap's slot. It would then unmap and free a frame the DMA has not sent yet, or free the old skb a second time. - poll_tx() publishes read_idx once it is done with the slots it freed, but that store is not ordered after its loads from those slots, so start_xmit() may refill a slot before poll_tx() has read it. Publish each index with smp_store_release() and read the other side's index with smp_load_acquire() before touching the slots. start_xmit() now publishes write_idx right after the descriptor, before the MMIO write that kicks the DMA rather than after it, which narrows the window in which the DMA can complete a frame that poll_tx() cannot see yet. Sashiko's review of the previous version of this series pointed this out; I have not seen it on the hardware. Fixes: 12bb508bfe5a ("net: broadcom: bcm4908_enet: support TX interrupt") Signed-off-by: Kordian Chmielewski Link: https://patch.msgid.link/20261113235847.517308-8-kudzo51@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 3f554c50c6d635966c9ddbe02d1993d5699e9cfc Author: Kordian Chmielewski Date: Sat Nov 14 00:58:46 2026 +0100 net: bcm4908_enet: publish the buffer address before OWN [ Upstream commit 4d47e6c2f3ceb638d4ea5c21e304b20f526255bd ] bcm4908_enet_dma_alloc_rx_buf() hands a descriptor to the DMA by writing its control word, with DMA_CTL_STATUS_OWN, first and the new buffer address second. If the DMA read the descriptor between the two stores, it would write the next frame into the old buffer, which poll_rx() is turning into an skb. start_xmit() writes the address first, but nothing orders the two stores, and the descriptors live in coherent memory, where arm64 may make them visible in either order. Write the address first on both paths and order it before the control word with dma_wmb(). In poll_rx(), read what the DMA wrote only after seeing OWN clear (dma_rmb()), as Documentation/memory-barriers.txt describes for descriptors shared with a device. Found by reading the code; I have no test that shows the DMA reading a descriptor while it is being refilled. Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver") Reviewed-by: Florian Fainelli Signed-off-by: Kordian Chmielewski Link: https://patch.msgid.link/20261113235847.517308-7-kudzo51@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 073643094d9f5be6f5de4126a4320d33d581cbf8 Author: Kordian Chmielewski Date: Sat Nov 14 00:58:45 2026 +0100 net: bcm4908_enet: unmap RX buffers on stop with their mapped size [ Upstream commit 1da02595e8d2647a04c2cdd4f668dee0b8ac1ae9 ] Since the switch to build_skb() the RX buffers are mapped with ENET_RX_BUF_DMA_SIZE and slot->len is no longer set for them, but bcm4908_enet_dma_uninit() still unmaps them with slot->len. Use the size they were mapped with. Found by reading the code. Fixes: 3a1cc23a75ab ("net: broadcom: bcm4908_enet: use build_skb()") Reviewed-by: Florian Fainelli Signed-off-by: Kordian Chmielewski Link: https://patch.msgid.link/20261113235847.517308-6-kudzo51@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 2186708904ace15a57c72051c20668e75e468840 Author: Kordian Chmielewski Date: Sat Nov 14 00:58:44 2026 +0100 net: bcm4908_enet: unmap the buffer of a dropped RX frame [ Upstream commit 1b48d619448c8425bd907722784f08e4e8fa4c5b ] When poll_rx() drops a frame (too short, or not in a single buffer), it frees the buffer without unmapping it first, so the memory goes back to the page allocator while still mapped for the device. Unmap it as the path for good frames does. Found by reading the code. Fixes: 4dc7f09b8bec ("net: broadcom: bcm4908_enet: fix RX path possible mem leak") Reviewed-by: Florian Fainelli Signed-off-by: Kordian Chmielewski Link: https://patch.msgid.link/20261113235847.517308-5-kudzo51@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 249e331927912344aa6d7a7637be1109e453204a Author: Kordian Chmielewski Date: Sat Nov 14 00:58:43 2026 +0100 net: bcm4908_enet: release the TX ring on stop [ Upstream commit e2785f0ff0a210158933221e86ea5bd066992870 ] bcm4908_enet_stop() disables the TX DMA but leaves the ring as it is: the skbs that poll_tx() has not freed yet stay mapped and are never freed, and the descriptors the DMA has not sent yet keep DMA_CTL_STATUS_OWN. The skbs, the socket memory they hold and their mappings leak. The next open starts the indexes from 0 again over those descriptors, so the DMA may send stale frames from before the stop, and if the first descriptor still has OWN, start_xmit() stops the queue before it enables the DMA, with nothing left to wake it. Wait for the TX DMA channel to stop, as is already done for RX, then unmap and free the skbs between read_idx and write_idx and leave the ring empty, so that nothing can free them a second time. If the channel does not stop in time, leave the skbs alone rather than free them while the DMA may still read them. Clear the TX descriptors when the ring is initialised. A descriptor that start_xmit() is about to use then never carries OWN, so drop the check that stopped the queue on one. The RX helper's timeout warning said TX; make it say RX. Found by reading the code; I have not seen these on the hardware. Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver") Signed-off-by: Kordian Chmielewski Link: https://patch.msgid.link/20261113235847.517308-4-kudzo51@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit d88c42745d9c063a2af9cf3d66b59978545f26c6 Author: Kordian Chmielewski Date: Sat Nov 14 00:58:42 2026 +0100 net: bcm4908_enet: drop a TX frame whose DMA mapping failed [ Upstream commit e1d4683fb4cb9d7f45a17c43a56ba2d26ab91ec6 ] When dma_map_single() fails, start_xmit() returns NETDEV_TX_BUSY with the queue still running, after it has already stored the skb in the slot. Documentation/networking/driver.rst treats NETDEV_TX_BUSY under normal circumstances as a hard error, and a driver that returns it must not keep any reference to the skb. Here the stack requeues the frame and retries it while the slot still points at it. Drop the frame instead: free the skb, count it as dropped and return NETDEV_TX_OK. Map the buffer before the slot is touched. Found by reading the code. Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver") Reviewed-by: Florian Fainelli Signed-off-by: Kordian Chmielewski Link: https://patch.msgid.link/20261113235847.517308-3-kudzo51@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit f698fb18903947a2927de829bc5c6397d99261a2 Author: Kordian Chmielewski Date: Sat Nov 14 00:58:41 2026 +0100 net: bcm4908_enet: fix the TX ring wrap [ Upstream commit 4f8b1a7cf7548ebefae959486c3acc33799d1116 ] start_xmit() wraps write_idx at length - 1 and sets WRAP on the descriptor at length - 2, while poll_tx() wraps read_idx at length, and the free descriptor count is taken from length. With read_idx at 0 and write_idx at length - 2 the count comes out as 2, the frame is queued and write_idx wraps to 0 == read_idx: a full ring looks empty. The following frames overwrite slots whose skbs were never unmapped or freed, their bytes stay in BQL, and the queue stops for good with nothing left to wake it. On a TP-Link Archer AX6000 this stopped everything the CPU sent to the switch under sustained TX load (about 1.3 Gbit/s through the switch's CPU port): tx_packets froze, nothing was logged, and BQL showed about 185 KB in flight against a limit of about 10 KB. The same mismatch also lets poll_tx() step onto slot length - 1, which start_xmit() never fills: once per lap it completes that slot, unmapping address 0 with length 0 and counting a packet that was never sent. That one is from reading the code. Use every descriptor, with WRAP on the last one, wrap both indexes at length and keep one descriptor free, so that read_idx == write_idx can only mean an empty ring. Stop and wake the queue with the netdev_queues.h helpers: start_xmit() stops it when the ring is full, also when it finds the ring full on entry, and poll_tx() wakes it once there is room again. Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver") Reviewed-by: Florian Fainelli Signed-off-by: Kordian Chmielewski Link: https://patch.msgid.link/20261113235847.517308-2-kudzo51@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 7c5da4679ea6ff4bcb8913301f8d914622132ae6 Author: Artemii Mashanov Date: Tue Nov 17 12:06:08 2026 +0300 cxgb4: allocate the full ethtool filter location array [ Upstream commit ad2c7240a3981fd5f0142b61ca913b02ab476ede ] The ethtool filter location array stores nentries u32 values, but cxgb4_init_ethtool_filters() passes nentries to kvzalloc() as a byte count. The insertion and lookup paths allow indices below nentries, which can address memory beyond the requested allocation. Allocate nentries elements with kvcalloc() and the element size. The array remains compatible with the existing kvfree() calls. The size mismatch was found by reviewing the allocation, the array declaration and the indexed accesses in the filter handlers. Fixes: d915c299f1da ("cxgb4: add skeleton for ethtool n-tuple filters") Signed-off-by: Artemii Mashanov Reviewed-by: Potnuri Bharat Teja Link: https://patch.msgid.link/20261117090608.33178-1-ralerrdirsardx@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 0fe33252b6a5f47958ff95a325937376d70df3f5 Author: Alexander Duyck Date: Fri Nov 13 12:41:52 2026 -0800 fbnic: Initialize and reset the HW stats before they can be read [ Upstream commit 4b5153b389627d81f80eef49a5f27032c36378f6 ] The HW stats are kept as running totals that advance by the difference between each counter and the value last read, so the last values have to be captured before the first read, and rebased whenever the hardware counters are reset. Three paths get the ordering wrong. The fbnic_probe function creates the debugfs directory, including the pcie_stats file, before it calls the fbnic_init_hw_stats function. A read in that window takes the stats lock before it has been initialized, and accumulates deltas against baselines that have not been captured. On resume, the __fbnic_pm_attach function rebases the stats only after it has returned early for a device in init failure mode, though such a device still exposes the PCIe stats through debugfs. And during PCI error recovery it runs from the resume callback, after the __fbnic_pm_resume function has already restored MMIO access from the slot_reset callback, so a debugfs read in between takes its delta against the values from before the reset and the totals jump by close to the full width of each counter. Initialize the stats before the debugfs directory and the devlink instance are registered. Rebase them in the __fbnic_pm_resume function, in the same stats lock section that restores MMIO access, so no read can see the reset counters first, ahead of its init failure check. The issue was found by code review, and the recovery case confirmed by hardware testing with forced AER/DPC recovery. Fixes: 25ba596d137d ("eth: fbnic: add PCIe hardware statistics") Fixes: 9f61eb2d185b ("eth: fbnic: add locking support for hw stats") Fixes: 05ec5504ff69 ("fbnic: Fix service task races with ndo_stop and PM suspend") Signed-off-by: Alexander Duyck Link: https://patch.msgid.link/179460251204.8819.12233374584808838528.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 49eb61af6f5da3a0f0a9cfd7163fe259a05dd1e4 Author: Alexander Duyck Date: Fri Nov 13 12:41:43 2026 -0800 fbnic: Cover all of the HW stats with the stats lock [ Upstream commit 52a64e64230e03b45c13c615d7cdf0aeea39b210 ] The hw_stats lock covers the PHY, TMI, TTI, RPC, RXB, queue and PCIe stats, but the MAC stats are left to RTNL: the fbnic_reset_hw_stats function resets them outside the lock and asserts RTNL, on the grounds that the ethtool API is their only other user and holds RTNL. That is no longer the case. ethtool only takes RTNL on the Netlink path for the operations a driver lists in op_needs_rtnl, and fbnic lists only the pause getter among the stats ones, so the eth-mac, eth-ctrl and rmon getters update the MAC stats with only the netdev instance lock held, racing each other and the reset. Take the stats lock around the MAC stats updates in those getters and in the reset, and drop the RTNL assertion. Take it in the pause getter as well: it still runs under RTNL, but that no longer serializes it against the reset once the reset does not rely on RTNL. The PCIe stats debugfs read never needed RTNL, as the fbnic_get_hw_stats function updates those stats under the stats lock, so drop it there too. The values are printed from their 64-bit fields without the lock, as the counters keep changing during the read anyway. The issue was found by code review. Fixes: 45079e00133e ("net: ethtool: optionally skip rtnl_lock on Netlink path for GET ops") Signed-off-by: Alexander Duyck Link: https://patch.msgid.link/179460250360.8819.2203630667210523871.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit b09aa85a914905247e5767f48646c2ae5d034425 Author: Alexander Duyck Date: Fri Nov 13 12:41:27 2026 -0800 fbnic: Wait for in-flight PTP timestamps before treating Tx as idle [ Upstream commit 6ada0c2769666140dff8e808ff21e8f9544ddc99 ] The fbnic_wait_all_queues_idle function treats the Tx path as idle once the QM idle registers report every queue idle. Those registers do not cover the TMI completion path, so they can report idle while a PTP timestamp request is still outstanding in the MAC or queued in the TMI completion FIFO. The check can then pass without a flush, and the completion arrives after the rings have been flushed, where the fbnic_clean_tsq function either reports "Tx timestamp without matching packet" or, if the interface has come back up and a new timestamped frame is already waiting, matches the stale completion to that frame and hands an SO_TIMESTAMPING user the wrong Tx timestamp. After a forced flush it can also turn FBNIC_TMI_DROP_CTRL_CMPL_DIS back off before the queued completions have drained, as the completion FIFO is only drained while that bit is set. Split the Tx wait out into the fbnic_wait_tx_idle function and have its idle check require the TCE PTP in-flight count to read zero in addition to the QM idle registers. The count tracks each timestamp request from when its frame enters the TCE until its completion leaves the TMI completion FIFO, so the Tx path is only treated as idle once none are outstanding, and a forced flush keeps the completion disable set until they have drained. The Rx wait still checks only the QM idle registers. The count is printed with the other Tx idle registers on failure. Waiting on the in-flight count means the Tx idle check can now keep reading the full set of QM idle registers for the whole timeout, and the poll timeout only counts the delay between polls, not the time spent in the register reads. Raise the delay between polls of the Tx and Rx waits from 2us to 20us so the PCIe read latency stays a small part of each interval and the 500ms timeout stays close to wall time. Define the register inside the TCE CSR section and move FBNIC_CSR_END_TCE to the last register of the TCE block (0x040B4, TCE_SPARE2 in the CSR map), so that the ethtool register dump covers it. The section previously ended at 0x04050, short of the TXB, PTP and TCAM status registers. Per the CSR map, every register in the added range is read-only or read/write, so reading them for the dump has no side effects. A device that has dropped off the bus, or whose CSR access the driver has disabled after a failed read, reads all ones. The QM idle bits treat that as idle, and so does the in-flight check: the count is bounded by the timestamp requests the Tx path can hold and can never reach all ones, so teardown of a lost device, or during DPC recovery, does not wait out the idle timeouts. The issue was found by code review and confirmed against the RTL. Fixes: ad3d9f8bc66c ("eth: fbnic: add TX packets timestamping support") Fixes: 7d4568edce74 ("fbnic: Disable PTP completions during the Tx force-flush") Signed-off-by: Alexander Duyck Link: https://patch.msgid.link/179460248693.8819.282933709034208845.stgit@ahduyck-xeon-server.home.arpa Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit c2fdf0a4f865e31c732dec197ae6450f0ae0edf2 Author: Tianyi Gao Date: Mon Nov 16 16:28:34 2026 +0000 xsk: reject TX checksum requests that overflow skb->csum_start [ Upstream commit 4fdfed6d0990c82ce3c268814ba1b2c6ad0ce49d ] xsk_skb_metadata() sets the u16 skb->csum_start to hr + csum_start. With 64K pages, csum_start can be close to U16_MAX, so the sum can overflow. The checksum offset then becomes negative. With XDP_UMEM_TX_SW_CSUM, skb_checksum_help() triggers a warning. Without it, the device gets a CHECKSUM_PARTIAL skb with a negative offset. Reject this with -EINVAL. Use the limit of skb_partial_csum_set(), which also rejects U16_MAX, the "not set" value of transport_header. That helper cannot be used here, as the skb built for an IFF_TX_SKB_NO_LINEAR device has no linear data. Fixes: 48eb03dd2630 ("xsk: Add TX timestamp and TX checksum offload support") Reported-by: Sashiko Closes: https://lore.kernel.org/all/sashiko-outbox-203545@kernel.org/ Signed-off-by: Tianyi Gao Acked-by: Stanislav Fomichev Link: https://patch.msgid.link/20261116162834.30087-1-tianyi@cloudflare.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit de4a4c7e40464041e13512cd672dd8459214f035 Author: Srinivas Pandruvada Date: Mon Nov 9 11:59:45 2026 -0800 HID: sensor: custom: Disable sensor before hub close on removal [ Upstream commit 6e66d69837cf07a00cbcdeb6198e08332b422b6c ] When removing an enabled sensor, set its power and reporting states to off before closing the hub. Keep the field descriptors alive until the state update has completed, and release the hub's open reference. Fixes: 4a7de0519df5 ("HID: sensor: Custom and Generic sensor support") Reported-by: Semyon Maryasin Closes: https://lore.kernel.org/all/CAM2dg7ewfVJSP4rFyhkCB1Rmd1+X56sAg=eUdbPthG2xrLqwQQ@mail.gmail.com/ Reviewed-by: Joshua Crofts Tested-by: Semyon Maryasin Tested-by: Zhang Lixu Signed-off-by: Srinivas Pandruvada Reviewed-by: Jonathan Cameron Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit 8f85bbfd05d75dc37c0b1b545ad8b26046f63d1d Author: Srinivas Pandruvada Date: Mon Nov 9 11:59:44 2026 -0800 HID: sensor: custom: Set owner for misc device [ Upstream commit 452a24b2c2ed95aa246fcb3fcaf74a97a95c02a4 ] Set .owner in the misc-device file operations so open file descriptors keep the module loaded until their release callbacks have completed. Fixes: 4a7de0519df5 ("HID: sensor: Custom and Generic sensor support") Reported-by: Semyon Maryasin Closes: https://lore.kernel.org/all/CAM2dg7ewfVJSP4rFyhkCB1Rmd1+X56sAg=eUdbPthG2xrLqwQQ@mail.gmail.com/ Reviewed-by: Joshua Crofts Tested-by: Semyon Maryasin Tested-by: Zhang Lixu Signed-off-by: Srinivas Pandruvada Reviewed-by: Jonathan Cameron Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit a26dccc642b6f527e57e3bb01260d1d9d35bb10d Author: Srinivas Pandruvada Date: Mon Nov 9 11:59:43 2026 -0800 HID: sensor-hub: Synchronize callback removal with raw events [ Upstream commit abe10ad9c5fd868553b1262df403d5aaea3eff64 ] Raw-event processing holds pdata->lock across callback lookup and invocation, and takes dyn_callback_lock during lookup. Removal must prevent both active callbacks and future lookups before client state can be released. Take pdata->lock before dyn_callback_lock, matching raw-event order, and unlink the callback while holding both locks. This ensures active raw-event callbacks have finished and prevents future lookups. Fixes: 401ca24fb34a ("HID: sensors: introduce sensor framework") Reported-by: Semyon Maryasin Closes: https://lore.kernel.org/all/CAM2dg7ewfVJSP4rFyhkCB1Rmd1+X56sAg=eUdbPthG2xrLqwQQ@mail.gmail.com/ Reviewed-by: Joshua Crofts Tested-by: Semyon Maryasin Tested-by: Zhang Lixu Signed-off-by: Srinivas Pandruvada Reviewed-by: Jonathan Cameron Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit 20267b6492234ce3557a0bc4db6b25d3cc888b23 Author: Myeonghun Pak Date: Mon Nov 9 23:30:01 2026 -0500 HID: magicmouse: disable the multitouch work on removal [ Upstream commit 348597b22005a8f20d267cdcc503a41dcc658acf ] During USB runtime reset-resume, usbhid can call magicmouse_reset_resume() without serialization against HID driver unbind. The USB interface remains bound to usbhid, so this callback can queue msc->work after magicmouse_remove() cancels it. The delayed work can then run after devres frees msc. Use disable_delayed_work_sync() to drain the work and reject later queueing. Probe initializes fresh work on rebind. Found by a static analysis tool under development. Fixes: 4253fe22b137 ("HID: magicmouse: re-enable multitouch after reset-resume") Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit 3fed86e396f32a6b9b195e865b757ccfaceee862 Author: Danish Khateeb Date: Fri Sep 4 11:15:31 2026 -0500 HID: corsair: use disable_work_sync() to tear down the LED workers [ Upstream commit cc8d022e8679e34b4892fa6c0a3fa2db917a6283 ] Tearing down the K90 LEDs races with their brightness workers in two different ways, and swapping cancel_work_sync() and led_classdev_unregister() around only trades one for the other. Cancelling before the unregister, as k90_cleanup_backlight() and k90_cleanup_macro_functions() have done since commit eb51c9f8cb4f ("HID: corsair: cancel worker before unregistering LED to fix use-after-free"), leaves led_classdev_unregister() free to re-arm the worker: it calls led_set_brightness(led_cdev, LED_OFF), which reaches k90_brightness_set() and schedule_work()s the item again. The structure holding that work is then freed while it is still linked into the worklist: BUG: KASAN: slab-use-after-free in __list_add_valid_or_report+0x186/0x210 Read of size 8 at addr ffff888102a1ead0 by task kworker/0:1/11 __queue_work+0xade/0x1350 queue_work_on+0xb6/0xc0 led_classdev_unregister+0x26b/0x340 corsair_remove+0x1c2/0x2d0 hid_device_remove+0xba/0x1e0 usbhid_disconnect+0xa0/0xe0 Allocated by task 129: corsair_probe+0x560/0xd50 Freed by task 11: corsair_remove+0xec/0x2d0 Cancelling after the unregister avoids that, but reintroduces precisely the use-after-free that commit set out to fix: a worker that has already tested led->removed and found it false goes on to dereference led->cdev.dev, which led_classdev_unregister() has meanwhile freed via device_unregister(). Use disable_work_sync(), which provides both halves at once. It waits for a worker that is already executing, so nothing can be sitting between the led->removed test and the led->cdev.dev dereference when the device goes away, and it makes the subsequent schedule_work() from the LED_OFF callback fail rather than queue, so nothing is left on the worklist to be freed. The ordering then stops mattering. The removed flag is left alone; it is redundant for these paths now but harmless. The fail_sysfs error path in k90_init_macro_functions() unregisters before cancelling, and so still carries the dereference-after-free that was fixed in the teardown paths, so convert it too. Fixes: eb51c9f8cb4f ("HID: corsair: cancel worker before unregistering LED to fix use-after-free") Reported-by: syzbot+abcedffc9201f2bb66c2@syzkaller.appspotmail.com Link: https://syzkaller.appspot.com/bug?extid=abcedffc9201f2bb66c2 Assisted-by: LLM Signed-off-by: Danish Khateeb Reviewed-by: Chen Changcheng Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin commit aaaafd70391ba41c914fddd5c7c75b316d14880e Author: Cen Zhang Date: Thu Nov 19 08:32:46 2026 +0800 Bluetooth: hci_sync: Use controller handles for periodic advertising [ Upstream commit a7d2c94ba2995b5fb766d5ec7086f5e6a2774745 ] Management instance numbers and controller advertising handles differ on controllers with a single set: instance 1 uses handle 0x00. Periodic advertising data already sends adv->handle, but the parameters and enable commands send the instance number. The completion handler also treats the command's handle as an instance number: Request worker Controller / completion create instance 1 on handle 0 send periodic parameters for 1 Unknown Advertising Identifier Snapshot the handle under hdev->lock for periodic parameters, enable and disable. For instance 1 using handle 0, update periodic_enabled under the mutex after the command succeeds. Its completion handler cannot distinguish that instance from global advertising by the handle alone; keep the software instance number in the request, as the existing remove-set and random-address paths do. Use the same mapping for the advertising set in periodic transfer and both BIG creation commands, which obtain the instance number from the same broadcast QoS field as hci_start_per_adv_sync(). Keep the instance number in software state, and send no HCI command with the mutex held. Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections") Signed-off-by: Cen Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 0510125ce9b7828dabbf4dc5b1c84281cf8d99df Author: Cen Zhang Date: Thu Nov 19 08:32:45 2026 +0800 Bluetooth: hci_sync: Fix remaining advertising instance UAFs [ Upstream commit d7e77168da348d8ac0fdb3b3aa7ce1ccc83208a7 ] hci_enable_ext_advertising_sync() looks up the advertising instance without hdev->lock and then reads it, while HCI event processing can free the instance under the lock: Request work HCI event work hci_enable_ext_advertising_sync() adv = hci_find_adv_instance() hci_cc_le_clear_adv_sets() hci_dev_lock(hdev) hci_remove_adv_instance() kfree(adv) hci_dev_unlock(hdev) reads adv->enabled Since the conversion to hci_sync, the advertising request paths run without hdev->lock, and the periodic advertising, advertising timeout and mesh code added later does the same, while management commands and HCI event processing still add and free instances under the lock. The same unlocked use exists in: - hci_set_adv_data_sync(), hci_disable_ext_adv_instance_sync(), the periodic advertising enable and disable helpers, hci_schedule_adv_instance_sync(), adv_expire_sync() and set_advertising_complete() - hci_enable_advertising_sync() and hci_start_per_adv_sync(), which keep the instance across HCI commands - hci_remove_advertising_sync() and hci_clear_adv_instance_sync(), which keep the next instance as a pointer - mesh_send_sync(), which adds the mesh instance - the walks of hdev->adv_instances in hci_dev_open_sync(), hci_dev_close_sync(), hci_resume_advertising_sync() and hci_powered_update_adv_sync() Fix them as commit cdc36db204ff ("Bluetooth: hci_sync: Fix advertising data UAFs") does for the extended advertising data paths: look the instance up under hdev->lock, copy what is needed, and release the lock before a command is sent, since command completion handlers take it. Keep the next instance as an instance number. Walks that send no command hold the lock, as hci_clear_adv_sync() does. The resume and power on walks send a command per instance and cannot hold it, so they copy the instance numbers under the lock into a fixed stack array first. Instance identifiers are nonzero u8 values, so 255 bytes cover the whole namespace. This preserves list order without adding an allocation failure after the resume path consumes its pause state. Use a u32 for the timeout-to-milliseconds conversion before converting to the controller's 10 ms units, and clamp the result to U16_MAX. The old u16 intermediate wrapped timeouts longer than 65 seconds. KASAN report as below: BUG: KASAN: slab-use-after-free in hci_enable_ext_advertising_sync+0x2fd/0x330 Read of size 1 at addr ffff88811673b810 by task kworker/u17:0/492 Workqueue: hci0 hci_cmd_sync_work Call Trace: hci_enable_ext_advertising_sync+0x2fd/0x330 add_ext_adv_data_sync+0x1f8/0x250 hci_cmd_sync_work+0x1b3/0x450 Allocated by task 490: hci_add_adv_instance+0x627/0x960 add_ext_adv_params+0x4d4/0xaf0 hci_sock_sendmsg+0x128b/0x22e0 Freed by task 495: kfree+0x307/0x580 hci_remove_adv_instance+0x226/0x4f0 hci_cc_le_clear_adv_sets+0x2a5/0x400 hci_cmd_complete_evt+0x373/0xab0 hci_event_packet+0x4e8/0xc70 hci_rx_work+0x367/0xf00 The buggy address belongs to the object at ffff88811673b800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 16 bytes inside of freed 1024-byte region [ffff88811673b800, ffff88811673bc00) Fixes: cba6b758711c ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 2") Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections") Fixes: c249ea9b4309 ("Bluetooth: Move Adv Instance timer to hci_sync") Fixes: b338d91703fa ("Bluetooth: Implement support for Mesh") Signed-off-by: Cen Zhang Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit f8800ac0189920d339d2960eaae42f764d24d7b4 Author: Luiz Augusto von Dentz Date: Tue Nov 17 15:00:12 2026 -0500 Bluetooth: hci_core: Don't fail removing a monitor unknown to the controller [ Upstream commit 8d3e5e6fe6d0be5634b28788abf5685d571b13a4 ] hci_remove_adv_monitor() frees the monitor when the controller has no matching handle for it but still returned -ENOENT, so callers took it for a failure of a monitor that is gone, and hci_remove_all_adv_monitor() stopped at the first one leaving the others behind. Return success since the monitor was removed. Found by the sashiko.dev review of the previous revision of this series. Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20261117185737.3758255-1-luiz.dentz%40gmail.com Fixes: 7cf5c2978f23 ("Bluetooth: hci_sync: Refactor remove Adv Monitor") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 3479d901d27bd7b904f243880f625f3a224001ee Author: Luiz Augusto von Dentz Date: Tue Nov 17 15:00:11 2026 -0500 Bluetooth: MSFT: Free the response of the monitor commands [ Upstream commit 775eca0c3df2f0272f21ebc8c812ad010fd47243 ] msft_add_monitor_sync() and msft_remove_monitor_sync() send the MSFT command with __hci_cmd_sync() and pass the returned skb to the callbacks, which only parse it, so it is never freed. Free it once the callback returns. While at it initialize the RSSI fields of the handle data when it is created instead of after the command completed, so they are never exposed uninitialized, and do the lookup of the handle map in msft_remove_monitor_sync() with hdev->lock held. Found by the sashiko.dev review of the previous revision of this series. Reported-by: Sashiko Link: https://sashiko.dev/#/patchset/20261117185737.3758255-1-luiz.dentz%40gmail.com Fixes: b747a83690c8 ("Bluetooth: hci_sync: Refactor add Adv Monitor") Fixes: 7cf5c2978f23 ("Bluetooth: hci_sync: Refactor remove Adv Monitor") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit b10c6de3c663849e1c88ca555fdee4cc622b1c22 Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:32:57 2026 -0500 Bluetooth: hci_core: Hold hdev->lock when removing advertisement monitors [ Upstream commit 7f08b6ef44fa17f1a5ad3926663ddb5abe6ff68a ] hci_remove_single_adv_monitor() and hci_remove_all_adv_monitor() only require hci_req_sync_lock, yet they look up and free monitors, modifying hdev->adv_monitors_idr and adv_monitors_cnt, which Read Advertisement Monitor Features iterates under hdev->lock. Take hdev->lock around the IDR accesses and the freeing, but not across the HCI commands sent to the controller. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-8b358899-5ac9-4687-af16-58420a4d9bba Fixes: 7cf5c2978f23 ("Bluetooth: hci_sync: Refactor remove Adv Monitor") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit c7eb853dcbea30b52c3db7c60dc8f15fcd0cf4c5 Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:32:15 2026 -0500 Bluetooth: hci_debugfs: Fix racy toggling of debugfs controlled flags [ Upstream commit b49abf5f92ea0e03ebc0fe41ce4af87b094fe9b5 ] The debugfs writers checked the current state of the flag, then blindly inverted it with hci_dev_change_flag(). Two concurrent writers both pass the check and the second inversion undoes the first one, leaving the flag out of sync with the actual controller/SMP channel state (e.g. DUT mode flag vs controller, or the BR/EDR SMP channel being leaked or removed twice). Set or clear the flag explicitly instead, redo the dut_mode check under hci_req_sync_lock() and serialize smp_force_bredr() with hdev->lock. The same applies to the quirk attributes. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-442108d5-76ce-44a1-a84d-16b44d6a26a6 Fixes: 4b4148e9acc1 ("Bluetooth: Add support for setting DUT mode") Fixes: b55d1abf568c ("Bluetooth: Expose quirks through debugfs") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit c8e7ac952f2b2d92e71412b26c4e84a250cfcade Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:31:53 2026 -0500 Bluetooth: MSFT: Protect the event prefix with hdev->lock [ Upstream commit 0434cd10518c1b58ca3f5366341f0b1c469afbca ] msft_vendor_evt() read msft->evt_prefix_len and compared evt_prefix before taking hdev->lock, while msft_do_open() (and the supported features reply) free and reallocate the prefix without it, so an event received while the controller is being opened could access freed memory. Take hdev->lock for the whole event processing and while updating the prefix. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-246df501-f32c-46fd-8779-7fa755ed7f9d Fixes: 5031ffcc79b8 ("Bluetooth: Keep MSFT ext info throughout a hci_dev's life cycle") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 845ab50b2197c37b7a21c1190eb00a6f5c16e2f1 Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:31:19 2026 -0500 Bluetooth: MGMT: Fix use-after-free in mgmt_powering_down() [ Upstream commit 7c8dcf322b0d978c80001632c1206d5fe1ee9ba7 ] mgmt_powering_down() looked up the Set Powered command and read its parameters after mgmt_pending_find() dropped mgmt_pending_lock, so the command could be unlinked and freed in between. Do the lookup and read the parameters while holding the lock. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-e45413fa-48a6-43f1-90be-638841567534 Fixes: 302a1f674c00 ("Bluetooth: MGMT: Fix possible UAFs") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit b8f345727e4a2267cf3dc7bd537077ab5874eadc Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:30:35 2026 -0500 Bluetooth: mgmt: Fix mesh transmission locking and lifetime [ Upstream commit 1d7a527788584e4a88ccc532ed73bfdacd0b1e74 ] The mesh_pending list is modified under hdev->lock by Mesh Send, but the cmd_sync callbacks and Mesh Send Cancel add/remove entries and touch hdev->adv_instances without it, which corrupts the list and the advertising instances. In addition the queued mesh_send_sync entry holds a raw pointer to the mesh_tx which a cancel of the transmission can free while the entry is running, leading to use-after-free. Fix this by: - taking hdev->lock around every mesh_pending/adv_instances access in the cmd_sync callbacks and Mesh Send Cancel, but never across HCI commands; - queueing the cmd_sync entries with the transmission handle and looking it up under the lock instead of passing the pointer; - always sending the first transmission, tracked by HCI_MESH_SENDING which is only cleared together with the removal of the transmission so Mesh Send can't start another one in between, and making sure none is left stranded if queueing fails; - cancelling a transmission by dequeuing its entry, and the done entry if it is the one in progress, stopping the done timer, which is queued with hdev->lock held so a cancel can't miss it; - not taking hdev->lock from callbacks invoked with -ECANCELED since those run with the cmd_sync lock held, the transmission is removed by whoever cancelled the entry; - flushing the transmissions left, dequeuing the entries still queued for them and clearing HCI_MESH_SENDING, when the controller is closed (also when auto powered off) or the index is removed, as nothing is going to send them and the stale entries would act on the ones started after the controller is powered on again, and not accepting Mesh Send while the controller is not powered so none can be left behind; - not reporting the completion of a transmission that failed to be queued by Mesh Send itself since userspace wasn't told about its handle; - not reusing the handle of a transmission still pending when the handle counter wraps around, now that it is what identifies a transmission. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-4ab89465-fc27-4d91-a870-a8ed49b22e91 Link: https://sashiko.dev/#/bug/linux-ab941894-dbe1-49da-8bac-c52efda6eaee Link: https://sashiko.dev/#/bug/linux-4016f774-7ac7-4b8a-916f-587ec9d597d4 Fixes: b338d91703fa ("Bluetooth: Implement support for Mesh") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit de5d12135c939f7c264edaf2cb3a982adc289d87 Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:16:36 2026 -0500 Bluetooth: L2CAP: Don't use uninitialized EFS in l2cap_parse_conf_rsp() [ Upstream commit cb3251457da29ac1118f130bf45ac696421594a8 ] The local EFS values were copied from an on-stack struct even when the response carried no EFS option. Track whether it was received. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-089f015e-6251-4fea-85ef-7d6761e8c457 Fixes: 66af7aaf9edf ("Bluetooth: EFS: parse L2CAP config response") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 091c64e0766e0aea89d05bfe6d7f4c119a540902 Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:16:35 2026 -0500 Bluetooth: mgmt: Reject zero multi advertising rotation duration [ Upstream commit 4e0dc0523bd98adbd45ce1c66dd1a96d4f6a3ec9 ] A zero def_multi_adv_rotation_duration makes hci_schedule_adv_instance_sync() requeue itself with no delay, spinning the request workqueue. Reject it in Set Default System Configuration. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-24ecb695-0c5c-408a-a016-a980c3115e95 Fixes: 17896406ff35 ("Bluetooth: implement read/set default system parameters mgmt") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 0388f346808df9acfd620230a006e4cad836fa45 Author: Heiko Carstens Date: Mon Nov 16 15:35:34 2026 +0100 s390/cert_store: Initialize ism array in query_diag320_subcodes() [ Upstream commit 2c1f57bce05244165f406e45982bbcd036071d3b ] The Installed Subcode Block returned by DIAG 320 subcode 0 may be smaller than the ism array. Initialize it to avoid copying uninitialized data to the debug area. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit b18b00c28bf9940bdef6ae169dbb2dc2f911c021 Author: Heiko Carstens Date: Mon Nov 16 15:35:33 2026 +0100 s390/cert_store: Fix out-of-bounds read in pr_dbf_vce() [ Upstream commit 539cf27f0b090d84438b7da9045a271a947192ed ] pr_dbf_vce() dumps the last 128 bytes of the certificate data of a Verification Certificate Entry (VCE) into a debug area. However the address calculation is wrong: vce_length is the length of the whole entry including the header, while cert_data_buf starts behind the header. Therefore the dump starts at the end of the entry and starts reading behind it. Dump the last 128 bytes of the entry like intended. Limit dumps to the data length. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit 36b557f1c741e74f77c82e94d99821b84380fd9b Author: Heiko Carstens Date: Mon Nov 16 15:35:32 2026 +0100 s390/cert_store: Fix max_vcxe_length output in pr_dbf_vcssb() [ Upstream commit 9d263bd8ddc31c9c3ebe3612df575d70848f5772 ] Print the correct value for max_vcxe_length. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit e70c580d3c5b3a2a30ec994e0fd8c7529cff4c61 Author: Heiko Carstens Date: Mon Nov 16 15:35:31 2026 +0100 s390/cert_store: Validate hash length in check_certificate_valid() [ Upstream commit 8b4e340f7742c8c3b12353e882ad5d4d25c7acc9 ] Validate that vc_hash_length is SHA256_DIGEST_SIZE before checking the hash and use sizeof(hash) in memcmp(). This avoids an out-of-bounds read if vc_hash_length is incorrect. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit 3beed17c6f3b3208b6d86dda40a140358cd00abe Author: Heiko Carstens Date: Mon Nov 16 15:35:30 2026 +0100 s390/cert_store: Do not search the process keyrings for the cert_store keyring [ Upstream commit 5ac71bb84e34337d7be280d2c06ff9cae77b7bcf ] find_cs_keyring() first searches the user session keyring for the cert_store keyring, and falls back to request_key(), which searches the thread, process and session keyrings of the calling task. Any keyring named "cert_store" found this way is accepted. cleanup_cs_keys() then invalidates and unlinks all of its keys, and clears and invalidates the keyring itself, without checking permissions. If the refresh is triggered by a task which inherited a session keyring that contains a keyring named "cert_store" not created by this code, this keyring and its keys are destroyed. create_cs_keyring() always links the keyring into the user session keyring, so the first search is sufficient. Remove the request_key() fallback. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Heiko Carstens Reviewed-by: Jarkko Sakkinen Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit 707ec8a7834e5d94d832723f975ae954999e8488 Author: Heiko Carstens Date: Mon Nov 16 15:35:29 2026 +0100 s390/cert_store: Fix keyring refcount handling in get_user_session_keyring() [ Upstream commit aa7ee9e9cf17fcc7b0af55424aba6f0abd065fa7 ] get_user_session_keyring() drops the reference of the looked up keyring before returning it. Callers therefore use the keyring without holding a reference. Return the keyring with the reference and let callers drop the reference. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Heiko Carstens Reviewed-by: Jarkko Sakkinen Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit 7d98855b36ae974343dda303cc99a86af05e4bd2 Author: Heiko Carstens Date: Mon Nov 16 15:35:28 2026 +0100 s390/cert_store: Fix error handling of get_user_session_keyring() [ Upstream commit 8256791b74e701361398a8d0e43c55bdabadc5ca ] create_cs_keyring(), cleanup_cs_keys(), and find_cs_keyring() all pass the return value of get_user_session_keyring() to other functions without checking it. This can lead to dereferencing an error pointer. Check the return value before using it. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Heiko Carstens Reviewed-by: Jarkko Sakkinen Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit 804d103da20f9b7ee2be88ce1868a7442ca44f8a Author: Heiko Carstens Date: Mon Nov 16 15:35:27 2026 +0100 s390/cert_store: Remove unnecessary static specifier in create_cs_keyring() [ Upstream commit 1a58d930c82fcaf3a6a9e9daf21c7ae9ee088d7e ] The local variable cs_keyring in create_cs_keyring() never reuses its assigned value, therefore remove the static specifier. Callers are serialized by cs_refresh_lock, so this does not fix a bug. Even though this is not a bug fix, this contains a Fixes tag since other commits require this as a prereq. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Heiko Carstens Reviewed-by: Jarkko Sakkinen Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit 360fa6a8ca69560c642ed53684ed266dc35d6370 Author: Heiko Carstens Date: Mon Nov 16 15:35:26 2026 +0100 s390/cert_store: Fix potential use-after-free caused by find_cs_keyring() [ Upstream commit 92d377a611766f6ab7b9a63a530aa7bbd434abbb ] find_cs_keyring() drops the refcount of cs_keyring before returning it. Which means that callers operate on potentially already freed memory. Let find_cs_keyring() return cs_keyring with a reference. Since cleanup_cs_keys() now performs a balanced put via find_cs_keyring(), remove the separate cleanup_cs_keyring error label in fill_cs_keyring() and drop the reference unconditionally instead. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Heiko Carstens Reviewed-by: Jarkko Sakkinen Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit df345ce0f3d5789db1a84a93522fd3835bc46a76 Author: Heiko Carstens Date: Mon Nov 16 15:35:25 2026 +0100 s390/cert_store: Fix cs_keyring reference leak in fill_cs_keyring() [ Upstream commit f992716c4c767a89b6be32e24ee6e4e41ad99da4 ] create_cs_keyring() returns cs_keyring with a reference held. On the success path fill_cs_keyring() never drops it, leaking the reference. The keyring is kept alive by its link to the session keyring. Drop the reference after add_certificates_to_keyring() returns. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Heiko Carstens Reviewed-by: Jarkko Sakkinen Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit 57d3c6fd18ad195c340a4600396a90969439b86d Author: Heiko Carstens Date: Mon Nov 16 15:35:24 2026 +0100 s390/cert_store: Unlink before invalidate in invalidate_keyring_keys() [ Upstream commit a1e3a45cac3d847e8ae81cc7e9db1b7b2c547a0e ] If a key is invalidated, the key garbage collector may remove its link from the keyring at any time. If that happens the subsequent key_unlink() fails. invalidate_keyring_keys() would then incorrectly return an error, which would lead to unregistering the cert_store key type. Unlink the key first and invalidate it afterwards to avoid this race. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Heiko Carstens Reviewed-by: Jarkko Sakkinen Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit b25a021675d4fabe2ba11d0af80a7dec6c17a0a8 Author: Heiko Carstens Date: Mon Nov 16 15:35:23 2026 +0100 s390/cert_store: Check key_lookup() return code in invalidate_keyring_keys() [ Upstream commit 2a102f513a68ef6771e1cf107c7f98985686ad71 ] keyring->sem is released after writing the key serial numbers into key_array. Keys corresponding to those serial numbers may have been removed before key_lookup() is called. Therefore check the return code of key_lookup() before dereferencing it. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Heiko Carstens Reviewed-by: Jarkko Sakkinen Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit 6a53766a23b0892681d7dbc2f557c65dde46cafd Author: Heiko Carstens Date: Mon Nov 16 15:35:22 2026 +0100 s390/cert_store: Fix potential use-after-free in invalidate_keyring_keys() [ Upstream commit 69e0c49331475082e0b92cbf320e3e5a1deb889e ] Drop the refcount of current_key behind all users of current_key which dereference it, like e.g. error logging. Fixes a potential use-after-free bug. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Heiko Carstens Reviewed-by: Jarkko Sakkinen Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit 6377962450d7ebd1f493050360e779e1d5104f56 Author: Heiko Carstens Date: Mon Nov 16 15:35:21 2026 +0100 s390/cert_store: Fix return code handling in invalidate_keyring_keys() [ Upstream commit 1be070c4dc6edbfb015e72156fadb49fbaef47b9 ] Add missing error handling in case key_type_keyring.read() returns an error. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Signed-off-by: Heiko Carstens Reviewed-by: Jarkko Sakkinen Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit ff1fc7f3caaff295e52fb2b7d36bcaf7e41ccdd7 Author: Jarkko Sakkinen Date: Mon Nov 16 15:35:20 2026 +0100 s390/cert_store: Hold keyring->sem while reading the keyring [ Upstream commit 008b903f55eb4bdb1af77070bb93e6e1dfa9145d ] invalidate_keyring_keys() does not hold keyring->sem while calling keyring_read(), which is contrary to what keyring assumes from its callers, and can lead to recurring bugs. KEY_FLAG_KEEP alone does not protect from e.g. the following call path: 1. keyctl_keyring_move() 2. key_move() 3. __key_unlink() Address the issue by guarding the critical section. Fixes: 8cf57d7217c3 ("s390: add support for user-defined certificates") Acked-by: Alexander Gordeev Signed-off-by: Jarkko Sakkinen Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev Signed-off-by: Sasha Levin commit 80ec409e8537d9ee21079e91af287f83bace23c3 Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:16:35 2026 -0500 Bluetooth: hci_event: Validate sent command length in LE Set Ext Adv Enable [ Upstream commit ad7c1f067df2772d73a3a34218a8f5db57ceb41c ] hci_cc_le_set_ext_adv_enable() read num_of_sets and the set entries from the last sent command without checking its length. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-42bcc244-62e6-4295-802c-f9a512ca49a3 Fixes: de181e887ac2 ("Bluetooth: Impmlement extended adv enable") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit bb79ee35726111ae7d234935d68f84ca4ecad44f Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:16:34 2026 -0500 Bluetooth: SMP: Don't create the BR/EDR channel while unregistered [ Upstream commit 8a119ba64f33dd9ab265d3b978f7811a80b7fe8a ] smp_force_bredr() created a BR/EDR SMP channel even when the controller was powered off or not LE capable, leaving a stale channel that smp_register() later warns about and leaks. Only create it when SMP is registered and guard the removal; smp_register() creates it on power on if the flag is set. Since smp_unregister() runs with hdev->lock take it around smp_register() as well so they can't race with each other nor with smp_force_bredr(). Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-a921c99c-0b41-485c-91a4-1c6e54b45b0b Fixes: 300acfdec916 ("Bluetooth: Introduce force_bredr_smp debugfs option for testing") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 3b7e4b36e21f5db27cf7bc46e678191ba85fedda Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:16:34 2026 -0500 Bluetooth: SMP: Check smp_data before using SMP_DEV() [ Upstream commit e8764a6946341e9ee809393386e7b815179c5f5f ] hdev->smp_data is NULL when the SMP channel could not be registered, so receiving a Pairing Request/Response with the OOB flag set would dereference NULL through SMP_DEV(). Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-9bc9da90-02a8-4a87-a603-87d0a4cf464c Fixes: 94f14e472812 ("Bluetooth: SMP: Fix trying to use non-existent local OOB data") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit bd5b45b9b8f09f057f97639165e1782bfb137535 Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:16:33 2026 -0500 Bluetooth: SMP: Serialize link key updates from smp_notify_keys() [ Upstream commit e428ab70fb3398e835e5d70ba4839e7c06583b83 ] smp_notify_keys() runs from the L2CAP RX path without hdev->lock, yet hci_add_link_key() and the debug key removal modify hdev->link_keys and dereference entries returned by hci_find_link_key(), so a concurrent unpair or Load Link Keys can free the entry being updated. hdev->lock can't be taken there since it is ordered before the l2cap channel lock held by the SMP receive path (see smp_user_confirm_reply()). Add a dedicated link_keys_lock protecting the writers of hdev->link_keys (add, remove and clear). SMP holds it while it adds the key, notifies mgmt and removes a debug key, so the key can't go away meanwhile, and the debug key removed by hci_link_key_notify_evt() is deleted by reference with hci_del_link_key() since a lookup by address skips the keys that are blocked. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-7482a666-d2a0-44a4-9e0d-05354860a5fa Fixes: 6a77083af57f ("Bluetooth: Add support for LE SC key generation") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 1ad172f68924246d53a1e56826ac279e6e981cc2 Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:16:32 2026 -0500 Bluetooth: hci_sync: Hold hdev->lock in hci_schedule_adv_instance_sync() [ Upstream commit c592dfe9637c65eeaff4c9f6fd869f39ad7ae472 ] The advertising instance returned by hci_find_adv_instance() was dereferenced without hdev->lock and could be freed concurrently. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-616b1f8e-06ec-4634-a907-5eb4e82f66df Fixes: cba6b758711c ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 2") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit b28c752b3493cf05cb2b6e455cd4794fb6120710 Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:16:19 2026 -0500 Bluetooth: hci_sync: Lock the lookup in hci_disable_ext_adv_instance_sync() [ Upstream commit 8984b72f9508b2d03c58a82d73881b5e1e5f5bc4 ] hci_disable_ext_adv_instance_sync() calls hci_find_adv_instance() and dereferences the instance without hdev->lock, racing with the removal of the instance. Look the instance up under the lock and only use the values copied while it is held. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-a364929c-cd00-492a-a83c-5425d042b09f Fixes: cba6b758711c ("Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 2") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit f64a8323db05aac1c82c8a13fbd1c055098cf1c4 Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:16:07 2026 -0500 Bluetooth: hci_core: Take req_sync lock in hci_power_on() [ Upstream commit 6a296a4658124490d7dddd2b751e5f9ae5c5aec7 ] hci_powered_update_sync() issues synchronous HCI commands but was called without hci_req_sync_lock(), racing with other request users. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-1baf7393-3aeb-4fa5-806f-19cea743b9f3 Fixes: cf75ad8b41d2 ("Bluetooth: hci_sync: Convert MGMT_SET_POWERED") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 8102925478a4b4920afe006350f0c073a1d4af07 Author: Luiz Augusto von Dentz Date: Mon Nov 9 16:16:07 2026 -0500 Bluetooth: mgmt: Fix read_index_list() buffer overflow [ Upstream commit cfdd650c5dabbd2f59a0e916aa8ef3f1965a3b4b ] The first pass counts only configured controllers, but HCI_UNCONFIGURED can change before the second pass, which may then write more entries than were allocated. Size the buffer from the total number of controllers as read_unconf_index_list() already does. Reported-by: Sashiko Link: https://sashiko.dev/#/bug/linux-7841362e-9b8f-465f-aa22-e99c315231e2 Fixes: 73d1df2a7a10 ("Bluetooth: Add support for Read Unconfigured Index List command") Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 8346a704161410bb5c1c3a54379a1b6d0b57303d Author: Shawn Lin Date: Mon Nov 2 08:51:29 2026 +0800 phy: rockchip: snps-pcie3: Raise the SRAM init timeout [ Upstream commit 7c2a2268bd3ddf3b2c674ebb7557ae24c22309d7 ] The SRAM initialization of the PCIe3 PHY may take longer than the 500us currently allowed, especially on a slow power-up such as at low temperature. In that case the driver reports lock failed 0x..., check input refclk and power supply even though the input refclk and power supply are fine. Raise the timeout to 20ms and use a named constant for it, applied to both the RK3568 and RK3588 paths. A non-zero sleep interval (1ms) is passed to the polling helpers so the CPU is yielded between reads. With sleep_us == 0 the helpers tight-loop, which would otherwise burn the CPU during the now much longer wait. Fixes: 2e9bffc4f713 ("phy: rockchip: Support PCIe v3") Reviewed-by: Sebastian Reichel Reviewed-by: Manivannan Sadhasivam Signed-off-by: Shawn Lin Link: https://patch.msgid.link/20261102005129.3745527-1-shawn.lin@rock-chips.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit c3b10664c70ae0f6f4c3f0222d48409a62cbba01 Author: Long Wei Date: Thu Nov 19 17:59:37 2026 +0800 kho: do not expose incoming sub-blob contents in debugfs [ Upstream commit fa1c0f103fd68558613d3df76e222463c6e4fc37 ] Incoming sub-blob pages are owned by their consumers and have independent lifetimes. Some consumers, such as LUO, restore and free their state in early_initcall, i.e. before kho_init() (fs_initcall) builds the debugfs view: early_initcall: luo_early_startup() -> kho_retrieve_subtree("LUO") -> kho_restore_free(luo_ser) /* page is freed */ fs_initcall: kho_init() -> kho_in_debugfs_init() -> phys_to_virt(luo_ser_phys) -> debugfs_create_blob("LUO", ...) debugfs therefore ends up pointing at a page that was already handed back to the page allocator, and reading the file triggers a use-after-free: # cat /sys/kernel/debug/kho/in/sub_fdts/LUO ================================================================== BUG: KASAN: use-after-free in _copy_to_user+0x37/0x60 Read of size 32 at addr ffff88810309c000 by task cat/27436 Call Trace: kasan_report+0xb9/0xf0 kasan_check_range+0x100/0x1b0 _copy_to_user+0x37/0x60 simple_read_from_buffer+0x77/0xd0 read_file_blob+0x75/0xa0 vfs_read+0x12d/0x520 ksys_read+0xc3/0x160 do_syscall_64+0x97/0x4b0 entry_SYSCALL_64_after_hwframe+0x76/0x7e The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x1fd pfn:0x10309c flags: 0x17ffffc0000000(node=0|zone=2|lastcpupid=0x1fffff) page_type: f0(buddy) ================================================================== The page is already in the buddy allocator (page_type: f0(buddy), refcount 0), which confirms it was freed before the debugfs view was created. KHO does not own these pages, so it cannot safely expose their contents at all. Drop the in/sub_fdts directory. The incoming FDT is reserved by KHO and remains exposed as in/fdt, where the same metadata is available. The incoming sub-blob debugfs directory is gone, so remove its description from the KHO admin guide as well. Note that in/sub_fdts has exposed memory KHO does not own since commit c609c144b0e8 ("kexec: add KHO parsing support"), but the use-after-free only became reachable after commit d376e4b55c9a0 ("liveupdate: centralize state management into struct luo_ser") which added kho_restore_free() Fixes: d376e4b55c9a0 ("liveupdate: centralize state management into struct luo_ser") Acked-by: Pasha Tatashin Signed-off-by: Long Wei Reviewed-by: Pratyush Yadav Link: https://patch.msgid.link/20261119095937.826980-1-longwei27@huawei.com Signed-off-by: Mike Rapoport (Microsoft) Signed-off-by: Sasha Levin commit 85906694db7c8f3891cd61169be22df381d78abd Author: Nguyen Ngoc Thang Date: Wed Nov 18 09:21:18 2026 -0500 Bluetooth: L2CAP: Use a reserved ident for L2CAP_LE_CREDITS [ Upstream commit 06b6fbe05f5c81654815ec8d864d792a226cbdac ] L2CAP_LE_CREDITS has no response, so an ident taken from conn->tx_ida for it is never released by l2cap_put_ident() and l2cap_chan_le_send_credits() has to free it right away after sending, otherwise the range is exhausted after 254 packets and credits would be sent with the invalid ident 0, which some remote stacks ignore, stalling the channel. tx_ida only exists to track requests awaiting a response, so a command without one has no business in it: every credit update allocates and frees an ident, and the ident is visible in tx_ida while the credits are in flight, so an answer to them (a L2CAP_COMMAND_REJ) is processed by l2cap_put_ident() like the answer to a request. Using a counter that doesn't consult tx_ida is not an option either, it can return the ident of a request still outstanding, and a reject of the credits would then release that request's ident and close its channel in l2cap_le_command_rej(). Reserve ident 255 for L2CAP_LE_CREDITS instead: l2cap_get_ident() never returns it (the BR/EDR range already ends at 128), so it can't collide with any request, it doesn't have to be tracked in conn->tx_ida, and a reject of it matches no outstanding request. Fixes: 6e1930ece855 ("Bluetooth: L2CAP: fix tx ident leak for commands without a response") Reported-by: syzbot+9dc8780713b11155dd74@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=9dc8780713b11155dd74 Signed-off-by: Nguyen Ngoc Thang Assisted-by: OpenCode:claude-fable-5.2 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin commit 06a8fef41e099165402fb592b0890b68ac03a46d Author: Nguyen Ngoc Thang Date: Tue Nov 17 21:49:37 2026 +0700 Bluetooth: L2CAP: return LE credits from recvmsg under the conn lock [ Upstream commit 5beb86f98c3d45f6d64be5b6d6c77480487b41b4 ] l2cap_chan_le_send_credits() allocates an ident from conn->tx_ida, sends L2CAP_LE_CREDITS and frees the ident right away, since the command has no response. The RX path frees idents in l2cap_put_ident() under conn->lock. That only works if the credits path holds conn->lock too, so that no response can be processed between the allocation and the free. The RX path does, but l2cap_sock_recvmsg() calls l2cap_publish_rx_avail() -> l2cap_chan_rx_avail() -> l2cap_chan_le_send_credits() with only the socket lock held. If the remote answers the credits packet with L2CAP_COMMAND_REJ, l2cap_put_ident() can free the ident first, and the credits path then frees it again: ida_free called for id=3 which is not allocated. WARNING: lib/idr.c:594 at ida_free+0x24c/0x2d4 lib/idr.c:594 Call trace: ida_free+0x24c/0x2d4 lib/idr.c:594 l2cap_chan_le_send_credits+0x17c/0x29c net/bluetooth/l2cap_core.c:7113 l2cap_chan_rx_avail+0xb4/0x134 net/bluetooth/l2cap_core.c:7126 l2cap_publish_rx_avail+0x110/0x168 net/bluetooth/l2cap_sock.c l2cap_sock_recvmsg+0x280/0x7b8 net/bluetooth/l2cap_sock.c:1317 The same unlocked call also updates chan->rx_credits and reads chan->sdu concurrently with the RX path. Publish rx_avail from recvmsg under conn->lock and chan->lock, taken with l2cap_chan_lock_conn() as l2cap_sock_defer() already does, before taking the socket lock to keep the conn->lock -> chan->lock -> sk_lock order. Assert conn->lock in l2cap_chan_le_send_credits() so that an unlocked caller is caught by lockdep. Fixes: 6e1930ece855 ("Bluetooth: L2CAP: fix tx ident leak for commands without a response") Reported-by: syzbot+9dc8780713b11155dd74@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=9dc8780713b11155dd74 Signed-off-by: Nguyen Ngoc Thang Signed-off-by: Luiz Augusto von Dentz Stable-dep-of: 06b6fbe05f5c ("Bluetooth: L2CAP: Use a reserved ident for L2CAP_LE_CREDITS") Signed-off-by: Sasha Levin commit 9a13e7f4eff72f904e63bb06b74c890c7dfcdbbf Author: Changyul Lee Date: Mon Nov 9 11:06:51 2026 -0500 scsi: ch: Remove the minor from ch_index_idr after device_destroy() [ Upstream commit 9f9e0b1e5399045982788a954d3461de894e40c7 ] ch_remove() removes the minor from ch_index_idr before device_destroy() removes the "sch" device. A changer probed in between can get the same minor, and its device_create() fails: sysfs: cannot create duplicate filename '/class/scsi_changer/sch0' ... ch 1:0:0:0: ch0: device_create failed The new changer is then not attached. Replace the IDR entry with NULL instead, so that ch_open() still fails with -ENXIO for the changer being removed, and remove the minor after device_destroy(). Fixes: da707c54c342 ("[SCSI] ch: fix device minor number management bug") Signed-off-by: Changyul Lee Reviewed-by: Laurence Oberman Link: https://patch.msgid.link/20261109160651.986356-1-lcy8047@gmail.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit a85a3621b9e7a0ca276a87ff943ffdd56a195485 Author: Kyle Mahlkuch Date: Wed Nov 11 11:47:41 2026 -0600 scsi: lpfc: Fix race conditions in ELS retry handling [ Upstream commit 7470a1f2a84d68d177560b78388e640771b6b94a ] This patch addresses a race condition in the lpfc driver's ELS retry event handling that can lead to a use-after-free in the lpfc_cancel_retry_delay_tmo(), where the NLP_DELAY_TMO flag is cleared before acquiring the lock to check if the retry event is queued. This creates a window where the timer can be rescheduled and fire, causing both the cancel path and the worker thread to release the same reference, resulting in a double-put and use-after-free. Moved capture ndlp and clear evt_arg1 under hbalock while dequeuing LPFC_EVT_ELS_RETRY in lpfc_work_list_done(). Signed-off-by: Kyle Mahlkuch Fixes: e47c9093531d ("[SCSI] lpfc 8.2.5 : Correct ndlp referencing issues") Reviewed-by: Hannes Reinecke Reviewed-by: Paul Ely Link: https://patch.msgid.link/dcea48dd-f76c-4bb0-9275-c12ef9bd78a2@linux.ibm.com Signed-off-by: Martin K. Petersen (Oracle) Signed-off-by: Sasha Levin commit 54102b64b4dd4bba66e324ff510c3387de6182af Author: Toke Høiland-Jørgensen Date: Wed Oct 21 14:02:36 2026 +0200 wifi: ath9k: make sure we stop the wmi tasklet on init fail [ Upstream commit ec95877e2ea1c655e914c34fa23fd51e32315fec ] The ath9k_wmi_event_tasklet() reschedules itself until device initialisation is complete, but if the initialisation fails it is never interrupted. Syzbot triggered a use-after-free in tasklet_action_common because of this. Add a guard to the reschedule logic so it aborts if wmi->stopped is set, and add a call to ath9k_wmi_event_drain() in ath9k_stop_wmi(), so we are sure that the queue is drained and the tasklet is stopped on teardown. Fixes: 1af8dc9ca726 ("wifi: ath9k: Clean up device initialisation guards") Reported-by: syzbot+e91dc13b1b37759b3d9f@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=e91dc13b1b37759b3d9f Tested-by: syzbot+e91dc13b1b37759b3d9f@syzkaller.appspotmail.com Signed-off-by: Toke Høiland-Jørgensen Tested-by: Eduard Zateev Link: https://patch.msgid.link/20261021120237.481898-1-toke@toke.dk Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin commit 2ed5d179d58a0cbd1941f2919515b09920ee8f0f Author: Miri Korenblit Date: Sat Nov 14 19:31:58 2026 +0200 wifi: iwlwifi: mvm: correctly check the API version [ Upstream commit 06cfbf21b33772266a03a580182b74233f41f2b2 ] The check for the firmware version for the reset handshake was wrong. mvm->fw->ucode_ver is the major number itself. No need to mask it with IWL_UCODE_MAJOR. We could look at the major number from IWL_UCODE_TLV_FW_VERSION but we don't remember that number and looking at fw->ucode_ver is good enough. Fixes: 0eaa1f245ac0 ("wifi: iwlwifi: mvm: don't support the reset handshake for old firmwares") Reported-and-tested-by: Chris Bainbridge Link: https://lore.kernel.org/linux-wireless/amzVtgQb2p-_nShU@debian.local/ Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20261114193144.ab54bc9717fc.I8cda260e2ef7aedd790915a17cb6832010f82aa4@changeid Signed-off-by: Miri Korenblit Signed-off-by: Sasha Levin commit d33f29254ae4963030348ccc586b5f215e134386 Author: Michail Andreas Michalopoulos Date: Fri Nov 13 02:47:44 2026 +0700 ksmbd: sign the last response of a compound that ends early [ Upstream commit 3d322b98b56628ee69e4528a52cc1f445880fa17 ] is_chained_smb2_message() ends a compound early when the next command does not fit in the request, or its response would not fit in the response buffer. Since commit e2b76ab8b5c9 ("ksmbd: add support for read compound"), __handle_ksmbd_work() then signs ksmbd_resp_buf_curr(), which is_chained_smb2_message() only moves to the response of the command just processed when it chains to the next command or reaches the last one. On an early end it returns without moving it, so for a command after the first, the previous command's response was signed again, over the iovecs of both responses, and the response of this command was left unsigned. Neither signature verifies at the client. Handle an early end as the end of the compound: pad the response to 8 bytes and make it the current one. smb2_allocate_rsp_buf() leaves room for that padding in the response buffer of a compound. Only a compound whose NextCommand points past the end of the message, or whose responses fill the response buffer, takes this path. Sashiko pointed it out in its review of an unrelated series. An AI assistant was used to draft the patch and as an independent reviewer. Fixes: e2b76ab8b5c9 ("ksmbd: add support for read compound") Signed-off-by: Michail Andreas Michalopoulos Reviewed-by: Ian Bridges Tested-by: Ian Bridges Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin commit 550830f72cfd6477ae64b29f7e93a96ea2a864d0 Author: Geert Uytterhoeven Date: Tue Oct 20 14:27:51 2026 +0200 phy: PHY_GOOGLE_USB should depend on ARCH_GOOGLE [ Upstream commit 518d5bc7a636696969e3f4a7f9c66483e4f35e1e ] The Google Tensor SoC USB PHY is only present on Google Tensor G5 (Laguna) SoCs. Hence add a dependency on ARCH_GOOGLE, to prevent asking the user about this driver when configuring a kernel without Google Tensor SoC support. Fixes: cbce66669c82ee9a ("phy: Add Google Tensor SoC USB PHY driver") Signed-off-by: Geert Uytterhoeven Reviewed-by: Manivannan Sadhasivam Link: https://patch.msgid.link/90a172c2980073a09b4f01c21a251c3d0d2d6fe5.1792499240.git.geert+renesas@glider.be Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit 8d52b555b75d98671588931e4e7e0cf4fe146318 Author: Shawn Lin Date: Thu Oct 15 11:59:47 2026 +0800 phy: rockchip: naneng-combphy: Fix overwritten PLL SSC control bit [ Upstream commit 96246dc6c16a5e5a6b4b9fde8f4ab9cdeb201088 ] rk_combphy_common_cfg_ssc() first sets RK3568_PHYREG33_PLL_SSC_CTRL on the RK3588 and RK3576 SoCs, then, for PCIe at 24MHz, programs the PLL KVCO adjust field. The latter used a plain writel() of the FIELD_PREP() value, which cleared all the other bits of RK3568_PHYREG33, including the PLL_SSC_CTRL bit that had just been set a few lines above. Use rockchip_combphy_updatel() so that only the KVCO field is updated and the SSC control bit is preserved, as the comment and the pre-consolidation code intended. Fixes: 0b31f297557f ("phy: rockchip: naneng-combphy: Consolidate SSC configuration") Signed-off-by: Shawn Lin Reviewed-by: Manivannan Sadhasivam Reviewed-by: Sebastian Reichel Link: https://patch.msgid.link/1792036787-37927-1-git-send-email-shawn.lin@rock-chips.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit ccf4dd6e6846fcb394735919d0196411556df106 Author: Michael Burch Date: Tue Oct 13 09:22:49 2026 -0500 Revert "phy: qcom: qmp-pcie: Skip PHY reset if already up" [ Upstream commit 9a07dfa7f6fe34e230de183c02a8180529091649 ] This reverts commit 910b828b22b7b91054b3bd4be676a017444b0e00. That commit skips the no-csr reset assert/deassert (and the 200-300us settle) whenever the bootloader already brought the PCIe QMP PHY up: skip_reset = qmp->skip_init && !qphy_checkbits(pcs, cfg->regs[QPHY_PCS_STATUS], cfg->phy_status); and states its own assumption explicitly: "This relies on the assumption that when skip_init is enabled and the PHY is reported as up, the bootloader has already configured the PHY correctly and the link is in a usable state." That assumption does not hold on the Dell XPS 13 9345 (X1E80100). UEFI boots from the NVMe behind pcie6a, so the PHY is always already started when Linux takes over, skip_init is true, and the reset is skipped. The link then never retrains and the root port comes up with no endpoint: qcom-pcie 1bf8000.pcie: Device found, but not active pci 0006:00:00.0: [17cb:0111] type 01 class 0x060400 PCIe Root Port (no 0006:01:00.0, no nvme at all) "Device found, but not active" is dw_pcie_wait_for_link() reporting LTSSM stuck in POLL.Active/POLL.Compliance -- receiver detected, training never completes -- so the machine cannot find its root filesystem and drops to a dracut emergency shell. v7.2 is unaffected because it always performed the reset. The commit was applied on its own as patch 1/4 of "PCI: qcom: Add link retention support"; 2/4-4/4 have not landed. Without them, qcom_pcie_host_init() still asserts PERST# and resets the controller before qcom_pcie_phy_power_on(), so the link is down while QPHY_PCS_STATUS still reports the bootloader's state, and the skip's precondition never holds. Revert it until the rest of the series lands. Fixes: 910b828b22b7 ("phy: qcom: qmp-pcie: Skip PHY reset if already up") Signed-off-by: Michael Burch Reviewed-by: Manivannan Sadhasivam Link: https://patch.msgid.link/20261013-qmp-pcie-skip-reset-revert-v1@michaelburch.net Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit 5715d9916d0a108c34b12e22f4f2dfa18352bdd3 Author: Hongling Zeng Date: Wed Sep 9 20:26:30 2026 +0800 phy: ti-pipe3: Fix clock leaks in init/exit error paths [ Upstream commit 2be6a65608a5e32b2be6f5da843b1f29f1091098 ] Two paths return without disabling the clocks that ti_pipe3_init() has just enabled, leaking clock enable references: 1. In ti_pipe3_init(), when regmap_update_bits() fails for PCIe mode, the function returns the error without calling ti_pipe3_disable_clocks(). The clocks stay permanently enabled since the PHY framework won't invoke the .exit callback on init failure. 2. In ti_pipe3_exit(), when the PHY is in SATA mode without dpll_reset_syscon, the function returns 0 early to avoid powering down the SATA DPLL (Errata i783), which also skips the ti_pipe3_disable_clocks() at the end of the function. Every init/exit cycle therefore leaks the clock enable reference taken in ti_pipe3_init(). Fix both by adding the missing ti_pipe3_disable_clocks() calls, consistent with how the DPLL program error path handles cleanup. Fixes: 234738ea3390 ("phy: ti-pipe3: move clk initialization to a separate function") Fixes: 0a0830feb2ad ("phy: ti-pipe3: fix suspend") Reported-by: Sashiko AI Closes: https://lore.kernel.org/all/20260518023657.41852C2BCB0@smtp.kernel.org/ Signed-off-by: Hongling Zeng Reviewed-by: Manivannan Sadhasivam Link: https://patch.msgid.link/20260909122630.1313205-5-zenghongling@kylinos.cn Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit a1191a797cd90092c73b5560848312fb238fce98 Author: Hongling Zeng Date: Wed Sep 9 20:26:29 2026 +0800 phy: ti-pipe3: Fix EPROBE_DEFER handling for clock resources [ Upstream commit aeb637c73631851de0965514151f7ff7bc13f940 ] ti_pipe3_get_clk() has two issues with -EPROBE_DEFER error handling: 1. When devm_clk_get() for sysclk fails, the function returns -EINVAL instead of propagating the actual error code. This masks -EPROBE_DEFER to -EINVAL, breaking the probe deferral mechanism and causing permanent driver initialization failure on systems with non-deterministic probe ordering. 2. For SATA PHY refclk, the function ignores all errors to support older DTBs missing the refclk property. However, this incorrectly ignores -EPROBE_DEFER as well, causing the driver to proceed without waiting for the clock provider to become available. Fix both issues: - Return PTR_ERR(phy->sys_clk) instead of -EINVAL to propagate all error codes including -EPROBE_DEFER - Use devm_clk_get_optional() for SATA refclk to handle optional clocks while propagating -EPROBE_DEFER and other errors Fixes: a70143bbef6b ("drivers: phy: usb3/pipe3: Adapt pipe3 driver to Generic PHY Framework") Fixes: 7f33912d2978 ("phy: ti-pipe3: Fix SATA across suspend/resume") Suggested-by: Manivannan Sadhasivam Signed-off-by: Hongling Zeng Reviewed-by: Manivannan Sadhasivam Link: https://patch.msgid.link/20260909122630.1313205-4-zenghongling@kylinos.cn Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit 9cba31473a32f068494900bb649e3743042987b4 Author: Hongling Zeng Date: Wed Sep 9 20:26:28 2026 +0800 phy: ti: pipe3: Fix clock resource leak on probe errors [ Upstream commit 6dc01e3516d79cf4d690d892499a0bd08a14285b ] When devm_phy_create() or devm_of_phy_provider_register() fails, the refclk that was enabled earlier is not disabled, causing a resource leak. Fix this by adding an error handling path to disable the clock when these functions fail. Fixes: 234738ea3390 ("phy: ti-pipe3: move clk initialization to a separate function") Signed-off-by: Hongling Zeng Reviewed-by: Manivannan Sadhasivam Link: https://patch.msgid.link/20260909122630.1313205-3-zenghongling@kylinos.cn Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit 643fc734f64b640b0c4fed906f4ebd4bd04c3bd8 Author: Hongling Zeng Date: Wed Sep 9 20:26:27 2026 +0800 phy: ti-pipe3: Fix ignored clock enable return value in init [ Upstream commit 64207b5bc6be7db5e75ba9b7eb271dbda30834e5 ] ti_pipe3_init() ignores the return value of ti_pipe3_enable_clocks(), which can lead to: 1. Unclocked hardware access if clock enable fails 2. Unbalanced clock disables in error paths ti_pipe3_enable_clocks() returns an error code when clock enable fails and rolls back any partially enabled clocks. If we ignore this error and continue, we access hardware without proper clocking, which can cause bus errors. Additionally, if we reach error paths later in the function and call ti_pipe3_disable_clocks(), we'll be disabling already-disabled clocks, causing unbalanced disable warnings. Fix this by checking the return value of ti_pipe3_enable_clocks() and returning early if it fails. Fixes: 234738ea3390 ("phy: ti-pipe3: move clk initialization to a separate function") Reported-by: Sashiko AI Reviewed-by: Manivannan Sadhasivam Signed-off-by: Hongling Zeng Link: https://patch.msgid.link/20260909122630.1313205-2-zenghongling@kylinos.cn Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit d1bd7106d97dd08763eca685be435613b3290811 Author: Felix Gu Date: Sun Sep 6 21:30:31 2026 +0800 phy: ingenic: fix unbalanced regulator disable in exit [ Upstream commit 71c1be5cc4e083852c8437bd6afcb99ee3050e8e ] exit() and power_off() both disable vcc_supply, so the regulator gets disabled twice for every power cycle, causing an unbalanced disable WARN. Drop the regulator_disable() call from the exit callback and leave the regulator to the power_on/power_off pair. Fixes: 31de313dfdcf ("PHY: Ingenic: Add USB PHY driver using generic PHY framework.") Signed-off-by: Felix Gu Reviewed-by: Manivannan Sadhasivam Reviewed-by: Paul Cercueil Tested-by: Olivier Louvignes Reviewed-By: H. Nikolaus Schaller Link: https://patch.msgid.link/20260906-ingenic-v1-1-2311f3df8ddc@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit b82dcca94233df9dbf2f7b186f9950a9b24c6d80 Author: Sasha Levin Date: Wed Oct 14 16:01:49 2026 -0400 selftests: drivers/s390x: Select uvdevice tests using the target architecture [ Upstream commit 62aef2c04e0e69a9b88affa74ff699ce5c4e8652 ] The uvdevice Makefile decides whether to build its test from uname -m, which describes the build host. A cross build for s390 on another host therefore silently omits the test, while the non-s390 branch provides no-op build and installation targets but no emit_tests target. Select the test from the target ARCH when it is given and from the host's SUBARCH otherwise, accepting both the s390 and s390x spellings, and include lib.mk unconditionally so that other architectures build, install and emit an empty runlist. ARCH itself is left unset so that a native LLVM=1 build keeps using the compiler's native target. Drop the include path derived from tools/arch/$(ARCH): the test only needs asm/uvdevice.h from the installed kernel headers, and the path does not exist for the s390x spelling. Fixes: cbac924200b8 ("selftests: drivers/s390x: Add uvdevice tests") Signed-off-by: Sasha Levin Reviewed-by: Steffen Eiden Signed-off-by: Christian Borntraeger Signed-off-by: Sasha Levin commit 6a710c8a83e2907ed7f02bd8881a7ed4d23d913b Author: Bart Van Assche Date: Mon Oct 26 12:58:08 2026 -0700 drm/msm: Fix a lock leak in msm_ioctl_gem_info_set_metadata() [ Upstream commit 1e59855738454b14021b64115f0090eafc7526ae ] If krealloc() fails, msm_ioctl_gem_info_set_metadata() returns without unlocking the GEM object. Fix this by jumping to a new label that unlocks the GEM object before the buffer is freed. This bug has been detected by the Clang thread-safety analyzer. Fixes: 1c8c354098ea ("drm/msm: Add error handling for krealloc in metadata setup") Signed-off-by: Bart Van Assche Patchwork: https://patchwork.freedesktop.org/patch/763272/ Message-ID: <9671164f87138a0caf5c69b66129bbd6faf932f8.1793044688.git.bvanassche@acm.org> Signed-off-by: Rob Clark Signed-off-by: Sasha Levin commit 8e77af45ad8b0ef6710ac6a84a6f984849910b9f Author: Rob Clark Date: Mon Nov 2 09:20:00 2026 -0800 drm/msm/gem: Clear nr_ops in lookup_ops() failure path [ Upstream commit b22f5d783eadbebe90481db0c48cecf719e71dad ] We've already dropped the references taken in the handle lookup loop, so we don't want to drop them again in msm_vma_job_free(). Signed-off-by: Rob Clark Fixes: 2e6a8a1fe2b2 ("drm/msm: Add VM_BIND ioctl") Patchwork: https://patchwork.freedesktop.org/patch/765324/ Message-ID: <20261102172001.508440-5-robin.clark@oss.qualcomm.com> Signed-off-by: Sasha Levin commit 3d352d89ead9b0d1b14a7444edbc3fc824cd2215 Author: Rob Clark Date: Mon Nov 2 09:19:59 2026 -0800 drm/msm/gem: Decrement loop idx if handle lookup fails [ Upstream commit 31708945d3647ad29f91def9d40dafa149ac66f1 ] In the out_unlock unlock loop, we should skip the op which still has the gem handle instead of gem obj ptr. Fixes: 2e6a8a1fe2b2 ("drm/msm: Add VM_BIND ioctl") Signed-off-by: Rob Clark Reviewed-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/765328/ Message-ID: <20261102172001.508440-4-robin.clark@oss.qualcomm.com> Signed-off-by: Sasha Levin commit 02f598dcae1eda8840b87308629ca248385f3806 Author: Rob Clark Date: Mon Nov 2 09:19:58 2026 -0800 drm/msm/gem: Disallow nr_bos for VM_BIND contexts [ Upstream commit b3b44f7508c7f01273ba773595b7787883ceb4e0 ] If using VM_BIND, it is invalid to attach BOs to a GEM_SUBMIT ioctl. Only the VM_BIND ioctl should be used for binding objects. Fixes: 2e6a8a1fe2b2 ("drm/msm: Add VM_BIND ioctl") Reviewed-by: Dmitry Baryshkov Signed-off-by: Rob Clark Reviewed-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/765330/ Message-ID: <20261102172001.508440-3-robin.clark@oss.qualcomm.com> Signed-off-by: Sasha Levin commit 73c339d47be3c048043a8305ead6a98d8c96cf42 Author: Rob Clark Date: Mon Nov 2 09:19:57 2026 -0800 drm/msm/gem: Fix VM_BIND range check [ Upstream commit 4f0af27c3aef5a9480712cbac4bee14f7509ae5f ] Use size_add() to guard against overflow. Reported-by: Konrad Dybcio Fixes: 3a3bef68a6c1 ("drm/msm: Fix missing VM_BIND offset/range validation") Reviewed-by: Dmitry Baryshkov Signed-off-by: Rob Clark Reviewed-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/765329/ Message-ID: <20261102172001.508440-2-robin.clark@oss.qualcomm.com> Signed-off-by: Sasha Levin commit 166fbb01e43536050db2d6113a4a8f32803007c4 Author: Tzung-Bi Shih Date: Thu Nov 5 00:20:38 2026 +0800 reset: Fix circular locking dependency in reset_controller_unregister() [ Upstream commit d1f583c1eab5e4432c7ad48a8abd27cffbc8a549 ] reset_control_acquire() and reset_control_put_internal() acquire `rcdev->lock` inside the `rstc->srcu` read-side critical section (`rstc->srcu` -> `rcdev->lock`). However, reset_controller_unregister() holds `rcdev->lock` while calling synchronize_srcu(&rstc->srcu) (`rcdev->lock` -> `rstc->srcu`), causing a lockdep circular locking dependency warning and a potential ABBA deadlock. Run synchronize_srcu() outside `rcdev->lock`. Fixes: 44a0acb2caca ("reset: protect struct reset_controller_dev with its own mutex") Signed-off-by: Tzung-Bi Shih Reviewed-by: Philipp Zabel Reviewed-by: Bartosz Golaszewski Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin commit 409dc015c8e5ecff9d9fb5b19c289ca2792b6b17 Author: Tzung-Bi Shih Date: Thu Nov 5 00:20:37 2026 +0800 reset: Fix reset_control leak when put after controller unregister [ Upstream commit f06482ceb314c8dc19f3d084b29c27af237556b5 ] After commit 8c91302a29bc ("reset: protect struct reset_control with its own mutex"), reset_control_put_internal() returns early if `rcdev` is NULL. When a reset controller is unregistered while consumers still hold reset_control handles, reset_controller_unregister() sets `rstc->rcdev` to NULL. When consumers later release their handles via reset_control_put(), the early return skips kref_put(), resulting in leaking resources. Call kref_put() in reset_control_put_internal() even if `rcdev` is NULL. Fixes: 8c91302a29bc ("reset: protect struct reset_control with its own mutex") Signed-off-by: Tzung-Bi Shih Reviewed-by: Philipp Zabel Reviewed-by: Bartosz Golaszewski Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin commit d261bb102843451d0622abe35a3dee05ac6cd8a2 Author: Hung-Chun Tseng Date: Wed Oct 21 21:21:30 2026 +0800 reset: spacemit: Fix the RCPU2 PWM reset registers [ Upstream commit 168cae7e87463c34758db2b51537937a29b753f1 ] Every entry in k1_rcpu2_resets[] uses RCPU2_PWM9_CLK_RST, so asserting or deasserting the reset of any RCPU2 PWM from 0 to 8 acts on PWM9 instead. Each PWM has its own register, RCPU2_PWMn_CLK_RST at offset 4 * n, as k1-syscon.h already defines. On a Milk-V Jupiter running the vendor kernel, which uses RCPU2 PWM2 for the fan, the RCPU2 registers read: 0x00: 0x4 0x04: 0x4 0x08: 0x1 0x0c: 0x4 ... 0x24: 0x4 Only PWM2's register has its reset deasserted, which matches one register per PWM. Use the matching register for each reset. No in-tree device tree uses the RCPU2 PWMs yet, so this has no effect on current boards, but it would break the first one that does. Build-tested only (riscv defconfig, W=1); the fix could not be tested at runtime, as mainline has no RCPU2 PWM node to exercise it. Fixes: c479d7cf06c3 ("reset: spacemit: add support for SpacemiT CCU resets") Signed-off-by: Hung-Chun Tseng Reviewed-by: Yixun Lan Reviewed-by: Troy Mitchell Reviewed-by: Philipp Zabel Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin commit 7b44f4d3ac177bc6c794faaeb0ad155edf8a2de9 Author: Colton Lewis Date: Tue Oct 27 18:06:09 2026 +0000 irqchip/gic-v4: Use a separate lockdep class for vPE doorbell IRQs [ Upstream commit 7100185bdc1162eb2eca1dd20a036314e27f1561 ] By default, init_desc() assigns the shared irq_desc_lock_class lockdep key to desc->lock for every struct irq_desc. Device drivers that register an IRQ affinity notifier establish a lock dependency chain of &irq_desc_lock_class --> &pool->lock --> &p->pi_lock --> &rq->__lock when irq_set_affinity_locked() calls schedule_work() while holding desc->lock. On GICv4 systems, scheduling out a KVM vCPU calls kvm_sched_out() -> kvm_arch_vcpu_put() -> vgic_v3_put() -> vgic_v4_put() -> its_make_vpe_non_resident() -> irq_set_vcpu_affinity() while holding the scheduler runqueue lock (&rq->__lock). Acquiring the vPE doorbell IRQ's desc->lock establishes &rq->__lock --> &irq_desc_lock_class, triggering a lockdep circular locking splat: WARNING: possible circular locking dependency detected ------------------------------------------------------ VCPU-0/109705 is trying to acquire lock: ffff0001e41e4cc8 (&irq_desc_lock_class){-.-.}-{2:2}, at: __irq_get_desc_lock+0x5c/0xb0 but task is already holding lock: ffff00dad15fd260 (&rq->__lock){-.-.}-{2:2}, at: __schedule+0x23c/0x1850 which lock already depends on the new lock. Chain exists of: &irq_desc_lock_class --> &p->pi_lock --> &rq->__lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&rq->__lock); lock(&p->pi_lock); lock(&rq->__lock); lock(&irq_desc_lock_class); GICv4 vPE doorbell IRQs are internal to KVM and GICv4, set IRQ_NO_BALANCING, and never register an affinity notifier or queue work under desc->lock. However, under forced IRQ threading (threadirqs or CONFIG_PREEMPT_RT), request_irq() creates an IRQ thread for the doorbell handler, causing irq_set_affinity() -> irq_set_thread_affinity() in vgic_v4_load() to call wake_up_process() under desc->lock and establish a real desc->lock --> &p->pi_lock --> &rq->__lock dependency on the vPE doorbell IRQ itself. Mark vPE doorbell IRQs with irq_set_nothread() so they are never force-threaded, and assign them a dedicated lockdep class in its_alloc_vcpu_irqs() via irq_set_lockdep_class(). Fixes: 8e01d9a396e6 ("KVM: arm64: vgic-v4: Move the GICv4 residency flow to be driven by vcpu_load/put") Signed-off-by: Colton Lewis Link: https://patch.msgid.link/20261027180610.2840837-1-coltonlewis@google.com Signed-off-by: Marc Zyngier Signed-off-by: Sasha Levin commit 5cc06b68cd26c492eb0ddd294baefee49ed0dfd1 Author: Kunihiko Hayashi Date: Fri Oct 2 17:41:42 2026 +0900 reset: scmi: Set the device for the reset controller [ Upstream commit e3e068a457cebe2e475535685c325d5ca305f44a ] SCMI reset driver does not set rcdev.dev when registering its reset controller. If rcdev.of_node is not available, the reset core tries to obtain the firmware node from rcdev.dev. However, rcdev.dev is also NULL, causing a NULL pointer dereference. Set rcdev.dev to the SCMI device. Signed-off-by: Kunihiko Hayashi Reviewed-by: Sudeep Holla Fixes: c8ae9c2da1cc ("reset: Add support for resets provided by SCMI") Signed-off-by: Philipp Zabel Signed-off-by: Sasha Levin commit 648c086473f0db4a40b4a584b1f55e818a32b733 Author: Fuad Tabba Date: Mon Sep 21 08:29:56 2026 +0100 irqchip/gic-v4: Unwind what its_alloc_vcpu_irqs() allocated on failure [ Upstream commit fd86d69c951765e24e89a162c53dfe33a8aba976 ] A failure in the its_alloc_vcpu_sgis() loop leaves behind both the SGI domains created for the vPEs below the failing index and the vPE irqs allocated before the loop, since irq_domain_remove() frees neither. Each leaked vPE takes its ITS state with it, a vpe_id and an LPI pending table. Free both from a second label before the existing unwind. With the freed pointers now cleared, its_free_sgi_irqs() can skip a vPE with no SGI domain and be reused there. The check has to precede the lookup: irq_find_mapping(NULL, 0) falls back to irq_default_domain, and the live irq it returns would then be freed. Fixes: 6d31b6ff985d ("irqchip/gic-v4.1: Add VSGI allocation/teardown") Reviewed-by: Yuan Yao Signed-off-by: Fuad Tabba Link: https://patch.msgid.link/20260921072958.2918477-3-fuad.tabba@linux.dev Signed-off-by: Marc Zyngier Signed-off-by: Sasha Levin commit 99b16eb7d51cfc554b8e3aee16d17772873edcae Author: Fuad Tabba Date: Mon Sep 21 08:29:55 2026 +0100 irqchip/gic-v4: Clear the domain and fwnode pointers after freeing them [ Upstream commit 861bebd1fac5f5a25c11e40aec3c3291542045d1 ] The GICv4 allocation and teardown paths free their irq domains and fwnodes but leave the pointers set, and the allocation error paths test those pointers before removing them. struct its_vm and struct its_vpe are embedded in KVM's per-VM and per-vCPU state, so nothing re-zeroes them between two attempts, and an error path taken after an earlier one already freed the domain calls irq_domain_remove() on freed memory. Reaching this takes two allocation failures, one to leave the stale pointer behind and one to send the next attempt down the error path. Fixes: 7de5c0af9c7c ("irqchip/gic-v4: Add per-VM VPE domain creation") Fixes: 6d31b6ff985d ("irqchip/gic-v4.1: Add VSGI allocation/teardown") Reviewed-by: Yuan Yao Signed-off-by: Fuad Tabba Link: https://patch.msgid.link/20260921072958.2918477-2-fuad.tabba@linux.dev Signed-off-by: Marc Zyngier Signed-off-by: Sasha Levin commit dd3d02b422e863a76076c2e60223f9ccc0292fe4 Author: Selby Mashiki Date: Sun Oct 25 21:03:22 2026 +0200 memory: tegra: fix device_node leak in tegra186_mc_probe_device() [ Upstream commit 21250426a8469d3bc43c2f0c69ed5497ee9ff7d4 ] tegra186_mc_probe_device() iterates over the "interconnects" phandles using of_parse_phandle_with_args(), which increments the reference count of args.np on each successful call, but never drops the reference with of_node_put(args.np). Call of_node_put(args.np) at the end of each loop iteration. Fixes: fe3b082a6eb8 ("memory: tegra: Add SID override programming for MC clients") Signed-off-by: Selby Mashiki Link: https://patch.msgid.link/20261025190322.449324-1-mashikiselby@gmail.com Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sasha Levin commit b029c29e550a4790a835cb7ec0bd22af1bd0e1fd Author: Myeonghun Pak Date: Wed Oct 14 20:28:52 2026 -0400 memory: tegra: Shut down Tegra210 EMC timers before teardown [ Upstream commit c5f343c189aa30285e7c73dbf2f185720467794b ] The training and refresh timers can outlive the EMC state on removal or probe failure after clock attachment, causing use-after-free. Shut down both timers before detaching the clock provider and releasing the timing tables to wait for callbacks and prevent rearming. Initialize them before clock attachment, since set_rate() can start training. Fixes: 10de21148f7d ("memory: tegra: Add EMC scaling support code for Tegra210") Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-47538f77-fb50-4a06-b49b-92dbee8b538b Link: https://patch.msgid.link/20261015002852.2159841-1-mhun512@gmail.com Signed-off-by: Krzysztof Kozlowski Signed-off-by: Sasha Levin commit 075124a64cf64d4e8a91a53fa9d4dde05a63623a Author: Oleg Keri Date: Fri Oct 9 10:26:39 2026 +0200 soundwire: qcom: disable the interrupt before gating the clock [ Upstream commit 6c067677192f054bbfa815caf04f536bb8dcdee2 ] swrm_runtime_suspend() gates hclk straight after the ClockStopNow broadcast, while the interrupt thread that completed it is still clearing the status and CLK_STOP_FINISHED is about to fire. Both touch registers with the clock going away; on x1e80100 and glymur hclk is the SoundWire clock itself. The next clock-stop exit then fails at random (bus clash, parity errors, AUTO_ENUM_FAILED) and one side of the speakers stays detached until reboot. Disable the interrupt before gating the clock and enable it again once the clock is back. Fixes: 74e79da9fd46 ("soundwire: qcom: add runtime pm support") Signed-off-by: Oleg Keri Reviewed-by: Dmitry Baryshkov Link: https://patch.msgid.link/20261009082639.22662-1-okerixx@gmail.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin commit 9f3d2502105d0ccf17db24988110a687480da1b2 Author: Connor Abbott Date: Thu Oct 29 19:02:30 2026 -0400 drm/msm: Fix GMEM_BASE on a8xx [ Upstream commit 6036663be30a411b895d4ce9ba4625abbec5943b ] This was missed during initial bringup because GMEM_BASE is not used anymore for textures on a8xx. However other things such as mesh shading still use the GMEM aperture. Fix it to match the value programmed into the registers. Fixes: 288a93200892 ("drm/msm/adreno: Introduce A8x GPU Support") Signed-off-by: Connor Abbott Reviewed-by: Konrad Dybcio Patchwork: https://patchwork.freedesktop.org/patch/764371/ Message-ID: <20261029-drm-msm-gmem-base-fix-v2-1-26b338471b46@gmail.com> Signed-off-by: Rob Clark Signed-off-by: Sasha Levin commit eee20005a606d94bcb2310f02691aacf529eb867 Author: Sudeep Holla Date: Wed Oct 28 15:32:03 2026 +0000 firmware: arm_scmi: Free mailbox state on mapping failure [ Upstream commit 38b6268eae651de1ca31c48b912a55ae3e706b94 ] mailbox_chan_setup() allocates its private state from the SCMI base device before mapping the shared-memory area. If mapping fails while setting up an optional RX channel, the core ignores the RX failure and keeps the base device bound, retaining that devres allocation. Release the private mailbox state before returning the mapping error. Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-fda9bcb5-8255-4157-bbf7-d720bbd86605 Fixes: 1ebc28e9357c ("firmware: arm_scmi: Introduce setup_shmem_iomap") Link: https://patch.msgid.link/20261028153203.3305067-1-sudeep.holla@kernel.org Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin commit e3869a66a7db1f7b95cf1501bb8ea04675e60c75 Author: Sudeep Holla Date: Wed Oct 28 13:05:02 2026 +0000 firmware: arm_scmi: Unregister notifier on enable failure [ Upstream commit b9bb2eb88037a3823e7abd096b54d0a07d428f90 ] scmi_notifier_register() adds the caller's notifier block before enabling the corresponding event at the platform. If enablement fails, the caller receives an error and can free its notifier block. A concurrent registration can retain and later enable the handler, leaving the failed caller's block in its notification chain. Event delivery can then dereference the freed block. Remove the notifier block before dropping the handler reference when event enablement fails. Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-c3c9437c-ba1a-4db6-837f-cb0950d89018 Fixes: e7c215f358a3 ("firmware: arm_scmi: Add notification callbacks-registration") Reviewed-by: Peng Fan Link: https://patch.msgid.link/20261028130502.2999676-3-sudeep.holla@kernel.org Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin commit 3ce9522a96df1e18adda21a300045cfff682347e Author: Sudeep Holla Date: Wed Oct 28 13:05:01 2026 +0000 firmware: arm_scmi: imx: Validate MISC control response size [ Upstream commit 4e3652a0ac715ba7387b072b72eaff76e761aaf9 ] scmi_imx_misc_ctrl_get() uses @num to report the number of values returned by firmware, but it did not retain the caller's value as the capacity of @val. A response with more values than the caller allocated was copied into @val unchecked. For example, the MQS regmap callback supplies storage for one value. Retain the input capacity and reject responses exceeding it before copying, then update @num only after a successful copy. Document the in/out @num contract of the exported helper. Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-6897b44a-57fb-4964-95f8-447d0ce526e4 Fixes: 61c9f03e22fc ("firmware: arm_scmi: Add initial support for i.MX MISC protocol") Reviewed-by: Peng Fan Link: https://patch.msgid.link/20261028130502.2999676-2-sudeep.holla@kernel.org Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin commit 8ae943719f4c697db76689335286d7911e58af74 Author: Sudeep Holla Date: Wed Oct 28 13:05:00 2026 +0000 firmware: arm_scmi: imx: Track copied syslog words [ Upstream commit 3baf579ba76613f65b03f43a2f2642340e5fb717 ] The MISC syslog iterator records the number of returned words plus firmware-reported remaining words in the caller's size output. The debugfs consumer uses that value to dump its fixed-size buffer. A malformed or inconsistent response can therefore make it read beyond the copied data and allocation. Return the accumulated number of words copied into the caller's buffer instead. The generic iterator bounds this count to the initial buffer capacity before processing each response. Reported-by: Sashiko Closes: https://sashiko.dev/#/bug/linux-67e325a9-473e-450a-a2a0-bf4c0c720624 Fixes: 4fa62e80c7db ("firmware: arm_scmi: imx: Support getting syslog of MISC protocol") Reviewed-by: Peng Fan Link: https://patch.msgid.link/20261028130502.2999676-1-sudeep.holla@kernel.org Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin commit 1a951ffdbaff849c3fb48f311efff08132eb3c76 Author: Zhengping Jiang Date: Thu Oct 15 06:42:23 2026 +0000 HID: vivaldi: avoid redundant feature report reads per usage [ Upstream commit 720806515cb6921ab05caaa6f470f7054b56385e ] vivaldi_feature_mapping() is invoked by report_features() in ascending usage_index order for each usage in the top-row physical keymap field. Because fetching the feature report at usage_index == 0 already reads the entire report from hardware, calling hid_hw_raw_request() again for subsequent usages redundantly reads the same report N times (e.g., 12 sequential BLE GATT reads taking ~2s on Vivaldi BLE keyboards). Bail out immediately when usage->usage_index != 0, fetch the feature report once at usage_index == 0, and iterate over all usages in the field to populate data->function_row_physmap[]. Fixes: 33bbe04a15f2 ("HID: google: extract Vivaldi hid feature mapping for use in hid-hammer") Signed-off-by: Zhengping Jiang Link: https://patch.msgid.link/20261015064223.1939367-1-jiangzp@google.com Signed-off-by: Benjamin Tissoires Signed-off-by: Sasha Levin commit a6e69829c5dbd026dab5a1fb2a50e59009265934 Author: Shashikirana H K Date: Tue Oct 13 06:46:32 2026 +0000 HID: vivaldi: Extract feature report value directly in vivaldi_feature_mapping() [ Upstream commit 8dbf66b011135422a28ee32da1d6aacbe08ddd7a ] Currently vivaldi_feature_mapping() passes the raw buffer returned by hid_hw_raw_request() to hid_report_raw_event() with the descriptor-declared report_len just to populate field->value[usage->usage_index]. Since vivaldi_feature_mapping() already has the target report, field, and usage in hand, and nothing else consumes field->value[] for this report, verify that hid_hw_raw_request() returns the expected report_len, ensure usage->usage_index is within field->report_count, and extract the value directly using hid_field_extract(). Also use __free(kfree) to simplify buffer cleanup. Suggested-by: Dmitry Torokhov Fixes: 33bbe04a15f2 ("HID: google: extract Vivaldi hid feature mapping for use in hid-hammer") Cc: Tzung-Bi Shih Cc: Sean O'Brien Signed-off-by: Shashikirana H K Link: https://patch.msgid.link/20261013-upstream-vivaldi-fix-v2-1-ecc20329d24c@chromium.org Signed-off-by: Benjamin Tissoires Signed-off-by: Sasha Levin commit 6db04a6bcba068b615b6017a57fcc96ed56976ca Author: Julian Braha Date: Tue Oct 20 23:28:17 2026 +0100 irqchip/gic-v3: Select HAVE_ARM_SMCCC_DISCOVERY only on arm64 [ Upstream commit 40b097fdfd00516ba9a568ccc10e9f166358ddca ] ARM_PSCI_FW is always enabled for arm64, and the GICv3 driver only uses HAVE_ARM_SMCCC_DISCOVERY to identify the NVIDIA T241, which is arm64 anyway. For ARM_GIC_V3, let's only select HAVE_ARM_SMCCC_DISCOVERY on arm64. Fixes: 35727af2b15d ("irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4") Suggested-by: Marc Zyngier Reviewed-by: Marc Zyngier Acked-by: Thomas Gleixner Signed-off-by: Julian Braha Link: https://patch.msgid.link/20261020222817.1231643-3-julianbraha@gmail.com Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin commit 4e1d85e5564b308b21926b2708d7c5816d7c64ae Author: Julian Braha Date: Tue Oct 20 23:28:16 2026 +0100 firmware: smccc: Provide stubs for HAVE_ARM_SMCCC_DISCOVERY=n [ Upstream commit 6cc03818814aa98c3584a346b82165f1b561f2b7 ] Add fallbacks for callers to avoid needing #ifdef guards when HAVE_ARM_SMCCC_DISCOVERY is disabled (32-bit arm). Fixes: 35727af2b15d ("irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4") Suggested-by: Marc Zyngier Signed-off-by: Julian Braha Reviewed-by: Marc Zyngier Link: https://patch.msgid.link/20261020222817.1231643-2-julianbraha@gmail.com Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin commit 54c4d5c14064c241dffd9904e7f8e8d27b586d78 Author: David Cemin Date: Tue Oct 20 15:09:01 2026 -0700 firmware: arm_ffa: Compare notify_id when looking up notifier callbacks [ Upstream commit 8ab2e426762d199ce8b799d029edafbfb981f5c6 ] The notifier callbacks are kept in a hash table keyed by notification ID, but struct notifier_cb_info does not store the ID and none of the lookup helpers compare it. hash_for_each_possible() walks the whole bucket, so any two IDs that hash to the same bucket are treated as the same registration. With the 64-bucket table, hash_32() maps IDs 2 and 36 to the same bucket. A driver that requests notifications sequentially therefore fails at the 37th request: ARM FF-A: Failed to register callback for 36 - -22 because update_notifier_cb() finds the node registered for ID 2 and rejects the new registration as a duplicate. The same lookup is used on the delivery path, so a notification for a colliding ID can also be dispatched to the callback registered for the other ID. Store the notification ID in the node and compare it in all three lookup helpers. This was found on an arm64 laptop whose embedded controller partition declares 38 notifications: the EC driver failed to probe and every EC event (AC, battery, lid, hotkeys) was lost. Fixes: e0573444edbf ("firmware: arm_ffa: Add interfaces to request notification callbacks") Fixes: c10debfe7f02 ("firmware: arm_ffa: Add support for {un,}registration of framework notifications") Signed-off-by: David Cemin Link: https://patch.msgid.link/20261020220902.611138-1-dcemin@nvidia.com Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin commit 70d1655c0fbfa875605cd475ce380ee3d8480390 Author: Rob Herring (Arm) Date: Mon Oct 5 16:05:06 2026 -0500 arm64: dts: arm: corstone1000-a320: Fix GIC redistributor region size [ Upstream commit 5ac351938cae58c5cd1b356f9d0aae2e243c11ad ] The Arm Corstone1000-A320 has a GICv4 which means the redistributor region should be 4x256KB rather than 512KB. This issue didn't become apparent as SMP was disabled as a work-around in early versions of the FVP. Fixes: 87599f1843d3 ("arm64: dts: arm/corstone1000: Add corstone-1000-a320") Reviewed-by: Liviu Dudau Signed-off-by: Rob Herring (Arm) Link: https://patch.msgid.link/20261005210506.2118052-2-robh@kernel.org Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin commit 3242b861b9465e874eb6b613faa4b44c8dd842b0 Author: Geert Uytterhoeven Date: Tue Sep 29 14:25:56 2026 +0200 firmware: arm_scmi: Update ARM_SCMI_HAVE_TRANSPORT rationale [ Upstream commit e637b774416775d09540070ceecf972c59070d90 ] Not enabling any transports no longer breaks the build. Fixes: c0397c85b53d0bc6 ("firmware: arm_scmi: Use WARN_ON() to check configured transports") Signed-off-by: Geert Uytterhoeven Link: https://patch.msgid.link/48c4bed8036dcb55f554f513ce2ae61807c5677d.1790684637.git.geert+renesas@glider.be Signed-off-by: Sudeep Holla Signed-off-by: Sasha Levin commit ad8462d7c0b92c0c46d3970d0655f4f3b1ea49aa Author: Mario Limonciello Date: Tue Sep 1 16:37:22 2026 -0500 tpm: Call cmd_ready/go_idle for each command transmission commit 313acd594a799d6b4b3af937eaca7bf4a1803c4a upstream. Some TPM implementations, particularly fTPM using the CRB interface, require the TPM to transition through idle and ready states for each command rather than once per session. The current implementation calls cmd_ready once during tpm_chip_start() and go_idle once during tpm_chip_stop(). For fTPM, when multiple commands are sent without per-command idle transitions, subsequent commands timeout as the TPM is waiting for the transition. Fix this by calling cmd_ready before each command and go_idle on all exit paths in tpm_try_transmit(). For TPM implementations that don't require per-command transitions, the callbacks return immediately based on the start method. Remove the now-redundant per-session calls from tpm_chip_start() and tpm_chip_stop() along with their helpers. This resolves timeout errors during TPM initialization on systems where BIOS has already performed TPM startup. Signed-off-by: Mario Limonciello Reviewed-by: Jarkko Sakkinen Link: https://lore.kernel.org/r/20260901213723.3017371-1-mario.limonciello@amd.com Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman commit 09d21a7aab2c74a4499610f47edb711f3c02ff74 Author: Jeff Johnson Date: Sat Nov 14 08:13:06 2026 -0800 Revert "wifi: ath10k: Stop unanswered temperature reads" commit b1ed5a45b994a6473ca1cf34f35a1bf87f1d8e2a upstream. As reported by Nicolas Escande [1] this will break some setups where temperature reporting is supported but there are occasional requests where there isn't a response. Revert this implementation where a single unreported temperature read at any time will stop all future requests. Alternate solutions are being discussed. Link: https://lore.kernel.org/all/DMRPC2GCD51O.S4DMHZFDKRFG@gmail.com/ # [1] Signed-off-by: Jeff Johnson Signed-off-by: Greg Kroah-Hartman commit 66d22556db978a72f93ab8020b7d405d173a29b6 Author: Mathias Nyman Date: Thu Nov 5 19:51:02 2026 +0200 xhci: keep port link_inactive and connected flags in sync when polled [ Upstream commit bb261776d1a29768b8fd84eb4f42d99dafa29c93 ] Update port 'link_inactive' and 'connected' flags even if xHC isn't generating port change events. xHC only generates port change events on port changes after old port change bits are cleared. Hub driver is often kept up to date by polling the port status. Sashiko reported a possible case where all port changes after a port reset take place before hub driver clears the reset change bit. This way the port can end up connected and fully running with link in u0 without a port event clearing the 'link_inactive' or setting the 'connected' flags. A protocol STALL in this state would set EP_DROP_PENDING, and prevent all future URBs for the endpoint. Fix this by also updating the flags during get_port_status(), when hub driver is polling the port state. Fixes: 6895dbdc19d9 ("xhci: give back TDs and clean up ep0 after disconnect") Link: https://lore.kernel.org/linux-usb/sashiko-outbox-190046@kernel.org/ Cc: stable Signed-off-by: Mathias Nyman Link: https://patch.msgid.link/20261105175106.241182-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin commit 9101e54f1b5c5f82e031900d0fcfdcbf5e23f132 Author: Yiyu Zhou Date: Thu Nov 26 11:21:56 2026 -0500 xhci: give back TDs and clean up ep0 after disconnect [ Upstream commit 6895dbdc19d927a2872bd4f111e1911874d5dce4 ] Fix a regression in v7.3 introduced by the commits in the Fixes tags. Those patches avoid endpoint recovery and rapid state changes after the root port link is lost. This caused a regression in device enumeration. It turns out that a subset of USB HID devices briefly disconnect during enumeration. USB core manages to resuscitate these devices without reallocating them, and thus continue using the same udev, xhci vdev and default control endpoint (ep0) of the device. xhci didn't give back or clean up halted TDs behind disconnected ports as it assumed that the disconnect cancels all URBs, and drops and frees all endpoints. This is not the case, so cancel and give back TDs on halted endpoint behind disconnected ports, make sure ep0 is cleared and in a proper state to continue working even after a link error or disconnect is detected. Also prevent new URBs until device is reset. One issue related to the TDs not being given back was seen on a PFU HHKB Professional HYBRID Type-S keyboard (04fe:0021). It drops off the bus about 300 ms after its first enumeration, while usbhid is still probing its third interface. The probe runs in hub_wq, so the disconnect is not handled until the probe returns. On a root port the HID descriptor request and its four retries in hid_get_class_descriptor() each wait for the full 5 second USB_CTRL_GET_TIMEOUT: [57685.006036] usb 3-2: new full-speed USB device number 24 using xhci_hcd ... [57685.291304] hid-generic 0003:04FE:0021.0017: input,hidraw1: USB HID v1.11 Keyboard [PFU Limited HHKB-Hybrid] on usb-0000:00:14.0-2/input1 [57711.221083] usbhid 3-2:1.2: can't add hid device: -110 [57711.221613] usbhid 3-2:1.2: probe with driver usbhid failed with error -110 [57711.221842] usb 3-2: USB disconnect, device number 24 [mn: merge EP_DROP_PENDING and link_inactive checks in xhci_urb_enqueue(), return TDs and clean up ep0 on disconnect, rewrite commit message] Fixes: 042aad8d0db6 ("xhci: prevent endpoint recovery after roothub disconnect") Fixes: 7e0ef4332ed9 ("xhci: avoid xHC endpoint changes after disconnect or link error.") Cc: stable Closes: https://lore.kernel.org/all/20261010071811.20483-1-yiyu@yiyuzhou.io/ Closes: https://lore.kernel.org/linux-usb/4MjB9K-2SoiA85WbI9iEig@dsine.de/ Tested-by: Yiyu Zhou Tested-by: Dennis Wissel Signed-off-by: Yiyu Zhou Co-developed-by: Mathias Nyman Signed-off-by: Mathias Nyman Link: https://patch.msgid.link/20261029204324.658845-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin commit 82dab002b428c790720197f9326d27751defc041 Author: Zain Aboobacker Date: Thu Nov 26 11:21:55 2026 -0500 usb: xhci: fix typos in comments [ Upstream commit d7458590f585aea58f24047195f163adc6ecb045 ] Fix various spelling mistakes in comments found by codespell. Assisted-by: Claude:claude-opus-5-5 codespell Signed-off-by: Zain Aboobacker Signed-off-by: Mathias Nyman Link: https://patch.msgid.link/20261009151624.618967-4-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman Stable-dep-of: 6895dbdc19d9 ("xhci: give back TDs and clean up ep0 after disconnect") Signed-off-by: Sasha Levin commit 5c0177723446d06e5ebaebe509c6883f246d5435 Author: Qu Wenruo Date: Sat Oct 10 16:59:49 2026 +1030 btrfs: fix the fsverity callback where unexpected range is verified [ Upstream commit 254e15591ee4590064e0c55285cdcb4f4519133c ] [BUG] There is a bug report that on v7.2 kernel, compressed extents with fsverity enabled can lead to warnings like the following: fs-verity (dm-3, inode 257): FILE CORRUPTED! pos=7471104, level=-1, want_hash=sha256:bedf0e7bc93b48694db719001a8d3e79229cc58ee638b41d4149193505090774, real_hash=sha256:ad7facb2586fc6e966c004d7d1d16b024f5805ff7cb47c7a85dabd8b48892ca7 The read itself eventually succeeds, and no read error is returned to user space. [CAUSE] Since v7.2 btrfs has enabled large data folio support, now a folio can contain multiple blocks even if the page size matches the fs block size. And even before that, btrfs already has block size < page size support, thus all involved code should assume a folio can contain multiple blocks. However the function btrfs_verify_folio() calls fsverity_verify_folio(), which verifies the whole folio, even if the read range only covers part of the folio. This forces fsverity to verify garbage data that is not yet read from disk, and causes verification failure. This is a long-standing bug, but previously it only affected bs < ps cases which is not that common. Now with the large folio support, it's much easier to trigger with bs == ps cases. [FIX] Instead of calling fsverity_verify_folio(), call fsverity_verify_blocks() to verify only the read range. Reported-by: Roger Alasà Link: https://lore.kernel.org/linux-btrfs/CAELqY9==Ter2XQPRp=gjW5T75T+7kcZCXpn5roF2L6tY6mQNxw@mail.gmail.com/ Fixes: 146054090b08 ("btrfs: initial fsverity support") Tested-by: Roger Alasà Reviewed-by: Eric Biggers Tested-by: Tito Duarte Signed-off-by: Qu Wenruo Signed-off-by: David Sterba Signed-off-by: Sasha Levin commit 560d65fbe4d37378d2ea341555c30475d58fc0e3 Author: Julian Anastasov Date: Mon Nov 2 10:28:14 2026 +0200 ipvs: honor the overload state and do not enter it forever [ Upstream commit 567ca80d77baf4c9ab635865375956084c8bb52a ] Sashiko warns that we may enter the dest overload state forever if setting the u_threshold to 1 races with the ip_vs_unbind_dest() call for the last connection for dest. The problem is that we prefer ip_vs_unbind_dest() to avoid using locks while reading the threshold. To avoid the race, add a smp_mb() in __ip_vs_dest_update_overload() that is paired with the atomic_fetch_dec() in ip_vs_unbind_dest() which allows to re-read the totalconns and to leave the overload state if we are below l_threshold_val. Also, remove the overload parameter from ip_vs_dest_update_overload() because we just need to know the current state while deciding which threshold ranges to use. This ip_vs_dest_is_overloaded() check can be in __ip_vs_dest_update_overload() instead. To avoid ip_vs_bind_dest() to enter lock just to initialize u_threshold_val to INT_MAX, do it in ip_vs_new_dest(). The LBLC and LBLCR schedulers do not honor the global overload state for cached dests, so add a ip_vs_dest_is_overloaded() check for the situations where we may fallback from overloaded dest (LBLC and LBLCR) or when we hit a cached dest (LBLC). Also, move the ip_vs_dest_set_min() call in LBLCR after the ip_vs_dest_set_erase() call that removes the most-loaded server because due to races we may work with dest that is in process of removing, i.e. ip_vs_dest_set_min() and ip_vs_dest_set_max() may return same dest. Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261019150249.1879516-2-pablo%40netfilter.org Fixes: 3ba20137287f ("ipvs: fix more races around the overload flag") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin commit abc12eb6c0353228a736f6f87e44724ceb2a57e2 Author: Julian Anastasov Date: Mon Nov 2 10:07:28 2026 +0200 ipvs: read flags and seqs in master atomically [ Upstream commit aa9afc79f57ba5ef4385aa85cfb7dd50d5c484f6 ] After we fixed the double read of cp->flags in the master with commit 3e3fe49e8678 ("ipvs: fix buffer overflow when sending sync messages") Sashiko reports that we should also read the cp->flags and the seqs atomically. So if the SEQ_MASK is set, re-read the flags and the seqs under cp->lock to provide a snapshot when sending the sync message. Fixes: 3e3fe49e8678 ("ipvs: fix buffer overflow when sending sync messages") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Link: https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260927220816.268206-1-pablo%40netfilter.org Signed-off-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin commit 2032a1f0dfb9a9c6efca636298a06d49067e75e2 Author: Josef Bacik Date: Thu Nov 26 11:13:54 2026 -0500 w1: w1_therm: lock the list of slaves for the bulk read [ Upstream commit 1e46334d38e0217f5d255dc6fd63243593052f8e ] The callbacks of the file therm_bulk_read walk the list of the slaves of the master, trigger_bulk_read() three times and therm_bulk_read_show() once, without the list_mutex which protects it. In the meantime the thread of the master may find out that a sensor has gone: write to therm_bulk_read w1_process() trigger_bulk_read() w1_slave_detach() list_for_each_entry(sl, ...) w1_unref_slave() bulk_read_slave(sl) list_del() w1_therm_remove_slave() kfree(sl->family_data) kfree(sl) SLAVE_CONVERT_TRIGGERED(sl) = 1 The walk reads, and writes to, memory which has been freed, and follows the poisoned list pointers. Take list_mutex around each of the four walks. No pointer to a slave is kept from one walk to the next. This could not be done as long as w1_unref_slave() held the mutex while it waited, in w1_therm_remove_slave(), for these very callbacks and for the readers of the sensor, who need the bus_mutex which trigger_bulk_read() holds around its second walk. Now nothing is waited for with list_mutex held, and none of the other mutexes of the subsystem is taken under it, so it can be nested inside bus_mutex. Fixes: 57c76221d5af ("w1_therm: adding bulk read support to trigger multiple conversion on bus") Cc: stable Signed-off-by: Josef Bacik Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261027-llm-char-misc-w1-v1-8-d2e6bfafb6a4@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin commit c9489b31f2138e6b288d53c140239cbc65907ba7 Author: Paulo Alcantara Date: Wed Nov 25 23:47:02 2026 -0500 smb: client: don't replay handle reopens inside SMB2_open() [ Upstream commit 9bd8ee0c16146a3d0a401b39dc4cb1a84144c956 ] cifs_reopen_file_retry() reopens a read's or write's handle with backoff, per the hard and retrans mount options, giving up on umount -f. It calls cifs_reopen_file() -> SMB2_open(), which replays replayable errors on its own, also per hard and retrans. So each reopen is retried at both layers: up to (retrans + 1)^2 opens on a soft mount, and, on a hard mount, forever inside SMB2_open() without ever returning to cifs_reopen_file_retry() to notice umount -f - a worker doing writeback then can't be stopped. Have cifs_reopen_file_retry() tell SMB2_open() not to replay, so these reopens are bounded and stopped only by cifs_reopen_file_retry(). Other callers of cifs_reopen_file() keep SMB2_open()'s replay; SMB1 opens are unchanged. A reopen reconnects the durable handle or, if the server lost it, opens the file afresh. Without SMB2_open()'s loop, a retry must open afresh again rather than reconnect, which the server would reject, and replay its last create, with the same GUID and access and keeping its access fallbacks, if that create may have been processed, or it leaks or loses a handle. Track both on the open file under fh_mutex, so concurrent reopens agree: replay only after a create that SMB2_open() built and that failed with no answer from the server, or only a retryable one to its replay, and leave the state alone after an attempt that was interrupted or never built. SMB2_open()'s own loop retried a failed durable reconnect as a fresh open with a stale GUID, and smb2_open_file()'s retry without FILE_READ_ATTRIBUTES as a fresh open, skipping the relock; have both reissue the same create, only replay a create that was built, and don't leave SMB2_open()'s own replay state behind for the caller's next create. Fixes: 69c3c023af25 ("cifs: Implement netfslib hooks") Fixes: 4f1fffa23769 ("cifs: commands that are retried should have replay flag set") Fixes: 79520587fe42 ("cifs: update the same create_guid on replay") Fixes: e255612b5ed9 ("cifs: Add fallback for SMB2 CREATE without FILE_READ_ATTRIBUTES") Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin commit 58d372071f1f2ca1a8683d43e7433e34a459f2f9 Author: Paulo Alcantara Date: Wed Nov 25 23:47:01 2026 -0500 smb: client: let umount -f stop waiting for reconnects on hard mounts [ Upstream commit f8ea398448ce4adf32493649ab6665ab1f858d10 ] Requests waiting in smb2_reconnect() or cifs_reconnect_tcon() for a reconnect wait for as long as it takes on hard mounts. With the server gone, writeback stuck there keeps umount -f hanging in sync_filesystem() while it waits for that writeback, even though retries of reads and writes started before it now give up. Count umount -f attempts per tcon and stop waiting for reconnects, as on soft mounts, once one is made after the request started waiting, waking up such requests on all channels right away. Do this for the master tcon and for the per-user tcons of a multiuser mount, skipping tcons another mount still uses. Count the references mounts hold on a tcon for that, rather than relying on tc_count, which internal references such as a reconnect worker also raise: one per tlink in a superblock's tree, dropped when the tlink leaves it, and decide under the tree lock so that pruning or building a tlink can't skew it. Have a handle reopen started before umount -f stop short of a reconnect it would otherwise wait for afterwards, and have a retried read check for umount -f again after backing off. Requests started after umount -f are unaffected. Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Stable-dep-of: 9bd8ee0c1614 ("smb: client: don't replay handle reopens inside SMB2_open()") Signed-off-by: Sasha Levin commit 07d02c61434fb3ce4ccca640877c8d2a59d87721 Author: Paulo Alcantara Date: Wed Nov 25 23:47:00 2026 -0500 smb: client: retry writeback after losing the connection, share or handle [ Upstream commit 59d223256f5912263a1a8d2b5b0c5abf9542cf7d ] Writeback still fails, dropping its data, when a write gets back an error that only means the client lost track of the server for a while: - -EHOSTDOWN from smb2_reconnect() when a soft mount's server stays unreachable for longer than the reconnect wait, or from STATUS_HOST_UNREACHABLE, - -EREMCHG from STATUS_NETWORK_NAME_DELETED, for which the receive path already marks the tcon for reconnect, - -EBADF from STATUS_FILE_CLOSED or STATUS_INVALID_HANDLE, e.g. after the server lost a durable handle, - -ENETRESET and -ESHUTDOWN from STATUS_CONNECTION_RESET and STATUS_REMOTE_DISCONNECT, - any replayable error on SMB1, whose async write never retries them, while it retries writes cut short by a reconnect forever, regardless of soft mounts. Reopening the handle needed by a read or write is worse: cifs_prepare_write() and cifs_issue_read() retry cifs_reopen_file() only on -EAGAIN, with no limit and no delay, and fail on anything else. A server failing the reopen with a status mapped to -EAGAIN, such as STATUS_INSUFFICIENT_RESOURCES, makes them spin forever, past umount -f and, when netfs retries from a worker, with no signal to stop them, while any of the errors above fails writeback right away. Retry writeback failing with any of these, as already done for interrupts and allocation failures, with backoff and giving up on umount -f. On -EBADF, have the retry mark the handle invalid, so that it gets reopened, unless it got reopened since the write was issued: a late -EBADF would otherwise get the new handle replaced too, leaving it open on the server along with any byte-range locks pushed to it. Subrequests of the same request can fail -EBADF concurrently on different channels, so record the bad reopen generation atomically (keeping the newest), decide the invalidation under the handle lock, and have a reopen publish its new fid before its generation so a -EBADF is attributed to the fid that was actually sent. When writeback finally gives up on any of these errors, record -EIO for it instead, so that fsync(2) and close(2) don't return transient or internal errors such as -EAGAIN or -ERESTARTSYS. Retry reopens as the read or write needing them gets retried: as above for writeback, otherwise per the hard and retrans mount options on replayable errors, with backoff and giving up on umount -f. If any channel of the session got reconnected meanwhile, retry once regardless, as the reconnect may be what failed the reopen; the next attempt waits for the reconnect to finish. Never retry reopens on interrupts or once the task is dying, so that dying tasks don't spin there; for writeback, issue the subrequest without credits instead, as done for dying tasks, so that it gets retried from the netfs collector, where no signals are pending. Don't reopen for requests that predate a umount -f either, unless it is a first attempt on a connected server, as with issuing them. Once a reopen for writeback gives up, fail the other subrequests of the request right away, rather than each waiting out a retry window of its own. Reopen handles for reads in prepare, before acquiring credits, as already done for writes, so that reads don't hold credits across a reopen. A read whose handle or credits went stale before it could be sent is retried regardless of mount options, after the backoff, so that prepare reopens and takes fresh credits; check a write's credits the same way. Fixes: 69c3c023af25 ("cifs: Implement netfslib hooks") Reviewed-by: David Howells Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org Stable-dep-of: 9bd8ee0c1614 ("smb: client: don't replay handle reopens inside SMB2_open()") Signed-off-by: Sasha Levin commit 2504375fac5771807ffee85023e1efe3649155e2 Author: Paulo Alcantara Date: Wed Nov 25 23:32:38 2026 -0500 smb: client: don't fail writeback preparation if the task is dying [ Upstream commit 29ead886deaa1344a43ab68b1ea305ea2c86c378 ] cifs_prepare_write() may need to reopen an invalidated handle and to wait for credits, both from the context of the task doing writeback. A dying task gets the reopen refused at send time and the killable credit wait interrupted, so the subrequest is failed and, as with refused sends, its folios end writeback clean and the data is lost. For writeback in a dying task, skip both and prepare a credit-less subrequest capped at SMB2_MAX_BUFFER_SIZE, as already done when the server is low on credits. It gets issued from cifswritebackd, which reopens the handle if needed and takes a single credit when sending, neither of which can be interrupted there. Do the same when the reopen or credit wait fails because a fatal signal arrived meanwhile. cifs_begin_writeback() reopens the handle too when all the writable ones got invalidated, e.g. by a reconnect. If that fails, there is no upload stream, so netfs ends writeback of every folio clean with no error recorded. Take an invalidated handle as is there and leave reopening it to cifs_prepare_write(). If there is no writable handle at all, record -EIO for the mapping, so that the loss gets reported. Fixes: 3ee1a1fc3981 ("cifs: Cut over to using netfslib") Reviewed-by: David Howells Signed-off-by: Paulo Alcantara Cc: stable@vger.kernel.org [ sashal: moved cifs_writeback_dying() above cifs_prepare_write() so the new calls compile, because the earlier backport had left it after that function. ] Signed-off-by: Sasha Levin commit 559b8d2cf59d26f6cbf826cde849ec8c796f83cb Author: Paulo Alcantara Date: Wed Nov 25 23:46:58 2026 -0500 smb: client: remove commented-out cancel_*_requests() calls [ Upstream commit a40b17cc9ecaaa85c3615963ec21cfed1c734340 ] Drop these leftover commented-out calls. Signed-off-by: Paulo Alcantara Reviewed-by: David Howells Cc: Namjae Jeon Cc: Ronnie Sahlberg Cc: Shyam Prasad N Cc: Tom Talpey Cc: Bharath SM Stable-dep-of: 9bd8ee0c1614 ("smb: client: don't replay handle reopens inside SMB2_open()") Signed-off-by: Sasha Levin commit b93436c579eff316b7ad99a10f9de8ac917c1e6f Author: Takashi Iwai Date: Mon Nov 23 10:34:26 2026 +0100 Revert "ALSA: hda/realtek: Fix silent speaker on Higole F9B" [ Upstream commit b9fd2f07df77076f83a58fe7a5640cbcbc5a61ff ] This reverts commit 2a8ee6897302ca12ff39e8eb180503956797c60c. We've received a regression report due to this commit, and it turned out that the PCI SSID for this quirk entry is too generic (10ec:111e) that may match with several different models. Usually a workaround would be to apply the quirk for a more unique ID such as codec SSID, but in this case, unfortunately, the codec SSID is also 10ec:111e, so BIOS is in a premature state. For addressing the regression, revert the change for now. Fixes: 2a8ee6897302 ("ALSA: hda/realtek: Fix silent speaker on Higole F9B") Reported-by: Cristian-Marian Fotache Closes: https://lore.kernel.org/CACGjpbf73XdwrG34ffjmYU3ZYuStPpFNXf9w+AGYcTmLyHCN_w@mail.gmail.com Link: https://patch.msgid.link/20261123093436.48511-1-tiwai@suse.de Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin commit 29f3bb41bb310a9731bcbfccca5facb0e6805216 Author: Rafael J. Wysocki Date: Tue Nov 17 20:09:45 2026 +0100 ACPI: PM: Avoid initializing power management for absent devices [ Upstream commit b91ad39f29ceeee3e3d37eedff6b7c912855623c ] Commit 2f4ddf2bd1ba ("ACPI: scan: Stop calling acpi_bus_init_power() early") removed a device presence check from acpi_bus_init_power() which in some cases causes power management to be initialized for an ACPI device object and never used going forward. That in turn may prevent power management from working as expected for other devices. Namely, if a given ACPI device object is not enabled according to its _STA, find_child_checks() will return an error for it which will prevent it from being used as an ACPI companion for a PCI device. Thus if acpi_device_init_power() initializes power management for it and its initial power state turns out to be different from D3cold, it may stay in that power state forever. If it has power resources and they are "on" during the initialization, they may be reference-counted and never turned off. If they are shared with other devices, they will prevent power from going down after attempting to put the other devices into low-power states. To prevent that from happening, restore the device presence check in acpi_bus_init_power(), but also adjust find_child_checks() to return an error for absent devices (instead of doing that for disabled devices) in accordance with acpi_bus_init_power() and the existing check in acpi_bus_attach(). Fixes: 2f4ddf2bd1ba ("ACPI: scan: Stop calling acpi_bus_init_power() early") Reported-by: Alan Borzeszkowski Tested-by: Alan Borzeszkowski Signed-off-by: Rafael J. Wysocki Tested-by: Mika Westerberg Reviewed-by: Mika Westerberg Link: https://patch.msgid.link/13013440.O9o76ZdvQC@rafael.j.wysocki Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin commit 012df0a5272d57045c9351c31337dcc8e3e02a1b Author: Theodore Ts'o Date: Wed Nov 25 20:13:01 2026 -0500 ext4: don't track metadata buffers on an inode during fast commit replay [ Upstream commit aceadbccd428fb8e6593b27a3091d961f80225d1 ] Fast commit replay runs without a journal handle and before EXT4_SB(sb)->s_journal is set, so it effectively runs in nojournal mode. __ext4_handle_dirty_metadata() then hands every extent tree block and directory block it dirties to mmb_mark_buffer_dirty(). Commit d4fdde3257a5 ("fs: set I_METADATA_WRITEBACK in mmb_mark_buffer_dirty()") sets this flag on the inode, which can trigger a NULL pointer dereference on a per-cpu pointer during the fast commit replay. This is because the iput at the end of each fast commit update triggers write_inode_now(), and with I_METADATA_WRITEBACK set, writeback_single_inode() will end up calling ext4_writepages(), before ext4_percpu_param_init() has initialized s_writepages_rwsem. A similar crash was fixed in commit 0ecd56573c1f ("ext4: Avoid entering writeback paths during fastcommit replay") by not setting this flag in ext4_mark_iloc_dirty(). This commit applies the same fix to __ext4_handle_dirty_metadata(). Once the fast commit replay is complete, jbd2_journal_recover() syncs and flushes the whole block device, o the buffer is still written out before the mount proceeds. Reproduced with generic/311 using "-O inline_data,fast_commit" (the ext4/adv test configuration). Fixes: d4fdde3257a5 ("fs: set I_METADATA_WRITEBACK in mmb_mark_buffer_dirty()") Cc: stable@vger.kernel.org Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin commit 21d5ed5caf3fcf1d0588e0a41470acf551c342ba Author: Olga Kornievskaia Date: Fri Nov 6 22:12:31 2026 -0500 NFSv4: wake blocking lock waiters when a delegated lock is released [ Upstream commit e8433473eca284bc561373d0a0fff632f76aa594 ] When the client holds a delegation, _nfs4_proc_setlk() caches POSIX locks locally and never sends a LOCK to the server. It has to strip FL_SLEEP to do so, since that branch runs holding sp->so_delegreturn_mutex and nfsi->rwsem and F_SETLKW can block indefinitely. A contending waiter is therefore never placed on the VFS blocked-lock list, and locks_wake_up_blocks() does not reach it when the holder releases. The waiter blocks in nfs4_retry_setlk() on clp->cl_lock_waitq instead, whose only waker is nfs4_callback_notify_lock(). The server never saw a LOCK for a cached lock, so it does not know anyone is waiting and will never send a CB_NOTIFY_LOCK; nfs4_proc_unlck() returns early without sending LOCKU for the same reason. The waiter sleeps out the full NFS4_LOCK_MAXTIMEOUT of 30s before retrying a lock that is long free. Wake cl_lock_waitq when releasing a cached lock. The releasing thread cannot tell which waiter wants the lock, so the wakeup names only the inode; make the owner comparison in nfs4_wake_lock_waiter() conditional on cbnl_valid so that a CB_NOTIFY_LOCK still wakes exactly the owner it names. The inode restriction matters: without it every blocked locker for the server is woken, and those on non-delegated state each retry with a LOCK RPC. Fixes: a1d617d8f134 ("nfs: allow blocking locks to be awoken by lock callbacks") Assisted-by: Claude Opus 5 Signed-off-by: Olga Kornievskaia Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit b267e6dc9dc4a85abec2cf3f5f3d3fad59bbe8cd Author: Bartosz Golaszewski Date: Wed Nov 25 15:49:25 2026 -0500 gpio: mvebu: fix sleeping-while-atomic in mvebu_gpio_level_irq_mask() [ Upstream commit 42269cdb3d3b46ba6e80f31d0e00d0bdcff1d8d4 ] mvebu_gpio_write_level_mask() is called with a raw spinlock taken but the underlying regmap uses a standard spinlock which can sleep on RT_PREEMPT kernels. Add the .use_raw_spinlock attribute to the appropriate regmap config. Cc: stable@vger.kernel.org Fixes: 2233bf7a92e7 ("gpio: mvebu: switch to regmap for register access") Fixes: 4d305c227312 ("gpio: mvebu: name regmaps to fix debugfs collisions") Closes: https://sashiko.dev/#/bug/linux-6bee0c4f-384c-494c-868e-07c420195d13 Reviewed-by: Linus Walleij Link: https://patch.msgid.link/20261109-gpio-mvebu-sleeping-while-atomic-v2-1-41f070421e70@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin commit cb528d79d9f15a47f87406ab7f3c0030998d5bfe Author: Rosen Penev Date: Wed Nov 25 15:49:24 2026 -0500 gpio: mvebu: name regmaps to fix debugfs collisions [ Upstream commit 4d305c2273123119c27d6e4c822215e650c451e3 ] Each marvell,armada-370-gpio node provides both 'gpio' and 'pwm' register windows, and the driver creates one regmap per window on the same platform device. The shared regmap_config was unnamed, so both maps defaulted their debugfs directory to dev_name(), e.g. debugfs: 'f1018100.gpio' already exists in 'regmap' because the PWM regmap (and on Armada XP the per-CPU regmap) claimed the same directory as the GPIO regmap. Give each regmap a distinct .name so the debugfs directories become '.gpio', '.percpu' and '.pwm'. This only affects debugfs naming; register access is unchanged. Assisted-by: opencode:big-pickle Signed-off-by: Rosen Penev Reviewed-by: Linus Walleij Link: https://patch.msgid.link/20260905004334.177074-1-rosenp@gmail.com Signed-off-by: Bartosz Golaszewski Stable-dep-of: 42269cdb3d3b ("gpio: mvebu: fix sleeping-while-atomic in mvebu_gpio_level_irq_mask()") Signed-off-by: Sasha Levin commit 02a44a9bc5e6c58140e60a5784e4d1b495a3aff7 Author: Ian Bridges Date: Wed Nov 25 15:30:32 2026 -0500 ksmbd: skip metadata-only stream opens in the delete check [ Upstream commit 2f14fe2d589583ce649b2bf1b449cc9839abda8b ] A metadata-only named-stream open without FILE_SHARE_DELETE blocks a later DELETE open of the file. It also blocks setting the file delete pending. Ignore a stream open unless its effective access includes data, execute or delete access. Reuse the sharing-access helper so overwriting a stream, or creating one on an existing file, still counts as FILE_WRITE_DATA. The Time Machine AFP_AfpInfo synthesis keeps only its requested access. Fixes: 19043971c947 ("ksmbd: honor stream delete sharing for base file") Cc: stable@vger.kernel.org Signed-off-by: Ian Bridges Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin commit 659edcc3e1d484696c1db68700e882b43db79e2f Author: Ian Bridges Date: Wed Nov 25 14:50:20 2026 -0500 ksmbd: skip metadata-only opens in sharing checks [ Upstream commit 81fefb6c635489e71e286d1465b6dd1d0a27ceec ] A READ_CONTROL open without sharing can block later reads, writes and deletes even though it holds no data, execute or delete access. Keep the existing attribute-only exception. For other pairs, require both effective access masks to hold one of those rights. MS-FSA 2.1.5.1.2 grants FILE_WRITE_DATA when an open overwrites a file or stream, or creates a named stream on an existing file. Use that granted access for sharing checks while keeping the requested access on the returned handle. The Time Machine AFP_AfpInfo synthesis keeps its requested access. ksmbd implements FILE_SUPERSEDE by truncating the file, so count it as a write. This also prevents an overwrite from truncating a file while another open that holds data, execute or delete access does not share writing. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org Signed-off-by: Ian Bridges Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin commit 46eeab6acabd395c5367cd39f45659d1641b923d Author: Ian Bridges Date: Wed Nov 25 14:37:27 2026 -0500 ksmbd: let the parent's DACL grant DELETE and FILE_READ_ATTRIBUTES [ Upstream commit 4ab80fd4d1f1c4363b336ddb3d8818ea37c4997d ] FILE_DELETE_CHILD on a directory can grant DELETE on its children. FILE_LIST_DIRECTORY can similarly grant FILE_READ_ATTRIBUTES. Because ksmbd checks only the child's DACL, it can refuse rename, deletion and attribute opens that the parent permits. When the child does not grant an explicitly requested DELETE or FILE_READ_ATTRIBUTES, check the parent for FILE_DELETE_CHILD or FILE_LIST_DIRECTORY. Use exact SID matching, evaluate group allows and denies, and exclude guest and anonymous sessions from Authenticated Users. Fail closed on non-inherit-only object deny ACEs, missing or unreadable parent DACLs and the mount root. For the strict parent check, let applicable group and OWNER RIGHTS ACEs decide before the POSIX ACL fallback. Otherwise a POSIX ACL entry can hide a FILE_DELETE_CHILD grant. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Cc: stable@vger.kernel.org Signed-off-by: Ian Bridges Signed-off-by: Namjae Jeon Signed-off-by: Sasha Levin commit 1240c8b394094a9c4d8a819b1cc0d40b77b0727a Author: Tejun Heo Date: Wed Nov 25 14:19:42 2026 -0500 sched_ext: Fix ops.enqueue/dispatch() calls before ops.cpu_online() [ Upstream commit 2227a34ff7bfcf6112931039e3554f4b70b65ab9 ] ops.cpu_online() documents that the cpu doesn't call ops.enqueue() or ops.dispatch() before that op. Both are gated on SCX_RQ_ONLINE, which follows the core's rq online state through the ext class's rq_online and rq_offline hooks. On a runtime cpu up, sched_cpu_activate() runs: 1. set_cpu_active() marks the cpu active. 2. cpuset_cpu_active() rebuilds the sched domains synchronously, and rq_attach_root() puts the rq online as the cpu is active now. The rq_online hook sets SCX_RQ_ONLINE. 3. scx_rq_activate() calls the root's ops.cpu_online(). Between 2 and 3, ops.enqueue() can be called for tasks woken or migrated onto the cpu, and ops.dispatch() can run on it. The hooks can't call the ops. They run under the rq lock with IRQs off while the ops can be sleepable BPF programs, and handle_hotplug() needs the rebuilt sched domains for its idle topology update. Track SCX_RQ_ONLINE in handle_hotplug() alone. Set it right after the root's ops.cpu_online(). Clear it and move the cpu's tasks to its local DSQ when the cpu goes down. Sched domain rebuilds, which take a live cpu's rq offline and online again, no longer touch the flag, so a remote dispatch can't see it cleared by a rebuild and bounce to the global DSQ. Between 2 and 3, tasks that land on the cpu now go to its local DSQ without ops.enqueue(), and with sub-schedulers a task whose scheduler lacks caps on the cpu is admitted anyway and counted in SCX_EV_SUB_FORCED_ADMIT. Both already happen between 1 and 2. Fixes: 60c27fb59f6c ("sched_ext: Implement sched_ext_ops.cpu_online/offline()") Cc: stable@vger.kernel.org # v6.12+ Signed-off-by: Tejun Heo Reviewed-by: Andrea Righi [ sashal: Moved the SCX_RQ_ONLINE set/clear into handle_hotplug() and placed the ecaps reseed after it, dropping context lines for helpers and a flag this tree lacks and using the older comment wording. ] Signed-off-by: Sasha Levin commit 65ee75cf1b3ccf056912373f215847b2704fded0 Author: Stefan Haberland Date: Wed Nov 25 12:41:51 2026 -0500 s390/dasd: Re-initialize RCD buffer with "V1.0" before every start [ Upstream commit 25cdc1f63227a1ea69a1ec823a8a860e33299169 ] Under z/VM the Read Configuration Data (RCD) buffer has to start with EBCDIC "V1.0" to request the virtual device SNEQ that carries the minidisk UIT. The request and the response share the same buffer: CP evaluates the magic on the way out and the RCD data is written into the same buffer on the way back. The magic is only written when the request is built and again in read_conf_cb() when the original request fails. Several restart paths do not run that callback: - ERP use the same buffer and if the same error occurs again, the ERP restarts the existing ERP request; if a different error occurs, it adds another ERP request. Neither re-initializes the magic. - Terminated (timed out) ERP requests, killed requests and requests requeued after the last path was gone are restarted without it. - dasd_sleep_on_immediately() overwrites cqr->callback, so read_conf_cb() never ran for dasd_eckd_read_conf_immediately(), and its fastpath retries in dasd_int_handler() do not call a callback either. If such a restart succeeds, z/VM omits the virtual device SNEQ, the UID of that path is built without the UIT and the paths are reported as "Not all channel paths lead to the same device" although they lead to the same minidisk. Every start of a request, whatever path led to it, goes through dasd_start_IO(). Add an optional prepare_io function to the request that dasd_start_IO() calls before every start of the request and of its ERP requests, and use it to write the magic for RCD requests. The ERP handling stays unchanged. read_conf_cb() is no longer needed and is removed, which also gets rid of its memset() that only cleared a single byte. Fixes: 5915a873fcb1 ("[S390] dasd: re-initialize read_conf buffer for retries") Cc: stable@vger.kernel.org Reviewed-by: Jan Höppner Signed-off-by: Stefan Haberland Link: https://patch.msgid.link/20261112102608.1057852-3-sth@linux.ibm.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin commit 9ecc698e25eab812c09ecb7991f013468f2348ed Author: Stefan Haberland Date: Wed Nov 25 12:41:50 2026 -0500 s390/dasd: Fix typo 'immediatly' -> 'immediately' [ Upstream commit ae6f19236b5ae4eef4df2780d51bee19add0eba8 ] Fix typo in function name dasd_sleep_on_immediatly(). Suggested-by: Heiko Carstens Reviewed-by: Jan Höppner Signed-off-by: Stefan Haberland Link: https://patch.msgid.link/20261112102608.1057852-2-sth@linux.ibm.com Signed-off-by: Jens Axboe Stable-dep-of: 25cdc1f63227 ("s390/dasd: Re-initialize RCD buffer with "V1.0" before every start") Signed-off-by: Sasha Levin commit 95d0dc1f3f8993e0525f89613715636e36e33975 Author: Anton Lundin Date: Wed Nov 25 12:37:25 2026 -0500 hwmon: (nct6775) Handle dual use registers [ Upstream commit ca1abdd1a9b9ce51713a18c8905bf10579533c3b ] The REG_TARGET register has different meaning, depending on if pwm is in thermal_cruise or speed_cruise. This means we can't assume it's always word sized, so we need to handle it differently depending on which mode we're in. The code already does this, but the register was configured as word sized for the speed_cruise mode, which would do the wrong thing in thermal_cruise mode. Fixes: 6c009501ff20 ("hwmon: (nct6775) Add support for NCT6102D/6106D") Fixes: 29c7cb485b32 ("hwmon: (nct6775) Integrate new model nct6116") Fixes: 437b3c2a4bdc ("hwmon: (nct6775) Add support for NCT6126D") Cc: stable@vger.kernel.org Signed-off-by: Anton Lundin Link: https://patch.msgid.link/20261109082511.851377-2-glance@ac2.se Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin commit 5ab4fd00004941205d388e324adf95d45b68d368 Author: Tim Menninger Date: Wed Nov 25 11:41:09 2026 -0500 pNFS: avoid repeatedly cancelling I/O for the same lseg [ Upstream commit 9e28836b480c66cca4c3d391177f5b3a50927f7d ] Commit b739a5bd9d9f ("NFSv4/flexfiles: Cancel I/O if the layout is recalled or revoked") added I/O cancellation when a layout segment is invalidated while outstanding references remain. The invalid segment stays on the layout's segment list until those references drain. Subsequent scans can find it again and repeatedly invoke the layout driver's cancel_io() callback. For flexfiles, this cancels matching RPC tasks and disconnects data server RPC clients. During RPC/RDMA data server recovery, repeated cancellation can cause a reconnect loop that consumes essentially all client CPU and prevents forward progress. Record cancellation requests per mirror stripe in the flexfiles layout segment. Each stripe is cancelled at most once, regardless of how many times the invalid segment is encountered. A per-stripe bitmap rather than a single per-segment bit preserves the ability to cancel I/O to a different device after an earlier device-specific cancellation. Cancellation is best-effort. An RPC that has already passed the layout-validity check may not yet be visible to the cancellation scan. Such I/O retains its lseg reference and remains subject to the normal RPC completion and recovery paths. Suppress repeated cancellation and disconnect requests without changing the existing lseg lifetime and deferred layout-return accounting. This reproduced on 6.8.0, 7.0.0, and 7.4.0-rc1. It was tested on 7.4.0-rc1 with sustained pNFS/flexfiles I/O over RPC/RDMA while restarting the NFS service on a data server. Without it, repeated cancellation led to a reconnect loop and no workload recovery. With it, the client recovered after the data server returned. Fixes: b739a5bd9d9f ("NFSv4/flexfiles: Cancel I/O if the layout is recalled or revoked") Cc: stable@vger.kernel.org Signed-off-by: Tim Menninger Signed-off-by: Anna Schumaker Signed-off-by: Sasha Levin commit 7fdf0a985a13b9d044fa2f2264e15712360e6b39 Author: Benjamin Coddington Date: Wed Nov 25 11:41:08 2026 -0500 pNFS: allow layout drivers to cancel I/O to a single device [ Upstream commit 94dc092b208ad324981caa85fcf8416b905ca593 ] The ->cancel_io() layout operation cancels all in-flight I/O for a layout segment that is being returned. When the return is triggered by the failure of a single mirror instance, cancelling I/O to the healthy mirrors is both unnecessary and harmful: requests that were already transmitted cannot be un-sent, and will complete on the data servers after the layout has been returned. Give ->cancel_io() a device ID argument identifying the failed device, and thread it through pnfs_error_mark_layout_for_return() and pnfs_mark_matching_lsegs_return(). The flexfiles implementation compares it against the raw device ID from the layout, so that it can identify the failed mirror instance even when its device ID node was never instantiated. A NULL device ID preserves the existing cancel-everything behavior, and all callers pass NULL for now, so this patch makes no change in behavior. Assisted-by: Claude:claude-fable-5 Signed-off-by: Benjamin Coddington Reviewed-by: Tigran Mkrtchyan Signed-off-by: Anna Schumaker Stable-dep-of: 9e28836b480c ("pNFS: avoid repeatedly cancelling I/O for the same lseg") Signed-off-by: Sasha Levin commit 09f7136bae5c875d5496bf46e2a56be04e7fc61b Author: Benjamin Coddington Date: Wed Nov 25 11:41:07 2026 -0500 NFSv4/flexfiles: report the intended opnum when DS connection setup fails [ Upstream commit 3a612faba5c40a59257db50e3a2da30c02a8c969 ] When nfs4_ff_layout_prepare_ds() cannot establish a connection to a data server, it records a device error with opnum OP_ILLEGAL, since no operation ever made it to the wire. But servers can use the ff_ioerr4 opnum to distinguish failed read-class operations from write-class operations when deciding how to recover the affected mirror -- a mirror that may have missed writes needs to be brought back in sync, while one that merely failed to serve a read does not. OP_ILLEGAL gives the server nothing to act on. Every caller of nfs4_ff_layout_prepare_ds() knows which operation it was preparing to send, and the existing fail_return argument already divides the callers along the same boundary (false for READ, true for WRITE and COMMIT). Replace the boolean with the intended opnum, derive the layout return decision from it, and report it in the tracked device error instead of OP_ILLEGAL. Assisted-by: Claude:claude-fable-5 Signed-off-by: Benjamin Coddington Reviewed-by: Tigran Mkrtchyan Signed-off-by: Anna Schumaker Stable-dep-of: 9e28836b480c ("pNFS: avoid repeatedly cancelling I/O for the same lseg") Signed-off-by: Sasha Levin commit e9daec3c3147dfcecf582c74e9f653f327029fa0 Author: Christian Brauner Date: Wed Nov 25 11:40:09 2026 -0500 fs: set I_METADATA_WRITEBACK in mmb_mark_buffer_dirty() [ Upstream commit d4fdde3257a577f184b4498d040f6fe20be72326 ] ext2, ext4 without a journal, fat, udf and minix track the metadata buffers of an inode in a mapping_metadata_bhs list and sync them from ->sync_inode_metadata() and ->evict_inode(). The inode block itself is only tracked by I_METADATA_WRITEBACK which ->write_inode() sets after copying the inode into its buffer. Set the bit in mmb_mark_buffer_dirty() as well so that it covers all the metadata an inode may still have to write out. Set it after the buffer is on the list. An fsync() that sees the bit then also finds the buffer when it walks the list, and one that cleared the bit before we set it leaves it set for the next one. The inode itself may never have been dirtied. fat for example tracks the FAT buffers on a private inode that nothing marks dirty. So attach the inode to a wb before setting the bit, the way ext4_mark_iloc_dirty() does, or writeback_single_inode() has no wb to lock once evict() syncs it. That lets evict() write out everything the bit tracks in one place instead of every ->evict_inode() calling mmb_sync() itself. Suggested-by: Jan Kara Cc: stable@vger.kernel.org # v7.3 Link: https://patch.msgid.link/20261109-work-inode-metadata_writeback-v3-8-91ac6c024018@kernel.org Reviewed-by: Jan Kara Signed-off-by: Christian Brauner (Amutable) Signed-off-by: Sasha Levin commit a6782f2d5b2d76b3aea95df49f7165e43a552759 Author: Matthew Wilcox (Oracle) Date: Wed Nov 25 11:40:08 2026 -0500 buffer: Document mmb_mark_buffer_dirty() [ Upstream commit 6c8b7651d06f635fe3d8789eda493eda3b4d13ef ] Add kernel-doc for mmb_mark_buffer_dirty(). Signed-off-by: Matthew Wilcox (Oracle) Link: https://patch.msgid.link/20260828205429.3678204-5-willy@infradead.org Reviewed-by: Jan Kara Signed-off-by: Christian Brauner (Amutable) Stable-dep-of: d4fdde3257a5 ("fs: set I_METADATA_WRITEBACK in mmb_mark_buffer_dirty()") Signed-off-by: Sasha Levin commit 1a5e87435f9396f2fa94c9d5c82bf90a08b51421 Author: Debarghya Kundu Date: Wed Nov 25 10:25:47 2026 -0500 gve: Fix backward stats when interface goes down or configuration is adjusted [ Upstream commit 6752dfc316b94ce02998a79509df62a3aba51d1c ] gve_get_base_stats() sets all the stats to 0, so the stats go backwards when interface goes down or configuration is adjusted. ndo_get_stats64 has the same problem, since gve_get_stats() only sums the live rings, which are freed when the interface goes down. This issue was discovered and actually triggered by the drivers/net/stats.py selftest (check_down test case). Bringing down the interface caused statistics counters to reset to 0, triggering selftest assertion failures because netdevice stats must not go backwards. Fix this by persisting baseline stats across queue teardown in gve_queues_mem_remove() and single-queue stop in gve_rx_queue_stop(). The baseline is reported by both ndo_get_stats64 and gve_get_base_stats(). Also report the live XDP TX ring counters in gve_get_base_stats(), as those rings are not exposed as netdev queues. This change was tested using the DQO RDA queue format. Cc: stable@vger.kernel.org Fixes: f5cedc84a30d ("gve: Add transmit and receive support") Fixes: 2e5e0932dff5 ("gve: add support for basic queue stats") Signed-off-by: Debarghya Kundu Co-developed-by: Pin-yen Lin Signed-off-by: Pin-yen Lin Signed-off-by: Harshitha Ramamurthy Link: https://patch.msgid.link/20261109182036.2910559-3-hramamurthy@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit acc9640b869d581a30d9a101dcc6592aa6168076 Author: Masami Hiramatsu (Google) Date: Wed Nov 25 12:10:52 2026 -0500 kprobes: Switch ftrace ops when adding probe with post_handler [ Upstream commit f60f98881b54b0cf36b61f41c91fbd93b76a2d9c ] When an ftrace-based kprobe is registered without a post_handler, it is armed using kprobe_ftrace_ops. If a second probe with a post_handler is subsequently registered at the same address, register_aggr_kprobe() sets ap->post_handler to aggr_post_handler, but leaves the probe armed using kprobe_ftrace_ops. When the probe is later disarmed or disabled, disarm_kprobe_ftrace() checks whether p->post_handler is non-NULL and attempts to disarm from kprobe_ipmodify_ops. This fails with -ENOENT, decrements kprobe_ipmodify_enabled below zero, leaves the probe armed on kprobe_ftrace_ops, and aborts unregistration, leading to a use-after-free if the probe module is unloaded. Switch the armed probe from kprobe_ftrace_ops to kprobe_ipmodify_ops in register_aggr_kprobe() outside of text_mutex and cpus_read_lock to avoid lockdep and deadlock issues when modifying ftrace code. Defer adding the new probe onto ap->list until the ftrace ops switch completes so that the new probe's handlers are not published prematurely while ap is still on kprobe_ftrace_ops, and mark ap disabled if rollback re-arming fails. Also restore ftrace ops registration and counter if ftrace_set_filter_ip() fails in __disarm_kprobe_ftrace(). Link: https://lore.kernel.org/all/179440641120.328088.15542754095040659094.stgit@devnote2/ Fixes: 5dd7caf0bdc5 ("kprobes: Skip clearing aggrprobe's post_handler in kprobe-on-ftrace case") Cc: stable@vger.kernel.org Signed-off-by: Masami Hiramatsu (Google) Signed-off-by: Sasha Levin commit a4f8aa1c6107954e29cf400ef94a7faec82149a7 Author: Kuniyuki Iwashima Date: Wed Nov 25 22:08:32 2026 +0900 ipv6: Remove IPV6_ADDRFORM. [ Upstream commit 31c5ea8a3296e1486ac34bccea452bfe8c0bb1f9 ] Recently, IPV6_ADDRFORM has received many AI-driven bug reports. Fixing them properly would needlessly churn the fast paths in TCP and UDP. IPV6_ADDRFORM was initially introduced in RFC 2133 in 1997, but only two years later, it was removed from RFC 2553 in 1999. In 2026, modern applications natively support dual-stack sockets; notably, systemd's socket activation does not use IPV6_ADDRFORM. Also, getsockopt(IPV6_ADDRFORM) can be replaced with SO_DOMAIN. Let's remove IPV6_ADDRFORM. Later, we can remove sk->sk_prot_creator and revert commit c26c192c3d48 ("udp: properly deal with xfrm encap and ADDRFORM"). Reported-by: Daehyeon Ko <4ncienth@gmail.com> Closes: https://lore.kernel.org/netdev/20260902010408.1057857-1-4ncienth@gmail.com/ Reported-by: Hyunwoo Kim Closes: https://lore.kernel.org/netdev/20260824033331.1084971-1-imv4bel@gmail.com/ Signed-off-by: Kuniyuki Iwashima Link: https://patch.msgid.link/20260904033543.2635540-3-kuniyu@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Hyunwoo Kim Signed-off-by: Sasha Levin commit 5903f0a87c941e0ad5deff873d06c6c7f5d07cd3 Author: Kang Chen Date: Fri Nov 27 00:26:58 2026 +0800 sched_ext: make DSQ iterator stay drained after NULL commit fcbff7b56a881bbe041b6c5ba12831a3c1ac1bb4 upstream. nldsq_cursor_next_task() unlinks the iteration cursor when it reaches the end of the DSQ. A later call sees list_empty(&cursor->node), starts from the DSQ head again, and returns the first task of the same iteration. The verifier relies on the iterator contract that once next() returns NULL it keeps returning NULL: process_iter_next_call() marks the iterator DRAINED and treats the result of later next() calls as the constant zero. A restarted DSQ iteration therefore hands the BPF program a task pointer while the verifier believes R0 == 0. Remember the drained state in the cursor flags and return NULL on every later next() call. The cursor has spare flag bits and the BPF-visible iterator layout is unchanged. Fixes: 650ba21b131e ("sched_ext: Implement DSQ iterator") Signed-off-by: Kang Chen Signed-off-by: Tejun Heo [ chengyang: drop __SCX_DSQ_ITER_HAS_REENQ, which 7.3 lacks ] Signed-off-by: Cheng-Yang Chou Signed-off-by: Sasha Levin commit a6fa616f07ade3917c7b3727867cce0a16b5f771 Author: Rahad Bhuiya Date: Fri Nov 27 00:26:57 2026 +0800 sched_ext: Reset task fields on exit of an SCX_TASK_READY task commit 564405c424f49d70b13debe7fe5b550234ad6b84 upstream. Tasks in SCX_TASK_READY are attached to a scheduler but outside the ext class, such as RT/DL tasks, or non-SCHED_EXT tasks under a partial switch. The scheduler's BPF code can still update their dsq_vtime and slice (for instance, via ops.cgroup_move() as done by scx_flatcg). Because __scx_disable_and_exit_task() currently breaks out of the state switch for SCX_TASK_READY without calling scx_reset_task_fields(), these fields are not cleared when the task leaves the scheduler. If the task is subsequently moved to another cgroup/sub-scheduler and later switches to SCHED_NORMAL, the new scheduler's ops.enable() sees stale dsq_vtime from the previous scheduler's clock. Call scx_reset_task_fields() in the SCX_TASK_READY case of __scx_disable_and_exit_task() to ensure SCX-managed fields are properly reset when leaving the scheduler. Fixes: 5771e79e461e ("sched_ext: Reset dsq_vtime and slice when a task leaves SCX") Signed-off-by: Rahad Bhuiya Signed-off-by: Tejun Heo [ chengyang: 7.3 lacks scx_reset_task_fields(), so factor it out of scx_disable_task() ] Signed-off-by: Cheng-Yang Chou Signed-off-by: Sasha Levin commit f2922378bde1f20798691e6c9c4806e8a91f82b7 Author: Alice Ryhl Date: Wed Nov 25 18:06:23 2026 +0000 rust_binder: push BR_TRANSACTION_COMPLETE before BR_FAILED_REPLY commit ff9de8571f05e8f62f9cbe29f38e0aedda9389cf upstream. When building a reply fails in Thread::reply_inner(), BR_FAILED_REPLY is delivered to the caller before BR_TRANSACTION_COMPLETE is pushed to the replying thread's work list. In a nested transaction, the caller can wake up upon receiving BR_FAILED_REPLY and send an outer reply to the replying thread before BR_TRANSACTION_COMPLETE is queued. This causes the outer BR_REPLY to arrive ahead of BR_TRANSACTION_COMPLETE, which is not legal. This leads to userspace tripping on an assertion. Thus, push BR_TRANSACTION_COMPLETE in Thread::reply_inner() before delivering BR_FAILED_REPLY to the caller. As a nice side effect, this lets us remove the now-unused BR_TRANSACTION_COMPLETE error path in Thread::transaction(). Cc: stable@vger.kernel.org Fixes: eafedbc7c050 ("rust_binder: add Rust Binder driver") Link: https://patch.msgid.link/20261028-binder-reply-fail-v1-1-8b71d4daaf1d@google.com Signed-off-by: Greg Kroah-Hartman [aliceryhl: resolve conflicts in Thread::transaction() and reply_inner()] Signed-off-by: Alice Ryhl Signed-off-by: Sasha Levin commit bd55e44e2e38a2e60cf87f500177b92a13c3d267 Author: Ian Abbott Date: Wed Nov 25 17:44:12 2026 +0000 comedi: comedi_bond: Fix leak of opened device references commit fa0858523f07f8dd71d89b221f4422c3b8096d90 upstream. bonding_attach() calls do_dev_config() to open other comedi devices specified by the user and tries to make use of them as part of the 'bonding' device. If it successfully opens the other device but cannot use it (either because it does not any subdevices of a type the 'bonding' device can use, or because of some error that occurs while dealing with its subdevices) then it is left in the open state and the fact that it is open does not get recorded by the 'bonding' device, so the reference to the opened device gets lost. Fix it by closing the opened device if it could not be bound to the 'bonding' device. To match previous behavior, if the opened device is unsuitable then ignore it (after closing it). The opened devices recorded by the 'bonding' device will eventually get closed by bonding_detach() even if bonding_attach() returns an error. Fixes: 3cf840f65ad5 ("Staging: comedi: add comedi_bond driver") Cc: stable Reported-by: Wentao Liang Link: https://lore.kernel.org/lkml/20261103063301.1025860-1-vulab@iscas.ac.cn Signed-off-by: Ian Abbott Link: https://patch.msgid.link/20261103173610.89687-1-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman (cherry picked from commit fa0858523f07f8dd71d89b221f4422c3b8096d90) Signed-off-by: Ian Abbott Signed-off-by: Sasha Levin commit ca33bcc927e29f141d35723709005c01d6cb2bb2 Author: Wahid Khan Date: Wed Nov 25 14:27:04 2026 -0500 ksmbd: refuse to read a handle that is not open for reading [ Upstream commit 2fd145f8865bb1a6c38a3dc68fa44290008789d8 ] smb2_create_open_flags() picks the open mode from the read and write bits of the desired access. FILE_EXECUTE and FILE_READ_ATTRIBUTES select neither, so a request for FILE_WRITE_DATA | FILE_EXECUTE | FILE_READ_ATTRIBUTES opens the file O_WRONLY. smb2_read() accepts FILE_READ_ATTRIBUTES and ksmbd_vfs_read() accepts FILE_EXECUTE, so a later READ on that handle passes both checks and reaches __kernel_read() on a file that has no FMODE_READ: WARNING: fs/read_write.c:518 at __kernel_read __kernel_read ksmbd_vfs_read smb2_read handle_ksmbd_work Any client that can open a file with write access on a share, including a guest session, can trigger it; with panic_on_warn it takes the machine down. Return STATUS_ACCESS_DENIED when the file is not readable. Fixes: f44158485826 ("cifsd: add file operations") Cc: stable@vger.kernel.org Signed-off-by: Wahid Khan Reviewed-by: Ian Bridges Tested-by: Ian Bridges Signed-off-by: Namjae Jeon [ sashal: adjusted context: the new FMODE_READ check is inserted before this tree's if (!work->tcon->posix_extensions) { line instead of upstream's if (!fp->is_posix_ctxt) {. ] Signed-off-by: Sasha Levin commit 5422dc4869b1fc71984708e87155c448242a1802 Author: Jiwoo Kim Date: Wed Nov 25 14:13:30 2026 -0500 ksmbd: pin parent dentries in SMB2 CREATE ACL path [ Upstream commit 0383a66dabd7aa06237b9b24713c03656abeffe4 ] smb2_open() and smb_inherit_dacl() read a child's d_parent without a dentry reference. A concurrent SMB request can move the child and remove the parent while CREATE uses its inode for permission, status, and ACL inheritance work. A remote SMB race with concurrent opener and mover connections on a writable KSMBD acl_xattr share triggered an 8-byte slab-use-after-free read in get_cached_acl on tmpfs and ext4 KASAN guests. With oops=panic, it also caused an Oops and kernel panic on an ext4 guest. Take a parent dentry reference around each parent inode or ACL access in these paths and release it when the operation completes. Treat a negative parent dentry as -ENOENT for the affected operation. On a tmpfs KASAN QEMU guest, two 3,000-round reproducer instances completed without a KASAN report or Oops; SMB remained reachable. On an ext4 non-KASAN QEMU guest with oops=panic, a 2,000-operation no-race control and two 5,000-round reproducer instances completed without an Oops or panic. An SMB health probe still succeeded. OpenAI Codex assisted with finding the bug, generating the SMB race reproducer, drafting this fix and changelog, and running the tests. Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3") Cc: stable@kernel.org Signed-off-by: Jiwoo Kim Signed-off-by: Namjae Jeon [ sashal: Dropped the kunit include and the const on idmap from the smbacl.c context lines, since this tree has neither, and kept only the fix's own changes. ] Signed-off-by: Sasha Levin commit 63e2d6162c41fa36216e7eeff91cdb40c4a2bfae Author: Zhao Li Date: Wed Nov 25 11:07:49 2026 -0500 Bluetooth: L2CAP: Only accept LE responses to outstanding requests [ Upstream commit f50b32aa233d4687af2d241ddcb572da969e8989 ] The LE and ECRED response handlers match channels by identifier without checking whether they sent the request. An incoming channel stores the identifier chosen by the peer, so an unsolicited response can bypass deferred setup, delete an established channel, or leave an unaccepted socket and channel allocated after l2cap_chan_del(). Extend the BR/EDR lookup from commit a518b9a9ef6e ("Bluetooth: L2CAP: Only accept connection responses to outstanding requests") to LE. Require the matching connect-request flag and add a reconfigure-request flag. Check reconfigure identifiers under the channel lock, since BT_RCVMTU can replace a request without the connection lock. Match all members of a rejected ECRED request, which share one identifier. A reconfigure request can outlive close(). Complete it even in BT_DISCONN, and call the close callback after deletion to release an orphaned socket. Otherwise deletion cancels the timer and removes the channel before the disconnect response or the channel timeout can close it. AI assistance was used. Fixes: f1496dee9cbd ("Bluetooth: Add initial code for LE L2CAP Connect Request") Fixes: 71fb419724fa ("Bluetooth: Fix handling of L2CAP Command Reject over LE") Fixes: 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode") Cc: # 5.7.x: a518b9a9ef6e: Bluetooth: L2CAP: Only accept connection responses to outstanding requests Cc: # 5.7.x Signed-off-by: Zhao Li Signed-off-by: Luiz Augusto von Dentz [ sashal: Dropped the lockdep_assert_held() and __must_hold() annotations, since this tree lacks them; the l2cap_le_command_rej() and l2cap_ecred_reconf_rsp() logic is otherwise unchanged. ] Signed-off-by: Sasha Levin commit 4e6d6243043ec93975fd43aa704d99e252e31f4a Author: Pin-yen Lin Date: Wed Nov 25 10:26:37 2026 -0500 gve: Block invalid ring sizes when device options are 0 [ Upstream commit edc9a730ad3c98662047a76db2d7f26ea4350b2e ] On older device versions, minimum ring sizes in the device option are reported as 0. The driver imports these 0 values, allowing userspace (`ethtool -G`) to request invalidly small ring sizes. This issue was discovered and actually triggered by the drivers/net/ring_reconfig.py selftest (ringparam test case). Halving the ring size down to 1 triggered a kernel NULL pointer dereference in gve_tx_alloc_rings_dqo(): BUG: kernel NULL pointer dereference, address: 0000000000000002 RIP: 0010:gve_tx_alloc_rings_dqo+0x1c4/0x510 [gve] Call Trace: gve_queues_mem_alloc+0x29/0xa0 [gve] gve_adjust_config+0x1b/0x140 [gve] gve_set_ringparam+0x1f4/0x250 [gve] ethnl_set_rings+0x260/0x440 ... Fix this by falling back to the driver's default minimum ring sizes (GVE_DEFAULT_MIN_RX_RING_SIZE and GVE_DEFAULT_MIN_TX_RING_SIZE) whenever the device option reports minimum ring sizes as 0. The device reports either both minimum ring sizes or neither, so a single fallback for both is sufficient. This change was tested using the DQO RDA queue format. Cc: stable@vger.kernel.org Fixes: ed4fb326947d ("gve: add support to read ring size ranges from the device") Signed-off-by: Pin-yen Lin Reviewed-by: Joshua Washington Reviewed-by: Jordan Rhee Signed-off-by: Harshitha Ramamurthy Link: https://patch.msgid.link/20261109182036.2910559-4-hramamurthy@google.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin commit 50451feaff9b172d49113dcbde82837c2f8ee383 Author: Pin-yen Lin Date: Wed Nov 25 10:16:39 2026 -0500 gve: Fix race between stats query and queue reconfig [ Upstream commit 7de69da15088ac2add08eb2b5f5c0a79fd461c1e ] Fix a concurrency bug where network statistics queries race with queue reconfiguration or interface teardown, causing a Use-After-Free (UAF) or NULL pointer dereference. Currently, statistics queries access priv->tx and priv->rx without locking. When an interface is brought down or reconfigured, gve_queues_mem_remove() frees these arrays. A concurrent stats query can dereference freed queue structures and crash the kernel. This issue was discovered and actually triggered by the drivers/net/stats.py selftest. When an interface was brought down, querying per-queue statistics via Netlink caused a kernel NULL pointer dereference in gve_get_rx_queue_stats(): BUG: kernel NULL pointer dereference, address: 00000000000000a0 RIP: 0010:gve_get_rx_queue_stats+0x17/0x50 [gve] Call Trace: netdev_stat_queue_sum+0x11c/0x250 netdev_nl_stats_by_netdev+0x21b/0x2d0 netdev_nl_qstats_get_dumpit+0xd2/0x220 genl_dumpit+0x32/0x90 netlink_dump+0x1d2/0x450 __netlink_dump_start+0x1db/0x2a0 genl_family_rcv_msg_dumpit+0x9b/0x100 ... The per-queue stats callbacks run under the netdev instance lock, so this NULL dereference is not a race; it happens on any query while the interface is down. Additionally, concurrent stats queries during queue reconfiguration can race with gve_queues_mem_remove(), causing a Use-After-Free. This affects gve_get_stats(), which does not hold the instance lock. gve_handle_report_stats() also runs without it; it is stopped before queue teardown, but can still read priv->rx[idx] while the single-queue restart path rewrites it. Fix this by introducing stats_lock to serialize stats queries against queue teardown. In gve_queues_mem_remove(), queue pointers are set to NULL under stats_lock before freeing. Stats readers acquire the lock and verify pointers are non-NULL before reading counters. The per-queue stats callbacks already run under the instance lock, but take stats_lock as well for consistency. The single-queue restart path also rewrites priv->rx[idx] in place, so gve_rx_queue_stop() and gve_rx_queue_start() do those writes under stats_lock as well. This change was tested using the DQO RDA queue format. Cc: stable@vger.kernel.org Fixes: f5cedc84a30d ("gve: Add transmit and receive support") Fixes: 2e5e0932dff5 ("gve: add support for basic queue stats") Co-developed-by: Debarghya Kundu Signed-off-by: Debarghya Kundu Signed-off-by: Pin-yen Lin Signed-off-by: Harshitha Ramamurthy Link: https://patch.msgid.link/20261109182036.2910559-2-hramamurthy@google.com Signed-off-by: Jakub Kicinski [ sashal: Adjusted context in gve_queues_start() and gve_queues_mem_remove() because this tree sets the header-split and packet-buffer-size fields later in gve_queues_start(), so the unlock follows rx_pages_per_qpl. ] Signed-off-by: Sasha Levin commit c5eb148b7be37bb49c48198dd9f3f0f0dfc57498 Author: Gregory Price (Meta) Date: Tue Nov 24 16:09:10 2026 -0500 mm/hugetlb: retry the pool walk when the zonelist is rebuilt [ Upstream commit 9f6674f842bbceda8326cf4e494af5ad3a5a05e6 ] Onlining the first block of a zone rebuilds every zonelist in place, shifting the slots after the new zone. dequeue_hugetlb_folio_nodemask() approves a slot by its node, then loads the zone from it, so a hugetlb fault bound to one node can take a pool page from another: CPU 0 CPU 1 dequeue_hugetlb_folio_nodemask(nodemask {2}) slot 3 (NORMAL2) approved online_pages() build_all_zonelists() [.., NORMAL1, NORMAL2] -> [.., MOVABLE1, NORMAL1, ...] zone = zonelist_zone(slot 3) /* NORMAL1 */ dequeue_hugetlb_folio_node_exact(h, 1) Check zonelist_update_seq before using each zone, and on the way out with nothing found, and restart the walk if it changed. Checking before the dequeue leaves nothing to put back. Reset the last-tried node on restart, so it is not skipped. With kprobes holding the walk across the online, a fault bound to node 2 took a node 1 page in 3 of 3 runs, and a node 2 page in 3 of 3 with this change. Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists") Cc: stable@vger.kernel.org Signed-off-by: Gregory Price (Meta) Link: https://patch.msgid.link/20261101021340.2251928-10-gourry@gourry.net Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Sasha Levin commit 8ba4df62fc32446ccfa8fd1ea6f1fd0888ef9ece Author: Gregory Price (Meta) Date: Tue Nov 24 16:06:58 2026 -0500 mm/page_alloc: retry allocations that raced with a zonelist rebuild [ Upstream commit bcfc8286f0cd5a74c827d502f9f1ad408d7eff30 ] Onlining the first block of a zone rebuilds every zonelist in place, shifting the slots after the new zone. The iterator approves a slot, then the allocator loads the zone from it, so a GFP_KERNEL request can land in ZONE_MOVABLE and a nodemask request on a node outside its mask: CPU 0 CPU 1 prepare_alloc_pages() first_zones_zonelist(nodemask {1}) slot 0 (NORMAL1) approved online_pages() build_all_zonelists() [NORMAL1, NORMAL2, ...] -> [MOVABLE1, NORMAL1, ...] get_page_from_freelist() zone = zonelist_zone(slot 0) /* MOVABLE1 */ allocates from MOVABLE1 zonelist_update_seq detects the rebuild, but only the slowpath's failure exits check it. Check it whenever an allocation succeeds too, and if it changed, free the page and retry, as the memcg charge failure path does. Eligible pages are dropped as well: zonelists only change when memory comes or goes, and a retry is simpler than rechecking the page. Freeing the page does not undo a block the allocation claimed. A GFP_KERNEL request that lands in a fresh ZONE_MOVABLE converts a free block to MIGRATE_UNMOVABLE, which stays until the zone's movable free list runs out and a movable allocation takes it back. The fast and bulk paths read the seqlock's raw seqcount without waiting: an ALLOC_NOLOCK caller can be an NMI that interrupted the writer, and on PREEMPT_RT the seqlock accessor takes the spinlock. A sample taken mid-write costs a retry, or NULL under ALLOC_NOLOCK. check_retry_zonelist() returns 0 when compiled out, so a backport without the hot-add change stays harmless. Fixes: 11cd8638c37f ("mm, page_alloc: remove stop_machine from build_all_zonelists") Cc: stable@vger.kernel.org Signed-off-by: Gregory Price (Meta) Reviewed-by: Vlastimil Babka (SUSE) Link: https://patch.msgid.link/20261101021340.2251928-9-gourry@gourry.net Signed-off-by: Vlastimil Babka (SUSE) Signed-off-by: Sasha Levin commit ff7a5114c55445a711005b72ad42540eb0d9da45 Author: Qiqi Liu Date: Tue Nov 24 16:06:57 2026 -0500 mm/page_alloc: apply per-task GFP context in bulk allocator [ Upstream commit 1372648980b8524a5747a2732e90b20d3db10c3c ] alloc_pages_bulk_noprof() does not call current_gfp_context(), so per-task scoped allocation constraints (PF_MEMALLOC_NOIO, PF_MEMALLOC_NOFS, PF_MEMALLOC_PIN) are not applied on the bulk fast path. By ignoring PF_MEMALLOC_NOIO and PF_MEMALLOC_NOFS, the allocation can theoretically result in a deadlock. Ignoring PF_MEMALLOC_PIN also has consequences: without clearing __GFP_MOVABLE, prepare_alloc_pages() selects MIGRATE_MOVABLE for the PCP list, and a task with PF_MEMALLOC_PIN set receives movable pages from the bulk allocator. Once pinned, these pages can no longer be migrated but remain in MOVABLE pageblocks, violating the mobility contract. This can increase fragmentation and interfere with compaction or contiguous-memory allocations, eventually surfacing as higher allocation latency or allocation failures under memory pressure. Found via review of the bulk allocation tracepoint hooks [1]. Link: https://sashiko.dev/#/patchset/20260907120949.418450-1-liuqiqi%40kylinos.cn Link: https://lore.kernel.org/all/20260907120949.418450-1-liuqiqi@kylinos.cn/ [1] Link: https://lore.kernel.org/20260915074928.327471-1-liuqiqi@kylinos.cn Fixes: 387ba26fb1cb ("mm/page_alloc: add a bulk page allocator") Signed-off-by: Qiqi Liu Signed-off-by: Andrew Morton Reviewed-by: Vlastimil Babka (SUSE) Cc: Brendan Jackman Cc: Johannes Weiner Cc: Michal Hocko Cc: Suren Baghdasaryan Cc: Zi Yan Stable-dep-of: bcfc8286f0cd ("mm/page_alloc: retry allocations that raced with a zonelist rebuild") Signed-off-by: Sasha Levin commit e0e92c81be2af7cd02f457990d227bd35403520b Author: Peter Zijlstra Date: Sat Nov 7 12:36:39 2026 +0100 sched/fair: Make cfs_rq::idle the sum of ancestor tg::idle [ Upstream commit 75545668ae0fd80c08fe8fd0c6799b2ba9284557 ] Rather than keeping cfs_rq::idle as a copy of tg::idle, make it the sum of all ancestor tg::idle. This makes it trivial to tell if the current cgroup is marked idle somewhere along its ancestral path. This makes se_is_idle() behave differently. Notably is will now be true when there is a idle cgroup anywhere in the ancestor path. This addresses an issue where preemption of cgroup::idle was overlooked when flattening the runqueue. Fixes: 85570f10a4c6 ("sched/eevdf: Move to a single runqueue") Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kayra Cizmeci Reviewed-by: Vincent Guittot Reviewed-by: Josh Don Link: https://patch.msgid.link/20261107113639.GK2668200@noisy.programming.kicks-ass.net Signed-off-by: Sasha Levin commit 4fc0daa162b489b7bcea64808154b666dbd35d88 Author: Peter Zijlstra Date: Thu Nov 5 17:55:26 2026 +0100 sched/fair: Use guard in sched_group_set_idle() [ Upstream commit 9a92f776dfa6a88fc16fe0512c725734190bf9d0 ] Cleanup the code by using guards; prepares for further changes in this function. Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Kayra Cizmeci Reviewed-by: Vincent Guittot Reviewed-by: Josh Don Link: https://patch.msgid.link/20261105170157.453569788@infradead.org Signed-off-by: Sasha Levin