* [PATCH 6.19 001/311] perf/core: Fix refcount bug and potential UAF in perf_mmap
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 002/311] drm/vmwgfx: Fix invalid kref_put callback in vmw_bo_dirty_release Sasha Levin
` (323 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable
Cc: Haocheng Yu, kernel test robot, Peter Zijlstra (Intel),
Greg Kroah-Hartman
From: Haocheng Yu <yuhaocheng035@gmail.com>
commit 77de62ad3de3967818c3dbe656b7336ebee461d2 upstream.
Syzkaller reported a refcount_t: addition on 0; use-after-free warning
in perf_mmap.
The issue is caused by a race condition between a failing mmap() setup
and a concurrent mmap() on a dependent event (e.g., using output
redirection).
In perf_mmap(), the ring_buffer (rb) is allocated and assigned to
event->rb with the mmap_mutex held. The mutex is then released to
perform map_range().
If map_range() fails, perf_mmap_close() is called to clean up.
However, since the mutex was dropped, another thread attaching to
this event (via inherited events or output redirection) can acquire
the mutex, observe the valid event->rb pointer, and attempt to
increment its reference count. If the cleanup path has already
dropped the reference count to zero, this results in a
use-after-free or refcount saturation warning.
Fix this by extending the scope of mmap_mutex to cover the
map_range() call. This ensures that the ring buffer initialization
and mapping (or cleanup on failure) happens atomically effectively,
preventing other threads from accessing a half-initialized or
dying ring buffer.
Closes: https://lore.kernel.org/oe-kbuild-all/202602020208.m7KIjdzW-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Haocheng Yu <yuhaocheng035@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260202162057.7237-1-yuhaocheng035@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/events/core.c | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 69c56cad88a89..c0bb657e28e31 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7188,28 +7188,28 @@ static int perf_mmap(struct file *file, struct vm_area_struct *vma)
ret = perf_mmap_aux(vma, event, nr_pages);
if (ret)
return ret;
- }
- /*
- * Since pinned accounting is per vm we cannot allow fork() to copy our
- * vma.
- */
- vm_flags_set(vma, VM_DONTCOPY | VM_DONTEXPAND | VM_DONTDUMP);
- vma->vm_ops = &perf_mmap_vmops;
+ /*
+ * Since pinned accounting is per vm we cannot allow fork() to copy our
+ * vma.
+ */
+ vm_flags_set(vma, VM_DONTCOPY | VM_DONTEXPAND | VM_DONTDUMP);
+ vma->vm_ops = &perf_mmap_vmops;
- mapped = get_mapped(event, event_mapped);
- if (mapped)
- mapped(event, vma->vm_mm);
+ mapped = get_mapped(event, event_mapped);
+ if (mapped)
+ mapped(event, vma->vm_mm);
- /*
- * Try to map it into the page table. On fail, invoke
- * perf_mmap_close() to undo the above, as the callsite expects
- * full cleanup in this case and therefore does not invoke
- * vmops::close().
- */
- ret = map_range(event->rb, vma);
- if (ret)
- perf_mmap_close(vma);
+ /*
+ * Try to map it into the page table. On fail, invoke
+ * perf_mmap_close() to undo the above, as the callsite expects
+ * full cleanup in this case and therefore does not invoke
+ * vmops::close().
+ */
+ ret = map_range(event->rb, vma);
+ if (ret)
+ perf_mmap_close(vma);
+ }
return ret;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 002/311] drm/vmwgfx: Fix invalid kref_put callback in vmw_bo_dirty_release
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 001/311] perf/core: Fix refcount bug and potential UAF in perf_mmap Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 003/311] drm/vmwgfx: Return the correct value in vmw_translate_ptr functions Sasha Levin
` (322 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable; +Cc: Brad Spengler, Zack Rusin, Ian Forbes, Sasha Levin
From: Brad Spengler <brad.spengler@opensrcsec.com>
[ Upstream commit 211ecfaaef186ee5230a77d054cdec7fbfc6724a ]
The kref_put() call uses (void *)kvfree as the release callback, which
is incorrect. kref_put() expects a function with signature
void (*release)(struct kref *), but kvfree has signature
void (*)(const void *). Calling through an incompatible function pointer
is undefined behavior.
The code only worked by accident because ref_count is the first member
of vmw_bo_dirty, making the kref pointer equal to the struct pointer.
Fix this by adding a proper release callback that uses container_of()
to retrieve the containing structure before freeing.
Fixes: c1962742ffff ("drm/vmwgfx: Use kref in vmw_bo_dirty")
Signed-off-by: Brad Spengler <brad.spengler@opensrcsec.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Cc: Ian Forbes <ian.forbes@broadcom.com>
Link: https://patch.msgid.link/20260107171236.3573118-1-zack.rusin@broadcom.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c b/drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c
index fd4e76486f2d1..45561bc1c9eff 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c
@@ -260,6 +260,13 @@ int vmw_bo_dirty_add(struct vmw_bo *vbo)
return ret;
}
+static void vmw_bo_dirty_free(struct kref *kref)
+{
+ struct vmw_bo_dirty *dirty = container_of(kref, struct vmw_bo_dirty, ref_count);
+
+ kvfree(dirty);
+}
+
/**
* vmw_bo_dirty_release - Release a dirty-tracking user from a buffer object
* @vbo: The buffer object
@@ -274,7 +281,7 @@ void vmw_bo_dirty_release(struct vmw_bo *vbo)
{
struct vmw_bo_dirty *dirty = vbo->dirty;
- if (dirty && kref_put(&dirty->ref_count, (void *)kvfree))
+ if (dirty && kref_put(&dirty->ref_count, vmw_bo_dirty_free))
vbo->dirty = NULL;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 003/311] drm/vmwgfx: Return the correct value in vmw_translate_ptr functions
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 001/311] perf/core: Fix refcount bug and potential UAF in perf_mmap Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 002/311] drm/vmwgfx: Fix invalid kref_put callback in vmw_bo_dirty_release Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 004/311] debugobject: Make it work with deferred page initialization - again Sasha Levin
` (321 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable; +Cc: Ian Forbes, Kuzey Arda Bulut, Zack Rusin, Sasha Levin
From: Ian Forbes <ian.forbes@broadcom.com>
[ Upstream commit 5023ca80f9589295cb60735016e39fc5cc714243 ]
Before the referenced fixes these functions used a lookup function that
returned a pointer. This was changed to another lookup function that
returned an error code with the pointer becoming an out parameter.
The error path when the lookup failed was not changed to reflect this
change and the code continued to return the PTR_ERR of the now
uninitialized pointer. This could cause the vmw_translate_ptr functions
to return success when they actually failed causing further uninitialized
and OOB accesses.
Reported-by: Kuzey Arda Bulut <kuzeyardabulut@gmail.com>
Fixes: a309c7194e8a ("drm/vmwgfx: Remove rcu locks from user resources")
Signed-off-by: Ian Forbes <ian.forbes@broadcom.com>
Reviewed-by: Zack Rusin <zack.rusin@broadcom.com>
Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Link: https://patch.msgid.link/20260113175357.129285-1-ian.forbes@broadcom.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
index 3057f8baa7d25..e1f18020170ab 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
@@ -1143,7 +1143,7 @@ static int vmw_translate_mob_ptr(struct vmw_private *dev_priv,
ret = vmw_user_bo_lookup(sw_context->filp, handle, &vmw_bo);
if (ret != 0) {
drm_dbg(&dev_priv->drm, "Could not find or use MOB buffer.\n");
- return PTR_ERR(vmw_bo);
+ return ret;
}
vmw_bo_placement_set(vmw_bo, VMW_BO_DOMAIN_MOB, VMW_BO_DOMAIN_MOB);
ret = vmw_validation_add_bo(sw_context->ctx, vmw_bo);
@@ -1199,7 +1199,7 @@ static int vmw_translate_guest_ptr(struct vmw_private *dev_priv,
ret = vmw_user_bo_lookup(sw_context->filp, handle, &vmw_bo);
if (ret != 0) {
drm_dbg(&dev_priv->drm, "Could not find or use GMR region.\n");
- return PTR_ERR(vmw_bo);
+ return ret;
}
vmw_bo_placement_set(vmw_bo, VMW_BO_DOMAIN_GMR | VMW_BO_DOMAIN_VRAM,
VMW_BO_DOMAIN_GMR | VMW_BO_DOMAIN_VRAM);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 004/311] debugobject: Make it work with deferred page initialization - again
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (2 preceding siblings ...)
2026-03-10 11:00 ` [PATCH 6.19 003/311] drm/vmwgfx: Return the correct value in vmw_translate_ptr functions Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 005/311] drm/logicvc: Fix device node reference leak in logicvc_drm_config_parse() Sasha Levin
` (320 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable
Cc: Thomas Gleixner, Sebastian Andrzej Siewior, Alexei Starovoitov,
Vlastimil Babka, Sasha Levin
From: Thomas Gleixner <tglx@kernel.org>
[ Upstream commit fd3634312a04f336dcbfb481060219f0cd320738 ]
debugobjects uses __GFP_HIGH for allocations as it might be invoked
within locked regions. That worked perfectly fine until v6.18. It still
works correctly when deferred page initialization is disabled and works
by chance when no page allocation is required before deferred page
initialization has completed.
Since v6.18 allocations w/o a reclaim flag cause new_slab() to end up in
alloc_frozen_pages_nolock_noprof(), which returns early when deferred
page initialization has not yet completed. As the deferred page
initialization takes quite a while the debugobject pool is depleted and
debugobjects are disabled.
This can be worked around when PREEMPT_COUNT is enabled as that allows
debugobjects to add __GFP_KSWAPD_RECLAIM to the GFP flags when the context
is preemtible. When PREEMPT_COUNT is disabled the context is unknown and
the reclaim bit can't be set because the caller might hold locks which
might deadlock in the allocator.
In preemptible context the reclaim bit is harmless and not a performance
issue as that's usually invoked from slow path initialization context.
That makes debugobjects depend on PREEMPT_COUNT || !DEFERRED_STRUCT_PAGE_INIT.
Fixes: af92793e52c3 ("slab: Introduce kmalloc_nolock() and kfree_nolock().")
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Link: https://patch.msgid.link/87pl6gznti.ffs@tglx
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
lib/Kconfig.debug | 1 +
lib/debugobjects.c | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 4bae3b389a9c5..52c7a3a89f088 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -723,6 +723,7 @@ source "mm/Kconfig.debug"
config DEBUG_OBJECTS
bool "Debug object operations"
+ depends on PREEMPT_COUNT || !DEFERRED_STRUCT_PAGE_INIT
depends on DEBUG_KERNEL
help
If you say Y here, additional code will be inserted into the
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 89a1d6745dc2c..12f50de85b621 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -398,9 +398,26 @@ static void fill_pool(void)
atomic_inc(&cpus_allocating);
while (pool_should_refill(&pool_global)) {
+ gfp_t gfp = __GFP_HIGH | __GFP_NOWARN;
HLIST_HEAD(head);
- if (!kmem_alloc_batch(&head, obj_cache, __GFP_HIGH | __GFP_NOWARN))
+ /*
+ * Allow reclaim only in preemptible context and during
+ * early boot. If not preemptible, the caller might hold
+ * locks causing a deadlock in the allocator.
+ *
+ * If the reclaim flag is not set during early boot then
+ * allocations, which happen before deferred page
+ * initialization has completed, will fail.
+ *
+ * In preemptible context the flag is harmless and not a
+ * performance issue as that's usually invoked from slow
+ * path initialization context.
+ */
+ if (preemptible() || system_state < SYSTEM_SCHEDULING)
+ gfp |= __GFP_KSWAPD_RECLAIM;
+
+ if (!kmem_alloc_batch(&head, obj_cache, gfp))
break;
guard(raw_spinlock_irqsave)(&pool_lock);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 005/311] drm/logicvc: Fix device node reference leak in logicvc_drm_config_parse()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (3 preceding siblings ...)
2026-03-10 11:00 ` [PATCH 6.19 004/311] debugobject: Make it work with deferred page initialization - again Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 006/311] KVM: arm64: Hide S1POE from guests when not supported by the host Sasha Levin
` (319 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable; +Cc: Felix Gu, Luca Ceresoli, Kory Maincent, Sasha Levin
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit fef0e649f8b42bdffe4a916dd46e1b1e9ad2f207 ]
The logicvc_drm_config_parse() function calls of_get_child_by_name() to
find the "layers" node but fails to release the reference, leading to a
device node reference leak.
Fix this by using the __free(device_node) cleanup attribute to automatic
release the reference when the variable goes out of scope.
Fixes: efeeaefe9be5 ("drm: Add support for the LogiCVC display controller")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20260130-logicvc_drm-v1-1-04366463750c@gmail.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/logicvc/logicvc_drm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/logicvc/logicvc_drm.c b/drivers/gpu/drm/logicvc/logicvc_drm.c
index 204b0fee55d0b..bbebf4fc7f51a 100644
--- a/drivers/gpu/drm/logicvc/logicvc_drm.c
+++ b/drivers/gpu/drm/logicvc/logicvc_drm.c
@@ -92,7 +92,6 @@ static int logicvc_drm_config_parse(struct logicvc_drm *logicvc)
struct device *dev = drm_dev->dev;
struct device_node *of_node = dev->of_node;
struct logicvc_drm_config *config = &logicvc->config;
- struct device_node *layers_node;
int ret;
logicvc_of_property_parse_bool(of_node, LOGICVC_OF_PROPERTY_DITHERING,
@@ -128,7 +127,8 @@ static int logicvc_drm_config_parse(struct logicvc_drm *logicvc)
if (ret)
return ret;
- layers_node = of_get_child_by_name(of_node, "layers");
+ struct device_node *layers_node __free(device_node) =
+ of_get_child_by_name(of_node, "layers");
if (!layers_node) {
drm_err(drm_dev, "Missing non-optional layers node\n");
return -EINVAL;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 006/311] KVM: arm64: Hide S1POE from guests when not supported by the host
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (4 preceding siblings ...)
2026-03-10 11:00 ` [PATCH 6.19 005/311] drm/logicvc: Fix device node reference leak in logicvc_drm_config_parse() Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 007/311] KVM: arm64: Fix ID register initialization for non-protected pKVM guests Sasha Levin
` (318 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable; +Cc: Fuad Tabba, Marc Zyngier, Sasha Levin
From: Fuad Tabba <tabba@google.com>
[ Upstream commit f66857bafd4f151c5cc6856e47be2e12c1721e43 ]
When CONFIG_ARM64_POE is disabled, KVM does not save/restore POR_EL1.
However, ID_AA64MMFR3_EL1 sanitisation currently exposes the feature to
guests whenever the hardware supports it, ignoring the host kernel
configuration.
If a guest detects this feature and attempts to use it, the host will
fail to context-switch POR_EL1, potentially leading to state corruption.
Fix this by masking ID_AA64MMFR3_EL1.S1POE in the sanitised system
registers, preventing KVM from advertising the feature when the host
does not support it (i.e. system_supports_poe() is false).
Fixes: 70ed7238297f ("KVM: arm64: Sanitise ID_AA64MMFR3_EL1")
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260213143815.1732675-2-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/kvm/sys_regs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
index 88a57ca36d96c..237e8bd1cf29c 100644
--- a/arch/arm64/kvm/sys_regs.c
+++ b/arch/arm64/kvm/sys_regs.c
@@ -1816,6 +1816,9 @@ static u64 __kvm_read_sanitised_id_reg(const struct kvm_vcpu *vcpu,
ID_AA64MMFR3_EL1_SCTLRX |
ID_AA64MMFR3_EL1_S1POE |
ID_AA64MMFR3_EL1_S1PIE;
+
+ if (!system_supports_poe())
+ val &= ~ID_AA64MMFR3_EL1_S1POE;
break;
case SYS_ID_MMFR4_EL1:
val &= ~ID_MMFR4_EL1_CCIDX;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 007/311] KVM: arm64: Fix ID register initialization for non-protected pKVM guests
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (5 preceding siblings ...)
2026-03-10 11:00 ` [PATCH 6.19 006/311] KVM: arm64: Hide S1POE from guests when not supported by the host Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 008/311] drm/fourcc: fix plane order for 10/12/16-bit YCbCr formats Sasha Levin
` (317 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable; +Cc: Fuad Tabba, Marc Zyngier, Sasha Levin
From: Fuad Tabba <tabba@google.com>
[ Upstream commit 7e7c2cf0024d89443a7af52e09e47b1fe634ab17 ]
In protected mode, the hypervisor maintains a separate instance of
the `kvm` structure for each VM. For non-protected VMs, this structure is
initialized from the host's `kvm` state.
Currently, `pkvm_init_features_from_host()` copies the
`KVM_ARCH_FLAG_ID_REGS_INITIALIZED` flag from the host without the
underlying `id_regs` data being initialized. This results in the
hypervisor seeing the flag as set while the ID registers remain zeroed.
Consequently, `kvm_has_feat()` checks at EL2 fail (return 0) for
non-protected VMs. This breaks logic that relies on feature detection,
such as `ctxt_has_tcrx()` for TCR2_EL1 support. As a result, certain
system registers (e.g., TCR2_EL1, PIR_EL1, POR_EL1) are not
saved/restored during the world switch, which could lead to state
corruption.
Fix this by explicitly copying the ID registers from the host `kvm` to
the hypervisor `kvm` for non-protected VMs during initialization, since
we trust the host with its non-protected guests' features. Also ensure
`KVM_ARCH_FLAG_ID_REGS_INITIALIZED` is cleared initially in
`pkvm_init_features_from_host` so that `vm_copy_id_regs` can properly
initialize them and set the flag once done.
Fixes: 41d6028e28bd ("KVM: arm64: Convert the SVE guest vcpu flag to a vm flag")
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://patch.msgid.link/20260213143815.1732675-4-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/kvm/hyp/nvhe/pkvm.c | 35 ++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/kvm/hyp/nvhe/pkvm.c b/arch/arm64/kvm/hyp/nvhe/pkvm.c
index 12b2acfbcfd14..59a0102218189 100644
--- a/arch/arm64/kvm/hyp/nvhe/pkvm.c
+++ b/arch/arm64/kvm/hyp/nvhe/pkvm.c
@@ -345,6 +345,7 @@ static void pkvm_init_features_from_host(struct pkvm_hyp_vm *hyp_vm, const struc
/* No restrictions for non-protected VMs. */
if (!kvm_vm_is_protected(kvm)) {
hyp_vm->kvm.arch.flags = host_arch_flags;
+ hyp_vm->kvm.arch.flags &= ~BIT_ULL(KVM_ARCH_FLAG_ID_REGS_INITIALIZED);
bitmap_copy(kvm->arch.vcpu_features,
host_kvm->arch.vcpu_features,
@@ -471,6 +472,35 @@ static int pkvm_vcpu_init_sve(struct pkvm_hyp_vcpu *hyp_vcpu, struct kvm_vcpu *h
return ret;
}
+static int vm_copy_id_regs(struct pkvm_hyp_vcpu *hyp_vcpu)
+{
+ struct pkvm_hyp_vm *hyp_vm = pkvm_hyp_vcpu_to_hyp_vm(hyp_vcpu);
+ const struct kvm *host_kvm = hyp_vm->host_kvm;
+ struct kvm *kvm = &hyp_vm->kvm;
+
+ if (!test_bit(KVM_ARCH_FLAG_ID_REGS_INITIALIZED, &host_kvm->arch.flags))
+ return -EINVAL;
+
+ if (test_and_set_bit(KVM_ARCH_FLAG_ID_REGS_INITIALIZED, &kvm->arch.flags))
+ return 0;
+
+ memcpy(kvm->arch.id_regs, host_kvm->arch.id_regs, sizeof(kvm->arch.id_regs));
+
+ return 0;
+}
+
+static int pkvm_vcpu_init_sysregs(struct pkvm_hyp_vcpu *hyp_vcpu)
+{
+ int ret = 0;
+
+ if (pkvm_hyp_vcpu_is_protected(hyp_vcpu))
+ kvm_init_pvm_id_regs(&hyp_vcpu->vcpu);
+ else
+ ret = vm_copy_id_regs(hyp_vcpu);
+
+ return ret;
+}
+
static int init_pkvm_hyp_vcpu(struct pkvm_hyp_vcpu *hyp_vcpu,
struct pkvm_hyp_vm *hyp_vm,
struct kvm_vcpu *host_vcpu)
@@ -490,8 +520,9 @@ static int init_pkvm_hyp_vcpu(struct pkvm_hyp_vcpu *hyp_vcpu,
hyp_vcpu->vcpu.arch.cflags = READ_ONCE(host_vcpu->arch.cflags);
hyp_vcpu->vcpu.arch.mp_state.mp_state = KVM_MP_STATE_STOPPED;
- if (pkvm_hyp_vcpu_is_protected(hyp_vcpu))
- kvm_init_pvm_id_regs(&hyp_vcpu->vcpu);
+ ret = pkvm_vcpu_init_sysregs(hyp_vcpu);
+ if (ret)
+ goto done;
ret = pkvm_vcpu_init_traps(hyp_vcpu);
if (ret)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 008/311] drm/fourcc: fix plane order for 10/12/16-bit YCbCr formats
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (6 preceding siblings ...)
2026-03-10 11:00 ` [PATCH 6.19 007/311] KVM: arm64: Fix ID register initialization for non-protected pKVM guests Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 009/311] drm/tiny: sharp-memory: fix pointer error dereference Sasha Levin
` (316 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable; +Cc: Simon Ser, Daniel Stone, Robert Mader, Sasha Levin
From: Simon Ser <contact@emersion.fr>
[ Upstream commit e9e0b48cd15b46dcb2bbc165f6b0fee698b855d6 ]
The short comments had the correct order, but the long comments
had the planes reversed.
Fixes: 2271e0a20ef7 ("drm: drm_fourcc: add 10/12/16bit software decoder YCbCr formats")
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Robert Mader <robert.mader@collabora.com>
Link: https://patch.msgid.link/20260208224718.57199-1-contact@emersion.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/uapi/drm/drm_fourcc.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index e527b24bd824b..c89aede3cb120 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -401,8 +401,8 @@ extern "C" {
* implementation can multiply the values by 2^6=64. For that reason the padding
* must only contain zeros.
* index 0 = Y plane, [15:0] z:Y [6:10] little endian
- * index 1 = Cr plane, [15:0] z:Cr [6:10] little endian
- * index 2 = Cb plane, [15:0] z:Cb [6:10] little endian
+ * index 1 = Cb plane, [15:0] z:Cb [6:10] little endian
+ * index 2 = Cr plane, [15:0] z:Cr [6:10] little endian
*/
#define DRM_FORMAT_S010 fourcc_code('S', '0', '1', '0') /* 2x2 subsampled Cb (1) and Cr (2) planes 10 bits per channel */
#define DRM_FORMAT_S210 fourcc_code('S', '2', '1', '0') /* 2x1 subsampled Cb (1) and Cr (2) planes 10 bits per channel */
@@ -414,8 +414,8 @@ extern "C" {
* implementation can multiply the values by 2^4=16. For that reason the padding
* must only contain zeros.
* index 0 = Y plane, [15:0] z:Y [4:12] little endian
- * index 1 = Cr plane, [15:0] z:Cr [4:12] little endian
- * index 2 = Cb plane, [15:0] z:Cb [4:12] little endian
+ * index 1 = Cb plane, [15:0] z:Cb [4:12] little endian
+ * index 2 = Cr plane, [15:0] z:Cr [4:12] little endian
*/
#define DRM_FORMAT_S012 fourcc_code('S', '0', '1', '2') /* 2x2 subsampled Cb (1) and Cr (2) planes 12 bits per channel */
#define DRM_FORMAT_S212 fourcc_code('S', '2', '1', '2') /* 2x1 subsampled Cb (1) and Cr (2) planes 12 bits per channel */
@@ -424,8 +424,8 @@ extern "C" {
/*
* 3 plane YCbCr
* index 0 = Y plane, [15:0] Y little endian
- * index 1 = Cr plane, [15:0] Cr little endian
- * index 2 = Cb plane, [15:0] Cb little endian
+ * index 1 = Cb plane, [15:0] Cb little endian
+ * index 2 = Cr plane, [15:0] Cr little endian
*/
#define DRM_FORMAT_S016 fourcc_code('S', '0', '1', '6') /* 2x2 subsampled Cb (1) and Cr (2) planes 16 bits per channel */
#define DRM_FORMAT_S216 fourcc_code('S', '2', '1', '6') /* 2x1 subsampled Cb (1) and Cr (2) planes 16 bits per channel */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 009/311] drm/tiny: sharp-memory: fix pointer error dereference
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (7 preceding siblings ...)
2026-03-10 11:00 ` [PATCH 6.19 008/311] drm/fourcc: fix plane order for 10/12/16-bit YCbCr formats Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 010/311] irqchip/sifive-plic: Fix frozen interrupt due to affinity setting Sasha Levin
` (315 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable; +Cc: Ethan Tidmore, Thomas Zimmermann, Sasha Levin
From: Ethan Tidmore <ethantidmore06@gmail.com>
[ Upstream commit 46120745bb4e7e1f09959624716b4c5d6e2c2e9e ]
The function devm_drm_dev_alloc() returns a pointer error upon failure
not NULL. Change null check to pointer error check.
Detected by Smatch:
drivers/gpu/drm/tiny/sharp-memory.c:549 sharp_memory_probe() error:
'smd' dereferencing possible ERR_PTR()
Fixes: b8f9f21716fec ("drm/tiny: Add driver for Sharp Memory LCD")
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patch.msgid.link/20260216040438.43702-1-ethantidmore06@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/tiny/sharp-memory.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/tiny/sharp-memory.c b/drivers/gpu/drm/tiny/sharp-memory.c
index 64272cd0f6e22..cbf69460ebf32 100644
--- a/drivers/gpu/drm/tiny/sharp-memory.c
+++ b/drivers/gpu/drm/tiny/sharp-memory.c
@@ -541,8 +541,8 @@ static int sharp_memory_probe(struct spi_device *spi)
smd = devm_drm_dev_alloc(dev, &sharp_memory_drm_driver,
struct sharp_memory_device, drm);
- if (!smd)
- return -ENOMEM;
+ if (IS_ERR(smd))
+ return PTR_ERR(smd);
spi_set_drvdata(spi, smd);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 010/311] irqchip/sifive-plic: Fix frozen interrupt due to affinity setting
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (8 preceding siblings ...)
2026-03-10 11:00 ` [PATCH 6.19 009/311] drm/tiny: sharp-memory: fix pointer error dereference Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 011/311] scsi: lpfc: Properly set WC for DPP mapping Sasha Levin
` (314 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable; +Cc: Nam Cao, Thomas Gleixner, Sasha Levin
From: Nam Cao <namcao@linutronix.de>
[ Upstream commit 1072020685f4b81f6efad3b412cdae0bd62bb043 ]
PLIC ignores interrupt completion message for disabled interrupt, explained
by the specification:
The PLIC signals it has completed executing an interrupt handler by
writing the interrupt ID it received from the claim to the
claim/complete register. The PLIC does not check whether the completion
ID is the same as the last claim ID for that target. If the completion
ID does not match an interrupt source that is currently enabled for
the target, the completion is silently ignored.
This caused problems in the past, because an interrupt can be disabled
while still being handled and plic_irq_eoi() had no effect. That was fixed
by checking if the interrupt is disabled, and if so enable it, before
sending the completion message. That check is done with irqd_irq_disabled().
However, that is not sufficient because the enable bit for the handling
hart can be zero despite irqd_irq_disabled(d) being false. This can happen
when affinity setting is changed while a hart is still handling the
interrupt.
This problem is easily reproducible by dumping a large file to uart (which
generates lots of interrupts) and at the same time keep changing the uart
interrupt's affinity setting. The uart port becomes frozen almost
instantaneously.
Fix this by checking PLIC's enable bit instead of irqd_irq_disabled().
Fixes: cc9f04f9a84f ("irqchip/sifive-plic: Implement irq_set_affinity() for SMP host")
Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260212114125.3148067-1-namcao@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/irq-sifive-plic.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c
index 60fd8f91762b1..70058871d2fb6 100644
--- a/drivers/irqchip/irq-sifive-plic.c
+++ b/drivers/irqchip/irq-sifive-plic.c
@@ -172,8 +172,13 @@ static void plic_irq_disable(struct irq_data *d)
static void plic_irq_eoi(struct irq_data *d)
{
struct plic_handler *handler = this_cpu_ptr(&plic_handlers);
+ u32 __iomem *reg;
+ bool enabled;
+
+ reg = handler->enable_base + (d->hwirq / 32) * sizeof(u32);
+ enabled = readl(reg) & BIT(d->hwirq % 32);
- if (unlikely(irqd_irq_disabled(d))) {
+ if (unlikely(!enabled)) {
plic_toggle(handler, d->hwirq, 1);
writel(d->hwirq, handler->hart_base + CONTEXT_CLAIM);
plic_toggle(handler, d->hwirq, 0);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 011/311] scsi: lpfc: Properly set WC for DPP mapping
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (9 preceding siblings ...)
2026-03-10 11:00 ` [PATCH 6.19 010/311] irqchip/sifive-plic: Fix frozen interrupt due to affinity setting Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 012/311] scsi: pm8001: Fix use-after-free in pm8001_queue_command() Sasha Levin
` (313 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable
Cc: Mathias Krause, Justin Tee, Martin K. Petersen, Sasha Levin
From: Mathias Krause <minipli@grsecurity.net>
[ Upstream commit bffda93a51b40afd67c11bf558dc5aae83ca0943 ]
Using set_memory_wc() to enable write-combining for the DPP portion of
the MMIO mapping is wrong as set_memory_*() is meant to operate on RAM
only, not MMIO mappings. In fact, as used currently triggers a BUG_ON()
with enabled CONFIG_DEBUG_VIRTUAL.
Simply map the DPP region separately and in addition to the already
existing mappings, avoiding any possible negative side effects for
these.
Fixes: 1351e69fc6db ("scsi: lpfc: Add push-to-adapter support to sli4")
Signed-off-by: Mathias Krause <minipli@grsecurity.net>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Reviewed-by: Mathias Krause <minipli@grsecurity.net>
Link: https://patch.msgid.link/20260212192327.141104-1-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/lpfc/lpfc_init.c | 2 ++
drivers/scsi/lpfc/lpfc_sli.c | 36 +++++++++++++++++++++++++++++------
drivers/scsi/lpfc/lpfc_sli4.h | 3 +++
3 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index b1460b16dd91d..c6bb45c3d4c4a 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -12034,6 +12034,8 @@ lpfc_sli4_pci_mem_unset(struct lpfc_hba *phba)
iounmap(phba->sli4_hba.conf_regs_memmap_p);
if (phba->sli4_hba.dpp_regs_memmap_p)
iounmap(phba->sli4_hba.dpp_regs_memmap_p);
+ if (phba->sli4_hba.dpp_regs_memmap_wc_p)
+ iounmap(phba->sli4_hba.dpp_regs_memmap_wc_p);
break;
case LPFC_SLI_INTF_IF_TYPE_1:
break;
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 73d77cfab5f82..bddfc412b04b5 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -15981,6 +15981,32 @@ lpfc_dual_chute_pci_bar_map(struct lpfc_hba *phba, uint16_t pci_barset)
return NULL;
}
+static __maybe_unused void __iomem *
+lpfc_dpp_wc_map(struct lpfc_hba *phba, uint8_t dpp_barset)
+{
+
+ /* DPP region is supposed to cover 64-bit BAR2 */
+ if (dpp_barset != WQ_PCI_BAR_4_AND_5) {
+ lpfc_log_msg(phba, KERN_WARNING, LOG_INIT,
+ "3273 dpp_barset x%x != WQ_PCI_BAR_4_AND_5\n",
+ dpp_barset);
+ return NULL;
+ }
+
+ if (!phba->sli4_hba.dpp_regs_memmap_wc_p) {
+ void __iomem *dpp_map;
+
+ dpp_map = ioremap_wc(phba->pci_bar2_map,
+ pci_resource_len(phba->pcidev,
+ PCI_64BIT_BAR4));
+
+ if (dpp_map)
+ phba->sli4_hba.dpp_regs_memmap_wc_p = dpp_map;
+ }
+
+ return phba->sli4_hba.dpp_regs_memmap_wc_p;
+}
+
/**
* lpfc_modify_hba_eq_delay - Modify Delay Multiplier on EQs
* @phba: HBA structure that EQs are on.
@@ -16944,9 +16970,6 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq,
uint8_t dpp_barset;
uint32_t dpp_offset;
uint8_t wq_create_version;
-#ifdef CONFIG_X86
- unsigned long pg_addr;
-#endif
/* sanity check on queue memory */
if (!wq || !cq)
@@ -17132,14 +17155,15 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq,
#ifdef CONFIG_X86
/* Enable combined writes for DPP aperture */
- pg_addr = (unsigned long)(wq->dpp_regaddr) & PAGE_MASK;
- rc = set_memory_wc(pg_addr, 1);
- if (rc) {
+ bar_memmap_p = lpfc_dpp_wc_map(phba, dpp_barset);
+ if (!bar_memmap_p) {
lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
"3272 Cannot setup Combined "
"Write on WQ[%d] - disable DPP\n",
wq->queue_id);
phba->cfg_enable_dpp = 0;
+ } else {
+ wq->dpp_regaddr = bar_memmap_p + dpp_offset;
}
#else
phba->cfg_enable_dpp = 0;
diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h
index fd6dab1578872..40f313e2769fc 100644
--- a/drivers/scsi/lpfc/lpfc_sli4.h
+++ b/drivers/scsi/lpfc/lpfc_sli4.h
@@ -785,6 +785,9 @@ struct lpfc_sli4_hba {
void __iomem *dpp_regs_memmap_p; /* Kernel memory mapped address for
* dpp registers
*/
+ void __iomem *dpp_regs_memmap_wc_p;/* Kernel memory mapped address for
+ * dpp registers with write combining
+ */
union {
struct {
/* IF Type 0, BAR 0 PCI cfg space reg mem map */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 012/311] scsi: pm8001: Fix use-after-free in pm8001_queue_command()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (10 preceding siblings ...)
2026-03-10 11:00 ` [PATCH 6.19 011/311] scsi: lpfc: Properly set WC for DPP mapping Sasha Levin
@ 2026-03-10 11:00 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 013/311] accel: ethosu: Fix shift overflow in cmd_to_addr() Sasha Levin
` (312 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:00 UTC (permalink / raw)
To: patches, stable
Cc: Salomon Dushimirimana, Damien Le Moal, Martin K. Petersen,
Sasha Levin
From: Salomon Dushimirimana <salomondush@google.com>
[ Upstream commit 38353c26db28efd984f51d426eac2396d299cca7 ]
Commit e29c47fe8946 ("scsi: pm8001: Simplify pm8001_task_exec()") refactors
pm8001_queue_command(), however it introduces a potential cause of a double
free scenario when it changes the function to return -ENODEV in case of phy
down/device gone state.
In this path, pm8001_queue_command() updates task status and calls
task_done to indicate to upper layer that the task has been handled.
However, this also frees the underlying SAS task. A -ENODEV is then
returned to the caller. When libsas sas_ata_qc_issue() receives this error
value, it assumes the task wasn't handled/queued by LLDD and proceeds to
clean up and free the task again, resulting in a double free.
Since pm8001_queue_command() handles the SAS task in this case, it should
return 0 to the caller indicating that the task has been handled.
Fixes: e29c47fe8946 ("scsi: pm8001: Simplify pm8001_task_exec()")
Signed-off-by: Salomon Dushimirimana <salomondush@google.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://patch.msgid.link/20260213192806.439432-1-salomondush@google.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/scsi/pm8001/pm8001_sas.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index 6a8d35aea93a5..645524f3fe2d0 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -525,8 +525,9 @@ int pm8001_queue_command(struct sas_task *task, gfp_t gfp_flags)
} else {
task->task_done(task);
}
- rc = -ENODEV;
- goto err_out;
+ spin_unlock_irqrestore(&pm8001_ha->lock, flags);
+ pm8001_dbg(pm8001_ha, IO, "pm8001_task_exec device gone\n");
+ return 0;
}
ccb = pm8001_ccb_alloc(pm8001_ha, pm8001_dev, task);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 013/311] accel: ethosu: Fix shift overflow in cmd_to_addr()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (11 preceding siblings ...)
2026-03-10 11:00 ` [PATCH 6.19 012/311] scsi: pm8001: Fix use-after-free in pm8001_queue_command() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 014/311] drm/imx: parallel-display: check return value of devm_drm_bridge_add() in imx_pd_probe() Sasha Levin
` (311 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Dan Carpenter, Rob Herring (Arm), Sasha Levin
From: Dan Carpenter <dan.carpenter@linaro.org>
[ Upstream commit 7be41fb00e2c2a823f271a8318b453ca11812f1e ]
The "((cmd[0] & 0xff0000) << 16)" shift is zero. This was intended
to be (((u64)cmd[0] & 0xff0000) << 16). Move the cast to the correct
location.
Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aQGmY64tWcwOGFP4@stanley.mountain
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/ethosu/ethosu_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c
index 473b5f5d75144..7b073116314ba 100644
--- a/drivers/accel/ethosu/ethosu_gem.c
+++ b/drivers/accel/ethosu/ethosu_gem.c
@@ -154,7 +154,7 @@ static void cmd_state_init(struct cmd_state *st)
static u64 cmd_to_addr(u32 *cmd)
{
- return ((u64)((cmd[0] & 0xff0000) << 16)) | cmd[1];
+ return (((u64)cmd[0] & 0xff0000) << 16) | cmd[1];
}
static u64 dma_length(struct ethosu_validated_cmdstream_info *info,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 014/311] drm/imx: parallel-display: check return value of devm_drm_bridge_add() in imx_pd_probe()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (12 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 013/311] accel: ethosu: Fix shift overflow in cmd_to_addr() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 015/311] drm/bridge: synopsys: dw-dp: Check return value of devm_drm_bridge_add() in dw_dp_bind() Sasha Levin
` (310 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Chen Ni, Luca Ceresoli, Sasha Levin
From: Chen Ni <nichen@iscas.ac.cn>
[ Upstream commit c5f8658f97ec392eeaf355d4e9775ae1f23ca1d3 ]
Return the value of devm_drm_bridge_add() in order to propagate the
error properly, if it fails due to resource allocation failure or bridge
registration failure.
This ensures that the probe function fails safely rather than proceeding
with a potentially incomplete bridge setup.
Fixes: bf7e97910b9f ("drm/imx: parallel-display: add the bridge before attaching it")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20260204090629.2209542-1-nichen@iscas.ac.cn
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
index 6fbf505d2801d..590120a33fa07 100644
--- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c
+++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
@@ -256,7 +256,9 @@ static int imx_pd_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, imxpd);
- devm_drm_bridge_add(dev, &imxpd->bridge);
+ ret = devm_drm_bridge_add(dev, &imxpd->bridge);
+ if (ret)
+ return ret;
return component_add(dev, &imx_pd_ops);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 015/311] drm/bridge: synopsys: dw-dp: Check return value of devm_drm_bridge_add() in dw_dp_bind()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (13 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 014/311] drm/imx: parallel-display: check return value of devm_drm_bridge_add() in imx_pd_probe() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 016/311] ALSA: scarlett2: Fix DSP filter control array handling Sasha Levin
` (309 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Chen Ni, Andy Yan, Luca Ceresoli, Sasha Levin
From: Chen Ni <nichen@iscas.ac.cn>
[ Upstream commit 496daa2759260374bb9c9b2196a849aa3bc513a8 ]
Return the value of devm_drm_bridge_add() in order to propagate the
error properly, if it fails due to resource allocation failure or bridge
registration failure.
This ensures that the bind function fails safely rather than proceeding
with a potentially incomplete bridge setup.
Fixes: b726970486d8 ("drm/bridge: synopsys: dw-dp: add bridge before attaching")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Reviewed-by: Andy Yan <andyshrk@163.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Link: https://patch.msgid.link/20260206040621.4095517-1-nichen@iscas.ac.cn
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/bridge/synopsys/dw-dp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-dp.c b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
index 4323424524847..07f7a2e0d9f2a 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-dp.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-dp.c
@@ -2049,7 +2049,9 @@ struct dw_dp *dw_dp_bind(struct device *dev, struct drm_encoder *encoder,
bridge->type = DRM_MODE_CONNECTOR_DisplayPort;
bridge->ycbcr_420_allowed = true;
- devm_drm_bridge_add(dev, bridge);
+ ret = devm_drm_bridge_add(dev, bridge);
+ if (ret)
+ return ERR_PTR(ret);
dp->aux.dev = dev;
dp->aux.drm_dev = encoder->dev;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 016/311] ALSA: scarlett2: Fix DSP filter control array handling
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (14 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 015/311] drm/bridge: synopsys: dw-dp: Check return value of devm_drm_bridge_add() in dw_dp_bind() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 017/311] ALSA: usb-audio: Remove VALIDATE_RATES quirk for Focusrite devices Sasha Levin
` (308 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Geoffrey D. Bennett, Takashi Iwai, Sasha Levin
From: "Geoffrey D. Bennett" <g@b4.vu>
[ Upstream commit 1d241483368f2fd87fbaba64d6aec6bad3a1e12e ]
scarlett2_add_dsp_ctls() was incorrectly storing the precomp and PEQ
filter coefficient control pointers into the precomp_flt_switch_ctls
and peq_flt_switch_ctls arrays instead of the intended targets
precomp_flt_ctls and peq_flt_ctls. Pass NULL instead, as the filter
coefficient control pointers are not used, and remove the unused
precomp_flt_ctls and peq_flt_ctls arrays from struct scarlett2_data.
Additionally, scarlett2_update_filter_values() was reading
dsp_input_count * peq_flt_count values for
SCARLETT2_CONFIG_PEQ_FLT_SWITCH, but the peq_flt_switch array is
indexed only by dsp_input_count (one switch per DSP input, not per
filter). Fix the read count.
Fixes: b64678eb4e70 ("ALSA: scarlett2: Add DSP controls")
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Link: https://patch.msgid.link/86497b71db060677d97c38a6ce5f89bb3b25361b.1771581197.git.g@b4.vu
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/mixer_scarlett2.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/sound/usb/mixer_scarlett2.c b/sound/usb/mixer_scarlett2.c
index 88b7e42d159e0..7b31504c5f24c 100644
--- a/sound/usb/mixer_scarlett2.c
+++ b/sound/usb/mixer_scarlett2.c
@@ -1328,8 +1328,6 @@ struct scarlett2_data {
struct snd_kcontrol *mux_ctls[SCARLETT2_MUX_MAX];
struct snd_kcontrol *mix_ctls[SCARLETT2_MIX_MAX];
struct snd_kcontrol *compressor_ctls[SCARLETT2_COMPRESSOR_CTLS_MAX];
- struct snd_kcontrol *precomp_flt_ctls[SCARLETT2_PRECOMP_FLT_CTLS_MAX];
- struct snd_kcontrol *peq_flt_ctls[SCARLETT2_PEQ_FLT_CTLS_MAX];
struct snd_kcontrol *precomp_flt_switch_ctls[SCARLETT2_DSP_SWITCH_MAX];
struct snd_kcontrol *peq_flt_switch_ctls[SCARLETT2_DSP_SWITCH_MAX];
struct snd_kcontrol *direct_monitor_ctl;
@@ -3447,7 +3445,6 @@ static int scarlett2_update_autogain(struct usb_mixer_interface *mixer)
private->autogain_status[i] =
private->num_autogain_status_texts - 1;
-
for (i = 0; i < SCARLETT2_AG_TARGET_COUNT; i++)
if (scarlett2_has_config_item(private,
scarlett2_ag_target_configs[i])) {
@@ -5372,8 +5369,7 @@ static int scarlett2_update_filter_values(struct usb_mixer_interface *mixer)
err = scarlett2_usb_get_config(
mixer, SCARLETT2_CONFIG_PEQ_FLT_SWITCH,
- info->dsp_input_count * info->peq_flt_count,
- private->peq_flt_switch);
+ info->dsp_input_count, private->peq_flt_switch);
if (err < 0)
return err;
@@ -6546,7 +6542,7 @@ static int scarlett2_add_dsp_ctls(struct usb_mixer_interface *mixer, int i)
err = scarlett2_add_new_ctl(
mixer, &scarlett2_precomp_flt_ctl,
i * info->precomp_flt_count + j,
- 1, s, &private->precomp_flt_switch_ctls[j]);
+ 1, s, NULL);
if (err < 0)
return err;
}
@@ -6556,7 +6552,7 @@ static int scarlett2_add_dsp_ctls(struct usb_mixer_interface *mixer, int i)
err = scarlett2_add_new_ctl(
mixer, &scarlett2_peq_flt_ctl,
i * info->peq_flt_count + j,
- 1, s, &private->peq_flt_switch_ctls[j]);
+ 1, s, NULL);
if (err < 0)
return err;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 017/311] ALSA: usb-audio: Remove VALIDATE_RATES quirk for Focusrite devices
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (15 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 016/311] ALSA: scarlett2: Fix DSP filter control array handling Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-15 18:54 ` Geoffrey D. Bennett
2026-03-10 11:01 ` [PATCH 6.19 018/311] ALSA: usb-audio: Add QUIRK_FLAG_SKIP_IFACE_SETUP Sasha Levin
` (307 subsequent siblings)
324 siblings, 1 reply; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Geoffrey D. Bennett, Takashi Iwai, Sasha Levin
From: "Geoffrey D. Bennett" <g@b4.vu>
[ Upstream commit a8cc55bf81a45772cad44c83ea7bb0e98431094a ]
Remove QUIRK_FLAG_VALIDATE_RATES for Focusrite. With the previous
commit, focusrite_valid_sample_rate() produces correct rate tables
without USB probing.
QUIRK_FLAG_VALIDATE_RATES sends SET_CUR requests for each rate (~25ms
each) and leaves the device at 192kHz. This is a problem because that
rate: 1) disables the internal mixer, so outputs are silent until an
application opens the PCM and sets a lower rate, and 2) the Air and
Safe modes get disabled.
Fixes: 5963e5262180 ("ALSA: usb-audio: Enable rate validation for Scarlett devices")
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/09b9c012024c998c4ca14bd876ef0dce0d0b6101.1771594828.git.g@b4.vu
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/quirks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 86c329632e396..9cc5165510182 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -2422,7 +2422,7 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
VENDOR_FLG(0x07fd, /* MOTU */
QUIRK_FLAG_VALIDATE_RATES),
VENDOR_FLG(0x1235, /* Focusrite Novation */
- QUIRK_FLAG_VALIDATE_RATES),
+ 0),
VENDOR_FLG(0x1511, /* AURALiC */
QUIRK_FLAG_DSD_RAW),
VENDOR_FLG(0x152a, /* Thesycon devices */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 018/311] ALSA: usb-audio: Add QUIRK_FLAG_SKIP_IFACE_SETUP
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (16 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 017/311] ALSA: usb-audio: Remove VALIDATE_RATES quirk for Focusrite devices Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 019/311] gpio: shared: fix memory leaks Sasha Levin
` (306 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Geoffrey D. Bennett, Takashi Iwai, Sasha Levin
From: "Geoffrey D. Bennett" <g@b4.vu>
[ Upstream commit 38c322068a26a01d7ff64da92179e68cdde9860b ]
Add a quirk flag to skip the usb_set_interface(),
snd_usb_init_pitch(), and snd_usb_init_sample_rate() calls in
__snd_usb_parse_audio_interface(). These are redundant with
snd_usb_endpoint_prepare() at stream-open time.
Enable the quirk for Focusrite devices, as init_sample_rate(rate_max)
sets 192kHz during probing, which disables the internal mixer and Air
and Safe modes.
Fixes: 16f1f838442d ("Revert "ALSA: usb-audio: Drop superfluous interface setup at parsing"")
Signed-off-by: Geoffrey D. Bennett <g@b4.vu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/65a7909b15f9feb76c2a6f4f8814c240ddc50737.1771594828.git.g@b4.vu
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/quirks.c | 3 ++-
sound/usb/stream.c | 3 +++
sound/usb/usbaudio.h | 6 ++++++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index 9cc5165510182..a89ea2233180a 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -2422,7 +2422,7 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
VENDOR_FLG(0x07fd, /* MOTU */
QUIRK_FLAG_VALIDATE_RATES),
VENDOR_FLG(0x1235, /* Focusrite Novation */
- 0),
+ QUIRK_FLAG_SKIP_IFACE_SETUP),
VENDOR_FLG(0x1511, /* AURALiC */
QUIRK_FLAG_DSD_RAW),
VENDOR_FLG(0x152a, /* Thesycon devices */
@@ -2504,6 +2504,7 @@ static const char *const snd_usb_audio_quirk_flag_names[] = {
QUIRK_STRING_ENTRY(MIC_RES_384),
QUIRK_STRING_ENTRY(MIXER_PLAYBACK_MIN_MUTE),
QUIRK_STRING_ENTRY(MIXER_CAPTURE_MIN_MUTE),
+ QUIRK_STRING_ENTRY(SKIP_IFACE_SETUP),
NULL
};
diff --git a/sound/usb/stream.c b/sound/usb/stream.c
index ec7d756d78d17..421e94b233e17 100644
--- a/sound/usb/stream.c
+++ b/sound/usb/stream.c
@@ -1259,6 +1259,9 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip,
set_iface_first = true;
/* try to set the interface... */
+ if (chip->quirk_flags & QUIRK_FLAG_SKIP_IFACE_SETUP)
+ continue;
+
usb_set_interface(chip->dev, iface_no, 0);
if (set_iface_first)
usb_set_interface(chip->dev, iface_no, altno);
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 79978cae9799c..085530cf62d92 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -224,6 +224,10 @@ extern bool snd_usb_skip_validation;
* playback value represents muted state instead of minimum audible volume
* QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE
* Similar to QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE, but for capture streams
+ * QUIRK_FLAG_SKIP_IFACE_SETUP
+ * Skip the probe-time interface setup (usb_set_interface,
+ * init_pitch, init_sample_rate); redundant with
+ * snd_usb_endpoint_prepare() at stream-open time
*/
enum {
@@ -253,6 +257,7 @@ enum {
QUIRK_TYPE_MIC_RES_384 = 23,
QUIRK_TYPE_MIXER_PLAYBACK_MIN_MUTE = 24,
QUIRK_TYPE_MIXER_CAPTURE_MIN_MUTE = 25,
+ QUIRK_TYPE_SKIP_IFACE_SETUP = 26,
/* Please also edit snd_usb_audio_quirk_flag_names */
};
@@ -284,5 +289,6 @@ enum {
#define QUIRK_FLAG_MIC_RES_384 QUIRK_FLAG(MIC_RES_384)
#define QUIRK_FLAG_MIXER_PLAYBACK_MIN_MUTE QUIRK_FLAG(MIXER_PLAYBACK_MIN_MUTE)
#define QUIRK_FLAG_MIXER_CAPTURE_MIN_MUTE QUIRK_FLAG(MIXER_CAPTURE_MIN_MUTE)
+#define QUIRK_FLAG_SKIP_IFACE_SETUP QUIRK_FLAG(SKIP_IFACE_SETUP)
#endif /* __USBAUDIO_H */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 019/311] gpio: shared: fix memory leaks
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (17 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 018/311] ALSA: usb-audio: Add QUIRK_FLAG_SKIP_IFACE_SETUP Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 020/311] x86/fred: Correct speculative safety in fred_extint() Sasha Levin
` (305 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Daniel J Blueman, Bartosz Golaszewski, Sasha Levin
From: Daniel J Blueman <daniel@quora.org>
[ Upstream commit 32e0a7ad9c841f46549ccac0f1cca347a40d8685 ]
On a Snapdragon X1 Elite laptop (Lenovo Yoga Slim 7x), kmemleak reports
three sets of:
unreferenced object 0xffff00080187f400 (size 1024):
comm "swapper/0", pid 1, jiffies 4294667327
hex dump (first 32 bytes):
58 bd 70 01 08 00 ff ff 58 bd 70 01 08 00 ff ff X.p.....X.p.....
00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................
backtrace (crc 1665d1f8):
kmemleak_alloc+0xf4/0x12c
__kmalloc_cache_noprof+0x370/0x49c
gpio_shared_make_ref+0x70/0x16c
gpio_shared_of_traverse+0x4e8/0x5f4
gpio_shared_of_traverse+0x200/0x5f4
gpio_shared_of_traverse+0x200/0x5f4
gpio_shared_of_traverse+0x200/0x5f4
gpio_shared_of_traverse+0x200/0x5f4
gpio_shared_init+0x34/0x1c4
do_one_initcall+0x50/0x280
kernel_init_freeable+0x290/0x33c
kernel_init+0x28/0x14c
ret_from_fork+0x10/0x20
unreferenced object 0xffff00080170c140 (size 8):
comm "swapper/0", pid 1, jiffies 4294667327
hex dump (first 8 bytes):
72 65 73 65 74 00 00 00 reset...
backtrace (crc fc24536):
kmemleak_alloc+0xf4/0x12c
__kmalloc_node_track_caller_noprof+0x3c4/0x584
kstrdup+0x4c/0xcc
gpio_shared_make_ref+0x8c/0x16c
gpio_shared_of_traverse+0x4e8/0x5f4
gpio_shared_of_traverse+0x200/0x5f4
gpio_shared_of_traverse+0x200/0x5f4
gpio_shared_of_traverse+0x200/0x5f4
gpio_shared_of_traverse+0x200/0x5f4
gpio_shared_init+0x34/0x1c4
do_one_initcall+0x50/0x280
kernel_init_freeable+0x290/0x33c
kernel_init+0x28/0x14c
ret_from_fork+0x10/0x20
Fix this by decrementing the reference count of each list entry rather than
only the first.
Fix verified on the same laptop.
Fixes: a060b8c511abb gpiolib: implement low-level, shared GPIO support
Signed-off-by: Daniel J Blueman <daniel@quora.org>
Link: https://patch.msgid.link/20260220093452.101655-1-daniel@quora.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib-shared.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpio/gpiolib-shared.c b/drivers/gpio/gpiolib-shared.c
index 9e65442034393..e16f467b72e7a 100644
--- a/drivers/gpio/gpiolib-shared.c
+++ b/drivers/gpio/gpiolib-shared.c
@@ -753,14 +753,14 @@ static bool gpio_shared_entry_is_really_shared(struct gpio_shared_entry *entry)
static void gpio_shared_free_exclusive(void)
{
struct gpio_shared_entry *entry, *epos;
+ struct gpio_shared_ref *ref, *rpos;
list_for_each_entry_safe(entry, epos, &gpio_shared_list, list) {
if (gpio_shared_entry_is_really_shared(entry))
continue;
- gpio_shared_drop_ref(list_first_entry(&entry->refs,
- struct gpio_shared_ref,
- list));
+ list_for_each_entry_safe(ref, rpos, &entry->refs, list)
+ gpio_shared_drop_ref(ref);
gpio_shared_drop_entry(entry);
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 020/311] x86/fred: Correct speculative safety in fred_extint()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (18 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 019/311] gpio: shared: fix memory leaks Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 021/311] x86/bug: Handle __WARN_printf() trap in early_fixup_exception() Sasha Levin
` (304 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Andrew Cooper, Peter Zijlstra (Intel), Sasha Levin
From: Andrew Cooper <andrew.cooper3@citrix.com>
[ Upstream commit aa280a08e7d8fae58557acc345b36b3dc329d595 ]
array_index_nospec() is no use if the result gets spilled to the stack, as
it makes the believed safe-under-speculation value subject to memory
predictions.
For all practical purposes, this means array_index_nospec() must be used in
the expression that accesses the array.
As the code currently stands, it's the wrong side of irqentry_enter(), and
'index' is put into %ebp across the function call.
Remove the index variable and reposition array_index_nospec(), so it's
calculated immediately before the array access.
Fixes: 14619d912b65 ("x86/fred: FRED entry/exit and dispatch code")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260106131504.679932-1-andrew.cooper3@citrix.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/entry/entry_fred.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/x86/entry/entry_fred.c b/arch/x86/entry/entry_fred.c
index 94e626cc6a074..4fc5b176d3edb 100644
--- a/arch/x86/entry/entry_fred.c
+++ b/arch/x86/entry/entry_fred.c
@@ -159,8 +159,6 @@ void __init fred_complete_exception_setup(void)
static noinstr void fred_extint(struct pt_regs *regs)
{
unsigned int vector = regs->fred_ss.vector;
- unsigned int index = array_index_nospec(vector - FIRST_SYSTEM_VECTOR,
- NR_SYSTEM_VECTORS);
if (WARN_ON_ONCE(vector < FIRST_EXTERNAL_VECTOR))
return;
@@ -169,7 +167,8 @@ static noinstr void fred_extint(struct pt_regs *regs)
irqentry_state_t state = irqentry_enter(regs);
instrumentation_begin();
- sysvec_table[index](regs);
+ sysvec_table[array_index_nospec(vector - FIRST_SYSTEM_VECTOR,
+ NR_SYSTEM_VECTORS)](regs);
instrumentation_end();
irqentry_exit(regs, state);
} else {
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 021/311] x86/bug: Handle __WARN_printf() trap in early_fixup_exception()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (19 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 020/311] x86/fred: Correct speculative safety in fred_extint() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 022/311] x86/cfi: Fix CFI rewrite for odd alignments Sasha Levin
` (303 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Hou Wenlong, Peter Zijlstra (Intel), Sasha Levin
From: Hou Wenlong <houwenlong.hwl@antgroup.com>
[ Upstream commit a0cb371b521dde44f32cfe954b6ef6f82b407393 ]
The commit 5b472b6e5bd9 ("x86_64/bug: Implement __WARN_printf()")
implemented __WARN_printf(), which changed the mechanism to use UD1
instead of UD2. However, it only handles the trap in the runtime IDT
handler, while the early booting IDT handler lacks this handling. As a
result, the usage of WARN() before the runtime IDT setup can lead to
kernel crashes. Since KMSAN is enabled after the runtime IDT setup, it
is safe to use handle_bug() directly in early_fixup_exception() to
address this issue.
Fixes: 5b472b6e5bd9 ("x86_64/bug: Implement __WARN_printf()")
Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/c4fb3645f60d3a78629d9870e8fcc8535281c24f.1768016713.git.houwenlong.hwl@antgroup.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/include/asm/traps.h | 2 ++
arch/x86/kernel/traps.c | 2 +-
arch/x86/mm/extable.c | 7 ++-----
3 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/arch/x86/include/asm/traps.h b/arch/x86/include/asm/traps.h
index 869b880618018..3f24cc472ce9b 100644
--- a/arch/x86/include/asm/traps.h
+++ b/arch/x86/include/asm/traps.h
@@ -25,6 +25,8 @@ extern int ibt_selftest_noendbr(void);
void handle_invalid_op(struct pt_regs *regs);
#endif
+noinstr bool handle_bug(struct pt_regs *regs);
+
static inline int get_si_code(unsigned long condition)
{
if (condition & DR_STEP)
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index bcf1dedc1d008..aca1eca5daffa 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -397,7 +397,7 @@ static inline void handle_invalid_op(struct pt_regs *regs)
ILL_ILLOPN, error_get_trap_addr(regs));
}
-static noinstr bool handle_bug(struct pt_regs *regs)
+noinstr bool handle_bug(struct pt_regs *regs)
{
unsigned long addr = regs->ip;
bool handled = false;
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c
index 2fdc1f1f5adb9..6b9ff1c6cafa2 100644
--- a/arch/x86/mm/extable.c
+++ b/arch/x86/mm/extable.c
@@ -411,14 +411,11 @@ void __init early_fixup_exception(struct pt_regs *regs, int trapnr)
return;
if (trapnr == X86_TRAP_UD) {
- if (report_bug(regs->ip, regs) == BUG_TRAP_TYPE_WARN) {
- /* Skip the ud2. */
- regs->ip += LEN_UD2;
+ if (handle_bug(regs))
return;
- }
/*
- * If this was a BUG and report_bug returns or if this
+ * If this was a BUG and handle_bug returns or if this
* was just a normal #UD, we want to continue onward and
* crash.
*/
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 022/311] x86/cfi: Fix CFI rewrite for odd alignments
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (20 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 021/311] x86/bug: Handle __WARN_printf() trap in early_fixup_exception() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 023/311] sched/fair: Rename cfs_rq::avg_load to cfs_rq::sum_weight Sasha Levin
` (302 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Peter Zijlstra, Rustam Kovhaev, Sasha Levin
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit 24c8147abb39618d74fcc36e325765e8fe7bdd7a ]
Rustam reported his clang builds did not boot properly; turns out his
.config has: CONFIG_DEBUG_FORCE_FUNCTION_ALIGN_64B=y set.
Fix up the FineIBT code to deal with this unusual alignment.
Fixes: 931ab63664f0 ("x86/ibt: Implement FineIBT")
Reported-by: Rustam Kovhaev <rkovhaev@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Rustam Kovhaev <rkovhaev@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/include/asm/cfi.h | 12 ++++++++----
arch/x86/include/asm/linkage.h | 4 ++--
arch/x86/kernel/alternative.c | 29 ++++++++++++++++++++++-------
arch/x86/net/bpf_jit_comp.c | 13 ++-----------
4 files changed, 34 insertions(+), 24 deletions(-)
diff --git a/arch/x86/include/asm/cfi.h b/arch/x86/include/asm/cfi.h
index c40b9ebc1fb40..ab3fbbd947ed9 100644
--- a/arch/x86/include/asm/cfi.h
+++ b/arch/x86/include/asm/cfi.h
@@ -111,6 +111,12 @@ extern bhi_thunk __bhi_args_end[];
struct pt_regs;
+#ifdef CONFIG_CALL_PADDING
+#define CFI_OFFSET (CONFIG_FUNCTION_PADDING_CFI+5)
+#else
+#define CFI_OFFSET 5
+#endif
+
#ifdef CONFIG_CFI
enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);
#define __bpfcall
@@ -119,11 +125,9 @@ static inline int cfi_get_offset(void)
{
switch (cfi_mode) {
case CFI_FINEIBT:
- return 16;
+ return /* fineibt_prefix_size */ 16;
case CFI_KCFI:
- if (IS_ENABLED(CONFIG_CALL_PADDING))
- return 16;
- return 5;
+ return CFI_OFFSET;
default:
return 0;
}
diff --git a/arch/x86/include/asm/linkage.h b/arch/x86/include/asm/linkage.h
index 9d38ae744a2e4..a7294656ad908 100644
--- a/arch/x86/include/asm/linkage.h
+++ b/arch/x86/include/asm/linkage.h
@@ -68,7 +68,7 @@
* Depending on -fpatchable-function-entry=N,N usage (CONFIG_CALL_PADDING) the
* CFI symbol layout changes.
*
- * Without CALL_THUNKS:
+ * Without CALL_PADDING:
*
* .align FUNCTION_ALIGNMENT
* __cfi_##name:
@@ -77,7 +77,7 @@
* .long __kcfi_typeid_##name
* name:
*
- * With CALL_THUNKS:
+ * With CALL_PADDING:
*
* .align FUNCTION_ALIGNMENT
* __cfi_##name:
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 28518371d8bf3..a3f81cde2bb59 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -1147,7 +1147,7 @@ void __init_or_module noinline apply_seal_endbr(s32 *start, s32 *end)
poison_endbr(addr);
if (IS_ENABLED(CONFIG_FINEIBT))
- poison_cfi(addr - 16);
+ poison_cfi(addr - CFI_OFFSET);
}
}
@@ -1354,6 +1354,8 @@ extern u8 fineibt_preamble_end[];
#define fineibt_preamble_ud 0x13
#define fineibt_preamble_hash 5
+#define fineibt_prefix_size (fineibt_preamble_size - ENDBR_INSN_SIZE)
+
/*
* <fineibt_caller_start>:
* 0: b8 78 56 34 12 mov $0x12345678, %eax
@@ -1599,7 +1601,7 @@ static int cfi_rewrite_preamble(s32 *start, s32 *end)
* have determined there are no indirect calls to it and we
* don't need no CFI either.
*/
- if (!is_endbr(addr + 16))
+ if (!is_endbr(addr + CFI_OFFSET))
continue;
hash = decode_preamble_hash(addr, &arity);
@@ -1607,6 +1609,15 @@ static int cfi_rewrite_preamble(s32 *start, s32 *end)
addr, addr, 5, addr))
return -EINVAL;
+ /*
+ * FineIBT relies on being at func-16, so if the preamble is
+ * actually larger than that, place it the tail end.
+ *
+ * NOTE: this is possible with things like DEBUG_CALL_THUNKS
+ * and DEBUG_FORCE_FUNCTION_ALIGN_64B.
+ */
+ addr += CFI_OFFSET - fineibt_prefix_size;
+
text_poke_early(addr, fineibt_preamble_start, fineibt_preamble_size);
WARN_ON(*(u32 *)(addr + fineibt_preamble_hash) != 0x12345678);
text_poke_early(addr + fineibt_preamble_hash, &hash, 4);
@@ -1629,10 +1640,10 @@ static void cfi_rewrite_endbr(s32 *start, s32 *end)
for (s = start; s < end; s++) {
void *addr = (void *)s + *s;
- if (!exact_endbr(addr + 16))
+ if (!exact_endbr(addr + CFI_OFFSET))
continue;
- poison_endbr(addr + 16);
+ poison_endbr(addr + CFI_OFFSET);
}
}
@@ -1737,7 +1748,8 @@ static void __apply_fineibt(s32 *start_retpoline, s32 *end_retpoline,
if (FINEIBT_WARN(fineibt_preamble_size, 20) ||
FINEIBT_WARN(fineibt_preamble_bhi + fineibt_bhi1_size, 20) ||
FINEIBT_WARN(fineibt_caller_size, 14) ||
- FINEIBT_WARN(fineibt_paranoid_size, 20))
+ FINEIBT_WARN(fineibt_paranoid_size, 20) ||
+ WARN_ON_ONCE(CFI_OFFSET < fineibt_prefix_size))
return;
if (cfi_mode == CFI_AUTO) {
@@ -1850,6 +1862,11 @@ static void poison_cfi(void *addr)
*/
switch (cfi_mode) {
case CFI_FINEIBT:
+ /*
+ * FineIBT preamble is at func-16.
+ */
+ addr += CFI_OFFSET - fineibt_prefix_size;
+
/*
* FineIBT prefix should start with an ENDBR.
*/
@@ -1888,8 +1905,6 @@ static void poison_cfi(void *addr)
}
}
-#define fineibt_prefix_size (fineibt_preamble_size - ENDBR_INSN_SIZE)
-
/*
* When regs->ip points to a 0xD6 byte in the FineIBT preamble,
* return true and fill out target and type.
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index b0bac2a66eff3..ea76949ddda5e 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -438,17 +438,8 @@ static void emit_kcfi(u8 **pprog, u32 hash)
EMIT1_off32(0xb8, hash); /* movl $hash, %eax */
#ifdef CONFIG_CALL_PADDING
- EMIT1(0x90);
- EMIT1(0x90);
- EMIT1(0x90);
- EMIT1(0x90);
- EMIT1(0x90);
- EMIT1(0x90);
- EMIT1(0x90);
- EMIT1(0x90);
- EMIT1(0x90);
- EMIT1(0x90);
- EMIT1(0x90);
+ for (int i = 0; i < CONFIG_FUNCTION_PADDING_CFI; i++)
+ EMIT1(0x90);
#endif
EMIT_ENDBR();
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 023/311] sched/fair: Rename cfs_rq::avg_load to cfs_rq::sum_weight
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (21 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 022/311] x86/cfi: Fix CFI rewrite for odd alignments Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 024/311] sched/fair: Rename cfs_rq::avg_vruntime to ::sum_w_vruntime, and helper functions Sasha Levin
` (301 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Ingo Molnar, Sasha Levin
From: Ingo Molnar <mingo@kernel.org>
[ Upstream commit 4ff674fa986c27ec8a0542479258c92d361a2566 ]
The ::avg_load field is a long-standing misnomer: it says it's an
'average load', but in reality it's the momentary sum of the load
of all currently runnable tasks. We'd have to also perform a
division by nr_running (or use time-decay) to arrive at any sort
of average value.
This is clear from comments about the math of fair scheduling:
* \Sum w_i := cfs_rq->avg_load
The sum of all weights is ... the sum of all weights, not
the average of all weights.
To make it doubly confusing, there's also an ::avg_load
in the load-balancing struct sg_lb_stats, which *is* a
true average.
The second part of the field's name is a minor misnomer
as well: it says 'load', and it is indeed a load_weight
structure as it shares code with the load-balancer - but
it's only in an SMP load-balancing context where
load = weight, in the fair scheduling context the primary
purpose is the weighting of different nice levels.
So rename the field to ::sum_weight instead, which makes
the terminology of the EEVDF math match up with our
implementation of it:
* \Sum w_i := cfs_rq->sum_weight
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20251201064647.1851919-6-mingo@kernel.org
Stable-dep-of: b3d99f43c72b ("sched/fair: Fix zero_vruntime tracking")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/fair.c | 16 ++++++++--------
kernel/sched/sched.h | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 3eaeceda71b00..afb774c2f7bf7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -608,7 +608,7 @@ static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
*
* v0 := cfs_rq->zero_vruntime
* \Sum (v_i - v0) * w_i := cfs_rq->avg_vruntime
- * \Sum w_i := cfs_rq->avg_load
+ * \Sum w_i := cfs_rq->sum_weight
*
* Since zero_vruntime closely tracks the per-task service, these
* deltas: (v_i - v), will be in the order of the maximal (virtual) lag
@@ -625,7 +625,7 @@ avg_vruntime_add(struct cfs_rq *cfs_rq, struct sched_entity *se)
s64 key = entity_key(cfs_rq, se);
cfs_rq->avg_vruntime += key * weight;
- cfs_rq->avg_load += weight;
+ cfs_rq->sum_weight += weight;
}
static void
@@ -635,16 +635,16 @@ avg_vruntime_sub(struct cfs_rq *cfs_rq, struct sched_entity *se)
s64 key = entity_key(cfs_rq, se);
cfs_rq->avg_vruntime -= key * weight;
- cfs_rq->avg_load -= weight;
+ cfs_rq->sum_weight -= weight;
}
static inline
void avg_vruntime_update(struct cfs_rq *cfs_rq, s64 delta)
{
/*
- * v' = v + d ==> avg_vruntime' = avg_runtime - d*avg_load
+ * v' = v + d ==> avg_vruntime' = avg_runtime - d*sum_weight
*/
- cfs_rq->avg_vruntime -= cfs_rq->avg_load * delta;
+ cfs_rq->avg_vruntime -= cfs_rq->sum_weight * delta;
}
/*
@@ -655,7 +655,7 @@ u64 avg_vruntime(struct cfs_rq *cfs_rq)
{
struct sched_entity *curr = cfs_rq->curr;
s64 avg = cfs_rq->avg_vruntime;
- long load = cfs_rq->avg_load;
+ long load = cfs_rq->sum_weight;
if (curr && curr->on_rq) {
unsigned long weight = scale_load_down(curr->load.weight);
@@ -723,7 +723,7 @@ static int vruntime_eligible(struct cfs_rq *cfs_rq, u64 vruntime)
{
struct sched_entity *curr = cfs_rq->curr;
s64 avg = cfs_rq->avg_vruntime;
- long load = cfs_rq->avg_load;
+ long load = cfs_rq->sum_weight;
if (curr && curr->on_rq) {
unsigned long weight = scale_load_down(curr->load.weight);
@@ -5175,7 +5175,7 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
*
* vl_i = (W + w_i)*vl'_i / W
*/
- load = cfs_rq->avg_load;
+ load = cfs_rq->sum_weight;
if (curr && curr->on_rq)
load += scale_load_down(curr->load.weight);
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index 1b4283e9edc3b..f4e9a21cf0936 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -679,7 +679,7 @@ struct cfs_rq {
unsigned int h_nr_idle; /* SCHED_IDLE */
s64 avg_vruntime;
- u64 avg_load;
+ u64 sum_weight;
u64 zero_vruntime;
#ifdef CONFIG_SCHED_CORE
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 024/311] sched/fair: Rename cfs_rq::avg_vruntime to ::sum_w_vruntime, and helper functions
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (22 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 023/311] sched/fair: Rename cfs_rq::avg_load to cfs_rq::sum_weight Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 025/311] sched/fair: Introduce and use the vruntime_cmp() and vruntime_op() wrappers for wrapped-signed aritmetics Sasha Levin
` (300 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Ingo Molnar, Sasha Levin
From: Ingo Molnar <mingo@kernel.org>
[ Upstream commit dcbc9d3f0e594223275a18f7016001889ad35eff ]
The ::avg_vruntime field is a misnomer: it says it's an
'average vruntime', but in reality it's the momentary sum
of the weighted vruntimes of all queued tasks, which is
at least a division away from being an average.
This is clear from comments about the math of fair scheduling:
* \Sum (v_i - v0) * w_i := cfs_rq->avg_vruntime
This confusion is increased by the cfs_avg_vruntime() function,
which does perform the division and returns a true average.
The sum of all weighted vruntimes should be named thusly,
so rename the field to ::sum_w_vruntime. (As arguably
::sum_weighted_vruntime would be a bit of a mouthful.)
Understanding the scheduler is hard enough already, without
extra layers of obfuscated naming. ;-)
Also rename related helper functions:
sum_vruntime_add() => sum_w_vruntime_add()
sum_vruntime_sub() => sum_w_vruntime_sub()
sum_vruntime_update() => sum_w_vruntime_update()
With the notable exception of cfs_avg_vruntime(), which
was named accurately.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20251201064647.1851919-7-mingo@kernel.org
Stable-dep-of: b3d99f43c72b ("sched/fair: Fix zero_vruntime tracking")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/fair.c | 26 +++++++++++++-------------
kernel/sched/sched.h | 2 +-
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index afb774c2f7bf7..f06a5d36106b4 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -607,7 +607,7 @@ static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
* Which we track using:
*
* v0 := cfs_rq->zero_vruntime
- * \Sum (v_i - v0) * w_i := cfs_rq->avg_vruntime
+ * \Sum (v_i - v0) * w_i := cfs_rq->sum_w_vruntime
* \Sum w_i := cfs_rq->sum_weight
*
* Since zero_vruntime closely tracks the per-task service, these
@@ -619,32 +619,32 @@ static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
* As measured, the max (key * weight) value was ~44 bits for a kernel build.
*/
static void
-avg_vruntime_add(struct cfs_rq *cfs_rq, struct sched_entity *se)
+sum_w_vruntime_add(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
unsigned long weight = scale_load_down(se->load.weight);
s64 key = entity_key(cfs_rq, se);
- cfs_rq->avg_vruntime += key * weight;
+ cfs_rq->sum_w_vruntime += key * weight;
cfs_rq->sum_weight += weight;
}
static void
-avg_vruntime_sub(struct cfs_rq *cfs_rq, struct sched_entity *se)
+sum_w_vruntime_sub(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
unsigned long weight = scale_load_down(se->load.weight);
s64 key = entity_key(cfs_rq, se);
- cfs_rq->avg_vruntime -= key * weight;
+ cfs_rq->sum_w_vruntime -= key * weight;
cfs_rq->sum_weight -= weight;
}
static inline
-void avg_vruntime_update(struct cfs_rq *cfs_rq, s64 delta)
+void sum_w_vruntime_update(struct cfs_rq *cfs_rq, s64 delta)
{
/*
- * v' = v + d ==> avg_vruntime' = avg_runtime - d*sum_weight
+ * v' = v + d ==> sum_w_vruntime' = sum_runtime - d*sum_weight
*/
- cfs_rq->avg_vruntime -= cfs_rq->sum_weight * delta;
+ cfs_rq->sum_w_vruntime -= cfs_rq->sum_weight * delta;
}
/*
@@ -654,7 +654,7 @@ void avg_vruntime_update(struct cfs_rq *cfs_rq, s64 delta)
u64 avg_vruntime(struct cfs_rq *cfs_rq)
{
struct sched_entity *curr = cfs_rq->curr;
- s64 avg = cfs_rq->avg_vruntime;
+ s64 avg = cfs_rq->sum_w_vruntime;
long load = cfs_rq->sum_weight;
if (curr && curr->on_rq) {
@@ -722,7 +722,7 @@ static void update_entity_lag(struct cfs_rq *cfs_rq, struct sched_entity *se)
static int vruntime_eligible(struct cfs_rq *cfs_rq, u64 vruntime)
{
struct sched_entity *curr = cfs_rq->curr;
- s64 avg = cfs_rq->avg_vruntime;
+ s64 avg = cfs_rq->sum_w_vruntime;
long load = cfs_rq->sum_weight;
if (curr && curr->on_rq) {
@@ -745,7 +745,7 @@ static void update_zero_vruntime(struct cfs_rq *cfs_rq)
u64 vruntime = avg_vruntime(cfs_rq);
s64 delta = (s64)(vruntime - cfs_rq->zero_vruntime);
- avg_vruntime_update(cfs_rq, delta);
+ sum_w_vruntime_update(cfs_rq, delta);
cfs_rq->zero_vruntime = vruntime;
}
@@ -819,7 +819,7 @@ RB_DECLARE_CALLBACKS(static, min_vruntime_cb, struct sched_entity,
*/
static void __enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
- avg_vruntime_add(cfs_rq, se);
+ sum_w_vruntime_add(cfs_rq, se);
update_zero_vruntime(cfs_rq);
se->min_vruntime = se->vruntime;
se->min_slice = se->slice;
@@ -831,7 +831,7 @@ static void __dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
rb_erase_augmented_cached(&se->run_node, &cfs_rq->tasks_timeline,
&min_vruntime_cb);
- avg_vruntime_sub(cfs_rq, se);
+ sum_w_vruntime_sub(cfs_rq, se);
update_zero_vruntime(cfs_rq);
}
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
index f4e9a21cf0936..d3485d48be281 100644
--- a/kernel/sched/sched.h
+++ b/kernel/sched/sched.h
@@ -678,7 +678,7 @@ struct cfs_rq {
unsigned int h_nr_runnable; /* SCHED_{NORMAL,BATCH,IDLE} */
unsigned int h_nr_idle; /* SCHED_IDLE */
- s64 avg_vruntime;
+ s64 sum_w_vruntime;
u64 sum_weight;
u64 zero_vruntime;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 025/311] sched/fair: Introduce and use the vruntime_cmp() and vruntime_op() wrappers for wrapped-signed aritmetics
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (23 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 024/311] sched/fair: Rename cfs_rq::avg_vruntime to ::sum_w_vruntime, and helper functions Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 026/311] sched/fair: Fix zero_vruntime tracking Sasha Levin
` (299 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Ingo Molnar, Sasha Levin
From: Ingo Molnar <mingo@kernel.org>
[ Upstream commit 5758e48eefaf111d7764d8f1c8b666140fe5fa27 ]
We have to be careful with vruntime comparisons and subtraction,
due to the possibility of wrapping, so we have macros like:
#define vruntime_gt(field, lse, rse) ({ (s64)((lse)->field - (rse)->field) > 0; })
Which is used like this:
if (vruntime_gt(min_vruntime, se, rse))
se->min_vruntime = rse->min_vruntime;
Replace this with an easier to read pattern that uses the regular
arithmetics operators:
if (vruntime_cmp(se->min_vruntime, ">", rse->min_vruntime))
se->min_vruntime = rse->min_vruntime;
Also replace vruntime subtractions with vruntime_op():
- delta = (s64)(sea->vruntime - seb->vruntime) +
- (s64)(cfs_rqb->zero_vruntime_fi - cfs_rqa->zero_vruntime_fi);
+ delta = vruntime_op(sea->vruntime, "-", seb->vruntime) +
+ vruntime_op(cfs_rqb->zero_vruntime_fi, "-", cfs_rqa->zero_vruntime_fi);
In the vruntime_cmp() and vruntime_op() macros use Use __builtin_strcmp(),
because of __HAVE_ARCH_STRCMP might turn off the compiler optimizations
we rely on here to catch usage bugs.
No change in functionality.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Stable-dep-of: b3d99f43c72b ("sched/fair: Fix zero_vruntime tracking")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/fair.c | 66 ++++++++++++++++++++++++++++++++++-----------
1 file changed, 51 insertions(+), 15 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f06a5d36106b4..0fb6c3d43620f 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -524,10 +524,48 @@ void account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec);
* Scheduling class tree data structure manipulation methods:
*/
+extern void __BUILD_BUG_vruntime_cmp(void);
+
+/* Use __builtin_strcmp() because of __HAVE_ARCH_STRCMP: */
+
+#define vruntime_cmp(A, CMP_STR, B) ({ \
+ int __res = 0; \
+ \
+ if (!__builtin_strcmp(CMP_STR, "<")) { \
+ __res = ((s64)((A)-(B)) < 0); \
+ } else if (!__builtin_strcmp(CMP_STR, "<=")) { \
+ __res = ((s64)((A)-(B)) <= 0); \
+ } else if (!__builtin_strcmp(CMP_STR, ">")) { \
+ __res = ((s64)((A)-(B)) > 0); \
+ } else if (!__builtin_strcmp(CMP_STR, ">=")) { \
+ __res = ((s64)((A)-(B)) >= 0); \
+ } else { \
+ /* Unknown operator throws linker error: */ \
+ __BUILD_BUG_vruntime_cmp(); \
+ } \
+ \
+ __res; \
+})
+
+extern void __BUILD_BUG_vruntime_op(void);
+
+#define vruntime_op(A, OP_STR, B) ({ \
+ s64 __res = 0; \
+ \
+ if (!__builtin_strcmp(OP_STR, "-")) { \
+ __res = (s64)((A)-(B)); \
+ } else { \
+ /* Unknown operator throws linker error: */ \
+ __BUILD_BUG_vruntime_op(); \
+ } \
+ \
+ __res; \
+})
+
+
static inline __maybe_unused u64 max_vruntime(u64 max_vruntime, u64 vruntime)
{
- s64 delta = (s64)(vruntime - max_vruntime);
- if (delta > 0)
+ if (vruntime_cmp(vruntime, ">", max_vruntime))
max_vruntime = vruntime;
return max_vruntime;
@@ -535,8 +573,7 @@ static inline __maybe_unused u64 max_vruntime(u64 max_vruntime, u64 vruntime)
static inline __maybe_unused u64 min_vruntime(u64 min_vruntime, u64 vruntime)
{
- s64 delta = (s64)(vruntime - min_vruntime);
- if (delta < 0)
+ if (vruntime_cmp(vruntime, "<", min_vruntime))
min_vruntime = vruntime;
return min_vruntime;
@@ -549,12 +586,12 @@ static inline bool entity_before(const struct sched_entity *a,
* Tiebreak on vruntime seems unnecessary since it can
* hardly happen.
*/
- return (s64)(a->deadline - b->deadline) < 0;
+ return vruntime_cmp(a->deadline, "<", b->deadline);
}
static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
- return (s64)(se->vruntime - cfs_rq->zero_vruntime);
+ return vruntime_op(se->vruntime, "-", cfs_rq->zero_vruntime);
}
#define __node_2_se(node) \
@@ -732,7 +769,7 @@ static int vruntime_eligible(struct cfs_rq *cfs_rq, u64 vruntime)
load += weight;
}
- return avg >= (s64)(vruntime - cfs_rq->zero_vruntime) * load;
+ return avg >= vruntime_op(vruntime, "-", cfs_rq->zero_vruntime) * load;
}
int entity_eligible(struct cfs_rq *cfs_rq, struct sched_entity *se)
@@ -743,7 +780,7 @@ int entity_eligible(struct cfs_rq *cfs_rq, struct sched_entity *se)
static void update_zero_vruntime(struct cfs_rq *cfs_rq)
{
u64 vruntime = avg_vruntime(cfs_rq);
- s64 delta = (s64)(vruntime - cfs_rq->zero_vruntime);
+ s64 delta = vruntime_op(vruntime, "-", cfs_rq->zero_vruntime);
sum_w_vruntime_update(cfs_rq, delta);
@@ -770,13 +807,12 @@ static inline bool __entity_less(struct rb_node *a, const struct rb_node *b)
return entity_before(__node_2_se(a), __node_2_se(b));
}
-#define vruntime_gt(field, lse, rse) ({ (s64)((lse)->field - (rse)->field) > 0; })
-
static inline void __min_vruntime_update(struct sched_entity *se, struct rb_node *node)
{
if (node) {
struct sched_entity *rse = __node_2_se(node);
- if (vruntime_gt(min_vruntime, se, rse))
+
+ if (vruntime_cmp(se->min_vruntime, ">", rse->min_vruntime))
se->min_vruntime = rse->min_vruntime;
}
}
@@ -887,7 +923,7 @@ static inline void update_protect_slice(struct cfs_rq *cfs_rq, struct sched_enti
static inline bool protect_slice(struct sched_entity *se)
{
- return ((s64)(se->vprot - se->vruntime) > 0);
+ return vruntime_cmp(se->vruntime, "<", se->vprot);
}
static inline void cancel_protect_slice(struct sched_entity *se)
@@ -1024,7 +1060,7 @@ static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se);
*/
static bool update_deadline(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
- if ((s64)(se->vruntime - se->deadline) < 0)
+ if (vruntime_cmp(se->vruntime, "<", se->deadline))
return false;
/*
@@ -13319,8 +13355,8 @@ bool cfs_prio_less(const struct task_struct *a, const struct task_struct *b,
* zero_vruntime_fi, which would have been updated in prior calls
* to se_fi_update().
*/
- delta = (s64)(sea->vruntime - seb->vruntime) +
- (s64)(cfs_rqb->zero_vruntime_fi - cfs_rqa->zero_vruntime_fi);
+ delta = vruntime_op(sea->vruntime, "-", seb->vruntime) +
+ vruntime_op(cfs_rqb->zero_vruntime_fi, "-", cfs_rqa->zero_vruntime_fi);
return delta > 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 026/311] sched/fair: Fix zero_vruntime tracking
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (24 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 025/311] sched/fair: Introduce and use the vruntime_cmp() and vruntime_op() wrappers for wrapped-signed aritmetics Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 027/311] sched/fair: Only set slice protection at pick time Sasha Levin
` (298 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Peter Zijlstra, K Prateek Nayak, Shubhang Kaushik, Sasha Levin
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit b3d99f43c72b56cf7a104a364e7fb34b0702828b ]
It turns out that zero_vruntime tracking is broken when there is but a single
task running. Current update paths are through __{en,de}queue_entity(), and
when there is but a single task, pick_next_task() will always return that one
task, and put_prev_set_next_task() will end up in neither function.
This can cause entity_key() to grow indefinitely large and cause overflows,
leading to much pain and suffering.
Furtermore, doing update_zero_vruntime() from __{de,en}queue_entity(), which
are called from {set_next,put_prev}_entity() has problems because:
- set_next_entity() calls __dequeue_entity() before it does cfs_rq->curr = se.
This means the avg_vruntime() will see the removal but not current, missing
the entity for accounting.
- put_prev_entity() calls __enqueue_entity() before it does cfs_rq->curr =
NULL. This means the avg_vruntime() will see the addition *and* current,
leading to double accounting.
Both cases are incorrect/inconsistent.
Noting that avg_vruntime is already called on each {en,de}queue, remove the
explicit avg_vruntime() calls (which removes an extra 64bit division for each
{en,de}queue) and have avg_vruntime() update zero_vruntime itself.
Additionally, have the tick call avg_vruntime() -- discarding the result, but
for the side-effect of updating zero_vruntime.
While there, optimize avg_vruntime() by noting that the average of one value is
rather trivial to compute.
Test case:
# taskset -c -p 1 $$
# taskset -c 2 bash -c 'while :; do :; done&'
# cat /sys/kernel/debug/sched/debug | awk '/^cpu#/ {P=0} /^cpu#2,/ {P=1} {if (P) print $0}' | grep -e zero_vruntime -e "^>"
PRE:
.zero_vruntime : 31316.407903
>R bash 487 50787.345112 E 50789.145972 2.800000 50780.298364 16 120 0.000000 0.000000 0.000000 /
.zero_vruntime : 382548.253179
>R bash 487 427275.204288 E 427276.003584 2.800000 427268.157540 23 120 0.000000 0.000000 0.000000 /
POST:
.zero_vruntime : 17259.709467
>R bash 526 17259.709467 E 17262.509467 2.800000 16915.031624 9 120 0.000000 0.000000 0.000000 /
.zero_vruntime : 18702.723356
>R bash 526 18702.723356 E 18705.523356 2.800000 18358.045513 9 120 0.000000 0.000000 0.000000 /
Fixes: 79f3f9bedd14 ("sched/eevdf: Fix min_vruntime vs avg_vruntime")
Reported-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: Shubhang Kaushik <shubhang@os.amperecomputing.com>
Link: https://patch.msgid.link/20260219080624.438854780%40infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/fair.c | 84 ++++++++++++++++++++++++++++++---------------
1 file changed, 57 insertions(+), 27 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 0fb6c3d43620f..436dec8927232 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -589,6 +589,21 @@ static inline bool entity_before(const struct sched_entity *a,
return vruntime_cmp(a->deadline, "<", b->deadline);
}
+/*
+ * Per avg_vruntime() below, cfs_rq::zero_vruntime is only slightly stale
+ * and this value should be no more than two lag bounds. Which puts it in the
+ * general order of:
+ *
+ * (slice + TICK_NSEC) << NICE_0_LOAD_SHIFT
+ *
+ * which is around 44 bits in size (on 64bit); that is 20 for
+ * NICE_0_LOAD_SHIFT, another 20 for NSEC_PER_MSEC and then a handful for
+ * however many msec the actual slice+tick ends up begin.
+ *
+ * (disregarding the actual divide-by-weight part makes for the worst case
+ * weight of 2, which nicely cancels vs the fuzz in zero_vruntime not actually
+ * being the zero-lag point).
+ */
static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
return vruntime_op(se->vruntime, "-", cfs_rq->zero_vruntime);
@@ -676,39 +691,61 @@ sum_w_vruntime_sub(struct cfs_rq *cfs_rq, struct sched_entity *se)
}
static inline
-void sum_w_vruntime_update(struct cfs_rq *cfs_rq, s64 delta)
+void update_zero_vruntime(struct cfs_rq *cfs_rq, s64 delta)
{
/*
- * v' = v + d ==> sum_w_vruntime' = sum_runtime - d*sum_weight
+ * v' = v + d ==> sum_w_vruntime' = sum_w_vruntime - d*sum_weight
*/
cfs_rq->sum_w_vruntime -= cfs_rq->sum_weight * delta;
+ cfs_rq->zero_vruntime += delta;
}
/*
- * Specifically: avg_runtime() + 0 must result in entity_eligible() := true
+ * Specifically: avg_vruntime() + 0 must result in entity_eligible() := true
* For this to be so, the result of this function must have a left bias.
+ *
+ * Called in:
+ * - place_entity() -- before enqueue
+ * - update_entity_lag() -- before dequeue
+ * - entity_tick()
+ *
+ * This means it is one entry 'behind' but that puts it close enough to where
+ * the bound on entity_key() is at most two lag bounds.
*/
u64 avg_vruntime(struct cfs_rq *cfs_rq)
{
struct sched_entity *curr = cfs_rq->curr;
- s64 avg = cfs_rq->sum_w_vruntime;
- long load = cfs_rq->sum_weight;
+ long weight = cfs_rq->sum_weight;
+ s64 delta = 0;
- if (curr && curr->on_rq) {
- unsigned long weight = scale_load_down(curr->load.weight);
+ if (curr && !curr->on_rq)
+ curr = NULL;
- avg += entity_key(cfs_rq, curr) * weight;
- load += weight;
- }
+ if (weight) {
+ s64 runtime = cfs_rq->sum_w_vruntime;
+
+ if (curr) {
+ unsigned long w = scale_load_down(curr->load.weight);
+
+ runtime += entity_key(cfs_rq, curr) * w;
+ weight += w;
+ }
- if (load) {
/* sign flips effective floor / ceiling */
- if (avg < 0)
- avg -= (load - 1);
- avg = div_s64(avg, load);
+ if (runtime < 0)
+ runtime -= (weight - 1);
+
+ delta = div_s64(runtime, weight);
+ } else if (curr) {
+ /*
+ * When there is but one element, it is the average.
+ */
+ delta = curr->vruntime - cfs_rq->zero_vruntime;
}
- return cfs_rq->zero_vruntime + avg;
+ update_zero_vruntime(cfs_rq, delta);
+
+ return cfs_rq->zero_vruntime;
}
/*
@@ -777,16 +814,6 @@ int entity_eligible(struct cfs_rq *cfs_rq, struct sched_entity *se)
return vruntime_eligible(cfs_rq, se->vruntime);
}
-static void update_zero_vruntime(struct cfs_rq *cfs_rq)
-{
- u64 vruntime = avg_vruntime(cfs_rq);
- s64 delta = vruntime_op(vruntime, "-", cfs_rq->zero_vruntime);
-
- sum_w_vruntime_update(cfs_rq, delta);
-
- cfs_rq->zero_vruntime = vruntime;
-}
-
static inline u64 cfs_rq_min_slice(struct cfs_rq *cfs_rq)
{
struct sched_entity *root = __pick_root_entity(cfs_rq);
@@ -856,7 +883,6 @@ RB_DECLARE_CALLBACKS(static, min_vruntime_cb, struct sched_entity,
static void __enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
sum_w_vruntime_add(cfs_rq, se);
- update_zero_vruntime(cfs_rq);
se->min_vruntime = se->vruntime;
se->min_slice = se->slice;
rb_add_augmented_cached(&se->run_node, &cfs_rq->tasks_timeline,
@@ -868,7 +894,6 @@ static void __dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
rb_erase_augmented_cached(&se->run_node, &cfs_rq->tasks_timeline,
&min_vruntime_cb);
sum_w_vruntime_sub(cfs_rq, se);
- update_zero_vruntime(cfs_rq);
}
struct sched_entity *__pick_root_entity(struct cfs_rq *cfs_rq)
@@ -5567,6 +5592,11 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued)
update_load_avg(cfs_rq, curr, UPDATE_TG);
update_cfs_group(curr);
+ /*
+ * Pulls along cfs_rq::zero_vruntime.
+ */
+ avg_vruntime(cfs_rq);
+
#ifdef CONFIG_SCHED_HRTICK
/*
* queued ticks are scheduled to match the slice, so don't bother
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 027/311] sched/fair: Only set slice protection at pick time
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (25 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 026/311] sched/fair: Fix zero_vruntime tracking Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 028/311] sched/eevdf: Update se->vprot in reweight_entity() Sasha Levin
` (297 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Peter Zijlstra, Vincent Guittot, K Prateek Nayak,
Shubhang Kaushik, Sasha Levin
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit bcd74b2ffdd0a2233adbf26b65c62fc69a809c8e ]
We should not (re)set slice protection in the sched_change pattern
which calls put_prev_task() / set_next_task().
Fixes: 63304558ba5d ("sched/eevdf: Curb wakeup-preemption")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: Shubhang Kaushik <shubhang@os.amperecomputing.com>
Link: https://patch.msgid.link/20260219080624.561421378%40infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/fair.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 436dec8927232..6f66d4f0540ea 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5488,7 +5488,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
}
static void
-set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
+set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, bool first)
{
clear_buddies(cfs_rq, se);
@@ -5503,7 +5503,8 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se)
__dequeue_entity(cfs_rq, se);
update_load_avg(cfs_rq, se, UPDATE_TG);
- set_protect_slice(cfs_rq, se);
+ if (first)
+ set_protect_slice(cfs_rq, se);
}
update_stats_curr_start(cfs_rq, se);
@@ -9016,13 +9017,13 @@ pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf
pse = parent_entity(pse);
}
if (se_depth >= pse_depth) {
- set_next_entity(cfs_rq_of(se), se);
+ set_next_entity(cfs_rq_of(se), se, true);
se = parent_entity(se);
}
}
put_prev_entity(cfs_rq, pse);
- set_next_entity(cfs_rq, se);
+ set_next_entity(cfs_rq, se, true);
__set_next_task_fair(rq, p, true);
}
@@ -13621,7 +13622,7 @@ static void set_next_task_fair(struct rq *rq, struct task_struct *p, bool first)
for_each_sched_entity(se) {
struct cfs_rq *cfs_rq = cfs_rq_of(se);
- set_next_entity(cfs_rq, se);
+ set_next_entity(cfs_rq, se, first);
/* ensure bandwidth has been allocated on our new cfs_rq */
account_cfs_rq_runtime(cfs_rq, 0);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 028/311] sched/eevdf: Update se->vprot in reweight_entity()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (26 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 027/311] sched/fair: Only set slice protection at pick time Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 029/311] sched/fair: Fix lag clamp Sasha Levin
` (296 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Wang Tao, Zhang Qiao, Peter Zijlstra (Intel), Vincent Guittot,
K Prateek Nayak, Shubhang Kaushik, Sasha Levin
From: Wang Tao <wangtao554@huawei.com>
[ Upstream commit ff38424030f98976150e42ca35f4b00e6ab8fa23 ]
In the EEVDF framework with Run-to-Parity protection, `se->vprot` is an
independent variable defining the virtual protection timestamp.
When `reweight_entity()` is called (e.g., via nice/renice), it performs
the following actions to preserve Lag consistency:
1. Scales `se->vlag` based on the new weight.
2. Calls `place_entity()`, which recalculates `se->vruntime` based on
the new weight and scaled lag.
However, the current implementation fails to update `se->vprot`, leading
to mismatches between the task's actual runtime and its expected duration.
Fixes: 63304558ba5d ("sched/eevdf: Curb wakeup-preemption")
Suggested-by: Zhang Qiao <zhangqiao22@huawei.com>
Signed-off-by: Wang Tao <wangtao554@huawei.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: Shubhang Kaushik <shubhang@os.amperecomputing.com>
Link: https://patch.msgid.link/20260120123113.3518950-1-wangtao554@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/fair.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 6f66d4f0540ea..c8a6dac54e220 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3816,6 +3816,8 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
unsigned long weight)
{
bool curr = cfs_rq->curr == se;
+ bool rel_vprot = false;
+ u64 vprot;
if (se->on_rq) {
/* commit outstanding execution time */
@@ -3823,6 +3825,11 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
update_entity_lag(cfs_rq, se);
se->deadline -= se->vruntime;
se->rel_deadline = 1;
+ if (curr && protect_slice(se)) {
+ vprot = se->vprot - se->vruntime;
+ rel_vprot = true;
+ }
+
cfs_rq->nr_queued--;
if (!curr)
__dequeue_entity(cfs_rq, se);
@@ -3838,6 +3845,9 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
if (se->rel_deadline)
se->deadline = div_s64(se->deadline * se->load.weight, weight);
+ if (rel_vprot)
+ vprot = div_s64(vprot * se->load.weight, weight);
+
update_load_set(&se->load, weight);
do {
@@ -3849,6 +3859,8 @@ static void reweight_entity(struct cfs_rq *cfs_rq, struct sched_entity *se,
enqueue_load_avg(cfs_rq, se);
if (se->on_rq) {
place_entity(cfs_rq, se, 0);
+ if (rel_vprot)
+ se->vprot = se->vruntime + vprot;
update_load_add(&cfs_rq->load, se->load.weight);
if (!curr)
__enqueue_entity(cfs_rq, se);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 029/311] sched/fair: Fix lag clamp
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (27 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 028/311] sched/eevdf: Update se->vprot in reweight_entity() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 030/311] rseq: Clarify rseq registration rseq_size bound check comment Sasha Levin
` (295 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Peter Zijlstra, Vincent Guittot, K Prateek Nayak,
Shubhang Kaushik, Sasha Levin
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit 6e3c0a4e1ad1e0455b7880fad02b3ee179f56c09 ]
Vincent reported that he was seeing undue lag clamping in a mixed
slice workload. Implement the max_slice tracking as per the todo
comment.
Fixes: 147f3efaa241 ("sched/fair: Implement an EEVDF-like scheduling policy")
Reported-off-by: Vincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Vincent Guittot <vincent.guittot@linaro.org>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: Shubhang Kaushik <shubhang@os.amperecomputing.com>
Link: https://patch.msgid.link/20250422101628.GA33555@noisy.programming.kicks-ass.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/sched.h | 1 +
kernel/sched/fair.c | 39 +++++++++++++++++++++++++++++++++++----
2 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 5f00b5ed0f3b7..eb1c4c347a5cf 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -574,6 +574,7 @@ struct sched_entity {
u64 deadline;
u64 min_vruntime;
u64 min_slice;
+ u64 max_slice;
struct list_head group_node;
unsigned char on_rq;
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c8a6dac54e220..a8e766eaca1f9 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -748,6 +748,8 @@ u64 avg_vruntime(struct cfs_rq *cfs_rq)
return cfs_rq->zero_vruntime;
}
+static inline u64 cfs_rq_max_slice(struct cfs_rq *cfs_rq);
+
/*
* lag_i = S - s_i = w_i * (V - v_i)
*
@@ -761,17 +763,16 @@ u64 avg_vruntime(struct cfs_rq *cfs_rq)
* EEVDF gives the following limit for a steady state system:
*
* -r_max < lag < max(r_max, q)
- *
- * XXX could add max_slice to the augmented data to track this.
*/
static void update_entity_lag(struct cfs_rq *cfs_rq, struct sched_entity *se)
{
+ u64 max_slice = cfs_rq_max_slice(cfs_rq) + TICK_NSEC;
s64 vlag, limit;
WARN_ON_ONCE(!se->on_rq);
vlag = avg_vruntime(cfs_rq) - se->vruntime;
- limit = calc_delta_fair(max_t(u64, 2*se->slice, TICK_NSEC), se);
+ limit = calc_delta_fair(max_slice, se);
se->vlag = clamp(vlag, -limit, limit);
}
@@ -829,6 +830,21 @@ static inline u64 cfs_rq_min_slice(struct cfs_rq *cfs_rq)
return min_slice;
}
+static inline u64 cfs_rq_max_slice(struct cfs_rq *cfs_rq)
+{
+ struct sched_entity *root = __pick_root_entity(cfs_rq);
+ struct sched_entity *curr = cfs_rq->curr;
+ u64 max_slice = 0ULL;
+
+ if (curr && curr->on_rq)
+ max_slice = curr->slice;
+
+ if (root)
+ max_slice = max(max_slice, root->max_slice);
+
+ return max_slice;
+}
+
static inline bool __entity_less(struct rb_node *a, const struct rb_node *b)
{
return entity_before(__node_2_se(a), __node_2_se(b));
@@ -853,6 +869,15 @@ static inline void __min_slice_update(struct sched_entity *se, struct rb_node *n
}
}
+static inline void __max_slice_update(struct sched_entity *se, struct rb_node *node)
+{
+ if (node) {
+ struct sched_entity *rse = __node_2_se(node);
+ if (rse->max_slice > se->max_slice)
+ se->max_slice = rse->max_slice;
+ }
+}
+
/*
* se->min_vruntime = min(se->vruntime, {left,right}->min_vruntime)
*/
@@ -860,6 +885,7 @@ static inline bool min_vruntime_update(struct sched_entity *se, bool exit)
{
u64 old_min_vruntime = se->min_vruntime;
u64 old_min_slice = se->min_slice;
+ u64 old_max_slice = se->max_slice;
struct rb_node *node = &se->run_node;
se->min_vruntime = se->vruntime;
@@ -870,8 +896,13 @@ static inline bool min_vruntime_update(struct sched_entity *se, bool exit)
__min_slice_update(se, node->rb_right);
__min_slice_update(se, node->rb_left);
+ se->max_slice = se->slice;
+ __max_slice_update(se, node->rb_right);
+ __max_slice_update(se, node->rb_left);
+
return se->min_vruntime == old_min_vruntime &&
- se->min_slice == old_min_slice;
+ se->min_slice == old_min_slice &&
+ se->max_slice == old_max_slice;
}
RB_DECLARE_CALLBACKS(static, min_vruntime_cb, struct sched_entity,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 030/311] rseq: Clarify rseq registration rseq_size bound check comment
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (28 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 029/311] sched/fair: Fix lag clamp Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 031/311] perf/core: Fix invalid wait context in ctx_sched_in() Sasha Levin
` (294 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Mathieu Desnoyers, Peter Zijlstra (Intel), Sasha Levin
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
[ Upstream commit 26d43a90be81fc90e26688a51d3ec83188602731 ]
The rseq registration validates that the rseq_size argument is greater
or equal to 32 (the original rseq size), but the comment associated with
this check does not clearly state this.
Clarify the comment to that effect.
Fixes: ee3e3ac05c26 ("rseq: Introduce extensible rseq ABI")
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260220200642.1317826-2-mathieu.desnoyers@efficios.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/rseq.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/rseq.c b/kernel/rseq.c
index 395d8b002350a..6cb5b7e51555d 100644
--- a/kernel/rseq.c
+++ b/kernel/rseq.c
@@ -428,8 +428,9 @@ SYSCALL_DEFINE4(rseq, struct rseq __user *, rseq, u32, rseq_len, int, flags, u32
* auxiliary vector AT_RSEQ_ALIGN. If rseq_len is the original rseq
* size, the required alignment is the original struct rseq alignment.
*
- * In order to be valid, rseq_len is either the original rseq size, or
- * large enough to contain all supported fields, as communicated to
+ * The rseq_len is required to be greater or equal to the original rseq
+ * size. In order to be valid, rseq_len is either the original rseq size,
+ * or large enough to contain all supported fields, as communicated to
* user-space through the ELF auxiliary vector AT_RSEQ_FEATURE_SIZE.
*/
if (rseq_len < ORIG_RSEQ_SIZE ||
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 031/311] perf/core: Fix invalid wait context in ctx_sched_in()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (29 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 030/311] rseq: Clarify rseq registration rseq_size bound check comment Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 032/311] accel/amdxdna: Remove buffer size check when creating command BO Sasha Levin
` (293 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Namhyung Kim, Lai, Yi, Peter Zijlstra (Intel), Sasha Levin
From: Namhyung Kim <namhyung@kernel.org>
[ Upstream commit 486ff5ad49bc50315bcaf6d45f04a33ef0a45ced ]
Lockdep found a bug in the event scheduling when a pinned event was
failed and wakes up the threads in the ring buffer like below.
It seems it should not grab a wait-queue lock under perf-context lock.
Let's do it with irq_work.
[ 39.913691] =============================
[ 39.914157] [ BUG: Invalid wait context ]
[ 39.914623] 6.15.0-next-20250530-next-2025053 #1 Not tainted
[ 39.915271] -----------------------------
[ 39.915731] repro/837 is trying to lock:
[ 39.916191] ffff88801acfabd8 (&event->waitq){....}-{3:3}, at: __wake_up+0x26/0x60
[ 39.917182] other info that might help us debug this:
[ 39.917761] context-{5:5}
[ 39.918079] 4 locks held by repro/837:
[ 39.918530] #0: ffffffff8725cd00 (rcu_read_lock){....}-{1:3}, at: __perf_event_task_sched_in+0xd1/0xbc0
[ 39.919612] #1: ffff88806ca3c6f8 (&cpuctx_lock){....}-{2:2}, at: __perf_event_task_sched_in+0x1a7/0xbc0
[ 39.920748] #2: ffff88800d91fc18 (&ctx->lock){....}-{2:2}, at: __perf_event_task_sched_in+0x1f9/0xbc0
[ 39.921819] #3: ffffffff8725cd00 (rcu_read_lock){....}-{1:3}, at: perf_event_wakeup+0x6c/0x470
Fixes: f4b07fd62d4d ("perf/core: Use POLLHUP for a pinned event in error")
Closes: https://lore.kernel.org/lkml/aD2w50VDvGIH95Pf@ly-workstation
Reported-by: "Lai, Yi" <yi1.lai@linux.intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: "Lai, Yi" <yi1.lai@linux.intel.com>
Link: https://patch.msgid.link/20250603045105.1731451-1-namhyung@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/events/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index c0bb657e28e31..4311c33c3381c 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4017,7 +4017,8 @@ static int merge_sched_in(struct perf_event *event, void *data)
if (*perf_event_fasync(event))
event->pending_kill = POLL_ERR;
- perf_event_wakeup(event);
+ event->pending_wakeup = 1;
+ irq_work_queue(&event->pending_irq);
} else {
struct perf_cpu_pmu_context *cpc = this_cpc(event->pmu_ctx->pmu);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 032/311] accel/amdxdna: Remove buffer size check when creating command BO
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (30 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 031/311] perf/core: Fix invalid wait context in ctx_sched_in() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 033/311] accel/amdxdna: Switch to always use chained command Sasha Levin
` (292 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Lizhi Hou, Mario Limonciello (AMD), Sasha Levin
From: Lizhi Hou <lizhi.hou@amd.com>
[ Upstream commit 08fe1b5166fdc81b010d7bf39cd6440620e7931e ]
Large command buffers may be used, and they do not always need to be
mapped or accessed by the driver. Performing a size check at command BO
creation time unnecessarily rejects valid use cases.
Remove the buffer size check from command BO creation, and defer vmap
and size validation to the paths where the driver actually needs to map
and access the command buffer.
Fixes: ac49797c1815 ("accel/amdxdna: Add GEM buffer object management")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260206060237.4050492-1-lizhi.hou@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/amdxdna_gem.c | 38 ++++++++++++++---------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/drivers/accel/amdxdna/amdxdna_gem.c b/drivers/accel/amdxdna/amdxdna_gem.c
index dfa916eeb2d9c..56341b7668b10 100644
--- a/drivers/accel/amdxdna/amdxdna_gem.c
+++ b/drivers/accel/amdxdna/amdxdna_gem.c
@@ -21,8 +21,6 @@
#include "amdxdna_pci_drv.h"
#include "amdxdna_ubuf.h"
-#define XDNA_MAX_CMD_BO_SIZE SZ_32K
-
MODULE_IMPORT_NS("DMA_BUF");
static int
@@ -746,12 +744,6 @@ amdxdna_drm_create_cmd_bo(struct drm_device *dev,
{
struct amdxdna_dev *xdna = to_xdna_dev(dev);
struct amdxdna_gem_obj *abo;
- int ret;
-
- if (args->size > XDNA_MAX_CMD_BO_SIZE) {
- XDNA_ERR(xdna, "Command bo size 0x%llx too large", args->size);
- return ERR_PTR(-EINVAL);
- }
if (args->size < sizeof(struct amdxdna_cmd)) {
XDNA_DBG(xdna, "Command BO size 0x%llx too small", args->size);
@@ -765,17 +757,7 @@ amdxdna_drm_create_cmd_bo(struct drm_device *dev,
abo->type = AMDXDNA_BO_CMD;
abo->client = filp->driver_priv;
- ret = amdxdna_gem_obj_vmap(abo, &abo->mem.kva);
- if (ret) {
- XDNA_ERR(xdna, "Vmap cmd bo failed, ret %d", ret);
- goto release_obj;
- }
-
return abo;
-
-release_obj:
- drm_gem_object_put(to_gobj(abo));
- return ERR_PTR(ret);
}
int amdxdna_drm_create_bo_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
@@ -872,6 +854,7 @@ struct amdxdna_gem_obj *amdxdna_gem_get_obj(struct amdxdna_client *client,
struct amdxdna_dev *xdna = client->xdna;
struct amdxdna_gem_obj *abo;
struct drm_gem_object *gobj;
+ int ret;
gobj = drm_gem_object_lookup(client->filp, bo_hdl);
if (!gobj) {
@@ -880,9 +863,26 @@ struct amdxdna_gem_obj *amdxdna_gem_get_obj(struct amdxdna_client *client,
}
abo = to_xdna_obj(gobj);
- if (bo_type == AMDXDNA_BO_INVALID || abo->type == bo_type)
+ if (bo_type != AMDXDNA_BO_INVALID && abo->type != bo_type)
+ goto put_obj;
+
+ if (bo_type != AMDXDNA_BO_CMD || abo->mem.kva)
return abo;
+ if (abo->mem.size > SZ_32K) {
+ XDNA_ERR(xdna, "Cmd bo is too big %ld", abo->mem.size);
+ goto put_obj;
+ }
+
+ ret = amdxdna_gem_obj_vmap(abo, &abo->mem.kva);
+ if (ret) {
+ XDNA_ERR(xdna, "Vmap cmd bo failed, ret %d", ret);
+ goto put_obj;
+ }
+
+ return abo;
+
+put_obj:
drm_gem_object_put(gobj);
return NULL;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 033/311] accel/amdxdna: Switch to always use chained command
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (31 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 032/311] accel/amdxdna: Remove buffer size check when creating command BO Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 034/311] accel/amdxdna: Fix crash when destroying a suspended hardware context Sasha Levin
` (291 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Lizhi Hou, Karol Wachowski, Mario Limonciello (AMD), Sasha Levin
From: Lizhi Hou <lizhi.hou@amd.com>
[ Upstream commit c68a6af400ca80596e8c37de0a1cb564aa9da8a4 ]
Preempt commands are only supported when submitted as chained commands.
To ensure preempt support works consistently, always submit commands in
chained command format.
Set force_cmdlist to true so that single commands are filled using the
chained command layout, enabling correct handling of preempt commands.
Fixes: 3a0ff7b98af4 ("accel/amdxdna: Support preemption requests")
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260206060251.4050512-1-lizhi.hou@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/aie2_ctx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
index 37d05f2e986f9..6378a0bc7b6ea 100644
--- a/drivers/accel/amdxdna/aie2_ctx.c
+++ b/drivers/accel/amdxdna/aie2_ctx.c
@@ -23,9 +23,9 @@
#include "amdxdna_pci_drv.h"
#include "amdxdna_pm.h"
-static bool force_cmdlist;
+static bool force_cmdlist = true;
module_param(force_cmdlist, bool, 0600);
-MODULE_PARM_DESC(force_cmdlist, "Force use command list (Default false)");
+MODULE_PARM_DESC(force_cmdlist, "Force use command list (Default true)");
#define HWCTX_MAX_TIMEOUT 60000 /* milliseconds */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 034/311] accel/amdxdna: Fix crash when destroying a suspended hardware context
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (32 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 033/311] accel/amdxdna: Switch to always use chained command Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 035/311] accel/amdxdna: Reduce log noise during process termination Sasha Levin
` (290 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Lizhi Hou, Karol Wachowski, Sasha Levin
From: Lizhi Hou <lizhi.hou@amd.com>
[ Upstream commit 8363c02863332992a1822688da41f881d88d1631 ]
If userspace issues an ioctl to destroy a hardware context that has
already been automatically suspended, the driver may crash because the
mailbox channel pointer is NULL for the suspended context.
Fix this by checking the mailbox channel pointer in aie2_destroy_context()
before accessing it.
Fixes: 97f27573837e ("accel/amdxdna: Fix potential NULL pointer dereference in context cleanup")
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260206060306.4050531-1-lizhi.hou@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/aie2_message.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/accel/amdxdna/aie2_message.c b/drivers/accel/amdxdna/aie2_message.c
index 2c5b27d90563e..43657203d22b7 100644
--- a/drivers/accel/amdxdna/aie2_message.c
+++ b/drivers/accel/amdxdna/aie2_message.c
@@ -274,6 +274,9 @@ int aie2_destroy_context(struct amdxdna_dev_hdl *ndev, struct amdxdna_hwctx *hwc
struct amdxdna_dev *xdna = ndev->xdna;
int ret;
+ if (!hwctx->priv->mbox_chann)
+ return 0;
+
xdna_mailbox_stop_channel(hwctx->priv->mbox_chann);
ret = aie2_destroy_context_req(ndev, hwctx->fw_ctx_id);
xdna_mailbox_destroy_channel(hwctx->priv->mbox_chann);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 035/311] accel/amdxdna: Reduce log noise during process termination
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (33 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 034/311] accel/amdxdna: Fix crash when destroying a suspended hardware context Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 036/311] accel/amdxdna: Fix dead lock for suspend and resume Sasha Levin
` (289 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Mario Limonciello, Lizhi Hou, Sasha Levin
From: Mario Limonciello <mario.limonciello@amd.com>
[ Upstream commit 57aa3917a3b3bd805a3679371f97a1ceda3c5510 ]
During process termination, several error messages are logged that are
not actual errors but expected conditions when a process is killed or
interrupted. This creates unnecessary noise in the kernel log.
The specific scenarios are:
1. HMM invalidation returns -ERESTARTSYS when the wait is interrupted by
a signal during process cleanup. This is expected when a process is
being terminated and should not be logged as an error.
2. Context destruction returns -ENODEV when the firmware or device has
already stopped, which commonly occurs during cleanup if the device
was already torn down. This is also an expected condition during
orderly shutdown.
Downgrade these expected error conditions from error level to debug level
to reduce log noise while still keeping genuine errors visible.
Fixes: 97f27573837e ("accel/amdxdna: Fix potential NULL pointer dereference in context cleanup")
Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260210164521.1094274-3-mario.limonciello@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/aie2_ctx.c | 6 ++++--
drivers/accel/amdxdna/aie2_message.c | 4 +++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
index 6378a0bc7b6ea..a3bb37543f73d 100644
--- a/drivers/accel/amdxdna/aie2_ctx.c
+++ b/drivers/accel/amdxdna/aie2_ctx.c
@@ -497,7 +497,7 @@ static void aie2_release_resource(struct amdxdna_hwctx *hwctx)
if (AIE2_FEATURE_ON(xdna->dev_handle, AIE2_TEMPORAL_ONLY)) {
ret = aie2_destroy_context(xdna->dev_handle, hwctx);
- if (ret)
+ if (ret && ret != -ENODEV)
XDNA_ERR(xdna, "Destroy temporal only context failed, ret %d", ret);
} else {
ret = xrs_release_resource(xdna->xrs_hdl, (uintptr_t)hwctx);
@@ -1070,6 +1070,8 @@ void aie2_hmm_invalidate(struct amdxdna_gem_obj *abo,
ret = dma_resv_wait_timeout(gobj->resv, DMA_RESV_USAGE_BOOKKEEP,
true, MAX_SCHEDULE_TIMEOUT);
- if (!ret || ret == -ERESTARTSYS)
+ if (!ret)
XDNA_ERR(xdna, "Failed to wait for bo, ret %ld", ret);
+ else if (ret == -ERESTARTSYS)
+ XDNA_DBG(xdna, "Wait for bo interrupted by signal");
}
diff --git a/drivers/accel/amdxdna/aie2_message.c b/drivers/accel/amdxdna/aie2_message.c
index 43657203d22b7..d69d3afcfb748 100644
--- a/drivers/accel/amdxdna/aie2_message.c
+++ b/drivers/accel/amdxdna/aie2_message.c
@@ -193,8 +193,10 @@ static int aie2_destroy_context_req(struct amdxdna_dev_hdl *ndev, u32 id)
req.context_id = id;
ret = aie2_send_mgmt_msg_wait(ndev, &msg);
- if (ret)
+ if (ret && ret != -ENODEV)
XDNA_WARN(xdna, "Destroy context failed, ret %d", ret);
+ else if (ret == -ENODEV)
+ XDNA_DBG(xdna, "Destroy context: device already stopped");
return ret;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 036/311] accel/amdxdna: Fix dead lock for suspend and resume
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (34 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 035/311] accel/amdxdna: Reduce log noise during process termination Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 037/311] accel/amdxdna: Fix suspend failure after enabling turbo mode Sasha Levin
` (288 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Lizhi Hou, Mario Limonciello (AMD), Sasha Levin
From: Lizhi Hou <lizhi.hou@amd.com>
[ Upstream commit 1aa82181a3c285c7351523d587f7981ae4c015c8 ]
When an application issues a query IOCTL while auto suspend is running,
a deadlock can occur. The query path holds dev_lock and then calls
pm_runtime_resume_and_get(), which waits for the ongoing suspend to
complete. Meanwhile, the suspend callback attempts to acquire dev_lock
and blocks, resulting in a deadlock.
Fix this by releasing dev_lock before calling pm_runtime_resume_and_get()
and reacquiring it after the call completes. Also acquire dev_lock in the
resume callback to keep the locking consistent.
Fixes: 063db451832b ("accel/amdxdna: Enhance runtime power management")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260211204644.722758-1-lizhi.hou@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/aie2_ctx.c | 4 ++--
drivers/accel/amdxdna/aie2_pci.c | 7 +++----
drivers/accel/amdxdna/aie2_pm.c | 2 +-
drivers/accel/amdxdna/amdxdna_ctx.c | 19 +++++++------------
drivers/accel/amdxdna/amdxdna_pm.c | 2 ++
drivers/accel/amdxdna/amdxdna_pm.h | 11 +++++++++++
6 files changed, 26 insertions(+), 19 deletions(-)
diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
index a3bb37543f73d..1dcf6e862656d 100644
--- a/drivers/accel/amdxdna/aie2_ctx.c
+++ b/drivers/accel/amdxdna/aie2_ctx.c
@@ -629,7 +629,7 @@ int aie2_hwctx_init(struct amdxdna_hwctx *hwctx)
goto free_entity;
}
- ret = amdxdna_pm_resume_get(xdna);
+ ret = amdxdna_pm_resume_get_locked(xdna);
if (ret)
goto free_col_list;
@@ -760,7 +760,7 @@ static int aie2_hwctx_cu_config(struct amdxdna_hwctx *hwctx, void *buf, u32 size
if (!hwctx->cus)
return -ENOMEM;
- ret = amdxdna_pm_resume_get(xdna);
+ ret = amdxdna_pm_resume_get_locked(xdna);
if (ret)
goto free_cus;
diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c
index ec1c3ad57d490..20568d0f9a639 100644
--- a/drivers/accel/amdxdna/aie2_pci.c
+++ b/drivers/accel/amdxdna/aie2_pci.c
@@ -469,7 +469,6 @@ static int aie2_hw_suspend(struct amdxdna_dev *xdna)
{
struct amdxdna_client *client;
- guard(mutex)(&xdna->dev_lock);
list_for_each_entry(client, &xdna->client_list, node)
aie2_hwctx_suspend(client);
@@ -969,7 +968,7 @@ static int aie2_get_info(struct amdxdna_client *client, struct amdxdna_drm_get_i
if (!drm_dev_enter(&xdna->ddev, &idx))
return -ENODEV;
- ret = amdxdna_pm_resume_get(xdna);
+ ret = amdxdna_pm_resume_get_locked(xdna);
if (ret)
goto dev_exit;
@@ -1062,7 +1061,7 @@ static int aie2_get_array(struct amdxdna_client *client,
if (!drm_dev_enter(&xdna->ddev, &idx))
return -ENODEV;
- ret = amdxdna_pm_resume_get(xdna);
+ ret = amdxdna_pm_resume_get_locked(xdna);
if (ret)
goto dev_exit;
@@ -1152,7 +1151,7 @@ static int aie2_set_state(struct amdxdna_client *client,
if (!drm_dev_enter(&xdna->ddev, &idx))
return -ENODEV;
- ret = amdxdna_pm_resume_get(xdna);
+ ret = amdxdna_pm_resume_get_locked(xdna);
if (ret)
goto dev_exit;
diff --git a/drivers/accel/amdxdna/aie2_pm.c b/drivers/accel/amdxdna/aie2_pm.c
index 579b8be13b180..29bd4403a94d4 100644
--- a/drivers/accel/amdxdna/aie2_pm.c
+++ b/drivers/accel/amdxdna/aie2_pm.c
@@ -31,7 +31,7 @@ int aie2_pm_set_dpm(struct amdxdna_dev_hdl *ndev, u32 dpm_level)
{
int ret;
- ret = amdxdna_pm_resume_get(ndev->xdna);
+ ret = amdxdna_pm_resume_get_locked(ndev->xdna);
if (ret)
return ret;
diff --git a/drivers/accel/amdxdna/amdxdna_ctx.c b/drivers/accel/amdxdna/amdxdna_ctx.c
index d17aef89a0add..db3aa26fb55f0 100644
--- a/drivers/accel/amdxdna/amdxdna_ctx.c
+++ b/drivers/accel/amdxdna/amdxdna_ctx.c
@@ -266,9 +266,9 @@ int amdxdna_drm_config_hwctx_ioctl(struct drm_device *dev, void *data, struct dr
struct amdxdna_drm_config_hwctx *args = data;
struct amdxdna_dev *xdna = to_xdna_dev(dev);
struct amdxdna_hwctx *hwctx;
- int ret, idx;
u32 buf_size;
void *buf;
+ int ret;
u64 val;
if (XDNA_MBZ_DBG(xdna, &args->pad, sizeof(args->pad)))
@@ -310,20 +310,17 @@ int amdxdna_drm_config_hwctx_ioctl(struct drm_device *dev, void *data, struct dr
return -EINVAL;
}
- mutex_lock(&xdna->dev_lock);
- idx = srcu_read_lock(&client->hwctx_srcu);
+ guard(mutex)(&xdna->dev_lock);
hwctx = xa_load(&client->hwctx_xa, args->handle);
if (!hwctx) {
XDNA_DBG(xdna, "PID %d failed to get hwctx %d", client->pid, args->handle);
ret = -EINVAL;
- goto unlock_srcu;
+ goto free_buf;
}
ret = xdna->dev_info->ops->hwctx_config(hwctx, args->param_type, val, buf, buf_size);
-unlock_srcu:
- srcu_read_unlock(&client->hwctx_srcu, idx);
- mutex_unlock(&xdna->dev_lock);
+free_buf:
kfree(buf);
return ret;
}
@@ -334,7 +331,7 @@ int amdxdna_hwctx_sync_debug_bo(struct amdxdna_client *client, u32 debug_bo_hdl)
struct amdxdna_hwctx *hwctx;
struct amdxdna_gem_obj *abo;
struct drm_gem_object *gobj;
- int ret, idx;
+ int ret;
if (!xdna->dev_info->ops->hwctx_sync_debug_bo)
return -EOPNOTSUPP;
@@ -345,17 +342,15 @@ int amdxdna_hwctx_sync_debug_bo(struct amdxdna_client *client, u32 debug_bo_hdl)
abo = to_xdna_obj(gobj);
guard(mutex)(&xdna->dev_lock);
- idx = srcu_read_lock(&client->hwctx_srcu);
hwctx = xa_load(&client->hwctx_xa, abo->assigned_hwctx);
if (!hwctx) {
ret = -EINVAL;
- goto unlock_srcu;
+ goto put_obj;
}
ret = xdna->dev_info->ops->hwctx_sync_debug_bo(hwctx, debug_bo_hdl);
-unlock_srcu:
- srcu_read_unlock(&client->hwctx_srcu, idx);
+put_obj:
drm_gem_object_put(gobj);
return ret;
}
diff --git a/drivers/accel/amdxdna/amdxdna_pm.c b/drivers/accel/amdxdna/amdxdna_pm.c
index d024d480521c4..b1fafddd7ad59 100644
--- a/drivers/accel/amdxdna/amdxdna_pm.c
+++ b/drivers/accel/amdxdna/amdxdna_pm.c
@@ -16,6 +16,7 @@ int amdxdna_pm_suspend(struct device *dev)
struct amdxdna_dev *xdna = to_xdna_dev(dev_get_drvdata(dev));
int ret = -EOPNOTSUPP;
+ guard(mutex)(&xdna->dev_lock);
if (xdna->dev_info->ops->suspend)
ret = xdna->dev_info->ops->suspend(xdna);
@@ -28,6 +29,7 @@ int amdxdna_pm_resume(struct device *dev)
struct amdxdna_dev *xdna = to_xdna_dev(dev_get_drvdata(dev));
int ret = -EOPNOTSUPP;
+ guard(mutex)(&xdna->dev_lock);
if (xdna->dev_info->ops->resume)
ret = xdna->dev_info->ops->resume(xdna);
diff --git a/drivers/accel/amdxdna/amdxdna_pm.h b/drivers/accel/amdxdna/amdxdna_pm.h
index 77b2d6e455700..3d26b973e0e36 100644
--- a/drivers/accel/amdxdna/amdxdna_pm.h
+++ b/drivers/accel/amdxdna/amdxdna_pm.h
@@ -15,4 +15,15 @@ void amdxdna_pm_suspend_put(struct amdxdna_dev *xdna);
void amdxdna_pm_init(struct amdxdna_dev *xdna);
void amdxdna_pm_fini(struct amdxdna_dev *xdna);
+static inline int amdxdna_pm_resume_get_locked(struct amdxdna_dev *xdna)
+{
+ int ret;
+
+ mutex_unlock(&xdna->dev_lock);
+ ret = amdxdna_pm_resume_get(xdna);
+ mutex_lock(&xdna->dev_lock);
+
+ return ret;
+}
+
#endif /* _AMDXDNA_PM_H_ */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 037/311] accel/amdxdna: Fix suspend failure after enabling turbo mode
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (35 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 036/311] accel/amdxdna: Fix dead lock for suspend and resume Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 038/311] accel/amdxdna: Fix command hang on suspended hardware context Sasha Levin
` (287 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Lizhi Hou, Mario Limonciello (AMD), Sasha Levin
From: Lizhi Hou <lizhi.hou@amd.com>
[ Upstream commit fdb65acfe655f844ae1e88696b9656d3ef5bb8fb ]
Enabling turbo mode disables hardware clock gating. Suspend requires
hardware clock gating to be re-enabled, otherwise suspend will fail.
Fix this by calling aie2_runtime_cfg() from aie2_hw_stop() to
re-enable clock gating during suspend. Also ensure that firmware is
initialized in aie2_hw_start() before modifying clock-gating
settings during resume.
Fixes: f4d7b8a6bc8c ("accel/amdxdna: Enhance power management settings")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260211204716.722788-1-lizhi.hou@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/aie2_pci.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c
index 20568d0f9a639..3356c9ed079a8 100644
--- a/drivers/accel/amdxdna/aie2_pci.c
+++ b/drivers/accel/amdxdna/aie2_pci.c
@@ -341,6 +341,7 @@ static void aie2_hw_stop(struct amdxdna_dev *xdna)
return;
}
+ aie2_runtime_cfg(ndev, AIE2_RT_CFG_CLK_GATING, NULL);
aie2_mgmt_fw_fini(ndev);
xdna_mailbox_stop_channel(ndev->mgmt_chann);
xdna_mailbox_destroy_channel(ndev->mgmt_chann);
@@ -424,15 +425,15 @@ static int aie2_hw_start(struct amdxdna_dev *xdna)
goto stop_psp;
}
- ret = aie2_pm_init(ndev);
+ ret = aie2_mgmt_fw_init(ndev);
if (ret) {
- XDNA_ERR(xdna, "failed to init pm, ret %d", ret);
+ XDNA_ERR(xdna, "initial mgmt firmware failed, ret %d", ret);
goto destroy_mgmt_chann;
}
- ret = aie2_mgmt_fw_init(ndev);
+ ret = aie2_pm_init(ndev);
if (ret) {
- XDNA_ERR(xdna, "initial mgmt firmware failed, ret %d", ret);
+ XDNA_ERR(xdna, "failed to init pm, ret %d", ret);
goto destroy_mgmt_chann;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 038/311] accel/amdxdna: Fix command hang on suspended hardware context
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (36 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 037/311] accel/amdxdna: Fix suspend failure after enabling turbo mode Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 039/311] accel/amdxdna: Fix out-of-bounds memset in command slot handling Sasha Levin
` (286 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Lizhi Hou, Mario Limonciello (AMD), Sasha Levin
From: Lizhi Hou <lizhi.hou@amd.com>
[ Upstream commit 07efce5a6611af6714ea3ef65694e0c8dd7e44f5 ]
When a hardware context is suspended, the job scheduler is stopped. If a
command is submitted while the context is suspended, the job is queued in
the scheduler but aie2_sched_job_run() is never invoked to restart the
hardware context. As a result, the command hangs.
Fix this by modifying the hardware context suspend routine to keep the job
scheduler running so that queued jobs can trigger context restart properly.
Fixes: aac243092b70 ("accel/amdxdna: Add command execution")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260211205341.722982-1-lizhi.hou@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/aie2_ctx.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
index 1dcf6e862656d..01a02f4c3a98d 100644
--- a/drivers/accel/amdxdna/aie2_ctx.c
+++ b/drivers/accel/amdxdna/aie2_ctx.c
@@ -53,6 +53,7 @@ static void aie2_hwctx_stop(struct amdxdna_dev *xdna, struct amdxdna_hwctx *hwct
{
drm_sched_stop(&hwctx->priv->sched, bad_job);
aie2_destroy_context(xdna->dev_handle, hwctx);
+ drm_sched_start(&hwctx->priv->sched, 0);
}
static int aie2_hwctx_restart(struct amdxdna_dev *xdna, struct amdxdna_hwctx *hwctx)
@@ -80,7 +81,6 @@ static int aie2_hwctx_restart(struct amdxdna_dev *xdna, struct amdxdna_hwctx *hw
}
out:
- drm_sched_start(&hwctx->priv->sched, 0);
XDNA_DBG(xdna, "%s restarted, ret %d", hwctx->name, ret);
return ret;
}
@@ -297,19 +297,23 @@ aie2_sched_job_run(struct drm_sched_job *sched_job)
struct dma_fence *fence;
int ret;
- if (!hwctx->priv->mbox_chann)
+ ret = amdxdna_pm_resume_get(hwctx->client->xdna);
+ if (ret)
+ return NULL;
+
+ if (!hwctx->priv->mbox_chann) {
+ amdxdna_pm_suspend_put(hwctx->client->xdna);
return NULL;
+ }
- if (!mmget_not_zero(job->mm))
+ if (!mmget_not_zero(job->mm)) {
+ amdxdna_pm_suspend_put(hwctx->client->xdna);
return ERR_PTR(-ESRCH);
+ }
kref_get(&job->refcnt);
fence = dma_fence_get(job->fence);
- ret = amdxdna_pm_resume_get(hwctx->client->xdna);
- if (ret)
- goto out;
-
if (job->drv_cmd) {
switch (job->drv_cmd->opcode) {
case SYNC_DEBUG_BO:
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 039/311] accel/amdxdna: Fix out-of-bounds memset in command slot handling
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (37 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 038/311] accel/amdxdna: Fix command hang on suspended hardware context Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 040/311] accel/amdxdna: Prevent ubuf size overflow Sasha Levin
` (285 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Lizhi Hou, Mario Limonciello (AMD), Sasha Levin
From: Lizhi Hou <lizhi.hou@amd.com>
[ Upstream commit 1110a949675ebd56b3f0286e664ea543f745801c ]
The remaining space in a command slot may be smaller than the size of
the command header. Clearing the command header with memset() before
verifying the available slot space can result in an out-of-bounds write
and memory corruption.
Fix this by moving the memset() call after the size validation.
Fixes: 3d32eb7a5ecf ("accel/amdxdna: Fix cu_idx being cleared by memset() during command setup")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260217185415.1781908-1-lizhi.hou@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/aie2_message.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/accel/amdxdna/aie2_message.c b/drivers/accel/amdxdna/aie2_message.c
index d69d3afcfb748..a758c11a05a9c 100644
--- a/drivers/accel/amdxdna/aie2_message.c
+++ b/drivers/accel/amdxdna/aie2_message.c
@@ -656,11 +656,11 @@ aie2_cmdlist_fill_npu_cf(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t *siz
u32 cmd_len;
void *cmd;
- memset(npu_slot, 0, sizeof(*npu_slot));
cmd = amdxdna_cmd_get_payload(cmd_bo, &cmd_len);
if (*size < sizeof(*npu_slot) + cmd_len)
return -EINVAL;
+ memset(npu_slot, 0, sizeof(*npu_slot));
npu_slot->cu_idx = amdxdna_cmd_get_cu_idx(cmd_bo);
if (npu_slot->cu_idx == INVALID_CU_IDX)
return -EINVAL;
@@ -681,7 +681,6 @@ aie2_cmdlist_fill_npu_dpu(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t *si
u32 cmd_len;
u32 arg_sz;
- memset(npu_slot, 0, sizeof(*npu_slot));
sn = amdxdna_cmd_get_payload(cmd_bo, &cmd_len);
arg_sz = cmd_len - sizeof(*sn);
if (cmd_len < sizeof(*sn) || arg_sz > MAX_NPU_ARGS_SIZE)
@@ -690,6 +689,7 @@ aie2_cmdlist_fill_npu_dpu(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t *si
if (*size < sizeof(*npu_slot) + arg_sz)
return -EINVAL;
+ memset(npu_slot, 0, sizeof(*npu_slot));
npu_slot->cu_idx = amdxdna_cmd_get_cu_idx(cmd_bo);
if (npu_slot->cu_idx == INVALID_CU_IDX)
return -EINVAL;
@@ -713,7 +713,6 @@ aie2_cmdlist_fill_npu_preempt(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t
u32 cmd_len;
u32 arg_sz;
- memset(npu_slot, 0, sizeof(*npu_slot));
pd = amdxdna_cmd_get_payload(cmd_bo, &cmd_len);
arg_sz = cmd_len - sizeof(*pd);
if (cmd_len < sizeof(*pd) || arg_sz > MAX_NPU_ARGS_SIZE)
@@ -722,6 +721,7 @@ aie2_cmdlist_fill_npu_preempt(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t
if (*size < sizeof(*npu_slot) + arg_sz)
return -EINVAL;
+ memset(npu_slot, 0, sizeof(*npu_slot));
npu_slot->cu_idx = amdxdna_cmd_get_cu_idx(cmd_bo);
if (npu_slot->cu_idx == INVALID_CU_IDX)
return -EINVAL;
@@ -749,7 +749,6 @@ aie2_cmdlist_fill_npu_elf(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t *si
u32 cmd_len;
u32 arg_sz;
- memset(npu_slot, 0, sizeof(*npu_slot));
pd = amdxdna_cmd_get_payload(cmd_bo, &cmd_len);
arg_sz = cmd_len - sizeof(*pd);
if (cmd_len < sizeof(*pd) || arg_sz > MAX_NPU_ARGS_SIZE)
@@ -758,6 +757,7 @@ aie2_cmdlist_fill_npu_elf(struct amdxdna_gem_obj *cmd_bo, void *slot, size_t *si
if (*size < sizeof(*npu_slot) + arg_sz)
return -EINVAL;
+ memset(npu_slot, 0, sizeof(*npu_slot));
npu_slot->type = EXEC_NPU_TYPE_ELF;
npu_slot->inst_buf_addr = pd->inst_buf;
npu_slot->save_buf_addr = pd->save_buf;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 040/311] accel/amdxdna: Prevent ubuf size overflow
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (38 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 039/311] accel/amdxdna: Fix out-of-bounds memset in command slot handling Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 041/311] accel/amdxdna: Validate command buffer payload count Sasha Levin
` (284 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Lizhi Hou, Mario Limonciello (AMD), Sasha Levin
From: Lizhi Hou <lizhi.hou@amd.com>
[ Upstream commit 03808abb1d868aed7478a11a82e5bb4b3f1ca6d6 ]
The ubuf size calculation may overflow, resulting in an undersized
allocation and possible memory corruption.
Use check_add_overflow() helpers to validate the size calculation before
allocation.
Fixes: bd72d4acda10 ("accel/amdxdna: Support user space allocated buffer")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260217192815.1784689-1-lizhi.hou@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/amdxdna_ubuf.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/accel/amdxdna/amdxdna_ubuf.c b/drivers/accel/amdxdna/amdxdna_ubuf.c
index 9e3b3b055caa8..62a478f6b45fb 100644
--- a/drivers/accel/amdxdna/amdxdna_ubuf.c
+++ b/drivers/accel/amdxdna/amdxdna_ubuf.c
@@ -7,6 +7,7 @@
#include <drm/drm_device.h>
#include <drm/drm_print.h>
#include <linux/dma-buf.h>
+#include <linux/overflow.h>
#include <linux/pagemap.h>
#include <linux/vmalloc.h>
@@ -176,7 +177,10 @@ struct dma_buf *amdxdna_get_ubuf(struct drm_device *dev,
goto free_ent;
}
- exp_info.size += va_ent[i].len;
+ if (check_add_overflow(exp_info.size, va_ent[i].len, &exp_info.size)) {
+ ret = -EINVAL;
+ goto free_ent;
+ }
}
ubuf->nr_pages = exp_info.size >> PAGE_SHIFT;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 041/311] accel/amdxdna: Validate command buffer payload count
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (39 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 040/311] accel/amdxdna: Prevent ubuf size overflow Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 042/311] drm/xe/wa: Steer RMW of MCR registers while building default LRC Sasha Levin
` (283 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Lizhi Hou, Mario Limonciello (AMD), Sasha Levin
From: Lizhi Hou <lizhi.hou@amd.com>
[ Upstream commit 901ec3470994006bc8dd02399e16b675566c3416 ]
The count field in the command header is used to determine the valid
payload size. Verify that the valid payload does not exceed the remaining
buffer space.
Fixes: aac243092b70 ("accel/amdxdna: Add command execution")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260219211946.1920485-1-lizhi.hou@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/amdxdna_ctx.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/accel/amdxdna/amdxdna_ctx.c b/drivers/accel/amdxdna/amdxdna_ctx.c
index db3aa26fb55f0..e42eb12fc7c1b 100644
--- a/drivers/accel/amdxdna/amdxdna_ctx.c
+++ b/drivers/accel/amdxdna/amdxdna_ctx.c
@@ -104,7 +104,10 @@ void *amdxdna_cmd_get_payload(struct amdxdna_gem_obj *abo, u32 *size)
if (size) {
count = FIELD_GET(AMDXDNA_CMD_COUNT, cmd->header);
- if (unlikely(count <= num_masks)) {
+ if (unlikely(count <= num_masks ||
+ count * sizeof(u32) +
+ offsetof(struct amdxdna_cmd, data[0]) >
+ abo->mem.size)) {
*size = 0;
return NULL;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 042/311] drm/xe/wa: Steer RMW of MCR registers while building default LRC
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (40 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 041/311] accel/amdxdna: Validate command buffer payload count Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 043/311] cgroup/cpuset: Fix incorrect change to effective_xcpus in partition_xcpus_del() Sasha Levin
` (282 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Matt Roper, Michal Wajdeczko, Balasubramani Vivekanandan,
Rodrigo Vivi, Sasha Levin
From: Matt Roper <matthew.d.roper@intel.com>
[ Upstream commit 43d37df67f7770d8d261fdcb64ecc8c314e91303 ]
When generating the default LRC, if a register is not masked, we apply
any save-restore programming necessary via a read-modify-write sequence
that will ensure we only update the relevant bits/fields without
clobbering the rest of the register. However some of the registers that
need to be updated might be MCR registers which require steering to a
non-terminated instance to ensure we can read back a valid, non-zero
value. The steering of reads originating from a command streamer is
controlled by register CS_MMIO_GROUP_INSTANCE_SELECT. Emit additional
MI_LRI commands to update the steering before any RMW of an MCR register
to ensure the reads are performed properly.
Note that needing to perform a RMW of an MCR register while building the
default LRC is pretty rare. Most of the MCR registers that are part of
an engine's LRCs are also masked registers, so no MCR is necessary.
Fixes: f2f90989ccff ("drm/xe: Avoid reading RMW registers in emit_wa_job")
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Link: https://patch.msgid.link/20260206223058.387014-2-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit 6c2e331c915ba9e774aa847921262805feb00863)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/regs/xe_engine_regs.h | 6 +++
drivers/gpu/drm/xe/xe_gt.c | 66 +++++++++++++++++++-----
2 files changed, 60 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/xe/regs/xe_engine_regs.h b/drivers/gpu/drm/xe/regs/xe_engine_regs.h
index 68172b0248a6e..dc5a4fafa70cf 100644
--- a/drivers/gpu/drm/xe/regs/xe_engine_regs.h
+++ b/drivers/gpu/drm/xe/regs/xe_engine_regs.h
@@ -96,6 +96,12 @@
#define ENABLE_SEMAPHORE_POLL_BIT REG_BIT(13)
#define RING_CMD_CCTL(base) XE_REG((base) + 0xc4, XE_REG_OPTION_MASKED)
+
+#define CS_MMIO_GROUP_INSTANCE_SELECT(base) XE_REG((base) + 0xcc)
+#define SELECTIVE_READ_ADDRESSING REG_BIT(30)
+#define SELECTIVE_READ_GROUP REG_GENMASK(29, 23)
+#define SELECTIVE_READ_INSTANCE REG_GENMASK(22, 16)
+
/*
* CMD_CCTL read/write fields take a MOCS value and _not_ a table index.
* The lsb of each can be considered a separate enabling bit for encryption.
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index cdce210e36f25..e89cbe498c427 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -187,11 +187,15 @@ static int emit_nop_job(struct xe_gt *gt, struct xe_exec_queue *q)
return ret;
}
+/* Dwords required to emit a RMW of a register */
+#define EMIT_RMW_DW 20
+
static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q)
{
- struct xe_reg_sr *sr = &q->hwe->reg_lrc;
+ struct xe_hw_engine *hwe = q->hwe;
+ struct xe_reg_sr *sr = &hwe->reg_lrc;
struct xe_reg_sr_entry *entry;
- int count_rmw = 0, count = 0, ret;
+ int count_rmw = 0, count_rmw_mcr = 0, count = 0, ret;
unsigned long idx;
struct xe_bb *bb;
size_t bb_len = 0;
@@ -201,6 +205,8 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q)
xa_for_each(&sr->xa, idx, entry) {
if (entry->reg.masked || entry->clr_bits == ~0)
++count;
+ else if (entry->reg.mcr)
+ ++count_rmw_mcr;
else
++count_rmw;
}
@@ -208,17 +214,35 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q)
if (count)
bb_len += count * 2 + 1;
- if (count_rmw)
- bb_len += count_rmw * 20 + 7;
+ /*
+ * RMW of MCR registers is the same as a normal RMW, except an
+ * additional LRI (3 dwords) is required per register to steer the read
+ * to a nom-terminated instance.
+ *
+ * We could probably shorten the batch slightly by eliding the
+ * steering for consecutive MCR registers that have the same
+ * group/instance target, but it's not worth the extra complexity to do
+ * so.
+ */
+ bb_len += count_rmw * EMIT_RMW_DW;
+ bb_len += count_rmw_mcr * (EMIT_RMW_DW + 3);
+
+ /*
+ * After doing all RMW, we need 7 trailing dwords to clean up,
+ * plus an additional 3 dwords to reset steering if any of the
+ * registers were MCR.
+ */
+ if (count_rmw || count_rmw_mcr)
+ bb_len += 7 + (count_rmw_mcr ? 3 : 0);
- if (q->hwe->class == XE_ENGINE_CLASS_RENDER)
+ if (hwe->class == XE_ENGINE_CLASS_RENDER)
/*
* Big enough to emit all of the context's 3DSTATE via
* xe_lrc_emit_hwe_state_instructions()
*/
- bb_len += xe_gt_lrc_size(gt, q->hwe->class) / sizeof(u32);
+ bb_len += xe_gt_lrc_size(gt, hwe->class) / sizeof(u32);
- xe_gt_dbg(gt, "LRC %s WA job: %zu dwords\n", q->hwe->name, bb_len);
+ xe_gt_dbg(gt, "LRC %s WA job: %zu dwords\n", hwe->name, bb_len);
bb = xe_bb_new(gt, bb_len, false);
if (IS_ERR(bb))
@@ -253,13 +277,23 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q)
}
}
- if (count_rmw) {
- /* Emit MI_MATH for each RMW reg: 20dw per reg + 7 trailing dw */
-
+ if (count_rmw || count_rmw_mcr) {
xa_for_each(&sr->xa, idx, entry) {
if (entry->reg.masked || entry->clr_bits == ~0)
continue;
+ if (entry->reg.mcr) {
+ struct xe_reg_mcr reg = { .__reg.raw = entry->reg.raw };
+ u8 group, instance;
+
+ xe_gt_mcr_get_nonterminated_steering(gt, reg, &group, &instance);
+ *cs++ = MI_LOAD_REGISTER_IMM | MI_LRI_NUM_REGS(1);
+ *cs++ = CS_MMIO_GROUP_INSTANCE_SELECT(hwe->mmio_base).addr;
+ *cs++ = SELECTIVE_READ_ADDRESSING |
+ REG_FIELD_PREP(SELECTIVE_READ_GROUP, group) |
+ REG_FIELD_PREP(SELECTIVE_READ_INSTANCE, instance);
+ }
+
*cs++ = MI_LOAD_REGISTER_REG | MI_LRR_DST_CS_MMIO;
*cs++ = entry->reg.addr;
*cs++ = CS_GPR_REG(0, 0).addr;
@@ -285,8 +319,9 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q)
*cs++ = CS_GPR_REG(0, 0).addr;
*cs++ = entry->reg.addr;
- xe_gt_dbg(gt, "REG[%#x] = ~%#x|%#x\n",
- entry->reg.addr, entry->clr_bits, entry->set_bits);
+ xe_gt_dbg(gt, "REG[%#x] = ~%#x|%#x%s\n",
+ entry->reg.addr, entry->clr_bits, entry->set_bits,
+ entry->reg.mcr ? " (MCR)" : "");
}
/* reset used GPR */
@@ -298,6 +333,13 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q)
*cs++ = 0;
*cs++ = CS_GPR_REG(0, 2).addr;
*cs++ = 0;
+
+ /* reset steering */
+ if (count_rmw_mcr) {
+ *cs++ = MI_LOAD_REGISTER_IMM | MI_LRI_NUM_REGS(1);
+ *cs++ = CS_MMIO_GROUP_INSTANCE_SELECT(q->hwe->mmio_base).addr;
+ *cs++ = 0;
+ }
}
cs = xe_lrc_emit_hwe_state_instructions(q, cs);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 043/311] cgroup/cpuset: Fix incorrect change to effective_xcpus in partition_xcpus_del()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (41 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 042/311] drm/xe/wa: Steer RMW of MCR registers while building default LRC Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 044/311] cgroup/cpuset: Fix incorrect use of cpuset_update_tasks_cpumask() in update_cpumasks_hier() Sasha Levin
` (281 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Waiman Long, Chen Ridong, Tejun Heo, Sasha Levin
From: Waiman Long <longman@redhat.com>
[ Upstream commit f9a1767ce3a34bc33c3d33473f65dc13a380e379 ]
The effective_xcpus of a cpuset can contain offline CPUs. In
partition_xcpus_del(), the xcpus parameter is incorrectly used as
a temporary cpumask to mask out offline CPUs. As xcpus can be the
effective_xcpus of a cpuset, this can result in unexpected changes
in that cpumask. Fix this problem by not making any changes to the
xcpus parameter.
Fixes: 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions")
Reviewed-by: Chen Ridong <chenridong@huaweicloud.com>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index 62e1807b23448..aaef221a1434c 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -1401,8 +1401,8 @@ static void partition_xcpus_del(int old_prs, struct cpuset *parent,
isolated_cpus_update(old_prs, parent->partition_root_state,
xcpus);
- cpumask_and(xcpus, xcpus, cpu_active_mask);
cpumask_or(parent->effective_cpus, parent->effective_cpus, xcpus);
+ cpumask_and(parent->effective_cpus, parent->effective_cpus, cpu_active_mask);
}
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 044/311] cgroup/cpuset: Fix incorrect use of cpuset_update_tasks_cpumask() in update_cpumasks_hier()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (42 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 043/311] cgroup/cpuset: Fix incorrect change to effective_xcpus in partition_xcpus_del() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 045/311] clk: scu/imx8qxp: do not register driver in probe() Sasha Levin
` (280 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Waiman Long, Tejun Heo, Sasha Levin
From: Waiman Long <longman@redhat.com>
[ Upstream commit 68230aac8b9aad243626fbaf3ca170012c17fec5 ]
Commit e2ffe502ba45 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2")
incorrectly changed the 2nd parameter of cpuset_update_tasks_cpumask()
from tmp->new_cpus to cp->effective_cpus. This second parameter is just
a temporary cpumask for internal use. The cpuset_update_tasks_cpumask()
function was originally called update_tasks_cpumask() before commit
381b53c3b549 ("cgroup/cpuset: rename functions shared between v1
and v2").
This mistake can incorrectly change the effective_cpus of the
cpuset when it is the top_cpuset or in arm64 architecture where
task_cpu_possible_mask() may differ from cpu_possible_mask. So far
top_cpuset hasn't been passed to update_cpumasks_hier() yet, but arm64
arch can still be impacted. Fix it by reverting the incorrect change.
Fixes: e2ffe502ba45 ("cgroup/cpuset: Add cpuset.cpus.exclusive for v2")
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/cgroup/cpuset.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index aaef221a1434c..81b3165f1aaa1 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -2350,7 +2350,7 @@ static void update_cpumasks_hier(struct cpuset *cs, struct tmpmasks *tmp,
WARN_ON(!is_in_v2_mode() &&
!cpumask_equal(cp->cpus_allowed, cp->effective_cpus));
- cpuset_update_tasks_cpumask(cp, cp->effective_cpus);
+ cpuset_update_tasks_cpumask(cp, tmp->new_cpus);
/*
* On default hierarchy, inherit the CS_SCHED_LOAD_BALANCE
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 045/311] clk: scu/imx8qxp: do not register driver in probe()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (43 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 044/311] cgroup/cpuset: Fix incorrect use of cpuset_update_tasks_cpumask() in update_cpumasks_hier() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 046/311] cxl: Move devm_cxl_add_nvdimm_bridge() to cxl_pmem.ko Sasha Levin
` (279 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Danilo Krummrich, Alexander Stein, Abel Vesa, Daniel Baluta,
Sasha Levin
From: Danilo Krummrich <dakr@kernel.org>
[ Upstream commit 78437ab3b769f80526416570f60173c89858dd84 ]
imx_clk_scu_init() registers the imx_clk_scu_driver while commonly being
called from IMX driver's probe() callbacks.
However, it neither makes sense to register drivers from probe()
callbacks of other drivers, nor does the driver core allow registering
drivers with a device lock already being held.
The latter was revealed by commit dc23806a7c47 ("driver core: enforce
device_lock for driver_match_device()") leading to a deadlock condition
described in [1].
Besides that, nothing seems to unregister the imx_clk_scu_driver once
the corresponding driver module is unloaded, which leaves the
driver-core with a dangling pointer.
Also, if there are multiple matching devices for the imx8qxp_clk_driver,
imx8qxp_clk_probe() calls imx_clk_scu_init() multiple times. However,
any subsequent call after the first one will fail, since the driver-core
does not allow to register the same struct platform_driver multiple
times.
Hence, register the imx_clk_scu_driver from module_init() and unregister
it in module_exit().
Note that we first register the imx8qxp_clk_driver and then call
imx_clk_scu_module_init() to avoid having to call
imx_clk_scu_module_exit() in the unwind path of imx8qxp_clk_init().
Fixes: dc23806a7c47 ("driver core: enforce device_lock for driver_match_device()")
Fixes: 220175cd3979 ("clk: imx: scu: fix build break when compiled as modules")
Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Closes: https://lore.kernel.org/lkml/13955113.uLZWGnKmhe@steina-w/
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8x/MBa8x
Link: https://lore.kernel.org/lkml/DFU7CEPUSG9A.1KKGVW4HIPMSH@kernel.org/ [1]
Acked-by: Abel Vesa <abelvesa@kernel.org>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://patch.msgid.link/20260212235842.85934-1-dakr@kernel.org
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/imx/clk-imx8qxp.c | 24 +++++++++++++++++++++++-
drivers/clk/imx/clk-scu.c | 12 +++++++++++-
drivers/clk/imx/clk-scu.h | 2 ++
3 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/imx/clk-imx8qxp.c b/drivers/clk/imx/clk-imx8qxp.c
index 3ae162625bb1a..c781425a005ef 100644
--- a/drivers/clk/imx/clk-imx8qxp.c
+++ b/drivers/clk/imx/clk-imx8qxp.c
@@ -346,7 +346,29 @@ static struct platform_driver imx8qxp_clk_driver = {
},
.probe = imx8qxp_clk_probe,
};
-module_platform_driver(imx8qxp_clk_driver);
+
+static int __init imx8qxp_clk_init(void)
+{
+ int ret;
+
+ ret = platform_driver_register(&imx8qxp_clk_driver);
+ if (ret)
+ return ret;
+
+ ret = imx_clk_scu_module_init();
+ if (ret)
+ platform_driver_unregister(&imx8qxp_clk_driver);
+
+ return ret;
+}
+module_init(imx8qxp_clk_init);
+
+static void __exit imx8qxp_clk_exit(void)
+{
+ imx_clk_scu_module_exit();
+ platform_driver_unregister(&imx8qxp_clk_driver);
+}
+module_exit(imx8qxp_clk_exit);
MODULE_AUTHOR("Aisheng Dong <aisheng.dong@nxp.com>");
MODULE_DESCRIPTION("NXP i.MX8QXP clock driver");
diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index 34c9dc1fb20e5..c90d21e05f916 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -191,6 +191,16 @@ static bool imx_scu_clk_is_valid(u32 rsrc_id)
return p != NULL;
}
+int __init imx_clk_scu_module_init(void)
+{
+ return platform_driver_register(&imx_clk_scu_driver);
+}
+
+void __exit imx_clk_scu_module_exit(void)
+{
+ return platform_driver_unregister(&imx_clk_scu_driver);
+}
+
int imx_clk_scu_init(struct device_node *np,
const struct imx_clk_scu_rsrc_table *data)
{
@@ -215,7 +225,7 @@ int imx_clk_scu_init(struct device_node *np,
rsrc_table = data;
}
- return platform_driver_register(&imx_clk_scu_driver);
+ return 0;
}
/*
diff --git a/drivers/clk/imx/clk-scu.h b/drivers/clk/imx/clk-scu.h
index af7b697f51cae..ca82f2cce8974 100644
--- a/drivers/clk/imx/clk-scu.h
+++ b/drivers/clk/imx/clk-scu.h
@@ -25,6 +25,8 @@ extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8dxl;
extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8qxp;
extern const struct imx_clk_scu_rsrc_table imx_clk_scu_rsrc_imx8qm;
+int __init imx_clk_scu_module_init(void);
+void __exit imx_clk_scu_module_exit(void);
int imx_clk_scu_init(struct device_node *np,
const struct imx_clk_scu_rsrc_table *data);
struct clk_hw *imx_scu_of_clk_src_get(struct of_phandle_args *clkspec,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 046/311] cxl: Move devm_cxl_add_nvdimm_bridge() to cxl_pmem.ko
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (44 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 045/311] clk: scu/imx8qxp: do not register driver in probe() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 047/311] cxl: Fix race of nvdimm_bus object when creating nvdimm objects Sasha Levin
` (278 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Dave Jiang, Dan Williams, Ira Weiny, Alison Schofield,
Sasha Levin
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit e7e222ad73d93fe54d6e6e3a15253a0ecf081a1b ]
Moving the symbol devm_cxl_add_nvdimm_bridge() to
drivers/cxl/cxl_pmem.c, so that cxl_pmem can export a symbol that gives
cxl_acpi a depedency on cxl_pmem kernel module. This is a prepatory patch
to resolve the issue of a race for nvdimm_bus object that is created
during cxl_acpi_probe().
No functional changes besides moving code.
Suggested-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Ira Weiny <ira.weiny@intel.com>
Tested-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com?>
Link: https://patch.msgid.link/20260205001633.1813643-2-dave.jiang@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Stable-dep-of: 96a1fd0d84b1 ("cxl: Fix race of nvdimm_bus object when creating nvdimm objects")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/pmem.c | 13 +++----------
drivers/cxl/cxl.h | 2 ++
drivers/cxl/pmem.c | 14 ++++++++++++++
3 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/drivers/cxl/core/pmem.c b/drivers/cxl/core/pmem.c
index 8853415c106a9..e1325936183a6 100644
--- a/drivers/cxl/core/pmem.c
+++ b/drivers/cxl/core/pmem.c
@@ -115,15 +115,8 @@ static void unregister_nvb(void *_cxl_nvb)
device_unregister(&cxl_nvb->dev);
}
-/**
- * devm_cxl_add_nvdimm_bridge() - add the root of a LIBNVDIMM topology
- * @host: platform firmware root device
- * @port: CXL port at the root of a CXL topology
- *
- * Return: bridge device that can host cxl_nvdimm objects
- */
-struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
- struct cxl_port *port)
+struct cxl_nvdimm_bridge *__devm_cxl_add_nvdimm_bridge(struct device *host,
+ struct cxl_port *port)
{
struct cxl_nvdimm_bridge *cxl_nvb;
struct device *dev;
@@ -155,7 +148,7 @@ struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
put_device(dev);
return ERR_PTR(rc);
}
-EXPORT_SYMBOL_NS_GPL(devm_cxl_add_nvdimm_bridge, "CXL");
+EXPORT_SYMBOL_FOR_MODULES(__devm_cxl_add_nvdimm_bridge, "cxl_pmem");
static void cxl_nvdimm_release(struct device *dev)
{
diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h
index ba17fa86d249e..2854e47fd9869 100644
--- a/drivers/cxl/cxl.h
+++ b/drivers/cxl/cxl.h
@@ -893,6 +893,8 @@ void cxl_driver_unregister(struct cxl_driver *cxl_drv);
struct cxl_nvdimm_bridge *to_cxl_nvdimm_bridge(struct device *dev);
struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
struct cxl_port *port);
+struct cxl_nvdimm_bridge *__devm_cxl_add_nvdimm_bridge(struct device *host,
+ struct cxl_port *port);
struct cxl_nvdimm *to_cxl_nvdimm(struct device *dev);
bool is_cxl_nvdimm(struct device *dev);
int devm_cxl_add_nvdimm(struct cxl_port *parent_port, struct cxl_memdev *cxlmd);
diff --git a/drivers/cxl/pmem.c b/drivers/cxl/pmem.c
index e197883690efc..714beaf1704be 100644
--- a/drivers/cxl/pmem.c
+++ b/drivers/cxl/pmem.c
@@ -13,6 +13,20 @@
static __read_mostly DECLARE_BITMAP(exclusive_cmds, CXL_MEM_COMMAND_ID_MAX);
+/**
+ * __devm_cxl_add_nvdimm_bridge() - add the root of a LIBNVDIMM topology
+ * @host: platform firmware root device
+ * @port: CXL port at the root of a CXL topology
+ *
+ * Return: bridge device that can host cxl_nvdimm objects
+ */
+struct cxl_nvdimm_bridge *devm_cxl_add_nvdimm_bridge(struct device *host,
+ struct cxl_port *port)
+{
+ return __devm_cxl_add_nvdimm_bridge(host, port);
+}
+EXPORT_SYMBOL_NS_GPL(devm_cxl_add_nvdimm_bridge, "CXL");
+
static void clear_exclusive(void *mds)
{
clear_exclusive_cxl_commands(mds, exclusive_cmds);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 047/311] cxl: Fix race of nvdimm_bus object when creating nvdimm objects
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (45 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 046/311] cxl: Move devm_cxl_add_nvdimm_bridge() to cxl_pmem.ko Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 048/311] cxl/mbox: validate payload size before accessing contents in cxl_payload_from_user_allowed() Sasha Levin
` (277 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Dave Jiang, Dan Williams, Alison Schofield, Sasha Levin
From: Dave Jiang <dave.jiang@intel.com>
[ Upstream commit 96a1fd0d84b17360840f344826897fa71049870e ]
Found issue during running of cxl-translate.sh unit test. Adding a 3s
sleep right before the test seems to make the issue reproduce fairly
consistently. The cxl_translate module has dependency on cxl_acpi and
causes orphaned nvdimm objects to reprobe after cxl_acpi is removed.
The nvdimm_bus object is registered by the cxl_nvb object when
cxl_acpi_probe() is called. With the nvdimm_bus object missing,
__nd_device_register() will trigger NULL pointer dereference when
accessing the dev->parent that points to &nvdimm_bus->dev.
[ 192.884510] BUG: kernel NULL pointer dereference, address: 000000000000006c
[ 192.895383] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS edk2-20250812-19.fc42 08/12/2025
[ 192.897721] Workqueue: cxl_port cxl_bus_rescan_queue [cxl_core]
[ 192.899459] RIP: 0010:kobject_get+0xc/0x90
[ 192.924871] Call Trace:
[ 192.925959] <TASK>
[ 192.926976] ? pm_runtime_init+0xb9/0xe0
[ 192.929712] __nd_device_register.part.0+0x4d/0xc0 [libnvdimm]
[ 192.933314] __nvdimm_create+0x206/0x290 [libnvdimm]
[ 192.936662] cxl_nvdimm_probe+0x119/0x1d0 [cxl_pmem]
[ 192.940245] cxl_bus_probe+0x1a/0x60 [cxl_core]
[ 192.943349] really_probe+0xde/0x380
This patch also relies on the previous change where
devm_cxl_add_nvdimm_bridge() is called from drivers/cxl/pmem.c instead
of drivers/cxl/core.c to ensure the dependency of cxl_acpi on cxl_pmem.
1. Set probe_type of cxl_nvb to PROBE_FORCE_SYNCHRONOUS to ensure the
driver is probed synchronously when add_device() is called.
2. Add a check in __devm_cxl_add_nvdimm_bridge() to ensure that the
cxl_nvb driver is attached during cxl_acpi_probe().
3. Take the cxl_root uport_dev lock and the cxl_nvb->dev lock in
devm_cxl_add_nvdimm() before checking nvdimm_bus is valid.
4. Set cxl_nvdimm flag to CXL_NVD_F_INVALIDATED so cxl_nvdimm_probe()
will exit with -EBUSY.
The removal of cxl_nvdimm devices should prevent any orphaned devices
from probing once the nvdimm_bus is gone.
[ dj: Fixed 0-day reported kdoc issue. ]
[ dj: Fix cxl_nvb reference leak on error. Gregory (kreview-0811365) ]
Suggested-by: Dan Williams <dan.j.williams@intel.com>
Fixes: 8fdcb1704f61 ("cxl/pmem: Add initial infrastructure for pmem support")
Tested-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Alison Schofield <alison.schofield@intel.com?>
Link: https://patch.msgid.link/20260205001633.1813643-3-dave.jiang@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/pmem.c | 29 +++++++++++++++++++++++++++++
drivers/cxl/cxl.h | 5 +++++
drivers/cxl/pmem.c | 10 ++++++++--
3 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/drivers/cxl/core/pmem.c b/drivers/cxl/core/pmem.c
index e1325936183a6..e3a8b8d813333 100644
--- a/drivers/cxl/core/pmem.c
+++ b/drivers/cxl/core/pmem.c
@@ -115,6 +115,15 @@ static void unregister_nvb(void *_cxl_nvb)
device_unregister(&cxl_nvb->dev);
}
+static bool cxl_nvdimm_bridge_failed_attach(struct cxl_nvdimm_bridge *cxl_nvb)
+{
+ struct device *dev = &cxl_nvb->dev;
+
+ guard(device)(dev);
+ /* If the device has no driver, then it failed to attach. */
+ return dev->driver == NULL;
+}
+
struct cxl_nvdimm_bridge *__devm_cxl_add_nvdimm_bridge(struct device *host,
struct cxl_port *port)
{
@@ -138,6 +147,11 @@ struct cxl_nvdimm_bridge *__devm_cxl_add_nvdimm_bridge(struct device *host,
if (rc)
goto err;
+ if (cxl_nvdimm_bridge_failed_attach(cxl_nvb)) {
+ unregister_nvb(cxl_nvb);
+ return ERR_PTR(-ENODEV);
+ }
+
rc = devm_add_action_or_reset(host, unregister_nvb, cxl_nvb);
if (rc)
return ERR_PTR(rc);
@@ -247,6 +261,21 @@ int devm_cxl_add_nvdimm(struct cxl_port *parent_port,
if (!cxl_nvb)
return -ENODEV;
+ /*
+ * Take the uport_dev lock to guard against race of nvdimm_bus object.
+ * cxl_acpi_probe() registers the nvdimm_bus and is done under the
+ * root port uport_dev lock.
+ *
+ * Take the cxl_nvb device lock to ensure that cxl_nvb driver is in a
+ * consistent state. And the driver registers nvdimm_bus.
+ */
+ guard(device)(cxl_nvb->port->uport_dev);
+ guard(device)(&cxl_nvb->dev);
+ if (!cxl_nvb->nvdimm_bus) {
+ rc = -ENODEV;
+ goto err_alloc;
+ }
+
cxl_nvd = cxl_nvdimm_alloc(cxl_nvb, cxlmd);
if (IS_ERR(cxl_nvd)) {
rc = PTR_ERR(cxl_nvd);
diff --git a/drivers/cxl/cxl.h b/drivers/cxl/cxl.h
index 2854e47fd9869..e477cd72d3000 100644
--- a/drivers/cxl/cxl.h
+++ b/drivers/cxl/cxl.h
@@ -563,11 +563,16 @@ struct cxl_nvdimm_bridge {
#define CXL_DEV_ID_LEN 19
+enum {
+ CXL_NVD_F_INVALIDATED = 0,
+};
+
struct cxl_nvdimm {
struct device dev;
struct cxl_memdev *cxlmd;
u8 dev_id[CXL_DEV_ID_LEN]; /* for nvdimm, string of 'serial' */
u64 dirty_shutdowns;
+ unsigned long flags;
};
struct cxl_pmem_region_mapping {
diff --git a/drivers/cxl/pmem.c b/drivers/cxl/pmem.c
index 714beaf1704be..c00b84b960761 100644
--- a/drivers/cxl/pmem.c
+++ b/drivers/cxl/pmem.c
@@ -14,7 +14,7 @@
static __read_mostly DECLARE_BITMAP(exclusive_cmds, CXL_MEM_COMMAND_ID_MAX);
/**
- * __devm_cxl_add_nvdimm_bridge() - add the root of a LIBNVDIMM topology
+ * devm_cxl_add_nvdimm_bridge() - add the root of a LIBNVDIMM topology
* @host: platform firmware root device
* @port: CXL port at the root of a CXL topology
*
@@ -143,6 +143,9 @@ static int cxl_nvdimm_probe(struct device *dev)
struct nvdimm *nvdimm;
int rc;
+ if (test_bit(CXL_NVD_F_INVALIDATED, &cxl_nvd->flags))
+ return -EBUSY;
+
set_exclusive_cxl_commands(mds, exclusive_cmds);
rc = devm_add_action_or_reset(dev, clear_exclusive, mds);
if (rc)
@@ -323,8 +326,10 @@ static int detach_nvdimm(struct device *dev, void *data)
scoped_guard(device, dev) {
if (dev->driver) {
cxl_nvd = to_cxl_nvdimm(dev);
- if (cxl_nvd->cxlmd && cxl_nvd->cxlmd->cxl_nvb == data)
+ if (cxl_nvd->cxlmd && cxl_nvd->cxlmd->cxl_nvb == data) {
release = true;
+ set_bit(CXL_NVD_F_INVALIDATED, &cxl_nvd->flags);
+ }
}
}
if (release)
@@ -367,6 +372,7 @@ static struct cxl_driver cxl_nvdimm_bridge_driver = {
.probe = cxl_nvdimm_bridge_probe,
.id = CXL_DEVICE_NVDIMM_BRIDGE,
.drv = {
+ .probe_type = PROBE_FORCE_SYNCHRONOUS,
.suppress_bind_attrs = true,
},
};
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 048/311] cxl/mbox: validate payload size before accessing contents in cxl_payload_from_user_allowed()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (46 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 047/311] cxl: Fix race of nvdimm_bus object when creating nvdimm objects Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 049/311] scsi: ufs: core: Move link recovery for hibern8 exit failure to wl_resume Sasha Levin
` (276 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Davidlohr Bueso, Alison Schofield, Dave Jiang, Sasha Levin
From: Davidlohr Bueso <dave@stgolabs.net>
[ Upstream commit 60b5d1f68338aff2c5af0113f04aefa7169c50c2 ]
cxl_payload_from_user_allowed() casts and dereferences the input
payload without first verifying its size. When a raw mailbox command
is sent with an undersized payload (ie: 1 byte for CXL_MBOX_OP_CLEAR_LOG,
which expects a 16-byte UUID), uuid_equal() reads past the allocated buffer,
triggering a KASAN splat:
BUG: KASAN: slab-out-of-bounds in memcmp+0x176/0x1d0 lib/string.c:683
Read of size 8 at addr ffff88810130f5c0 by task syz.1.62/2258
CPU: 2 UID: 0 PID: 2258 Comm: syz.1.62 Not tainted 6.19.0-dirty #3 PREEMPT(voluntary)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0xab/0xe0 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xce/0x650 mm/kasan/report.c:482
kasan_report+0xce/0x100 mm/kasan/report.c:595
memcmp+0x176/0x1d0 lib/string.c:683
uuid_equal include/linux/uuid.h:73 [inline]
cxl_payload_from_user_allowed drivers/cxl/core/mbox.c:345 [inline]
cxl_mbox_cmd_ctor drivers/cxl/core/mbox.c:368 [inline]
cxl_validate_cmd_from_user drivers/cxl/core/mbox.c:522 [inline]
cxl_send_cmd+0x9c0/0xb50 drivers/cxl/core/mbox.c:643
__cxl_memdev_ioctl drivers/cxl/core/memdev.c:698 [inline]
cxl_memdev_ioctl+0x14f/0x190 drivers/cxl/core/memdev.c:713
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa8/0x330 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fdaf331ba79
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fdaf1d77038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fdaf3585fa0 RCX: 00007fdaf331ba79
RDX: 00002000000001c0 RSI: 00000000c030ce02 RDI: 0000000000000003
RBP: 00007fdaf33749df R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fdaf3586038 R14: 00007fdaf3585fa0 R15: 00007ffced2af768
</TASK>
Add 'in_size' parameter to cxl_payload_from_user_allowed() and validate
the payload is large enough.
Fixes: 6179045ccc0c ("cxl/mbox: Block immediate mode in SET_PARTITION_INFO command")
Fixes: 206f9fa9d555 ("cxl/mbox: Add Clear Log mailbox command")
Signed-off-by: Davidlohr Bueso <dave@stgolabs.net>
Reviewed-by: Alison Schofield <alison.schofield@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20260220001618.963490-2-dave@stgolabs.net
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/cxl/core/mbox.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
index fa6dd0c94656f..e7a6452bf5445 100644
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
@@ -311,6 +311,7 @@ static bool cxl_mem_raw_command_allowed(u16 opcode)
* cxl_payload_from_user_allowed() - Check contents of in_payload.
* @opcode: The mailbox command opcode.
* @payload_in: Pointer to the input payload passed in from user space.
+ * @in_size: Size of @payload_in in bytes.
*
* Return:
* * true - payload_in passes check for @opcode.
@@ -325,12 +326,15 @@ static bool cxl_mem_raw_command_allowed(u16 opcode)
*
* The specific checks are determined by the opcode.
*/
-static bool cxl_payload_from_user_allowed(u16 opcode, void *payload_in)
+static bool cxl_payload_from_user_allowed(u16 opcode, void *payload_in,
+ size_t in_size)
{
switch (opcode) {
case CXL_MBOX_OP_SET_PARTITION_INFO: {
struct cxl_mbox_set_partition_info *pi = payload_in;
+ if (in_size < sizeof(*pi))
+ return false;
if (pi->flags & CXL_SET_PARTITION_IMMEDIATE_FLAG)
return false;
break;
@@ -338,6 +342,8 @@ static bool cxl_payload_from_user_allowed(u16 opcode, void *payload_in)
case CXL_MBOX_OP_CLEAR_LOG: {
const uuid_t *uuid = (uuid_t *)payload_in;
+ if (in_size < sizeof(uuid_t))
+ return false;
/*
* Restrict the ‘Clear log’ action to only apply to
* Vendor debug logs.
@@ -365,7 +371,8 @@ static int cxl_mbox_cmd_ctor(struct cxl_mbox_cmd *mbox_cmd,
if (IS_ERR(mbox_cmd->payload_in))
return PTR_ERR(mbox_cmd->payload_in);
- if (!cxl_payload_from_user_allowed(opcode, mbox_cmd->payload_in)) {
+ if (!cxl_payload_from_user_allowed(opcode, mbox_cmd->payload_in,
+ in_size)) {
dev_dbg(cxl_mbox->host, "%s: input payload not allowed\n",
cxl_mem_opcode_to_name(opcode));
kvfree(mbox_cmd->payload_in);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 049/311] scsi: ufs: core: Move link recovery for hibern8 exit failure to wl_resume
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (47 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 048/311] cxl/mbox: validate payload size before accessing contents in cxl_payload_from_user_allowed() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 050/311] regulator: fp9931: Fix PM runtime reference leak in fp9931_hwmon_read() Sasha Levin
` (275 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Peter Wang, Bart Van Assche, Martin K. Petersen, Sasha Levin
From: Peter Wang <peter.wang@mediatek.com>
[ Upstream commit 62c015373e1cdb1cdca824bd2dbce2dac0819467 ]
Move the link recovery trigger from ufshcd_uic_pwr_ctrl() to
__ufshcd_wl_resume(). Ensure link recovery is only attempted when hibern8
exit fails during resume, not during hibern8 enter in suspend. Improve
error handling and prevent unnecessary link recovery attempts.
Fixes: 35dabf4503b9 ("scsi: ufs: core: Use link recovery when h8 exit fails during runtime resume")
Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260223103906.2533654-1-peter.wang@mediatek.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ufs/core/ufshcd.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 09f0d77d57f02..d6e4e99a571f1 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -4385,14 +4385,6 @@ static int ufshcd_uic_pwr_ctrl(struct ufs_hba *hba, struct uic_command *cmd)
spin_unlock_irqrestore(hba->host->host_lock, flags);
mutex_unlock(&hba->uic_cmd_mutex);
- /*
- * If the h8 exit fails during the runtime resume process, it becomes
- * stuck and cannot be recovered through the error handler. To fix
- * this, use link recovery instead of the error handler.
- */
- if (ret && hba->pm_op_in_progress)
- ret = ufshcd_link_recovery(hba);
-
return ret;
}
@@ -10174,7 +10166,15 @@ static int __ufshcd_wl_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op)
} else {
dev_err(hba->dev, "%s: hibern8 exit failed %d\n",
__func__, ret);
- goto vendor_suspend;
+ /*
+ * If the h8 exit fails during the runtime resume
+ * process, it becomes stuck and cannot be recovered
+ * through the error handler. To fix this, use link
+ * recovery instead of the error handler.
+ */
+ ret = ufshcd_link_recovery(hba);
+ if (ret)
+ goto vendor_suspend;
}
} else if (ufshcd_is_link_off(hba)) {
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 050/311] regulator: fp9931: Fix PM runtime reference leak in fp9931_hwmon_read()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (48 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 049/311] scsi: ufs: core: Move link recovery for hibern8 exit failure to wl_resume Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 051/311] regulator: bq257xx: Fix device node reference leak in bq257xx_reg_dt_parse_gpio() Sasha Levin
` (274 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Felix Gu, Andreas Kemnade, Mark Brown, Sasha Levin
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit 0902010c8d163f7b62e655efda1a843529152c7c ]
In fp9931_hwmon_read(), if regmap_read() failed, the function returned
the error code without calling pm_runtime_put_autosuspend(), causing
a PM reference leak.
Fixes: 12d821bd13d4 ("regulator: Add FP9931/JD9930 driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20260224-fp9931-v1-1-1cf05cabef4a@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/fp9931.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/regulator/fp9931.c b/drivers/regulator/fp9931.c
index 7fbcc6327cc63..abea3b69d8a08 100644
--- a/drivers/regulator/fp9931.c
+++ b/drivers/regulator/fp9931.c
@@ -144,13 +144,12 @@ static int fp9931_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
return ret;
ret = regmap_read(data->regmap, FP9931_REG_TMST_VALUE, &val);
- if (ret)
- return ret;
+ if (!ret)
+ *temp = (s8)val * 1000;
pm_runtime_put_autosuspend(data->dev);
- *temp = (s8)val * 1000;
- return 0;
+ return ret;
}
static umode_t fp9931_hwmon_is_visible(const void *data,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 051/311] regulator: bq257xx: Fix device node reference leak in bq257xx_reg_dt_parse_gpio()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (49 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 050/311] regulator: fp9931: Fix PM runtime reference leak in fp9931_hwmon_read() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 052/311] irqchip/ls-extirq: Fix devm_of_iomap() error check Sasha Levin
` (273 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Felix Gu, Mark Brown, Sasha Levin
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit 4baaddaa44af01cd4ce239493060738fd0881835 ]
In bq257xx_reg_dt_parse_gpio(), if fails to get subchild, it returns
without calling of_node_put(child), causing the device node reference
leak.
Fixes: 981dd162b635 ("regulator: bq257xx: Add bq257xx boost regulator driver")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260224-bq257-v1-1-8ebbc731c1c3@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/bq257xx-regulator.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/regulator/bq257xx-regulator.c b/drivers/regulator/bq257xx-regulator.c
index fc1ccede44688..dab8f1ab44503 100644
--- a/drivers/regulator/bq257xx-regulator.c
+++ b/drivers/regulator/bq257xx-regulator.c
@@ -115,11 +115,10 @@ static void bq257xx_reg_dt_parse_gpio(struct platform_device *pdev)
return;
subchild = of_get_child_by_name(child, pdata->desc.of_match);
+ of_node_put(child);
if (!subchild)
return;
- of_node_put(child);
-
pdata->otg_en_gpio = devm_fwnode_gpiod_get_index(&pdev->dev,
of_fwnode_handle(subchild),
"enable", 0,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 052/311] irqchip/ls-extirq: Fix devm_of_iomap() error check
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (50 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 051/311] regulator: bq257xx: Fix device node reference leak in bq257xx_reg_dt_parse_gpio() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 053/311] io_uring/cmd_net: use READ_ONCE() for ->addr3 read Sasha Levin
` (272 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Ioana Ciornei, Dan Carpenter, Thomas Gleixner, Herve Codina,
Sasha Levin
From: Ioana Ciornei <ioana.ciornei@nxp.com>
[ Upstream commit fe5669e363b129cde285bfb4d45abb72d1d77cfc ]
The devm_of_iomap() function returns an ERR_PTR() encoded error code on
failure. Replace the incorrect check against NULL with IS_ERR().
Fixes: 05cd654829dd ("irqchip/ls-extirq: Convert to a platform driver to make it work again")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
Link: https://patch.msgid.link/20260224113610.1129022-3-ioana.ciornei@nxp.com
Closes: https://lore.kernel.org/all/aYXvfbfT6w0TMsXS@stanley.mountain/
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/irqchip/irq-ls-extirq.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/irqchip/irq-ls-extirq.c b/drivers/irqchip/irq-ls-extirq.c
index 96f9c20621cf5..d724fe8439801 100644
--- a/drivers/irqchip/irq-ls-extirq.c
+++ b/drivers/irqchip/irq-ls-extirq.c
@@ -190,8 +190,10 @@ static int ls_extirq_probe(struct platform_device *pdev)
return dev_err_probe(dev, -ENOMEM, "Failed to allocate memory\n");
priv->intpcr = devm_of_iomap(dev, node, 0, NULL);
- if (!priv->intpcr)
- return dev_err_probe(dev, -ENOMEM, "Cannot ioremap OF node %pOF\n", node);
+ if (IS_ERR(priv->intpcr)) {
+ return dev_err_probe(dev, PTR_ERR(priv->intpcr),
+ "Cannot ioremap OF node %pOF\n", node);
+ }
ret = ls_extirq_parse_map(priv, node);
if (ret)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 053/311] io_uring/cmd_net: use READ_ONCE() for ->addr3 read
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (51 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 052/311] irqchip/ls-extirq: Fix devm_of_iomap() error check Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 054/311] zloop: advertise a volatile write cache Sasha Levin
` (271 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Jens Axboe, Sasha Levin
From: Jens Axboe <axboe@kernel.dk>
[ Upstream commit a46435537a844d0f7b4b620baf962cad136422de ]
Any SQE read should use READ_ONCE(), to ensure the result is read once
and only once. Doesn't really matter for this case, but it's better to
keep these 100% consistent and always use READ_ONCE() for the prep side
of SQE handling.
Fixes: 5d24321e4c15 ("io_uring: Introduce getsockname io_uring cmd")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/cmd_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/io_uring/cmd_net.c b/io_uring/cmd_net.c
index 3db34e2d22ee5..17d499f68fe6d 100644
--- a/io_uring/cmd_net.c
+++ b/io_uring/cmd_net.c
@@ -145,7 +145,7 @@ static int io_uring_cmd_getsockname(struct socket *sock,
return -EINVAL;
uaddr = u64_to_user_ptr(READ_ONCE(sqe->addr));
- ulen = u64_to_user_ptr(sqe->addr3);
+ ulen = u64_to_user_ptr(READ_ONCE(sqe->addr3));
peer = READ_ONCE(sqe->optlen);
if (peer > 1)
return -EINVAL;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 054/311] zloop: advertise a volatile write cache
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (52 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 053/311] io_uring/cmd_net: use READ_ONCE() for ->addr3 read Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 055/311] zloop: check for spurious options passed to remove Sasha Levin
` (270 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Christoph Hellwig, Damien Le Moal, Jens Axboe, Sasha Levin
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit 6acf7860dcc79ed045cc9e6a79c8a8bb6959dba7 ]
Zloop is file system backed and thus needs to sync the underlying file
system to persist data. Set BLK_FEAT_WRITE_CACHE so that the block
layer actually send flush commands, and fix the flush implementation
as sync_filesystem requires s_umount to be held and the code currently
misses that.
Fixes: eb0570c7df23 ("block: new zoned loop block device driver")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/zloop.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c
index 8e334f5025fc0..ae9bf2a85c21c 100644
--- a/drivers/block/zloop.c
+++ b/drivers/block/zloop.c
@@ -542,6 +542,21 @@ static void zloop_rw(struct zloop_cmd *cmd)
zloop_put_cmd(cmd);
}
+/*
+ * Sync the entire FS containing the zone files instead of walking all files.
+ */
+static int zloop_flush(struct zloop_device *zlo)
+{
+ struct super_block *sb = file_inode(zlo->data_dir)->i_sb;
+ int ret;
+
+ down_read(&sb->s_umount);
+ ret = sync_filesystem(sb);
+ up_read(&sb->s_umount);
+
+ return ret;
+}
+
static void zloop_handle_cmd(struct zloop_cmd *cmd)
{
struct request *rq = blk_mq_rq_from_pdu(cmd);
@@ -562,11 +577,7 @@ static void zloop_handle_cmd(struct zloop_cmd *cmd)
zloop_rw(cmd);
return;
case REQ_OP_FLUSH:
- /*
- * Sync the entire FS containing the zone files instead of
- * walking all files
- */
- cmd->ret = sync_filesystem(file_inode(zlo->data_dir)->i_sb);
+ cmd->ret = zloop_flush(zlo);
break;
case REQ_OP_ZONE_RESET:
cmd->ret = zloop_reset_zone(zlo, rq_zone_no(rq));
@@ -981,7 +992,8 @@ static int zloop_ctl_add(struct zloop_options *opts)
struct queue_limits lim = {
.max_hw_sectors = SZ_1M >> SECTOR_SHIFT,
.chunk_sectors = opts->zone_size,
- .features = BLK_FEAT_ZONED,
+ .features = BLK_FEAT_ZONED | BLK_FEAT_WRITE_CACHE,
+
};
unsigned int nr_zones, i, j;
struct zloop_device *zlo;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 055/311] zloop: check for spurious options passed to remove
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (53 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 054/311] zloop: advertise a volatile write cache Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 056/311] drm/client: Do not destroy NULL modes Sasha Levin
` (269 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Christoph Hellwig, Damien Le Moal, Jens Axboe, Sasha Levin
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit 3c4617117a2b7682cf037be5e5533e379707f050 ]
Zloop uses a command option parser for all control commands,
but most options are only valid for adding a new device. Check
for incorrectly specified options in the remove handler.
Fixes: eb0570c7df23 ("block: new zoned loop block device driver")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/block/zloop.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/block/zloop.c b/drivers/block/zloop.c
index ae9bf2a85c21c..9e3bb538d5fcf 100644
--- a/drivers/block/zloop.c
+++ b/drivers/block/zloop.c
@@ -1174,7 +1174,12 @@ static int zloop_ctl_remove(struct zloop_options *opts)
int ret;
if (!(opts->mask & ZLOOP_OPT_ID)) {
- pr_err("No ID specified\n");
+ pr_err("No ID specified for remove\n");
+ return -EINVAL;
+ }
+
+ if (opts->mask & ~ZLOOP_OPT_ID) {
+ pr_err("Invalid option specified for remove\n");
return -EINVAL;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 056/311] drm/client: Do not destroy NULL modes
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (54 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 055/311] zloop: check for spurious options passed to remove Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 057/311] ALSA: usb-audio: Cap the packet size pre-calculations Sasha Levin
` (268 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Jonathan Cavitt, Ville Syrjälä, Sasha Levin
From: Jonathan Cavitt <jonathan.cavitt@intel.com>
[ Upstream commit c601fd5414315fc515f746b499110e46272e7243 ]
'modes' in drm_client_modeset_probe may fail to kcalloc. If this
occurs, we jump to 'out', calling modes_destroy on it, which
dereferences it. This may result in a NULL pointer dereference in the
error case. Prevent that.
Fixes: 3039cc0c0653 ("drm/client: Make copies of modes")
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260224221227.69126-2-jonathan.cavitt@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_client_modeset.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_client_modeset.c b/drivers/gpu/drm/drm_client_modeset.c
index fc4caf7da5fcd..4a72f323e83e3 100644
--- a/drivers/gpu/drm/drm_client_modeset.c
+++ b/drivers/gpu/drm/drm_client_modeset.c
@@ -930,7 +930,8 @@ int drm_client_modeset_probe(struct drm_client_dev *client, unsigned int width,
mutex_unlock(&client->modeset_mutex);
out:
kfree(crtcs);
- modes_destroy(dev, modes, connector_count);
+ if (modes)
+ modes_destroy(dev, modes, connector_count);
kfree(modes);
kfree(offsets);
kfree(enabled);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 057/311] ALSA: usb-audio: Cap the packet size pre-calculations
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (55 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 056/311] drm/client: Do not destroy NULL modes Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 058/311] ALSA: usb-audio: Use inclusive terms Sasha Levin
` (267 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Takashi Iwai, Sasha Levin
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 7fe8dec3f628e9779f1631576f8e693370050348 ]
We calculate the possible packet sizes beforehand for adaptive and
synchronous endpoints, but we didn't take care of the max frame size
for those pre-calculated values. When a device or a bus limits the
packet size, a high sample rate or a high number of channels may lead
to the packet sizes that are larger than the given limit, which
results in an error from the USB core at submitting URBs.
As a simple workaround, just add the sanity checks of pre-calculated
packet sizes to have the upper boundary of ep->maxframesize.
Fixes: f0bd62b64016 ("ALSA: usb-audio: Improve frames size computation")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=221076
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260225085233.316306-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/endpoint.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 1eaf52d1ae9c7..bd035ab414531 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -1374,6 +1374,9 @@ int snd_usb_endpoint_set_params(struct snd_usb_audio *chip,
return -EINVAL;
}
+ ep->packsize[0] = min(ep->packsize[0], ep->maxframesize);
+ ep->packsize[1] = min(ep->packsize[1], ep->maxframesize);
+
/* calculate the frequency in 16.16 format */
ep->freqm = ep->freqn;
ep->freqshift = INT_MIN;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 058/311] ALSA: usb-audio: Use inclusive terms
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (56 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 057/311] ALSA: usb-audio: Cap the packet size pre-calculations Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 059/311] perf: Fix __perf_event_overflow() vs perf_remove_from_context() race Sasha Levin
` (266 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Takashi Iwai, Sasha Levin
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 4e9113c533acee2ba1f72fd68ee6ecd36b64484e ]
Replace the remaining with inclusive terms; it's only this function
name we overlooked at the previous conversion.
Fixes: 53837b4ac2bd ("ALSA: usb-audio: Replace slave/master terms")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260225085233.316306-5-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/endpoint.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index bd035ab414531..686f095290673 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -160,8 +160,8 @@ int snd_usb_endpoint_implicit_feedback_sink(struct snd_usb_endpoint *ep)
* This won't be used for implicit feedback which takes the packet size
* returned from the sync source
*/
-static int slave_next_packet_size(struct snd_usb_endpoint *ep,
- unsigned int avail)
+static int synced_next_packet_size(struct snd_usb_endpoint *ep,
+ unsigned int avail)
{
unsigned int phase;
int ret;
@@ -227,7 +227,7 @@ int snd_usb_endpoint_next_packet_size(struct snd_usb_endpoint *ep,
}
if (ep->sync_source)
- return slave_next_packet_size(ep, avail);
+ return synced_next_packet_size(ep, avail);
else
return next_packet_size(ep, avail);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 059/311] perf: Fix __perf_event_overflow() vs perf_remove_from_context() race
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (57 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 058/311] ALSA: usb-audio: Use inclusive terms Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 060/311] s390/idle: Fix cpu idle exit cpu time accounting Sasha Levin
` (265 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Peter Zijlstra, Simond Hu, Sasha Levin
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit c9bc1753b3cc41d0e01fbca7f035258b5f4db0ae ]
Make sure that __perf_event_overflow() runs with IRQs disabled for all
possible callchains. Specifically the software events can end up running
it with only preemption disabled.
This opens up a race vs perf_event_exit_event() and friends that will go
and free various things the overflow path expects to be present, like
the BPF program.
Fixes: 592903cdcbf6 ("perf_counter: add an event_list")
Reported-by: Simond Hu <cmdhh1767@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Simond Hu <cmdhh1767@gmail.com>
Link: https://patch.msgid.link/20260224122909.GV1395416@noisy.programming.kicks-ass.net
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/events/core.c | 42 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 4311c33c3381c..84a79e977580e 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -10498,6 +10498,13 @@ int perf_event_overflow(struct perf_event *event,
struct perf_sample_data *data,
struct pt_regs *regs)
{
+ /*
+ * Entry point from hardware PMI, interrupts should be disabled here.
+ * This serializes us against perf_event_remove_from_context() in
+ * things like perf_event_release_kernel().
+ */
+ lockdep_assert_irqs_disabled();
+
return __perf_event_overflow(event, 1, data, regs);
}
@@ -10574,6 +10581,19 @@ static void perf_swevent_event(struct perf_event *event, u64 nr,
{
struct hw_perf_event *hwc = &event->hw;
+ /*
+ * This is:
+ * - software preempt
+ * - tracepoint preempt
+ * - tp_target_task irq (ctx->lock)
+ * - uprobes preempt/irq
+ * - kprobes preempt/irq
+ * - hw_breakpoint irq
+ *
+ * Any of these are sufficient to hold off RCU and thus ensure @event
+ * exists.
+ */
+ lockdep_assert_preemption_disabled();
local64_add(nr, &event->count);
if (!regs)
@@ -10582,6 +10602,16 @@ static void perf_swevent_event(struct perf_event *event, u64 nr,
if (!is_sampling_event(event))
return;
+ /*
+ * Serialize against event_function_call() IPIs like normal overflow
+ * event handling. Specifically, must not allow
+ * perf_event_release_kernel() -> perf_remove_from_context() to make
+ * progress and 'release' the event from under us.
+ */
+ guard(irqsave)();
+ if (event->state != PERF_EVENT_STATE_ACTIVE)
+ return;
+
if ((event->attr.sample_type & PERF_SAMPLE_PERIOD) && !event->attr.freq) {
data->period = nr;
return perf_swevent_overflow(event, 1, data, regs);
@@ -11080,6 +11110,11 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size,
struct perf_sample_data data;
struct perf_event *event;
+ /*
+ * Per being a tracepoint, this runs with preemption disabled.
+ */
+ lockdep_assert_preemption_disabled();
+
struct perf_raw_record raw = {
.frag = {
.size = entry_size,
@@ -11412,6 +11447,11 @@ void perf_bp_event(struct perf_event *bp, void *data)
struct perf_sample_data sample;
struct pt_regs *regs = data;
+ /*
+ * Exception context, will have interrupts disabled.
+ */
+ lockdep_assert_irqs_disabled();
+
perf_sample_data_init(&sample, bp->attr.bp_addr, 0);
if (!bp->hw.state && !perf_exclude_event(bp, regs))
@@ -11876,7 +11916,7 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer)
if (regs && !perf_exclude_event(event, regs)) {
if (!(event->attr.exclude_idle && is_idle_task(current)))
- if (__perf_event_overflow(event, 1, &data, regs))
+ if (perf_event_overflow(event, &data, regs))
ret = HRTIMER_NORESTART;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 060/311] s390/idle: Fix cpu idle exit cpu time accounting
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (58 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 059/311] perf: Fix __perf_event_overflow() vs perf_remove_from_context() race Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 061/311] s390/vtime: Fix virtual timer forwarding Sasha Levin
` (264 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Heiko Carstens, Sven Schnelle, Vasily Gorbik, Sasha Levin
From: Heiko Carstens <hca@linux.ibm.com>
[ Upstream commit 0d785e2c324c90662baa4fe07a0d02233ff92824 ]
With the conversion to generic entry [1] cpu idle exit cpu time accounting
was converted from assembly to C. This introduced an reversed order of cpu
time accounting.
On cpu idle exit the current accounting happens with the following call
chain:
-> do_io_irq()/do_ext_irq()
-> irq_enter_rcu()
-> account_hardirq_enter()
-> vtime_account_irq()
-> vtime_account_kernel()
vtime_account_kernel() accounts the passed cpu time since last_update_timer
as system time, and updates last_update_timer to the current cpu timer
value.
However the subsequent call of
-> account_idle_time_irq()
will incorrectly subtract passed cpu time from timer_idle_enter to the
updated last_update_timer value from system_timer. Then last_update_timer
is updated to a sys_enter_timer, which means that last_update_timer goes
back in time.
Subsequently account_hardirq_exit() will account too much cpu time as
hardirq time. The sum of all accounted cpu times is still correct, however
some cpu time which was previously accounted as system time is now
accounted as hardirq time, plus there is the oddity that last_update_timer
goes back in time.
Restore previous behavior by extracting cpu time accounting code from
account_idle_time_irq() into a new update_timer_idle() function and call it
before irq_enter_rcu().
Fixes: 56e62a737028 ("s390: convert to generic entry") [1]
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/s390/include/asm/idle.h | 1 +
arch/s390/kernel/idle.c | 13 +++++++++----
arch/s390/kernel/irq.c | 10 ++++++++--
3 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/arch/s390/include/asm/idle.h b/arch/s390/include/asm/idle.h
index 09f763b9eb40a..133059d9a949c 100644
--- a/arch/s390/include/asm/idle.h
+++ b/arch/s390/include/asm/idle.h
@@ -23,5 +23,6 @@ extern struct device_attribute dev_attr_idle_count;
extern struct device_attribute dev_attr_idle_time_us;
void psw_idle(struct s390_idle_data *data, unsigned long psw_mask);
+void update_timer_idle(void);
#endif /* _S390_IDLE_H */
diff --git a/arch/s390/kernel/idle.c b/arch/s390/kernel/idle.c
index 39cb8d0ae3480..0f9e53f0a0686 100644
--- a/arch/s390/kernel/idle.c
+++ b/arch/s390/kernel/idle.c
@@ -21,11 +21,10 @@
static DEFINE_PER_CPU(struct s390_idle_data, s390_idle);
-void account_idle_time_irq(void)
+void update_timer_idle(void)
{
struct s390_idle_data *idle = this_cpu_ptr(&s390_idle);
struct lowcore *lc = get_lowcore();
- unsigned long idle_time;
u64 cycles_new[8];
int i;
@@ -35,13 +34,19 @@ void account_idle_time_irq(void)
this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]);
}
- idle_time = lc->int_clock - idle->clock_idle_enter;
-
lc->steal_timer += idle->clock_idle_enter - lc->last_update_clock;
lc->last_update_clock = lc->int_clock;
lc->system_timer += lc->last_update_timer - idle->timer_idle_enter;
lc->last_update_timer = lc->sys_enter_timer;
+}
+
+void account_idle_time_irq(void)
+{
+ struct s390_idle_data *idle = this_cpu_ptr(&s390_idle);
+ unsigned long idle_time;
+
+ idle_time = get_lowcore()->int_clock - idle->clock_idle_enter;
/* Account time spent with enabled wait psw loaded as idle time. */
WRITE_ONCE(idle->idle_time, READ_ONCE(idle->idle_time) + idle_time);
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c
index bdf9c7cb5685b..080e9285b3379 100644
--- a/arch/s390/kernel/irq.c
+++ b/arch/s390/kernel/irq.c
@@ -146,6 +146,10 @@ void noinstr do_io_irq(struct pt_regs *regs)
struct pt_regs *old_regs = set_irq_regs(regs);
bool from_idle;
+ from_idle = test_and_clear_cpu_flag(CIF_ENABLED_WAIT);
+ if (from_idle)
+ update_timer_idle();
+
irq_enter_rcu();
if (user_mode(regs)) {
@@ -154,7 +158,6 @@ void noinstr do_io_irq(struct pt_regs *regs)
current->thread.last_break = regs->last_break;
}
- from_idle = test_and_clear_cpu_flag(CIF_ENABLED_WAIT);
if (from_idle)
account_idle_time_irq();
@@ -182,6 +185,10 @@ void noinstr do_ext_irq(struct pt_regs *regs)
struct pt_regs *old_regs = set_irq_regs(regs);
bool from_idle;
+ from_idle = test_and_clear_cpu_flag(CIF_ENABLED_WAIT);
+ if (from_idle)
+ update_timer_idle();
+
irq_enter_rcu();
if (user_mode(regs)) {
@@ -194,7 +201,6 @@ void noinstr do_ext_irq(struct pt_regs *regs)
regs->int_parm = get_lowcore()->ext_params;
regs->int_parm_long = get_lowcore()->ext_params2;
- from_idle = test_and_clear_cpu_flag(CIF_ENABLED_WAIT);
if (from_idle)
account_idle_time_irq();
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 061/311] s390/vtime: Fix virtual timer forwarding
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (59 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 060/311] s390/idle: Fix cpu idle exit cpu time accounting Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 062/311] s390/kexec: Disable stack protector in s390_reset_system() Sasha Levin
` (263 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Heiko Carstens, Sven Schnelle, Vasily Gorbik, Sasha Levin
From: Heiko Carstens <hca@linux.ibm.com>
[ Upstream commit dbc0fb35679ed5d0adecf7d02137ac2c77244b3b ]
Since delayed accounting of system time [1] the virtual timer is
forwarded by do_account_vtime() but also vtime_account_kernel(),
vtime_account_softirq(), and vtime_account_hardirq(). This leads
to double accounting of system, guest, softirq, and hardirq time.
Remove accounting from the vtime_account*() family to restore old behavior.
There is only one user of the vtimer interface, which might explain
why nobody noticed this so far.
Fixes: b7394a5f4ce9 ("sched/cputime, s390: Implement delayed accounting of system time") [1]
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/s390/kernel/vtime.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index 234a0ba305108..122d30b104401 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -225,10 +225,6 @@ static u64 vtime_delta(void)
return timer - lc->last_update_timer;
}
-/*
- * Update process times based on virtual cpu times stored by entry.S
- * to the lowcore fields user_timer, system_timer & steal_clock.
- */
void vtime_account_kernel(struct task_struct *tsk)
{
struct lowcore *lc = get_lowcore();
@@ -238,27 +234,17 @@ void vtime_account_kernel(struct task_struct *tsk)
lc->guest_timer += delta;
else
lc->system_timer += delta;
-
- virt_timer_forward(delta);
}
EXPORT_SYMBOL_GPL(vtime_account_kernel);
void vtime_account_softirq(struct task_struct *tsk)
{
- u64 delta = vtime_delta();
-
- get_lowcore()->softirq_timer += delta;
-
- virt_timer_forward(delta);
+ get_lowcore()->softirq_timer += vtime_delta();
}
void vtime_account_hardirq(struct task_struct *tsk)
{
- u64 delta = vtime_delta();
-
- get_lowcore()->hardirq_timer += delta;
-
- virt_timer_forward(delta);
+ get_lowcore()->hardirq_timer += vtime_delta();
}
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 062/311] s390/kexec: Disable stack protector in s390_reset_system()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (60 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 061/311] s390/vtime: Fix virtual timer forwarding Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 063/311] arm64: io: Rename ioremap_prot() to __ioremap_prot() Sasha Levin
` (262 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Vasily Gorbik, Nikita Dubrovskii, Heiko Carstens,
Alexander Gordeev, Sasha Levin
From: Vasily Gorbik <gor@linux.ibm.com>
[ Upstream commit 1623a554c68f352c17d0a358bc62580dc187f06b ]
s390_reset_system() calls set_prefix(0), which switches back to the
absolute lowcore. At that point the stack protector canary no longer
matches the canary from the lowcore the function was entered with, so
the stack check fails.
Mark s390_reset_system() __no_stack_protector. This is safe here since
its callers (__do_machine_kdump() and __do_machine_kexec()) are
effectively no-return and fall back to disabled_wait() on failure.
Fixes: f5730d44e05e ("s390: Add stackprotector support")
Reported-by: Nikita Dubrovskii <nikita@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/s390/kernel/ipl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index dcdc7e2748486..049c557c452ff 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -2377,7 +2377,7 @@ void __init setup_ipl(void)
atomic_notifier_chain_register(&panic_notifier_list, &on_panic_nb);
}
-void s390_reset_system(void)
+void __no_stack_protector s390_reset_system(void)
{
/* Disable prefixing */
set_prefix(0);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 063/311] arm64: io: Rename ioremap_prot() to __ioremap_prot()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (61 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 062/311] s390/kexec: Disable stack protector in s390_reset_system() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 064/311] arm64: io: Extract user memory type in ioremap_prot() Sasha Levin
` (261 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Will Deacon, Zeng Heng, Jinjiang Tu, Catalin Marinas, Sasha Levin
From: Will Deacon <will@kernel.org>
[ Upstream commit f6bf47ab32e0863df50f5501d207dcdddb7fc507 ]
Rename our ioremap_prot() implementation to __ioremap_prot() and convert
all arch-internal callers over to the new function.
ioremap_prot() remains as a #define to __ioremap_prot() for
generic_access_phys() and will be subsequently extended to handle user
permissions in 'prot'.
Cc: Zeng Heng <zengheng4@huawei.com>
Cc: Jinjiang Tu <tujinjiang@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Stable-dep-of: 8f098037139b ("arm64: io: Extract user memory type in ioremap_prot()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/include/asm/io.h | 11 ++++++-----
arch/arm64/kernel/acpi.c | 2 +-
arch/arm64/mm/ioremap.c | 6 +++---
3 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index 83e03abbb2ca9..cd2fddfe814ac 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -264,19 +264,20 @@ __iowrite64_copy(void __iomem *to, const void *from, size_t count)
typedef int (*ioremap_prot_hook_t)(phys_addr_t phys_addr, size_t size,
pgprot_t *prot);
int arm64_ioremap_prot_hook_register(const ioremap_prot_hook_t hook);
+void __iomem *__ioremap_prot(phys_addr_t phys, size_t size, pgprot_t prot);
-#define ioremap_prot ioremap_prot
+#define ioremap_prot __ioremap_prot
#define _PAGE_IOREMAP PROT_DEVICE_nGnRE
#define ioremap_wc(addr, size) \
- ioremap_prot((addr), (size), __pgprot(PROT_NORMAL_NC))
+ __ioremap_prot((addr), (size), __pgprot(PROT_NORMAL_NC))
#define ioremap_np(addr, size) \
- ioremap_prot((addr), (size), __pgprot(PROT_DEVICE_nGnRnE))
+ __ioremap_prot((addr), (size), __pgprot(PROT_DEVICE_nGnRnE))
#define ioremap_encrypted(addr, size) \
- ioremap_prot((addr), (size), PAGE_KERNEL)
+ __ioremap_prot((addr), (size), PAGE_KERNEL)
/*
* io{read,write}{16,32,64}be() macros
@@ -297,7 +298,7 @@ static inline void __iomem *ioremap_cache(phys_addr_t addr, size_t size)
if (pfn_is_map_memory(__phys_to_pfn(addr)))
return (void __iomem *)__phys_to_virt(addr);
- return ioremap_prot(addr, size, __pgprot(PROT_NORMAL));
+ return __ioremap_prot(addr, size, __pgprot(PROT_NORMAL));
}
/*
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index af90128cfed56..a9d884fd1d001 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -377,7 +377,7 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
prot = __acpi_get_writethrough_mem_attribute();
}
}
- return ioremap_prot(phys, size, prot);
+ return __ioremap_prot(phys, size, prot);
}
/*
diff --git a/arch/arm64/mm/ioremap.c b/arch/arm64/mm/ioremap.c
index 10e246f112710..1e4794a2af7d6 100644
--- a/arch/arm64/mm/ioremap.c
+++ b/arch/arm64/mm/ioremap.c
@@ -14,8 +14,8 @@ int arm64_ioremap_prot_hook_register(ioremap_prot_hook_t hook)
return 0;
}
-void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
- pgprot_t pgprot)
+void __iomem *__ioremap_prot(phys_addr_t phys_addr, size_t size,
+ pgprot_t pgprot)
{
unsigned long last_addr = phys_addr + size - 1;
@@ -38,7 +38,7 @@ void __iomem *ioremap_prot(phys_addr_t phys_addr, size_t size,
return generic_ioremap_prot(phys_addr, size, pgprot);
}
-EXPORT_SYMBOL(ioremap_prot);
+EXPORT_SYMBOL(__ioremap_prot);
/*
* Must be called after early_fixmap_init
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 064/311] arm64: io: Extract user memory type in ioremap_prot()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (62 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 063/311] arm64: io: Rename ioremap_prot() to __ioremap_prot() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 065/311] PCI: dwc: ep: Refresh MSI Message Address cache on change Sasha Levin
` (260 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Will Deacon, Zeng Heng, Jinjiang Tu, Catalin Marinas, Sasha Levin
From: Will Deacon <will@kernel.org>
[ Upstream commit 8f098037139b294050053123ab2bc0f819d08932 ]
The only caller of ioremap_prot() outside of the generic ioremap()
implementation is generic_access_phys(), which passes a 'pgprot_t' value
determined from the user mapping of the target 'pfn' being accessed by
the kernel. On arm64, the 'pgprot_t' contains all of the non-address
bits from the pte, including the permission controls, and so we end up
returning a new user mapping from ioremap_prot() which faults when
accessed from the kernel on systems with PAN:
| Unable to handle kernel read from unreadable memory at virtual address ffff80008ea89000
| ...
| Call trace:
| __memcpy_fromio+0x80/0xf8
| generic_access_phys+0x20c/0x2b8
| __access_remote_vm+0x46c/0x5b8
| access_remote_vm+0x18/0x30
| environ_read+0x238/0x3e8
| vfs_read+0xe4/0x2b0
| ksys_read+0xcc/0x178
| __arm64_sys_read+0x4c/0x68
Extract only the memory type from the user 'pgprot_t' in ioremap_prot()
and assert that we're being passed a user mapping, to protect us against
any changes in future that may require additional handling. To avoid
falsely flagging users of ioremap(), provide our own ioremap() macro
which simply wraps __ioremap_prot().
Cc: Zeng Heng <zengheng4@huawei.com>
Cc: Jinjiang Tu <tujinjiang@huawei.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Fixes: 893dea9ccd08 ("arm64: Add HAVE_IOREMAP_PROT support")
Reported-by: Jinjiang Tu <tujinjiang@huawei.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/include/asm/io.h | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
index cd2fddfe814ac..8cbd1e96fd50b 100644
--- a/arch/arm64/include/asm/io.h
+++ b/arch/arm64/include/asm/io.h
@@ -266,10 +266,23 @@ typedef int (*ioremap_prot_hook_t)(phys_addr_t phys_addr, size_t size,
int arm64_ioremap_prot_hook_register(const ioremap_prot_hook_t hook);
void __iomem *__ioremap_prot(phys_addr_t phys, size_t size, pgprot_t prot);
-#define ioremap_prot __ioremap_prot
+static inline void __iomem *ioremap_prot(phys_addr_t phys, size_t size,
+ pgprot_t user_prot)
+{
+ pgprot_t prot;
+ ptdesc_t user_prot_val = pgprot_val(user_prot);
+
+ if (WARN_ON_ONCE(!(user_prot_val & PTE_USER)))
+ return NULL;
-#define _PAGE_IOREMAP PROT_DEVICE_nGnRE
+ prot = __pgprot_modify(PAGE_KERNEL, PTE_ATTRINDX_MASK,
+ user_prot_val & PTE_ATTRINDX_MASK);
+ return __ioremap_prot(phys, size, prot);
+}
+#define ioremap_prot ioremap_prot
+#define ioremap(addr, size) \
+ __ioremap_prot((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
#define ioremap_wc(addr, size) \
__ioremap_prot((addr), (size), __pgprot(PROT_NORMAL_NC))
#define ioremap_np(addr, size) \
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 065/311] PCI: dwc: ep: Refresh MSI Message Address cache on change
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (63 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 064/311] arm64: io: Extract user memory type in ioremap_prot() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 066/311] PCI: dwc: ep: Flush MSI-X write before unmapping its ATU entry Sasha Levin
` (259 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Niklas Cassel, Bjorn Helgaas, Shin'ichiro Kawasaki,
Koichiro Den, Manivannan Sadhasivam, Sasha Levin
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 468711a40d5dfc01bf0a24c1981246a2c93ac405 ]
Endpoint drivers use dw_pcie_ep_raise_msi_irq() to raise MSI interrupts to
the host. After 8719c64e76bf ("PCI: dwc: ep: Cache MSI outbound iATU
mapping"), dw_pcie_ep_raise_msi_irq() caches the Message Address from the
MSI Capability in ep->msi_msg_addr. But that Message Address is controlled
by the host, and it may change. For example, if:
- firmware on the host configures the Message Address and triggers an
MSI,
- a driver on the Endpoint raises the MSI via dw_pcie_ep_raise_msi_irq(),
which caches the Message Address,
- a kernel on the host reconfigures the Message Address and the host
kernel driver triggers another MSI,
dw_pcie_ep_raise_msi_irq() notices that the Message Address no longer
matches the cached ep->msi_msg_addr, warns about it, and returns error
instead of raising the MSI. The host kernel may hang because it never
receives the MSI.
This was seen with the nvmet_pci_epf_driver: the host UEFI performs NVMe
commands, e.g. Identify Controller to get the name of the controller,
nvmet-pci-epf posts the completion queue entry and raises an IRQ using
dw_pcie_ep_raise_msi_irq(). When the host boots Linux, we see a
WARN_ON_ONCE() from dw_pcie_ep_raise_msi_irq(), and the host kernel hangs
because the nvme driver never gets an IRQ.
Remove the warning when dw_pcie_ep_raise_msi_irq() notices that Message
Address has changed, remap using the new address, and update the
ep->msi_msg_addr cache.
Fixes: 8719c64e76bf ("PCI: dwc: ep: Cache MSI outbound iATU mapping")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tested-by: Koichiro Den <den@valinux.co.jp>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20260210181225.3926165-2-cassel@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../pci/controller/dwc/pcie-designware-ep.c | 22 +++++++++++--------
1 file changed, 13 insertions(+), 9 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index 59fd6ebf01489..77f27295b0a80 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -904,6 +904,19 @@ int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no,
* supported, so we avoid reprogramming the region on every MSI,
* specifically unmapping immediately after writel().
*/
+ if (ep->msi_iatu_mapped && (ep->msi_msg_addr != msg_addr ||
+ ep->msi_map_size != map_size)) {
+ /*
+ * The host changed the MSI target address or the required
+ * mapping size changed. Reprogramming the iATU when there are
+ * operations in flight is unsafe on this controller. However,
+ * there is no unified way to check if we have operations in
+ * flight, thus we don't know if we should WARN() or not.
+ */
+ dw_pcie_ep_unmap_addr(epc, func_no, 0, ep->msi_mem_phys);
+ ep->msi_iatu_mapped = false;
+ }
+
if (!ep->msi_iatu_mapped) {
ret = dw_pcie_ep_map_addr(epc, func_no, 0,
ep->msi_mem_phys, msg_addr,
@@ -914,15 +927,6 @@ int dw_pcie_ep_raise_msi_irq(struct dw_pcie_ep *ep, u8 func_no,
ep->msi_iatu_mapped = true;
ep->msi_msg_addr = msg_addr;
ep->msi_map_size = map_size;
- } else if (WARN_ON_ONCE(ep->msi_msg_addr != msg_addr ||
- ep->msi_map_size != map_size)) {
- /*
- * The host changed the MSI target address or the required
- * mapping size changed. Reprogramming the iATU at runtime is
- * unsafe on this controller, so bail out instead of trying to
- * update the existing region.
- */
- return -EINVAL;
}
writel(msg_data | (interrupt_num - 1), ep->msi_mem + offset);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 066/311] PCI: dwc: ep: Flush MSI-X write before unmapping its ATU entry
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (64 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 065/311] PCI: dwc: ep: Refresh MSI Message Address cache on change Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 067/311] drm/amdgpu/userq: Do not allow userspace to trivially triger kernel warnings Sasha Levin
` (258 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Niklas Cassel, Bjorn Helgaas, Frank Li, Sasha Levin
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit c22533c66ccae10511ad6a7afc34bb26c47577e3 ]
Endpoint drivers use dw_pcie_ep_raise_msix_irq() to raise an MSI-X
interrupt to the host using a writel(), which generates a PCI posted write
transaction. There's no completion for posted writes, so the writel() may
return before the PCI write completes. dw_pcie_ep_raise_msix_irq() also
unmaps the outbound ATU entry used for the PCI write, so the write races
with the unmap.
If the PCI write loses the race with the ATU unmap, the write may corrupt
host memory or cause IOMMU errors, e.g., these when running fio with a
larger queue depth against nvmet-pci-epf:
arm-smmu-v3 fc900000.iommu: 0x0000010000000010
arm-smmu-v3 fc900000.iommu: 0x0000020000000000
arm-smmu-v3 fc900000.iommu: 0x000000090000f040
arm-smmu-v3 fc900000.iommu: 0x0000000000000000
arm-smmu-v3 fc900000.iommu: event: F_TRANSLATION client: 0000:01:00.0 sid: 0x100 ssid: 0x0 iova: 0x90000f040 ipa: 0x0
arm-smmu-v3 fc900000.iommu: unpriv data write s1 "Input address caused fault" stag: 0x0
Flush the write by performing a readl() of the same address to ensure that
the write has reached the destination before the ATU entry is unmapped.
The same problem was solved for dw_pcie_ep_raise_msi_irq() in commit
8719c64e76bf ("PCI: dwc: ep: Cache MSI outbound iATU mapping"), but there
it was solved by dedicating an outbound iATU only for MSI. We can't do the
same for MSI-X because each vector can have a different msg_addr and the
msg_addr may be changed while the vector is masked.
Fixes: beb4641a787d ("PCI: dwc: Add MSI-X callbacks handler")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260211175540.105677-2-cassel@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/dwc/pcie-designware-ep.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
index 77f27295b0a80..7ebb01fa5076f 100644
--- a/drivers/pci/controller/dwc/pcie-designware-ep.c
+++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
@@ -1013,6 +1013,9 @@ int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no,
writel(msg_data, ep->msi_mem + offset);
+ /* flush posted write before unmap */
+ readl(ep->msi_mem + offset);
+
dw_pcie_ep_unmap_addr(epc, func_no, 0, ep->msi_mem_phys);
return 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 067/311] drm/amdgpu/userq: Do not allow userspace to trivially triger kernel warnings
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (65 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 066/311] PCI: dwc: ep: Flush MSI-X write before unmapping its ATU entry Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 068/311] drm/amdgpu: Unlock a mutex before destroying it Sasha Levin
` (257 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Tvrtko Ursulin, Alex Deucher, Arunpravin Paneer Selvam,
Christian König, Sasha Levin
From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
[ Upstream commit 7b7d7693a55d606d700beb9549c9f7f0e5d9c24f ]
Userspace can either deliberately pass in the too small num_fences, or the
required number can legitimately grow between the two calls to the userq
wait ioctl. In both cases we do not want the emit the kernel warning
backtrace since nothing is wrong with the kernel and userspace will simply
get an errno reported back. So lets simply drop the WARN_ONs.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fixes: a292fdecd728 ("drm/amdgpu: Implement userqueue signal/wait IOCTL")
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 2c333ea579de6cc20ea7bc50e9595ef72863e65c)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
index 85e9edc1cb6ff..f61886745e33d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
@@ -830,7 +830,7 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data,
dma_resv_for_each_fence(&resv_cursor, gobj_read[i]->resv,
DMA_RESV_USAGE_READ, fence) {
- if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
+ if (num_fences >= wait_info->num_fences) {
r = -EINVAL;
goto free_fences;
}
@@ -847,7 +847,7 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data,
dma_resv_for_each_fence(&resv_cursor, gobj_write[i]->resv,
DMA_RESV_USAGE_WRITE, fence) {
- if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
+ if (num_fences >= wait_info->num_fences) {
r = -EINVAL;
goto free_fences;
}
@@ -871,7 +871,7 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data,
goto free_fences;
dma_fence_unwrap_for_each(f, &iter, fence) {
- if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
+ if (num_fences >= wait_info->num_fences) {
r = -EINVAL;
goto free_fences;
}
@@ -895,7 +895,7 @@ int amdgpu_userq_wait_ioctl(struct drm_device *dev, void *data,
if (r)
goto free_fences;
- if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) {
+ if (num_fences >= wait_info->num_fences) {
r = -EINVAL;
goto free_fences;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 068/311] drm/amdgpu: Unlock a mutex before destroying it
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (66 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 067/311] drm/amdgpu/userq: Do not allow userspace to trivially triger kernel warnings Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 069/311] drm/amdgpu: Fix locking bugs in error paths Sasha Levin
` (256 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Bart Van Assche, Alex Deucher, Christian König, Yang Wang,
Hawking Zhang, amd-gfx, Sasha Levin
From: Bart Van Assche <bvanassche@acm.org>
[ Upstream commit 5e0bcc7b88bcd081aaae6f481b10d9ab294fcb69 ]
Mutexes must be unlocked before these are destroyed. This has been detected
by the Clang thread-safety analyzer.
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Yang Wang <kevinyang.wang@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Fixes: f5e4cc8461c4 ("drm/amdgpu: implement RAS ACA driver framework")
Reviewed-by: Yang Wang <kevinyang.wang@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 270258ba320beb99648dceffb67e86ac76786e55)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
index 9b31804491500..3f9b094e93a29 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c
@@ -641,6 +641,7 @@ static void aca_error_fini(struct aca_error *aerr)
aca_bank_error_remove(aerr, bank_error);
out_unlock:
+ mutex_unlock(&aerr->lock);
mutex_destroy(&aerr->lock);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 069/311] drm/amdgpu: Fix locking bugs in error paths
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (67 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 068/311] drm/amdgpu: Unlock a mutex before destroying it Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 070/311] drm/amdgpu: Fix error handling in slot reset Sasha Levin
` (255 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Bart Van Assche, Alex Deucher, Christian König, YiPeng Chai,
Hawking Zhang, amd-gfx, Sasha Levin
From: Bart Van Assche <bvanassche@acm.org>
[ Upstream commit 480ad5f6ead4a47b969aab6618573cd6822bb6a4 ]
Do not unlock psp->ras_context.mutex if it has not been locked. This has
been detected by the Clang thread-safety analyzer.
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: YiPeng Chai <YiPeng.Chai@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Fixes: b3fb79cda568 ("drm/amdgpu: add mutex to protect ras shared memory")
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6fa01b4335978051d2cd80841728fd63cc597970)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
index 6e8aad91bcd30..0d3c18f04ac36 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
@@ -332,13 +332,13 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
if (!context || !context->initialized) {
dev_err(adev->dev, "TA is not initialized\n");
ret = -EINVAL;
- goto err_free_shared_buf;
+ goto free_shared_buf;
}
if (!psp->ta_funcs || !psp->ta_funcs->fn_ta_invoke) {
dev_err(adev->dev, "Unsupported function to invoke TA\n");
ret = -EOPNOTSUPP;
- goto err_free_shared_buf;
+ goto free_shared_buf;
}
context->session_id = ta_id;
@@ -346,7 +346,7 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
mutex_lock(&psp->ras_context.mutex);
ret = prep_ta_mem_context(&context->mem_context, shared_buf, shared_buf_len);
if (ret)
- goto err_free_shared_buf;
+ goto unlock;
ret = psp_fn_ta_invoke(psp, cmd_id);
if (ret || context->resp_status) {
@@ -354,15 +354,17 @@ static ssize_t ta_if_invoke_debugfs_write(struct file *fp, const char *buf, size
ret, context->resp_status);
if (!ret) {
ret = -EINVAL;
- goto err_free_shared_buf;
+ goto unlock;
}
}
if (copy_to_user((char *)&buf[copy_pos], context->mem_context.shared_buf, shared_buf_len))
ret = -EFAULT;
-err_free_shared_buf:
+unlock:
mutex_unlock(&psp->ras_context.mutex);
+
+free_shared_buf:
kfree(shared_buf);
return ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 070/311] drm/amdgpu: Fix error handling in slot reset
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (68 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 069/311] drm/amdgpu: Fix locking bugs in error paths Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 071/311] ALSA: hda: cs35l56: Fix signedness error in cs35l56_hda_posture_put() Sasha Levin
` (254 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Lijo Lazar, Ce Sun, Alex Deucher, Sasha Levin
From: Lijo Lazar <lijo.lazar@amd.com>
[ Upstream commit b57c4ec98c17789136a4db948aec6daadceb5024 ]
If the device has not recovered after slot reset is called, it goes to
out label for error handling. There it could make decision based on
uninitialized hive pointer and could result in accessing an uninitialized
list.
Initialize the list and hive properly so that it handles the error
situation and also releases the reset domain lock which is acquired
during error_detected callback.
Fixes: 732c6cefc1ec ("drm/amdgpu: Replace tmp_adev with hive in amdgpu_pci_slot_reset")
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Ce Sun <cesun102@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit bb71362182e59caa227e4192da5a612b09349696)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 09f9d82e572da..ad5a3235a75f1 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -7203,6 +7203,15 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev)
dev_info(adev->dev, "PCI error: slot reset callback!!\n");
memset(&reset_context, 0, sizeof(reset_context));
+ INIT_LIST_HEAD(&device_list);
+ hive = amdgpu_get_xgmi_hive(adev);
+ if (hive) {
+ mutex_lock(&hive->hive_lock);
+ list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head)
+ list_add_tail(&tmp_adev->reset_list, &device_list);
+ } else {
+ list_add_tail(&adev->reset_list, &device_list);
+ }
if (adev->pcie_reset_ctx.swus)
link_dev = adev->pcie_reset_ctx.swus;
@@ -7243,19 +7252,13 @@ pci_ers_result_t amdgpu_pci_slot_reset(struct pci_dev *pdev)
reset_context.reset_req_dev = adev;
set_bit(AMDGPU_NEED_FULL_RESET, &reset_context.flags);
set_bit(AMDGPU_SKIP_COREDUMP, &reset_context.flags);
- INIT_LIST_HEAD(&device_list);
- hive = amdgpu_get_xgmi_hive(adev);
if (hive) {
- mutex_lock(&hive->hive_lock);
reset_context.hive = hive;
- list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) {
+ list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head)
tmp_adev->pcie_reset_ctx.in_link_reset = true;
- list_add_tail(&tmp_adev->reset_list, &device_list);
- }
} else {
set_bit(AMDGPU_SKIP_HW_RESET, &reset_context.flags);
- list_add_tail(&adev->reset_list, &device_list);
}
r = amdgpu_device_asic_reset(adev, &device_list, &reset_context);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 071/311] ALSA: hda: cs35l56: Fix signedness error in cs35l56_hda_posture_put()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (69 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 070/311] drm/amdgpu: Fix error handling in slot reset Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 072/311] btrfs: free pages on error in btrfs_uring_read_extent() Sasha Levin
` (253 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable; +Cc: Richard Fitzgerald, Takashi Iwai, Sasha Levin
From: Richard Fitzgerald <rf@opensource.cirrus.com>
[ Upstream commit 003ce8c9b2ca28fbb4860651e76fb1c9a91f2ea1 ]
In cs35l56_hda_posture_put() assign ucontrol->value.integer.value[0] to
a long instead of an unsigned long. ucontrol->value.integer.value[0] is
a long.
This fixes the sparse warning:
sound/hda/codecs/side-codecs/cs35l56_hda.c:256:20: warning: unsigned value
that used to be signed checked against zero?
sound/hda/codecs/side-codecs/cs35l56_hda.c:252:29: signed value source
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 73cfbfa9caea8 ("ALSA: hda/cs35l56: Add driver for Cirrus Logic CS35L56 amplifier")
Link: https://patch.msgid.link/20260226111728.1700431-1-rf@opensource.cirrus.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/hda/codecs/side-codecs/cs35l56_hda.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/hda/codecs/side-codecs/cs35l56_hda.c b/sound/hda/codecs/side-codecs/cs35l56_hda.c
index f7ba92e119578..32d734bf2fdf8 100644
--- a/sound/hda/codecs/side-codecs/cs35l56_hda.c
+++ b/sound/hda/codecs/side-codecs/cs35l56_hda.c
@@ -249,7 +249,7 @@ static int cs35l56_hda_posture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct cs35l56_hda *cs35l56 = snd_kcontrol_chip(kcontrol);
- unsigned long pos = ucontrol->value.integer.value[0];
+ long pos = ucontrol->value.integer.value[0];
bool changed;
int ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 072/311] btrfs: free pages on error in btrfs_uring_read_extent()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (70 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 071/311] ALSA: hda: cs35l56: Fix signedness error in cs35l56_hda_posture_put() Sasha Levin
@ 2026-03-10 11:01 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 073/311] btrfs: fix error message order of parameters in btrfs_delete_delayed_dir_index() Sasha Levin
` (252 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:01 UTC (permalink / raw)
To: patches, stable
Cc: Miquel Sabaté Solà, Filipe Manana, David Sterba,
Sasha Levin
From: Miquel Sabaté Solà <mssola@mssola.com>
[ Upstream commit 3f501412f2079ca14bf68a18d80a2b7a823f1f64 ]
In this function the 'pages' object is never freed in the hopes that it is
picked up by btrfs_uring_read_finished() whenever that executes in the
future. But that's just the happy path. Along the way previous
allocations might have gone wrong, or we might not get -EIOCBQUEUED from
btrfs_encoded_read_regular_fill_pages(). In all these cases, we go to a
cleanup section that frees all memory allocated by this function without
assuming any deferred execution, and this also needs to happen for the
'pages' allocation.
Fixes: 34310c442e17 ("btrfs: add io_uring command for encoded reads (ENCODED_READ ioctl)")
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/ioctl.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index acb484546b1da..c9284ce6c6e78 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -4661,7 +4661,7 @@ static int btrfs_uring_read_extent(struct kiocb *iocb, struct iov_iter *iter,
{
struct btrfs_inode *inode = BTRFS_I(file_inode(iocb->ki_filp));
struct extent_io_tree *io_tree = &inode->io_tree;
- struct page **pages;
+ struct page **pages = NULL;
struct btrfs_uring_priv *priv = NULL;
unsigned long nr_pages;
int ret;
@@ -4719,6 +4719,11 @@ static int btrfs_uring_read_extent(struct kiocb *iocb, struct iov_iter *iter,
btrfs_unlock_extent(io_tree, start, lockend, &cached_state);
btrfs_inode_unlock(inode, BTRFS_ILOCK_SHARED);
kfree(priv);
+ for (int i = 0; i < nr_pages; i++) {
+ if (pages[i])
+ __free_page(pages[i]);
+ }
+ kfree(pages);
return ret;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 073/311] btrfs: fix error message order of parameters in btrfs_delete_delayed_dir_index()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (71 preceding siblings ...)
2026-03-10 11:01 ` [PATCH 6.19 072/311] btrfs: free pages on error in btrfs_uring_read_extent() Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 074/311] btrfs: fix incorrect key offset in error message in check_dev_extent_item() Sasha Levin
` (251 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Mark Harmstone, Filipe Manana, David Sterba, Sasha Levin
From: Mark Harmstone <mark@harmstone.com>
[ Upstream commit 3cf0f35779d364cf2003c617bb7f3f3e41023372 ]
Fix the error message in btrfs_delete_delayed_dir_index() if
__btrfs_add_delayed_item() fails: the message says root, inode, index,
error, but we're actually passing index, root, inode, error.
Fixes: adc1ef55dc04 ("btrfs: add details to error messages at btrfs_delete_delayed_dir_index()")
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/delayed-inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c
index 4b7d9015e0dad..7e3d294a6dced 100644
--- a/fs/btrfs/delayed-inode.c
+++ b/fs/btrfs/delayed-inode.c
@@ -1673,7 +1673,7 @@ int btrfs_delete_delayed_dir_index(struct btrfs_trans_handle *trans,
if (unlikely(ret)) {
btrfs_err(trans->fs_info,
"failed to add delayed dir index item, root: %llu, inode: %llu, index: %llu, error: %d",
- index, btrfs_root_id(node->root), node->inode_id, ret);
+ btrfs_root_id(node->root), node->inode_id, index, ret);
btrfs_delayed_item_release_metadata(dir->root, item);
btrfs_release_delayed_item(item);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 074/311] btrfs: fix incorrect key offset in error message in check_dev_extent_item()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (72 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 073/311] btrfs: fix error message order of parameters in btrfs_delete_delayed_dir_index() Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 075/311] btrfs: fix objectid value in error message in check_extent_data_ref() Sasha Levin
` (250 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Mark Harmstone, Chris Mason, Qu Wenruo, David Sterba, Sasha Levin
From: Mark Harmstone <mark@harmstone.com>
[ Upstream commit 511dc8912ae3e929c1a182f5e6b2326516fd42a0 ]
Fix the error message in check_dev_extent_item(), when an overlapping
stripe is encountered. For dev extents, objectid is the disk number and
offset the physical address, so prev_key->objectid should actually be
prev_key->offset.
(I can't take any credit for this one - this was discovered by Chris and
his friend Claude.)
Reported-by: Chris Mason <clm@fb.com>
Fixes: 008e2512dc56 ("btrfs: tree-checker: add dev extent item checks")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/tree-checker.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index c21c21adf61ed..6d4dceb144373 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -1893,7 +1893,7 @@ static int check_dev_extent_item(const struct extent_buffer *leaf,
if (unlikely(prev_key->offset + prev_len > key->offset)) {
generic_err(leaf, slot,
"dev extent overlap, prev offset %llu len %llu current offset %llu",
- prev_key->objectid, prev_len, key->offset);
+ prev_key->offset, prev_len, key->offset);
return -EUCLEAN;
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 075/311] btrfs: fix objectid value in error message in check_extent_data_ref()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (73 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 074/311] btrfs: fix incorrect key offset in error message in check_dev_extent_item() Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 076/311] btrfs: fix warning in scrub_verify_one_metadata() Sasha Levin
` (249 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Mark Harmstone, Qu Wenruo, David Sterba, Sasha Levin
From: Mark Harmstone <mark@harmstone.com>
[ Upstream commit a10172780526c2002e062102ad4f2aabac495889 ]
Fix a copy-paste error in check_extent_data_ref(): we're printing root
as in the message above, we should be printing objectid.
Fixes: f333a3c7e832 ("btrfs: tree-checker: validate dref root and objectid")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/tree-checker.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index 6d4dceb144373..12d6ae49bc078 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -1712,7 +1712,7 @@ static int check_extent_data_ref(struct extent_buffer *leaf,
objectid > BTRFS_LAST_FREE_OBJECTID)) {
extent_err(leaf, slot,
"invalid extent data backref objectid value %llu",
- root);
+ objectid);
return -EUCLEAN;
}
if (unlikely(!IS_ALIGNED(offset, leaf->fs_info->sectorsize))) {
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 076/311] btrfs: fix warning in scrub_verify_one_metadata()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (74 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 075/311] btrfs: fix objectid value in error message in check_extent_data_ref() Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 077/311] btrfs: print correct subvol num if active swapfile prevents deletion Sasha Levin
` (248 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Mark Harmstone, Qu Wenruo, David Sterba, Sasha Levin
From: Mark Harmstone <mark@harmstone.com>
[ Upstream commit 44e2fda66427a0442d8d2c0e6443256fb458ab6b ]
Commit b471965fdb2d ("btrfs: fix replace/scrub failure with
metadata_uuid") fixed the comparison in scrub_verify_one_metadata() to
use metadata_uuid rather than fsid, but left the warning as it was. Fix
it so it matches what we're doing.
Fixes: b471965fdb2d ("btrfs: fix replace/scrub failure with metadata_uuid")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/scrub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index a40ee41f42c68..4fc69b2d213a6 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -745,7 +745,7 @@ static void scrub_verify_one_metadata(struct scrub_stripe *stripe, int sector_nr
btrfs_warn_rl(fs_info,
"scrub: tree block %llu mirror %u has bad fsid, has %pU want %pU",
logical, stripe->mirror_num,
- header->fsid, fs_info->fs_devices->fsid);
+ header->fsid, fs_info->fs_devices->metadata_uuid);
return;
}
if (memcmp(header->chunk_tree_uuid, fs_info->chunk_tree_uuid,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 077/311] btrfs: print correct subvol num if active swapfile prevents deletion
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (75 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 076/311] btrfs: fix warning in scrub_verify_one_metadata() Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 078/311] btrfs: fix compat mask in error messages in btrfs_check_features() Sasha Levin
` (247 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Mark Harmstone, Qu Wenruo, Filipe Manana, David Sterba,
Sasha Levin
From: Mark Harmstone <mark@harmstone.com>
[ Upstream commit 1c7e9111f4e6d6d42bc47759c9af1ef91f03ac2c ]
Fix the error message in btrfs_delete_subvolume() if we can't delete a
subvolume because it has an active swapfile: we were printing the number
of the parent rather than the target.
Fixes: 60021bd754c6 ("btrfs: prevent subvol with swapfile from being deleted")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a2b5b440637e6..827554963a7c8 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4720,7 +4720,7 @@ int btrfs_delete_subvolume(struct btrfs_inode *dir, struct dentry *dentry)
spin_unlock(&dest->root_item_lock);
btrfs_warn(fs_info,
"attempt to delete subvolume %llu with active swapfile",
- btrfs_root_id(root));
+ btrfs_root_id(dest));
ret = -EPERM;
goto out_up_write;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 078/311] btrfs: fix compat mask in error messages in btrfs_check_features()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (76 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 077/311] btrfs: print correct subvol num if active swapfile prevents deletion Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 079/311] ALSA: usb: qcom: Correct parameter comment for uaudio_transfer_buffer_setup() Sasha Levin
` (246 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Mark Harmstone, Qu Wenruo, David Sterba, Sasha Levin
From: Mark Harmstone <mark@harmstone.com>
[ Upstream commit 587bb33b10bda645a1028c1737ad3992b3d7cf61 ]
Commit d7f67ac9a928 ("btrfs: relax block-group-tree feature dependency
checks") introduced a regression when it comes to handling unsupported
incompat or compat_ro flags. Beforehand we only printed the flags that
we didn't recognize, afterwards we printed them all, which is less
useful. Fix the error handling so it behaves like it used to.
Fixes: d7f67ac9a928 ("btrfs: relax block-group-tree feature dependency checks")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Mark Harmstone <mark@harmstone.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/disk-io.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 2833b44f4b4f2..6d2dcd023cc6f 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3150,7 +3150,7 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount)
if (incompat & ~BTRFS_FEATURE_INCOMPAT_SUPP) {
btrfs_err(fs_info,
"cannot mount because of unknown incompat features (0x%llx)",
- incompat);
+ incompat & ~BTRFS_FEATURE_INCOMPAT_SUPP);
return -EINVAL;
}
@@ -3182,7 +3182,7 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount)
if (compat_ro_unsupp && is_rw_mount) {
btrfs_err(fs_info,
"cannot mount read-write because of unknown compat_ro features (0x%llx)",
- compat_ro);
+ compat_ro_unsupp);
return -EINVAL;
}
@@ -3195,7 +3195,7 @@ int btrfs_check_features(struct btrfs_fs_info *fs_info, bool is_rw_mount)
!btrfs_test_opt(fs_info, NOLOGREPLAY)) {
btrfs_err(fs_info,
"cannot replay dirty log with unsupported compat_ro features (0x%llx), try rescue=nologreplay",
- compat_ro);
+ compat_ro_unsupp);
return -EINVAL;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 079/311] ALSA: usb: qcom: Correct parameter comment for uaudio_transfer_buffer_setup()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (77 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 078/311] btrfs: fix compat mask in error messages in btrfs_check_features() Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 080/311] mm/slab: pass __GFP_NOWARN to refill_sheaf() if fallback is available Sasha Levin
` (245 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Takashi Iwai, Sasha Levin
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 1d6452a0ce78cd3f4e48943b5ba21d273a658298 ]
At fixing the memory leak of xfer buffer, we forgot to update the
corresponding comment, too. This resulted in a kernel-doc warning
with W=1. Let's correct it.
Fixes: 5c7ef5001292 ("ALSA: qc_audio_offload: avoid leaking xfer_buf allocation")
Link: https://patch.msgid.link/20260226154414.1081568-4-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/usb/qcom/qc_audio_offload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/qcom/qc_audio_offload.c b/sound/usb/qcom/qc_audio_offload.c
index cfb30a195364a..297490f0f5874 100644
--- a/sound/usb/qcom/qc_audio_offload.c
+++ b/sound/usb/qcom/qc_audio_offload.c
@@ -1007,7 +1007,7 @@ static int enable_audio_stream(struct snd_usb_substream *subs,
/**
* uaudio_transfer_buffer_setup() - fetch and populate xfer buffer params
* @subs: usb substream
- * @xfer_buf: xfer buf to be allocated
+ * @xfer_buf_cpu: xfer buf to be allocated
* @xfer_buf_len: size of allocation
* @mem_info: QMI response info
*
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 080/311] mm/slab: pass __GFP_NOWARN to refill_sheaf() if fallback is available
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (78 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 079/311] ALSA: usb: qcom: Correct parameter comment for uaudio_transfer_buffer_setup() Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 081/311] ASoC: SDCA: Fix comments for sdca_irq_request() Sasha Levin
` (244 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Harry Yoo, Chris Bainbridge, Mikhail Gavrilov,
Vlastimil Babka (SUSE), Sasha Levin
From: Harry Yoo <harry.yoo@oracle.com>
[ Upstream commit 021ca6b670bebebc409d43845efcfe8c11c1dd54 ]
When refill_sheaf() is called, failing to refill the sheaf doesn't
necessarily mean the allocation will fail because a fallback path
might be available and serve the allocation request.
Suppress spurious warnings by passing __GFP_NOWARN along with
__GFP_NOMEMALLOC whenever a fallback path is available.
When the caller is alloc_full_sheaf() or __pcs_replace_empty_main(),
the kernel always falls back to the slowpath (__slab_alloc_node()).
For __prefill_sheaf_pfmemalloc(), the fallback path is available
only when gfp_pfmemalloc_allowed() returns true.
Reported-and-tested-by: Chris Bainbridge <chris.bainbridge@gmail.com>
Closes: https://lore.kernel.org/linux-mm/aZt2-oS9lkmwT7Ch@debian.local
Fixes: 1ce20c28eafd ("slab: handle pfmemalloc slabs properly with sheaves")
Link: https://lore.kernel.org/linux-mm/aZwSreGj9-HHdD-j@hyeyoo
Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
Link: https://patch.msgid.link/20260223133322.16705-1-harry.yoo@oracle.com
Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Signed-off-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/slub.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 889c2804bbfeb..b68db0f5a6374 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2715,7 +2715,7 @@ static struct slab_sheaf *alloc_full_sheaf(struct kmem_cache *s, gfp_t gfp)
if (!sheaf)
return NULL;
- if (refill_sheaf(s, sheaf, gfp | __GFP_NOMEMALLOC)) {
+ if (refill_sheaf(s, sheaf, gfp | __GFP_NOMEMALLOC | __GFP_NOWARN)) {
free_empty_sheaf(s, sheaf);
return NULL;
}
@@ -5092,7 +5092,7 @@ __pcs_replace_empty_main(struct kmem_cache *s, struct slub_percpu_sheaves *pcs,
return NULL;
if (empty) {
- if (!refill_sheaf(s, empty, gfp | __GFP_NOMEMALLOC)) {
+ if (!refill_sheaf(s, empty, gfp | __GFP_NOMEMALLOC | __GFP_NOWARN)) {
full = empty;
} else {
/*
@@ -5395,9 +5395,14 @@ EXPORT_SYMBOL(kmem_cache_alloc_node_noprof);
static int __prefill_sheaf_pfmemalloc(struct kmem_cache *s,
struct slab_sheaf *sheaf, gfp_t gfp)
{
- int ret = 0;
+ gfp_t gfp_nomemalloc;
+ int ret;
+
+ gfp_nomemalloc = gfp | __GFP_NOMEMALLOC;
+ if (gfp_pfmemalloc_allowed(gfp))
+ gfp_nomemalloc |= __GFP_NOWARN;
- ret = refill_sheaf(s, sheaf, gfp | __GFP_NOMEMALLOC);
+ ret = refill_sheaf(s, sheaf, gfp_nomemalloc);
if (likely(!ret || !gfp_pfmemalloc_allowed(gfp)))
return ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 081/311] ASoC: SDCA: Fix comments for sdca_irq_request()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (79 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 080/311] mm/slab: pass __GFP_NOWARN to refill_sheaf() if fallback is available Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 082/311] bpf, arm64: Force 8-byte alignment for JIT buffer to prevent atomic tearing Sasha Levin
` (243 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Takashi Iwai, Mark Brown, Sasha Levin
From: Takashi Iwai <tiwai@suse.de>
[ Upstream commit 71c1978ab6d2c6d48c31311855f1a85377c152ae ]
The kernel-doc comments for sdca_irq_request() contained some typos
that lead to build warnings with W=1. Let's correct them.
Fixes: b126394d9ec6 ("ASoC: SDCA: Generic interrupt support")
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260226154753.1083320-1-tiwai@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sdca/sdca_interrupts.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c
index ff3a7e405fdcb..49b675e601433 100644
--- a/sound/soc/sdca/sdca_interrupts.c
+++ b/sound/soc/sdca/sdca_interrupts.c
@@ -246,9 +246,9 @@ static int sdca_irq_request_locked(struct device *dev,
}
/**
- * sdca_request_irq - request an individual SDCA interrupt
+ * sdca_irq_request - request an individual SDCA interrupt
* @dev: Pointer to the struct device against which things should be allocated.
- * @interrupt_info: Pointer to the interrupt information structure.
+ * @info: Pointer to the interrupt information structure.
* @sdca_irq: SDCA interrupt position.
* @name: Name to be given to the IRQ.
* @handler: A callback thread function to be called for the IRQ.
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 082/311] bpf, arm64: Force 8-byte alignment for JIT buffer to prevent atomic tearing
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (80 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 081/311] ASoC: SDCA: Fix comments for sdca_irq_request() Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 083/311] bpf: Fix stack-out-of-bounds write in devmap Sasha Levin
` (242 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Fuad Tabba, Will Deacon, Alexei Starovoitov, Sasha Levin
From: Fuad Tabba <tabba@google.com>
[ Upstream commit ef06fd16d48704eac868441d98d4ef083d8f3d07 ]
struct bpf_plt contains a u64 target field. Currently, the BPF JIT
allocator requests an alignment of 4 bytes (sizeof(u32)) for the JIT
buffer.
Because the base address of the JIT buffer can be 4-byte aligned (e.g.,
ending in 0x4 or 0xc), the relative padding logic in build_plt() fails
to ensure that target lands on an 8-byte boundary.
This leads to two issues:
1. UBSAN reports misaligned-access warnings when dereferencing the
structure.
2. More critically, target is updated concurrently via WRITE_ONCE() in
bpf_arch_text_poke() while the JIT'd code executes ldr. On arm64,
64-bit loads/stores are only guaranteed to be single-copy atomic if
they are 64-bit aligned. A misaligned target risks a torn read,
causing the JIT to jump to a corrupted address.
Fix this by increasing the allocation alignment requirement to 8 bytes
(sizeof(u64)) in bpf_jit_binary_pack_alloc(). This anchors the base of
the JIT buffer to an 8-byte boundary, allowing the relative padding math
in build_plt() to correctly align the target field.
Fixes: b2ad54e1533e ("bpf, arm64: Implement bpf_arch_text_poke() for arm64")
Signed-off-by: Fuad Tabba <tabba@google.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20260226075525.233321-1-tabba@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/net/bpf_jit_comp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index 1d657bd3ce655..f9fcd699f2e94 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -2126,7 +2126,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
extable_offset = round_up(prog_size + PLT_TARGET_SIZE, extable_align);
image_size = extable_offset + extable_size;
ro_header = bpf_jit_binary_pack_alloc(image_size, &ro_image_ptr,
- sizeof(u32), &header, &image_ptr,
+ sizeof(u64), &header, &image_ptr,
jit_fill_hole);
if (!ro_header) {
prog = orig_prog;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 083/311] bpf: Fix stack-out-of-bounds write in devmap
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (81 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 082/311] bpf, arm64: Force 8-byte alignment for JIT buffer to prevent atomic tearing Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 084/311] selftests/bpf: Fix OOB read in dmabuf_collector Sasha Levin
` (241 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Kohei Enju, syzbot+10cc7f13760b31bd2e61,
Toke Høiland-Jørgensen, Alexei Starovoitov, Sasha Levin
From: Kohei Enju <kohei@enjuk.jp>
[ Upstream commit b7bf516c3ecd9a2aae2dc2635178ab87b734fef1 ]
get_upper_ifindexes() iterates over all upper devices and writes their
indices into an array without checking bounds.
Also the callers assume that the max number of upper devices is
MAX_NEST_DEV and allocate excluded_devices[1+MAX_NEST_DEV] on the stack,
but that assumption is not correct and the number of upper devices could
be larger than MAX_NEST_DEV (e.g., many macvlans), causing a
stack-out-of-bounds write.
Add a max parameter to get_upper_ifindexes() to avoid the issue.
When there are too many upper devices, return -EOVERFLOW and abort the
redirect.
To reproduce, create more than MAX_NEST_DEV(8) macvlans on a device with
an XDP program attached using BPF_F_BROADCAST | BPF_F_EXCLUDE_INGRESS.
Then send a packet to the device to trigger the XDP redirect path.
Reported-by: syzbot+10cc7f13760b31bd2e61@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/698c4ce3.050a0220.340abe.000b.GAE@google.com/T/
Fixes: aeea1b86f936 ("bpf, devmap: Exclude XDP broadcast to master device")
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Kohei Enju <kohei@enjuk.jp>
Link: https://lore.kernel.org/r/20260225053506.4738-1-kohei@enjuk.jp
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/devmap.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
index 2625601de76e9..2984e938f94dc 100644
--- a/kernel/bpf/devmap.c
+++ b/kernel/bpf/devmap.c
@@ -588,18 +588,22 @@ static inline bool is_ifindex_excluded(int *excluded, int num_excluded, int ifin
}
/* Get ifindex of each upper device. 'indexes' must be able to hold at
- * least MAX_NEST_DEV elements.
- * Returns the number of ifindexes added.
+ * least 'max' elements.
+ * Returns the number of ifindexes added, or -EOVERFLOW if there are too
+ * many upper devices.
*/
-static int get_upper_ifindexes(struct net_device *dev, int *indexes)
+static int get_upper_ifindexes(struct net_device *dev, int *indexes, int max)
{
struct net_device *upper;
struct list_head *iter;
int n = 0;
netdev_for_each_upper_dev_rcu(dev, upper, iter) {
+ if (n >= max)
+ return -EOVERFLOW;
indexes[n++] = upper->ifindex;
}
+
return n;
}
@@ -615,7 +619,11 @@ int dev_map_enqueue_multi(struct xdp_frame *xdpf, struct net_device *dev_rx,
int err;
if (exclude_ingress) {
- num_excluded = get_upper_ifindexes(dev_rx, excluded_devices);
+ num_excluded = get_upper_ifindexes(dev_rx, excluded_devices,
+ ARRAY_SIZE(excluded_devices) - 1);
+ if (num_excluded < 0)
+ return num_excluded;
+
excluded_devices[num_excluded++] = dev_rx->ifindex;
}
@@ -733,7 +741,11 @@ int dev_map_redirect_multi(struct net_device *dev, struct sk_buff *skb,
int err;
if (exclude_ingress) {
- num_excluded = get_upper_ifindexes(dev, excluded_devices);
+ num_excluded = get_upper_ifindexes(dev, excluded_devices,
+ ARRAY_SIZE(excluded_devices) - 1);
+ if (num_excluded < 0)
+ return num_excluded;
+
excluded_devices[num_excluded++] = dev->ifindex;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 084/311] selftests/bpf: Fix OOB read in dmabuf_collector
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (82 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 083/311] bpf: Fix stack-out-of-bounds write in devmap Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 085/311] sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag Sasha Levin
` (240 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: T.J. Mercier, Jerome Lee, Alexei Starovoitov, Sasha Levin
From: "T.J. Mercier" <tjmercier@google.com>
[ Upstream commit 6881af27f9ea0f5ca8f606f573ef5cc25ca31fe4 ]
Dmabuf name allocations can be less than DMA_BUF_NAME_LEN characters,
but bpf_probe_read_kernel always tries to read exactly that many bytes.
If a name is less than DMA_BUF_NAME_LEN characters,
bpf_probe_read_kernel will read past the end. bpf_probe_read_kernel_str
stops at the first NUL terminator so use it instead, like
iter_dmabuf_for_each already does.
Fixes: ae5d2c59ecd7 ("selftests/bpf: Add test for dmabuf_iter")
Reported-by: Jerome Lee <jaewookl@quicinc.com>
Signed-off-by: T.J. Mercier <tjmercier@google.com>
Link: https://lore.kernel.org/r/20260225003349.113746-1-tjmercier@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/bpf/progs/dmabuf_iter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/progs/dmabuf_iter.c b/tools/testing/selftests/bpf/progs/dmabuf_iter.c
index 13cdb11fdeb2b..9cbb7442646e5 100644
--- a/tools/testing/selftests/bpf/progs/dmabuf_iter.c
+++ b/tools/testing/selftests/bpf/progs/dmabuf_iter.c
@@ -48,7 +48,7 @@ int dmabuf_collector(struct bpf_iter__dmabuf *ctx)
/* Buffers are not required to be named */
if (pname) {
- if (bpf_probe_read_kernel(name, sizeof(name), pname))
+ if (bpf_probe_read_kernel_str(name, sizeof(name), pname) < 0)
return 1;
/* Name strings can be provided by userspace */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 085/311] sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (83 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 084/311] selftests/bpf: Fix OOB read in dmabuf_collector Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 086/311] spi: stm32: fix missing pointer assignment in case of dma chaining Sasha Levin
` (239 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: David Carlier, Tejun Heo, Sasha Levin
From: David Carlier <devnexen@gmail.com>
[ Upstream commit 749989b2d90ddc7dd253ad3b11a77cf882721acf ]
SCX_EFLAG_INITIALIZED is the sole member of enum scx_exit_flags with no
explicit value, so the compiler assigns it 0. This makes the bitwise OR
in scx_ops_init() a no-op:
sch->exit_info->flags |= SCX_EFLAG_INITIALIZED; /* |= 0 */
As a result, BPF schedulers cannot distinguish whether ops.init()
completed successfully by inspecting exit_info->flags.
Assign the value 1LLU << 0 so the flag is actually set.
Fixes: f3aec2adce8d ("sched_ext: Add SCX_EFLAG_INITIALIZED to indicate successful ops.init()")
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/ext_internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/ext_internal.h b/kernel/sched/ext_internal.h
index 386c677e4c9a0..11ebb744d8931 100644
--- a/kernel/sched/ext_internal.h
+++ b/kernel/sched/ext_internal.h
@@ -74,7 +74,7 @@ enum scx_exit_flags {
* info communication. The following flag indicates whether ops.init()
* finished successfully.
*/
- SCX_EFLAG_INITIALIZED,
+ SCX_EFLAG_INITIALIZED = 1LLU << 0,
};
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 086/311] spi: stm32: fix missing pointer assignment in case of dma chaining
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (84 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 085/311] sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 087/311] PCI: Correct PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 value Sasha Levin
` (238 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Alain Volmat, Antonio Quartulli, Mark Brown, Sasha Levin
From: Alain Volmat <alain.volmat@foss.st.com>
[ Upstream commit e96493229a6399e902062213c6381162464cdd50 ]
Commit c4f2c05ab029 ("spi: stm32: fix pointer-to-pointer variables usage")
introduced a regression since dma descriptors generated as part of the
stm32_spi_prepare_rx_dma_mdma_chaining function are not well propagated
to the caller function, leading to mdma-dma chaining being no more
functional.
Fixes: c4f2c05ab029 ("spi: stm32: fix pointer-to-pointer variables usage")
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Acked-by: Antonio Quartulli <antonio@mandelbit.com>
Link: https://patch.msgid.link/20260224-spi-stm32-chaining-fix-v1-1-5da7a4851b66@foss.st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spi/spi-stm32.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c
index 80986bd251d29..7a6ee93be9bd4 100644
--- a/drivers/spi/spi-stm32.c
+++ b/drivers/spi/spi-stm32.c
@@ -1570,6 +1570,9 @@ static int stm32_spi_prepare_rx_dma_mdma_chaining(struct stm32_spi *spi,
return -EINVAL;
}
+ *rx_mdma_desc = _mdma_desc;
+ *rx_dma_desc = _dma_desc;
+
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 087/311] PCI: Correct PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 value
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (85 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 086/311] spi: stm32: fix missing pointer assignment in case of dma chaining Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 088/311] bpf: Fix race in cpumap on PREEMPT_RT Sasha Levin
` (237 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Bjorn Helgaas, David Woodhouse, Krzysztof Wilczyński,
Sasha Levin
From: Bjorn Helgaas <bhelgaas@google.com>
[ Upstream commit 39195990e4c093c9eecf88f29811c6de29265214 ]
fb82437fdd8c ("PCI: Change capability register offsets to hex") incorrectly
converted the PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 value from decimal 52 to hex
0x32:
-#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 52 /* v2 endpoints with link end here */
+#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 0x32 /* end of v2 EPs w/ link */
This broke PCI capabilities in a VMM because subsequent ones weren't
DWORD-aligned.
Change PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 to the correct value of 0x34.
fb82437fdd8c was from Baruch Siach <baruch@tkos.co.il>, but this was not
Baruch's fault; it's a mistake I made when applying the patch.
Fixes: fb82437fdd8c ("PCI: Change capability register offsets to hex")
Reported-by: David Woodhouse <dwmw2@infradead.org>
Closes: https://lore.kernel.org/all/3ae392a0158e9d9ab09a1d42150429dd8ca42791.camel@infradead.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/uapi/linux/pci_regs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index 3add74ae25948..48b0616ddbbbd 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -707,7 +707,7 @@
#define PCI_EXP_LNKCTL2_HASD 0x0020 /* HW Autonomous Speed Disable */
#define PCI_EXP_LNKSTA2 0x32 /* Link Status 2 */
#define PCI_EXP_LNKSTA2_FLIT 0x0400 /* Flit Mode Status */
-#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 0x32 /* end of v2 EPs w/ link */
+#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 0x34 /* end of v2 EPs w/ link */
#define PCI_EXP_SLTCAP2 0x34 /* Slot Capabilities 2 */
#define PCI_EXP_SLTCAP2_IBPD 0x00000001 /* In-band PD Disable Supported */
#define PCI_EXP_SLTCTL2 0x38 /* Slot Control 2 */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 088/311] bpf: Fix race in cpumap on PREEMPT_RT
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (86 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 087/311] PCI: Correct PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 value Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 089/311] bpf: Fix race in devmap " Sasha Levin
` (236 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Jiayuan Chen, syzbot+2b3391f44313b3983e91,
Sebastian Andrzej Siewior, Jiayuan Chen, Alexei Starovoitov,
Sasha Levin
From: Jiayuan Chen <jiayuan.chen@shopee.com>
[ Upstream commit 869c63d5975d55e97f6b168e885452b3da20ea47 ]
On PREEMPT_RT kernels, the per-CPU xdp_bulk_queue (bq) can be accessed
concurrently by multiple preemptible tasks on the same CPU.
The original code assumes bq_enqueue() and __cpu_map_flush() run
atomically with respect to each other on the same CPU, relying on
local_bh_disable() to prevent preemption. However, on PREEMPT_RT,
local_bh_disable() only calls migrate_disable() (when
PREEMPT_RT_NEEDS_BH_LOCK is not set) and does not disable
preemption, which allows CFS scheduling to preempt a task during
bq_flush_to_queue(), enabling another task on the same CPU to enter
bq_enqueue() and operate on the same per-CPU bq concurrently.
This leads to several races:
1. Double __list_del_clearprev(): after bq->count is reset in
bq_flush_to_queue(), a preempting task can call bq_enqueue() ->
bq_flush_to_queue() on the same bq when bq->count reaches
CPU_MAP_BULK_SIZE. Both tasks then call __list_del_clearprev()
on the same bq->flush_node, the second call dereferences the
prev pointer that was already set to NULL by the first.
2. bq->count and bq->q[] races: concurrent bq_enqueue() can corrupt
the packet queue while bq_flush_to_queue() is processing it.
The race between task A (__cpu_map_flush -> bq_flush_to_queue) and
task B (bq_enqueue -> bq_flush_to_queue) on the same CPU:
Task A (xdp_do_flush) Task B (cpu_map_enqueue)
---------------------- ------------------------
bq_flush_to_queue(bq)
spin_lock(&q->producer_lock)
/* flush bq->q[] to ptr_ring */
bq->count = 0
spin_unlock(&q->producer_lock)
bq_enqueue(rcpu, xdpf)
<-- CFS preempts Task A --> bq->q[bq->count++] = xdpf
/* ... more enqueues until full ... */
bq_flush_to_queue(bq)
spin_lock(&q->producer_lock)
/* flush to ptr_ring */
spin_unlock(&q->producer_lock)
__list_del_clearprev(flush_node)
/* sets flush_node.prev = NULL */
<-- Task A resumes -->
__list_del_clearprev(flush_node)
flush_node.prev->next = ...
/* prev is NULL -> kernel oops */
Fix this by adding a local_lock_t to xdp_bulk_queue and acquiring it
in bq_enqueue() and __cpu_map_flush(). These paths already run under
local_bh_disable(), so use local_lock_nested_bh() which on non-RT is
a pure annotation with no overhead, and on PREEMPT_RT provides a
per-CPU sleeping lock that serializes access to the bq.
To reproduce, insert an mdelay(100) between bq->count = 0 and
__list_del_clearprev() in bq_flush_to_queue(), then run reproducer
provided by syzkaller.
Fixes: 3253cb49cbad ("softirq: Allow to drop the softirq-BKL lock on PREEMPT_RT")
Reported-by: syzbot+2b3391f44313b3983e91@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/69369331.a70a0220.38f243.009d.GAE@google.com/T/
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com>
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://lore.kernel.org/r/20260225121459.183121-2-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/cpumap.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c
index 703e5df1f4ef9..306bf98378041 100644
--- a/kernel/bpf/cpumap.c
+++ b/kernel/bpf/cpumap.c
@@ -29,6 +29,7 @@
#include <linux/sched.h>
#include <linux/workqueue.h>
#include <linux/kthread.h>
+#include <linux/local_lock.h>
#include <linux/completion.h>
#include <trace/events/xdp.h>
#include <linux/btf_ids.h>
@@ -52,6 +53,7 @@ struct xdp_bulk_queue {
struct list_head flush_node;
struct bpf_cpu_map_entry *obj;
unsigned int count;
+ local_lock_t bq_lock;
};
/* Struct for every remote "destination" CPU in map */
@@ -451,6 +453,7 @@ __cpu_map_entry_alloc(struct bpf_map *map, struct bpf_cpumap_val *value,
for_each_possible_cpu(i) {
bq = per_cpu_ptr(rcpu->bulkq, i);
bq->obj = rcpu;
+ local_lock_init(&bq->bq_lock);
}
/* Alloc queue */
@@ -717,6 +720,8 @@ static void bq_flush_to_queue(struct xdp_bulk_queue *bq)
struct ptr_ring *q;
int i;
+ lockdep_assert_held(&bq->bq_lock);
+
if (unlikely(!bq->count))
return;
@@ -744,11 +749,15 @@ static void bq_flush_to_queue(struct xdp_bulk_queue *bq)
}
/* Runs under RCU-read-side, plus in softirq under NAPI protection.
- * Thus, safe percpu variable access.
+ * Thus, safe percpu variable access. PREEMPT_RT relies on
+ * local_lock_nested_bh() to serialise access to the per-CPU bq.
*/
static void bq_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_frame *xdpf)
{
- struct xdp_bulk_queue *bq = this_cpu_ptr(rcpu->bulkq);
+ struct xdp_bulk_queue *bq;
+
+ local_lock_nested_bh(&rcpu->bulkq->bq_lock);
+ bq = this_cpu_ptr(rcpu->bulkq);
if (unlikely(bq->count == CPU_MAP_BULK_SIZE))
bq_flush_to_queue(bq);
@@ -769,6 +778,8 @@ static void bq_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_frame *xdpf)
list_add(&bq->flush_node, flush_list);
}
+
+ local_unlock_nested_bh(&rcpu->bulkq->bq_lock);
}
int cpu_map_enqueue(struct bpf_cpu_map_entry *rcpu, struct xdp_frame *xdpf,
@@ -805,7 +816,9 @@ void __cpu_map_flush(struct list_head *flush_list)
struct xdp_bulk_queue *bq, *tmp;
list_for_each_entry_safe(bq, tmp, flush_list, flush_node) {
+ local_lock_nested_bh(&bq->obj->bulkq->bq_lock);
bq_flush_to_queue(bq);
+ local_unlock_nested_bh(&bq->obj->bulkq->bq_lock);
/* If already running, costs spin_lock_irqsave + smb_mb */
wake_up_process(bq->obj->kthread);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 089/311] bpf: Fix race in devmap on PREEMPT_RT
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (87 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 088/311] bpf: Fix race in cpumap on PREEMPT_RT Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 090/311] bpf: Add bitwise tracking for BPF_END Sasha Levin
` (235 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Jiayuan Chen, Sebastian Andrzej Siewior, Jiayuan Chen,
Alexei Starovoitov, Sasha Levin
From: Jiayuan Chen <jiayuan.chen@shopee.com>
[ Upstream commit 1872e75375c40add4a35990de3be77b5741c252c ]
On PREEMPT_RT kernels, the per-CPU xdp_dev_bulk_queue (bq) can be
accessed concurrently by multiple preemptible tasks on the same CPU.
The original code assumes bq_enqueue() and __dev_flush() run atomically
with respect to each other on the same CPU, relying on
local_bh_disable() to prevent preemption. However, on PREEMPT_RT,
local_bh_disable() only calls migrate_disable() (when
PREEMPT_RT_NEEDS_BH_LOCK is not set) and does not disable
preemption, which allows CFS scheduling to preempt a task during
bq_xmit_all(), enabling another task on the same CPU to enter
bq_enqueue() and operate on the same per-CPU bq concurrently.
This leads to several races:
1. Double-free / use-after-free on bq->q[]: bq_xmit_all() snapshots
cnt = bq->count, then iterates bq->q[0..cnt-1] to transmit frames.
If preempted after the snapshot, a second task can call bq_enqueue()
-> bq_xmit_all() on the same bq, transmitting (and freeing) the
same frames. When the first task resumes, it operates on stale
pointers in bq->q[], causing use-after-free.
2. bq->count and bq->q[] corruption: concurrent bq_enqueue() modifying
bq->count and bq->q[] while bq_xmit_all() is reading them.
3. dev_rx/xdp_prog teardown race: __dev_flush() clears bq->dev_rx and
bq->xdp_prog after bq_xmit_all(). If preempted between
bq_xmit_all() return and bq->dev_rx = NULL, a preempting
bq_enqueue() sees dev_rx still set (non-NULL), skips adding bq to
the flush_list, and enqueues a frame. When __dev_flush() resumes,
it clears dev_rx and removes bq from the flush_list, orphaning the
newly enqueued frame.
4. __list_del_clearprev() on flush_node: similar to the cpumap race,
both tasks can call __list_del_clearprev() on the same flush_node,
the second dereferences the prev pointer already set to NULL.
The race between task A (__dev_flush -> bq_xmit_all) and task B
(bq_enqueue -> bq_xmit_all) on the same CPU:
Task A (xdp_do_flush) Task B (ndo_xdp_xmit redirect)
---------------------- --------------------------------
__dev_flush(flush_list)
bq_xmit_all(bq)
cnt = bq->count /* e.g. 16 */
/* start iterating bq->q[] */
<-- CFS preempts Task A -->
bq_enqueue(dev, xdpf)
bq->count == DEV_MAP_BULK_SIZE
bq_xmit_all(bq, 0)
cnt = bq->count /* same 16! */
ndo_xdp_xmit(bq->q[])
/* frames freed by driver */
bq->count = 0
<-- Task A resumes -->
ndo_xdp_xmit(bq->q[])
/* use-after-free: frames already freed! */
Fix this by adding a local_lock_t to xdp_dev_bulk_queue and acquiring
it in bq_enqueue() and __dev_flush(). These paths already run under
local_bh_disable(), so use local_lock_nested_bh() which on non-RT is
a pure annotation with no overhead, and on PREEMPT_RT provides a
per-CPU sleeping lock that serializes access to the bq.
Fixes: 3253cb49cbad ("softirq: Allow to drop the softirq-BKL lock on PREEMPT_RT")
Reported-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com>
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://lore.kernel.org/r/20260225121459.183121-3-jiayuan.chen@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/devmap.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
index 2984e938f94dc..3d619d01088e3 100644
--- a/kernel/bpf/devmap.c
+++ b/kernel/bpf/devmap.c
@@ -45,6 +45,7 @@
* types of devmap; only the lookup and insertion is different.
*/
#include <linux/bpf.h>
+#include <linux/local_lock.h>
#include <net/xdp.h>
#include <linux/filter.h>
#include <trace/events/xdp.h>
@@ -60,6 +61,7 @@ struct xdp_dev_bulk_queue {
struct net_device *dev_rx;
struct bpf_prog *xdp_prog;
unsigned int count;
+ local_lock_t bq_lock;
};
struct bpf_dtab_netdev {
@@ -381,6 +383,8 @@ static void bq_xmit_all(struct xdp_dev_bulk_queue *bq, u32 flags)
int to_send = cnt;
int i;
+ lockdep_assert_held(&bq->bq_lock);
+
if (unlikely(!cnt))
return;
@@ -425,10 +429,12 @@ void __dev_flush(struct list_head *flush_list)
struct xdp_dev_bulk_queue *bq, *tmp;
list_for_each_entry_safe(bq, tmp, flush_list, flush_node) {
+ local_lock_nested_bh(&bq->dev->xdp_bulkq->bq_lock);
bq_xmit_all(bq, XDP_XMIT_FLUSH);
bq->dev_rx = NULL;
bq->xdp_prog = NULL;
__list_del_clearprev(&bq->flush_node);
+ local_unlock_nested_bh(&bq->dev->xdp_bulkq->bq_lock);
}
}
@@ -451,12 +457,16 @@ static void *__dev_map_lookup_elem(struct bpf_map *map, u32 key)
/* Runs in NAPI, i.e., softirq under local_bh_disable(). Thus, safe percpu
* variable access, and map elements stick around. See comment above
- * xdp_do_flush() in filter.c.
+ * xdp_do_flush() in filter.c. PREEMPT_RT relies on local_lock_nested_bh()
+ * to serialise access to the per-CPU bq.
*/
static void bq_enqueue(struct net_device *dev, struct xdp_frame *xdpf,
struct net_device *dev_rx, struct bpf_prog *xdp_prog)
{
- struct xdp_dev_bulk_queue *bq = this_cpu_ptr(dev->xdp_bulkq);
+ struct xdp_dev_bulk_queue *bq;
+
+ local_lock_nested_bh(&dev->xdp_bulkq->bq_lock);
+ bq = this_cpu_ptr(dev->xdp_bulkq);
if (unlikely(bq->count == DEV_MAP_BULK_SIZE))
bq_xmit_all(bq, 0);
@@ -477,6 +487,8 @@ static void bq_enqueue(struct net_device *dev, struct xdp_frame *xdpf,
}
bq->q[bq->count++] = xdpf;
+
+ local_unlock_nested_bh(&dev->xdp_bulkq->bq_lock);
}
static inline int __xdp_enqueue(struct net_device *dev, struct xdp_frame *xdpf,
@@ -1127,8 +1139,13 @@ static int dev_map_notification(struct notifier_block *notifier,
if (!netdev->xdp_bulkq)
return NOTIFY_BAD;
- for_each_possible_cpu(cpu)
- per_cpu_ptr(netdev->xdp_bulkq, cpu)->dev = netdev;
+ for_each_possible_cpu(cpu) {
+ struct xdp_dev_bulk_queue *bq;
+
+ bq = per_cpu_ptr(netdev->xdp_bulkq, cpu);
+ bq->dev = netdev;
+ local_lock_init(&bq->bq_lock);
+ }
break;
case NETDEV_UNREGISTER:
/* This rcu_read_lock/unlock pair is needed because
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 090/311] bpf: Add bitwise tracking for BPF_END
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (88 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 089/311] bpf: Fix race in devmap " Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 091/311] bpf: Introduce tnum_step to step through tnum's members Sasha Levin
` (234 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Tianci Cao, Shenghao Yuan, Yazhou Tang, Eduard Zingerman,
Alexei Starovoitov, Sasha Levin
From: Tianci Cao <ziye@zju.edu.cn>
[ Upstream commit 9d21199842247ab05c675fb9b6c6ca393a5c0024 ]
This patch implements bitwise tracking (tnum analysis) for BPF_END
(byte swap) operation.
Currently, the BPF verifier does not track value for BPF_END operation,
treating the result as completely unknown. This limits the verifier's
ability to prove safety of programs that perform endianness conversions,
which are common in networking code.
For example, the following code pattern for port number validation:
int test(struct pt_regs *ctx) {
__u64 x = bpf_get_prandom_u32();
x &= 0x3f00; // Range: [0, 0x3f00], var_off: (0x0; 0x3f00)
x = bswap16(x); // Should swap to range [0, 0x3f], var_off: (0x0; 0x3f)
if (x > 0x3f) goto trap;
return 0;
trap:
return *(u64 *)NULL; // Should be unreachable
}
Currently generates verifier output:
1: (54) w0 &= 16128 ; R0=scalar(smin=smin32=0,smax=umax=smax32=umax32=16128,var_off=(0x0; 0x3f00))
2: (d7) r0 = bswap16 r0 ; R0=scalar()
3: (25) if r0 > 0x3f goto pc+2 ; R0=scalar(smin=smin32=0,smax=umax=smax32=umax32=63,var_off=(0x0; 0x3f))
Without this patch, even though the verifier knows `x` has certain bits
set, after bswap16, it loses all tracking information and treats port
as having a completely unknown value [0, 65535].
According to the BPF instruction set[1], there are 3 kinds of BPF_END:
1. `bswap(16|32|64)`: opcode=0xd7 (BPF_END | BPF_ALU64 | BPF_TO_LE)
- do unconditional swap
2. `le(16|32|64)`: opcode=0xd4 (BPF_END | BPF_ALU | BPF_TO_LE)
- on big-endian: do swap
- on little-endian: truncation (16/32-bit) or no-op (64-bit)
3. `be(16|32|64)`: opcode=0xdc (BPF_END | BPF_ALU | BPF_TO_BE)
- on little-endian: do swap
- on big-endian: truncation (16/32-bit) or no-op (64-bit)
Since BPF_END operations are inherently bit-wise permutations, tnum
(bitwise tracking) offers the most efficient and precise mechanism
for value analysis. By implementing `tnum_bswap16`, `tnum_bswap32`,
and `tnum_bswap64`, we can derive exact `var_off` values concisely,
directly reflecting the bit-level changes.
Here is the overview of changes:
1. In `tnum_bswap(16|32|64)` (kernel/bpf/tnum.c):
Call `swab(16|32|64)` function on the value and mask of `var_off`, and
do truncation for 16/32-bit cases.
2. In `adjust_scalar_min_max_vals` (kernel/bpf/verifier.c):
Call helper function `scalar_byte_swap`.
- Only do byte swap when
* alu64 (unconditional swap) OR
* switching between big-endian and little-endian machines.
- If need do byte swap:
* Firstly call `tnum_bswap(16|32|64)` to update `var_off`.
* Then reset the bound since byte swap scrambles the range.
- For 16/32-bit cases, truncate dst register to match the swapped size.
This enables better verification of networking code that frequently uses
byte swaps for protocol processing, reducing false positive rejections.
[1] https://www.kernel.org/doc/Documentation/bpf/standardization/instruction-set.rst
Co-developed-by: Shenghao Yuan <shenghaoyuan0928@163.com>
Signed-off-by: Shenghao Yuan <shenghaoyuan0928@163.com>
Co-developed-by: Yazhou Tang <tangyazhou518@outlook.com>
Signed-off-by: Yazhou Tang <tangyazhou518@outlook.com>
Signed-off-by: Tianci Cao <ziye@zju.edu.cn>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20260204111503.77871-2-ziye@zju.edu.cn
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: efc11a667878 ("bpf: Improve bounds when tnum has a single possible value")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/tnum.h | 5 ++++
kernel/bpf/tnum.c | 16 ++++++++++++
kernel/bpf/verifier.c | 60 ++++++++++++++++++++++++++++++++++++++++---
3 files changed, 78 insertions(+), 3 deletions(-)
diff --git a/include/linux/tnum.h b/include/linux/tnum.h
index c52b862dad45b..fa4654ffb6217 100644
--- a/include/linux/tnum.h
+++ b/include/linux/tnum.h
@@ -63,6 +63,11 @@ struct tnum tnum_union(struct tnum t1, struct tnum t2);
/* Return @a with all but the lowest @size bytes cleared */
struct tnum tnum_cast(struct tnum a, u8 size);
+/* Swap the bytes of a tnum */
+struct tnum tnum_bswap16(struct tnum a);
+struct tnum tnum_bswap32(struct tnum a);
+struct tnum tnum_bswap64(struct tnum a);
+
/* Returns true if @a is a known constant */
static inline bool tnum_is_const(struct tnum a)
{
diff --git a/kernel/bpf/tnum.c b/kernel/bpf/tnum.c
index f8e70e9c3998d..26fbfbb017001 100644
--- a/kernel/bpf/tnum.c
+++ b/kernel/bpf/tnum.c
@@ -8,6 +8,7 @@
*/
#include <linux/kernel.h>
#include <linux/tnum.h>
+#include <linux/swab.h>
#define TNUM(_v, _m) (struct tnum){.value = _v, .mask = _m}
/* A completely unknown value */
@@ -253,3 +254,18 @@ struct tnum tnum_const_subreg(struct tnum a, u32 value)
{
return tnum_with_subreg(a, tnum_const(value));
}
+
+struct tnum tnum_bswap16(struct tnum a)
+{
+ return TNUM(swab16(a.value & 0xFFFF), swab16(a.mask & 0xFFFF));
+}
+
+struct tnum tnum_bswap32(struct tnum a)
+{
+ return TNUM(swab32(a.value & 0xFFFFFFFF), swab32(a.mask & 0xFFFFFFFF));
+}
+
+struct tnum tnum_bswap64(struct tnum a)
+{
+ return TNUM(swab64(a.value), swab64(a.mask));
+}
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 783d984d7884d..0f871db07aadf 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -15458,6 +15458,48 @@ static void scalar_min_max_arsh(struct bpf_reg_state *dst_reg,
__update_reg_bounds(dst_reg);
}
+static void scalar_byte_swap(struct bpf_reg_state *dst_reg, struct bpf_insn *insn)
+{
+ /*
+ * Byte swap operation - update var_off using tnum_bswap.
+ * Three cases:
+ * 1. bswap(16|32|64): opcode=0xd7 (BPF_END | BPF_ALU64 | BPF_TO_LE)
+ * unconditional swap
+ * 2. to_le(16|32|64): opcode=0xd4 (BPF_END | BPF_ALU | BPF_TO_LE)
+ * swap on big-endian, truncation or no-op on little-endian
+ * 3. to_be(16|32|64): opcode=0xdc (BPF_END | BPF_ALU | BPF_TO_BE)
+ * swap on little-endian, truncation or no-op on big-endian
+ */
+
+ bool alu64 = BPF_CLASS(insn->code) == BPF_ALU64;
+ bool to_le = BPF_SRC(insn->code) == BPF_TO_LE;
+ bool is_big_endian;
+#ifdef CONFIG_CPU_BIG_ENDIAN
+ is_big_endian = true;
+#else
+ is_big_endian = false;
+#endif
+ /* Apply bswap if alu64 or switch between big-endian and little-endian machines */
+ bool need_bswap = alu64 || (to_le == is_big_endian);
+
+ if (need_bswap) {
+ if (insn->imm == 16)
+ dst_reg->var_off = tnum_bswap16(dst_reg->var_off);
+ else if (insn->imm == 32)
+ dst_reg->var_off = tnum_bswap32(dst_reg->var_off);
+ else if (insn->imm == 64)
+ dst_reg->var_off = tnum_bswap64(dst_reg->var_off);
+ /*
+ * Byteswap scrambles the range, so we must reset bounds.
+ * Bounds will be re-derived from the new tnum later.
+ */
+ __mark_reg_unbounded(dst_reg);
+ }
+ /* For bswap16/32, truncate dst register to match the swapped size */
+ if (insn->imm == 16 || insn->imm == 32)
+ coerce_reg_to_size(dst_reg, insn->imm / 8);
+}
+
static bool is_safe_to_compute_dst_reg_range(struct bpf_insn *insn,
const struct bpf_reg_state *src_reg)
{
@@ -15484,6 +15526,7 @@ static bool is_safe_to_compute_dst_reg_range(struct bpf_insn *insn,
case BPF_XOR:
case BPF_OR:
case BPF_MUL:
+ case BPF_END:
return true;
/* Shift operators range is only computable if shift dimension operand
@@ -15632,12 +15675,23 @@ static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env,
else
scalar_min_max_arsh(dst_reg, &src_reg);
break;
+ case BPF_END:
+ scalar_byte_swap(dst_reg, insn);
+ break;
default:
break;
}
- /* ALU32 ops are zero extended into 64bit register */
- if (alu32)
+ /*
+ * ALU32 ops are zero extended into 64bit register.
+ *
+ * BPF_END is already handled inside the helper (truncation),
+ * so skip zext here to avoid unexpected zero extension.
+ * e.g., le64: opcode=(BPF_END|BPF_ALU|BPF_TO_LE), imm=0x40
+ * This is a 64bit byte swap operation with alu32==true,
+ * but we should not zero extend the result.
+ */
+ if (alu32 && opcode != BPF_END)
zext_32_to_64(dst_reg);
reg_bounds_sync(dst_reg);
return 0;
@@ -15817,7 +15871,7 @@ static int check_alu_op(struct bpf_verifier_env *env, struct bpf_insn *insn)
}
/* check dest operand */
- if (opcode == BPF_NEG &&
+ if ((opcode == BPF_NEG || opcode == BPF_END) &&
regs[insn->dst_reg].type == SCALAR_VALUE) {
err = check_reg_arg(env, insn->dst_reg, DST_OP_NO_MARK);
err = err ?: adjust_scalar_min_max_vals(env, insn,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 091/311] bpf: Introduce tnum_step to step through tnum's members
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (89 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 090/311] bpf: Add bitwise tracking for BPF_END Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 092/311] bpf: Improve bounds when tnum has a single possible value Sasha Levin
` (233 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Harishankar Vishwanathan, Srinivas Narayana, Santosh Nagarakatte,
Alexei Starovoitov, Sasha Levin
From: Harishankar Vishwanathan <harishankar.vishwanathan@gmail.com>
[ Upstream commit 76e954155b45294c502e3d3a9e15757c858ca55e ]
This commit introduces tnum_step(), a function that, when given t, and a
number z returns the smallest member of t larger than z. The number z
must be greater or equal to the smallest member of t and less than the
largest member of t.
The first step is to compute j, a number that keeps all of t's known
bits, and matches all unknown bits to z's bits. Since j is a member of
the t, it is already a candidate for result. However, we want our result
to be (minimally) greater than z.
There are only two possible cases:
(1) Case j <= z. In this case, we want to increase the value of j and
make it > z.
(2) Case j > z. In this case, we want to decrease the value of j while
keeping it > z.
(Case 1) j <= z
t = xx11x0x0
z = 10111101 (189)
j = 10111000 (184)
^
k
(Case 1.1) Let's first consider the case where j < z. We will address j
== z later.
Since z > j, there had to be a bit position that was 1 in z and a 0 in
j, beyond which all positions of higher significance are equal in j and
z. Further, this position could not have been unknown in a, because the
unknown positions of a match z. This position had to be a 1 in z and
known 0 in t.
Let k be position of the most significant 1-to-0 flip. In our example, k
= 3 (starting the count at 1 at the least significant bit). Setting (to
1) the unknown bits of t in positions of significance smaller than
k will not produce a result > z. Hence, we must set/unset the unknown
bits at positions of significance higher than k. Specifically, we look
for the next larger combination of 1s and 0s to place in those
positions, relative to the combination that exists in z. We can achieve
this by concatenating bits at unknown positions of t into an integer,
adding 1, and writing the bits of that result back into the
corresponding bit positions previously extracted from z.
>From our example, considering only positions of significance greater
than k:
t = xx..x
z = 10..1
+ 1
-----
11..0
This is the exact combination 1s and 0s we need at the unknown bits of t
in positions of significance greater than k. Further, our result must
only increase the value minimally above z. Hence, unknown bits in
positions of significance smaller than k should remain 0. We finally
have,
result = 11110000 (240)
(Case 1.2) Now consider the case when j = z, for example
t = 1x1x0xxx
z = 10110100 (180)
j = 10110100 (180)
Matching the unknown bits of the t to the bits of z yielded exactly z.
To produce a number greater than z, we must set/unset the unknown bits
in t, and *all* the unknown bits of t candidates for being set/unset. We
can do this similar to Case 1.1, by adding 1 to the bits extracted from
the masked bit positions of z. Essentially, this case is equivalent to
Case 1.1, with k = 0.
t = 1x1x0xxx
z = .0.1.100
+ 1
---------
.0.1.101
This is the exact combination of bits needed in the unknown positions of
t. After recalling the known positions of t, we get
result = 10110101 (181)
(Case 2) j > z
t = x00010x1
z = 10000010 (130)
j = 10001011 (139)
^
k
Since j > z, there had to be a bit position which was 0 in z, and a 1 in
j, beyond which all positions of higher significance are equal in j and
z. This position had to be a 0 in z and known 1 in t. Let k be the
position of the most significant 0-to-1 flip. In our example, k = 4.
Because of the 0-to-1 flip at position k, a member of t can become
greater than z if the bits in positions greater than k are themselves >=
to z. To make that member *minimally* greater than z, the bits in
positions greater than k must be exactly = z. Hence, we simply match all
of t's unknown bits in positions more significant than k to z's bits. In
positions less significant than k, we set all t's unknown bits to 0
to retain minimality.
In our example, in positions of greater significance than k (=4),
t=x000. These positions are matched with z (1000) to produce 1000. In
positions of lower significance than k, t=10x1. All unknown bits are set
to 0 to produce 1001. The final result is:
result = 10001001 (137)
This concludes the computation for a result > z that is a member of t.
The procedure for tnum_step() in this commit implements the idea
described above. As a proof of correctness, we verified the algorithm
against a logical specification of tnum_step. The specification asserts
the following about the inputs t, z and output res that:
1. res is a member of t, and
2. res is strictly greater than z, and
3. there does not exist another value res2 such that
3a. res2 is also a member of t, and
3b. res2 is greater than z
3c. res2 is smaller than res
We checked the implementation against this logical specification using
an SMT solver. The verification formula in SMTLIB format is available
at [1]. The verification returned an "unsat": indicating that no input
assignment exists for which the implementation and the specification
produce different outputs.
In addition, we also automatically generated the logical encoding of the
C implementation using Agni [2] and verified it against the same
specification. This verification also returned an "unsat", confirming
that the implementation is equivalent to the specification. The formula
for this check is also available at [3].
Link: https://pastebin.com/raw/2eRWbiit [1]
Link: https://github.com/bpfverif/agni [2]
Link: https://pastebin.com/raw/EztVbBJ2 [3]
Co-developed-by: Srinivas Narayana <srinivas.narayana@rutgers.edu>
Signed-off-by: Srinivas Narayana <srinivas.narayana@rutgers.edu>
Co-developed-by: Santosh Nagarakatte <santosh.nagarakatte@rutgers.edu>
Signed-off-by: Santosh Nagarakatte <santosh.nagarakatte@rutgers.edu>
Signed-off-by: Harishankar Vishwanathan <harishankar.vishwanathan@gmail.com>
Link: https://lore.kernel.org/r/93fdf71910411c0f19e282ba6d03b4c65f9c5d73.1772225741.git.paul.chaignon@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: efc11a667878 ("bpf: Improve bounds when tnum has a single possible value")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/tnum.h | 3 +++
kernel/bpf/tnum.c | 56 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 59 insertions(+)
diff --git a/include/linux/tnum.h b/include/linux/tnum.h
index fa4654ffb6217..ca2cfec8de08a 100644
--- a/include/linux/tnum.h
+++ b/include/linux/tnum.h
@@ -131,4 +131,7 @@ static inline bool tnum_subreg_is_const(struct tnum a)
return !(tnum_subreg(a)).mask;
}
+/* Returns the smallest member of t larger than z */
+u64 tnum_step(struct tnum t, u64 z);
+
#endif /* _LINUX_TNUM_H */
diff --git a/kernel/bpf/tnum.c b/kernel/bpf/tnum.c
index 26fbfbb017001..4abc359b3db01 100644
--- a/kernel/bpf/tnum.c
+++ b/kernel/bpf/tnum.c
@@ -269,3 +269,59 @@ struct tnum tnum_bswap64(struct tnum a)
{
return TNUM(swab64(a.value), swab64(a.mask));
}
+
+/* Given tnum t, and a number z such that tmin <= z < tmax, where tmin
+ * is the smallest member of the t (= t.value) and tmax is the largest
+ * member of t (= t.value | t.mask), returns the smallest member of t
+ * larger than z.
+ *
+ * For example,
+ * t = x11100x0
+ * z = 11110001 (241)
+ * result = 11110010 (242)
+ *
+ * Note: if this function is called with z >= tmax, it just returns
+ * early with tmax; if this function is called with z < tmin, the
+ * algorithm already returns tmin.
+ */
+u64 tnum_step(struct tnum t, u64 z)
+{
+ u64 tmax, j, p, q, r, s, v, u, w, res;
+ u8 k;
+
+ tmax = t.value | t.mask;
+
+ /* if z >= largest member of t, return largest member of t */
+ if (z >= tmax)
+ return tmax;
+
+ /* if z < smallest member of t, return smallest member of t */
+ if (z < t.value)
+ return t.value;
+
+ /* keep t's known bits, and match all unknown bits to z */
+ j = t.value | (z & t.mask);
+
+ if (j > z) {
+ p = ~z & t.value & ~t.mask;
+ k = fls64(p); /* k is the most-significant 0-to-1 flip */
+ q = U64_MAX << k;
+ r = q & z; /* positions > k matched to z */
+ s = ~q & t.value; /* positions <= k matched to t.value */
+ v = r | s;
+ res = v;
+ } else {
+ p = z & ~t.value & ~t.mask;
+ k = fls64(p); /* k is the most-significant 1-to-0 flip */
+ q = U64_MAX << k;
+ r = q & t.mask & z; /* unknown positions > k, matched to z */
+ s = q & ~t.mask; /* known positions > k, set to 1 */
+ v = r | s;
+ /* add 1 to unknown positions > k to make value greater than z */
+ u = v + (1ULL << k);
+ /* extract bits in unknown positions > k from u, rest from t.value */
+ w = (u & t.mask) | t.value;
+ res = w;
+ }
+ return res;
+}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 092/311] bpf: Improve bounds when tnum has a single possible value
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (90 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 091/311] bpf: Introduce tnum_step to step through tnum's members Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 093/311] uaccess: Fix scoped_user_read_access() for 'pointer to const' Sasha Levin
` (232 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Paul Chaignon, Eduard Zingerman, Marco Schirrmeister,
Harishankar Vishwanathan, Alexei Starovoitov, Sasha Levin
From: Paul Chaignon <paul.chaignon@gmail.com>
[ Upstream commit efc11a667878a1d655ff034a93a539debbfedb12 ]
We're hitting an invariant violation in Cilium that sometimes leads to
BPF programs being rejected and Cilium failing to start [1]. The
following extract from verifier logs shows what's happening:
from 201 to 236: R1=0 R6=ctx() R7=1 R9=scalar(smin=umin=smin32=umin32=3584,smax=umax=smax32=umax32=3840,var_off=(0xe00; 0x100)) R10=fp0
236: R1=0 R6=ctx() R7=1 R9=scalar(smin=umin=smin32=umin32=3584,smax=umax=smax32=umax32=3840,var_off=(0xe00; 0x100)) R10=fp0
; if (magic == MARK_MAGIC_HOST || magic == MARK_MAGIC_OVERLAY || magic == MARK_MAGIC_ENCRYPT) @ bpf_host.c:1337
236: (16) if w9 == 0xe00 goto pc+45 ; R9=scalar(smin=umin=smin32=umin32=3585,smax=umax=smax32=umax32=3840,var_off=(0xe00; 0x100))
237: (16) if w9 == 0xf00 goto pc+1
verifier bug: REG INVARIANTS VIOLATION (false_reg1): range bounds violation u64=[0xe01, 0xe00] s64=[0xe01, 0xe00] u32=[0xe01, 0xe00] s32=[0xe01, 0xe00] var_off=(0xe00, 0x0)
We reach instruction 236 with two possible values for R9, 0xe00 and
0xf00. This is perfectly reflected in the tnum, but of course the ranges
are less accurate and cover [0xe00; 0xf00]. Taking the fallthrough path
at instruction 236 allows the verifier to reduce the range to
[0xe01; 0xf00]. The tnum is however not updated.
With these ranges, at instruction 237, the verifier is not able to
deduce that R9 is always equal to 0xf00. Hence the fallthrough pass is
explored first, the verifier refines the bounds using the assumption
that R9 != 0xf00, and ends up with an invariant violation.
This pattern of impossible branch + bounds refinement is common to all
invariant violations seen so far. The long-term solution is likely to
rely on the refinement + invariant violation check to detect dead
branches, as started by Eduard. To fix the current issue, we need
something with less refactoring that we can backport.
This patch uses the tnum_step helper introduced in the previous patch to
detect the above situation. In particular, three cases are now detected
in the bounds refinement:
1. The u64 range and the tnum only overlap in umin.
u64: ---[xxxxxx]-----
tnum: --xx----------x-
2. The u64 range and the tnum only overlap in the maximum value
represented by the tnum, called tmax.
u64: ---[xxxxxx]-----
tnum: xx-----x--------
3. The u64 range and the tnum only overlap in between umin (excluded)
and umax.
u64: ---[xxxxxx]-----
tnum: xx----x-------x-
To detect these three cases, we call tnum_step(tnum, umin), which
returns the smallest member of the tnum greater than umin, called
tnum_next here. We're in case (1) if umin is part of the tnum and
tnum_next is greater than umax. We're in case (2) if umin is not part of
the tnum and tnum_next is equal to tmax. Finally, we're in case (3) if
umin is not part of the tnum, tnum_next is inferior or equal to umax,
and calling tnum_step a second time gives us a value past umax.
This change implements these three cases. With it, the above bytecode
looks as follows:
0: (85) call bpf_get_prandom_u32#7 ; R0=scalar()
1: (47) r0 |= 3584 ; R0=scalar(smin=0x8000000000000e00,umin=umin32=3584,smin32=0x80000e00,var_off=(0xe00; 0xfffffffffffff1ff))
2: (57) r0 &= 3840 ; R0=scalar(smin=umin=smin32=umin32=3584,smax=umax=smax32=umax32=3840,var_off=(0xe00; 0x100))
3: (15) if r0 == 0xe00 goto pc+2 ; R0=3840
4: (15) if r0 == 0xf00 goto pc+1
4: R0=3840
6: (95) exit
In addition to the new selftests, this change was also verified with
Agni [3]. For the record, the raw SMT is available at [4]. The property
it verifies is that: If a concrete value x is contained in all input
abstract values, after __update_reg_bounds, it will continue to be
contained in all output abstract values.
Link: https://github.com/cilium/cilium/issues/44216 [1]
Link: https://pchaigno.github.io/test-verifier-complexity.html [2]
Link: https://github.com/bpfverif/agni [3]
Link: https://pastebin.com/raw/naCfaqNx [4]
Fixes: 0df1a55afa83 ("bpf: Warn on internal verifier errors")
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Tested-by: Marco Schirrmeister <mschirrmeister@gmail.com>
Co-developed-by: Harishankar Vishwanathan <harishankar.vishwanathan@gmail.com>
Signed-off-by: Harishankar Vishwanathan <harishankar.vishwanathan@gmail.com>
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Link: https://lore.kernel.org/r/ef254c4f68be19bd393d450188946821c588565d.1772225741.git.paul.chaignon@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 0f871db07aadf..c3b58f5d062b0 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -2358,6 +2358,9 @@ static void __update_reg32_bounds(struct bpf_reg_state *reg)
static void __update_reg64_bounds(struct bpf_reg_state *reg)
{
+ u64 tnum_next, tmax;
+ bool umin_in_tnum;
+
/* min signed is max(sign bit) | min(other bits) */
reg->smin_value = max_t(s64, reg->smin_value,
reg->var_off.value | (reg->var_off.mask & S64_MIN));
@@ -2367,6 +2370,33 @@ static void __update_reg64_bounds(struct bpf_reg_state *reg)
reg->umin_value = max(reg->umin_value, reg->var_off.value);
reg->umax_value = min(reg->umax_value,
reg->var_off.value | reg->var_off.mask);
+
+ /* Check if u64 and tnum overlap in a single value */
+ tnum_next = tnum_step(reg->var_off, reg->umin_value);
+ umin_in_tnum = (reg->umin_value & ~reg->var_off.mask) == reg->var_off.value;
+ tmax = reg->var_off.value | reg->var_off.mask;
+ if (umin_in_tnum && tnum_next > reg->umax_value) {
+ /* The u64 range and the tnum only overlap in umin.
+ * u64: ---[xxxxxx]-----
+ * tnum: --xx----------x-
+ */
+ ___mark_reg_known(reg, reg->umin_value);
+ } else if (!umin_in_tnum && tnum_next == tmax) {
+ /* The u64 range and the tnum only overlap in the maximum value
+ * represented by the tnum, called tmax.
+ * u64: ---[xxxxxx]-----
+ * tnum: xx-----x--------
+ */
+ ___mark_reg_known(reg, tmax);
+ } else if (!umin_in_tnum && tnum_next <= reg->umax_value &&
+ tnum_step(reg->var_off, tnum_next) > reg->umax_value) {
+ /* The u64 range and the tnum only overlap in between umin
+ * (excluded) and umax.
+ * u64: ---[xxxxxx]-----
+ * tnum: xx----x-------x-
+ */
+ ___mark_reg_known(reg, tnum_next);
+ }
}
static void __update_reg_bounds(struct bpf_reg_state *reg)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 093/311] uaccess: Fix scoped_user_read_access() for 'pointer to const'
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (91 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 092/311] bpf: Improve bounds when tnum has a single possible value Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 094/311] usb: gadget: u_ether: add gether_opts for config caching Sasha Levin
` (231 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: David Laight, Christophe Leroy (CS GROUP), Linus Torvalds,
Sasha Levin
From: David Laight <david.laight.linux@gmail.com>
[ Upstream commit af4e9ef3d78420feb8fe58cd9a1ab80c501b3c08 ]
If a 'const struct foo __user *ptr' is used for the address passed to
scoped_user_read_access() then you get a warning/error
uaccess.h:691:1: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
for the
void __user *_tmpptr = __scoped_user_access_begin(mode, uptr, size, elbl)
assignment.
Fix by using 'auto' for both _tmpptr and the redeclaration of uptr.
Replace the CLASS() with explicit __cleanup() functions on uptr.
Fixes: e497310b4ffb ("uaccess: Provide scoped user access regions")
Signed-off-by: David Laight <david.laight.linux@gmail.com>
Reviewed-and-tested-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/uaccess.h | 54 +++++++++++++++--------------------------
1 file changed, 20 insertions(+), 34 deletions(-)
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h
index 1f3804245c066..809e4f7dfdbd4 100644
--- a/include/linux/uaccess.h
+++ b/include/linux/uaccess.h
@@ -647,36 +647,22 @@ static inline void user_access_restore(unsigned long flags) { }
/* Define RW variant so the below _mode macro expansion works */
#define masked_user_rw_access_begin(u) masked_user_access_begin(u)
#define user_rw_access_begin(u, s) user_access_begin(u, s)
-#define user_rw_access_end() user_access_end()
/* Scoped user access */
-#define USER_ACCESS_GUARD(_mode) \
-static __always_inline void __user * \
-class_user_##_mode##_begin(void __user *ptr) \
-{ \
- return ptr; \
-} \
- \
-static __always_inline void \
-class_user_##_mode##_end(void __user *ptr) \
-{ \
- user_##_mode##_access_end(); \
-} \
- \
-DEFINE_CLASS(user_ ##_mode## _access, void __user *, \
- class_user_##_mode##_end(_T), \
- class_user_##_mode##_begin(ptr), void __user *ptr) \
- \
-static __always_inline class_user_##_mode##_access_t \
-class_user_##_mode##_access_ptr(void __user *scope) \
-{ \
- return scope; \
-}
-USER_ACCESS_GUARD(read)
-USER_ACCESS_GUARD(write)
-USER_ACCESS_GUARD(rw)
-#undef USER_ACCESS_GUARD
+/* Cleanup wrapper functions */
+static __always_inline void __scoped_user_read_access_end(const void *p)
+{
+ user_read_access_end();
+};
+static __always_inline void __scoped_user_write_access_end(const void *p)
+{
+ user_write_access_end();
+};
+static __always_inline void __scoped_user_rw_access_end(const void *p)
+{
+ user_access_end();
+};
/**
* __scoped_user_access_begin - Start a scoped user access
@@ -750,13 +736,13 @@ USER_ACCESS_GUARD(rw)
*
* Don't use directly. Use scoped_masked_user_$MODE_access() instead.
*/
-#define __scoped_user_access(mode, uptr, size, elbl) \
-for (bool done = false; !done; done = true) \
- for (void __user *_tmpptr = __scoped_user_access_begin(mode, uptr, size, elbl); \
- !done; done = true) \
- for (CLASS(user_##mode##_access, scope)(_tmpptr); !done; done = true) \
- /* Force modified pointer usage within the scope */ \
- for (const typeof(uptr) uptr = _tmpptr; !done; done = true)
+#define __scoped_user_access(mode, uptr, size, elbl) \
+for (bool done = false; !done; done = true) \
+ for (auto _tmpptr = __scoped_user_access_begin(mode, uptr, size, elbl); \
+ !done; done = true) \
+ /* Force modified pointer usage within the scope */ \
+ for (const auto uptr __cleanup(__scoped_user_##mode##_access_end) = \
+ _tmpptr; !done; done = true)
/**
* scoped_user_read_access_size - Start a scoped user read access with given size
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 094/311] usb: gadget: u_ether: add gether_opts for config caching
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (92 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 093/311] uaccess: Fix scoped_user_read_access() for 'pointer to const' Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 095/311] usb: gadget: u_ether: Add auto-cleanup helper for freeing net_device Sasha Levin
` (230 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Kuen-Han Tsai, Greg Kroah-Hartman, Sasha Levin
From: Kuen-Han Tsai <khtsai@google.com>
[ Upstream commit e065c6a7e46c2ee9c677fdbf50035323d2de1215 ]
Currently, the net_device is allocated when the function instance is
created (e.g., in ncm_alloc_inst()). While this allows userspace to
configure the device early, it decouples the net_device lifecycle from
the actual USB connection state (bind/unbind). The goal is to defer
net_device creation to the bind callback to properly align the lifecycle
with its parent gadget device.
However, deferring net_device allocation would prevent userspace from
configuring parameters (like interface name or MAC address) before the
net_device exists.
Introduce a new structure, struct gether_opts, associated with the
usb_function_instance, to cache settings independently of the
net_device. These settings include the interface name pattern, MAC
addresses (device and host), queue multiplier, and address assignment
type.
New helper functions are added:
- gether_setup_opts_default(): Initializes struct gether_opts with
defaults, including random MAC addresses.
- gether_apply_opts(): Applies the cached options from a struct
gether_opts to a valid net_device.
To expose these options to userspace, new configfs macros
(USB_ETHER_OPTS_ITEM and USB_ETHER_OPTS_ATTR_*) are defined in
u_ether_configfs.h. These attributes are part of the function
instance's configfs group.
This refactoring is a preparatory step. It allows the subsequent patch
to safely move the net_device allocation from the instance creation
phase to the bind phase without losing the ability to pre-configure
the interface via configfs.
Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
Link: https://patch.msgid.link/20251230-ncm-refactor-v1-1-793e347bc7a7@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 56a512a9b410 ("usb: gadget: f_ncm: align net_device lifecycle with bind/unbind")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/gadget/function/u_ether.c | 30 +++
drivers/usb/gadget/function/u_ether.h | 28 +++
.../usb/gadget/function/u_ether_configfs.h | 176 ++++++++++++++++++
3 files changed, 234 insertions(+)
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index f58590bf5e02f..745ed2c212e3a 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -1039,6 +1039,36 @@ int gether_set_ifname(struct net_device *net, const char *name, int len)
}
EXPORT_SYMBOL_GPL(gether_set_ifname);
+void gether_setup_opts_default(struct gether_opts *opts, const char *name)
+{
+ opts->qmult = QMULT_DEFAULT;
+ snprintf(opts->name, sizeof(opts->name), "%s%%d", name);
+ eth_random_addr(opts->dev_mac);
+ opts->addr_assign_type = NET_ADDR_RANDOM;
+ eth_random_addr(opts->host_mac);
+}
+EXPORT_SYMBOL_GPL(gether_setup_opts_default);
+
+void gether_apply_opts(struct net_device *net, struct gether_opts *opts)
+{
+ struct eth_dev *dev = netdev_priv(net);
+
+ dev->qmult = opts->qmult;
+
+ if (opts->ifname_set) {
+ strscpy(net->name, opts->name, sizeof(net->name));
+ dev->ifname_set = true;
+ }
+
+ memcpy(dev->host_mac, opts->host_mac, sizeof(dev->host_mac));
+
+ if (opts->addr_assign_type == NET_ADDR_SET) {
+ memcpy(dev->dev_mac, opts->dev_mac, sizeof(dev->dev_mac));
+ net->addr_assign_type = opts->addr_assign_type;
+ }
+}
+EXPORT_SYMBOL_GPL(gether_apply_opts);
+
void gether_suspend(struct gether *link)
{
struct eth_dev *dev = link->ioport;
diff --git a/drivers/usb/gadget/function/u_ether.h b/drivers/usb/gadget/function/u_ether.h
index 34be220cef77c..63a0240df4d74 100644
--- a/drivers/usb/gadget/function/u_ether.h
+++ b/drivers/usb/gadget/function/u_ether.h
@@ -38,6 +38,31 @@
struct eth_dev;
+/**
+ * struct gether_opts - Options for Ethernet gadget function instances
+ * @name: Pattern for the network interface name (e.g., "usb%d").
+ * Used to generate the net device name.
+ * @qmult: Queue length multiplier for high/super speed.
+ * @host_mac: The MAC address to be used by the host side.
+ * @dev_mac: The MAC address to be used by the device side.
+ * @ifname_set: True if the interface name pattern has been set by userspace.
+ * @addr_assign_type: The method used for assigning the device MAC address
+ * (e.g., NET_ADDR_RANDOM, NET_ADDR_SET).
+ *
+ * This structure caches network-related settings provided through configfs
+ * before the net_device is fully instantiated. This allows for early
+ * configuration while deferring net_device allocation until the function
+ * is bound.
+ */
+struct gether_opts {
+ char name[IFNAMSIZ];
+ unsigned int qmult;
+ u8 host_mac[ETH_ALEN];
+ u8 dev_mac[ETH_ALEN];
+ bool ifname_set;
+ unsigned char addr_assign_type;
+};
+
/*
* This represents the USB side of an "ethernet" link, managed by a USB
* function which provides control and (maybe) framing. Two functions
@@ -259,6 +284,9 @@ int gether_set_ifname(struct net_device *net, const char *name, int len);
void gether_cleanup(struct eth_dev *dev);
+void gether_setup_opts_default(struct gether_opts *opts, const char *name);
+void gether_apply_opts(struct net_device *net, struct gether_opts *opts);
+
void gether_suspend(struct gether *link);
void gether_resume(struct gether *link);
diff --git a/drivers/usb/gadget/function/u_ether_configfs.h b/drivers/usb/gadget/function/u_ether_configfs.h
index f558c3139ebe5..a3696797e074a 100644
--- a/drivers/usb/gadget/function/u_ether_configfs.h
+++ b/drivers/usb/gadget/function/u_ether_configfs.h
@@ -13,6 +13,12 @@
#ifndef __U_ETHER_CONFIGFS_H
#define __U_ETHER_CONFIGFS_H
+#include <linux/cleanup.h>
+#include <linux/if_ether.h>
+#include <linux/mutex.h>
+#include <linux/netdevice.h>
+#include <linux/rtnetlink.h>
+
#define USB_ETHERNET_CONFIGFS_ITEM(_f_) \
static void _f_##_attr_release(struct config_item *item) \
{ \
@@ -197,4 +203,174 @@ out: \
\
CONFIGFS_ATTR(_f_##_opts_, _n_)
+#define USB_ETHER_OPTS_ITEM(_f_) \
+ static void _f_##_attr_release(struct config_item *item) \
+ { \
+ struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \
+ \
+ usb_put_function_instance(&opts->func_inst); \
+ } \
+ \
+ static struct configfs_item_operations _f_##_item_ops = { \
+ .release = _f_##_attr_release, \
+ }
+
+#define USB_ETHER_OPTS_ATTR_DEV_ADDR(_f_) \
+ static ssize_t _f_##_opts_dev_addr_show(struct config_item *item, \
+ char *page) \
+ { \
+ struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \
+ \
+ guard(mutex)(&opts->lock); \
+ return sysfs_emit(page, "%pM\n", opts->net_opts.dev_mac); \
+ } \
+ \
+ static ssize_t _f_##_opts_dev_addr_store(struct config_item *item, \
+ const char *page, size_t len) \
+ { \
+ struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \
+ u8 new_addr[ETH_ALEN]; \
+ const char *p = page; \
+ \
+ guard(mutex)(&opts->lock); \
+ if (opts->refcnt) \
+ return -EBUSY; \
+ \
+ for (int i = 0; i < ETH_ALEN; i++) { \
+ unsigned char num; \
+ if ((*p == '.') || (*p == ':')) \
+ p++; \
+ num = hex_to_bin(*p++) << 4; \
+ num |= hex_to_bin(*p++); \
+ new_addr[i] = num; \
+ } \
+ if (!is_valid_ether_addr(new_addr)) \
+ return -EINVAL; \
+ memcpy(opts->net_opts.dev_mac, new_addr, ETH_ALEN); \
+ opts->net_opts.addr_assign_type = NET_ADDR_SET; \
+ return len; \
+ } \
+ \
+ CONFIGFS_ATTR(_f_##_opts_, dev_addr)
+
+#define USB_ETHER_OPTS_ATTR_HOST_ADDR(_f_) \
+ static ssize_t _f_##_opts_host_addr_show(struct config_item *item, \
+ char *page) \
+ { \
+ struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \
+ \
+ guard(mutex)(&opts->lock); \
+ return sysfs_emit(page, "%pM\n", opts->net_opts.host_mac); \
+ } \
+ \
+ static ssize_t _f_##_opts_host_addr_store(struct config_item *item, \
+ const char *page, size_t len) \
+ { \
+ struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \
+ u8 new_addr[ETH_ALEN]; \
+ const char *p = page; \
+ \
+ guard(mutex)(&opts->lock); \
+ if (opts->refcnt) \
+ return -EBUSY; \
+ \
+ for (int i = 0; i < ETH_ALEN; i++) { \
+ unsigned char num; \
+ if ((*p == '.') || (*p == ':')) \
+ p++; \
+ num = hex_to_bin(*p++) << 4; \
+ num |= hex_to_bin(*p++); \
+ new_addr[i] = num; \
+ } \
+ if (!is_valid_ether_addr(new_addr)) \
+ return -EINVAL; \
+ memcpy(opts->net_opts.host_mac, new_addr, ETH_ALEN); \
+ return len; \
+ } \
+ \
+ CONFIGFS_ATTR(_f_##_opts_, host_addr)
+
+#define USB_ETHER_OPTS_ATTR_QMULT(_f_) \
+ static ssize_t _f_##_opts_qmult_show(struct config_item *item, \
+ char *page) \
+ { \
+ struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \
+ \
+ guard(mutex)(&opts->lock); \
+ return sysfs_emit(page, "%u\n", opts->net_opts.qmult); \
+ } \
+ \
+ static ssize_t _f_##_opts_qmult_store(struct config_item *item, \
+ const char *page, size_t len) \
+ { \
+ struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \
+ u32 val; \
+ int ret; \
+ \
+ guard(mutex)(&opts->lock); \
+ if (opts->refcnt) \
+ return -EBUSY; \
+ \
+ ret = kstrtou32(page, 0, &val); \
+ if (ret) \
+ return ret; \
+ \
+ opts->net_opts.qmult = val; \
+ return len; \
+ } \
+ \
+ CONFIGFS_ATTR(_f_##_opts_, qmult)
+
+#define USB_ETHER_OPTS_ATTR_IFNAME(_f_) \
+ static ssize_t _f_##_opts_ifname_show(struct config_item *item, \
+ char *page) \
+ { \
+ struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \
+ const char *name; \
+ \
+ guard(mutex)(&opts->lock); \
+ rtnl_lock(); \
+ if (opts->net_opts.ifname_set) \
+ name = opts->net_opts.name; \
+ else if (opts->net) \
+ name = netdev_name(opts->net); \
+ else \
+ name = "(inactive net_device)"; \
+ rtnl_unlock(); \
+ return sysfs_emit(page, "%s\n", name); \
+ } \
+ \
+ static ssize_t _f_##_opts_ifname_store(struct config_item *item, \
+ const char *page, size_t len) \
+ { \
+ struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \
+ char tmp[IFNAMSIZ]; \
+ const char *p; \
+ size_t c_len = len; \
+ \
+ if (c_len > 0 && page[c_len - 1] == '\n') \
+ c_len--; \
+ \
+ if (c_len >= sizeof(tmp)) \
+ return -E2BIG; \
+ \
+ strscpy(tmp, page, c_len + 1); \
+ if (!dev_valid_name(tmp)) \
+ return -EINVAL; \
+ \
+ /* Require exactly one %d */ \
+ p = strchr(tmp, '%'); \
+ if (!p || p[1] != 'd' || strchr(p + 2, '%')) \
+ return -EINVAL; \
+ \
+ guard(mutex)(&opts->lock); \
+ if (opts->refcnt) \
+ return -EBUSY; \
+ strscpy(opts->net_opts.name, tmp, sizeof(opts->net_opts.name)); \
+ opts->net_opts.ifname_set = true; \
+ return len; \
+ } \
+ \
+ CONFIGFS_ATTR(_f_##_opts_, ifname)
+
#endif /* __U_ETHER_CONFIGFS_H */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 095/311] usb: gadget: u_ether: Add auto-cleanup helper for freeing net_device
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (93 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 094/311] usb: gadget: u_ether: add gether_opts for config caching Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 096/311] usb: gadget: f_ncm: align net_device lifecycle with bind/unbind Sasha Levin
` (229 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Kuen-Han Tsai, Greg Kroah-Hartman, Sasha Levin
From: Kuen-Han Tsai <khtsai@google.com>
[ Upstream commit 0c0981126b99288ed354d3d414c8a5fd42ac9e25 ]
The net_device in the u_ether framework currently requires explicit
calls to unregister and free the device.
Introduce gether_unregister_free_netdev() and the corresponding
auto-cleanup macro. This ensures that if a net_device is registered, it
is properly unregistered and the associated work queue is flushed before
the memory is freed.
This is a preparatory patch to simplify error handling paths in gadget
drivers by removing the need for explicit goto labels for net_device
cleanup.
Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
Link: https://patch.msgid.link/20251230-ncm-refactor-v1-2-793e347bc7a7@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 56a512a9b410 ("usb: gadget: f_ncm: align net_device lifecycle with bind/unbind")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/gadget/function/u_ether.c | 15 +++++++++++++++
drivers/usb/gadget/function/u_ether.h | 2 ++
2 files changed, 17 insertions(+)
diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
index 745ed2c212e3a..6c32665538cc0 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -1125,6 +1125,21 @@ void gether_cleanup(struct eth_dev *dev)
}
EXPORT_SYMBOL_GPL(gether_cleanup);
+void gether_unregister_free_netdev(struct net_device *net)
+{
+ if (!net)
+ return;
+
+ struct eth_dev *dev = netdev_priv(net);
+
+ if (net->reg_state == NETREG_REGISTERED) {
+ unregister_netdev(net);
+ flush_work(&dev->work);
+ }
+ free_netdev(net);
+}
+EXPORT_SYMBOL_GPL(gether_unregister_free_netdev);
+
/**
* gether_connect - notify network layer that USB link is active
* @link: the USB link, set up with endpoints, descriptors matching
diff --git a/drivers/usb/gadget/function/u_ether.h b/drivers/usb/gadget/function/u_ether.h
index 63a0240df4d74..a212a8ec5eb1b 100644
--- a/drivers/usb/gadget/function/u_ether.h
+++ b/drivers/usb/gadget/function/u_ether.h
@@ -283,6 +283,8 @@ int gether_get_ifname(struct net_device *net, char *name, int len);
int gether_set_ifname(struct net_device *net, const char *name, int len);
void gether_cleanup(struct eth_dev *dev);
+void gether_unregister_free_netdev(struct net_device *net);
+DEFINE_FREE(free_gether_netdev, struct net_device *, gether_unregister_free_netdev(_T));
void gether_setup_opts_default(struct gether_opts *opts, const char *name);
void gether_apply_opts(struct net_device *net, struct gether_opts *opts);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 096/311] usb: gadget: f_ncm: align net_device lifecycle with bind/unbind
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (94 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 095/311] usb: gadget: u_ether: Add auto-cleanup helper for freeing net_device Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 097/311] accel/rocket: fix unwinding in error path in rocket_core_init Sasha Levin
` (228 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Kuen-Han Tsai, stable, Greg Kroah-Hartman, Sasha Levin
From: Kuen-Han Tsai <khtsai@google.com>
[ Upstream commit 56a512a9b4107079f68701e7d55da8507eb963d9 ]
Currently, the net_device is allocated in ncm_alloc_inst() and freed in
ncm_free_inst(). This ties the network interface's lifetime to the
configuration instance rather than the USB connection (bind/unbind).
This decoupling causes issues when the USB gadget is disconnected where
the underlying gadget device is removed. The net_device can outlive its
parent, leading to dangling sysfs links and NULL pointer dereferences
when accessing the freed gadget device.
Problem 1: NULL pointer dereference on disconnect
Unable to handle kernel NULL pointer dereference at virtual address
0000000000000000
Call trace:
__pi_strlen+0x14/0x150
rtnl_fill_ifinfo+0x6b4/0x708
rtmsg_ifinfo_build_skb+0xd8/0x13c
rtmsg_ifinfo+0x50/0xa0
__dev_notify_flags+0x4c/0x1f0
dev_change_flags+0x54/0x70
do_setlink+0x390/0xebc
rtnl_newlink+0x7d0/0xac8
rtnetlink_rcv_msg+0x27c/0x410
netlink_rcv_skb+0x134/0x150
rtnetlink_rcv+0x18/0x28
netlink_unicast+0x254/0x3f0
netlink_sendmsg+0x2e0/0x3d4
Problem 2: Dangling sysfs symlinks
console:/ # ls -l /sys/class/net/ncm0
lrwxrwxrwx ... /sys/class/net/ncm0 ->
/sys/devices/platform/.../gadget.0/net/ncm0
console:/ # ls -l /sys/devices/platform/.../gadget.0/net/ncm0
ls: .../gadget.0/net/ncm0: No such file or directory
Move the net_device allocation to ncm_bind() and deallocation to
ncm_unbind(). This ensures the network interface exists only when the
gadget function is actually bound to a configuration.
To support pre-bind configuration (e.g., setting interface name or MAC
address via configfs), cache user-provided options in f_ncm_opts
using the gether_opts structure. Apply these cached settings to the
net_device upon creation in ncm_bind().
Preserve the use-after-free fix from commit 6334b8e4553c ("usb: gadget:
f_ncm: Fix UAF ncm object at re-bind after usb ep transport error").
Check opts->net in ncm_set_alt() and ncm_disable() to ensure
gether_disconnect() runs only if a connection was established.
Fixes: 40d133d7f542 ("usb: gadget: f_ncm: convert to new function interface with backward compatibility")
Cc: stable@kernel.org
Signed-off-by: Kuen-Han Tsai <khtsai@google.com>
Link: https://patch.msgid.link/20251230-ncm-refactor-v1-3-793e347bc7a7@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/gadget/function/f_ncm.c | 128 ++++++++++++++--------------
drivers/usb/gadget/function/u_ncm.h | 4 +-
2 files changed, 66 insertions(+), 66 deletions(-)
diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c
index 0e38330271d5a..e23adc132f886 100644
--- a/drivers/usb/gadget/function/f_ncm.c
+++ b/drivers/usb/gadget/function/f_ncm.c
@@ -83,6 +83,11 @@ static inline struct f_ncm *func_to_ncm(struct usb_function *f)
return container_of(f, struct f_ncm, port.func);
}
+static inline struct f_ncm_opts *func_to_ncm_opts(struct usb_function *f)
+{
+ return container_of(f->fi, struct f_ncm_opts, func_inst);
+}
+
/*-------------------------------------------------------------------------*/
/*
@@ -859,6 +864,7 @@ static int ncm_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
static int ncm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
{
struct f_ncm *ncm = func_to_ncm(f);
+ struct f_ncm_opts *opts = func_to_ncm_opts(f);
struct usb_composite_dev *cdev = f->config->cdev;
/* Control interface has only altsetting 0 */
@@ -881,12 +887,13 @@ static int ncm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
if (alt > 1)
goto fail;
- if (ncm->netdev) {
- DBG(cdev, "reset ncm\n");
- ncm->netdev = NULL;
- gether_disconnect(&ncm->port);
- ncm_reset_values(ncm);
- }
+ scoped_guard(mutex, &opts->lock)
+ if (opts->net) {
+ DBG(cdev, "reset ncm\n");
+ opts->net = NULL;
+ gether_disconnect(&ncm->port);
+ ncm_reset_values(ncm);
+ }
/*
* CDC Network only sends data in non-default altsettings.
@@ -919,7 +926,8 @@ static int ncm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
net = gether_connect(&ncm->port);
if (IS_ERR(net))
return PTR_ERR(net);
- ncm->netdev = net;
+ scoped_guard(mutex, &opts->lock)
+ opts->net = net;
}
spin_lock(&ncm->lock);
@@ -1366,14 +1374,16 @@ static int ncm_unwrap_ntb(struct gether *port,
static void ncm_disable(struct usb_function *f)
{
struct f_ncm *ncm = func_to_ncm(f);
+ struct f_ncm_opts *opts = func_to_ncm_opts(f);
struct usb_composite_dev *cdev = f->config->cdev;
DBG(cdev, "ncm deactivated\n");
- if (ncm->netdev) {
- ncm->netdev = NULL;
- gether_disconnect(&ncm->port);
- }
+ scoped_guard(mutex, &opts->lock)
+ if (opts->net) {
+ opts->net = NULL;
+ gether_disconnect(&ncm->port);
+ }
if (ncm->notify->enabled) {
usb_ep_disable(ncm->notify);
@@ -1433,39 +1443,44 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f)
{
struct usb_composite_dev *cdev = c->cdev;
struct f_ncm *ncm = func_to_ncm(f);
+ struct f_ncm_opts *ncm_opts = func_to_ncm_opts(f);
struct usb_string *us;
int status = 0;
struct usb_ep *ep;
- struct f_ncm_opts *ncm_opts;
struct usb_os_desc_table *os_desc_table __free(kfree) = NULL;
+ struct net_device *netdev __free(free_gether_netdev) = NULL;
struct usb_request *request __free(free_usb_request) = NULL;
if (!can_support_ecm(cdev->gadget))
return -EINVAL;
- ncm_opts = container_of(f->fi, struct f_ncm_opts, func_inst);
-
if (cdev->use_os_string) {
os_desc_table = kzalloc(sizeof(*os_desc_table), GFP_KERNEL);
if (!os_desc_table)
return -ENOMEM;
}
- mutex_lock(&ncm_opts->lock);
- gether_set_gadget(ncm_opts->net, cdev->gadget);
- if (!ncm_opts->bound) {
- ncm_opts->net->mtu = (ncm_opts->max_segment_size - ETH_HLEN);
- status = gether_register_netdev(ncm_opts->net);
+ netdev = gether_setup_default();
+ if (IS_ERR(netdev))
+ return -ENOMEM;
+
+ scoped_guard(mutex, &ncm_opts->lock) {
+ gether_apply_opts(netdev, &ncm_opts->net_opts);
+ netdev->mtu = ncm_opts->max_segment_size - ETH_HLEN;
}
- mutex_unlock(&ncm_opts->lock);
+ gether_set_gadget(netdev, cdev->gadget);
+ status = gether_register_netdev(netdev);
if (status)
return status;
- ncm_opts->bound = true;
-
- ncm_string_defs[1].s = ncm->ethaddr;
+ /* export host's Ethernet address in CDC format */
+ status = gether_get_host_addr_cdc(netdev, ncm->ethaddr,
+ sizeof(ncm->ethaddr));
+ if (status < 12)
+ return -EINVAL;
+ ncm_string_defs[STRING_MAC_IDX].s = ncm->ethaddr;
us = usb_gstrings_attach(cdev, ncm_strings,
ARRAY_SIZE(ncm_string_defs));
@@ -1563,6 +1578,8 @@ static int ncm_bind(struct usb_configuration *c, struct usb_function *f)
f->os_desc_n = 1;
}
ncm->notify_req = no_free_ptr(request);
+ ncm->netdev = no_free_ptr(netdev);
+ ncm->port.ioport = netdev_priv(ncm->netdev);
DBG(cdev, "CDC Network: IN/%s OUT/%s NOTIFY/%s\n",
ncm->port.in_ep->name, ncm->port.out_ep->name,
@@ -1577,19 +1594,19 @@ static inline struct f_ncm_opts *to_f_ncm_opts(struct config_item *item)
}
/* f_ncm_item_ops */
-USB_ETHERNET_CONFIGFS_ITEM(ncm);
+USB_ETHER_OPTS_ITEM(ncm);
/* f_ncm_opts_dev_addr */
-USB_ETHERNET_CONFIGFS_ITEM_ATTR_DEV_ADDR(ncm);
+USB_ETHER_OPTS_ATTR_DEV_ADDR(ncm);
/* f_ncm_opts_host_addr */
-USB_ETHERNET_CONFIGFS_ITEM_ATTR_HOST_ADDR(ncm);
+USB_ETHER_OPTS_ATTR_HOST_ADDR(ncm);
/* f_ncm_opts_qmult */
-USB_ETHERNET_CONFIGFS_ITEM_ATTR_QMULT(ncm);
+USB_ETHER_OPTS_ATTR_QMULT(ncm);
/* f_ncm_opts_ifname */
-USB_ETHERNET_CONFIGFS_ITEM_ATTR_IFNAME(ncm);
+USB_ETHER_OPTS_ATTR_IFNAME(ncm);
static ssize_t ncm_opts_max_segment_size_show(struct config_item *item,
char *page)
@@ -1655,34 +1672,27 @@ static void ncm_free_inst(struct usb_function_instance *f)
struct f_ncm_opts *opts;
opts = container_of(f, struct f_ncm_opts, func_inst);
- if (opts->bound)
- gether_cleanup(netdev_priv(opts->net));
- else
- free_netdev(opts->net);
kfree(opts->ncm_interf_group);
kfree(opts);
}
static struct usb_function_instance *ncm_alloc_inst(void)
{
- struct f_ncm_opts *opts;
+ struct usb_function_instance *ret;
struct usb_os_desc *descs[1];
char *names[1];
struct config_group *ncm_interf_group;
- opts = kzalloc(sizeof(*opts), GFP_KERNEL);
+ struct f_ncm_opts *opts __free(kfree) = kzalloc(sizeof(*opts), GFP_KERNEL);
if (!opts)
return ERR_PTR(-ENOMEM);
+
+ opts->net = NULL;
opts->ncm_os_desc.ext_compat_id = opts->ncm_ext_compat_id;
+ gether_setup_opts_default(&opts->net_opts, "usb");
mutex_init(&opts->lock);
opts->func_inst.free_func_inst = ncm_free_inst;
- opts->net = gether_setup_default();
- if (IS_ERR(opts->net)) {
- struct net_device *net = opts->net;
- kfree(opts);
- return ERR_CAST(net);
- }
opts->max_segment_size = ETH_FRAME_LEN;
INIT_LIST_HEAD(&opts->ncm_os_desc.ext_prop);
@@ -1693,26 +1703,22 @@ static struct usb_function_instance *ncm_alloc_inst(void)
ncm_interf_group =
usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs,
names, THIS_MODULE);
- if (IS_ERR(ncm_interf_group)) {
- ncm_free_inst(&opts->func_inst);
+ if (IS_ERR(ncm_interf_group))
return ERR_CAST(ncm_interf_group);
- }
opts->ncm_interf_group = ncm_interf_group;
- return &opts->func_inst;
+ ret = &opts->func_inst;
+ retain_and_null_ptr(opts);
+ return ret;
}
static void ncm_free(struct usb_function *f)
{
- struct f_ncm *ncm;
- struct f_ncm_opts *opts;
+ struct f_ncm_opts *opts = func_to_ncm_opts(f);
- ncm = func_to_ncm(f);
- opts = container_of(f->fi, struct f_ncm_opts, func_inst);
- kfree(ncm);
- mutex_lock(&opts->lock);
- opts->refcnt--;
- mutex_unlock(&opts->lock);
+ scoped_guard(mutex, &opts->lock)
+ opts->refcnt--;
+ kfree(func_to_ncm(f));
}
static void ncm_unbind(struct usb_configuration *c, struct usb_function *f)
@@ -1736,13 +1742,15 @@ static void ncm_unbind(struct usb_configuration *c, struct usb_function *f)
kfree(ncm->notify_req->buf);
usb_ep_free_request(ncm->notify, ncm->notify_req);
+
+ ncm->port.ioport = NULL;
+ gether_cleanup(netdev_priv(ncm->netdev));
}
static struct usb_function *ncm_alloc(struct usb_function_instance *fi)
{
struct f_ncm *ncm;
struct f_ncm_opts *opts;
- int status;
/* allocate and initialize one new instance */
ncm = kzalloc(sizeof(*ncm), GFP_KERNEL);
@@ -1750,22 +1758,12 @@ static struct usb_function *ncm_alloc(struct usb_function_instance *fi)
return ERR_PTR(-ENOMEM);
opts = container_of(fi, struct f_ncm_opts, func_inst);
- mutex_lock(&opts->lock);
- opts->refcnt++;
- /* export host's Ethernet address in CDC format */
- status = gether_get_host_addr_cdc(opts->net, ncm->ethaddr,
- sizeof(ncm->ethaddr));
- if (status < 12) { /* strlen("01234567890a") */
- kfree(ncm);
- mutex_unlock(&opts->lock);
- return ERR_PTR(-EINVAL);
- }
+ scoped_guard(mutex, &opts->lock)
+ opts->refcnt++;
spin_lock_init(&ncm->lock);
ncm_reset_values(ncm);
- ncm->port.ioport = netdev_priv(opts->net);
- mutex_unlock(&opts->lock);
ncm->port.is_fixed = true;
ncm->port.supports_multi_frame = true;
diff --git a/drivers/usb/gadget/function/u_ncm.h b/drivers/usb/gadget/function/u_ncm.h
index 49ec095cdb4b6..d99330fe31e88 100644
--- a/drivers/usb/gadget/function/u_ncm.h
+++ b/drivers/usb/gadget/function/u_ncm.h
@@ -15,11 +15,13 @@
#include <linux/usb/composite.h>
+#include "u_ether.h"
+
struct f_ncm_opts {
struct usb_function_instance func_inst;
struct net_device *net;
- bool bound;
+ struct gether_opts net_opts;
struct config_group *ncm_interf_group;
struct usb_os_desc ncm_os_desc;
char ncm_ext_compat_id[16];
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 097/311] accel/rocket: fix unwinding in error path in rocket_core_init
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (95 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 096/311] usb: gadget: f_ncm: align net_device lifecycle with bind/unbind Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 098/311] accel/rocket: fix unwinding in error path in rocket_probe Sasha Levin
` (227 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Quentin Schulz, Tomeu Vizoso, Sasha Levin
From: Quentin Schulz <quentin.schulz@cherry.de>
[ Upstream commit f509a081f6a289f7c66856333b3becce7a33c97e ]
When rocket_job_init() is called, iommu_group_get() has already been
called, therefore we should call iommu_group_put() and make the
iommu_group pointer NULL. This aligns with what's done in
rocket_core_fini().
If pm_runtime_resume_and_get() somehow fails, not only should
rocket_job_fini() be called but we should also unwind everything done
before that, that is, disable PM, put the iommu_group, NULLify it and
then call rocket_job_fini(). This is exactly what's done in
rocket_core_fini() so let's call that function instead of duplicating
the code.
Fixes: 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL")
Cc: stable@vger.kernel.org
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://patch.msgid.link/20251215-rocket-error-path-v1-1-eec3bf29dc3b@cherry.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/rocket/rocket_core.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/accel/rocket/rocket_core.c b/drivers/accel/rocket/rocket_core.c
index abe7719c1db46..b3b2fa9ba645a 100644
--- a/drivers/accel/rocket/rocket_core.c
+++ b/drivers/accel/rocket/rocket_core.c
@@ -59,8 +59,11 @@ int rocket_core_init(struct rocket_core *core)
core->iommu_group = iommu_group_get(dev);
err = rocket_job_init(core);
- if (err)
+ if (err) {
+ iommu_group_put(core->iommu_group);
+ core->iommu_group = NULL;
return err;
+ }
pm_runtime_use_autosuspend(dev);
@@ -76,7 +79,7 @@ int rocket_core_init(struct rocket_core *core)
err = pm_runtime_resume_and_get(dev);
if (err) {
- rocket_job_fini(core);
+ rocket_core_fini(core);
return err;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 098/311] accel/rocket: fix unwinding in error path in rocket_probe
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (96 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 097/311] accel/rocket: fix unwinding in error path in rocket_core_init Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 099/311] KVM: x86: Add x2APIC "features" to control EOI broadcast suppression Sasha Levin
` (226 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Quentin Schulz, Tomeu Vizoso, Sasha Levin
From: Quentin Schulz <quentin.schulz@cherry.de>
[ Upstream commit 34f4495a7f72895776b81969639f527c99eb12b9 ]
When rocket_core_init() fails (as could be the case with EPROBE_DEFER),
we need to properly unwind by decrementing the counter we just
incremented and if this is the first core we failed to probe, remove the
rocket DRM device with rocket_device_fini() as well. This matches the
logic in rocket_remove(). Failing to properly unwind results in
out-of-bounds accesses.
Fixes: 0810d5ad88a1 ("accel/rocket: Add job submission IOCTL")
Cc: stable@vger.kernel.org
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Link: https://patch.msgid.link/20251215-rocket-error-path-v1-2-eec3bf29dc3b@cherry.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/rocket/rocket_drv.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/accel/rocket/rocket_drv.c b/drivers/accel/rocket/rocket_drv.c
index 5c0b63f0a8f00..f6ef4c7aeef11 100644
--- a/drivers/accel/rocket/rocket_drv.c
+++ b/drivers/accel/rocket/rocket_drv.c
@@ -13,6 +13,7 @@
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include "rocket_device.h"
#include "rocket_drv.h"
#include "rocket_gem.h"
#include "rocket_job.h"
@@ -158,6 +159,8 @@ static const struct drm_driver rocket_drm_driver = {
static int rocket_probe(struct platform_device *pdev)
{
+ int ret;
+
if (rdev == NULL) {
/* First core probing, initialize DRM device. */
rdev = rocket_device_init(drm_dev, &rocket_drm_driver);
@@ -177,7 +180,17 @@ static int rocket_probe(struct platform_device *pdev)
rdev->num_cores++;
- return rocket_core_init(&rdev->cores[core]);
+ ret = rocket_core_init(&rdev->cores[core]);
+ if (ret) {
+ rdev->num_cores--;
+
+ if (rdev->num_cores == 0) {
+ rocket_device_fini(rdev);
+ rdev = NULL;
+ }
+ }
+
+ return ret;
}
static void rocket_remove(struct platform_device *pdev)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 099/311] KVM: x86: Add x2APIC "features" to control EOI broadcast suppression
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (97 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 098/311] accel/rocket: fix unwinding in error path in rocket_probe Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 100/311] eventpoll: Fix integer overflow in ep_loop_check_proc() Sasha Levin
` (225 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Khushit Shah, David Woodhouse, Sean Christopherson, Sasha Levin
From: Khushit Shah <khushit.shah@nutanix.com>
[ Upstream commit 6517dfbcc918f970a928d9dc17586904bac06893 ]
Add two flags for KVM_CAP_X2APIC_API to allow userspace to control support
for Suppress EOI Broadcasts when using a split IRQCHIP (I/O APIC emulated
by userspace), which KVM completely mishandles. When x2APIC support was
first added, KVM incorrectly advertised and "enabled" Suppress EOI
Broadcast, without fully supporting the I/O APIC side of the equation,
i.e. without adding directed EOI to KVM's in-kernel I/O APIC.
That flaw was carried over to split IRQCHIP support, i.e. KVM advertised
support for Suppress EOI Broadcasts irrespective of whether or not the
userspace I/O APIC implementation supported directed EOIs. Even worse,
KVM didn't actually suppress EOI broadcasts, i.e. userspace VMMs without
support for directed EOI came to rely on the "spurious" broadcasts.
KVM "fixed" the in-kernel I/O APIC implementation by completely disabling
support for Suppress EOI Broadcasts in commit 0bcc3fb95b97 ("KVM: lapic:
stop advertising DIRECTED_EOI when in-kernel IOAPIC is in use"), but
didn't do anything to remedy userspace I/O APIC implementations.
KVM's bogus handling of Suppress EOI Broadcast is problematic when the
guest relies on interrupts being masked in the I/O APIC until well after
the initial local APIC EOI. E.g. Windows with Credential Guard enabled
handles interrupts in the following order:
1. Interrupt for L2 arrives.
2. L1 APIC EOIs the interrupt.
3. L1 resumes L2 and injects the interrupt.
4. L2 EOIs after servicing.
5. L1 performs the I/O APIC EOI.
Because KVM EOIs the I/O APIC at step #2, the guest can get an interrupt
storm, e.g. if the IRQ line is still asserted and userspace reacts to the
EOI by re-injecting the IRQ, because the guest doesn't de-assert the line
until step #4, and doesn't expect the interrupt to be re-enabled until
step #5.
Unfortunately, simply "fixing" the bug isn't an option, as KVM has no way
of knowing if the userspace I/O APIC supports directed EOIs, i.e.
suppressing EOI broadcasts would result in interrupts being stuck masked
in the userspace I/O APIC due to step #5 being ignored by userspace. And
fully disabling support for Suppress EOI Broadcast is also undesirable, as
picking up the fix would require a guest reboot, *and* more importantly
would change the virtual CPU model exposed to the guest without any buy-in
from userspace.
Add KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST and
KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST flags to allow userspace to
explicitly enable or disable support for Suppress EOI Broadcasts. This
gives userspace control over the virtual CPU model exposed to the guest,
as KVM should never have enabled support for Suppress EOI Broadcast without
userspace opt-in. Not setting either flag will result in legacy quirky
behavior for backward compatibility.
Disallow fully enabling SUPPRESS_EOI_BROADCAST when using an in-kernel
I/O APIC, as KVM's history/support is just as tragic. E.g. it's not clear
that commit c806a6ad35bf ("KVM: x86: call irq notifiers with directed EOI")
was entirely correct, i.e. it may have simply papered over the lack of
Directed EOI emulation in the I/O APIC.
Note, Suppress EOI Broadcasts is defined only in Intel's SDM, not in AMD's
APM. But the bit is writable on some AMD CPUs, e.g. Turin, and KVM's ABI
is to support Directed EOI (KVM's name) irrespective of guest CPU vendor.
Fixes: 7543a635aa09 ("KVM: x86: Add KVM exit for IOAPIC EOIs")
Closes: https://lore.kernel.org/kvm/7D497EF1-607D-4D37-98E7-DAF95F099342@nutanix.com
Cc: stable@vger.kernel.org
Suggested-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Khushit Shah <khushit.shah@nutanix.com>
Link: https://patch.msgid.link/20260123125657.3384063-1-khushit.shah@nutanix.com
[sean: clean up minor formatting goofs and fix a comment typo]
Co-developed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Documentation/virt/kvm/api.rst | 28 +++++++++++-
arch/x86/include/asm/kvm_host.h | 7 +++
arch/x86/include/uapi/asm/kvm.h | 6 ++-
arch/x86/kvm/ioapic.c | 2 +-
arch/x86/kvm/lapic.c | 76 +++++++++++++++++++++++++++++----
arch/x86/kvm/lapic.h | 2 +
arch/x86/kvm/x86.c | 21 ++++++++-
7 files changed, 127 insertions(+), 15 deletions(-)
diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index 01a3abef8abb9..f1f1d2e5dc7c9 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -7835,8 +7835,10 @@ Will return -EBUSY if a VCPU has already been created.
Valid feature flags in args[0] are::
- #define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)
- #define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)
+ #define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)
+ #define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)
+ #define KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST (1ULL << 2)
+ #define KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST (1ULL << 3)
Enabling KVM_X2APIC_API_USE_32BIT_IDS changes the behavior of
KVM_SET_GSI_ROUTING, KVM_SIGNAL_MSI, KVM_SET_LAPIC, and KVM_GET_LAPIC,
@@ -7849,6 +7851,28 @@ as a broadcast even in x2APIC mode in order to support physical x2APIC
without interrupt remapping. This is undesirable in logical mode,
where 0xff represents CPUs 0-7 in cluster 0.
+Setting KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST instructs KVM to enable
+Suppress EOI Broadcasts. KVM will advertise support for Suppress EOI
+Broadcast to the guest and suppress LAPIC EOI broadcasts when the guest
+sets the Suppress EOI Broadcast bit in the SPIV register. This flag is
+supported only when using a split IRQCHIP.
+
+Setting KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST disables support for
+Suppress EOI Broadcasts entirely, i.e. instructs KVM to NOT advertise
+support to the guest.
+
+Modern VMMs should either enable KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST
+or KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST. If not, legacy quirky
+behavior will be used by KVM: in split IRQCHIP mode, KVM will advertise
+support for Suppress EOI Broadcasts but not actually suppress EOI
+broadcasts; for in-kernel IRQCHIP mode, KVM will not advertise support for
+Suppress EOI Broadcasts.
+
+Setting both KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST and
+KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST will fail with an EINVAL error,
+as will setting KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST without a split
+IRCHIP.
+
7.8 KVM_CAP_S390_USER_INSTR0
----------------------------
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 5a3bfa293e8b1..c27b3e5f60c23 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -1226,6 +1226,12 @@ enum kvm_irqchip_mode {
KVM_IRQCHIP_SPLIT, /* created with KVM_CAP_SPLIT_IRQCHIP */
};
+enum kvm_suppress_eoi_broadcast_mode {
+ KVM_SUPPRESS_EOI_BROADCAST_QUIRKED, /* Legacy behavior */
+ KVM_SUPPRESS_EOI_BROADCAST_ENABLED, /* Enable Suppress EOI broadcast */
+ KVM_SUPPRESS_EOI_BROADCAST_DISABLED /* Disable Suppress EOI broadcast */
+};
+
struct kvm_x86_msr_filter {
u8 count;
bool default_allow:1;
@@ -1475,6 +1481,7 @@ struct kvm_arch {
bool x2apic_format;
bool x2apic_broadcast_quirk_disabled;
+ enum kvm_suppress_eoi_broadcast_mode suppress_eoi_broadcast_mode;
bool has_mapped_host_mmio;
bool guest_can_read_msr_platform_info;
diff --git a/arch/x86/include/uapi/asm/kvm.h b/arch/x86/include/uapi/asm/kvm.h
index 7ceff65836525..1208932e5cc3c 100644
--- a/arch/x86/include/uapi/asm/kvm.h
+++ b/arch/x86/include/uapi/asm/kvm.h
@@ -914,8 +914,10 @@ struct kvm_sev_snp_launch_finish {
__u64 pad1[4];
};
-#define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0)
-#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1)
+#define KVM_X2APIC_API_USE_32BIT_IDS _BITULL(0)
+#define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK _BITULL(1)
+#define KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST _BITULL(2)
+#define KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST _BITULL(3)
struct kvm_hyperv_eventfd {
__u32 conn_id;
diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c
index 2c2783296aedb..a26fa4222f292 100644
--- a/arch/x86/kvm/ioapic.c
+++ b/arch/x86/kvm/ioapic.c
@@ -561,7 +561,7 @@ static void kvm_ioapic_update_eoi_one(struct kvm_vcpu *vcpu,
spin_lock(&ioapic->lock);
if (trigger_mode != IOAPIC_LEVEL_TRIG ||
- kvm_lapic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI)
+ kvm_lapic_suppress_eoi_broadcast(apic))
return;
ASSERT(ent->fields.trig_mode == IOAPIC_LEVEL_TRIG);
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 1597dd0b0cc66..9ec577b10e051 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -105,6 +105,63 @@ bool kvm_apic_pending_eoi(struct kvm_vcpu *vcpu, int vector)
apic_test_vector(vector, apic->regs + APIC_IRR);
}
+static bool kvm_lapic_advertise_suppress_eoi_broadcast(struct kvm *kvm)
+{
+ switch (kvm->arch.suppress_eoi_broadcast_mode) {
+ case KVM_SUPPRESS_EOI_BROADCAST_ENABLED:
+ return true;
+ case KVM_SUPPRESS_EOI_BROADCAST_DISABLED:
+ return false;
+ case KVM_SUPPRESS_EOI_BROADCAST_QUIRKED:
+ /*
+ * The default in-kernel I/O APIC emulates the 82093AA and does not
+ * implement an EOI register. Some guests (e.g. Windows with the
+ * Hyper-V role enabled) disable LAPIC EOI broadcast without
+ * checking the I/O APIC version, which can cause level-triggered
+ * interrupts to never be EOI'd.
+ *
+ * To avoid this, KVM doesn't advertise Suppress EOI Broadcast
+ * support when using the default in-kernel I/O APIC.
+ *
+ * Historically, in split IRQCHIP mode, KVM always advertised
+ * Suppress EOI Broadcast support but did not actually suppress
+ * EOIs, resulting in quirky behavior.
+ */
+ return !ioapic_in_kernel(kvm);
+ default:
+ WARN_ON_ONCE(1);
+ return false;
+ }
+}
+
+bool kvm_lapic_suppress_eoi_broadcast(struct kvm_lapic *apic)
+{
+ struct kvm *kvm = apic->vcpu->kvm;
+
+ if (!(kvm_lapic_get_reg(apic, APIC_SPIV) & APIC_SPIV_DIRECTED_EOI))
+ return false;
+
+ switch (kvm->arch.suppress_eoi_broadcast_mode) {
+ case KVM_SUPPRESS_EOI_BROADCAST_ENABLED:
+ return true;
+ case KVM_SUPPRESS_EOI_BROADCAST_DISABLED:
+ return false;
+ case KVM_SUPPRESS_EOI_BROADCAST_QUIRKED:
+ /*
+ * Historically, in split IRQCHIP mode, KVM ignored the suppress
+ * EOI broadcast bit set by the guest and broadcasts EOIs to the
+ * userspace I/O APIC. For In-kernel I/O APIC, the support itself
+ * is not advertised, can only be enabled via KVM_SET_APIC_STATE,
+ * and KVM's I/O APIC doesn't emulate Directed EOIs; but if the
+ * feature is enabled, it is respected (with odd behavior).
+ */
+ return ioapic_in_kernel(kvm);
+ default:
+ WARN_ON_ONCE(1);
+ return false;
+ }
+}
+
__read_mostly DEFINE_STATIC_KEY_FALSE(kvm_has_noapic_vcpu);
EXPORT_SYMBOL_FOR_KVM_INTERNAL(kvm_has_noapic_vcpu);
@@ -554,15 +611,9 @@ void kvm_apic_set_version(struct kvm_vcpu *vcpu)
v = APIC_VERSION | ((apic->nr_lvt_entries - 1) << 16);
- /*
- * KVM emulates 82093AA datasheet (with in-kernel IOAPIC implementation)
- * which doesn't have EOI register; Some buggy OSes (e.g. Windows with
- * Hyper-V role) disable EOI broadcast in lapic not checking for IOAPIC
- * version first and level-triggered interrupts never get EOIed in
- * IOAPIC.
- */
+
if (guest_cpu_cap_has(vcpu, X86_FEATURE_X2APIC) &&
- !ioapic_in_kernel(vcpu->kvm))
+ kvm_lapic_advertise_suppress_eoi_broadcast(vcpu->kvm))
v |= APIC_LVR_DIRECTED_EOI;
kvm_lapic_set_reg(apic, APIC_LVR, v);
}
@@ -1517,6 +1568,15 @@ static void kvm_ioapic_send_eoi(struct kvm_lapic *apic, int vector)
/* Request a KVM exit to inform the userspace IOAPIC. */
if (irqchip_split(apic->vcpu->kvm)) {
+ /*
+ * Don't exit to userspace if the guest has enabled Directed
+ * EOI, a.k.a. Suppress EOI Broadcasts, in which case the local
+ * APIC doesn't broadcast EOIs (the guest must EOI the target
+ * I/O APIC(s) directly).
+ */
+ if (kvm_lapic_suppress_eoi_broadcast(apic))
+ return;
+
apic->vcpu->arch.pending_ioapic_eoi = vector;
kvm_make_request(KVM_REQ_IOAPIC_EOI_EXIT, apic->vcpu);
return;
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h
index 282b9b7da98cd..e5f5a222eced0 100644
--- a/arch/x86/kvm/lapic.h
+++ b/arch/x86/kvm/lapic.h
@@ -231,6 +231,8 @@ static inline int kvm_lapic_latched_init(struct kvm_vcpu *vcpu)
bool kvm_apic_pending_eoi(struct kvm_vcpu *vcpu, int vector);
+bool kvm_lapic_suppress_eoi_broadcast(struct kvm_lapic *apic);
+
void kvm_wait_lapic_expire(struct kvm_vcpu *vcpu);
void kvm_bitmap_or_dest_vcpus(struct kvm *kvm, struct kvm_lapic_irq *irq,
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8b12bf0774c77..0d731ce4c4e16 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -121,8 +121,10 @@ static u64 __read_mostly efer_reserved_bits = ~((u64)EFER_SCE);
#define KVM_CAP_PMU_VALID_MASK KVM_PMU_CAP_DISABLE
-#define KVM_X2APIC_API_VALID_FLAGS (KVM_X2APIC_API_USE_32BIT_IDS | \
- KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK)
+#define KVM_X2APIC_API_VALID_FLAGS (KVM_X2APIC_API_USE_32BIT_IDS | \
+ KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK | \
+ KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST | \
+ KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST)
static void update_cr8_intercept(struct kvm_vcpu *vcpu);
static void process_nmi(struct kvm_vcpu *vcpu);
@@ -4931,6 +4933,8 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
break;
case KVM_CAP_X2APIC_API:
r = KVM_X2APIC_API_VALID_FLAGS;
+ if (kvm && !irqchip_split(kvm))
+ r &= ~KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST;
break;
case KVM_CAP_NESTED_STATE:
r = kvm_x86_ops.nested_ops->get_state ?
@@ -6748,11 +6752,24 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm,
if (cap->args[0] & ~KVM_X2APIC_API_VALID_FLAGS)
break;
+ if ((cap->args[0] & KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST) &&
+ (cap->args[0] & KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST))
+ break;
+
+ if ((cap->args[0] & KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST) &&
+ !irqchip_split(kvm))
+ break;
+
if (cap->args[0] & KVM_X2APIC_API_USE_32BIT_IDS)
kvm->arch.x2apic_format = true;
if (cap->args[0] & KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK)
kvm->arch.x2apic_broadcast_quirk_disabled = true;
+ if (cap->args[0] & KVM_X2APIC_ENABLE_SUPPRESS_EOI_BROADCAST)
+ kvm->arch.suppress_eoi_broadcast_mode = KVM_SUPPRESS_EOI_BROADCAST_ENABLED;
+ if (cap->args[0] & KVM_X2APIC_DISABLE_SUPPRESS_EOI_BROADCAST)
+ kvm->arch.suppress_eoi_broadcast_mode = KVM_SUPPRESS_EOI_BROADCAST_DISABLED;
+
r = 0;
break;
case KVM_CAP_X86_DISABLE_EXITS:
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 100/311] eventpoll: Fix integer overflow in ep_loop_check_proc()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (98 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 099/311] KVM: x86: Add x2APIC "features" to control EOI broadcast suppression Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 101/311] namespace: fix proc mount iteration Sasha Levin
` (224 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Jann Horn, Guenter Roeck, Christian Brauner, Greg Kroah-Hartman
From: Jann Horn <jannh@google.com>
commit fdcfce93073d990ed4b71752e31ad1c1d6e9d58b upstream.
If a recursive call to ep_loop_check_proc() hits the `result = INT_MAX`,
an integer overflow will occur in the calling ep_loop_check_proc() at
`result = max(result, ep_loop_check_proc(ep_tovisit, depth + 1) + 1)`,
breaking the recursion depth check.
Fix it by using a different placeholder value that can't lead to an
overflow.
Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: f2e467a48287 ("eventpoll: Fix semi-unbounded recursion")
Cc: stable@vger.kernel.org
Signed-off-by: Jann Horn <jannh@google.com>
Link: https://patch.msgid.link/20260223-epoll-int-overflow-v1-1-452f35132224@google.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/eventpoll.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 6c36d9dc6926f..d20917b03161b 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -2061,7 +2061,8 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
* @ep: the &struct eventpoll to be currently checked.
* @depth: Current depth of the path being checked.
*
- * Return: depth of the subtree, or INT_MAX if we found a loop or went too deep.
+ * Return: depth of the subtree, or a value bigger than EP_MAX_NESTS if we found
+ * a loop or went too deep.
*/
static int ep_loop_check_proc(struct eventpoll *ep, int depth)
{
@@ -2080,7 +2081,7 @@ static int ep_loop_check_proc(struct eventpoll *ep, int depth)
struct eventpoll *ep_tovisit;
ep_tovisit = epi->ffd.file->private_data;
if (ep_tovisit == inserting_into || depth > EP_MAX_NESTS)
- result = INT_MAX;
+ result = EP_MAX_NESTS+1;
else
result = max(result, ep_loop_check_proc(ep_tovisit, depth + 1) + 1);
if (result > EP_MAX_NESTS)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 101/311] namespace: fix proc mount iteration
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (99 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 100/311] eventpoll: Fix integer overflow in ep_loop_check_proc() Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 102/311] media: dvb-core: fix wrong reinitialization of ringbuffer on reopen Sasha Levin
` (223 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Christian Brauner, Greg Kroah-Hartman
From: Christian Brauner <brauner@kernel.org>
commit 4a403d7aa9074f527f064ef0806aaab38d14b07c upstream.
The m->index isn't updated when m->show() overflows and retains its
value before the current mount causing a restart to start at the same
value. If that happens in short order to due a quickly expanding mount
table this would cause the same mount to be shown again and again.
Ensure that *pos always equals the mount id of the mount that was
returned by start/next. On restart after overflow mnt_find_id_at(*pos)
finds the exact mount. This should avoid duplicates, avoid skips and
should handle concurrent modification just fine.
Cc: <stable@vger.kernel.org>
Fixed: 2eea9ce4310d8 ("mounts: keep list of mounts in an rbtree")
Link: https://patch.msgid.link/20260129-geleckt-treuhand-4bb940acacd9@brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/namespace.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index ecf0e72ce6cfd..9e5e3f1db02f9 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1537,23 +1537,33 @@ static struct mount *mnt_find_id_at_reverse(struct mnt_namespace *ns, u64 mnt_id
static void *m_start(struct seq_file *m, loff_t *pos)
{
struct proc_mounts *p = m->private;
+ struct mount *mnt;
down_read(&namespace_sem);
- return mnt_find_id_at(p->ns, *pos);
+ mnt = mnt_find_id_at(p->ns, *pos);
+ if (mnt)
+ *pos = mnt->mnt_id_unique;
+ return mnt;
}
static void *m_next(struct seq_file *m, void *v, loff_t *pos)
{
- struct mount *next = NULL, *mnt = v;
+ struct mount *mnt = v;
struct rb_node *node = rb_next(&mnt->mnt_node);
- ++*pos;
if (node) {
- next = node_to_mount(node);
+ struct mount *next = node_to_mount(node);
*pos = next->mnt_id_unique;
+ return next;
}
- return next;
+
+ /*
+ * No more mounts. Set pos past current mount's ID so that if
+ * iteration restarts, mnt_find_id_at() returns NULL.
+ */
+ *pos = mnt->mnt_id_unique + 1;
+ return NULL;
}
static void m_stop(struct seq_file *m, void *v)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 102/311] media: dvb-core: fix wrong reinitialization of ringbuffer on reopen
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (100 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 101/311] namespace: fix proc mount iteration Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 103/311] nfc: pn533: properly drop the usb interface reference on disconnect Sasha Levin
` (222 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Jens Axboe, syzbot+ab12f0c08dd7ab8d057c, Linus Torvalds,
Greg Kroah-Hartman
From: Jens Axboe <axboe@kernel.dk>
commit bfbc0b5b32a8f28ce284add619bf226716a59bc0 upstream.
dvb_dvr_open() calls dvb_ringbuffer_init() when a new reader opens the
DVR device. dvb_ringbuffer_init() calls init_waitqueue_head(), which
reinitializes the waitqueue list head to empty.
Since dmxdev->dvr_buffer.queue is a shared waitqueue (all opens of the
same DVR device share it), this orphans any existing waitqueue entries
from io_uring poll or epoll, leaving them with stale prev/next pointers
while the list head is reset to {self, self}.
The waitqueue and spinlock in dvr_buffer are already properly
initialized once in dvb_dmxdev_init(). The open path only needs to
reset the buffer data pointer, size, and read/write positions.
Replace the dvb_ringbuffer_init() call in dvb_dvr_open() with direct
assignment of data/size and a call to dvb_ringbuffer_reset(), which
properly resets pread, pwrite, and error with correct memory ordering
without touching the waitqueue or spinlock.
Cc: stable@vger.kernel.org
Fixes: 34731df288a5f ("V4L/DVB (3501): Dmxdev: use dvb_ringbuffer")
Reported-by: syzbot+ab12f0c08dd7ab8d057c@syzkaller.appspotmail.com
Tested-by: syzbot+ab12f0c08dd7ab8d057c@syzkaller.appspotmail.com
Link: https://lore.kernel.org/all/698a26d3.050a0220.3b3015.007d.GAE@google.com/
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/media/dvb-core/dmxdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index 17184b3674904..9aaae55ce7b4e 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -168,7 +168,9 @@ static int dvb_dvr_open(struct inode *inode, struct file *file)
mutex_unlock(&dmxdev->mutex);
return -ENOMEM;
}
- dvb_ringbuffer_init(&dmxdev->dvr_buffer, mem, DVR_BUFFER_SIZE);
+ dmxdev->dvr_buffer.data = mem;
+ dmxdev->dvr_buffer.size = DVR_BUFFER_SIZE;
+ dvb_ringbuffer_reset(&dmxdev->dvr_buffer);
if (dmxdev->may_do_mmap)
dvb_vb2_init(&dmxdev->dvr_vb2_ctx, "dvr",
file->f_flags & O_NONBLOCK);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 103/311] nfc: pn533: properly drop the usb interface reference on disconnect
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (101 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 102/311] media: dvb-core: fix wrong reinitialization of ringbuffer on reopen Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 104/311] net: usb: kaweth: validate USB endpoints Sasha Levin
` (221 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Greg Kroah-Hartman, stable, Simon Horman, Jakub Kicinski
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 12133a483dfa832241fbbf09321109a0ea8a520e upstream.
When the device is disconnected from the driver, there is a "dangling"
reference count on the usb interface that was grabbed in the probe
callback. Fix this up by properly dropping the reference after we are
done with it.
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Fixes: c46ee38620a2 ("NFC: pn533: add NXP pn533 nfc device driver")
Link: https://patch.msgid.link/2026022329-flashing-ought-7573@gregkh
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/nfc/pn533/usb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nfc/pn533/usb.c b/drivers/nfc/pn533/usb.c
index 018a80674f06e..0f12f86ebb023 100644
--- a/drivers/nfc/pn533/usb.c
+++ b/drivers/nfc/pn533/usb.c
@@ -628,6 +628,7 @@ static void pn533_usb_disconnect(struct usb_interface *interface)
usb_free_urb(phy->out_urb);
usb_free_urb(phy->ack_urb);
kfree(phy->ack_buffer);
+ usb_put_dev(phy->udev);
nfc_info(&interface->dev, "NXP PN533 NFC device disconnected\n");
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 104/311] net: usb: kaweth: validate USB endpoints
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (102 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 103/311] nfc: pn533: properly drop the usb interface reference on disconnect Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 105/311] net: usb: kalmia: " Sasha Levin
` (220 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Greg Kroah-Hartman, stable, Simon Horman, Jakub Kicinski
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 4b063c002ca759d1b299988ee23f564c9609c875 upstream.
The kaweth driver should validate that the device it is probing has the
proper number and types of USB endpoints it is expecting before it binds
to it. If a malicious device were to not have the same urbs the driver
will crash later on when it blindly accesses these endpoints.
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Link: https://patch.msgid.link/2026022305-substance-virtual-c728@gregkh
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/usb/kaweth.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index e01d14f6c3667..cb2472b59e104 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -883,6 +883,13 @@ static int kaweth_probe(
const eth_addr_t bcast_addr = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
int result = 0;
int rv = -EIO;
+ static const u8 bulk_ep_addr[] = {
+ 1 | USB_DIR_IN,
+ 2 | USB_DIR_OUT,
+ 0};
+ static const u8 int_ep_addr[] = {
+ 3 | USB_DIR_IN,
+ 0};
dev_dbg(dev,
"Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x\n",
@@ -896,6 +903,12 @@ static int kaweth_probe(
(int)udev->descriptor.bLength,
(int)udev->descriptor.bDescriptorType);
+ if (!usb_check_bulk_endpoints(intf, bulk_ep_addr) ||
+ !usb_check_int_endpoints(intf, int_ep_addr)) {
+ dev_err(dev, "couldn't find required endpoints\n");
+ return -ENODEV;
+ }
+
netdev = alloc_etherdev(sizeof(*kaweth));
if (!netdev)
return -ENOMEM;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 105/311] net: usb: kalmia: validate USB endpoints
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (103 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 104/311] net: usb: kaweth: validate USB endpoints Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 106/311] net: usb: pegasus: " Sasha Levin
` (219 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Greg Kroah-Hartman, stable, Simon Horman, Jakub Kicinski
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit c58b6c29a4c9b8125e8ad3bca0637e00b71e2693 upstream.
The kalmia driver should validate that the device it is probing has the
proper number and types of USB endpoints it is expecting before it binds
to it. If a malicious device were to not have the same urbs the driver
will crash later on when it blindly accesses these endpoints.
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Fixes: d40261236e8e ("net/usb: Add Samsung Kalmia driver for Samsung GT-B3730")
Link: https://patch.msgid.link/2026022326-shack-headstone-ef6f@gregkh
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/usb/kalmia.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/usb/kalmia.c b/drivers/net/usb/kalmia.c
index 613fc6910f148..ee9c48f7f68f9 100644
--- a/drivers/net/usb/kalmia.c
+++ b/drivers/net/usb/kalmia.c
@@ -132,11 +132,18 @@ kalmia_bind(struct usbnet *dev, struct usb_interface *intf)
{
int status;
u8 ethernet_addr[ETH_ALEN];
+ static const u8 ep_addr[] = {
+ 1 | USB_DIR_IN,
+ 2 | USB_DIR_OUT,
+ 0};
/* Don't bind to AT command interface */
if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
return -EINVAL;
+ if (!usb_check_bulk_endpoints(intf, ep_addr))
+ return -ENODEV;
+
dev->in = usb_rcvbulkpipe(dev->udev, 0x81 & USB_ENDPOINT_NUMBER_MASK);
dev->out = usb_sndbulkpipe(dev->udev, 0x02 & USB_ENDPOINT_NUMBER_MASK);
dev->status = NULL;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 106/311] net: usb: pegasus: validate USB endpoints
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (104 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 105/311] net: usb: kalmia: " Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 107/311] can: ems_usb: ems_usb_read_bulk_callback(): check the proper length of a message Sasha Levin
` (218 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Greg Kroah-Hartman, Petko Manolov, stable, Jakub Kicinski
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 11de1d3ae5565ed22ef1f89d73d8f2d00322c699 upstream.
The pegasus driver should validate that the device it is probing has the
proper number and types of USB endpoints it is expecting before it binds
to it. If a malicious device were to not have the same urbs the driver
will crash later on when it blindly accesses these endpoints.
Cc: Petko Manolov <petkan@nucleusys.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/2026022347-legibly-attest-cc5c@gregkh
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/usb/pegasus.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index 0f16a133c75d1..475b066081c7f 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -815,8 +815,19 @@ static void unlink_all_urbs(pegasus_t *pegasus)
static int alloc_urbs(pegasus_t *pegasus)
{
+ static const u8 bulk_ep_addr[] = {
+ 1 | USB_DIR_IN,
+ 2 | USB_DIR_OUT,
+ 0};
+ static const u8 int_ep_addr[] = {
+ 3 | USB_DIR_IN,
+ 0};
int res = -ENOMEM;
+ if (!usb_check_bulk_endpoints(pegasus->intf, bulk_ep_addr) ||
+ !usb_check_int_endpoints(pegasus->intf, int_ep_addr))
+ return -ENODEV;
+
pegasus->rx_urb = usb_alloc_urb(0, GFP_KERNEL);
if (!pegasus->rx_urb) {
return res;
@@ -1171,6 +1182,7 @@ static int pegasus_probe(struct usb_interface *intf,
pegasus = netdev_priv(net);
pegasus->dev_index = dev_index;
+ pegasus->intf = intf;
res = alloc_urbs(pegasus);
if (res < 0) {
@@ -1182,7 +1194,6 @@ static int pegasus_probe(struct usb_interface *intf,
INIT_DELAYED_WORK(&pegasus->carrier_check, check_carrier);
- pegasus->intf = intf;
pegasus->usb = dev;
pegasus->net = net;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 107/311] can: ems_usb: ems_usb_read_bulk_callback(): check the proper length of a message
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (105 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 106/311] net: usb: pegasus: " Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 108/311] can: usb: f81604: correctly anchor the urb in the read bulk callback Sasha Levin
` (217 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Greg Kroah-Hartman, Vincent Mailhol, Marc Kleine-Budde, stable
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 38a01c9700b0dcafe97dfa9dc7531bf4a245deff upstream.
When looking at the data in a USB urb, the actual_length is the size of
the buffer passed to the driver, not the transfer_buffer_length which is
set by the driver as the max size of the buffer.
When parsing the messages in ems_usb_read_bulk_callback() properly check
the size both at the beginning of parsing the message to make sure it is
big enough for the expected structure, and at the end of the message to
make sure we don't overflow past the end of the buffer for the next
message.
Cc: Vincent Mailhol <mailhol@kernel.org>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: stable@kernel.org
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/2026022316-answering-strainer-a5db@gregkh
Fixes: 702171adeed3 ("ems_usb: Added support for EMS CPC-USB/ARM7 CAN/USB interface")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/can/usb/ems_usb.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index 4c219a5b139bb..9b25dda7c1838 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -445,6 +445,11 @@ static void ems_usb_read_bulk_callback(struct urb *urb)
start = CPC_HEADER_SIZE;
while (msg_count) {
+ if (start + CPC_MSG_HEADER_LEN > urb->actual_length) {
+ netdev_err(netdev, "format error\n");
+ break;
+ }
+
msg = (struct ems_cpc_msg *)&ibuf[start];
switch (msg->type) {
@@ -474,7 +479,7 @@ static void ems_usb_read_bulk_callback(struct urb *urb)
start += CPC_MSG_HEADER_LEN + msg->length;
msg_count--;
- if (start > urb->transfer_buffer_length) {
+ if (start > urb->actual_length) {
netdev_err(netdev, "format error\n");
break;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 108/311] can: usb: f81604: correctly anchor the urb in the read bulk callback
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (106 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 107/311] can: ems_usb: ems_usb_read_bulk_callback(): check the proper length of a message Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 109/311] can: ucan: Fix infinite loop from zero-length messages Sasha Levin
` (216 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Greg Kroah-Hartman, Ji-Ze Hong (Peter Hong), Marc Kleine-Budde,
Vincent Mailhol, stable
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 952caa5da10bed22be09612433964f6877ba0dde upstream.
When submitting an urb, that is using the anchor pattern, it needs to be
anchored before submitting it otherwise it could be leaked if
usb_kill_anchored_urbs() is called. This logic is correctly done
elsewhere in the driver, except in the read bulk callback so do that
here also.
Cc: Ji-Ze Hong (Peter Hong) <peter_hong@fintek.com.tw>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Vincent Mailhol <mailhol@kernel.org>
Cc: stable@kernel.org
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/2026022334-starlight-scaling-2cea@gregkh
Fixes: 88da17436973 ("can: usb: f81604: add Fintek F81604 support")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/can/usb/f81604.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/net/can/usb/f81604.c b/drivers/net/can/usb/f81604.c
index efe61ece79ea2..28ac92d669faa 100644
--- a/drivers/net/can/usb/f81604.c
+++ b/drivers/net/can/usb/f81604.c
@@ -413,6 +413,7 @@ static void f81604_read_bulk_callback(struct urb *urb)
{
struct f81604_can_frame *frame = urb->transfer_buffer;
struct net_device *netdev = urb->context;
+ struct f81604_port_priv *priv = netdev_priv(netdev);
int ret;
if (!netif_device_present(netdev))
@@ -445,10 +446,15 @@ static void f81604_read_bulk_callback(struct urb *urb)
f81604_process_rx_packet(netdev, frame);
resubmit_urb:
+ usb_anchor_urb(urb, &priv->urbs_anchor);
ret = usb_submit_urb(urb, GFP_ATOMIC);
+ if (!ret)
+ return;
+ usb_unanchor_urb(urb);
+
if (ret == -ENODEV)
netif_device_detach(netdev);
- else if (ret)
+ else
netdev_err(netdev,
"%s: failed to resubmit read bulk urb: %pe\n",
__func__, ERR_PTR(ret));
@@ -646,10 +652,15 @@ static void f81604_read_int_callback(struct urb *urb)
f81604_handle_tx(priv, data);
resubmit_urb:
+ usb_anchor_urb(urb, &priv->urbs_anchor);
ret = usb_submit_urb(urb, GFP_ATOMIC);
+ if (!ret)
+ return;
+ usb_unanchor_urb(urb);
+
if (ret == -ENODEV)
netif_device_detach(netdev);
- else if (ret)
+ else
netdev_err(netdev, "%s: failed to resubmit int urb: %pe\n",
__func__, ERR_PTR(ret));
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 109/311] can: ucan: Fix infinite loop from zero-length messages
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (107 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 108/311] can: usb: f81604: correctly anchor the urb in the read bulk callback Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 110/311] can: usb: etas_es58x: correctly anchor the urb in the read bulk callback Sasha Levin
` (215 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Greg Kroah-Hartman, Marc Kleine-Budde, Vincent Mailhol, stable
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 1e446fd0582ad8be9f6dafb115fc2e7245f9bea7 upstream.
If a broken ucan device gets a message with the message length field set
to 0, then the driver will loop for forever in
ucan_read_bulk_callback(), hanging the system. If the length is 0, just
skip the message and go on to the next one.
This has been fixed in the kvaser_usb driver in the past in commit
0c73772cd2b8 ("can: kvaser_usb: leaf: Fix potential infinite loop in
command parsers"), so there must be some broken devices out there like
this somewhere.
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Vincent Mailhol <mailhol@kernel.org>
Cc: stable@kernel.org
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/2026022319-huff-absurd-6a18@gregkh
Fixes: 9f2d3eae88d2 ("can: ucan: add driver for Theobroma Systems UCAN devices")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/can/usb/ucan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/ucan.c b/drivers/net/can/usb/ucan.c
index de61d9da99e35..87ddeff0937fb 100644
--- a/drivers/net/can/usb/ucan.c
+++ b/drivers/net/can/usb/ucan.c
@@ -749,7 +749,7 @@ static void ucan_read_bulk_callback(struct urb *urb)
len = le16_to_cpu(m->len);
/* check sanity (length of content) */
- if (urb->actual_length - pos < len) {
+ if ((len == 0) || (urb->actual_length - pos < len)) {
netdev_warn(up->netdev,
"invalid message (short; no data; l:%d)\n",
urb->actual_length);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 110/311] can: usb: etas_es58x: correctly anchor the urb in the read bulk callback
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (108 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 109/311] can: ucan: Fix infinite loop from zero-length messages Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 111/311] can: usb: f81604: handle short interrupt urb messages properly Sasha Levin
` (214 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Greg Kroah-Hartman, Vincent Mailhol, Marc Kleine-Budde, stable
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 5eaad4f768266f1f17e01232ffe2ef009f8129b7 upstream.
When submitting an urb, that is using the anchor pattern, it needs to be
anchored before submitting it otherwise it could be leaked if
usb_kill_anchored_urbs() is called. This logic is correctly done
elsewhere in the driver, except in the read bulk callback so do that
here also.
Cc: Vincent Mailhol <mailhol@kernel.org>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: stable@kernel.org
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Vincent Mailhol <mailhol@kernel.org>
Tested-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/2026022320-poser-stiffly-9d84@gregkh
Fixes: 8537257874e9 ("can: etas_es58x: add core support for ETAS ES58X CAN USB interfaces")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/can/usb/etas_es58x/es58x_core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c
index 2d248deb69dc1..b259f61098083 100644
--- a/drivers/net/can/usb/etas_es58x/es58x_core.c
+++ b/drivers/net/can/usb/etas_es58x/es58x_core.c
@@ -1461,12 +1461,18 @@ static void es58x_read_bulk_callback(struct urb *urb)
}
resubmit_urb:
+ usb_anchor_urb(urb, &es58x_dev->rx_urbs);
ret = usb_submit_urb(urb, GFP_ATOMIC);
+ if (!ret)
+ return;
+
+ usb_unanchor_urb(urb);
+
if (ret == -ENODEV) {
for (i = 0; i < es58x_dev->num_can_ch; i++)
if (es58x_dev->netdev[i])
netif_device_detach(es58x_dev->netdev[i]);
- } else if (ret)
+ } else
dev_err_ratelimited(dev,
"Failed resubmitting read bulk urb: %pe\n",
ERR_PTR(ret));
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 111/311] can: usb: f81604: handle short interrupt urb messages properly
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (109 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 110/311] can: usb: etas_es58x: correctly anchor the urb in the read bulk callback Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 112/311] can: usb: f81604: handle bulk write errors properly Sasha Levin
` (213 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Greg Kroah-Hartman, Ji-Ze Hong (Peter Hong), Marc Kleine-Budde,
Vincent Mailhol, stable
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 7299b1b39a255f6092ce4ec0b65f66e9d6a357af upstream.
If an interrupt urb is received that is not the correct length, properly
detect it and don't attempt to treat the data as valid.
Cc: Ji-Ze Hong (Peter Hong) <peter_hong@fintek.com.tw>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Vincent Mailhol <mailhol@kernel.org>
Cc: stable@kernel.org
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/2026022331-opal-evaluator-a928@gregkh
Fixes: 88da17436973 ("can: usb: f81604: add Fintek F81604 support")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/can/usb/f81604.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/can/usb/f81604.c b/drivers/net/can/usb/f81604.c
index 28ac92d669faa..afd216949d03f 100644
--- a/drivers/net/can/usb/f81604.c
+++ b/drivers/net/can/usb/f81604.c
@@ -626,6 +626,12 @@ static void f81604_read_int_callback(struct urb *urb)
netdev_info(netdev, "%s: Int URB aborted: %pe\n", __func__,
ERR_PTR(urb->status));
+ if (urb->actual_length < sizeof(*data)) {
+ netdev_warn(netdev, "%s: short int URB: %u < %zu\n",
+ __func__, urb->actual_length, sizeof(*data));
+ goto resubmit_urb;
+ }
+
switch (urb->status) {
case 0: /* success */
break;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 112/311] can: usb: f81604: handle bulk write errors properly
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (110 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 111/311] can: usb: f81604: handle short interrupt urb messages properly Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 113/311] HID: Add HID_CLAIMED_INPUT guards in raw_event callbacks missing them Sasha Levin
` (212 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Greg Kroah-Hartman, Ji-Ze Hong (Peter Hong), Marc Kleine-Budde,
Vincent Mailhol, stable
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 51f94780720fa90c424f67e3e9784cb8ef8190e5 upstream.
If a write urb fails then more needs to be done other than just logging
the message, otherwise the transmission could be stalled. Properly
increment the error counters and wake up the queues so that data will
continue to flow.
Cc: Ji-Ze Hong (Peter Hong) <peter_hong@fintek.com.tw>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Vincent Mailhol <mailhol@kernel.org>
Cc: stable@kernel.org
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/2026022334-slackness-dynamic-9195@gregkh
Fixes: 88da17436973 ("can: usb: f81604: add Fintek F81604 support")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/can/usb/f81604.c | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/drivers/net/can/usb/f81604.c b/drivers/net/can/usb/f81604.c
index afd216949d03f..ea70ddf325d32 100644
--- a/drivers/net/can/usb/f81604.c
+++ b/drivers/net/can/usb/f81604.c
@@ -891,9 +891,27 @@ static void f81604_write_bulk_callback(struct urb *urb)
if (!netif_device_present(netdev))
return;
- if (urb->status)
- netdev_info(netdev, "%s: Tx URB error: %pe\n", __func__,
- ERR_PTR(urb->status));
+ if (!urb->status)
+ return;
+
+ switch (urb->status) {
+ case -ENOENT:
+ case -ECONNRESET:
+ case -ESHUTDOWN:
+ return;
+ default:
+ break;
+ }
+
+ if (net_ratelimit())
+ netdev_err(netdev, "%s: Tx URB error: %pe\n", __func__,
+ ERR_PTR(urb->status));
+
+ can_free_echo_skb(netdev, 0, NULL);
+ netdev->stats.tx_dropped++;
+ netdev->stats.tx_errors++;
+
+ netif_wake_queue(netdev);
}
static void f81604_clear_reg_work(struct work_struct *work)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 113/311] HID: Add HID_CLAIMED_INPUT guards in raw_event callbacks missing them
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (111 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 112/311] can: usb: f81604: handle bulk write errors properly Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 114/311] HID: pidff: Fix condition effect bit clearing Sasha Levin
` (211 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Greg Kroah-Hartman, Jiri Kosina, Benjamin Tissoires,
Bastien Nocera, linux-input, stable
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit ecfa6f34492c493a9a1dc2900f3edeb01c79946b upstream.
In commit 2ff5baa9b527 ("HID: appleir: Fix potential NULL dereference at
raw event handle"), we handle the fact that raw event callbacks
can happen even for a HID device that has not been "claimed" causing a
crash if a broken device were attempted to be connected to the system.
Fix up the remaining in-tree HID drivers that forgot to add this same
check to resolve the same issue.
Cc: Jiri Kosina <jikos@kernel.org>
Cc: Benjamin Tissoires <bentiss@kernel.org>
Cc: Bastien Nocera <hadess@hadess.net>
Cc: linux-input@vger.kernel.org
Cc: stable <stable@kernel.org>
Assisted-by: gkh_clanker_2000
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hid/hid-cmedia.c | 2 +-
drivers/hid/hid-creative-sb0540.c | 2 +-
drivers/hid/hid-zydacron.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-cmedia.c b/drivers/hid/hid-cmedia.c
index 528d7f3612157..8bf5649b0c793 100644
--- a/drivers/hid/hid-cmedia.c
+++ b/drivers/hid/hid-cmedia.c
@@ -99,7 +99,7 @@ static int cmhid_raw_event(struct hid_device *hid, struct hid_report *report,
{
struct cmhid *cm = hid_get_drvdata(hid);
- if (len != CM6533_JD_RAWEV_LEN)
+ if (len != CM6533_JD_RAWEV_LEN || !(hid->claimed & HID_CLAIMED_INPUT))
goto out;
if (memcmp(data+CM6533_JD_SFX_OFFSET, ji_sfx, sizeof(ji_sfx)))
goto out;
diff --git a/drivers/hid/hid-creative-sb0540.c b/drivers/hid/hid-creative-sb0540.c
index b4c8e7a5d3e02..dfd6add353d19 100644
--- a/drivers/hid/hid-creative-sb0540.c
+++ b/drivers/hid/hid-creative-sb0540.c
@@ -153,7 +153,7 @@ static int creative_sb0540_raw_event(struct hid_device *hid,
u64 code, main_code;
int key;
- if (len != 6)
+ if (len != 6 || !(hid->claimed & HID_CLAIMED_INPUT))
return 0;
/* From daemons/hw_hiddev.c sb0540_rec() in lirc */
diff --git a/drivers/hid/hid-zydacron.c b/drivers/hid/hid-zydacron.c
index 3bdb26f455925..1aae80f848f50 100644
--- a/drivers/hid/hid-zydacron.c
+++ b/drivers/hid/hid-zydacron.c
@@ -114,7 +114,7 @@ static int zc_raw_event(struct hid_device *hdev, struct hid_report *report,
unsigned key;
unsigned short index;
- if (report->id == data[0]) {
+ if (report->id == data[0] && (hdev->claimed & HID_CLAIMED_INPUT)) {
/* break keys */
for (index = 0; index < 4; index++) {
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 114/311] HID: pidff: Fix condition effect bit clearing
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (112 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 113/311] HID: Add HID_CLAIMED_INPUT guards in raw_event callbacks missing them Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 115/311] HID: multitouch: Keep latency normal on deactivate for reactivation gesture Sasha Levin
` (210 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Tomasz Pakuła, Jiri Kosina, Greg Kroah-Hartman
From: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
commit 97d5c8f5c09a604c4873c8348f58de3cea69a7df upstream.
As reported by MPDarkGuy on discord, NULL pointer dereferences were
happening because not all the conditional effects bits were cleared.
Properly clear all conditional effect bits from ffbit
Fixes: 7f3d7bc0df4b ("HID: pidff: Better quirk assigment when searching for fields")
Cc: stable@vger.kernel.org # 6.18.x
Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hid/usbhid/hid-pidff.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c
index a4e700b40ba9b..56d6af39ba81e 100644
--- a/drivers/hid/usbhid/hid-pidff.c
+++ b/drivers/hid/usbhid/hid-pidff.c
@@ -1452,10 +1452,13 @@ static int pidff_init_fields(struct pidff_device *pidff, struct input_dev *dev)
hid_warn(pidff->hid, "unknown ramp effect layout\n");
if (PIDFF_FIND_FIELDS(set_condition, PID_SET_CONDITION, 1)) {
- if (test_and_clear_bit(FF_SPRING, dev->ffbit) ||
- test_and_clear_bit(FF_DAMPER, dev->ffbit) ||
- test_and_clear_bit(FF_FRICTION, dev->ffbit) ||
- test_and_clear_bit(FF_INERTIA, dev->ffbit))
+ bool test = false;
+
+ test |= test_and_clear_bit(FF_SPRING, dev->ffbit);
+ test |= test_and_clear_bit(FF_DAMPER, dev->ffbit);
+ test |= test_and_clear_bit(FF_FRICTION, dev->ffbit);
+ test |= test_and_clear_bit(FF_INERTIA, dev->ffbit);
+ if (test)
hid_warn(pidff->hid, "unknown condition effect layout\n");
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 115/311] HID: multitouch: Keep latency normal on deactivate for reactivation gesture
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (113 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 114/311] HID: pidff: Fix condition effect bit clearing Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 116/311] x86/efi: defer freeing of boot services memory Sasha Levin
` (209 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Werner Sembach, Jiri Kosina, Greg Kroah-Hartman
From: Werner Sembach <wse@tuxedocomputers.com>
commit ec3070f01fa30f2c5547d645dbb76174304bf0e4 upstream.
Uniwill devices have a built in gesture in the touchpad to de- and
reactivate it by double taping the upper left corner. This gesture stops
working when latency is set to high, so this patch keeps the latency on
normal.
Cc: stable@vger.kernel.org
Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
[jkosina@suse.com: change bit from 24 to 25]
[jkosina@suse.com: update shortlog]
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hid/hid-multitouch.c | 32 +++++++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 7daa8f6d81870..dde15d131a73e 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -77,6 +77,7 @@ MODULE_LICENSE("GPL");
#define MT_QUIRK_ORIENTATION_INVERT BIT(22)
#define MT_QUIRK_APPLE_TOUCHBAR BIT(23)
#define MT_QUIRK_YOGABOOK9I BIT(24)
+#define MT_QUIRK_KEEP_LATENCY_ON_CLOSE BIT(25)
#define MT_INPUTMODE_TOUCHSCREEN 0x02
#define MT_INPUTMODE_TOUCHPAD 0x03
@@ -214,6 +215,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
#define MT_CLS_WIN_8_DISABLE_WAKEUP 0x0016
#define MT_CLS_WIN_8_NO_STICKY_FINGERS 0x0017
#define MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU 0x0018
+#define MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE 0x0019
/* vendor specific classes */
#define MT_CLS_3M 0x0101
@@ -334,6 +336,15 @@ static const struct mt_class mt_classes[] = {
MT_QUIRK_CONTACT_CNT_ACCURATE |
MT_QUIRK_WIN8_PTP_BUTTONS,
.export_all_inputs = true },
+ { .name = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_IGNORE_DUPLICATES |
+ MT_QUIRK_HOVERING |
+ MT_QUIRK_CONTACT_CNT_ACCURATE |
+ MT_QUIRK_STICKY_FINGERS |
+ MT_QUIRK_WIN8_PTP_BUTTONS |
+ MT_QUIRK_KEEP_LATENCY_ON_CLOSE,
+ .export_all_inputs = true },
/*
* vendor specific classes
@@ -849,7 +860,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
if ((cls->name == MT_CLS_WIN_8 ||
cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT ||
cls->name == MT_CLS_WIN_8_FORCE_MULTI_INPUT_NSMU ||
- cls->name == MT_CLS_WIN_8_DISABLE_WAKEUP) &&
+ cls->name == MT_CLS_WIN_8_DISABLE_WAKEUP ||
+ cls->name == MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE) &&
(field->application == HID_DG_TOUCHPAD ||
field->application == HID_DG_TOUCHSCREEN))
app->quirks |= MT_QUIRK_CONFIDENCE;
@@ -1762,7 +1774,8 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
int ret;
if (td->is_haptic_touchpad && (td->mtclass.name == MT_CLS_WIN_8 ||
- td->mtclass.name == MT_CLS_WIN_8_FORCE_MULTI_INPUT)) {
+ td->mtclass.name == MT_CLS_WIN_8_FORCE_MULTI_INPUT ||
+ td->mtclass.name == MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE)) {
if (hid_haptic_input_configured(hdev, td->haptic, hi) == 0)
td->is_haptic_touchpad = false;
} else {
@@ -2075,7 +2088,12 @@ static void mt_on_hid_hw_open(struct hid_device *hdev)
static void mt_on_hid_hw_close(struct hid_device *hdev)
{
- mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
+ struct mt_device *td = hid_get_drvdata(hdev);
+
+ if (td->mtclass.quirks & MT_QUIRK_KEEP_LATENCY_ON_CLOSE)
+ mt_set_modes(hdev, HID_LATENCY_NORMAL, TOUCHPAD_REPORT_NONE);
+ else
+ mt_set_modes(hdev, HID_LATENCY_HIGH, TOUCHPAD_REPORT_NONE);
}
/*
@@ -2461,6 +2479,14 @@ static const struct hid_device_id mt_devices[] = {
MT_USB_DEVICE(USB_VENDOR_ID_UNITEC,
USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
+ /* Uniwill touchpads */
+ { .driver_data = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
+ HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
+ USB_VENDOR_ID_PIXART, 0x0255) },
+ { .driver_data = MT_CLS_WIN_8_KEEP_LATENCY_ON_CLOSE,
+ HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
+ USB_VENDOR_ID_PIXART, 0x0274) },
+
/* VTL panels */
{ .driver_data = MT_CLS_VTL,
MT_USB_DEVICE(USB_VENDOR_ID_VTL,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 116/311] x86/efi: defer freeing of boot services memory
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (114 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 115/311] HID: multitouch: Keep latency normal on deactivate for reactivation gesture Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 117/311] perf/x86/intel/uncore: Add per-scheduler IMC CAS count events Sasha Levin
` (208 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Mike Rapoport (Microsoft), Benjamin Herrenschmidt, Ard Biesheuvel,
Greg Kroah-Hartman
From: "Mike Rapoport (Microsoft)" <rppt@kernel.org>
commit a4b0bf6a40f3c107c67a24fbc614510ef5719980 upstream.
efi_free_boot_services() frees memory occupied by EFI_BOOT_SERVICES_CODE
and EFI_BOOT_SERVICES_DATA using memblock_free_late().
There are two issue with that: memblock_free_late() should be used for
memory allocated with memblock_alloc() while the memory reserved with
memblock_reserve() should be freed with free_reserved_area().
More acutely, with CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
efi_free_boot_services() is called before deferred initialization of the
memory map is complete.
Benjamin Herrenschmidt reports that this causes a leak of ~140MB of
RAM on EC2 t3a.nano instances which only have 512MB or RAM.
If the freed memory resides in the areas that memory map for them is
still uninitialized, they won't be actually freed because
memblock_free_late() calls memblock_free_pages() and the latter skips
uninitialized pages.
Using free_reserved_area() at this point is also problematic because
__free_page() accesses the buddy of the freed page and that again might
end up in uninitialized part of the memory map.
Delaying the entire efi_free_boot_services() could be problematic
because in addition to freeing boot services memory it updates
efi.memmap without any synchronization and that's undesirable late in
boot when there is concurrency.
More robust approach is to only defer freeing of the EFI boot services
memory.
Split efi_free_boot_services() in two. First efi_unmap_boot_services()
collects ranges that should be freed into an array then
efi_free_boot_services() later frees them after deferred init is complete.
Link: https://lore.kernel.org/all/ec2aaef14783869b3be6e3c253b2dcbf67dbc12a.camel@kernel.crashing.org
Fixes: 916f676f8dc0 ("x86, efi: Retain boot service code until after switching to virtual mode")
Cc: <stable@vger.kernel.org>
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/include/asm/efi.h | 2 +-
arch/x86/platform/efi/efi.c | 2 +-
arch/x86/platform/efi/quirks.c | 55 +++++++++++++++++++++++++++--
drivers/firmware/efi/mokvar-table.c | 2 +-
4 files changed, 55 insertions(+), 6 deletions(-)
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index f227a70ac91f0..51b4cdbea061a 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -138,7 +138,7 @@ extern void __init efi_apply_memmap_quirks(void);
extern int __init efi_reuse_config(u64 tables, int nr_tables);
extern void efi_delete_dummy_variable(void);
extern void efi_crash_gracefully_on_page_fault(unsigned long phys_addr);
-extern void efi_free_boot_services(void);
+extern void efi_unmap_boot_services(void);
void arch_efi_call_virt_setup(void);
void arch_efi_call_virt_teardown(void);
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
index 463b784499a8f..791c52c8393f4 100644
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -837,7 +837,7 @@ static void __init __efi_enter_virtual_mode(void)
}
efi_check_for_embedded_firmwares();
- efi_free_boot_services();
+ efi_unmap_boot_services();
if (!efi_is_mixed())
efi_native_runtime_setup();
diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
index 553f330198f2f..35caa5746115d 100644
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -341,7 +341,7 @@ void __init efi_reserve_boot_services(void)
/*
* Because the following memblock_reserve() is paired
- * with memblock_free_late() for this region in
+ * with free_reserved_area() for this region in
* efi_free_boot_services(), we must be extremely
* careful not to reserve, and subsequently free,
* critical regions of memory (like the kernel image) or
@@ -404,17 +404,33 @@ static void __init efi_unmap_pages(efi_memory_desc_t *md)
pr_err("Failed to unmap VA mapping for 0x%llx\n", va);
}
-void __init efi_free_boot_services(void)
+struct efi_freeable_range {
+ u64 start;
+ u64 end;
+};
+
+static struct efi_freeable_range *ranges_to_free;
+
+void __init efi_unmap_boot_services(void)
{
struct efi_memory_map_data data = { 0 };
efi_memory_desc_t *md;
int num_entries = 0;
+ int idx = 0;
+ size_t sz;
void *new, *new_md;
/* Keep all regions for /sys/kernel/debug/efi */
if (efi_enabled(EFI_DBG))
return;
+ sz = sizeof(*ranges_to_free) * efi.memmap.nr_map + 1;
+ ranges_to_free = kzalloc(sz, GFP_KERNEL);
+ if (!ranges_to_free) {
+ pr_err("Failed to allocate storage for freeable EFI regions\n");
+ return;
+ }
+
for_each_efi_memory_desc(md) {
unsigned long long start = md->phys_addr;
unsigned long long size = md->num_pages << EFI_PAGE_SHIFT;
@@ -471,7 +487,15 @@ void __init efi_free_boot_services(void)
start = SZ_1M;
}
- memblock_free_late(start, size);
+ /*
+ * With CONFIG_DEFERRED_STRUCT_PAGE_INIT parts of the memory
+ * map are still not initialized and we can't reliably free
+ * memory here.
+ * Queue the ranges to free at a later point.
+ */
+ ranges_to_free[idx].start = start;
+ ranges_to_free[idx].end = start + size;
+ idx++;
}
if (!num_entries)
@@ -512,6 +536,31 @@ void __init efi_free_boot_services(void)
}
}
+static int __init efi_free_boot_services(void)
+{
+ struct efi_freeable_range *range = ranges_to_free;
+ unsigned long freed = 0;
+
+ if (!ranges_to_free)
+ return 0;
+
+ while (range->start) {
+ void *start = phys_to_virt(range->start);
+ void *end = phys_to_virt(range->end);
+
+ free_reserved_area(start, end, -1, NULL);
+ freed += (end - start);
+ range++;
+ }
+ kfree(ranges_to_free);
+
+ if (freed)
+ pr_info("Freeing EFI boot services memory: %ldK\n", freed / SZ_1K);
+
+ return 0;
+}
+arch_initcall(efi_free_boot_services);
+
/*
* A number of config table entries get remapped to virtual addresses
* after entering EFI virtual mode. However, the kexec kernel requires
diff --git a/drivers/firmware/efi/mokvar-table.c b/drivers/firmware/efi/mokvar-table.c
index aedbbd627706a..741674a0a70c5 100644
--- a/drivers/firmware/efi/mokvar-table.c
+++ b/drivers/firmware/efi/mokvar-table.c
@@ -85,7 +85,7 @@ static struct kobject *mokvar_kobj;
* as an alternative to ordinary EFI variables, due to platform-dependent
* limitations. The memory occupied by this table is marked as reserved.
*
- * This routine must be called before efi_free_boot_services() in order
+ * This routine must be called before efi_unmap_boot_services() in order
* to guarantee that it can mark the table as reserved.
*
* Implicit inputs:
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 117/311] perf/x86/intel/uncore: Add per-scheduler IMC CAS count events
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (115 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 116/311] x86/efi: defer freeing of boot services memory Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 118/311] x86/boot: Handle relative CONFIG_EFI_SBAT_FILE file paths Sasha Levin
` (207 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Zide Chen, Reinette Chatre, Peter Zijlstra (Intel), Dapeng Mi,
Greg Kroah-Hartman
From: Zide Chen <zide.chen@intel.com>
commit 6a8a48644c4b804123e59dbfc5d6cd29a0194046 upstream.
IMC on SPR and EMR does not support sub-channels. In contrast, CPUs
that use gnr_uncores[] (e.g. Granite Rapids and Sierra Forest)
implement two command schedulers (SCH0/SCH1) per memory channel,
providing logically independent command and data paths.
Do not reuse the spr_uncore_imc[] configuration for these CPUs.
Instead, introduce a dedicated gnr_uncore_imc[] with per-scheduler
events, so userspace can monitor SCH0 and SCH1 independently.
On these CPUs, replace cas_count_{read,write} with
cas_count_{read,write}_sch{0,1}. This may break existing userspace
that relies on cas_count_{read,write}, prompting it to switch to the
per-scheduler events, as the legacy event reports only partial
traffic (SCH0).
Fixes: 632c4bf6d007 ("perf/x86/intel/uncore: Support Granite Rapids")
Fixes: cb4a6ccf3583 ("perf/x86/intel/uncore: Support Sierra Forest and Grand Ridge")
Reported-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260210005225.20311-1-zide.chen@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/events/intel/uncore_snbep.c | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index e1f370b8d065f..a338ee01bb242 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -6610,6 +6610,32 @@ static struct intel_uncore_type gnr_uncore_ubox = {
.attr_update = uncore_alias_groups,
};
+static struct uncore_event_desc gnr_uncore_imc_events[] = {
+ INTEL_UNCORE_EVENT_DESC(clockticks, "event=0x01,umask=0x00"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch0, "event=0x05,umask=0xcf"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch0.scale, "6.103515625e-5"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch0.unit, "MiB"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch1, "event=0x06,umask=0xcf"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch1.scale, "6.103515625e-5"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_read_sch1.unit, "MiB"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch0, "event=0x05,umask=0xf0"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch0.scale, "6.103515625e-5"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch0.unit, "MiB"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch1, "event=0x06,umask=0xf0"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch1.scale, "6.103515625e-5"),
+ INTEL_UNCORE_EVENT_DESC(cas_count_write_sch1.unit, "MiB"),
+ { /* end: all zeroes */ },
+};
+
+static struct intel_uncore_type gnr_uncore_imc = {
+ SPR_UNCORE_MMIO_COMMON_FORMAT(),
+ .name = "imc",
+ .fixed_ctr_bits = 48,
+ .fixed_ctr = SNR_IMC_MMIO_PMON_FIXED_CTR,
+ .fixed_ctl = SNR_IMC_MMIO_PMON_FIXED_CTL,
+ .event_descs = gnr_uncore_imc_events,
+};
+
static struct intel_uncore_type gnr_uncore_pciex8 = {
SPR_UNCORE_PCI_COMMON_FORMAT(),
.name = "pciex8",
@@ -6657,7 +6683,7 @@ static struct intel_uncore_type *gnr_uncores[UNCORE_GNR_NUM_UNCORE_TYPES] = {
NULL,
&spr_uncore_pcu,
&gnr_uncore_ubox,
- &spr_uncore_imc,
+ &gnr_uncore_imc,
NULL,
&gnr_uncore_upi,
NULL,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 118/311] x86/boot: Handle relative CONFIG_EFI_SBAT_FILE file paths
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (116 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 117/311] perf/x86/intel/uncore: Add per-scheduler IMC CAS count events Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 119/311] x86/sev: Allow IBPB-on-Entry feature for SNP guests Sasha Levin
` (206 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Jan Stancek, Borislav Petkov (AMD), Vitaly Kuznetsov, stable,
Greg Kroah-Hartman
From: Jan Stancek <jstancek@redhat.com>
commit 3d1973a0c76a78a4728cff13648a188ed486cf44 upstream.
CONFIG_EFI_SBAT_FILE can be a relative path. When compiling using a different
output directory (O=) the build currently fails because it can't find the
filename set in CONFIG_EFI_SBAT_FILE:
arch/x86/boot/compressed/sbat.S: Assembler messages:
arch/x86/boot/compressed/sbat.S:6: Error: file not found: kernel.sbat
Add $(srctree) as include dir for sbat.o.
[ bp: Massage commit message. ]
Fixes: 61b57d35396a ("x86/efi: Implement support for embedding SBAT data for x86")
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: <stable@kernel.org>
Link: https://patch.msgid.link/f4eda155b0cef91d4d316b4e92f5771cb0aa7187.1772047658.git.jstancek@redhat.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/boot/compressed/Makefile | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 68f9d7a1683b5..b8b2b7bea1d31 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -113,6 +113,7 @@ vmlinux-objs-$(CONFIG_EFI_SBAT) += $(obj)/sbat.o
ifdef CONFIG_EFI_SBAT
$(obj)/sbat.o: $(CONFIG_EFI_SBAT_FILE)
+AFLAGS_sbat.o += -I $(srctree)
endif
$(obj)/vmlinux: $(vmlinux-objs-y) $(vmlinux-libs-y) FORCE
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 119/311] x86/sev: Allow IBPB-on-Entry feature for SNP guests
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (117 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 118/311] x86/boot: Handle relative CONFIG_EFI_SBAT_FILE file paths Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 120/311] x86/boot/sev: Move SEV decompressor variables into the .data section Sasha Levin
` (205 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Kim Phillips, Borislav Petkov (AMD), Nikunj A Dadhania,
Tom Lendacky, stable, Greg Kroah-Hartman
From: Kim Phillips <kim.phillips@amd.com>
commit 9073428bb204d921ae15326bb7d4558d9d269aab upstream.
The SEV-SNP IBPB-on-Entry feature does not require a guest-side
implementation. It was added in Zen5 h/w, after the first SNP Zen
implementation, and thus was not accounted for when the initial set of SNP
features were added to the kernel.
In its abundant precaution, commit
8c29f0165405 ("x86/sev: Add SEV-SNP guest feature negotiation support")
included SEV_STATUS' IBPB-on-Entry bit as a reserved bit, thereby masking
guests from using the feature.
Allow guests to make use of IBPB-on-Entry when supported by the hypervisor, as
the bit is now architecturally defined and safe to expose.
Fixes: 8c29f0165405 ("x86/sev: Add SEV-SNP guest feature negotiation support")
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Nikunj A Dadhania <nikunj@amd.com>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Cc: stable@kernel.org
Link: https://patch.msgid.link/20260203222405.4065706-2-kim.phillips@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/boot/compressed/sev.c | 1 +
arch/x86/coco/sev/core.c | 1 +
arch/x86/include/asm/msr-index.h | 5 ++++-
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c
index c8c1464b3a56e..2b639703b8dd4 100644
--- a/arch/x86/boot/compressed/sev.c
+++ b/arch/x86/boot/compressed/sev.c
@@ -188,6 +188,7 @@ bool sev_es_check_ghcb_fault(unsigned long address)
MSR_AMD64_SNP_RESERVED_BIT13 | \
MSR_AMD64_SNP_RESERVED_BIT15 | \
MSR_AMD64_SNP_SECURE_AVIC | \
+ MSR_AMD64_SNP_RESERVED_BITS19_22 | \
MSR_AMD64_SNP_RESERVED_MASK)
#ifdef CONFIG_AMD_SECURE_AVIC
diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
index c8ddb9febe3d9..d20e9cc065a87 100644
--- a/arch/x86/coco/sev/core.c
+++ b/arch/x86/coco/sev/core.c
@@ -122,6 +122,7 @@ static const char * const sev_status_feat_names[] = {
[MSR_AMD64_SNP_VMSA_REG_PROT_BIT] = "VMSARegProt",
[MSR_AMD64_SNP_SMT_PROT_BIT] = "SMTProt",
[MSR_AMD64_SNP_SECURE_AVIC_BIT] = "SecureAVIC",
+ [MSR_AMD64_SNP_IBPB_ON_ENTRY_BIT] = "IBPBOnEntry",
};
/*
diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h
index 3d0a0950d20a1..d1b11b4c40d28 100644
--- a/arch/x86/include/asm/msr-index.h
+++ b/arch/x86/include/asm/msr-index.h
@@ -735,7 +735,10 @@
#define MSR_AMD64_SNP_SMT_PROT BIT_ULL(MSR_AMD64_SNP_SMT_PROT_BIT)
#define MSR_AMD64_SNP_SECURE_AVIC_BIT 18
#define MSR_AMD64_SNP_SECURE_AVIC BIT_ULL(MSR_AMD64_SNP_SECURE_AVIC_BIT)
-#define MSR_AMD64_SNP_RESV_BIT 19
+#define MSR_AMD64_SNP_RESERVED_BITS19_22 GENMASK_ULL(22, 19)
+#define MSR_AMD64_SNP_IBPB_ON_ENTRY_BIT 23
+#define MSR_AMD64_SNP_IBPB_ON_ENTRY BIT_ULL(MSR_AMD64_SNP_IBPB_ON_ENTRY_BIT)
+#define MSR_AMD64_SNP_RESV_BIT 24
#define MSR_AMD64_SNP_RESERVED_MASK GENMASK_ULL(63, MSR_AMD64_SNP_RESV_BIT)
#define MSR_AMD64_SAVIC_CONTROL 0xc0010138
#define MSR_AMD64_SAVIC_EN_BIT 0
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 120/311] x86/boot/sev: Move SEV decompressor variables into the .data section
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (118 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 119/311] x86/sev: Allow IBPB-on-Entry feature for SNP guests Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 121/311] platform/x86: dell-wmi-sysman: Don't hex dump plaintext password data Sasha Levin
` (204 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Tom Lendacky, Borislav Petkov (AMD), Ard Biesheuvel,
Changyuan Lyu, Kevin Hui, Greg Kroah-Hartman
From: Tom Lendacky <thomas.lendacky@amd.com>
commit 4ca191cec17a997d0e3b2cd312f3a884288acc27 upstream.
As part of the work to remove the dependency on calling into the decompressor
code (startup_64()) for a UEFI boot, a call to rmpadjust() was removed from
sev_enable() in favor of checking the value of the snp_vmpl variable.
When booting through a non-UEFI path and calling startup_64(), the call to
sev_enable() is performed before the BSS section is zeroed. With the removal
of the rmpadjust() call and the corresponding check of the return code, the
snp_vmpl variable is checked.
Since the kernel is running at VMPL0, the snp_vmpl variable will not have been
set and should be the default value of 0. However, since the call occurs
before the BSS is zeroed, the snp_vmpl variable may not actually be zero,
which will cause the guest boot to fail.
Since the decompressor relocates itself, the BSS would need to be cleared both
before and after the relocation, but this would, in effect, cause all of the
changes to BSS variables before relocation to be lost after relocation.
Instead, move the snp_vmpl variable into the .data section so that it is
initialized and the value made safe during relocation. As a pre-caution
against future changes, move other SEV-related decompressor variables into the
.data section, too.
Fixes: 68a501d7fd82 ("x86/boot: Drop redundant RMPADJUST in SEV SVSM presence check")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Changyuan Lyu <changyuanl@google.com>
Tested-by: Kevin Hui <kevinhui@meta.com>
Tested-by: Changyuan Lyu <changyuanl@google.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/5648b7de5b0a5d0dfef3785f9582b718678c6448.1770217260.git.thomas.lendacky@amd.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/boot/compressed/sev.c | 8 ++++----
arch/x86/boot/startup/sev-shared.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/x86/boot/compressed/sev.c b/arch/x86/boot/compressed/sev.c
index 2b639703b8dd4..e468476e9e4a0 100644
--- a/arch/x86/boot/compressed/sev.c
+++ b/arch/x86/boot/compressed/sev.c
@@ -28,17 +28,17 @@
#include "sev.h"
static struct ghcb boot_ghcb_page __aligned(PAGE_SIZE);
-struct ghcb *boot_ghcb;
+struct ghcb *boot_ghcb __section(".data");
#undef __init
#define __init
#define __BOOT_COMPRESSED
-u8 snp_vmpl;
-u16 ghcb_version;
+u8 snp_vmpl __section(".data");
+u16 ghcb_version __section(".data");
-u64 boot_svsm_caa_pa;
+u64 boot_svsm_caa_pa __section(".data");
/* Include code for early handlers */
#include "../../boot/startup/sev-shared.c"
diff --git a/arch/x86/boot/startup/sev-shared.c b/arch/x86/boot/startup/sev-shared.c
index a0fa8bb2b9458..d9ac3a929d335 100644
--- a/arch/x86/boot/startup/sev-shared.c
+++ b/arch/x86/boot/startup/sev-shared.c
@@ -31,7 +31,7 @@ static u32 cpuid_std_range_max __ro_after_init;
static u32 cpuid_hyp_range_max __ro_after_init;
static u32 cpuid_ext_range_max __ro_after_init;
-bool sev_snp_needs_sfw;
+bool sev_snp_needs_sfw __section(".data");
void __noreturn
sev_es_terminate(unsigned int set, unsigned int reason)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 121/311] platform/x86: dell-wmi-sysman: Don't hex dump plaintext password data
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (119 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 120/311] x86/boot/sev: Move SEV decompressor variables into the .data section Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 122/311] platform/x86: alienware-wmi-wmax: Add G-Mode support to m18 laptops Sasha Levin
` (203 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Thorsten Blum, Ilpo Järvinen, Greg Kroah-Hartman
From: Thorsten Blum <thorsten.blum@linux.dev>
commit d1a196e0a6dcddd03748468a0e9e3100790fc85c upstream.
set_new_password() hex dumps the entire buffer, which contains plaintext
password data, including current and new passwords. Remove the hex dump
to avoid leaking credentials.
Fixes: e8a60aa7404b ("platform/x86: Introduce support for Systems Management Driver over WMI for Dell Systems")
Cc: stable@vger.kernel.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260303113050.58127-2-thorsten.blum@linux.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c b/drivers/platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c
index 86ec962aace9b..e586f7957946b 100644
--- a/drivers/platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c
+++ b/drivers/platform/x86/dell/dell-wmi-sysman/passwordattr-interface.c
@@ -93,7 +93,6 @@ int set_new_password(const char *password_type, const char *new)
if (ret < 0)
goto out;
- print_hex_dump_bytes("set new password data: ", DUMP_PREFIX_NONE, buffer, buffer_size);
ret = call_password_interface(wmi_priv.password_attr_wdev, buffer, buffer_size);
/* on success copy the new password to current password */
if (!ret)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 122/311] platform/x86: alienware-wmi-wmax: Add G-Mode support to m18 laptops
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (120 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 121/311] platform/x86: dell-wmi-sysman: Don't hex dump plaintext password data Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 123/311] platform/x86: dell-wmi: Add audio/mic mute key codes Sasha Levin
` (202 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Kurt Borja, Olexa Bilaniuk, Ilpo Järvinen,
Greg Kroah-Hartman
From: Kurt Borja <kuurtb@gmail.com>
commit bd5914caeb4b2de233992c31babccda88041b035 upstream.
Alienware m18 laptops support G-Mode. Therefore, match them with
G-Series quirks.
Cc: stable@vger.kernel.org
Tested-by: Olexa Bilaniuk <obilaniu@gmail.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Link: https://patch.msgid.link/20260129-m18-gmode-v1-1-48be521487b9@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/platform/x86/dell/alienware-wmi-wmax.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/dell/alienware-wmi-wmax.c b/drivers/platform/x86/dell/alienware-wmi-wmax.c
index e69b50162bb1b..d1b4df91401b1 100644
--- a/drivers/platform/x86/dell/alienware-wmi-wmax.c
+++ b/drivers/platform/x86/dell/alienware-wmi-wmax.c
@@ -175,7 +175,7 @@ static const struct dmi_system_id awcc_dmi_table[] __initconst = {
DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18"),
},
- .driver_data = &generic_quirks,
+ .driver_data = &g_series_quirks,
},
{
.ident = "Alienware x15",
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 123/311] platform/x86: dell-wmi: Add audio/mic mute key codes
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (121 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 122/311] platform/x86: alienware-wmi-wmax: Add G-Mode support to m18 laptops Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 124/311] ALSA: hda/realtek: Add quirk for HP Pavilion 15-eh1xxx to enable mute LED Sasha Levin
` (201 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Kurt Borja, Olexa Bilaniuk, Pali Rohár, Ilpo Järvinen,
Greg Kroah-Hartman
From: Kurt Borja <kuurtb@gmail.com>
commit 26a7601471f62b95d56a81c3a8ccb551b5a6630f upstream.
Add audio/mic mute key codes found in Alienware m18 r1 AMD.
Cc: stable@vger.kernel.org
Tested-by: Olexa Bilaniuk <obilaniu@gmail.com>
Suggested-by: Olexa Bilaniuk <obilaniu@gmail.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Acked-by: Pali Rohár <pali@kernel.org>
Link: https://patch.msgid.link/20260207-mute-keys-v2-1-c55e5471c9c1@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/platform/x86/dell/dell-wmi-base.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/platform/x86/dell/dell-wmi-base.c b/drivers/platform/x86/dell/dell-wmi-base.c
index 28076929d6af5..907f1da01c8db 100644
--- a/drivers/platform/x86/dell/dell-wmi-base.c
+++ b/drivers/platform/x86/dell/dell-wmi-base.c
@@ -80,6 +80,12 @@ static const struct dmi_system_id dell_wmi_smbios_list[] __initconst = {
static const struct key_entry dell_wmi_keymap_type_0000[] = {
{ KE_IGNORE, 0x003a, { KEY_CAPSLOCK } },
+ /* Audio mute toggle */
+ { KE_KEY, 0x0109, { KEY_MUTE } },
+
+ /* Mic mute toggle */
+ { KE_KEY, 0x0150, { KEY_MICMUTE } },
+
/* Meta key lock */
{ KE_IGNORE, 0xe000, { KEY_RIGHTMETA } },
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 124/311] ALSA: hda/realtek: Add quirk for HP Pavilion 15-eh1xxx to enable mute LED
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (122 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 123/311] platform/x86: dell-wmi: Add audio/mic mute key codes Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 125/311] ALSA: doc: usb-audio: Add doc for QUIRK_FLAG_SKIP_IFACE_SETUP Sasha Levin
` (200 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Zhang Heng, Takashi Iwai, Greg Kroah-Hartman
From: Zhang Heng <zhangheng@kylinos.cn>
commit 068641bc9dc3d680d1ec4f6ee9199d4812041dff upstream.
The HP Pavilion 15-eh1xxx series uses the HP mainboard 88D1 with ALC245
and needs the ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT quirk to make the
mute led working.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215978
Cc: <stable@vger.kernel.org>
Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
Link: https://patch.msgid.link/20260227121327.3751341-1-zhangheng@kylinos.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/hda/codecs/realtek/alc269.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 36053042ca772..beff91f122c61 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -6872,6 +6872,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x103c, 0x8898, "HP EliteBook 845 G8 Notebook PC", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST),
SND_PCI_QUIRK(0x103c, 0x88b3, "HP ENVY x360 Convertible 15-es0xxx", ALC245_FIXUP_HP_ENVY_X360_MUTE_LED),
SND_PCI_QUIRK(0x103c, 0x88d0, "HP Pavilion 15-eh1xxx (mainboard 88D0)", ALC287_FIXUP_HP_GPIO_LED),
+ SND_PCI_QUIRK(0x103c, 0x88d1, "HP Pavilion 15-eh1xxx (mainboard 88D1)", ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT),
SND_PCI_QUIRK(0x103c, 0x88dd, "HP Pavilion 15z-ec200", ALC285_FIXUP_HP_MUTE_LED),
SND_PCI_QUIRK(0x103c, 0x88eb, "HP Victus 16-e0xxx", ALC245_FIXUP_HP_MUTE_LED_V2_COEFBIT),
SND_PCI_QUIRK(0x103c, 0x8902, "HP OMEN 16", ALC285_FIXUP_HP_MUTE_LED),
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 125/311] ALSA: doc: usb-audio: Add doc for QUIRK_FLAG_SKIP_IFACE_SETUP
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (123 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 124/311] ALSA: hda/realtek: Add quirk for HP Pavilion 15-eh1xxx to enable mute LED Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 126/311] ALSA: usb-audio: Use correct version for UAC3 header validation Sasha Levin
` (199 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Rong Zhang, Takashi Iwai, Greg Kroah-Hartman
From: Rong Zhang <i@rong.moe>
commit 93992667d0ab695ac30ceec91a516fd4bf725d75 upstream.
QUIRK_FLAG_SKIP_IFACE_SETUP was introduced into usb-audio before without
appropriate documentation, so add it.
Fixes: 38c322068a26 ("ALSA: usb-audio: Add QUIRK_FLAG_SKIP_IFACE_SETUP")
Cc: stable@vger.kernel.org
Signed-off-by: Rong Zhang <i@rong.moe>
Link: https://patch.msgid.link/20260302173300.322673-1-i@rong.moe
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Documentation/sound/alsa-configuration.rst | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/sound/alsa-configuration.rst b/Documentation/sound/alsa-configuration.rst
index 0a4eaa7d66ddd..55b845d382368 100644
--- a/Documentation/sound/alsa-configuration.rst
+++ b/Documentation/sound/alsa-configuration.rst
@@ -2372,6 +2372,10 @@ quirk_flags
audible volume
* bit 25: ``mixer_capture_min_mute``
Similar to bit 24 but for capture streams
+ * bit 26: ``skip_iface_setup``
+ Skip the probe-time interface setup (usb_set_interface,
+ init_pitch, init_sample_rate); redundant with
+ snd_usb_endpoint_prepare() at stream-open time
This module supports multiple devices, autoprobe and hotplugging.
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 126/311] ALSA: usb-audio: Use correct version for UAC3 header validation
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (124 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 125/311] ALSA: doc: usb-audio: Add doc for QUIRK_FLAG_SKIP_IFACE_SETUP Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 127/311] ALSA: hda/intel: increase default bdl_pos_adj for Nvidia controllers Sasha Levin
` (198 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Jun Seo, Takashi Iwai, Greg Kroah-Hartman
From: Jun Seo <jun.seo.93@proton.me>
commit 54f9d645a5453d0bfece0c465d34aaf072ea99fa upstream.
The entry of the validators table for UAC3 AC header descriptor is
defined with the wrong protocol version UAC_VERSION_2, while it should
have been UAC_VERSION_3. This results in the validator never matching
for actual UAC3 devices (protocol == UAC_VERSION_3), causing their
header descriptors to bypass validation entirely. A malicious USB
device presenting a truncated UAC3 header could exploit this to cause
out-of-bounds reads when the driver later accesses unvalidated
descriptor fields.
The bug was introduced in the same commit as the recently fixed UAC3
feature unit sub-type typo, and appears to be from the same copy-paste
error when the UAC3 section was created from the UAC2 section.
Fixes: 57f8770620e9 ("ALSA: usb-audio: More validations of descriptor units")
Cc: <stable@vger.kernel.org>
Signed-off-by: Jun Seo <jun.seo.93@proton.me>
Link: https://patch.msgid.link/20260226010820.36529-1-jun.seo.93@proton.me
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/usb/validate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/usb/validate.c b/sound/usb/validate.c
index 4bb4893f6e74f..f62b7cc041dc9 100644
--- a/sound/usb/validate.c
+++ b/sound/usb/validate.c
@@ -281,7 +281,7 @@ static const struct usb_desc_validator audio_validators[] = {
/* UAC_VERSION_2, UAC2_SAMPLE_RATE_CONVERTER: not implemented yet */
/* UAC3 */
- FIXED(UAC_VERSION_2, UAC_HEADER, struct uac3_ac_header_descriptor),
+ FIXED(UAC_VERSION_3, UAC_HEADER, struct uac3_ac_header_descriptor),
FIXED(UAC_VERSION_3, UAC_INPUT_TERMINAL,
struct uac3_input_terminal_descriptor),
FIXED(UAC_VERSION_3, UAC_OUTPUT_TERMINAL,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 127/311] ALSA: hda/intel: increase default bdl_pos_adj for Nvidia controllers
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (125 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 126/311] ALSA: usb-audio: Use correct version for UAC3 header validation Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 128/311] ALSA: hda/realtek: fix model name typo for Samsung Galaxy Book Flex (NT950QCG-X716) Sasha Levin
` (197 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Panagiotis Foliadis, Charalampos Mitrodimas, Takashi Iwai,
Greg Kroah-Hartman
From: Panagiotis Foliadis <pfoliadis@posteo.net>
commit e9fb2028f1eb563e653cff3b0d1c87c5e0203d45 upstream.
The default bdl_pos_adj of 32 for Nvidia HDA controllers is
insufficient on GA102 (and likely other recent Nvidia GPUs) after S3
suspend/resume. The controller's DMA timing degrades after resume,
causing premature IRQ detection in azx_position_ok() which results in
silent HDMI/DP audio output despite userspace reporting a valid
playback state and correct ELD data.
Increase bdl_pos_adj to 64 for AZX_DRIVER_NVIDIA, matching the value
already used by Intel Apollo Lake for the same class of timing issue.
Cc: stable@vger.kernel.org
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221069
Suggested-by: Charalampos Mitrodimas <charmitro@posteo.net>
Signed-off-by: Panagiotis Foliadis <pfoliadis@posteo.net>
Link: https://patch.msgid.link/20260225-nvidia-audio-fix-v1-1-b1383c37ec49@posteo.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/hda/controllers/intel.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/hda/controllers/intel.c b/sound/hda/controllers/intel.c
index 1b365e0772970..f8919cb521a1a 100644
--- a/sound/hda/controllers/intel.c
+++ b/sound/hda/controllers/intel.c
@@ -1751,6 +1751,8 @@ static int default_bdl_pos_adj(struct azx *chip)
return 1;
case AZX_DRIVER_ZHAOXINHDMI:
return 128;
+ case AZX_DRIVER_NVIDIA:
+ return 64;
default:
return 32;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 128/311] ALSA: hda/realtek: fix model name typo for Samsung Galaxy Book Flex (NT950QCG-X716)
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (126 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 127/311] ALSA: hda/intel: increase default bdl_pos_adj for Nvidia controllers Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 129/311] ALSA: hda/realtek: Add quirk for Acer Aspire V3-572G Sasha Levin
` (196 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Juhyung Park, Takashi Iwai, Greg Kroah-Hartman
From: Juhyung Park <qkrwngud825@gmail.com>
commit 43a44fb7f2fa163926b23149805e989ba2395db1 upstream.
There's no product named "Samsung Galaxy Flex Book".
Use the correct "Samsung Galaxy Book Flex" name.
Link: https://www.samsung.com/sec/support/model/NT950QCG-X716
Link: https://www.samsung.com/us/computing/galaxy-books/galaxy-book-flex/galaxy-book-flex-15-6-qled-512gb-storage-s-pen-included-np950qcg-k01us
Cc: <stable@vger.kernel.org>
Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
Link: https://patch.msgid.link/20260222122609.281191-1-qkrwngud825@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/hda/codecs/realtek/alc269.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index beff91f122c61..df5c64b7d1f9e 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -7312,7 +7312,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
- SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Flex Book (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
+ SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Book Flex (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc1a4, "Samsung Galaxy Book Pro 360 (NT935QBD)", ALC298_FIXUP_SAMSUNG_AMP),
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 129/311] ALSA: hda/realtek: Add quirk for Acer Aspire V3-572G
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (127 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 128/311] ALSA: hda/realtek: fix model name typo for Samsung Galaxy Book Flex (NT950QCG-X716) Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 130/311] ALSA: hda/realtek: add quirk for Samsung Galaxy Book Flex (NT950QCT-A38A) Sasha Levin
` (195 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Panagiotis Foliadis, Charalampos Mitrodimas, Takashi Iwai,
Greg Kroah-Hartman
From: Panagiotis Foliadis <pfoliadis@posteo.net>
commit cbddd303416456db5ceeedaf9e262096f079e861 upstream.
The Acer Aspire V3-572G has a combo jack (ALC283) but the BIOS
sets pin 0x19 to 0x411111f0 (not connected), so the headset mic
is not detected.
Add a quirk to override pin 0x19 as a headset mic and enable
headset mode.
Cc: stable@vger.kernel.org
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221075
Suggested-by: Charalampos Mitrodimas <charmitro@posteo.net>
Signed-off-by: Panagiotis Foliadis <pfoliadis@posteo.net>
Reviewed-by: Charalampos Mitrodimas <charmitro@posteo.net>
Link: https://patch.msgid.link/20260221-fix-detect-mic-v1-1-b6e427b5275d@posteo.net
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/hda/codecs/realtek/alc269.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index df5c64b7d1f9e..f77f160504adc 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -6591,6 +6591,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x079b, "Acer Aspire V5-573G", ALC282_FIXUP_ASPIRE_V5_PINS),
SND_PCI_QUIRK(0x1025, 0x080d, "Acer Aspire V5-122P", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
SND_PCI_QUIRK(0x1025, 0x0840, "Acer Aspire E1", ALC269VB_FIXUP_ASPIRE_E1_COEF),
+ SND_PCI_QUIRK(0x1025, 0x0943, "Acer Aspire V3-572G", ALC269_FIXUP_ASPIRE_HEADSET_MIC),
SND_PCI_QUIRK(0x1025, 0x100c, "Acer Aspire E5-574G", ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST),
SND_PCI_QUIRK(0x1025, 0x101c, "Acer Veriton N2510G", ALC269_FIXUP_LIFEBOOK),
SND_PCI_QUIRK(0x1025, 0x102b, "Acer Aspire C24-860", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE),
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 130/311] ALSA: hda/realtek: add quirk for Samsung Galaxy Book Flex (NT950QCT-A38A)
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (128 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 129/311] ALSA: hda/realtek: Add quirk for Acer Aspire V3-572G Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 131/311] ALSA: hda/realtek: add quirk for Acer Nitro ANV15-51 Sasha Levin
` (194 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Juhyung Park, Takashi Iwai, Greg Kroah-Hartman
From: Juhyung Park <qkrwngud825@gmail.com>
commit 9fb16a5c5ff93058851099a2b80a899b0c53fe3f upstream.
Similar to other Samsung laptops, NT950QCT also requires the
ALC298_FIXUP_SAMSUNG_AMP quirk applied.
Cc: <stable@vger.kernel.org>
Signed-off-by: Juhyung Park <qkrwngud825@gmail.com>
Link: https://patch.msgid.link/20260222122609.281191-2-qkrwngud825@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/hda/codecs/realtek/alc269.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index f77f160504adc..1b674b77da69b 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -7313,6 +7313,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x144d, 0xc109, "Samsung Ativ book 9 (NP900X3G)", ALC269_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x144d, 0xc169, "Samsung Notebook 9 Pen (NP930SBE-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc176, "Samsung Notebook 9 Pro (NP930MBE-K04US)", ALC298_FIXUP_SAMSUNG_AMP),
+ SND_PCI_QUIRK(0x144d, 0xc188, "Samsung Galaxy Book Flex (NT950QCT-A38A)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc189, "Samsung Galaxy Book Flex (NT950QCG-X716)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_AMP),
SND_PCI_QUIRK(0x144d, 0xc1a3, "Samsung Galaxy Book Pro (NP935XDB-KC1SE)", ALC298_FIXUP_SAMSUNG_AMP),
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 131/311] ALSA: hda/realtek: add quirk for Acer Nitro ANV15-51
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (129 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 130/311] ALSA: hda/realtek: add quirk for Samsung Galaxy Book Flex (NT950QCT-A38A) Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 132/311] wifi: radiotap: reject radiotap with unknown bits Sasha Levin
` (193 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable; +Cc: Zhang Heng, Takashi Iwai, Greg Kroah-Hartman
From: Zhang Heng <zhangheng@kylinos.cn>
commit aa4876fe2d9fcbcaa0592b25f34ec6f6ea7876c1 upstream.
fix mute/micmute LEDs and headset microphone for Acer Nitro ANV15-51.
[ The headset microphone issue is solved by Kailang]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=220279
Cc: stable@vger.kernel.org
Signed-off-by: Zhang Heng <zhangheng@kylinos.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260209134149.3076957-1-zhangheng@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/hda/codecs/realtek/alc269.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/hda/codecs/realtek/alc269.c b/sound/hda/codecs/realtek/alc269.c
index 1b674b77da69b..f5719e630d28a 100644
--- a/sound/hda/codecs/realtek/alc269.c
+++ b/sound/hda/codecs/realtek/alc269.c
@@ -4056,6 +4056,7 @@ enum {
ALC236_FIXUP_HP_MUTE_LED_MICMUTE_GPIO,
ALC233_FIXUP_LENOVO_GPIO2_MIC_HOTKEY,
ALC245_FIXUP_BASS_HP_DAC,
+ ALC245_FIXUP_ACER_MICMUTE_LED,
};
/* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -6576,6 +6577,12 @@ static const struct hda_fixup alc269_fixups[] = {
/* Borrow the DAC routing selected for those Thinkpads */
.v.func = alc285_fixup_thinkpad_x1_gen7,
},
+ [ALC245_FIXUP_ACER_MICMUTE_LED] = {
+ .type = HDA_FIXUP_FUNC,
+ .v.func = alc285_fixup_hp_coef_micmute_led,
+ .chained = true,
+ .chain_id = ALC2XX_FIXUP_HEADSET_MIC,
+ }
};
static const struct hda_quirk alc269_fixup_tbl[] = {
@@ -6628,6 +6635,7 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x159c, "Acer Nitro 5 AN515-58", ALC2XX_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1025, 0x1597, "Acer Nitro 5 AN517-55", ALC2XX_FIXUP_HEADSET_MIC),
SND_PCI_QUIRK(0x1025, 0x169a, "Acer Swift SFG16", ALC256_FIXUP_ACER_SFG16_MICMUTE_LED),
+ SND_PCI_QUIRK(0x1025, 0x171e, "Acer Nitro ANV15-51", ALC245_FIXUP_ACER_MICMUTE_LED),
SND_PCI_QUIRK(0x1025, 0x1826, "Acer Helios ZPC", ALC287_FIXUP_PREDATOR_SPK_CS35L41_I2C_2),
SND_PCI_QUIRK(0x1025, 0x182c, "Acer Helios ZPD", ALC287_FIXUP_PREDATOR_SPK_CS35L41_I2C_2),
SND_PCI_QUIRK(0x1025, 0x1844, "Acer Helios ZPS", ALC287_FIXUP_PREDATOR_SPK_CS35L41_I2C_2),
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 132/311] wifi: radiotap: reject radiotap with unknown bits
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (130 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 131/311] ALSA: hda/realtek: add quirk for Acer Nitro ANV15-51 Sasha Levin
@ 2026-03-10 11:02 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 133/311] wifi: libertas: fix use-after-free in lbs_free_adapter() Sasha Levin
` (192 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:02 UTC (permalink / raw)
To: patches, stable
Cc: Johannes Berg, syzbot+b09c1af8764c0097bb19, Greg Kroah-Hartman
From: Johannes Berg <johannes.berg@intel.com>
commit c854758abe0b8d86f9c43dc060ff56a0ee5b31e0 upstream.
The radiotap parser is currently only used with the radiotap
namespace (not with vendor namespaces), but if the undefined
field 18 is used, the alignment/size is unknown as well. In
this case, iterator->_next_ns_data isn't initialized (it's
only set for skipping vendor namespaces), and syzbot points
out that we later compare against this uninitialized value.
Fix this by moving the rejection of unknown radiotap fields
down to after the in-namespace lookup, so it will really use
iterator->_next_ns_data only for vendor namespaces, even in
case undefined fields are present.
Cc: stable@vger.kernel.org
Fixes: 33e5a2f776e3 ("wireless: update radiotap parser")
Reported-by: syzbot+b09c1af8764c0097bb19@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/r/69944a91.a70a0220.2c38d7.00fc.GAE@google.com
Link: https://patch.msgid.link/20260217120526.162647-2-johannes@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/wireless/radiotap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/wireless/radiotap.c b/net/wireless/radiotap.c
index 326faea38ca38..c85eaa583a466 100644
--- a/net/wireless/radiotap.c
+++ b/net/wireless/radiotap.c
@@ -239,14 +239,14 @@ int ieee80211_radiotap_iterator_next(
default:
if (!iterator->current_namespace ||
iterator->_arg_index >= iterator->current_namespace->n_bits) {
- if (iterator->current_namespace == &radiotap_ns)
- return -ENOENT;
align = 0;
} else {
align = iterator->current_namespace->align_size[iterator->_arg_index].align;
size = iterator->current_namespace->align_size[iterator->_arg_index].size;
}
if (!align) {
+ if (iterator->current_namespace == &radiotap_ns)
+ return -ENOENT;
/* skip all subsequent data */
iterator->_arg = iterator->_next_ns_data;
/* give up on this namespace */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 133/311] wifi: libertas: fix use-after-free in lbs_free_adapter()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (131 preceding siblings ...)
2026-03-10 11:02 ` [PATCH 6.19 132/311] wifi: radiotap: reject radiotap with unknown bits Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 134/311] wifi: cfg80211: cancel rfkill_block work in wiphy_unregister() Sasha Levin
` (191 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Daniel Hodges, Johannes Berg, Greg Kroah-Hartman
From: Daniel Hodges <git@danielhodges.dev>
commit 03cc8f90d0537fcd4985c3319b4fafbf2e3fb1f0 upstream.
The lbs_free_adapter() function uses timer_delete() (non-synchronous)
for both command_timer and tx_lockup_timer before the structure is
freed. This is incorrect because timer_delete() does not wait for
any running timer callback to complete.
If a timer callback is executing when lbs_free_adapter() is called,
the callback will access freed memory since lbs_cfg_free() frees the
containing structure immediately after lbs_free_adapter() returns.
Both timer callbacks (lbs_cmd_timeout_handler and lbs_tx_lockup_handler)
access priv->driver_lock, priv->cur_cmd, priv->dev, and other fields,
which would all be use-after-free violations.
Use timer_delete_sync() instead to ensure any running timer callback
has completed before returning.
This bug was introduced in commit 8f641d93c38a ("libertas: detect TX
lockups and reset hardware") where del_timer() was used instead of
del_timer_sync() in the cleanup path. The command_timer has had the
same issue since the driver was first written.
Fixes: 8f641d93c38a ("libertas: detect TX lockups and reset hardware")
Fixes: 954ee164f4f4 ("[PATCH] libertas: reorganize and simplify init sequence")
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Hodges <git@danielhodges.dev>
Link: https://patch.msgid.link/20260206195356.15647-1-git@danielhodges.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/marvell/libertas/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/marvell/libertas/main.c b/drivers/net/wireless/marvell/libertas/main.c
index d44e02c6fe385..dd97f1b61f4d1 100644
--- a/drivers/net/wireless/marvell/libertas/main.c
+++ b/drivers/net/wireless/marvell/libertas/main.c
@@ -799,8 +799,8 @@ static void lbs_free_adapter(struct lbs_private *priv)
{
lbs_free_cmd_buffer(priv);
kfifo_free(&priv->event_fifo);
- timer_delete(&priv->command_timer);
- timer_delete(&priv->tx_lockup_timer);
+ timer_delete_sync(&priv->command_timer);
+ timer_delete_sync(&priv->tx_lockup_timer);
}
static const struct net_device_ops lbs_netdev_ops = {
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 134/311] wifi: cfg80211: cancel rfkill_block work in wiphy_unregister()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (132 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 133/311] wifi: libertas: fix use-after-free in lbs_free_adapter() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 135/311] wifi: mac80211: bounds-check link_id in ieee80211_ml_reconfiguration Sasha Levin
` (190 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Daniil Dulov, Johannes Berg, Greg Kroah-Hartman
From: Daniil Dulov <d.dulov@aladdin.ru>
commit 767d23ade706d5fa51c36168e92a9c5533c351a1 upstream.
There is a use-after-free error in cfg80211_shutdown_all_interfaces found
by syzkaller:
BUG: KASAN: use-after-free in cfg80211_shutdown_all_interfaces+0x213/0x220
Read of size 8 at addr ffff888112a78d98 by task kworker/0:5/5326
CPU: 0 UID: 0 PID: 5326 Comm: kworker/0:5 Not tainted 6.19.0-rc2 #2 PREEMPT(voluntary)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
Workqueue: events cfg80211_rfkill_block_work
Call Trace:
<TASK>
dump_stack_lvl+0x116/0x1f0
print_report+0xcd/0x630
kasan_report+0xe0/0x110
cfg80211_shutdown_all_interfaces+0x213/0x220
cfg80211_rfkill_block_work+0x1e/0x30
process_one_work+0x9cf/0x1b70
worker_thread+0x6c8/0xf10
kthread+0x3c5/0x780
ret_from_fork+0x56d/0x700
ret_from_fork_asm+0x1a/0x30
</TASK>
The problem arises due to the rfkill_block work is not cancelled when wiphy
is being unregistered. In order to fix the issue cancel the corresponding
work in wiphy_unregister().
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
Fixes: 1f87f7d3a3b4 ("cfg80211: add rfkill support")
Cc: stable@vger.kernel.org
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Link: https://patch.msgid.link/20260211082024.1967588-1-d.dulov@aladdin.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/wireless/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 16ccf6fb28b21..381e329e02a4c 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -1210,6 +1210,7 @@ void wiphy_unregister(struct wiphy *wiphy)
/* this has nothing to do now but make sure it's gone */
cancel_work_sync(&rdev->wiphy_work);
+ cancel_work_sync(&rdev->rfkill_block);
cancel_work_sync(&rdev->conn_work);
flush_work(&rdev->event_work);
cancel_delayed_work_sync(&rdev->dfs_update_channels_wk);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 135/311] wifi: mac80211: bounds-check link_id in ieee80211_ml_reconfiguration
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (133 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 134/311] wifi: cfg80211: cancel rfkill_block work in wiphy_unregister() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 136/311] wifi: mac80211: fix NULL pointer dereference in mesh_rx_csa_frame() Sasha Levin
` (189 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Ariel Silver, Johannes Berg, Greg Kroah-Hartman
From: Ariel Silver <arielsilver77@gmail.com>
commit 162d331d833dc73a3e905a24c44dd33732af1fc5 upstream.
link_id is taken from the ML Reconfiguration element (control & 0x000f),
so it can be 0..15. link_removal_timeout[] has IEEE80211_MLD_MAX_NUM_LINKS
(15) elements, so index 15 is out-of-bounds. Skip subelements with
link_id >= IEEE80211_MLD_MAX_NUM_LINKS to avoid a stack out-of-bounds
write.
Fixes: 8eb8dd2ffbbb ("wifi: mac80211: Support link removal using Reconfiguration ML element")
Reported-by: Ariel Silver <arielsilver77@gmail.com>
Signed-off-by: Ariel Silver <arielsilver77@gmail.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260220101129.1202657-1-Ariel.Silver@cybereason.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/mlme.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 73f57b9e0ebf7..63346ee15069a 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -6975,6 +6975,9 @@ static void ieee80211_ml_reconfiguration(struct ieee80211_sub_if_data *sdata,
control = le16_to_cpu(prof->control);
link_id = control & IEEE80211_MLE_STA_RECONF_CONTROL_LINK_ID;
+ if (link_id >= IEEE80211_MLD_MAX_NUM_LINKS)
+ continue;
+
removed_links |= BIT(link_id);
/* the MAC address should not be included, but handle it */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 136/311] wifi: mac80211: fix NULL pointer dereference in mesh_rx_csa_frame()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (134 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 135/311] wifi: mac80211: bounds-check link_id in ieee80211_ml_reconfiguration Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 137/311] Bluetooth: purge error queues in socket destructors Sasha Levin
` (188 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Vahagn Vardanian, Johannes Berg, Greg Kroah-Hartman
From: Vahagn Vardanian <vahagn@redrays.io>
commit 017c1792525064a723971f0216e6ef86a8c7af11 upstream.
In mesh_rx_csa_frame(), elems->mesh_chansw_params_ie is dereferenced
at lines 1638 and 1642 without a prior NULL check:
ifmsh->chsw_ttl = elems->mesh_chansw_params_ie->mesh_ttl;
...
pre_value = le16_to_cpu(elems->mesh_chansw_params_ie->mesh_pre_value);
The mesh_matches_local() check above only validates the Mesh ID,
Mesh Configuration, and Supported Rates IEs. It does not verify the
presence of the Mesh Channel Switch Parameters IE (element ID 118).
When a received CSA action frame omits that IE, ieee802_11_parse_elems()
leaves elems->mesh_chansw_params_ie as NULL, and the unconditional
dereference causes a kernel NULL pointer dereference.
A remote mesh peer with an established peer link (PLINK_ESTAB) can
trigger this by sending a crafted SPECTRUM_MGMT/CHL_SWITCH action frame
that includes a matching Mesh ID and Mesh Configuration IE but omits the
Mesh Channel Switch Parameters IE. No authentication beyond the default
open mesh peering is required.
Crash confirmed on kernel 6.17.0-5-generic via mac80211_hwsim:
BUG: kernel NULL pointer dereference, address: 0000000000000000
Oops: Oops: 0000 [#1] SMP NOPTI
RIP: 0010:ieee80211_mesh_rx_queued_mgmt+0x143/0x2a0 [mac80211]
CR2: 0000000000000000
Fix by adding a NULL check for mesh_chansw_params_ie after
mesh_matches_local() returns, consistent with how other optional IEs
are guarded throughout the mesh code.
The bug has been present since v3.13 (released 2014-01-19).
Fixes: 8f2535b92d68 ("mac80211: process the CSA frame for mesh accordingly")
Cc: stable@vger.kernel.org
Signed-off-by: Vahagn Vardanian <vahagn@redrays.io>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac80211/mesh.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 68901f1def0dd..129e814abe764 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -1636,6 +1636,9 @@ static void mesh_rx_csa_frame(struct ieee80211_sub_if_data *sdata,
if (!mesh_matches_local(sdata, elems))
goto free;
+ if (!elems->mesh_chansw_params_ie)
+ goto free;
+
ifmsh->chsw_ttl = elems->mesh_chansw_params_ie->mesh_ttl;
if (!--ifmsh->chsw_ttl)
fwd_csa = false;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 137/311] Bluetooth: purge error queues in socket destructors
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (135 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 136/311] wifi: mac80211: fix NULL pointer dereference in mesh_rx_csa_frame() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 138/311] gve: fix incorrect buffer cleanup in gve_tx_clean_pending_packets for QPL Sasha Levin
` (187 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Heitor Alves de Siqueira, syzbot+7ff4013eabad1407b70a,
Luiz Augusto von Dentz, Greg Kroah-Hartman
From: Heitor Alves de Siqueira <halves@igalia.com>
commit 21e4271e65094172aadd5beb8caea95dd0fbf6d7 upstream.
When TX timestamping is enabled via SO_TIMESTAMPING, SKBs may be queued
into sk_error_queue and will stay there until consumed. If userspace never
gets to read the timestamps, or if the controller is removed unexpectedly,
these SKBs will leak.
Fix by adding skb_queue_purge() calls for sk_error_queue in affected
bluetooth destructors. RFCOMM does not currently use sk_error_queue.
Fixes: 134f4b39df7b ("Bluetooth: add support for skb TX SND/COMPLETION timestamping")
Reported-by: syzbot+7ff4013eabad1407b70a@syzkaller.appspotmail.com
Closes: https://syzbot.org/bug?extid=7ff4013eabad1407b70a
Cc: stable@vger.kernel.org
Signed-off-by: Heitor Alves de Siqueira <halves@igalia.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bluetooth/hci_sock.c | 1 +
net/bluetooth/iso.c | 1 +
net/bluetooth/l2cap_sock.c | 1 +
net/bluetooth/sco.c | 1 +
4 files changed, 4 insertions(+)
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 4e7bf63af9c5f..0290dea081f62 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -2166,6 +2166,7 @@ static void hci_sock_destruct(struct sock *sk)
mgmt_cleanup(sk);
skb_queue_purge(&sk->sk_receive_queue);
skb_queue_purge(&sk->sk_write_queue);
+ skb_queue_purge(&sk->sk_error_queue);
}
static const struct proto_ops hci_sock_ops = {
diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index e36d24a9098b9..0f07f05c15577 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -746,6 +746,7 @@ static void iso_sock_destruct(struct sock *sk)
skb_queue_purge(&sk->sk_receive_queue);
skb_queue_purge(&sk->sk_write_queue);
+ skb_queue_purge(&sk->sk_error_queue);
}
static void iso_sock_cleanup_listen(struct sock *parent)
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 66ab2754594d6..bc9760e0abaf8 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1806,6 +1806,7 @@ static void l2cap_sock_destruct(struct sock *sk)
skb_queue_purge(&sk->sk_receive_queue);
skb_queue_purge(&sk->sk_write_queue);
+ skb_queue_purge(&sk->sk_error_queue);
}
static void l2cap_skb_msg_name(struct sk_buff *skb, void *msg_name,
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 87ba90336e803..cccfaf5603174 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -470,6 +470,7 @@ static void sco_sock_destruct(struct sock *sk)
skb_queue_purge(&sk->sk_receive_queue);
skb_queue_purge(&sk->sk_write_queue);
+ skb_queue_purge(&sk->sk_error_queue);
}
static void sco_sock_cleanup_listen(struct sock *parent)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 138/311] gve: fix incorrect buffer cleanup in gve_tx_clean_pending_packets for QPL
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (136 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 137/311] Bluetooth: purge error queues in socket destructors Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 139/311] net: phy: register phy led_triggers during probe to avoid AB-BA deadlock Sasha Levin
` (186 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Ankit Garg, Jordan Rhee, Harshitha Ramamurthy, Joshua Washington,
Simon Horman, Jakub Kicinski, Greg Kroah-Hartman
From: Ankit Garg <nktgrg@google.com>
commit fb868db5f4bccd7a78219313ab2917429f715cea upstream.
In DQ-QPL mode, gve_tx_clean_pending_packets() incorrectly uses the RDA
buffer cleanup path. It iterates num_bufs times and attempts to unmap
entries in the dma array.
This leads to two issues:
1. The dma array shares storage with tx_qpl_buf_ids (union).
Interpreting buffer IDs as DMA addresses results in attempting to
unmap incorrect memory locations.
2. num_bufs in QPL mode (counting 2K chunks) can significantly exceed
the size of the dma array, causing out-of-bounds access warnings
(trace below is how we noticed this issue).
UBSAN: array-index-out-of-bounds in
drivers/net/ethernet/drivers/net/ethernet/google/gve/gve_tx_dqo.c:178:5 index 18 is out of
range for type 'dma_addr_t[18]' (aka 'unsigned long long[18]')
Workqueue: gve gve_service_task [gve]
Call Trace:
<TASK>
dump_stack_lvl+0x33/0xa0
__ubsan_handle_out_of_bounds+0xdc/0x110
gve_tx_stop_ring_dqo+0x182/0x200 [gve]
gve_close+0x1be/0x450 [gve]
gve_reset+0x99/0x120 [gve]
gve_service_task+0x61/0x100 [gve]
process_scheduled_works+0x1e9/0x380
Fix this by properly checking for QPL mode and delegating to
gve_free_tx_qpl_bufs() to reclaim the buffers.
Cc: stable@vger.kernel.org
Fixes: a6fb8d5a8b69 ("gve: Tx path for DQO-QPL")
Signed-off-by: Ankit Garg <nktgrg@google.com>
Reviewed-by: Jordan Rhee <jordanrhee@google.com>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260220215324.1631350-1-joshwash@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/google/gve/gve_tx_dqo.c | 56 +++++++++-----------
1 file changed, 25 insertions(+), 31 deletions(-)
diff --git a/drivers/net/ethernet/google/gve/gve_tx_dqo.c b/drivers/net/ethernet/google/gve/gve_tx_dqo.c
index 40b89b3e5a318..e5e3396645862 100644
--- a/drivers/net/ethernet/google/gve/gve_tx_dqo.c
+++ b/drivers/net/ethernet/google/gve/gve_tx_dqo.c
@@ -167,6 +167,25 @@ gve_free_pending_packet(struct gve_tx_ring *tx,
}
}
+static void gve_unmap_packet(struct device *dev,
+ struct gve_tx_pending_packet_dqo *pkt)
+{
+ int i;
+
+ if (!pkt->num_bufs)
+ return;
+
+ /* SKB linear portion is guaranteed to be mapped */
+ dma_unmap_single(dev, dma_unmap_addr(pkt, dma[0]),
+ dma_unmap_len(pkt, len[0]), DMA_TO_DEVICE);
+ for (i = 1; i < pkt->num_bufs; i++) {
+ netmem_dma_unmap_page_attrs(dev, dma_unmap_addr(pkt, dma[i]),
+ dma_unmap_len(pkt, len[i]),
+ DMA_TO_DEVICE, 0);
+ }
+ pkt->num_bufs = 0;
+}
+
/* gve_tx_free_desc - Cleans up all pending tx requests and buffers.
*/
static void gve_tx_clean_pending_packets(struct gve_tx_ring *tx)
@@ -176,21 +195,12 @@ static void gve_tx_clean_pending_packets(struct gve_tx_ring *tx)
for (i = 0; i < tx->dqo.num_pending_packets; i++) {
struct gve_tx_pending_packet_dqo *cur_state =
&tx->dqo.pending_packets[i];
- int j;
-
- for (j = 0; j < cur_state->num_bufs; j++) {
- if (j == 0) {
- dma_unmap_single(tx->dev,
- dma_unmap_addr(cur_state, dma[j]),
- dma_unmap_len(cur_state, len[j]),
- DMA_TO_DEVICE);
- } else {
- dma_unmap_page(tx->dev,
- dma_unmap_addr(cur_state, dma[j]),
- dma_unmap_len(cur_state, len[j]),
- DMA_TO_DEVICE);
- }
- }
+
+ if (tx->dqo.qpl)
+ gve_free_tx_qpl_bufs(tx, cur_state);
+ else
+ gve_unmap_packet(tx->dev, cur_state);
+
if (cur_state->skb) {
dev_consume_skb_any(cur_state->skb);
cur_state->skb = NULL;
@@ -1160,22 +1170,6 @@ static void remove_from_list(struct gve_tx_ring *tx,
}
}
-static void gve_unmap_packet(struct device *dev,
- struct gve_tx_pending_packet_dqo *pkt)
-{
- int i;
-
- /* SKB linear portion is guaranteed to be mapped */
- dma_unmap_single(dev, dma_unmap_addr(pkt, dma[0]),
- dma_unmap_len(pkt, len[0]), DMA_TO_DEVICE);
- for (i = 1; i < pkt->num_bufs; i++) {
- netmem_dma_unmap_page_attrs(dev, dma_unmap_addr(pkt, dma[i]),
- dma_unmap_len(pkt, len[i]),
- DMA_TO_DEVICE, 0);
- }
- pkt->num_bufs = 0;
-}
-
/* Completion types and expected behavior:
* No Miss compl + Packet compl = Packet completed normally.
* Miss compl + Re-inject compl = Packet completed normally.
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 139/311] net: phy: register phy led_triggers during probe to avoid AB-BA deadlock
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (137 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 138/311] gve: fix incorrect buffer cleanup in gve_tx_clean_pending_packets for QPL Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 140/311] IB/mthca: Add missed mthca_unmap_user_db() for mthca_create_srq() Sasha Levin
` (185 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Andrew Lunn, Shiji Yang, Paolo Abeni, Greg Kroah-Hartman
From: Andrew Lunn <andrew@lunn.ch>
commit c8dbdc6e380e7e96a51706db3e4b7870d8a9402d upstream.
There is an AB-BA deadlock when both LEDS_TRIGGER_NETDEV and
LED_TRIGGER_PHY are enabled:
[ 1362.049207] [<8054e4b8>] led_trigger_register+0x5c/0x1fc <-- Trying to get lock "triggers_list_lock" via down_write(&triggers_list_lock);
[ 1362.054536] [<80662830>] phy_led_triggers_register+0xd0/0x234
[ 1362.060329] [<8065e200>] phy_attach_direct+0x33c/0x40c
[ 1362.065489] [<80651fc4>] phylink_fwnode_phy_connect+0x15c/0x23c
[ 1362.071480] [<8066ee18>] mtk_open+0x7c/0xba0
[ 1362.075849] [<806d714c>] __dev_open+0x280/0x2b0
[ 1362.080384] [<806d7668>] __dev_change_flags+0x244/0x24c
[ 1362.085598] [<806d7698>] dev_change_flags+0x28/0x78
[ 1362.090528] [<807150e4>] dev_ioctl+0x4c0/0x654 <-- Hold lock "rtnl_mutex" by calling rtnl_lock();
[ 1362.094985] [<80694360>] sock_ioctl+0x2f4/0x4e0
[ 1362.099567] [<802e9c4c>] sys_ioctl+0x32c/0xd8c
[ 1362.104022] [<80014504>] syscall_common+0x34/0x58
Here LED_TRIGGER_PHY is registering LED triggers during phy_attach
while holding RTNL and then taking triggers_list_lock.
[ 1362.191101] [<806c2640>] register_netdevice_notifier+0x60/0x168 <-- Trying to get lock "rtnl_mutex" via rtnl_lock();
[ 1362.197073] [<805504ac>] netdev_trig_activate+0x194/0x1e4
[ 1362.202490] [<8054e28c>] led_trigger_set+0x1d4/0x360 <-- Hold lock "triggers_list_lock" by down_read(&triggers_list_lock);
[ 1362.207511] [<8054eb38>] led_trigger_write+0xd8/0x14c
[ 1362.212566] [<80381d98>] sysfs_kf_bin_write+0x80/0xbc
[ 1362.217688] [<8037fcd8>] kernfs_fop_write_iter+0x17c/0x28c
[ 1362.223174] [<802cbd70>] vfs_write+0x21c/0x3c4
[ 1362.227712] [<802cc0c4>] ksys_write+0x78/0x12c
[ 1362.232164] [<80014504>] syscall_common+0x34/0x58
Here LEDS_TRIGGER_NETDEV is being enabled on an LED. It first takes
triggers_list_lock and then RTNL. A classical AB-BA deadlock.
phy_led_triggers_registers() does not require the RTNL, it does not
make any calls into the network stack which require protection. There
is also no requirement the PHY has been attached to a MAC, the
triggers only make use of phydev state. This allows the call to
phy_led_triggers_registers() to be placed elsewhere. PHY probe() and
release() don't hold RTNL, so solving the AB-BA deadlock.
Reported-by: Shiji Yang <yangshiji66@outlook.com>
Closes: https://lore.kernel.org/all/OS7PR01MB13602B128BA1AD3FA38B6D1FFBC69A@OS7PR01MB13602.jpnprd01.prod.outlook.com/
Fixes: 06f502f57d0d ("leds: trigger: Introduce a NETDEV trigger")
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://patch.msgid.link/20260222152601.1978655-1-andrew@lunn.ch
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/phy/phy_device.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 81984d4ebb7cb..a1ed7ed938ac5 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1763,8 +1763,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
goto error;
phy_resume(phydev);
- if (!phydev->is_on_sfp_module)
- phy_led_triggers_register(phydev);
/**
* If the external phy used by current mac interface is managed by
@@ -1879,9 +1877,6 @@ void phy_detach(struct phy_device *phydev)
phydev->phy_link_change = NULL;
phydev->phylink = NULL;
- if (!phydev->is_on_sfp_module)
- phy_led_triggers_unregister(phydev);
-
if (phydev->mdio.dev.driver)
module_put(phydev->mdio.dev.driver->owner);
@@ -3512,16 +3507,27 @@ static int phy_probe(struct device *dev)
/* Set the state to READY by default */
phydev->state = PHY_READY;
+ /* Register the PHY LED triggers */
+ if (!phydev->is_on_sfp_module)
+ phy_led_triggers_register(phydev);
+
/* Get the LEDs from the device tree, and instantiate standard
* LEDs for them.
*/
- if (IS_ENABLED(CONFIG_PHYLIB_LEDS) && !phy_driver_is_genphy(phydev))
+ if (IS_ENABLED(CONFIG_PHYLIB_LEDS) && !phy_driver_is_genphy(phydev)) {
err = of_phy_leds(phydev);
+ if (err)
+ goto out;
+ }
+
+ return 0;
out:
+ if (!phydev->is_on_sfp_module)
+ phy_led_triggers_unregister(phydev);
+
/* Re-assert the reset signal on error */
- if (err)
- phy_device_reset(phydev, 1);
+ phy_device_reset(phydev, 1);
return err;
}
@@ -3535,6 +3541,9 @@ static int phy_remove(struct device *dev)
if (IS_ENABLED(CONFIG_PHYLIB_LEDS) && !phy_driver_is_genphy(phydev))
phy_leds_unregister(phydev);
+ if (!phydev->is_on_sfp_module)
+ phy_led_triggers_unregister(phydev);
+
phydev->state = PHY_DOWN;
sfp_bus_del_upstream(phydev->sfp_bus);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 140/311] IB/mthca: Add missed mthca_unmap_user_db() for mthca_create_srq()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (138 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 139/311] net: phy: register phy led_triggers during probe to avoid AB-BA deadlock Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 141/311] RDMA/irdma: Fix kernel stack leak in irdma_create_user_ah() Sasha Levin
` (184 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Jason Gunthorpe, Leon Romanovsky, Greg Kroah-Hartman
From: Jason Gunthorpe <jgg@nvidia.com>
commit 117942ca43e2e3c3d121faae530989931b7f67e1 upstream.
Fix a user triggerable leak on the system call failure path.
Cc: stable@vger.kernel.org
Fixes: ec34a922d243 ("[PATCH] IB/mthca: Add SRQ implementation")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://patch.msgid.link/2-v1-83e918d69e73+a9-rdma_udata_rc_jgg@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/mthca/mthca_provider.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index dd572d76866c2..e095873b381b6 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -428,6 +428,8 @@ static int mthca_create_srq(struct ib_srq *ibsrq,
if (context && ib_copy_to_udata(udata, &srq->srqn, sizeof(__u32))) {
mthca_free_srq(to_mdev(ibsrq->device), srq);
+ mthca_unmap_user_db(to_mdev(ibsrq->device), &context->uar,
+ context->db_tab, ucmd.db_index);
return -EFAULT;
}
@@ -436,6 +438,7 @@ static int mthca_create_srq(struct ib_srq *ibsrq,
static int mthca_destroy_srq(struct ib_srq *srq, struct ib_udata *udata)
{
+ mthca_free_srq(to_mdev(srq->device), to_msrq(srq));
if (udata) {
struct mthca_ucontext *context =
rdma_udata_to_drv_context(
@@ -446,8 +449,6 @@ static int mthca_destroy_srq(struct ib_srq *srq, struct ib_udata *udata)
mthca_unmap_user_db(to_mdev(srq->device), &context->uar,
context->db_tab, to_msrq(srq)->db_index);
}
-
- mthca_free_srq(to_mdev(srq->device), to_msrq(srq));
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 141/311] RDMA/irdma: Fix kernel stack leak in irdma_create_user_ah()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (139 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 140/311] IB/mthca: Add missed mthca_unmap_user_db() for mthca_create_srq() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 142/311] RDMA/ionic: Fix kernel stack leak in ionic_create_cq() Sasha Levin
` (183 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Jason Gunthorpe, Leon Romanovsky, Greg Kroah-Hartman
From: Jason Gunthorpe <jgg@nvidia.com>
commit 74586c6da9ea222a61c98394f2fc0a604748438c upstream.
struct irdma_create_ah_resp { // 8 bytes, no padding
__u32 ah_id; // offset 0 - SET (uresp.ah_id = ah->sc_ah.ah_info.ah_idx)
__u8 rsvd[4]; // offset 4 - NEVER SET <- LEAK
};
rsvd[4]: 4 bytes of stack memory leaked unconditionally. Only ah_id is assigned before ib_respond_udata().
The reserved members of the structure were not zeroed.
Cc: stable@vger.kernel.org
Fixes: b48c24c2d710 ("RDMA/irdma: Implement device supported verb APIs")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://patch.msgid.link/3-v1-83e918d69e73+a9-rdma_udata_rc_jgg@nvidia.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/irdma/verbs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c
index 6d9af41a2884a..68fb81b7bd221 100644
--- a/drivers/infiniband/hw/irdma/verbs.c
+++ b/drivers/infiniband/hw/irdma/verbs.c
@@ -5209,7 +5209,7 @@ static int irdma_create_user_ah(struct ib_ah *ibah,
#define IRDMA_CREATE_AH_MIN_RESP_LEN offsetofend(struct irdma_create_ah_resp, rsvd)
struct irdma_ah *ah = container_of(ibah, struct irdma_ah, ibah);
struct irdma_device *iwdev = to_iwdev(ibah->pd->device);
- struct irdma_create_ah_resp uresp;
+ struct irdma_create_ah_resp uresp = {};
struct irdma_ah *parent_ah;
int err;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 142/311] RDMA/ionic: Fix kernel stack leak in ionic_create_cq()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (140 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 141/311] RDMA/irdma: Fix kernel stack leak in irdma_create_user_ah() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 143/311] ksmbd: Compare MACs in constant time Sasha Levin
` (182 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Jason Gunthorpe, Abhijit Gangurde, Leon Romanovsky,
Greg Kroah-Hartman
From: Jason Gunthorpe <jgg@nvidia.com>
commit faa72102b178c7ae6c6afea23879e7c84fc59b4e upstream.
struct ionic_cq_resp resp {
__u32 cqid[2]; // offset 0 - PARTIALLY SET (see below)
__u8 udma_mask; // offset 8 - SET (resp.udma_mask = vcq->udma_mask)
__u8 rsvd[7]; // offset 9 - NEVER SET <- LEAK
};
rsvd[7]: 7 bytes of stack memory leaked unconditionally.
cqid[2]: The loop at line 1256 iterates over udma_idx but skips indices
where !(vcq->udma_mask & BIT(udma_idx)). The array has 2 entries but
udma_count could be 1, meaning cqid[1] might never be written via
ionic_create_cq_common(). If udma_mask only has bit 0 set, cqid[1] (4
bytes) is also leaked. So potentially 11 bytes leaked.
Cc: stable@vger.kernel.org
Fixes: e8521822c733 ("RDMA/ionic: Register device ops for control path")
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://patch.msgid.link/4-v1-83e918d69e73+a9-rdma_udata_rc_jgg@nvidia.com
Acked-by: Abhijit Gangurde <abhijit.gangurde@amd.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/ionic/ionic_controlpath.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/ionic/ionic_controlpath.c b/drivers/infiniband/hw/ionic/ionic_controlpath.c
index ea12d9b8e125f..83573721af2c0 100644
--- a/drivers/infiniband/hw/ionic/ionic_controlpath.c
+++ b/drivers/infiniband/hw/ionic/ionic_controlpath.c
@@ -1218,7 +1218,7 @@ int ionic_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
rdma_udata_to_drv_context(udata, struct ionic_ctx, ibctx);
struct ionic_vcq *vcq = to_ionic_vcq(ibcq);
struct ionic_tbl_buf buf = {};
- struct ionic_cq_resp resp;
+ struct ionic_cq_resp resp = {};
struct ionic_cq_req req;
int udma_idx = 0, rc;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 143/311] ksmbd: Compare MACs in constant time
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (141 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 142/311] RDMA/ionic: Fix kernel stack leak in ionic_create_cq() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 144/311] cpufreq: intel_pstate: Fix crash during turbo disable Sasha Levin
` (181 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Eric Biggers, Namjae Jeon, Steve French, Greg Kroah-Hartman
From: Eric Biggers <ebiggers@kernel.org>
commit c5794709bc9105935dbedef8b9cf9c06f2b559fa upstream.
To prevent timing attacks, MAC comparisons need to be constant-time.
Replace the memcmp() with the correct function, crypto_memneq().
Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/server/Kconfig | 1 +
fs/smb/server/auth.c | 4 +++-
fs/smb/server/smb2pdu.c | 5 +++--
3 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/fs/smb/server/Kconfig b/fs/smb/server/Kconfig
index 2775162c535c6..12594879cb640 100644
--- a/fs/smb/server/Kconfig
+++ b/fs/smb/server/Kconfig
@@ -13,6 +13,7 @@ config SMB_SERVER
select CRYPTO_LIB_MD5
select CRYPTO_LIB_SHA256
select CRYPTO_LIB_SHA512
+ select CRYPTO_LIB_UTILS
select CRYPTO_CMAC
select CRYPTO_AEAD2
select CRYPTO_CCM
diff --git a/fs/smb/server/auth.c b/fs/smb/server/auth.c
index 09af55b71153e..a69e8694605aa 100644
--- a/fs/smb/server/auth.c
+++ b/fs/smb/server/auth.c
@@ -15,6 +15,7 @@
#include <crypto/aead.h>
#include <crypto/md5.h>
#include <crypto/sha2.h>
+#include <crypto/utils.h>
#include <linux/random.h>
#include <linux/scatterlist.h>
@@ -165,7 +166,8 @@ int ksmbd_auth_ntlmv2(struct ksmbd_conn *conn, struct ksmbd_session *sess,
ntlmv2_rsp, CIFS_HMAC_MD5_HASH_SIZE,
sess->sess_key);
- if (memcmp(ntlmv2->ntlmv2_hash, ntlmv2_rsp, CIFS_HMAC_MD5_HASH_SIZE) != 0)
+ if (crypto_memneq(ntlmv2->ntlmv2_hash, ntlmv2_rsp,
+ CIFS_HMAC_MD5_HASH_SIZE))
return -EINVAL;
return 0;
}
diff --git a/fs/smb/server/smb2pdu.c b/fs/smb/server/smb2pdu.c
index 1022d794bd232..b682e8160504a 100644
--- a/fs/smb/server/smb2pdu.c
+++ b/fs/smb/server/smb2pdu.c
@@ -4,6 +4,7 @@
* Copyright (C) 2018 Samsung Electronics Co., Ltd.
*/
+#include <crypto/utils.h>
#include <linux/inetdevice.h>
#include <net/addrconf.h>
#include <linux/syscalls.h>
@@ -8879,7 +8880,7 @@ int smb2_check_sign_req(struct ksmbd_work *work)
ksmbd_sign_smb2_pdu(work->conn, work->sess->sess_key, iov, 1,
signature);
- if (memcmp(signature, signature_req, SMB2_SIGNATURE_SIZE)) {
+ if (crypto_memneq(signature, signature_req, SMB2_SIGNATURE_SIZE)) {
pr_err("bad smb2 signature\n");
return 0;
}
@@ -8967,7 +8968,7 @@ int smb3_check_sign_req(struct ksmbd_work *work)
if (ksmbd_sign_smb3_pdu(conn, signing_key, iov, 1, signature))
return 0;
- if (memcmp(signature, signature_req, SMB2_SIGNATURE_SIZE)) {
+ if (crypto_memneq(signature, signature_req, SMB2_SIGNATURE_SIZE)) {
pr_err("bad smb2 signature\n");
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 144/311] cpufreq: intel_pstate: Fix crash during turbo disable
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (142 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 143/311] ksmbd: Compare MACs in constant time Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 145/311] arm64: gcs: Do not set PTE_SHARED on GCS mappings if FEAT_LPA2 is enabled Sasha Levin
` (180 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Srinivas Pandruvada, Rafael J. Wysocki, Greg Kroah-Hartman
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
commit 6b050482ec40569429d963ac52afa878691b04c9 upstream.
When the system is booted with kernel command line argument "nosmt" or
"maxcpus" to limit the number of CPUs, disabling turbo via:
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
results in a crash:
PF: supervisor read access in kernel mode
PF: error_code(0x0000) - not-present page
PGD 0 P4D 0
Oops: Oops: 0000 [#1] SMP PTI
...
RIP: 0010:store_no_turbo+0x100/0x1f0
...
This occurs because for_each_possible_cpu() returns CPUs even if they
are not online. For those CPUs, all_cpu_data[] will be NULL. Since
commit 973207ae3d7c ("cpufreq: intel_pstate: Rearrange max frequency
updates handling code"), all_cpu_data[] is dereferenced even for CPUs
which are not online, causing the NULL pointer dereference.
To fix that, pass CPU number to intel_pstate_update_max_freq() and use
all_cpu_data[] for those CPUs for which there is a valid cpufreq policy.
Fixes: 973207ae3d7c ("cpufreq: intel_pstate: Rearrange max frequency updates handling code")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221068
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: 6.16+ <stable@vger.kernel.org> # 6.16+
Link: https://patch.msgid.link/20260225001752.890164-1-srinivas.pandruvada@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/cpufreq/intel_pstate.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 1625ec2d0d06a..ec8308629432b 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1476,13 +1476,13 @@ static void __intel_pstate_update_max_freq(struct cpufreq_policy *policy,
refresh_frequency_limits(policy);
}
-static bool intel_pstate_update_max_freq(struct cpudata *cpudata)
+static bool intel_pstate_update_max_freq(int cpu)
{
- struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpudata->cpu);
+ struct cpufreq_policy *policy __free(put_cpufreq_policy) = cpufreq_cpu_get(cpu);
if (!policy)
return false;
- __intel_pstate_update_max_freq(policy, cpudata);
+ __intel_pstate_update_max_freq(policy, all_cpu_data[cpu]);
return true;
}
@@ -1501,7 +1501,7 @@ static void intel_pstate_update_limits_for_all(void)
int cpu;
for_each_possible_cpu(cpu)
- intel_pstate_update_max_freq(all_cpu_data[cpu]);
+ intel_pstate_update_max_freq(cpu);
mutex_lock(&hybrid_capacity_lock);
@@ -1908,7 +1908,7 @@ static void intel_pstate_notify_work(struct work_struct *work)
struct cpudata *cpudata =
container_of(to_delayed_work(work), struct cpudata, hwp_notify_work);
- if (intel_pstate_update_max_freq(cpudata)) {
+ if (intel_pstate_update_max_freq(cpudata->cpu)) {
/*
* The driver will not be unregistered while this function is
* running, so update the capacity without acquiring the driver
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 145/311] arm64: gcs: Do not set PTE_SHARED on GCS mappings if FEAT_LPA2 is enabled
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (143 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 144/311] cpufreq: intel_pstate: Fix crash during turbo disable Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 146/311] net/sched: ets: fix divide by zero in the offload path Sasha Levin
` (179 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Catalin Marinas, Emanuele Rocca, Mark Brown, Will Deacon,
David Hildenbrand (Arm), Greg Kroah-Hartman
From: Catalin Marinas <catalin.marinas@arm.com>
commit 8a85b3131225a8c8143ba2ae29c0eef8c1f9117f upstream.
When FEAT_LPA2 is enabled, bits 8-9 of the PTE replace the
shareability attribute with bits 50-51 of the output address. The
_PAGE_GCS{,_RO} definitions include the PTE_SHARED bits as 0b11 (this
matches the other _PAGE_* definitions) but using this macro directly
leads to the following panic when enabling GCS on a system/model with
LPA2:
Unable to handle kernel paging request at virtual address fffff1ffc32d8008
Mem abort info:
ESR = 0x0000000096000004
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x04: level 0 translation fault
Data abort info:
ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
CM = 0, WnR = 0, TnD = 0, TagAccess = 0
GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
swapper pgtable: 4k pages, 52-bit VAs, pgdp=0000000060f4d000
[fffff1ffc32d8008] pgd=100000006184b003, p4d=0000000000000000
Internal error: Oops: 0000000096000004 [#1] SMP
CPU: 0 UID: 0 PID: 513 Comm: gcs_write_fault Tainted: G M 7.0.0-rc1 #1 PREEMPT
Tainted: [M]=MACHINE_CHECK
Hardware name: QEMU QEMU Virtual Machine, BIOS 2025.02-8+deb13u1 11/08/2025
pstate: 03402005 (nzcv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=--)
pc : zap_huge_pmd+0x168/0x468
lr : zap_huge_pmd+0x2c/0x468
sp : ffff800080beb660
x29: ffff800080beb660 x28: fff00000c2058180 x27: ffff800080beb898
x26: fff00000c2058180 x25: ffff800080beb820 x24: 00c800010b600f41
x23: ffffc1ffc30af1a8 x22: fff00000c2058180 x21: 0000ffff8dc00000
x20: fff00000c2bc6370 x19: ffff800080beb898 x18: ffff800080bebb60
x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000007
x14: 000000000000000a x13: 0000aaaacbbbffff x12: 0000000000000000
x11: 0000ffff8ddfffff x10: 00000000000001fe x9 : 0000ffff8ddfffff
x8 : 0000ffff8de00000 x7 : 0000ffff8da00000 x6 : fff00000c2bc6370
x5 : 0000ffff8da00000 x4 : 000000010b600000 x3 : ffffc1ffc0000000
x2 : fff00000c2058180 x1 : fffff1ffc32d8000 x0 : 000000c00010b600
Call trace:
zap_huge_pmd+0x168/0x468 (P)
unmap_page_range+0xd70/0x1560
unmap_single_vma+0x48/0x80
unmap_vmas+0x90/0x180
unmap_region+0x88/0xe4
vms_complete_munmap_vmas+0xf8/0x1e0
do_vmi_align_munmap+0x158/0x180
do_vmi_munmap+0xac/0x160
__vm_munmap+0xb0/0x138
vm_munmap+0x14/0x20
gcs_free+0x70/0x80
mm_release+0x1c/0xc8
exit_mm_release+0x28/0x38
do_exit+0x190/0x8ec
do_group_exit+0x34/0x90
get_signal+0x794/0x858
arch_do_signal_or_restart+0x11c/0x3e0
exit_to_user_mode_loop+0x10c/0x17c
el0_da+0x8c/0x9c
el0t_64_sync_handler+0xd0/0xf0
el0t_64_sync+0x198/0x19c
Code: aa1603e2 d34cfc00 cb813001 8b011861 (f9400420)
Similarly to how the kernel handles protection_map[], use a
gcs_page_prot variable to store the protection bits and clear PTE_SHARED
if LPA2 is enabled.
Also remove the unused PAGE_GCS{,_RO} macros.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Fixes: 6497b66ba694 ("arm64/mm: Map pages for guarded control stack")
Reported-by: Emanuele Rocca <emanuele.rocca@arm.com>
Cc: stable@vger.kernel.org
Cc: Mark Brown <broonie@kernel.org>
Cc: Will Deacon <will@kernel.org>
Reviewed-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/include/asm/pgtable-prot.h | 3 ---
arch/arm64/mm/mmap.c | 8 ++++++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h
index 161e8660edddc..ea6f5458ae2e1 100644
--- a/arch/arm64/include/asm/pgtable-prot.h
+++ b/arch/arm64/include/asm/pgtable-prot.h
@@ -164,9 +164,6 @@ static inline bool __pure lpa2_is_enabled(void)
#define _PAGE_GCS (_PAGE_DEFAULT | PTE_NG | PTE_UXN | PTE_WRITE | PTE_USER)
#define _PAGE_GCS_RO (_PAGE_DEFAULT | PTE_NG | PTE_UXN | PTE_USER)
-#define PAGE_GCS __pgprot(_PAGE_GCS)
-#define PAGE_GCS_RO __pgprot(_PAGE_GCS_RO)
-
#define PIE_E0 ( \
PIRx_ELx_PERM_PREP(pte_pi_index(_PAGE_GCS), PIE_GCS) | \
PIRx_ELx_PERM_PREP(pte_pi_index(_PAGE_GCS_RO), PIE_R) | \
diff --git a/arch/arm64/mm/mmap.c b/arch/arm64/mm/mmap.c
index 08ee177432c2f..75f343009b4b1 100644
--- a/arch/arm64/mm/mmap.c
+++ b/arch/arm64/mm/mmap.c
@@ -34,6 +34,8 @@ static pgprot_t protection_map[16] __ro_after_init = {
[VM_SHARED | VM_EXEC | VM_WRITE | VM_READ] = PAGE_SHARED_EXEC
};
+static ptdesc_t gcs_page_prot __ro_after_init = _PAGE_GCS_RO;
+
/*
* You really shouldn't be using read() or write() on /dev/mem. This might go
* away in the future.
@@ -73,9 +75,11 @@ static int __init adjust_protection_map(void)
protection_map[VM_EXEC | VM_SHARED] = PAGE_EXECONLY;
}
- if (lpa2_is_enabled())
+ if (lpa2_is_enabled()) {
for (int i = 0; i < ARRAY_SIZE(protection_map); i++)
pgprot_val(protection_map[i]) &= ~PTE_SHARED;
+ gcs_page_prot &= ~PTE_SHARED;
+ }
return 0;
}
@@ -87,7 +91,7 @@ pgprot_t vm_get_page_prot(vm_flags_t vm_flags)
/* Short circuit GCS to avoid bloating the table. */
if (system_supports_gcs() && (vm_flags & VM_SHADOW_STACK)) {
- prot = _PAGE_GCS_RO;
+ prot = gcs_page_prot;
} else {
prot = pgprot_val(protection_map[vm_flags &
(VM_READ|VM_WRITE|VM_EXEC|VM_SHARED)]);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 146/311] net/sched: ets: fix divide by zero in the offload path
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (144 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 145/311] arm64: gcs: Do not set PTE_SHARED on GCS mappings if FEAT_LPA2 is enabled Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 147/311] nfsd: Fix cred ref leak in nfsd_nl_threads_set_doit() Sasha Levin
` (178 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Davide Caratti, Jamal Hadi Salim, Petr Machata, Jakub Kicinski,
Greg Kroah-Hartman
From: Davide Caratti <dcaratti@redhat.com>
commit e35626f610f3d2b7953ccddf6a77453da22b3a9e upstream.
Offloading ETS requires computing each class' WRR weight: this is done by
averaging over the sums of quanta as 'q_sum' and 'q_psum'. Using unsigned
int, the same integer size as the individual DRR quanta, can overflow and
even cause division by zero, like it happened in the following splat:
Oops: divide error: 0000 [#1] SMP PTI
CPU: 13 UID: 0 PID: 487 Comm: tc Tainted: G E 6.19.0-virtme #45 PREEMPT(full)
Tainted: [E]=UNSIGNED_MODULE
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
RIP: 0010:ets_offload_change+0x11f/0x290 [sch_ets]
Code: e4 45 31 ff eb 03 41 89 c7 41 89 cb 89 ce 83 f9 0f 0f 87 b7 00 00 00 45 8b 08 31 c0 45 01 cc 45 85 c9 74 09 41 6b c4 64 31 d2 <41> f7 f2 89 c2 44 29 fa 45 89 df 41 83 fb 0f 0f 87 c7 00 00 00 44
RSP: 0018:ffffd0a180d77588 EFLAGS: 00010246
RAX: 00000000ffffff38 RBX: ffff8d3d482ca000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffd0a180d77660
RBP: ffffd0a180d77690 R08: ffff8d3d482ca2d8 R09: 00000000fffffffe
R10: 0000000000000000 R11: 0000000000000000 R12: 00000000fffffffe
R13: ffff8d3d472f2000 R14: 0000000000000003 R15: 0000000000000000
FS: 00007f440b6c2740(0000) GS:ffff8d3dc9803000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000003cdd2000 CR3: 0000000007b58002 CR4: 0000000000172ef0
Call Trace:
<TASK>
ets_qdisc_change+0x870/0xf40 [sch_ets]
qdisc_create+0x12b/0x540
tc_modify_qdisc+0x6d7/0xbd0
rtnetlink_rcv_msg+0x168/0x6b0
netlink_rcv_skb+0x5c/0x110
netlink_unicast+0x1d6/0x2b0
netlink_sendmsg+0x22e/0x470
____sys_sendmsg+0x38a/0x3c0
___sys_sendmsg+0x99/0xe0
__sys_sendmsg+0x8a/0xf0
do_syscall_64+0x111/0xf80
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f440b81c77e
Code: 4d 89 d8 e8 d4 bc 00 00 4c 8b 5d f8 41 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 11 c9 c3 0f 1f 80 00 00 00 00 48 8b 45 10 0f 05 <c9> c3 83 e2 39 83 fa 08 75 e7 e8 13 ff ff ff 0f 1f 00 f3 0f 1e fa
RSP: 002b:00007fff951e4c10 EFLAGS: 00000202 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000000000481820 RCX: 00007f440b81c77e
RDX: 0000000000000000 RSI: 00007fff951e4cd0 RDI: 0000000000000003
RBP: 00007fff951e4c20 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 00007fff951f4fa8
R13: 00000000699ddede R14: 00007f440bb01000 R15: 0000000000486980
</TASK>
Modules linked in: sch_ets(E) netdevsim(E)
---[ end trace 0000000000000000 ]---
RIP: 0010:ets_offload_change+0x11f/0x290 [sch_ets]
Code: e4 45 31 ff eb 03 41 89 c7 41 89 cb 89 ce 83 f9 0f 0f 87 b7 00 00 00 45 8b 08 31 c0 45 01 cc 45 85 c9 74 09 41 6b c4 64 31 d2 <41> f7 f2 89 c2 44 29 fa 45 89 df 41 83 fb 0f 0f 87 c7 00 00 00 44
RSP: 0018:ffffd0a180d77588 EFLAGS: 00010246
RAX: 00000000ffffff38 RBX: ffff8d3d482ca000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffd0a180d77660
RBP: ffffd0a180d77690 R08: ffff8d3d482ca2d8 R09: 00000000fffffffe
R10: 0000000000000000 R11: 0000000000000000 R12: 00000000fffffffe
R13: ffff8d3d472f2000 R14: 0000000000000003 R15: 0000000000000000
FS: 00007f440b6c2740(0000) GS:ffff8d3dc9803000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000003cdd2000 CR3: 0000000007b58002 CR4: 0000000000172ef0
Kernel panic - not syncing: Fatal exception
Kernel Offset: 0x30000000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
---[ end Kernel panic - not syncing: Fatal exception ]---
Fix this using 64-bit integers for 'q_sum' and 'q_psum'.
Cc: stable@vger.kernel.org
Fixes: d35eb52bd2ac ("net: sch_ets: Make the ETS qdisc offloadable")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Link: https://patch.msgid.link/28504887df314588c7255e9911769c36f751edee.1771964872.git.dcaratti@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/sch_ets.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/net/sched/sch_ets.c b/net/sched/sch_ets.c
index 306e046276d46..a4b07b661b775 100644
--- a/net/sched/sch_ets.c
+++ b/net/sched/sch_ets.c
@@ -115,12 +115,12 @@ static void ets_offload_change(struct Qdisc *sch)
struct ets_sched *q = qdisc_priv(sch);
struct tc_ets_qopt_offload qopt;
unsigned int w_psum_prev = 0;
- unsigned int q_psum = 0;
- unsigned int q_sum = 0;
unsigned int quantum;
unsigned int w_psum;
unsigned int weight;
unsigned int i;
+ u64 q_psum = 0;
+ u64 q_sum = 0;
if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
return;
@@ -138,8 +138,12 @@ static void ets_offload_change(struct Qdisc *sch)
for (i = 0; i < q->nbands; i++) {
quantum = q->classes[i].quantum;
- q_psum += quantum;
- w_psum = quantum ? q_psum * 100 / q_sum : 0;
+ if (quantum) {
+ q_psum += quantum;
+ w_psum = div64_u64(q_psum * 100, q_sum);
+ } else {
+ w_psum = 0;
+ }
weight = w_psum - w_psum_prev;
w_psum_prev = w_psum;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 147/311] nfsd: Fix cred ref leak in nfsd_nl_threads_set_doit().
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (145 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 146/311] net/sched: ets: fix divide by zero in the offload path Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 148/311] tracing: Fix WARN_ON in tracing_buffers_mmap_close Sasha Levin
` (177 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Kuniyuki Iwashima, syzbot+dd3b43aa0204089217ee, Jeff Layton,
Chuck Lever, Greg Kroah-Hartman
From: Kuniyuki Iwashima <kuniyu@google.com>
commit 1cb968a2013ffa8112d52ebe605009ea1c6a582c upstream.
syzbot reported memory leak of struct cred. [0]
nfsd_nl_threads_set_doit() passes get_current_cred() to
nfsd_svc(), but put_cred() is not called after that.
The cred is finally passed down to _svc_xprt_create(),
which calls get_cred() with the cred for struct svc_xprt.
The ownership of the refcount by get_current_cred() is not
transferred to anywhere and is just leaked.
nfsd_svc() is also called from write_threads(), but it does
not bump file->f_cred there.
nfsd_nl_threads_set_doit() is called from sendmsg() and
current->cred does not go away.
Let's use current_cred() in nfsd_nl_threads_set_doit().
[0]:
BUG: memory leak
unreferenced object 0xffff888108b89480 (size 184):
comm "syz-executor", pid 5994, jiffies 4294943386
hex dump (first 32 bytes):
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace (crc 369454a7):
kmemleak_alloc_recursive include/linux/kmemleak.h:44 [inline]
slab_post_alloc_hook mm/slub.c:4958 [inline]
slab_alloc_node mm/slub.c:5263 [inline]
kmem_cache_alloc_noprof+0x412/0x580 mm/slub.c:5270
prepare_creds+0x22/0x600 kernel/cred.c:185
copy_creds+0x44/0x290 kernel/cred.c:286
copy_process+0x7a7/0x2870 kernel/fork.c:2086
kernel_clone+0xac/0x6e0 kernel/fork.c:2651
__do_sys_clone+0x7f/0xb0 kernel/fork.c:2792
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xa4/0xf80 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Fixes: 924f4fb003ba ("NFSD: convert write_threads to netlink command")
Cc: stable@vger.kernel.org
Reported-by: syzbot+dd3b43aa0204089217ee@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/69744674.a00a0220.33ccc7.0000.GAE@google.com/
Tested-by: syzbot+dd3b43aa0204089217ee@syzkaller.appspotmail.com
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfsd/nfsctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 084fc517e9e16..ec9782fd4a367 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -1642,7 +1642,7 @@ int nfsd_nl_threads_set_doit(struct sk_buff *skb, struct genl_info *info)
scope = nla_data(attr);
}
- ret = nfsd_svc(nrpools, nthreads, net, get_current_cred(), scope);
+ ret = nfsd_svc(nrpools, nthreads, net, current_cred(), scope);
if (ret > 0)
ret = 0;
out_unlock:
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 148/311] tracing: Fix WARN_ON in tracing_buffers_mmap_close
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (146 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 147/311] nfsd: Fix cred ref leak in nfsd_nl_threads_set_doit() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 149/311] scsi: target: Fix recursive locking in __configfs_open_file() Sasha Levin
` (176 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Qing Wang, Masami Hiramatsu, Mathieu Desnoyers, Vincent Donnefort,
Lorenzo Stoakes, syzbot+3b5dd2030fe08afdf65d,
Steven Rostedt (Google), Greg Kroah-Hartman
From: Qing Wang <wangqing7171@gmail.com>
commit e39bb9e02b68942f8e9359d2a3efe7d37ae6be0e upstream.
When a process forks, the child process copies the parent's VMAs but the
user_mapped reference count is not incremented. As a result, when both the
parent and child processes exit, tracing_buffers_mmap_close() is called
twice. On the second call, user_mapped is already 0, causing the function to
return -ENODEV and triggering a WARN_ON.
Normally, this isn't an issue as the memory is mapped with VM_DONTCOPY set.
But this is only a hint, and the application can call
madvise(MADVISE_DOFORK) which resets the VM_DONTCOPY flag. When the
application does that, it can trigger this issue on fork.
Fix it by incrementing the user_mapped reference count without re-mapping
the pages in the VMA's open callback.
Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Vincent Donnefort <vdonnefort@google.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Link: https://patch.msgid.link/20260227025842.1085206-1-wangqing7171@gmail.com
Fixes: cf9f0f7c4c5bb ("tracing: Allow user-space mapping of the ring-buffer")
Reported-by: syzbot+3b5dd2030fe08afdf65d@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=3b5dd2030fe08afdf65d
Tested-by: syzbot+3b5dd2030fe08afdf65d@syzkaller.appspotmail.com
Signed-off-by: Qing Wang <wangqing7171@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/ring_buffer.h | 1 +
kernel/trace/ring_buffer.c | 21 +++++++++++++++++++++
kernel/trace/trace.c | 13 +++++++++++++
3 files changed, 35 insertions(+)
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 876358cfe1b12..d862fa610270b 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -248,6 +248,7 @@ int trace_rb_cpu_prepare(unsigned int cpu, struct hlist_node *node);
int ring_buffer_map(struct trace_buffer *buffer, int cpu,
struct vm_area_struct *vma);
+void ring_buffer_map_dup(struct trace_buffer *buffer, int cpu);
int ring_buffer_unmap(struct trace_buffer *buffer, int cpu);
int ring_buffer_map_get_reader(struct trace_buffer *buffer, int cpu);
#endif /* _LINUX_RING_BUFFER_H */
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 2f44063c666f2..93f521b89aee1 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -7292,6 +7292,27 @@ int ring_buffer_map(struct trace_buffer *buffer, int cpu,
return err;
}
+/*
+ * This is called when a VMA is duplicated (e.g., on fork()) to increment
+ * the user_mapped counter without remapping pages.
+ */
+void ring_buffer_map_dup(struct trace_buffer *buffer, int cpu)
+{
+ struct ring_buffer_per_cpu *cpu_buffer;
+
+ if (WARN_ON(!cpumask_test_cpu(cpu, buffer->cpumask)))
+ return;
+
+ cpu_buffer = buffer->buffers[cpu];
+
+ guard(mutex)(&cpu_buffer->mapping_lock);
+
+ if (cpu_buffer->user_mapped)
+ __rb_inc_dec_mapped(cpu_buffer, true);
+ else
+ WARN(1, "Unexpected buffer stat, it should be mapped");
+}
+
int ring_buffer_unmap(struct trace_buffer *buffer, int cpu)
{
struct ring_buffer_per_cpu *cpu_buffer;
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index cc93d0e1f1876..bce112e1bbbae 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -8999,6 +8999,18 @@ static inline int get_snapshot_map(struct trace_array *tr) { return 0; }
static inline void put_snapshot_map(struct trace_array *tr) { }
#endif
+/*
+ * This is called when a VMA is duplicated (e.g., on fork()) to increment
+ * the user_mapped counter without remapping pages.
+ */
+static void tracing_buffers_mmap_open(struct vm_area_struct *vma)
+{
+ struct ftrace_buffer_info *info = vma->vm_file->private_data;
+ struct trace_iterator *iter = &info->iter;
+
+ ring_buffer_map_dup(iter->array_buffer->buffer, iter->cpu_file);
+}
+
static void tracing_buffers_mmap_close(struct vm_area_struct *vma)
{
struct ftrace_buffer_info *info = vma->vm_file->private_data;
@@ -9018,6 +9030,7 @@ static int tracing_buffers_may_split(struct vm_area_struct *vma, unsigned long a
}
static const struct vm_operations_struct tracing_buffers_vmops = {
+ .open = tracing_buffers_mmap_open,
.close = tracing_buffers_mmap_close,
.may_split = tracing_buffers_may_split,
};
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 149/311] scsi: target: Fix recursive locking in __configfs_open_file()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (147 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 148/311] tracing: Fix WARN_ON in tracing_buffers_mmap_close Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 150/311] mm: thp: deny THP for files on anonymous inodes Sasha Levin
` (175 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Prithvi Tambewagh, syzbot+f6e8174215573a84b797, Dmitry Bogdanov,
Martin K. Petersen, Greg Kroah-Hartman
From: Prithvi Tambewagh <activprithvi@gmail.com>
commit 14d4ac19d1895397532eec407433c5d74d9da53b upstream.
In flush_write_buffer, &p->frag_sem is acquired and then the loaded store
function is called, which, here, is target_core_item_dbroot_store(). This
function called filp_open(), following which these functions were called
(in reverse order), according to the call trace:
down_read
__configfs_open_file
do_dentry_open
vfs_open
do_open
path_openat
do_filp_open
file_open_name
filp_open
target_core_item_dbroot_store
flush_write_buffer
configfs_write_iter
target_core_item_dbroot_store() tries to validate the new file path by
trying to open the file path provided to it; however, in this case, the bug
report shows:
db_root: not a directory: /sys/kernel/config/target/dbroot
indicating that the same configfs file was tried to be opened, on which it
is currently working on. Thus, it is trying to acquire frag_sem semaphore
of the same file of which it already holds the semaphore obtained in
flush_write_buffer(), leading to acquiring the semaphore in a nested manner
and a possibility of recursive locking.
Fix this by modifying target_core_item_dbroot_store() to use kern_path()
instead of filp_open() to avoid opening the file using filesystem-specific
function __configfs_open_file(), and further modifying it to make this fix
compatible.
Reported-by: syzbot+f6e8174215573a84b797@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f6e8174215573a84b797
Tested-by: syzbot+f6e8174215573a84b797@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Signed-off-by: Prithvi Tambewagh <activprithvi@gmail.com>
Reviewed-by: Dmitry Bogdanov <d.bogdanov@yadro.com>
Link: https://patch.msgid.link/20260216062002.61937-1-activprithvi@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/target/target_core_configfs.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index f7868b41c5e61..749af4a29a715 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -108,8 +108,8 @@ static ssize_t target_core_item_dbroot_store(struct config_item *item,
const char *page, size_t count)
{
ssize_t read_bytes;
- struct file *fp;
ssize_t r = -EINVAL;
+ struct path path = {};
mutex_lock(&target_devices_lock);
if (target_devices) {
@@ -131,17 +131,14 @@ static ssize_t target_core_item_dbroot_store(struct config_item *item,
db_root_stage[read_bytes - 1] = '\0';
/* validate new db root before accepting it */
- fp = filp_open(db_root_stage, O_RDONLY, 0);
- if (IS_ERR(fp)) {
+ r = kern_path(db_root_stage, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path);
+ if (r) {
pr_err("db_root: cannot open: %s\n", db_root_stage);
+ if (r == -ENOTDIR)
+ pr_err("db_root: not a directory: %s\n", db_root_stage);
goto unlock;
}
- if (!S_ISDIR(file_inode(fp)->i_mode)) {
- filp_close(fp, NULL);
- pr_err("db_root: not a directory: %s\n", db_root_stage);
- goto unlock;
- }
- filp_close(fp, NULL);
+ path_put(&path);
strscpy(db_root, db_root_stage);
pr_debug("Target_Core_ConfigFS: db_root set to %s\n", db_root);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 150/311] mm: thp: deny THP for files on anonymous inodes
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (148 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 149/311] scsi: target: Fix recursive locking in __configfs_open_file() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 151/311] Squashfs: check metadata block offset is within range Sasha Levin
` (174 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Deepanshu Kartikey, Deepanshu Kartikey,
syzbot+33a04338019ac7e43a44, Lance Yang, David Hildenbrand (Arm),
Barry Song, Ackerley Tng, Lorenzo Stoakes, Baolin Wang, Dev Jain,
Fangrui Song, Liam Howlett, Nico Pache, Ryan Roberts, Yang Shi,
Zi Yan, Andrew Morton, Greg Kroah-Hartman
From: Deepanshu Kartikey <kartikey406@gmail.com>
commit dd085fe9a8ebfc5d10314c60452db38d2b75e609 upstream.
file_thp_enabled() incorrectly allows THP for files on anonymous inodes
(e.g. guest_memfd and secretmem). These files are created via
alloc_file_pseudo(), which does not call get_write_access() and leaves
inode->i_writecount at 0. Combined with S_ISREG(inode->i_mode) being
true, they appear as read-only regular files when
CONFIG_READ_ONLY_THP_FOR_FS is enabled, making them eligible for THP
collapse.
Anonymous inodes can never pass the inode_is_open_for_write() check
since their i_writecount is never incremented through the normal VFS
open path. The right thing to do is to exclude them from THP eligibility
altogether, since CONFIG_READ_ONLY_THP_FOR_FS was designed for real
filesystem files (e.g. shared libraries), not for pseudo-filesystem
inodes.
For guest_memfd, this allows khugepaged and MADV_COLLAPSE to create
large folios in the page cache via the collapse path, but the
guest_memfd fault handler does not support large folios. This triggers
WARN_ON_ONCE(folio_test_large(folio)) in kvm_gmem_fault_user_mapping().
For secretmem, collapse_file() tries to copy page contents through the
direct map, but secretmem pages are removed from the direct map. This
can result in a kernel crash:
BUG: unable to handle page fault for address: ffff88810284d000
RIP: 0010:memcpy_orig+0x16/0x130
Call Trace:
collapse_file
hpage_collapse_scan_file
madvise_collapse
Secretmem is not affected by the crash on upstream as the memory failure
recovery handles the failed copy gracefully, but it still triggers
confusing false memory failure reports:
Memory failure: 0x106d96f: recovery action for clean unevictable
LRU page: Recovered
Check IS_ANON_FILE(inode) in file_thp_enabled() to deny THP for all
anonymous inode files.
Link: https://syzkaller.appspot.com/bug?extid=33a04338019ac7e43a44
Link: https://lore.kernel.org/linux-mm/CAEvNRgHegcz3ro35ixkDw39ES8=U6rs6S7iP0gkR9enr7HoGtA@mail.gmail.com
Link: https://lkml.kernel.org/r/20260214001535.435626-1-kartikey406@gmail.com
Fixes: 7fbb5e188248 ("mm: remove VM_EXEC requirement for THP eligibility")
Signed-off-by: Deepanshu Kartikey <Kartikey406@gmail.com>
Reported-by: syzbot+33a04338019ac7e43a44@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=33a04338019ac7e43a44
Tested-by: syzbot+33a04338019ac7e43a44@syzkaller.appspotmail.com
Tested-by: Lance Yang <lance.yang@linux.dev>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Ackerley Tng <ackerleytng@google.com>
Tested-by: Ackerley Tng <ackerleytng@google.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Fangrui Song <i@maskray.me>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Nico Pache <npache@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Yang Shi <shy828301@gmail.com>
Cc: Zi Yan <ziy@nvidia.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/huge_memory.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 40cf59301c21a..d3beddd8cc30a 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -94,6 +94,9 @@ static inline bool file_thp_enabled(struct vm_area_struct *vma)
inode = file_inode(vma->vm_file);
+ if (IS_ANON_FILE(inode))
+ return false;
+
return !inode_is_open_for_write(inode) && S_ISREG(inode->i_mode);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 151/311] Squashfs: check metadata block offset is within range
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (149 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 150/311] mm: thp: deny THP for files on anonymous inodes Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 152/311] drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock() Sasha Levin
` (173 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Phillip Lougher, syzbot+a9747fe1c35a5b115d3f, Christian Brauner,
Andrew Morton, Greg Kroah-Hartman
From: Phillip Lougher <phillip@squashfs.org.uk>
commit fdb24a820a5832ec4532273282cbd4f22c291a0d upstream.
Syzkaller reports a "general protection fault in squashfs_copy_data"
This is ultimately caused by a corrupted index look-up table, which
produces a negative metadata block offset.
This is subsequently passed to squashfs_copy_data (via
squashfs_read_metadata) where the negative offset causes an out of bounds
access.
The fix is to check that the offset is within range in
squashfs_read_metadata. This will trap this and other cases.
Link: https://lkml.kernel.org/r/20260217050955.138351-1-phillip@squashfs.org.uk
Fixes: f400e12656ab ("Squashfs: cache operations")
Reported-by: syzbot+a9747fe1c35a5b115d3f@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/699234e2.a70a0220.2c38d7.00e2.GAE@google.com/
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/squashfs/cache.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/squashfs/cache.c b/fs/squashfs/cache.c
index 181260e72680c..92fb857d2c761 100644
--- a/fs/squashfs/cache.c
+++ b/fs/squashfs/cache.c
@@ -344,6 +344,9 @@ int squashfs_read_metadata(struct super_block *sb, void *buffer,
if (unlikely(length < 0))
return -EIO;
+ if (unlikely(*offset < 0 || *offset >= SQUASHFS_METADATA_SIZE))
+ return -EIO;
+
while (length) {
entry = squashfs_cache_get(sb, msblk->block_cache, *block, 0);
if (entry->error) {
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 152/311] drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (150 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 151/311] Squashfs: check metadata block offset is within range Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 153/311] drbd: fix null-pointer dereference on local read error Sasha Levin
` (172 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Lars Ellenberg, Christoph Böhmwalder, Jens Axboe,
Greg Kroah-Hartman
From: Lars Ellenberg <lars.ellenberg@linbit.com>
commit ab140365fb62c0bdab22b2f516aff563b2559e3b upstream.
Even though we check that we "should" be able to do lc_get_cumulative()
while holding the device->al_lock spinlock, it may still fail,
if some other code path decided to do lc_try_lock() with bad timing.
If that happened, we logged "LOGIC BUG for enr=...",
but still did not return an error.
The rest of the code now assumed that this request has references
for the relevant activity log extents.
The implcations are that during an active resync, mutual exclusivity of
resync versus application IO is not guaranteed. And a potential crash
at this point may not realizs that these extents could have been target
of in-flight IO and would need to be resynced just in case.
Also, once the request completes, it will give up activity log references it
does not even hold, which will trigger a BUG_ON(refcnt == 0) in lc_put().
Fix:
Do not crash the kernel for a condition that is harmless during normal
operation: also catch "e->refcnt == 0", not only "e == NULL"
when being noisy about "al_complete_io() called on inactive extent %u\n".
And do not try to be smart and "guess" whether something will work, then
be surprised when it does not.
Deal with the fact that it may or may not work. If it does not, remember a
possible "partially in activity log" state (only possible for requests that
cross extent boundaries), and return an error code from
drbd_al_begin_io_nonblock().
A latter call for the same request will then resume from where we left off.
Cc: stable@vger.kernel.org
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/block/drbd/drbd_actlog.c | 53 +++++++++++++-----------------
drivers/block/drbd/drbd_interval.h | 5 ++-
2 files changed, 27 insertions(+), 31 deletions(-)
diff --git a/drivers/block/drbd/drbd_actlog.c b/drivers/block/drbd/drbd_actlog.c
index 742b2908ff686..b3dbf6c76e98f 100644
--- a/drivers/block/drbd/drbd_actlog.c
+++ b/drivers/block/drbd/drbd_actlog.c
@@ -483,38 +483,20 @@ void drbd_al_begin_io(struct drbd_device *device, struct drbd_interval *i)
int drbd_al_begin_io_nonblock(struct drbd_device *device, struct drbd_interval *i)
{
- struct lru_cache *al = device->act_log;
/* for bios crossing activity log extent boundaries,
* we may need to activate two extents in one go */
unsigned first = i->sector >> (AL_EXTENT_SHIFT-9);
unsigned last = i->size == 0 ? first : (i->sector + (i->size >> 9) - 1) >> (AL_EXTENT_SHIFT-9);
- unsigned nr_al_extents;
- unsigned available_update_slots;
unsigned enr;
- D_ASSERT(device, first <= last);
-
- nr_al_extents = 1 + last - first; /* worst case: all touched extends are cold. */
- available_update_slots = min(al->nr_elements - al->used,
- al->max_pending_changes - al->pending_changes);
-
- /* We want all necessary updates for a given request within the same transaction
- * We could first check how many updates are *actually* needed,
- * and use that instead of the worst-case nr_al_extents */
- if (available_update_slots < nr_al_extents) {
- /* Too many activity log extents are currently "hot".
- *
- * If we have accumulated pending changes already,
- * we made progress.
- *
- * If we cannot get even a single pending change through,
- * stop the fast path until we made some progress,
- * or requests to "cold" extents could be starved. */
- if (!al->pending_changes)
- __set_bit(__LC_STARVING, &device->act_log->flags);
- return -ENOBUFS;
+ if (i->partially_in_al_next_enr) {
+ D_ASSERT(device, first < i->partially_in_al_next_enr);
+ D_ASSERT(device, last >= i->partially_in_al_next_enr);
+ first = i->partially_in_al_next_enr;
}
+ D_ASSERT(device, first <= last);
+
/* Is resync active in this area? */
for (enr = first; enr <= last; enr++) {
struct lc_element *tmp;
@@ -529,14 +511,21 @@ int drbd_al_begin_io_nonblock(struct drbd_device *device, struct drbd_interval *
}
}
- /* Checkout the refcounts.
- * Given that we checked for available elements and update slots above,
- * this has to be successful. */
+ /* Try to checkout the refcounts. */
for (enr = first; enr <= last; enr++) {
struct lc_element *al_ext;
al_ext = lc_get_cumulative(device->act_log, enr);
- if (!al_ext)
- drbd_info(device, "LOGIC BUG for enr=%u\n", enr);
+
+ if (!al_ext) {
+ /* Did not work. We may have exhausted the possible
+ * changes per transaction. Or raced with someone
+ * "locking" it against changes.
+ * Remember where to continue from.
+ */
+ if (enr > first)
+ i->partially_in_al_next_enr = enr;
+ return -ENOBUFS;
+ }
}
return 0;
}
@@ -556,7 +545,11 @@ void drbd_al_complete_io(struct drbd_device *device, struct drbd_interval *i)
for (enr = first; enr <= last; enr++) {
extent = lc_find(device->act_log, enr);
- if (!extent) {
+ /* Yes, this masks a bug elsewhere. However, during normal
+ * operation this is harmless, so no need to crash the kernel
+ * by the BUG_ON(refcount == 0) in lc_put().
+ */
+ if (!extent || extent->refcnt == 0) {
drbd_err(device, "al_complete_io() called on inactive extent %u\n", enr);
continue;
}
diff --git a/drivers/block/drbd/drbd_interval.h b/drivers/block/drbd/drbd_interval.h
index 366489b72fe97..5d3213b81eede 100644
--- a/drivers/block/drbd/drbd_interval.h
+++ b/drivers/block/drbd/drbd_interval.h
@@ -8,12 +8,15 @@
struct drbd_interval {
struct rb_node rb;
sector_t sector; /* start sector of the interval */
- unsigned int size; /* size in bytes */
sector_t end; /* highest interval end in subtree */
+ unsigned int size; /* size in bytes */
unsigned int local:1 /* local or remote request? */;
unsigned int waiting:1; /* someone is waiting for completion */
unsigned int completed:1; /* this has been completed already;
* ignore for conflict detection */
+
+ /* to resume a partially successful drbd_al_begin_io_nonblock(); */
+ unsigned int partially_in_al_next_enr;
};
static inline void drbd_clear_interval(struct drbd_interval *i)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 153/311] drbd: fix null-pointer dereference on local read error
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (151 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 152/311] drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 154/311] xfs: fix xfs_group release bug in xfs_dax_notify_dev_failure Sasha Levin
` (171 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Christoph Böhmwalder, Tuo Li, Jens Axboe, Greg Kroah-Hartman
From: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
commit 0d195d3b205ca90db30d70d09d7bb6909aac178f upstream.
In drbd_request_endio(), READ_COMPLETED_WITH_ERROR is passed to
__req_mod() with a NULL peer_device:
__req_mod(req, what, NULL, &m);
The READ_COMPLETED_WITH_ERROR handler then unconditionally passes this
NULL peer_device to drbd_set_out_of_sync(), which dereferences it,
causing a null-pointer dereference.
Fix this by obtaining the peer_device via first_peer_device(device),
matching how drbd_req_destroy() handles the same situation.
Cc: stable@vger.kernel.org
Reported-by: Tuo Li <islituo@gmail.com>
Link: https://lore.kernel.org/linux-block/20260104165355.151864-1-islituo@gmail.com
Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/block/drbd/drbd_req.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index d15826f6ee81d..70f75ef079457 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -621,7 +621,8 @@ int __req_mod(struct drbd_request *req, enum drbd_req_event what,
break;
case READ_COMPLETED_WITH_ERROR:
- drbd_set_out_of_sync(peer_device, req->i.sector, req->i.size);
+ drbd_set_out_of_sync(first_peer_device(device),
+ req->i.sector, req->i.size);
drbd_report_io_error(device, req);
__drbd_chk_io_error(device, DRBD_READ_ERROR);
fallthrough;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 154/311] xfs: fix xfs_group release bug in xfs_dax_notify_dev_failure
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (152 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 153/311] drbd: fix null-pointer dereference on local read error Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 155/311] xfs: Fix error pointer dereference Sasha Levin
` (170 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Darrick J. Wong, Christoph Hellwig, Carlos Maiolino,
Carlos Maiolino, Greg Kroah-Hartman
From: "Darrick J. Wong" <djwong@kernel.org>
commit eb8550fb75a875657dc29e3925a40244ec6b6bd6 upstream.
Chris Mason reports that his AI tools noticed that we were using
xfs_perag_put and xfs_group_put to release the group reference returned
by xfs_group_next_range. However, the iterator function returns an
object with an active refcount, which means that we must use the correct
function to release the active refcount, which is _rele.
Cc: <stable@vger.kernel.org> # v6.0
Fixes: 6f643c57d57c56 ("xfs: implement ->notify_failure() for XFS")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/xfs/xfs_notify_failure.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_notify_failure.c b/fs/xfs/xfs_notify_failure.c
index b176728899420..0700a723f38e7 100644
--- a/fs/xfs/xfs_notify_failure.c
+++ b/fs/xfs/xfs_notify_failure.c
@@ -293,7 +293,7 @@ xfs_dax_notify_dev_failure(
error = xfs_alloc_read_agf(pag, tp, 0, &agf_bp);
if (error) {
- xfs_perag_put(pag);
+ xfs_perag_rele(pag);
break;
}
@@ -329,7 +329,7 @@ xfs_dax_notify_dev_failure(
if (rtg)
xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP);
if (error) {
- xfs_group_put(xg);
+ xfs_group_rele(xg);
break;
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 155/311] xfs: Fix error pointer dereference
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (153 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 154/311] xfs: fix xfs_group release bug in xfs_dax_notify_dev_failure Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 156/311] smb: client: fix cifs_pick_channel when channels are equally loaded Sasha Levin
` (169 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Ethan Tidmore, Darrick J. Wong, Nirjhar Roy (IBM),
Carlos Maiolino, Greg Kroah-Hartman
From: Ethan Tidmore <ethantidmore06@gmail.com>
commit cddfa648f1ab99e30e91455be19cd5ade26338c2 upstream.
The function try_lookup_noperm() can return an error pointer and is not
checked for one.
Add checks for error pointer in xrep_adoption_check_dcache() and
xrep_adoption_zap_dcache().
Detected by Smatch:
fs/xfs/scrub/orphanage.c:449 xrep_adoption_check_dcache() error:
'd_child' dereferencing possible ERR_PTR()
fs/xfs/scrub/orphanage.c:485 xrep_adoption_zap_dcache() error:
'd_child' dereferencing possible ERR_PTR()
Fixes: 73597e3e42b4 ("xfs: ensure dentry consistency when the orphanage adopts a file")
Cc: stable@vger.kernel.org # v6.16
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/xfs/scrub/orphanage.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/scrub/orphanage.c b/fs/xfs/scrub/orphanage.c
index 4e550a1d5353b..3fa78bfe5f663 100644
--- a/fs/xfs/scrub/orphanage.c
+++ b/fs/xfs/scrub/orphanage.c
@@ -442,6 +442,11 @@ xrep_adoption_check_dcache(
return 0;
d_child = try_lookup_noperm(&qname, d_orphanage);
+ if (IS_ERR(d_child)) {
+ dput(d_orphanage);
+ return PTR_ERR(d_child);
+ }
+
if (d_child) {
trace_xrep_adoption_check_child(sc->mp, d_child);
@@ -479,7 +484,7 @@ xrep_adoption_zap_dcache(
return;
d_child = try_lookup_noperm(&qname, d_orphanage);
- while (d_child != NULL) {
+ while (!IS_ERR_OR_NULL(d_child)) {
trace_xrep_adoption_invalidate_child(sc->mp, d_child);
ASSERT(d_is_negative(d_child));
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 156/311] smb: client: fix cifs_pick_channel when channels are equally loaded
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (154 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 155/311] xfs: Fix error pointer dereference Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 157/311] smb: client: fix broken multichannel with krb5+signing Sasha Levin
` (168 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Henrique Carvalho, Paulo Alcantara (Red Hat), Meetakshi Setiya,
Shyam Prasad N, Steve French, Greg Kroah-Hartman
From: Henrique Carvalho <henrique.carvalho@suse.com>
commit 663c28469d3274d6456f206a6671c91493d85ff1 upstream.
cifs_pick_channel uses (start % chan_count) when channels are equally
loaded, but that can return a channel that failed the eligibility
checks.
Drop the fallback and return the scan-selected channel instead. If none
is eligible, keep the existing behavior of using the primary channel.
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Acked-by: Meetakshi Setiya <msetiya@microsoft.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/transport.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/fs/smb/client/transport.c b/fs/smb/client/transport.c
index 3b34c3f4da2df..67aee82e98860 100644
--- a/fs/smb/client/transport.c
+++ b/fs/smb/client/transport.c
@@ -808,16 +808,21 @@ cifs_cancelled_callback(struct TCP_Server_Info *server, struct mid_q_entry *mid)
}
/*
- * Return a channel (master if none) of @ses that can be used to send
- * regular requests.
+ * cifs_pick_channel - pick an eligible channel for network operations
*
- * If we are currently binding a new channel (negprot/sess.setup),
- * return the new incomplete channel.
+ * @ses: session reference
+ *
+ * Select an eligible channel (not terminating and not marked as needing
+ * reconnect), preferring the least loaded one. If no eligible channel is
+ * found, fall back to the primary channel (index 0).
+ *
+ * Return: TCP_Server_Info pointer for the chosen channel, or NULL if @ses is
+ * NULL.
*/
struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses)
{
uint index = 0;
- unsigned int min_in_flight = UINT_MAX, max_in_flight = 0;
+ unsigned int min_in_flight = UINT_MAX;
struct TCP_Server_Info *server = NULL;
int i, start, cur;
@@ -847,14 +852,8 @@ struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses)
min_in_flight = server->in_flight;
index = cur;
}
- if (server->in_flight > max_in_flight)
- max_in_flight = server->in_flight;
}
- /* if all channels are equally loaded, fall back to round-robin */
- if (min_in_flight == max_in_flight)
- index = (uint)start % ses->chan_count;
-
server = ses->chans[index].server;
spin_unlock(&ses->chan_lock);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 157/311] smb: client: fix broken multichannel with krb5+signing
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (155 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 156/311] smb: client: fix cifs_pick_channel when channels are equally loaded Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 158/311] smb: client: Don't log plaintext credentials in cifs_set_cifscreds Sasha Levin
` (167 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Paulo Alcantara, Xiaoli Feng, Enzo Matsumiya, David Howells,
linux-cifs, Steve French, Greg Kroah-Hartman
From: Paulo Alcantara <pc@manguebit.org>
commit d9d1e319b39ea685ede59319002d567c159d23c3 upstream.
When mounting a share with 'multichannel,max_channels=n,sec=krb5i',
the client was duplicating signing key for all secondary channels,
thus making the server fail all commands sent from secondary channels
due to bad signatures.
Every channel has its own signing key, so when establishing a new
channel with krb5 auth, make sure to use the new session key as the
derived key to generate channel's signing key in SMB2_auth_kerberos().
Repro:
$ mount.cifs //srv/share /mnt -o multichannel,max_channels=4,sec=krb5i
$ sleep 5
$ umount /mnt
$ dmesg
...
CIFS: VFS: sign fail cmd 0x5 message id 0x2
CIFS: VFS: \\srv SMB signature verification returned error = -13
CIFS: VFS: sign fail cmd 0x5 message id 0x2
CIFS: VFS: \\srv SMB signature verification returned error = -13
CIFS: VFS: sign fail cmd 0x4 message id 0x2
CIFS: VFS: \\srv SMB signature verification returned error = -13
Reported-by: Xiaoli Feng <xifeng@redhat.com>
Reviewed-by: Enzo Matsumiya <ematsumiya@suse.de>
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Cc: David Howells <dhowells@redhat.com>
Cc: linux-cifs@vger.kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/smb2pdu.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index 758d6f4256726..b16d7b42a73c4 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -1715,19 +1715,17 @@ SMB2_auth_kerberos(struct SMB2_sess_data *sess_data)
is_binding = (ses->ses_status == SES_GOOD);
spin_unlock(&ses->ses_lock);
- /* keep session key if binding */
- if (!is_binding) {
- kfree_sensitive(ses->auth_key.response);
- ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len,
- GFP_KERNEL);
- if (!ses->auth_key.response) {
- cifs_dbg(VFS, "Kerberos can't allocate (%u bytes) memory\n",
- msg->sesskey_len);
- rc = -ENOMEM;
- goto out_put_spnego_key;
- }
- ses->auth_key.len = msg->sesskey_len;
+ kfree_sensitive(ses->auth_key.response);
+ ses->auth_key.response = kmemdup(msg->data,
+ msg->sesskey_len,
+ GFP_KERNEL);
+ if (!ses->auth_key.response) {
+ cifs_dbg(VFS, "%s: can't allocate (%u bytes) memory\n",
+ __func__, msg->sesskey_len);
+ rc = -ENOMEM;
+ goto out_put_spnego_key;
}
+ ses->auth_key.len = msg->sesskey_len;
sess_data->iov[1].iov_base = msg->data + msg->sesskey_len;
sess_data->iov[1].iov_len = msg->secblob_len;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 158/311] smb: client: Don't log plaintext credentials in cifs_set_cifscreds
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (156 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 157/311] smb: client: fix broken multichannel with krb5+signing Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 159/311] smb: client: fix oops due to uninitialised var in smb2_unlink() Sasha Levin
` (166 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Thorsten Blum, Paulo Alcantara (Red Hat), Steve French,
Greg Kroah-Hartman
From: Thorsten Blum <thorsten.blum@linux.dev>
commit 2f37dc436d4e61ff7ae0b0353cf91b8c10396e4d upstream.
When debug logging is enabled, cifs_set_cifscreds() logs the key
payload and exposes the plaintext username and password. Remove the
debug log to avoid exposing credentials.
Fixes: 8a8798a5ff90 ("cifs: fetch credentials out of keyring for non-krb5 auth multiuser mounts")
Cc: stable@vger.kernel.org
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/connect.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/fs/smb/client/connect.c b/fs/smb/client/connect.c
index 60c76375f0f50..9d082f8bfa4ae 100644
--- a/fs/smb/client/connect.c
+++ b/fs/smb/client/connect.c
@@ -2233,7 +2233,6 @@ cifs_set_cifscreds(struct smb3_fs_context *ctx, struct cifs_ses *ses)
/* find first : in payload */
payload = upayload->data;
delim = strnchr(payload, upayload->datalen, ':');
- cifs_dbg(FYI, "payload=%s\n", payload);
if (!delim) {
cifs_dbg(FYI, "Unable to find ':' in payload (datalen=%d)\n",
upayload->datalen);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 159/311] smb: client: fix oops due to uninitialised var in smb2_unlink()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (157 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 158/311] smb: client: Don't log plaintext credentials in cifs_set_cifscreds Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 160/311] scsi: core: Fix refcount leak for tagset_refcnt Sasha Levin
` (165 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Paulo Alcantara, Thiago Becker, David Howells, linux-cifs,
Steve French, Greg Kroah-Hartman
From: Paulo Alcantara <pc@manguebit.org>
commit 048efe129a297256d3c2088cf8d79515ff5ec864 upstream.
If SMB2_open_init() or SMB2_close_init() fails (e.g. reconnect), the
iovs set @rqst will be left uninitialised, hence calling
SMB2_open_free(), SMB2_close_free() or smb2_set_related() on them will
oops.
Fix this by initialising @close_iov and @open_iov before setting them
in @rqst.
Reported-by: Thiago Becker <tbecker@redhat.com>
Fixes: 1cf9f2a6a544 ("smb: client: handle unlink(2) of files open by different clients")
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
Cc: David Howells <dhowells@redhat.com>
Cc: linux-cifs@vger.kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/smb/client/smb2inode.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c
index 2ded3246600c0..6b0420a5b52a7 100644
--- a/fs/smb/client/smb2inode.c
+++ b/fs/smb/client/smb2inode.c
@@ -1208,6 +1208,7 @@ smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
memset(resp_buftype, 0, sizeof(resp_buftype));
memset(rsp_iov, 0, sizeof(rsp_iov));
+ memset(open_iov, 0, sizeof(open_iov));
rqst[0].rq_iov = open_iov;
rqst[0].rq_nvec = ARRAY_SIZE(open_iov);
@@ -1232,14 +1233,15 @@ smb2_unlink(const unsigned int xid, struct cifs_tcon *tcon, const char *name,
creq = rqst[0].rq_iov[0].iov_base;
creq->ShareAccess = FILE_SHARE_DELETE_LE;
+ memset(&close_iov, 0, sizeof(close_iov));
rqst[1].rq_iov = &close_iov;
rqst[1].rq_nvec = 1;
rc = SMB2_close_init(tcon, server, &rqst[1],
COMPOUND_FID, COMPOUND_FID, false);
- smb2_set_related(&rqst[1]);
if (rc)
goto err_free;
+ smb2_set_related(&rqst[1]);
if (retries) {
for (int i = 0; i < ARRAY_SIZE(rqst); i++)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 160/311] scsi: core: Fix refcount leak for tagset_refcnt
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (158 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 159/311] smb: client: fix oops due to uninitialised var in smb2_unlink() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 161/311] scsi: ufs: core: Fix RPMB region size detection for UFS 2.2 Sasha Levin
` (164 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Junxiao Bi, Mike Christie, Bart Van Assche, Martin K. Petersen,
Greg Kroah-Hartman
From: Junxiao Bi <junxiao.bi@oracle.com>
commit 1ac22c8eae81366101597d48360718dff9b9d980 upstream.
This leak will cause a hang when tearing down the SCSI host. For example,
iscsid hangs with the following call trace:
[130120.652718] scsi_alloc_sdev: Allocation failure during SCSI scanning, some SCSI devices might not be configured
PID: 2528 TASK: ffff9d0408974e00 CPU: 3 COMMAND: "iscsid"
#0 [ffffb5b9c134b9e0] __schedule at ffffffff860657d4
#1 [ffffb5b9c134ba28] schedule at ffffffff86065c6f
#2 [ffffb5b9c134ba40] schedule_timeout at ffffffff86069fb0
#3 [ffffb5b9c134bab0] __wait_for_common at ffffffff8606674f
#4 [ffffb5b9c134bb10] scsi_remove_host at ffffffff85bfe84b
#5 [ffffb5b9c134bb30] iscsi_sw_tcp_session_destroy at ffffffffc03031c4 [iscsi_tcp]
#6 [ffffb5b9c134bb48] iscsi_if_recv_msg at ffffffffc0292692 [scsi_transport_iscsi]
#7 [ffffb5b9c134bb98] iscsi_if_rx at ffffffffc02929c2 [scsi_transport_iscsi]
#8 [ffffb5b9c134bbf0] netlink_unicast at ffffffff85e551d6
#9 [ffffb5b9c134bc38] netlink_sendmsg at ffffffff85e554ef
Fixes: 8fe4ce5836e9 ("scsi: core: Fix a use-after-free")
Cc: stable@vger.kernel.org
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260223232728.93350-1-junxiao.bi@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/scsi_scan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 7acbfcfc2172e..c64ef71633d82 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -361,6 +361,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
* since we use this queue depth most of times.
*/
if (scsi_realloc_sdev_budget_map(sdev, depth)) {
+ kref_put(&sdev->host->tagset_refcnt, scsi_mq_free_tags);
put_device(&starget->dev);
kfree(sdev);
goto out;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 161/311] scsi: ufs: core: Fix RPMB region size detection for UFS 2.2
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (159 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 160/311] scsi: core: Fix refcount leak for tagset_refcnt Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 162/311] mptcp: pm: avoid sending RM_ADDR over same subflow Sasha Levin
` (163 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Alexey Charkov, Bean Huo, Martin K. Petersen, Greg Kroah-Hartman
From: Alexey Charkov <alchark@flipper.net>
commit 2e6b5cd6a4b37a95b78cf8c39a979b58c915c8ed upstream.
Older UFS spec devices (2.2 and earlier) do not expose per-region RPMB
sizes, as only one RPMB region is supported. In such cases, the size of the
single RPMB region can be deduced from the Logical Block Count and Logical
Block Size fields in the RPMB Unit Descriptor.
Add a fallback mechanism to calculate the RPMB region size from these
fields if the device implements an older spec, so that the RPMB driver can
work with such devices - otherwise it silently skips the whole RPMB.
Section 14.1.4.6 (RPMB Unit Descriptor)
Link: https://www.jedec.org/system/files/docs/JESD220C-2_2.pdf
Cc: stable@vger.kernel.org
Fixes: b06b8c421485 ("scsi: ufs: core: Add OP-TEE based RPMB driver for UFS devices")
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Alexey Charkov <alchark@flipper.net>
Link: https://patch.msgid.link/20260209-ufs-rpmb-v3-1-b1804e71bd38@flipper.net
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/ufs/core/ufshcd.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index d6e4e99a571f1..80fafad339c75 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -23,6 +23,7 @@
#include <linux/pm_opp.h>
#include <linux/regulator/consumer.h>
#include <linux/sched/clock.h>
+#include <linux/sizes.h>
#include <linux/iopoll.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_dbg.h>
@@ -5237,6 +5238,25 @@ static void ufshcd_lu_init(struct ufs_hba *hba, struct scsi_device *sdev)
hba->dev_info.rpmb_region_size[1] = desc_buf[RPMB_UNIT_DESC_PARAM_REGION1_SIZE];
hba->dev_info.rpmb_region_size[2] = desc_buf[RPMB_UNIT_DESC_PARAM_REGION2_SIZE];
hba->dev_info.rpmb_region_size[3] = desc_buf[RPMB_UNIT_DESC_PARAM_REGION3_SIZE];
+
+ if (hba->dev_info.wspecversion <= 0x0220) {
+ /*
+ * These older spec chips have only one RPMB region,
+ * sized between 128 kB minimum and 16 MB maximum.
+ * No per region size fields are provided (respective
+ * REGIONX_SIZE fields always contain zeros), so get
+ * it from the logical block count and size fields for
+ * compatibility
+ *
+ * (See JESD220C-2_2 Section 14.1.4.6
+ * RPMB Unit Descriptor,* offset 13h, 4 bytes)
+ */
+ hba->dev_info.rpmb_region_size[0] =
+ (get_unaligned_be64(desc_buf
+ + RPMB_UNIT_DESC_PARAM_LOGICAL_BLK_COUNT)
+ << desc_buf[RPMB_UNIT_DESC_PARAM_LOGICAL_BLK_SIZE])
+ / SZ_128K;
+ }
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 162/311] mptcp: pm: avoid sending RM_ADDR over same subflow
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (160 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 161/311] scsi: ufs: core: Fix RPMB region size detection for UFS 2.2 Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 163/311] mptcp: pm: in-kernel: always mark signal+subflow endp as used Sasha Levin
` (162 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Matthieu Baerts (NGI0), Frank Lorenz, Mat Martineau,
Jakub Kicinski, Greg Kroah-Hartman
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
commit fb8d0bccb221080630efcd9660c9f9349e53cc9e upstream.
RM_ADDR are sent over an active subflow, the first one in the subflows
list. There is then a high chance the initial subflow is picked. With
the in-kernel PM, when an endpoint is removed, a RM_ADDR is sent, then
linked subflows are closed. This is done for each active MPTCP
connection.
MPTCP endpoints are likely removed because the attached network is no
longer available or usable. In this case, it is better to avoid sending
this RM_ADDR over the subflow that is going to be removed, but prefer
sending it over another active and non stale subflow, if any.
This modification avoids situations where the other end is not notified
when a subflow is no longer usable: typically when the endpoint linked
to the initial subflow is removed, especially on the server side.
Fixes: 8dd5efb1f91b ("mptcp: send ack for rm_addr")
Cc: stable@vger.kernel.org
Reported-by: Frank Lorenz <lorenz-frank@web.de>
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/612
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260303-net-mptcp-misc-fixes-7-0-rc2-v1-2-4b5462b6f016@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mptcp/pm.c | 55 +++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 43 insertions(+), 12 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index e2040c327af67..f5e1a204007aa 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -212,9 +212,24 @@ void mptcp_pm_send_ack(struct mptcp_sock *msk,
spin_lock_bh(&msk->pm.lock);
}
-void mptcp_pm_addr_send_ack(struct mptcp_sock *msk)
+static bool subflow_in_rm_list(const struct mptcp_subflow_context *subflow,
+ const struct mptcp_rm_list *rm_list)
+{
+ u8 i, id = subflow_get_local_id(subflow);
+
+ for (i = 0; i < rm_list->nr; i++) {
+ if (rm_list->ids[i] == id)
+ return true;
+ }
+
+ return false;
+}
+
+static void
+mptcp_pm_addr_send_ack_avoid_list(struct mptcp_sock *msk,
+ const struct mptcp_rm_list *rm_list)
{
- struct mptcp_subflow_context *subflow, *alt = NULL;
+ struct mptcp_subflow_context *subflow, *stale = NULL, *same_id = NULL;
msk_owned_by_me(msk);
lockdep_assert_held(&msk->pm.lock);
@@ -224,19 +239,35 @@ void mptcp_pm_addr_send_ack(struct mptcp_sock *msk)
return;
mptcp_for_each_subflow(msk, subflow) {
- if (__mptcp_subflow_active(subflow)) {
- if (!subflow->stale) {
- mptcp_pm_send_ack(msk, subflow, false, false);
- return;
- }
+ if (!__mptcp_subflow_active(subflow))
+ continue;
- if (!alt)
- alt = subflow;
+ if (unlikely(subflow->stale)) {
+ if (!stale)
+ stale = subflow;
+ } else if (unlikely(rm_list &&
+ subflow_in_rm_list(subflow, rm_list))) {
+ if (!same_id)
+ same_id = subflow;
+ } else {
+ goto send_ack;
}
}
- if (alt)
- mptcp_pm_send_ack(msk, alt, false, false);
+ if (same_id)
+ subflow = same_id;
+ else if (stale)
+ subflow = stale;
+ else
+ return;
+
+send_ack:
+ mptcp_pm_send_ack(msk, subflow, false, false);
+}
+
+void mptcp_pm_addr_send_ack(struct mptcp_sock *msk)
+{
+ mptcp_pm_addr_send_ack_avoid_list(msk, NULL);
}
int mptcp_pm_mp_prio_send_ack(struct mptcp_sock *msk,
@@ -470,7 +501,7 @@ int mptcp_pm_remove_addr(struct mptcp_sock *msk, const struct mptcp_rm_list *rm_
msk->pm.rm_list_tx = *rm_list;
rm_addr |= BIT(MPTCP_RM_ADDR_SIGNAL);
WRITE_ONCE(msk->pm.addr_signal, rm_addr);
- mptcp_pm_addr_send_ack(msk);
+ mptcp_pm_addr_send_ack_avoid_list(msk, rm_list);
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 163/311] mptcp: pm: in-kernel: always mark signal+subflow endp as used
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (161 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 162/311] mptcp: pm: avoid sending RM_ADDR over same subflow Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 164/311] selftests: mptcp: more stable simult_flows tests Sasha Levin
` (161 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Matthieu Baerts (NGI0), Mat Martineau, Jakub Kicinski,
Greg Kroah-Hartman
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
commit 579a752464a64cb5f9139102f0e6b90a1f595ceb upstream.
Syzkaller managed to find a combination of actions that was generating
this warning:
msk->pm.local_addr_used == 0
WARNING: net/mptcp/pm_kernel.c:1071 at __mark_subflow_endp_available net/mptcp/pm_kernel.c:1071 [inline], CPU#1: syz.2.17/961
WARNING: net/mptcp/pm_kernel.c:1071 at mptcp_nl_remove_subflow_and_signal_addr net/mptcp/pm_kernel.c:1103 [inline], CPU#1: syz.2.17/961
WARNING: net/mptcp/pm_kernel.c:1071 at mptcp_pm_nl_del_addr_doit+0x81d/0x8f0 net/mptcp/pm_kernel.c:1210, CPU#1: syz.2.17/961
Modules linked in:
CPU: 1 UID: 0 PID: 961 Comm: syz.2.17 Not tainted 6.19.0-08368-gfafda3b4b06b #22 PREEMPT(full)
Hardware name: QEMU Ubuntu 25.10 PC v2 (i440FX + PIIX, + 10.1 machine, 1996), BIOS 1.17.0-debian-1.17.0-1build1 04/01/2014
RIP: 0010:__mark_subflow_endp_available net/mptcp/pm_kernel.c:1071 [inline]
RIP: 0010:mptcp_nl_remove_subflow_and_signal_addr net/mptcp/pm_kernel.c:1103 [inline]
RIP: 0010:mptcp_pm_nl_del_addr_doit+0x81d/0x8f0 net/mptcp/pm_kernel.c:1210
Code: 89 c5 e8 46 30 6f fe e9 21 fd ff ff 49 83 ed 80 e8 38 30 6f fe 4c 89 ef be 03 00 00 00 e8 db 49 df fe eb ac e8 24 30 6f fe 90 <0f> 0b 90 e9 1d ff ff ff e8 16 30 6f fe eb 05 e8 0f 30 6f fe e8 9a
RSP: 0018:ffffc90001663880 EFLAGS: 00010293
RAX: ffffffff82de1a6c RBX: 0000000000000000 RCX: ffff88800722b500
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff8880158b22d0 R08: 0000000000010425 R09: ffffffffffffffff
R10: ffffffff82de18ba R11: 0000000000000000 R12: ffff88800641a640
R13: ffff8880158b1880 R14: ffff88801ec3c900 R15: ffff88800641a650
FS: 00005555722c3500(0000) GS:ffff8880f909d000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f66346e0f60 CR3: 000000001607c000 CR4: 0000000000350ef0
Call Trace:
<TASK>
genl_family_rcv_msg_doit+0x117/0x180 net/netlink/genetlink.c:1115
genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
genl_rcv_msg+0x3a8/0x3f0 net/netlink/genetlink.c:1210
netlink_rcv_skb+0x16d/0x240 net/netlink/af_netlink.c:2550
genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x3e9/0x4c0 net/netlink/af_netlink.c:1344
netlink_sendmsg+0x4aa/0x5b0 net/netlink/af_netlink.c:1894
sock_sendmsg_nosec net/socket.c:727 [inline]
__sock_sendmsg+0xc9/0xf0 net/socket.c:742
____sys_sendmsg+0x272/0x3b0 net/socket.c:2592
___sys_sendmsg+0x2de/0x320 net/socket.c:2646
__sys_sendmsg net/socket.c:2678 [inline]
__do_sys_sendmsg net/socket.c:2683 [inline]
__se_sys_sendmsg net/socket.c:2681 [inline]
__x64_sys_sendmsg+0x110/0x1a0 net/socket.c:2681
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x143/0x440 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f66346f826d
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc83d8bdc8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007f6634985fa0 RCX: 00007f66346f826d
RDX: 00000000040000b0 RSI: 0000200000000740 RDI: 0000000000000007
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f6634985fa8
R13: 00007f6634985fac R14: 0000000000000000 R15: 0000000000001770
</TASK>
The actions that caused that seem to be:
- Set the MPTCP subflows limit to 0
- Create an MPTCP endpoint with both the 'signal' and 'subflow' flags
- Create a new MPTCP connection from a different address: an ADD_ADDR
linked to the MPTCP endpoint will be sent ('signal' flag), but no
subflows is initiated ('subflow' flag)
- Remove the MPTCP endpoint
In this case, msk->pm.local_addr_used has been kept to 0 -- because no
subflows have been created -- but the corresponding bit in
msk->pm.id_avail_bitmap has been cleared when the ADD_ADDR has been
sent. This later causes a splat when removing the MPTCP endpoint because
msk->pm.local_addr_used has been kept to 0.
Now, if an endpoint has both the signal and subflow flags, but it is not
possible to create subflows because of the limits or the c-flag case,
then the local endpoint counter is still incremented: the endpoint is
used at the end. This avoids issues later when removing the endpoint and
calling __mark_subflow_endp_available(), which expects
msk->pm.local_addr_used to have been previously incremented if the
endpoint was marked as used according to msk->pm.id_avail_bitmap.
Note that signal_and_subflow variable is reset to false when the limits
and the c-flag case allows subflows creation. Also, local_addr_used is
only incremented for non ID0 subflows.
Fixes: 85df533a787b ("mptcp: pm: do not ignore 'subflow' if 'signal' flag is also set")
Cc: stable@vger.kernel.org
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/613
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260303-net-mptcp-misc-fixes-7-0-rc2-v1-4-4b5462b6f016@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mptcp/pm_kernel.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
index 4972c19fc73e2..0ef43993e15ad 100644
--- a/net/mptcp/pm_kernel.c
+++ b/net/mptcp/pm_kernel.c
@@ -418,6 +418,15 @@ static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
}
exit:
+ /* If an endpoint has both the signal and subflow flags, but it is not
+ * possible to create subflows -- the 'while' loop body above never
+ * executed -- then still mark the endp as used, which is somehow the
+ * case. This avoids issues later when removing the endpoint and calling
+ * __mark_subflow_endp_available(), which expects the increment here.
+ */
+ if (signal_and_subflow && local.addr.id != msk->mpc_endpoint_id)
+ msk->pm.local_addr_used++;
+
mptcp_pm_nl_check_work_pending(msk);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 164/311] selftests: mptcp: more stable simult_flows tests
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (162 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 163/311] mptcp: pm: in-kernel: always mark signal+subflow endp as used Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 165/311] selftests: mptcp: join: check RM_ADDR not sent over same subflow Sasha Levin
` (160 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Paolo Abeni, Matthieu Baerts (NGI0), Jakub Kicinski,
Greg Kroah-Hartman
From: Paolo Abeni <pabeni@redhat.com>
commit 8c09412e584d9bcc0e71d758ec1008d1c8d1a326 upstream.
By default, the netem qdisc can keep up to 1000 packets under its belly
to deal with the configured rate and delay. The simult flows test-case
simulates very low speed links, to avoid problems due to slow CPUs and
the TCP stack tend to transmit at a slightly higher rate than the
(virtual) link constraints.
All the above causes a relatively large amount of packets being enqueued
in the netem qdiscs - the longer the transfer, the longer the queue -
producing increasingly high TCP RTT samples and consequently increasingly
larger receive buffer size due to DRS.
When the receive buffer size becomes considerably larger than the needed
size, the tests results can flake, i.e. because minimal inaccuracy in the
pacing rate can lead to a single subflow usage towards the end of the
connection for a considerable amount of data.
Address the issue explicitly setting netem limits suitable for the
configured link speeds and unflake all the affected tests.
Fixes: 1a418cb8e888 ("mptcp: simult flow self-tests")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260303-net-mptcp-misc-fixes-7-0-rc2-v1-1-4b5462b6f016@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/testing/selftests/net/mptcp/simult_flows.sh | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/net/mptcp/simult_flows.sh b/tools/testing/selftests/net/mptcp/simult_flows.sh
index 806aaa7d2d61d..d11a8b949aab5 100755
--- a/tools/testing/selftests/net/mptcp/simult_flows.sh
+++ b/tools/testing/selftests/net/mptcp/simult_flows.sh
@@ -237,10 +237,13 @@ run_test()
for dev in ns2eth1 ns2eth2; do
tc -n $ns2 qdisc del dev $dev root >/dev/null 2>&1
done
- tc -n $ns1 qdisc add dev ns1eth1 root netem rate ${rate1}mbit $delay1
- tc -n $ns1 qdisc add dev ns1eth2 root netem rate ${rate2}mbit $delay2
- tc -n $ns2 qdisc add dev ns2eth1 root netem rate ${rate1}mbit $delay1
- tc -n $ns2 qdisc add dev ns2eth2 root netem rate ${rate2}mbit $delay2
+
+ # keep the queued pkts number low, or the RTT estimator will see
+ # increasing latency over time.
+ tc -n $ns1 qdisc add dev ns1eth1 root netem rate ${rate1}mbit $delay1 limit 50
+ tc -n $ns1 qdisc add dev ns1eth2 root netem rate ${rate2}mbit $delay2 limit 50
+ tc -n $ns2 qdisc add dev ns2eth1 root netem rate ${rate1}mbit $delay1 limit 50
+ tc -n $ns2 qdisc add dev ns2eth2 root netem rate ${rate2}mbit $delay2 limit 50
# time is measured in ms, account for transfer size, aggregated link speed
# and header overhead (10%)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 165/311] selftests: mptcp: join: check RM_ADDR not sent over same subflow
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (163 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 164/311] selftests: mptcp: more stable simult_flows tests Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 166/311] selftests: mptcp: join: check removing signal+subflow endp Sasha Levin
` (159 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Matthieu Baerts (NGI0), Mat Martineau, Jakub Kicinski,
Greg Kroah-Hartman
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
commit 560edd99b5f58b2d4bbe3c8e51e1eed68d887b0e upstream.
This validates the previous commit: RM_ADDR were sent over the first
found active subflow which could be the same as the one being removed.
It is more likely to loose this notification.
For this check, RM_ADDR are explicitly dropped when trying to send them
over the initial subflow, when removing the endpoint attached to it. If
it is dropped, the test will complain because some RM_ADDR have not been
received.
Note that only the RM_ADDR are dropped, to allow the linked subflow to
be quickly and cleanly closed. To only drop those RM_ADDR, a cBPF byte
code is used. If the IPTables commands fail, that's OK, the tests will
continue to pass, but not validate this part. This can be ignored:
another subtest fully depends on such command, and will be marked as
skipped.
The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests,
but it validates the previous fix for an issue introduced by this commit
ID.
Fixes: 8dd5efb1f91b ("mptcp: send ack for rm_addr")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260303-net-mptcp-misc-fixes-7-0-rc2-v1-3-4b5462b6f016@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
.../testing/selftests/net/mptcp/mptcp_join.sh | 36 +++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index e70d3420954fc..2e7461c488c71 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -104,6 +104,24 @@ CBPF_MPTCP_SUBOPTION_ADD_ADDR="14,
6 0 0 65535,
6 0 0 0"
+# IPv4: TCP hdr of 48B, a first suboption of 12B (DACK8), the RM_ADDR suboption
+# generated using "nfbpf_compile '(ip[32] & 0xf0) == 0xc0 && ip[53] == 0x0c &&
+# (ip[66] & 0xf0) == 0x40'"
+CBPF_MPTCP_SUBOPTION_RM_ADDR="13,
+ 48 0 0 0,
+ 84 0 0 240,
+ 21 0 9 64,
+ 48 0 0 32,
+ 84 0 0 240,
+ 21 0 6 192,
+ 48 0 0 53,
+ 21 0 4 12,
+ 48 0 0 66,
+ 84 0 0 240,
+ 21 0 1 64,
+ 6 0 0 65535,
+ 6 0 0 0"
+
init_partial()
{
capout=$(mktemp)
@@ -4222,6 +4240,14 @@ endpoint_tests()
chk_subflow_nr "after no reject" 3
chk_mptcp_info subflows 2 subflows 2
+ # To make sure RM_ADDR are sent over a different subflow, but
+ # allow the rest to quickly and cleanly close the subflow
+ local ipt=1
+ ip netns exec "${ns2}" ${iptables} -I OUTPUT -s "10.0.1.2" \
+ -p tcp -m tcp --tcp-option 30 \
+ -m bpf --bytecode \
+ "$CBPF_MPTCP_SUBOPTION_RM_ADDR" \
+ -j DROP || ipt=0
local i
for i in $(seq 3); do
pm_nl_del_endpoint $ns2 1 10.0.1.2
@@ -4234,6 +4260,7 @@ endpoint_tests()
chk_subflow_nr "after re-add id 0 ($i)" 3
chk_mptcp_info subflows 3 subflows 3
done
+ [ ${ipt} = 1 ] && ip netns exec "${ns2}" ${iptables} -D OUTPUT 1
mptcp_lib_kill_group_wait $tests_pid
@@ -4293,11 +4320,20 @@ endpoint_tests()
chk_mptcp_info subflows 2 subflows 2
chk_mptcp_info add_addr_signal 2 add_addr_accepted 2
+ # To make sure RM_ADDR are sent over a different subflow, but
+ # allow the rest to quickly and cleanly close the subflow
+ local ipt=1
+ ip netns exec "${ns1}" ${iptables} -I OUTPUT -s "10.0.1.1" \
+ -p tcp -m tcp --tcp-option 30 \
+ -m bpf --bytecode \
+ "$CBPF_MPTCP_SUBOPTION_RM_ADDR" \
+ -j DROP || ipt=0
pm_nl_del_endpoint $ns1 42 10.0.1.1
sleep 0.5
chk_subflow_nr "after delete ID 0" 2
chk_mptcp_info subflows 2 subflows 2
chk_mptcp_info add_addr_signal 2 add_addr_accepted 2
+ [ ${ipt} = 1 ] && ip netns exec "${ns1}" ${iptables} -D OUTPUT 1
pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal
wait_mpj $ns2
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 166/311] selftests: mptcp: join: check removing signal+subflow endp
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (164 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 165/311] selftests: mptcp: join: check RM_ADDR not sent over same subflow Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 167/311] kbuild: Split .modinfo out from ELF_DETAILS Sasha Levin
` (158 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Matthieu Baerts (NGI0), Mat Martineau, Jakub Kicinski,
Greg Kroah-Hartman
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
commit 1777f349ff41b62dfe27454b69c27b0bc99ffca5 upstream.
This validates the previous commit: endpoints with both the signal and
subflow flags should always be marked as used even if it was not
possible to create new subflows due to the MPTCP PM limits.
For this test, an extra endpoint is created with both the signal and the
subflow flags, and limits are set not to create extra subflows. In this
case, an ADD_ADDR is sent, but no subflows are created. Still, the local
endpoint is marked as used, and no warning is fired when removing the
endpoint, after having sent a RM_ADDR.
The 'Fixes' tag here below is the same as the one from the previous
commit: this patch here is not fixing anything wrong in the selftests,
but it validates the previous fix for an issue introduced by this commit
ID.
Fixes: 85df533a787b ("mptcp: pm: do not ignore 'subflow' if 'signal' flag is also set")
Cc: stable@vger.kernel.org
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260303-net-mptcp-misc-fixes-7-0-rc2-v1-5-4b5462b6f016@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
tools/testing/selftests/net/mptcp/mptcp_join.sh | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/tools/testing/selftests/net/mptcp/mptcp_join.sh b/tools/testing/selftests/net/mptcp/mptcp_join.sh
index 2e7461c488c71..c739e0185f7fd 100755
--- a/tools/testing/selftests/net/mptcp/mptcp_join.sh
+++ b/tools/testing/selftests/net/mptcp/mptcp_join.sh
@@ -2637,6 +2637,19 @@ remove_tests()
chk_rst_nr 0 0
fi
+ # signal+subflow with limits, remove
+ if reset "remove signal+subflow with limits"; then
+ pm_nl_set_limits $ns1 0 0
+ pm_nl_add_endpoint $ns1 10.0.2.1 flags signal,subflow
+ pm_nl_set_limits $ns2 0 0
+ addr_nr_ns1=-1 speed=slow \
+ run_tests $ns1 $ns2 10.0.1.1
+ chk_join_nr 0 0 0
+ chk_add_nr 1 1
+ chk_rm_nr 1 0 invert
+ chk_rst_nr 0 0
+ fi
+
# addresses remove
if reset "remove addresses"; then
pm_nl_set_limits $ns1 3 3
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 167/311] kbuild: Split .modinfo out from ELF_DETAILS
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (165 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 166/311] selftests: mptcp: join: check removing signal+subflow endp Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 168/311] kbuild: Leave objtool binary around with 'make clean' Sasha Levin
` (157 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Nathan Chancellor, Ed W, Greg Kroah-Hartman
From: Nathan Chancellor <nathan@kernel.org>
commit 8678591b47469fe16357234efef9b260317b8be4 upstream.
Commit 3e86e4d74c04 ("kbuild: keep .modinfo section in
vmlinux.unstripped") added .modinfo to ELF_DETAILS while removing it
from COMMON_DISCARDS, as it was needed in vmlinux.unstripped and
ELF_DETAILS was present in all architecture specific vmlinux linker
scripts. While this shuffle is fine for vmlinux, ELF_DETAILS and
COMMON_DISCARDS may be used by other linker scripts, such as the s390
and x86 compressed boot images, which may not expect to have a .modinfo
section. In certain circumstances, this could result in a bootloader
failing to load the compressed kernel [1].
Commit ddc6cbef3ef1 ("s390/boot/vmlinux.lds.S: Ensure bzImage ends with
SecureBoot trailer") recently addressed this for the s390 bzImage but
the same bug remains for arm, parisc, and x86. The presence of .modinfo
in the x86 bzImage was the root cause of the issue worked around with
commit d50f21091358 ("kbuild: align modinfo section for Secureboot
Authenticode EDK2 compat"). misc.c in arch/x86/boot/compressed includes
lib/decompress_unzstd.c, which in turn includes lib/xxhash.c and its
MODULE_LICENSE / MODULE_DESCRIPTION macros due to the STATIC definition.
Split .modinfo out from ELF_DETAILS into its own macro and handle it in
all vmlinux linker scripts. Discard .modinfo in the places where it was
previously being discarded from being in COMMON_DISCARDS, as it has
never been necessary in those uses.
Cc: stable@vger.kernel.org
Fixes: 3e86e4d74c04 ("kbuild: keep .modinfo section in vmlinux.unstripped")
Reported-by: Ed W <lists@wildgooses.com>
Closes: https://lore.kernel.org/587f25e0-a80e-46a5-9f01-87cb40cfa377@wildgooses.com/ [1]
Tested-by: Ed W <lists@wildgooses.com> # x86_64
Link: https://patch.msgid.link/20260225-separate-modinfo-from-elf-details-v1-1-387ced6baf4b@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/alpha/kernel/vmlinux.lds.S | 1 +
arch/arc/kernel/vmlinux.lds.S | 1 +
arch/arm/boot/compressed/vmlinux.lds.S | 1 +
arch/arm/kernel/vmlinux-xip.lds.S | 1 +
arch/arm/kernel/vmlinux.lds.S | 1 +
arch/arm64/kernel/vmlinux.lds.S | 1 +
arch/csky/kernel/vmlinux.lds.S | 1 +
arch/hexagon/kernel/vmlinux.lds.S | 1 +
arch/loongarch/kernel/vmlinux.lds.S | 1 +
arch/m68k/kernel/vmlinux-nommu.lds | 1 +
arch/m68k/kernel/vmlinux-std.lds | 1 +
arch/m68k/kernel/vmlinux-sun3.lds | 1 +
arch/mips/kernel/vmlinux.lds.S | 1 +
arch/nios2/kernel/vmlinux.lds.S | 1 +
arch/openrisc/kernel/vmlinux.lds.S | 1 +
arch/parisc/boot/compressed/vmlinux.lds.S | 1 +
arch/parisc/kernel/vmlinux.lds.S | 1 +
arch/powerpc/kernel/vmlinux.lds.S | 1 +
arch/riscv/kernel/vmlinux.lds.S | 1 +
arch/s390/kernel/vmlinux.lds.S | 1 +
arch/sh/kernel/vmlinux.lds.S | 1 +
arch/sparc/kernel/vmlinux.lds.S | 1 +
arch/um/kernel/dyn.lds.S | 1 +
arch/um/kernel/uml.lds.S | 1 +
arch/x86/boot/compressed/vmlinux.lds.S | 2 +-
arch/x86/kernel/vmlinux.lds.S | 1 +
include/asm-generic/vmlinux.lds.h | 4 +++-
27 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/arch/alpha/kernel/vmlinux.lds.S b/arch/alpha/kernel/vmlinux.lds.S
index 2efa7dfc798a9..2d136c63db161 100644
--- a/arch/alpha/kernel/vmlinux.lds.S
+++ b/arch/alpha/kernel/vmlinux.lds.S
@@ -71,6 +71,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
DISCARDS
diff --git a/arch/arc/kernel/vmlinux.lds.S b/arch/arc/kernel/vmlinux.lds.S
index 61a1b2b96e1d8..6af63084ff285 100644
--- a/arch/arc/kernel/vmlinux.lds.S
+++ b/arch/arc/kernel/vmlinux.lds.S
@@ -123,6 +123,7 @@ SECTIONS
_end = . ;
STABS_DEBUG
+ MODINFO
ELF_DETAILS
DISCARDS
diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S
index d411abd4310ea..2d916647df03c 100644
--- a/arch/arm/boot/compressed/vmlinux.lds.S
+++ b/arch/arm/boot/compressed/vmlinux.lds.S
@@ -21,6 +21,7 @@ SECTIONS
COMMON_DISCARDS
*(.ARM.exidx*)
*(.ARM.extab*)
+ *(.modinfo)
*(.note.*)
*(.rel.*)
*(.printk_index)
diff --git a/arch/arm/kernel/vmlinux-xip.lds.S b/arch/arm/kernel/vmlinux-xip.lds.S
index f2e8d4fac0687..5afb725998ec0 100644
--- a/arch/arm/kernel/vmlinux-xip.lds.S
+++ b/arch/arm/kernel/vmlinux-xip.lds.S
@@ -154,6 +154,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ARM_DETAILS
ARM_ASSERTS
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index d592a203f9c6b..c07843c3c53d3 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -153,6 +153,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ARM_DETAILS
ARM_ASSERTS
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index ad6133b89e7a4..2964aad0362e4 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -349,6 +349,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
HEAD_SYMBOLS
diff --git a/arch/csky/kernel/vmlinux.lds.S b/arch/csky/kernel/vmlinux.lds.S
index d718961786d24..81943981b3af4 100644
--- a/arch/csky/kernel/vmlinux.lds.S
+++ b/arch/csky/kernel/vmlinux.lds.S
@@ -109,6 +109,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
DISCARDS
diff --git a/arch/hexagon/kernel/vmlinux.lds.S b/arch/hexagon/kernel/vmlinux.lds.S
index 1150b77fa281c..aae22283b5e00 100644
--- a/arch/hexagon/kernel/vmlinux.lds.S
+++ b/arch/hexagon/kernel/vmlinux.lds.S
@@ -62,6 +62,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
.hexagon.attributes 0 : { *(.hexagon.attributes) }
diff --git a/arch/loongarch/kernel/vmlinux.lds.S b/arch/loongarch/kernel/vmlinux.lds.S
index 08ea921cdec16..d0e1377a041d6 100644
--- a/arch/loongarch/kernel/vmlinux.lds.S
+++ b/arch/loongarch/kernel/vmlinux.lds.S
@@ -147,6 +147,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
#ifdef CONFIG_EFI_STUB
diff --git a/arch/m68k/kernel/vmlinux-nommu.lds b/arch/m68k/kernel/vmlinux-nommu.lds
index 2624fc18c131f..45d7f4b0177b4 100644
--- a/arch/m68k/kernel/vmlinux-nommu.lds
+++ b/arch/m68k/kernel/vmlinux-nommu.lds
@@ -85,6 +85,7 @@ SECTIONS {
_end = .;
STABS_DEBUG
+ MODINFO
ELF_DETAILS
/* Sections to be discarded */
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 1ccdd04ae4624..7326586afe15f 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -58,6 +58,7 @@ SECTIONS
_end = . ;
STABS_DEBUG
+ MODINFO
ELF_DETAILS
/* Sections to be discarded */
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index f13ddcc2af5c2..1b19fef201fba 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -51,6 +51,7 @@ __init_begin = .;
_end = . ;
STABS_DEBUG
+ MODINFO
ELF_DETAILS
/* Sections to be discarded */
diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
index 2b708fac8d2c1..579b2cc1995ae 100644
--- a/arch/mips/kernel/vmlinux.lds.S
+++ b/arch/mips/kernel/vmlinux.lds.S
@@ -217,6 +217,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
/* These must appear regardless of . */
diff --git a/arch/nios2/kernel/vmlinux.lds.S b/arch/nios2/kernel/vmlinux.lds.S
index 37b9580550646..206f92445bfad 100644
--- a/arch/nios2/kernel/vmlinux.lds.S
+++ b/arch/nios2/kernel/vmlinux.lds.S
@@ -57,6 +57,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
DISCARDS
diff --git a/arch/openrisc/kernel/vmlinux.lds.S b/arch/openrisc/kernel/vmlinux.lds.S
index 049bff45f6126..9b29c3211774c 100644
--- a/arch/openrisc/kernel/vmlinux.lds.S
+++ b/arch/openrisc/kernel/vmlinux.lds.S
@@ -101,6 +101,7 @@ SECTIONS
/* Throw in the debugging sections */
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
/* Sections to be discarded -- must be last */
diff --git a/arch/parisc/boot/compressed/vmlinux.lds.S b/arch/parisc/boot/compressed/vmlinux.lds.S
index ab7b439908578..87d24cc824b66 100644
--- a/arch/parisc/boot/compressed/vmlinux.lds.S
+++ b/arch/parisc/boot/compressed/vmlinux.lds.S
@@ -90,6 +90,7 @@ SECTIONS
/* Sections to be discarded */
DISCARDS
/DISCARD/ : {
+ *(.modinfo)
#ifdef CONFIG_64BIT
/* temporary hack until binutils is fixed to not emit these
* for static binaries
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index b445e47903cfd..0ca93d6d72354 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -165,6 +165,7 @@ SECTIONS
_end = . ;
STABS_DEBUG
+ MODINFO
ELF_DETAILS
.note 0 : { *(.note) }
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 15850296c0a9c..8fc11d6565bfb 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -397,6 +397,7 @@ SECTIONS
_end = . ;
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
DISCARDS
diff --git a/arch/riscv/kernel/vmlinux.lds.S b/arch/riscv/kernel/vmlinux.lds.S
index 61bd5ba6680a7..997f9eb3b22b1 100644
--- a/arch/riscv/kernel/vmlinux.lds.S
+++ b/arch/riscv/kernel/vmlinux.lds.S
@@ -170,6 +170,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
.riscv.attributes 0 : { *(.riscv.attributes) }
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index 53bcbb91bb9bd..2b62395e35bfb 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -221,6 +221,7 @@ SECTIONS
/* Debugging sections. */
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
/*
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
index 008c30289eaa6..169c63fb3c1dc 100644
--- a/arch/sh/kernel/vmlinux.lds.S
+++ b/arch/sh/kernel/vmlinux.lds.S
@@ -89,6 +89,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
DISCARDS
diff --git a/arch/sparc/kernel/vmlinux.lds.S b/arch/sparc/kernel/vmlinux.lds.S
index f1b86eb303404..7ea510d9b42f2 100644
--- a/arch/sparc/kernel/vmlinux.lds.S
+++ b/arch/sparc/kernel/vmlinux.lds.S
@@ -191,6 +191,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
DISCARDS
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index a36b7918a011a..ad3cefeff2acb 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -172,6 +172,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
DISCARDS
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index a409d4b66114f..30aa24348d60c 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -113,6 +113,7 @@ SECTIONS
STABS_DEBUG
DWARF_DEBUG
+ MODINFO
ELF_DETAILS
DISCARDS
diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index 587ce3e7c5048..e0b152715d9c6 100644
--- a/arch/x86/boot/compressed/vmlinux.lds.S
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -88,7 +88,7 @@ SECTIONS
/DISCARD/ : {
*(.dynamic) *(.dynsym) *(.dynstr) *(.dynbss)
*(.hash) *(.gnu.hash)
- *(.note.*)
+ *(.note.*) *(.modinfo)
}
.got.plt (INFO) : {
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
index d7af4a64c211b..4ed82b1fe173b 100644
--- a/arch/x86/kernel/vmlinux.lds.S
+++ b/arch/x86/kernel/vmlinux.lds.S
@@ -424,6 +424,7 @@ SECTIONS
.llvm_bb_addr_map : { *(.llvm_bb_addr_map) }
#endif
+ MODINFO
ELF_DETAILS
DISCARDS
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 8ca130af301fc..7b38ec8dc8dd3 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -848,12 +848,14 @@
/* Required sections not related to debugging. */
#define ELF_DETAILS \
- .modinfo : { *(.modinfo) . = ALIGN(8); } \
.comment 0 : { *(.comment) } \
.symtab 0 : { *(.symtab) } \
.strtab 0 : { *(.strtab) } \
.shstrtab 0 : { *(.shstrtab) }
+#define MODINFO \
+ .modinfo : { *(.modinfo) . = ALIGN(8); }
+
#ifdef CONFIG_GENERIC_BUG
#define BUG_TABLE \
. = ALIGN(8); \
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 168/311] kbuild: Leave objtool binary around with 'make clean'
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (166 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 167/311] kbuild: Split .modinfo out from ELF_DETAILS Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 169/311] ASoC: sdca: Fix missing regmap dependencies in Kconfig Sasha Levin
` (156 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Nathan Chancellor, Michal Suchanek, Rainer Fiebig, Josh Poimboeuf,
Peter Zijlstra (Intel), Nicolas Schier, Greg Kroah-Hartman
From: Nathan Chancellor <nathan@kernel.org>
commit fdb12c8a24a453bdd6759979b6ef1e04ebd4beb4 upstream.
The difference between 'make clean' and 'make mrproper' is documented in
'make help' as:
clean - Remove most generated files but keep the config and
enough build support to build external modules
mrproper - Remove all generated files + config + various backup files
After commit 68b4fe32d737 ("kbuild: Add objtool to top-level clean
target"), running 'make clean' then attempting to build an external
module with the resulting build directory fails with
$ make ARCH=x86_64 O=build clean
$ make -C build M=... MO=...
...
/bin/sh: line 1: .../build/tools/objtool/objtool: No such file or directory
as 'make clean' removes the objtool binary.
Split the objtool clean target into mrproper and clean like Kbuild does
and remove all generated artifacts with 'make clean' except for the
objtool binary, which is removed with 'make mrproper'. To avoid a small
race when running the objtool clean target through both objtool_mrproper
and objtool_clean when running 'make mrproper', modify objtool's clean
up find command to avoid using find's '-delete' command by piping the
files into 'xargs rm -f' like the rest of Kbuild does.
Cc: stable@vger.kernel.org
Fixes: 68b4fe32d737 ("kbuild: Add objtool to top-level clean target")
Reported-by: Michal Suchanek <msuchanek@suse.de>
Closes: https://lore.kernel.org/20260225112633.6123-1-msuchanek@suse.de/
Reported-by: Rainer Fiebig <jrf@mailbox.org>
Closes: https://lore.kernel.org/62d12399-76e5-3d40-126a-7490b4795b17@mailbox.org/
Acked-by: Josh Poimboeuf <jpoimboe@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Tested-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/20260227-avoid-objtool-binary-removal-clean-v1-1-122f3e55eae9@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
Makefile | 8 ++++----
tools/objtool/Makefile | 8 +++++---
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index 67f26d8b29343..faab511ef38c0 100644
--- a/Makefile
+++ b/Makefile
@@ -1474,13 +1474,13 @@ ifneq ($(wildcard $(resolve_btfids_O)),)
$(Q)$(MAKE) -sC $(srctree)/tools/bpf/resolve_btfids O=$(resolve_btfids_O) clean
endif
-PHONY += objtool_clean
+PHONY += objtool_clean objtool_mrproper
objtool_O = $(abspath $(objtree))/tools/objtool
-objtool_clean:
+objtool_clean objtool_mrproper:
ifneq ($(wildcard $(objtool_O)),)
- $(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=$(objtool_O) srctree=$(abs_srctree) clean
+ $(Q)$(MAKE) -sC $(abs_srctree)/tools/objtool O=$(objtool_O) srctree=$(abs_srctree) $(patsubst objtool_%,%,$@)
endif
tools/: FORCE
@@ -1657,7 +1657,7 @@ PHONY += $(mrproper-dirs) mrproper
$(mrproper-dirs):
$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
-mrproper: clean $(mrproper-dirs)
+mrproper: clean objtool_mrproper $(mrproper-dirs)
$(call cmd,rmfiles)
@find . $(RCS_FIND_IGNORE) \
\( -name '*.rmeta' \) \
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 6964175abdfdf..76bcd4e85de34 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -142,13 +142,15 @@ $(LIBSUBCMD)-clean:
$(Q)$(RM) -r -- $(LIBSUBCMD_OUTPUT)
clean: $(LIBSUBCMD)-clean
- $(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL)
- $(Q)find $(OUTPUT) -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete
+ $(Q)find $(OUTPUT) \( -name '*.o' -o -name '\.*.cmd' -o -name '\.*.d' \) -type f -print | xargs $(RM)
$(Q)$(RM) $(OUTPUT)arch/x86/lib/cpu-feature-names.c $(OUTPUT)fixdep
$(Q)$(RM) $(OUTPUT)arch/x86/lib/inat-tables.c $(OUTPUT)fixdep
$(Q)$(RM) -- $(OUTPUT)FEATURE-DUMP.objtool
$(Q)$(RM) -r -- $(OUTPUT)feature
+mrproper: clean
+ $(call QUIET_CLEAN, objtool) $(RM) $(OBJTOOL)
+
FORCE:
-.PHONY: clean FORCE
+.PHONY: clean mrproper FORCE
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 169/311] ASoC: sdca: Fix missing regmap dependencies in Kconfig
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (167 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 168/311] kbuild: Leave objtool binary around with 'make clean' Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 170/311] Revert "netfilter: nft_set_rbtree: validate open interval overlap" Sasha Levin
` (155 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Boris Faure, Mark Brown, Randy Dunlap, Greg Kroah-Hartman
From: Boris Faure <boris@fau.re>
commit bbb758a6943e19c483ab752cf8220140b46cf22c upstream.
The SDCA modules failed to build with modpost errors:
ERROR: modpost: "__devm_regmap_init_sdw" [sound/soc/sdca/snd-soc-sdca-class.ko] undefined!
ERROR: modpost: "__devm_regmap_init_sdw_mbq" [sound/soc/sdca/snd-soc-sdca-class-function.ko] undefined!
The issue occurs because:
- sdca_class.c calls devm_regmap_init_sdw() which requires REGMAP_SOUNDWIRE
- sdca_class_function.c calls devm_regmap_init_sdw_mbq_cfg() which requires REGMAP_SOUNDWIRE_MBQ
However, the Kconfig didn't select these dependencies, causing the symbols
to be unavailable when the SDCA modules are built.
Fix this by adding:
- select REGMAP_SOUNDWIRE to SND_SOC_SDCA_CLASS
- select REGMAP_SOUNDWIRE_MBQ to SND_SOC_SDCA_CLASS_FUNCTION
This ensures the required regmap drivers are enabled when building SDCA support.
Configuration after fix:
CONFIG_SND_SOC_SDCA_CLASS=m
CONFIG_SND_SOC_SDCA_CLASS_FUNCTION=m
CONFIG_REGMAP_SOUNDWIRE=m
CONFIG_REGMAP_SOUNDWIRE_MBQ=m
Signed-off-by: Boris Faure <boris@fau.re>
Link: https://patch.msgid.link/20260129141419.13843-1-boris@fau.re
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/soc/sdca/Kconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/sdca/Kconfig b/sound/soc/sdca/Kconfig
index fabb69a3450d3..87ab2895096c1 100644
--- a/sound/soc/sdca/Kconfig
+++ b/sound/soc/sdca/Kconfig
@@ -46,12 +46,14 @@ config SND_SOC_SDCA_CLASS
select SND_SOC_SDCA_FDL
select SND_SOC_SDCA_HID
select SND_SOC_SDCA_IRQ
+ select REGMAP_SOUNDWIRE
help
This option enables support for the SDCA Class driver which should
support any class compliant SDCA part.
config SND_SOC_SDCA_CLASS_FUNCTION
tristate
+ select REGMAP_SOUNDWIRE_MBQ
help
This option enables support for the SDCA Class Function drivers,
these implement the individual functions of the SDCA Class driver.
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 170/311] Revert "netfilter: nft_set_rbtree: validate open interval overlap"
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (168 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 169/311] ASoC: sdca: Fix missing regmap dependencies in Kconfig Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 171/311] ARM: clean up the memset64() C wrapper Sasha Levin
` (154 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Greg Kroah-Hartman, Pablo Neira Ayuso, Florian Westphal
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This reverts commit 6db2be971e3d70c9e3f85d39eff7103c2ee2f579 which is
commit 648946966a08e4cb1a71619e3d1b12bd7642de7b upstream.
It is causing netfilter issues, so revert it for now.
Link: https://lore.kernel.org/r/aaeEd8UqYQ33Af7_@chamomile
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Florian Westphal <fw@strlen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/netfilter/nf_tables.h | 4 --
net/netfilter/nf_tables_api.c | 21 ++-------
net/netfilter/nft_set_rbtree.c | 71 +++++--------------------------
3 files changed, 14 insertions(+), 82 deletions(-)
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 05f57ba622447..f1b67b40dd4de 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -278,8 +278,6 @@ struct nft_userdata {
unsigned char data[];
};
-#define NFT_SET_ELEM_INTERNAL_LAST 0x1
-
/* placeholder structure for opaque set element backend representation. */
struct nft_elem_priv { };
@@ -289,7 +287,6 @@ struct nft_elem_priv { };
* @key: element key
* @key_end: closing element key
* @data: element data
- * @flags: flags
* @priv: element private data and extensions
*/
struct nft_set_elem {
@@ -305,7 +302,6 @@ struct nft_set_elem {
u32 buf[NFT_DATA_VALUE_MAXLEN / sizeof(u32)];
struct nft_data val;
} data;
- u32 flags;
struct nft_elem_priv *priv;
};
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 3b9c559ab1232..6d1b34a97ec7f 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -7153,8 +7153,7 @@ static u32 nft_set_maxsize(const struct nft_set *set)
}
static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
- const struct nlattr *attr, u32 nlmsg_flags,
- bool last)
+ const struct nlattr *attr, u32 nlmsg_flags)
{
struct nft_expr *expr_array[NFT_SET_EXPR_MAX] = {};
struct nlattr *nla[NFTA_SET_ELEM_MAX + 1];
@@ -7440,11 +7439,6 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
if (flags)
*nft_set_ext_flags(ext) = flags;
- if (last)
- elem.flags = NFT_SET_ELEM_INTERNAL_LAST;
- else
- elem.flags = 0;
-
if (obj)
*nft_set_ext_obj(ext) = obj;
@@ -7608,8 +7602,7 @@ static int nf_tables_newsetelem(struct sk_buff *skb,
nft_ctx_init(&ctx, net, skb, info->nlh, family, table, NULL, nla);
nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) {
- err = nft_add_set_elem(&ctx, set, attr, info->nlh->nlmsg_flags,
- nla_is_last(attr, rem));
+ err = nft_add_set_elem(&ctx, set, attr, info->nlh->nlmsg_flags);
if (err < 0) {
NL_SET_BAD_ATTR(extack, attr);
return err;
@@ -7733,7 +7726,7 @@ static void nft_trans_elems_destroy_abort(const struct nft_ctx *ctx,
}
static int nft_del_setelem(struct nft_ctx *ctx, struct nft_set *set,
- const struct nlattr *attr, bool last)
+ const struct nlattr *attr)
{
struct nlattr *nla[NFTA_SET_ELEM_MAX + 1];
struct nft_set_ext_tmpl tmpl;
@@ -7801,11 +7794,6 @@ static int nft_del_setelem(struct nft_ctx *ctx, struct nft_set *set,
if (flags)
*nft_set_ext_flags(ext) = flags;
- if (last)
- elem.flags = NFT_SET_ELEM_INTERNAL_LAST;
- else
- elem.flags = 0;
-
trans = nft_trans_elem_alloc(ctx, NFT_MSG_DELSETELEM, set);
if (trans == NULL)
goto fail_trans;
@@ -7953,8 +7941,7 @@ static int nf_tables_delsetelem(struct sk_buff *skb,
return nft_set_flush(&ctx, set, genmask);
nla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) {
- err = nft_del_setelem(&ctx, set, attr,
- nla_is_last(attr, rem));
+ err = nft_del_setelem(&ctx, set, attr);
if (err == -ENOENT &&
NFNL_MSG_TYPE(info->nlh->nlmsg_type) == NFT_MSG_DESTROYSETELEM)
continue;
diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
index 644d4b9167057..a4fb5b517d9de 100644
--- a/net/netfilter/nft_set_rbtree.c
+++ b/net/netfilter/nft_set_rbtree.c
@@ -304,19 +304,10 @@ static void nft_rbtree_set_start_cookie(struct nft_rbtree *priv,
priv->start_rbe_cookie = (unsigned long)rbe;
}
-static void nft_rbtree_set_start_cookie_open(struct nft_rbtree *priv,
- const struct nft_rbtree_elem *rbe,
- unsigned long open_interval)
-{
- priv->start_rbe_cookie = (unsigned long)rbe | open_interval;
-}
-
-#define NFT_RBTREE_OPEN_INTERVAL 1UL
-
static bool nft_rbtree_cmp_start_cookie(struct nft_rbtree *priv,
const struct nft_rbtree_elem *rbe)
{
- return (priv->start_rbe_cookie & ~NFT_RBTREE_OPEN_INTERVAL) == (unsigned long)rbe;
+ return priv->start_rbe_cookie == (unsigned long)rbe;
}
static bool nft_rbtree_insert_same_interval(const struct net *net,
@@ -346,14 +337,13 @@ static bool nft_rbtree_insert_same_interval(const struct net *net,
static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set,
struct nft_rbtree_elem *new,
- struct nft_elem_priv **elem_priv, u64 tstamp, bool last)
+ struct nft_elem_priv **elem_priv, u64 tstamp)
{
struct nft_rbtree_elem *rbe, *rbe_le = NULL, *rbe_ge = NULL, *rbe_prev;
struct rb_node *node, *next, *parent, **p, *first = NULL;
struct nft_rbtree *priv = nft_set_priv(set);
u8 cur_genmask = nft_genmask_cur(net);
u8 genmask = nft_genmask_next(net);
- unsigned long open_interval = 0;
int d;
/* Descend the tree to search for an existing element greater than the
@@ -459,18 +449,10 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set,
}
}
- if (nft_rbtree_interval_null(set, new)) {
+ if (nft_rbtree_interval_null(set, new))
+ priv->start_rbe_cookie = 0;
+ else if (nft_rbtree_interval_start(new) && priv->start_rbe_cookie)
priv->start_rbe_cookie = 0;
- } else if (nft_rbtree_interval_start(new) && priv->start_rbe_cookie) {
- if (nft_set_is_anonymous(set)) {
- priv->start_rbe_cookie = 0;
- } else if (priv->start_rbe_cookie & NFT_RBTREE_OPEN_INTERVAL) {
- /* Previous element is an open interval that partially
- * overlaps with an existing non-open interval.
- */
- return -ENOTEMPTY;
- }
- }
/* - new start element matching existing start element: full overlap
* reported as -EEXIST, cleared by caller if NLM_F_EXCL is not given.
@@ -478,27 +460,7 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set,
if (rbe_ge && !nft_rbtree_cmp(set, new, rbe_ge) &&
nft_rbtree_interval_start(rbe_ge) == nft_rbtree_interval_start(new)) {
*elem_priv = &rbe_ge->priv;
-
- /* - Corner case: new start element of open interval (which
- * comes as last element in the batch) overlaps the start of
- * an existing interval with an end element: partial overlap.
- */
- node = rb_first(&priv->root);
- rbe = __nft_rbtree_next_active(node, genmask);
- if (rbe && nft_rbtree_interval_end(rbe)) {
- rbe = nft_rbtree_next_active(rbe, genmask);
- if (rbe &&
- nft_rbtree_interval_start(rbe) &&
- !nft_rbtree_cmp(set, new, rbe)) {
- if (last)
- return -ENOTEMPTY;
-
- /* Maybe open interval? */
- open_interval = NFT_RBTREE_OPEN_INTERVAL;
- }
- }
- nft_rbtree_set_start_cookie_open(priv, rbe_ge, open_interval);
-
+ nft_rbtree_set_start_cookie(priv, rbe_ge);
return -EEXIST;
}
@@ -553,12 +515,6 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set,
nft_rbtree_interval_end(rbe_ge) && nft_rbtree_interval_end(new))
return -ENOTEMPTY;
- /* - start element overlaps an open interval but end element is new:
- * partial overlap, reported as -ENOEMPTY.
- */
- if (!rbe_ge && priv->start_rbe_cookie && nft_rbtree_interval_end(new))
- return -ENOTEMPTY;
-
/* Accepted element: pick insertion point depending on key value */
parent = NULL;
p = &priv->root.rb_node;
@@ -668,7 +624,6 @@ static int nft_rbtree_insert(const struct net *net, const struct nft_set *set,
struct nft_elem_priv **elem_priv)
{
struct nft_rbtree_elem *rbe = nft_elem_priv_cast(elem->priv);
- bool last = !!(elem->flags & NFT_SET_ELEM_INTERNAL_LAST);
struct nft_rbtree *priv = nft_set_priv(set);
u64 tstamp = nft_net_tstamp(net);
int err;
@@ -685,12 +640,8 @@ static int nft_rbtree_insert(const struct net *net, const struct nft_set *set,
cond_resched();
write_lock_bh(&priv->lock);
- err = __nft_rbtree_insert(net, set, rbe, elem_priv, tstamp, last);
+ err = __nft_rbtree_insert(net, set, rbe, elem_priv, tstamp);
write_unlock_bh(&priv->lock);
-
- if (nft_rbtree_interval_end(rbe))
- priv->start_rbe_cookie = 0;
-
} while (err == -EAGAIN);
return err;
@@ -778,7 +729,6 @@ nft_rbtree_deactivate(const struct net *net, const struct nft_set *set,
const struct nft_set_elem *elem)
{
struct nft_rbtree_elem *rbe, *this = nft_elem_priv_cast(elem->priv);
- bool last = !!(elem->flags & NFT_SET_ELEM_INTERNAL_LAST);
struct nft_rbtree *priv = nft_set_priv(set);
const struct rb_node *parent = priv->root.rb_node;
u8 genmask = nft_genmask_next(net);
@@ -819,10 +769,9 @@ nft_rbtree_deactivate(const struct net *net, const struct nft_set *set,
continue;
}
- if (nft_rbtree_interval_start(rbe)) {
- if (!last)
- nft_rbtree_set_start_cookie(priv, rbe);
- } else if (!nft_rbtree_deactivate_same_interval(net, priv, rbe))
+ if (nft_rbtree_interval_start(rbe))
+ nft_rbtree_set_start_cookie(priv, rbe);
+ else if (!nft_rbtree_deactivate_same_interval(net, priv, rbe))
return NULL;
nft_rbtree_flush(net, set, &rbe->priv);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 171/311] ARM: clean up the memset64() C wrapper
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (169 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 170/311] Revert "netfilter: nft_set_rbtree: validate open interval overlap" Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 172/311] platform/x86: hp-bioscfg: Support allocations of larger data Sasha Levin
` (153 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Thomas Weißschuh, Linus Torvalds, Ben Hutchings,
Greg Kroah-Hartman
From: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
commit b52343d1cb47bb27ca32a3f4952cc2fd3cd165bf upstream.
The current logic to split the 64-bit argument into its 32-bit halves is
byte-order specific and a bit clunky. Use a union instead which is
easier to read and works in all cases.
GCC still generates the same machine code.
While at it, rename the arguments of the __memset64() prototype to
actually reflect their semantics.
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: Ben Hutchings <ben@decadent.org.uk> # for -stable
Link: https://lore.kernel.org/all/1a11526ae3d8664f705b541b8d6ea57b847b49a8.camel@decadent.org.uk/
Suggested-by: https://lore.kernel.org/all/aZonkWMwpbFhzDJq@casper.infradead.org/ # for -stable
Link: https://lore.kernel.org/all/aZonkWMwpbFhzDJq@casper.infradead.org/
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm/include/asm/string.h | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch/arm/include/asm/string.h b/arch/arm/include/asm/string.h
index c35250c4991bc..96fc6cf460ecb 100644
--- a/arch/arm/include/asm/string.h
+++ b/arch/arm/include/asm/string.h
@@ -39,13 +39,17 @@ static inline void *memset32(uint32_t *p, uint32_t v, __kernel_size_t n)
}
#define __HAVE_ARCH_MEMSET64
-extern void *__memset64(uint64_t *, uint32_t low, __kernel_size_t, uint32_t hi);
+extern void *__memset64(uint64_t *, uint32_t first, __kernel_size_t, uint32_t second);
static inline void *memset64(uint64_t *p, uint64_t v, __kernel_size_t n)
{
- if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
- return __memset64(p, v, n * 8, v >> 32);
- else
- return __memset64(p, v >> 32, n * 8, v);
+ union {
+ uint64_t val;
+ struct {
+ uint32_t first, second;
+ };
+ } word = { .val = v };
+
+ return __memset64(p, word.first, n * 8, word.second);
}
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 172/311] platform/x86: hp-bioscfg: Support allocations of larger data
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (170 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 171/311] ARM: clean up the memset64() C wrapper Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 173/311] Bluetooth: Fix CIS host feature condition Sasha Levin
` (152 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Mario Limonciello, Paul Kerry, Ilpo Järvinen, Sasha Levin,
Greg Kroah-Hartman
From: Mario Limonciello <mario.limonciello@amd.com>
commit 916727cfdb72cd01fef3fa6746e648f8cb70e713 upstream.
Some systems have much larger amounts of enumeration attributes
than have been previously encountered. This can lead to page allocation
failures when using kcalloc(). Switch over to using kvcalloc() to
allow larger allocations.
Fixes: 6b2770bfd6f92 ("platform/x86: hp-bioscfg: enum-attributes")
Cc: stable@vger.kernel.org
Reported-by: Paul Kerry <p.kerry@sheffield.ac.uk>
Tested-by: Paul Kerry <p.kerry@sheffield.ac.uk>
Closes: https://bugs.debian.org/1127612
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patch.msgid.link/20260225210646.59381-1-mario.limonciello@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ kcalloc() => kvcalloc() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
index f346aad8e9d89..af4d1920d4880 100644
--- a/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
+++ b/drivers/platform/x86/hp/hp-bioscfg/enum-attributes.c
@@ -94,8 +94,11 @@ int hp_alloc_enumeration_data(void)
bioscfg_drv.enumeration_instances_count =
hp_get_instance_count(HP_WMI_BIOS_ENUMERATION_GUID);
- bioscfg_drv.enumeration_data = kcalloc(bioscfg_drv.enumeration_instances_count,
- sizeof(*bioscfg_drv.enumeration_data), GFP_KERNEL);
+ if (!bioscfg_drv.enumeration_instances_count)
+ return -EINVAL;
+ bioscfg_drv.enumeration_data = kvcalloc(bioscfg_drv.enumeration_instances_count,
+ sizeof(*bioscfg_drv.enumeration_data), GFP_KERNEL);
+
if (!bioscfg_drv.enumeration_data) {
bioscfg_drv.enumeration_instances_count = 0;
return -ENOMEM;
@@ -444,6 +447,6 @@ void hp_exit_enumeration_attributes(void)
}
bioscfg_drv.enumeration_instances_count = 0;
- kfree(bioscfg_drv.enumeration_data);
+ kvfree(bioscfg_drv.enumeration_data);
bioscfg_drv.enumeration_data = NULL;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 173/311] Bluetooth: Fix CIS host feature condition
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (171 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 172/311] platform/x86: hp-bioscfg: Support allocations of larger data Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 174/311] ipmi: Fix use-after-free and list corruption on sender error Sasha Levin
` (151 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Mariusz Skamra, Paul Menzel, Luiz Augusto von Dentz, Sasha Levin,
Greg Kroah-Hartman
From: Mariusz Skamra <mariusz.skamra@codecoup.pl>
commit 7cff9a40c6b0f72ccefdaf0ffe03cfac30348f51 upstream.
This fixes the condition for sending the LE Set Host Feature command.
The command is sent to indicate host support for Connected Isochronous
Streams in this case. It has been observed that the system could not
initialize BIS-only capable controllers because the controllers do not
support the command.
As per Core v6.2 | Vol 4, Part E, Table 3.1 the command shall be
supported if CIS Central or CIS Peripheral is supported; otherwise,
the command is optional.
Fixes: 709788b154ca ("Bluetooth: hci_core: Fix using {cis,bis}_capable for current settings")
Cc: stable@vger.kernel.org
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
[ iso_capable() => cis_capable() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bluetooth/hci_sync.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 334eb4376a266..80b601e344ae3 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4564,7 +4564,7 @@ static int hci_le_set_host_feature_sync(struct hci_dev *hdev)
{
struct hci_cp_le_set_host_feature cp;
- if (!iso_capable(hdev))
+ if (!cis_capable(hdev))
return 0;
memset(&cp, 0, sizeof(cp));
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 174/311] ipmi: Fix use-after-free and list corruption on sender error
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (172 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 173/311] Bluetooth: Fix CIS host feature condition Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 175/311] net: stmmac: remove support for lpi_intr_o Sasha Levin
` (150 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Corey Minyard, Breno Leitao, Greg Kroah-Hartman
From: Corey Minyard <corey@minyard.net>
commit 594c11d0e1d445f580898a2b8c850f2e3f099368 upstream.
The analysis from Breno:
When the SMI sender returns an error, smi_work() delivers an error
response but then jumps back to restart without cleaning up properly:
1. intf->curr_msg is not cleared, so no new message is pulled
2. newmsg still points to the message, causing sender() to be called
again with the same message
3. If sender() fails again, deliver_err_response() is called with
the same recv_msg that was already queued for delivery
This causes list_add corruption ("list_add double add") because the
recv_msg is added to the user_msgs list twice. Subsequently, the
corrupted list leads to use-after-free when the memory is freed and
reused, and eventually a NULL pointer dereference when accessing
recv_msg->done.
The buggy sequence:
sender() fails
-> deliver_err_response(recv_msg) // recv_msg queued for delivery
-> goto restart // curr_msg not cleared!
sender() fails again (same message!)
-> deliver_err_response(recv_msg) // tries to queue same recv_msg
-> LIST CORRUPTION
Fix this by freeing the message and setting it to NULL on a send error.
Also, always free the newmsg on a send error, otherwise it will leak.
Reported-by: Breno Leitao <leitao@debian.org>
Closes: https://lore.kernel.org/lkml/20260127-ipmi-v1-0-ba5cc90f516f@debian.org/
Fixes: 9cf93a8fa9513 ("ipmi: Allow an SMI sender to return an error")
Cc: stable@vger.kernel.org # 4.18
Reviewed-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Corey Minyard <corey@minyard.net>
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/char/ipmi/ipmi_msghandler.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c
index 3f48fc6ab596d..a590a67294e24 100644
--- a/drivers/char/ipmi/ipmi_msghandler.c
+++ b/drivers/char/ipmi/ipmi_msghandler.c
@@ -4852,8 +4852,15 @@ static void smi_work(struct work_struct *t)
if (newmsg->recv_msg)
deliver_err_response(intf,
newmsg->recv_msg, cc);
- else
- ipmi_free_smi_msg(newmsg);
+ if (!run_to_completion)
+ spin_lock_irqsave(&intf->xmit_msgs_lock,
+ flags);
+ intf->curr_msg = NULL;
+ if (!run_to_completion)
+ spin_unlock_irqrestore(&intf->xmit_msgs_lock,
+ flags);
+ ipmi_free_smi_msg(newmsg);
+ newmsg = NULL;
goto restart;
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 175/311] net: stmmac: remove support for lpi_intr_o
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (173 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 174/311] ipmi: Fix use-after-free and list corruption on sender error Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 176/311] drm/amd/display: Use GFP_ATOMIC in dc_create_stream_for_sink Sasha Levin
` (149 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Russell King (Oracle), Ovidiu Panait, Jakub Kicinski,
Greg Kroah-Hartman
From: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
commit 14eb64db8ff07b58a35b98375f446d9e20765674 upstream.
The dwmac databook for v3.74a states that lpi_intr_o is a sideband
signal which should be used to ungate the application clock, and this
signal is synchronous to the receive clock. The receive clock can run
at 2.5, 25 or 125MHz depending on the media speed, and can stop under
the control of the link partner. This means that the time it takes to
clear is dependent on the negotiated media speed, and thus can be 8,
40, or 400ns after reading the LPI control and status register.
It has been observed with some aggressive link partners, this clock
can stop while lpi_intr_o is still asserted, meaning that the signal
remains asserted for an indefinite period that the local system has
no direct control over.
The LPI interrupts will still be signalled through the main interrupt
path in any case, and this path is not dependent on the receive clock.
This, since we do not gate the application clock, and the chances of
adding clock gating in the future are slim due to the clocks being
ill-defined, lpi_intr_o serves no useful purpose. Remove the code which
requests the interrupt, and all associated code.
Reported-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Tested-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com> # Renesas RZ/V2H board
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vnJbt-00000007YYN-28nm@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/ethernet/stmicro/stmmac/common.h | 1 -
.../net/ethernet/stmicro/stmmac/dwmac-intel.c | 4 ---
.../ethernet/stmicro/stmmac/dwmac-loongson.c | 7 ----
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 --
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 36 -------------------
.../ethernet/stmicro/stmmac/stmmac_platform.c | 8 -----
include/linux/stmmac.h | 1 -
7 files changed, 59 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
index 49df46be36699..9ebaddffa5b25 100644
--- a/drivers/net/ethernet/stmicro/stmmac/common.h
+++ b/drivers/net/ethernet/stmicro/stmmac/common.h
@@ -390,7 +390,6 @@ enum request_irq_err {
REQ_IRQ_ERR_SFTY,
REQ_IRQ_ERR_SFTY_UE,
REQ_IRQ_ERR_SFTY_CE,
- REQ_IRQ_ERR_LPI,
REQ_IRQ_ERR_WOL,
REQ_IRQ_ERR_MAC,
REQ_IRQ_ERR_NO,
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
index aad1be1ec4c11..92d77b0c2f54b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
@@ -719,7 +719,6 @@ static int intel_mgbe_common_data(struct pci_dev *pdev,
/* Setup MSI vector offset specific to Intel mGbE controller */
plat->msi_mac_vec = 29;
- plat->msi_lpi_vec = 28;
plat->msi_sfty_ce_vec = 27;
plat->msi_sfty_ue_vec = 26;
plat->msi_rx_base_vec = 0;
@@ -1177,8 +1176,6 @@ static int stmmac_config_multi_msi(struct pci_dev *pdev,
res->irq = pci_irq_vector(pdev, plat->msi_mac_vec);
if (plat->msi_wol_vec < STMMAC_MSI_VEC_MAX)
res->wol_irq = pci_irq_vector(pdev, plat->msi_wol_vec);
- if (plat->msi_lpi_vec < STMMAC_MSI_VEC_MAX)
- res->lpi_irq = pci_irq_vector(pdev, plat->msi_lpi_vec);
if (plat->msi_sfty_ce_vec < STMMAC_MSI_VEC_MAX)
res->sfty_ce_irq = pci_irq_vector(pdev, plat->msi_sfty_ce_vec);
if (plat->msi_sfty_ue_vec < STMMAC_MSI_VEC_MAX)
@@ -1294,7 +1291,6 @@ static int intel_eth_pci_probe(struct pci_dev *pdev,
*/
plat->msi_mac_vec = STMMAC_MSI_VEC_MAX;
plat->msi_wol_vec = STMMAC_MSI_VEC_MAX;
- plat->msi_lpi_vec = STMMAC_MSI_VEC_MAX;
plat->msi_sfty_ce_vec = STMMAC_MSI_VEC_MAX;
plat->msi_sfty_ue_vec = STMMAC_MSI_VEC_MAX;
plat->msi_rx_base_vec = STMMAC_MSI_VEC_MAX;
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
index c05e3e7a539cf..a5203101268ba 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
@@ -443,13 +443,6 @@ static int loongson_dwmac_dt_config(struct pci_dev *pdev,
res->wol_irq = res->irq;
}
- res->lpi_irq = of_irq_get_byname(np, "eth_lpi");
- if (res->lpi_irq < 0) {
- dev_err(&pdev->dev, "IRQ eth_lpi not found\n");
- ret = -ENODEV;
- goto err_put_node;
- }
-
ret = device_get_phy_mode(&pdev->dev);
if (ret < 0) {
dev_err(&pdev->dev, "phy_mode not found\n");
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 012b0a477255d..aafd8c39be63c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -31,7 +31,6 @@ struct stmmac_resources {
void __iomem *addr;
u8 mac[ETH_ALEN];
int wol_irq;
- int lpi_irq;
int irq;
int sfty_irq;
int sfty_ce_irq;
@@ -297,7 +296,6 @@ struct stmmac_priv {
int wol_irq;
u32 gmii_address_bus_config;
struct timer_list eee_ctrl_timer;
- int lpi_irq;
u32 tx_lpi_timer;
bool tx_lpi_clk_stop;
bool eee_enabled;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f98fd254315f6..e9493c0c27b87 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -3712,10 +3712,6 @@ static void stmmac_free_irq(struct net_device *dev,
free_irq(priv->sfty_ce_irq, dev);
fallthrough;
case REQ_IRQ_ERR_SFTY_CE:
- if (priv->lpi_irq > 0 && priv->lpi_irq != dev->irq)
- free_irq(priv->lpi_irq, dev);
- fallthrough;
- case REQ_IRQ_ERR_LPI:
if (priv->wol_irq > 0 && priv->wol_irq != dev->irq)
free_irq(priv->wol_irq, dev);
fallthrough;
@@ -3773,24 +3769,6 @@ static int stmmac_request_irq_multi_msi(struct net_device *dev)
}
}
- /* Request the LPI IRQ in case of another line
- * is used for LPI
- */
- if (priv->lpi_irq > 0 && priv->lpi_irq != dev->irq) {
- int_name = priv->int_name_lpi;
- sprintf(int_name, "%s:%s", dev->name, "lpi");
- ret = request_irq(priv->lpi_irq,
- stmmac_mac_interrupt,
- 0, int_name, dev);
- if (unlikely(ret < 0)) {
- netdev_err(priv->dev,
- "%s: alloc lpi MSI %d (error: %d)\n",
- __func__, priv->lpi_irq, ret);
- irq_err = REQ_IRQ_ERR_LPI;
- goto irq_error;
- }
- }
-
/* Request the common Safety Feature Correctible/Uncorrectible
* Error line in case of another line is used
*/
@@ -3930,19 +3908,6 @@ static int stmmac_request_irq_single(struct net_device *dev)
}
}
- /* Request the IRQ lines */
- if (priv->lpi_irq > 0 && priv->lpi_irq != dev->irq) {
- ret = request_irq(priv->lpi_irq, stmmac_interrupt,
- IRQF_SHARED, dev->name, dev);
- if (unlikely(ret < 0)) {
- netdev_err(priv->dev,
- "%s: ERROR: allocating the LPI IRQ %d (%d)\n",
- __func__, priv->lpi_irq, ret);
- irq_err = REQ_IRQ_ERR_LPI;
- goto irq_error;
- }
- }
-
/* Request the common Safety Feature Correctible/Uncorrectible
* Error line in case of another line is used
*/
@@ -7709,7 +7674,6 @@ static int __stmmac_dvr_probe(struct device *device,
priv->dev->irq = res->irq;
priv->wol_irq = res->wol_irq;
- priv->lpi_irq = res->lpi_irq;
priv->sfty_irq = res->sfty_irq;
priv->sfty_ce_irq = res->sfty_ce_irq;
priv->sfty_ue_irq = res->sfty_ue_irq;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 8979a50b55070..5c9fd91a1db9d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -725,14 +725,6 @@ int stmmac_get_platform_resources(struct platform_device *pdev,
stmmac_res->wol_irq = stmmac_res->irq;
}
- stmmac_res->lpi_irq =
- platform_get_irq_byname_optional(pdev, "eth_lpi");
- if (stmmac_res->lpi_irq < 0) {
- if (stmmac_res->lpi_irq == -EPROBE_DEFER)
- return -EPROBE_DEFER;
- dev_info(&pdev->dev, "IRQ eth_lpi not found\n");
- }
-
stmmac_res->sfty_irq =
platform_get_irq_byname_optional(pdev, "sfty");
if (stmmac_res->sfty_irq < 0) {
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index f1054b9c2d8ac..0c26ccfeeb8d8 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -299,7 +299,6 @@ struct plat_stmmacenet_data {
int int_snapshot_num;
int msi_mac_vec;
int msi_wol_vec;
- int msi_lpi_vec;
int msi_sfty_ce_vec;
int msi_sfty_ue_vec;
int msi_rx_base_vec;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 176/311] drm/amd/display: Use GFP_ATOMIC in dc_create_stream_for_sink
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (174 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 175/311] net: stmmac: remove support for lpi_intr_o Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 177/311] nvme: fix admin queue leak on controller reset Sasha Levin
` (148 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Natalie Vock, Alex Deucher, Sasha Levin, Greg Kroah-Hartman
From: Natalie Vock <natalie.vock@gmx.de>
commit 28dfe4317541e57fe52f9a290394cd29c348228b upstream.
This can be called while preemption is disabled, for example by
dcn32_internal_validate_bw which is called with the FPU active.
Fixes "BUG: scheduling while atomic" messages I encounter on my Navi31
machine.
Signed-off-by: Natalie Vock <natalie.vock@gmx.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b42dae2ebc5c84a68de63ec4ffdfec49362d53f1)
Cc: stable@vger.kernel.org
[ Context ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 129cd5f849837..da44c1f01bef1 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -169,7 +169,7 @@ struct dc_stream_state *dc_create_stream_for_sink(
if (sink == NULL)
return NULL;
- stream = kzalloc(sizeof(struct dc_stream_state), GFP_KERNEL);
+ stream = kzalloc(sizeof(struct dc_stream_state), GFP_ATOMIC);
if (stream == NULL)
goto alloc_fail;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 177/311] nvme: fix admin queue leak on controller reset
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (175 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 176/311] drm/amd/display: Use GFP_ATOMIC in dc_create_stream_for_sink Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 178/311] hwmon: (macsmc) Fix regressions in Apple Silicon SMC hwmon driver Sasha Levin
` (147 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Ming Lei, Keith Busch, Yi Zhang, Sasha Levin
From: Ming Lei <ming.lei@redhat.com>
[ Upstream commit b84bb7bd913d8ca2f976ee6faf4a174f91c02b8d ]
When nvme_alloc_admin_tag_set() is called during a controller reset,
a previous admin queue may still exist. Release it properly before
allocating a new one to avoid orphaning the old queue.
This fixes a regression introduced by commit 03b3bcd319b3 ("nvme: fix
admin request_queue lifetime").
Cc: Keith Busch <kbusch@kernel.org>
Fixes: 03b3bcd319b3 ("nvme: fix admin request_queue lifetime").
Reported-and-tested-by: Yi Zhang <yi.zhang@redhat.com>
Closes: https://lore.kernel.org/linux-block/CAHj4cs9wv3SdPo+N01Fw2SHBYDs9tj2M_e1-GdQOkRy=DsBB1w@mail.gmail.com/
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/core.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 7bf228df6001f..3fdcd73b95468 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -4864,6 +4864,13 @@ int nvme_alloc_admin_tag_set(struct nvme_ctrl *ctrl, struct blk_mq_tag_set *set,
if (ret)
return ret;
+ /*
+ * If a previous admin queue exists (e.g., from before a reset),
+ * put it now before allocating a new one to avoid orphaning it.
+ */
+ if (ctrl->admin_q)
+ blk_put_queue(ctrl->admin_q);
+
ctrl->admin_q = blk_mq_alloc_queue(set, &lim, NULL);
if (IS_ERR(ctrl->admin_q)) {
ret = PTR_ERR(ctrl->admin_q);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 178/311] hwmon: (macsmc) Fix regressions in Apple Silicon SMC hwmon driver
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (176 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 177/311] nvme: fix admin queue leak on controller reset Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 179/311] hwmon: (macsmc) Fix overflows, underflows, and sign extension Sasha Levin
` (146 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Guenter Roeck, Nathan Chancellor, James Calligeros, Neal Gompa,
Janne Grunau, Sasha Levin
From: Guenter Roeck <linux@roeck-us.net>
[ Upstream commit 5dd69b864911ae3847365e8bafe7854e79fbeecb ]
The recently added macsmc-hwmon driver contained several critical
bugs in its sensor population logic and float conversion routines.
Specifically:
- The voltage sensor population loop used the wrong prefix ("volt-"
instead of "voltage-") and incorrectly assigned sensors to the
temperature sensor array (hwmon->temp.sensors) instead of the
voltage sensor array (hwmon->volt.sensors). This would lead to
out-of-bounds memory access or data corruption when both temperature
and voltage sensors were present.
- The float conversion in macsmc_hwmon_write_f32() had flawed exponent
logic for values >= 2^24 and lacked masking for the mantissa, which
could lead to incorrect values being written to the SMC.
Fix these issues to ensure correct sensor registration and reliable
manual fan control.
Confirm that the reported overflow in FIELD_PREP is fixed by declaring
macsmc_hwmon_write_f32() as __always_inline for a compile test.
Fixes: 785205fd8139 ("hwmon: Add Apple Silicon SMC hwmon driver")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Closes: https://lore.kernel.org/linux-hwmon/20260119195817.GA1035354@ax162/
Cc: James Calligeros <jcalligeros99@gmail.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Neal Gompa <neal@gompa.dev>
Cc: Janne Grunau <j@jannau.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build only
Link: https://lore.kernel.org/r/20260129175112.3751907-2-linux@roeck-us.net
Reviewed-by: James Calligeros <jcalligeros99@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/macsmc-hwmon.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/hwmon/macsmc-hwmon.c b/drivers/hwmon/macsmc-hwmon.c
index 1c0bbec7e8ebc..40d25c81b4435 100644
--- a/drivers/hwmon/macsmc-hwmon.c
+++ b/drivers/hwmon/macsmc-hwmon.c
@@ -228,25 +228,22 @@ static int macsmc_hwmon_write_f32(struct apple_smc *smc, smc_key key, int value)
{
u64 val;
u32 fval = 0;
- int exp = 0, neg;
+ int exp, neg;
+ neg = value < 0;
val = abs(value);
- neg = val != value;
if (val) {
- int msb = __fls(val) - exp;
-
- if (msb > 23) {
- val >>= msb - FLT_MANT_BIAS;
- exp -= msb - FLT_MANT_BIAS;
- } else if (msb < 23) {
- val <<= FLT_MANT_BIAS - msb;
- exp += msb;
- }
+ exp = __fls(val);
+
+ if (exp > 23)
+ val >>= exp - 23;
+ else
+ val <<= 23 - exp;
fval = FIELD_PREP(FLT_SIGN_MASK, neg) |
FIELD_PREP(FLT_EXP_MASK, exp + FLT_EXP_BIAS) |
- FIELD_PREP(FLT_MANT_MASK, val);
+ FIELD_PREP(FLT_MANT_MASK, val & FLT_MANT_MASK);
}
return apple_smc_write_u32(smc, key, fval);
@@ -663,8 +660,8 @@ static int macsmc_hwmon_populate_sensors(struct macsmc_hwmon *hwmon,
if (!hwmon->volt.sensors)
return -ENOMEM;
- for_each_child_of_node_with_prefix(hwmon_node, key_node, "volt-") {
- sensor = &hwmon->temp.sensors[hwmon->temp.count];
+ for_each_child_of_node_with_prefix(hwmon_node, key_node, "voltage-") {
+ sensor = &hwmon->volt.sensors[hwmon->volt.count];
if (!macsmc_hwmon_create_sensor(hwmon->dev, hwmon->smc, key_node, sensor)) {
sensor->attrs = HWMON_I_INPUT;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 179/311] hwmon: (macsmc) Fix overflows, underflows, and sign extension
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (177 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 178/311] hwmon: (macsmc) Fix regressions in Apple Silicon SMC hwmon driver Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 180/311] hwmon: (aht10) Fix initialization commands for AHT20 Sasha Levin
` (145 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Guenter Roeck, James Calligeros, Nathan Chancellor, Neal Gompa,
Janne Grunau, Sasha Levin
From: Guenter Roeck <linux@roeck-us.net>
[ Upstream commit 579b86f3c26fee97996e68c1cbfb7461711f3de3 ]
The macsmc-hwmon driver experienced several issues related to value
scaling and type conversion:
1. macsmc_hwmon_read_f32_scaled() clipped values to INT_MAX/INT_MIN.
On 64-bit systems, hwmon supports long values, so clipping to
32-bit range was premature and caused loss of range for high-power
sensors. Changed it to use long and clip to LONG_MAX/LONG_MIN.
2. The overflow check in macsmc_hwmon_read_f32_scaled() used 1UL,
which is 32-bit on some platforms. Switched to 1ULL.
3. macsmc_hwmon_read_key() used a u32 temporary variable for f32
values. When assigned to a 64-bit long, negative values were
zero-extended instead of sign-extended, resulting in large
positive numbers.
4. macsmc_hwmon_read_ioft_scaled() used mult_frac() which could
overflow during intermediate multiplication. Switched to
mul_u64_u32_div() to handle the 64-bit multiplication safely.
5. ioft values (unsigned 48.16) could overflow long when scaled
by 1,000,000. Added explicit clipping to LONG_MAX in the caller.
6. macsmc_hwmon_write_f32() truncated its long argument to int,
potentially causing issues for large values.
Fix these issues by using appropriate types and helper functions.
Fixes: 785205fd8139 ("hwmon: Add Apple Silicon SMC hwmon driver")
Cc: James Calligeros <jcalligeros99@gmail.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Neal Gompa <neal@gompa.dev>
Cc: Janne Grunau <j@jannau.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20260129175112.3751907-3-linux@roeck-us.net
Reviewed-by: James Calligeros <jcalligeros99@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/macsmc-hwmon.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/drivers/hwmon/macsmc-hwmon.c b/drivers/hwmon/macsmc-hwmon.c
index 40d25c81b4435..1500ec2cc9f83 100644
--- a/drivers/hwmon/macsmc-hwmon.c
+++ b/drivers/hwmon/macsmc-hwmon.c
@@ -22,6 +22,7 @@
#include <linux/bitfield.h>
#include <linux/hwmon.h>
+#include <linux/math64.h>
#include <linux/mfd/macsmc.h>
#include <linux/module.h>
#include <linux/of.h>
@@ -130,7 +131,7 @@ static int macsmc_hwmon_read_ioft_scaled(struct apple_smc *smc, smc_key key,
if (ret < 0)
return ret;
- *p = mult_frac(val, scale, 65536);
+ *p = mul_u64_u32_div(val, scale, 65536);
return 0;
}
@@ -140,7 +141,7 @@ static int macsmc_hwmon_read_ioft_scaled(struct apple_smc *smc, smc_key key,
* them.
*/
static int macsmc_hwmon_read_f32_scaled(struct apple_smc *smc, smc_key key,
- int *p, int scale)
+ long *p, int scale)
{
u32 fval;
u64 val;
@@ -162,21 +163,21 @@ static int macsmc_hwmon_read_f32_scaled(struct apple_smc *smc, smc_key key,
val = 0;
else if (exp < 0)
val >>= -exp;
- else if (exp != 0 && (val & ~((1UL << (64 - exp)) - 1))) /* overflow */
+ else if (exp != 0 && (val & ~((1ULL << (64 - exp)) - 1))) /* overflow */
val = U64_MAX;
else
val <<= exp;
if (fval & FLT_SIGN_MASK) {
- if (val > (-(s64)INT_MIN))
- *p = INT_MIN;
+ if (val > (u64)LONG_MAX + 1)
+ *p = LONG_MIN;
else
- *p = -val;
+ *p = -(long)val;
} else {
- if (val > INT_MAX)
- *p = INT_MAX;
+ if (val > (u64)LONG_MAX)
+ *p = LONG_MAX;
else
- *p = val;
+ *p = (long)val;
}
return 0;
@@ -195,7 +196,7 @@ static int macsmc_hwmon_read_key(struct apple_smc *smc,
switch (sensor->info.type_code) {
/* 32-bit IEEE 754 float */
case __SMC_KEY('f', 'l', 't', ' '): {
- u32 flt_ = 0;
+ long flt_ = 0;
ret = macsmc_hwmon_read_f32_scaled(smc, sensor->macsmc_key,
&flt_, scale);
@@ -214,7 +215,10 @@ static int macsmc_hwmon_read_key(struct apple_smc *smc,
if (ret)
return ret;
- *val = (long)ioft;
+ if (ioft > LONG_MAX)
+ *val = LONG_MAX;
+ else
+ *val = (long)ioft;
break;
}
default:
@@ -224,7 +228,7 @@ static int macsmc_hwmon_read_key(struct apple_smc *smc,
return 0;
}
-static int macsmc_hwmon_write_f32(struct apple_smc *smc, smc_key key, int value)
+static int macsmc_hwmon_write_f32(struct apple_smc *smc, smc_key key, long value)
{
u64 val;
u32 fval = 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 180/311] hwmon: (aht10) Fix initialization commands for AHT20
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (178 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 179/311] hwmon: (macsmc) Fix overflows, underflows, and sign extension Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 181/311] pinctrl: equilibrium: rename irq_chip function callbacks Sasha Levin
` (144 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Hao Yu, Guenter Roeck, Sasha Levin
From: Hao Yu <haoyufine@gmail.com>
[ Upstream commit b7497b5a99f54ab8dcda5b14a308385b2fb03d8d ]
According to the AHT20 datasheet (updated to V1.0 after the 2023.09
version), the initialization command for AHT20 is 0b10111110 (0xBE).
The previous sequence (0xE1) used in earlier versions is no longer
compatible with newer AHT20 sensors. Update the initialization
command to ensure the sensor is properly initialized.
While at it, use binary notation for DHT20_CMD_INIT to match the notation
used in the datasheet.
Fixes: d2abcb5cc885 ("hwmon: (aht10) Add support for compatible aht20")
Signed-off-by: Hao Yu <haoyufine@gmail.com>
Link: https://lore.kernel.org/r/20260222170332.1616-3-haoyufine@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/aht10.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/aht10.c b/drivers/hwmon/aht10.c
index 007befdba9776..4ce019d2cc80e 100644
--- a/drivers/hwmon/aht10.c
+++ b/drivers/hwmon/aht10.c
@@ -37,7 +37,9 @@
#define AHT10_CMD_MEAS 0b10101100
#define AHT10_CMD_RST 0b10111010
-#define DHT20_CMD_INIT 0x71
+#define AHT20_CMD_INIT 0b10111110
+
+#define DHT20_CMD_INIT 0b01110001
/*
* Flags in the answer byte/command
@@ -341,7 +343,7 @@ static int aht10_probe(struct i2c_client *client)
data->meas_size = AHT20_MEAS_SIZE;
data->crc8 = true;
crc8_populate_msb(crc8_table, AHT20_CRC8_POLY);
- data->init_cmd = AHT10_CMD_INIT;
+ data->init_cmd = AHT20_CMD_INIT;
break;
case dht20:
data->meas_size = AHT20_MEAS_SIZE;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 181/311] pinctrl: equilibrium: rename irq_chip function callbacks
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (179 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 180/311] hwmon: (aht10) Fix initialization commands for AHT20 Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 182/311] pinctrl: equilibrium: fix warning trace on load Sasha Levin
` (143 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Florian Eckert, Linus Walleij, Sasha Levin
From: Florian Eckert <fe@dev.tdt.de>
[ Upstream commit 1f96b84835eafb3e6f366dc3a66c0e69504cec9d ]
Renaming of the irq_chip callback functions to improve clarity.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Stable-dep-of: 3e00b1b332e5 ("pinctrl: equilibrium: fix warning trace on load")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/pinctrl-equilibrium.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-equilibrium.c b/drivers/pinctrl/pinctrl-equilibrium.c
index 48b55c5bf8d4f..49c8232b525a9 100644
--- a/drivers/pinctrl/pinctrl-equilibrium.c
+++ b/drivers/pinctrl/pinctrl-equilibrium.c
@@ -23,7 +23,7 @@
#define PIN_NAME_LEN 10
#define PAD_REG_OFF 0x100
-static void eqbr_gpio_disable_irq(struct irq_data *d)
+static void eqbr_irq_mask(struct irq_data *d)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct eqbr_gpio_ctrl *gctrl = gpiochip_get_data(gc);
@@ -36,7 +36,7 @@ static void eqbr_gpio_disable_irq(struct irq_data *d)
gpiochip_disable_irq(gc, offset);
}
-static void eqbr_gpio_enable_irq(struct irq_data *d)
+static void eqbr_irq_unmask(struct irq_data *d)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct eqbr_gpio_ctrl *gctrl = gpiochip_get_data(gc);
@@ -50,7 +50,7 @@ static void eqbr_gpio_enable_irq(struct irq_data *d)
raw_spin_unlock_irqrestore(&gctrl->lock, flags);
}
-static void eqbr_gpio_ack_irq(struct irq_data *d)
+static void eqbr_irq_ack(struct irq_data *d)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct eqbr_gpio_ctrl *gctrl = gpiochip_get_data(gc);
@@ -62,10 +62,10 @@ static void eqbr_gpio_ack_irq(struct irq_data *d)
raw_spin_unlock_irqrestore(&gctrl->lock, flags);
}
-static void eqbr_gpio_mask_ack_irq(struct irq_data *d)
+static void eqbr_irq_mask_ack(struct irq_data *d)
{
- eqbr_gpio_disable_irq(d);
- eqbr_gpio_ack_irq(d);
+ eqbr_irq_mask(d);
+ eqbr_irq_ack(d);
}
static inline void eqbr_cfg_bit(void __iomem *addr,
@@ -92,7 +92,7 @@ static int eqbr_irq_type_cfg(struct gpio_irq_type *type,
return 0;
}
-static int eqbr_gpio_set_irq_type(struct irq_data *d, unsigned int type)
+static int eqbr_irq_set_type(struct irq_data *d, unsigned int type)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct eqbr_gpio_ctrl *gctrl = gpiochip_get_data(gc);
@@ -166,11 +166,11 @@ static void eqbr_irq_handler(struct irq_desc *desc)
static const struct irq_chip eqbr_irq_chip = {
.name = "gpio_irq",
- .irq_mask = eqbr_gpio_disable_irq,
- .irq_unmask = eqbr_gpio_enable_irq,
- .irq_ack = eqbr_gpio_ack_irq,
- .irq_mask_ack = eqbr_gpio_mask_ack_irq,
- .irq_set_type = eqbr_gpio_set_irq_type,
+ .irq_ack = eqbr_irq_ack,
+ .irq_mask = eqbr_irq_mask,
+ .irq_mask_ack = eqbr_irq_mask_ack,
+ .irq_unmask = eqbr_irq_unmask,
+ .irq_set_type = eqbr_irq_set_type,
.flags = IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
};
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 182/311] pinctrl: equilibrium: fix warning trace on load
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (180 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 181/311] pinctrl: equilibrium: rename irq_chip function callbacks Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 183/311] pinctrl: qcom: qcs615: Add missing dual edge GPIO IRQ errata flag Sasha Levin
` (142 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Florian Eckert, Linus Walleij, Sasha Levin
From: Florian Eckert <fe@dev.tdt.de>
[ Upstream commit 3e00b1b332e54ba50cca6691f628b9c06574024f ]
The callback functions 'eqbr_irq_mask()' and 'eqbr_irq_ack()' are also
called in the callback function 'eqbr_irq_mask_ack()'. This is done to
avoid source code duplication. The problem, is that in the function
'eqbr_irq_mask()' also calles the gpiolib function 'gpiochip_disable_irq()'
This generates the following warning trace in the log for every gpio on
load.
[ 6.088111] ------------[ cut here ]------------
[ 6.092440] WARNING: CPU: 3 PID: 1 at drivers/gpio/gpiolib.c:3810 gpiochip_disable_irq+0x39/0x50
[ 6.097847] Modules linked in:
[ 6.097847] CPU: 3 UID: 0 PID: 1 Comm: swapper/0 Tainted: G W 6.12.59+ #0
[ 6.097847] Tainted: [W]=WARN
[ 6.097847] RIP: 0010:gpiochip_disable_irq+0x39/0x50
[ 6.097847] Code: 39 c6 48 19 c0 21 c6 48 c1 e6 05 48 03 b2 38 03 00 00 48 81 fe 00 f0 ff ff 77 11 48 8b 46 08 f6 c4 02 74 06 f0 80 66 09 fb c3 <0f> 0b 90 0f 1f 40 00 c3 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40
[ 6.097847] RSP: 0000:ffffc9000000b830 EFLAGS: 00010046
[ 6.097847] RAX: 0000000000000045 RBX: ffff888001be02a0 RCX: 0000000000000008
[ 6.097847] RDX: ffff888001be9000 RSI: ffff888001b2dd00 RDI: ffff888001be02a0
[ 6.097847] RBP: ffffc9000000b860 R08: 0000000000000000 R09: 0000000000000000
[ 6.097847] R10: 0000000000000001 R11: ffff888001b2a154 R12: ffff888001be0514
[ 6.097847] R13: ffff888001be02a0 R14: 0000000000000008 R15: 0000000000000000
[ 6.097847] FS: 0000000000000000(0000) GS:ffff888041d80000(0000) knlGS:0000000000000000
[ 6.097847] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 6.097847] CR2: 0000000000000000 CR3: 0000000003030000 CR4: 00000000001026b0
[ 6.097847] Call Trace:
[ 6.097847] <TASK>
[ 6.097847] ? eqbr_irq_mask+0x63/0x70
[ 6.097847] ? no_action+0x10/0x10
[ 6.097847] eqbr_irq_mask_ack+0x11/0x60
In an other driver (drivers/pinctrl/starfive/pinctrl-starfive-jh7100.c) the
interrupt is not disabled here.
To fix this, do not call the 'eqbr_irq_mask()' and 'eqbr_irq_ack()'
function. Implement instead this directly without disabling the interrupts.
Fixes: 52066a53bd11 ("pinctrl: equilibrium: Convert to immutable irq_chip")
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/pinctrl-equilibrium.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-equilibrium.c b/drivers/pinctrl/pinctrl-equilibrium.c
index 49c8232b525a9..ba1c867b7b891 100644
--- a/drivers/pinctrl/pinctrl-equilibrium.c
+++ b/drivers/pinctrl/pinctrl-equilibrium.c
@@ -64,8 +64,15 @@ static void eqbr_irq_ack(struct irq_data *d)
static void eqbr_irq_mask_ack(struct irq_data *d)
{
- eqbr_irq_mask(d);
- eqbr_irq_ack(d);
+ struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+ struct eqbr_gpio_ctrl *gctrl = gpiochip_get_data(gc);
+ unsigned int offset = irqd_to_hwirq(d);
+ unsigned long flags;
+
+ raw_spin_lock_irqsave(&gctrl->lock, flags);
+ writel(BIT(offset), gctrl->membase + GPIO_IRNENCLR);
+ writel(BIT(offset), gctrl->membase + GPIO_IRNCR);
+ raw_spin_unlock_irqrestore(&gctrl->lock, flags);
}
static inline void eqbr_cfg_bit(void __iomem *addr,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 183/311] pinctrl: qcom: qcs615: Add missing dual edge GPIO IRQ errata flag
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (181 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 182/311] pinctrl: equilibrium: fix warning trace on load Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 184/311] platform/x86: thinkpad_acpi: Fix errors reading battery thresholds Sasha Levin
` (141 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Maulik Shah, Dmitry Baryshkov, Linus Walleij, Sasha Levin
From: Maulik Shah <maulik.shah@oss.qualcomm.com>
[ Upstream commit 09a30b7a035f9f4ac918c8a9af89d70e43462152 ]
Wakeup capable GPIOs uses PDC as parent IRQ chip and PDC on qcs615 do not
support dual edge IRQs. Add missing wakeirq_dual_edge_errata configuration
to enable workaround for dual edge GPIO IRQs.
Fixes: b698f36a9d40 ("pinctrl: qcom: add the tlmm driver for QCS615 platform")
Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/qcom/pinctrl-qcs615.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/pinctrl/qcom/pinctrl-qcs615.c b/drivers/pinctrl/qcom/pinctrl-qcs615.c
index 4dfa820d4e77c..f1c827ddbfbfa 100644
--- a/drivers/pinctrl/qcom/pinctrl-qcs615.c
+++ b/drivers/pinctrl/qcom/pinctrl-qcs615.c
@@ -1067,6 +1067,7 @@ static const struct msm_pinctrl_soc_data qcs615_tlmm = {
.ntiles = ARRAY_SIZE(qcs615_tiles),
.wakeirq_map = qcs615_pdc_map,
.nwakeirq_map = ARRAY_SIZE(qcs615_pdc_map),
+ .wakeirq_dual_edge_errata = true,
};
static const struct of_device_id qcs615_tlmm_of_match[] = {
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 184/311] platform/x86: thinkpad_acpi: Fix errors reading battery thresholds
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (182 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 183/311] pinctrl: qcom: qcs615: Add missing dual edge GPIO IRQ errata flag Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 185/311] module: Remove duplicate freeing of lockdep classes Sasha Levin
` (140 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Jonathan Teh, Mark Pearson, Ilpo Järvinen, Sasha Levin
From: Jonathan Teh <jonathan.teh@outlook.com>
[ Upstream commit 53e977b1d50c46f2c4ec3865cd13a822f58ad3cd ]
Check whether the battery supports the relevant charge threshold before
reading the value to silence these errors:
thinkpad_acpi: acpi_evalf(BCTG, dd, ...) failed: AE_NOT_FOUND
ACPI: \_SB_.PCI0.LPC_.EC__.HKEY: BCTG: evaluate failed
thinkpad_acpi: acpi_evalf(BCSG, dd, ...) failed: AE_NOT_FOUND
ACPI: \_SB_.PCI0.LPC_.EC__.HKEY: BCSG: evaluate failed
when reading the charge thresholds via sysfs on platforms that do not
support them such as the ThinkPad T400.
Fixes: 2801b9683f74 ("thinkpad_acpi: Add support for battery thresholds")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=202619
Signed-off-by: Jonathan Teh <jonathan.teh@outlook.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Link: https://patch.msgid.link/MI0P293MB01967B206E1CA6F337EBFB12926CA@MI0P293MB0196.ITAP293.PROD.OUTLOOK.COM
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/x86/lenovo/thinkpad_acpi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c
index cc19fe520ea96..075543cd0e77e 100644
--- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
+++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
@@ -9525,14 +9525,16 @@ static int tpacpi_battery_get(int what, int battery, int *ret)
{
switch (what) {
case THRESHOLD_START:
- if ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_START, ret, battery))
+ if (!battery_info.batteries[battery].start_support ||
+ ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_START, ret, battery)))
return -ENODEV;
/* The value is in the low 8 bits of the response */
*ret = *ret & 0xFF;
return 0;
case THRESHOLD_STOP:
- if ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_STOP, ret, battery))
+ if (!battery_info.batteries[battery].stop_support ||
+ ACPI_FAILURE(tpacpi_battery_acpi_eval(GET_STOP, ret, battery)))
return -ENODEV;
/* Value is in lower 8 bits */
*ret = *ret & 0xFF;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 185/311] module: Remove duplicate freeing of lockdep classes
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (183 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 184/311] platform/x86: thinkpad_acpi: Fix errors reading battery thresholds Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 186/311] HID: multitouch: new class MT_CLS_EGALAX_P80H84 Sasha Levin
` (139 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Petr Pavlu, Daniel Gomez, Aaron Tomlin, Song Liu,
Peter Zijlstra (Intel), Sami Tolvanen, Sasha Levin
From: Petr Pavlu <petr.pavlu@suse.com>
[ Upstream commit a7b4bc094fbaa7dc7b7b91ae33549bbd7eefaac1 ]
In the error path of load_module(), under the free_module label, the
code calls lockdep_free_key_range() to release lock classes associated
with the MOD_DATA, MOD_RODATA and MOD_RO_AFTER_INIT module regions, and
subsequently invokes module_deallocate().
Since commit ac3b43283923 ("module: replace module_layout with
module_memory"), the module_deallocate() function calls free_mod_mem(),
which releases the lock classes as well and considers all module
regions.
Attempting to free these classes twice is unnecessary. Remove the
redundant code in load_module().
Fixes: ac3b43283923 ("module: replace module_layout with module_memory")
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Reviewed-by: Daniel Gomez <da.gomez@samsung.com>
Reviewed-by: Aaron Tomlin <atomlin@atomlin.com>
Acked-by: Song Liu <song@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/module/main.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/kernel/module/main.c b/kernel/module/main.c
index 710ee30b3beab..bcd259505c8b3 100644
--- a/kernel/module/main.c
+++ b/kernel/module/main.c
@@ -3544,12 +3544,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
mutex_unlock(&module_mutex);
free_module:
mod_stat_bump_invalid(info, flags);
- /* Free lock-classes; relies on the preceding sync_rcu() */
- for_class_mod_mem_type(type, core_data) {
- lockdep_free_key_range(mod->mem[type].base,
- mod->mem[type].size);
- }
-
module_memory_restore_rox(mod);
module_deallocate(mod, info);
free_copy:
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 186/311] HID: multitouch: new class MT_CLS_EGALAX_P80H84
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (184 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 185/311] module: Remove duplicate freeing of lockdep classes Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 187/311] pinctrl: pinconf-generic: Fix memory leak in pinconf_generic_parse_dt_config() Sasha Levin
` (138 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Ian Ray, Jiri Kosina, Sasha Levin
From: Ian Ray <ian.ray@gehealthcare.com>
[ Upstream commit a2e70a89fa58133521b2deae4427d35776bda935 ]
Fixes: f9e82295eec1 ("HID: multitouch: add eGalaxTouch P80H84 support")
Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hid/hid-multitouch.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index dde15d131a73e..b8a748bbf0fd8 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -235,6 +235,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
#define MT_CLS_SMART_TECH 0x0113
#define MT_CLS_APPLE_TOUCHBAR 0x0114
#define MT_CLS_YOGABOOK9I 0x0115
+#define MT_CLS_EGALAX_P80H84 0x0116
#define MT_CLS_SIS 0x0457
#define MT_DEFAULT_MAXCONTACT 10
@@ -449,6 +450,11 @@ static const struct mt_class mt_classes[] = {
MT_QUIRK_YOGABOOK9I,
.export_all_inputs = true
},
+ { .name = MT_CLS_EGALAX_P80H84,
+ .quirks = MT_QUIRK_ALWAYS_VALID |
+ MT_QUIRK_IGNORE_DUPLICATES |
+ MT_QUIRK_CONTACT_CNT_ACCURATE,
+ },
{ }
};
@@ -2233,8 +2239,9 @@ static const struct hid_device_id mt_devices[] = {
{ .driver_data = MT_CLS_EGALAX_SERIAL,
MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C000) },
- { .driver_data = MT_CLS_EGALAX,
- MT_USB_DEVICE(USB_VENDOR_ID_DWAV,
+ { .driver_data = MT_CLS_EGALAX_P80H84,
+ HID_DEVICE(HID_BUS_ANY, HID_GROUP_MULTITOUCH_WIN_8,
+ USB_VENDOR_ID_DWAV,
USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH_C002) },
/* Elan devices */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 187/311] pinctrl: pinconf-generic: Fix memory leak in pinconf_generic_parse_dt_config()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (185 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 186/311] HID: multitouch: new class MT_CLS_EGALAX_P80H84 Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 188/311] pinctrl: generic: move function to amlogic-am4 driver Sasha Levin
` (137 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Felix Gu, Antonio Borneo, Linus Walleij, Sasha Levin
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit 7a648d598cb8e8c62af3f0e020a25820a3f3a9a7 ]
In pinconf_generic_parse_dt_config(), if parse_dt_cfg() fails, it returns
directly. This bypasses the cleanup logic and results in a memory leak of
the cfg buffer.
Fix this by jumping to the out label on failure, ensuring kfree(cfg) is
called before returning.
Fixes: 90a18c512884 ("pinctrl: pinconf-generic: Handle string values for generic properties")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Antonio Borneo <antonio.borneo@foss.st.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/pinconf-generic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
index 366775841c639..38a8daf4a5848 100644
--- a/drivers/pinctrl/pinconf-generic.c
+++ b/drivers/pinctrl/pinconf-generic.c
@@ -351,13 +351,13 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
ret = parse_dt_cfg(np, dt_params, ARRAY_SIZE(dt_params), cfg, &ncfg);
if (ret)
- return ret;
+ goto out;
if (pctldev && pctldev->desc->num_custom_params &&
pctldev->desc->custom_params) {
ret = parse_dt_cfg(np, pctldev->desc->custom_params,
pctldev->desc->num_custom_params, cfg, &ncfg);
if (ret)
- return ret;
+ goto out;
}
/* no configs found at all */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 188/311] pinctrl: generic: move function to amlogic-am4 driver
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (186 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 187/311] pinctrl: pinconf-generic: Fix memory leak in pinconf_generic_parse_dt_config() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 189/311] pinctrl: meson: amlogic-a4: Fix device node reference leak in aml_dt_node_to_map_pinmux() Sasha Levin
` (136 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Conor Dooley, Andy Shevchenko, Linus Walleij, Sasha Levin
From: Conor Dooley <conor.dooley@microchip.com>
[ Upstream commit 9c5a40f2922a5a6d6b42e7b3d4c8e253918c07a1 ]
pinconf_generic_dt_node_to_map_pinmux() is not actually a generic
function, and really belongs in the amlogic-am4 driver. There are three
reasons why.
First, and least, of the reasons is that this function behaves
differently to the other dt_node_to_map functions in a way that is not
obvious from a first glance. This difference stems for the devicetree
properties that the function is intended for use with, and how they are
typically used. The other generic dt_node_to_map functions support
platforms where the pins, groups and functions are described statically
in the driver and require a function that will produce a mapping from dt
nodes to these pre-established descriptions. No other code in the driver
is require to be executed at runtime.
pinconf_generic_dt_node_to_map_pinmux() on the other hand is intended for
use with the pinmux property, where groups and functions are determined
entirely from the devicetree. As a result, there are no statically
defined groups and functions in the driver for this function to perform
a mapping to. Other drivers that use the pinmux property (e.g. the k1)
their dt_node_to_map function creates the groups and functions as the
devicetree is parsed. Instead of that,
pinconf_generic_dt_node_to_map_pinmux() requires that the devicetree is
parsed twice, once by it and once at probe, so that the driver
dynamically creates the groups and functions before the dt_node_to_map
callback is executed. I don't believe this double parsing requirement is
how developers would expect this to work and is not necessary given
there are drivers that do not have this behaviour.
Secondly and thirdly, the function bakes in some assumptions that only
really match the amlogic platform about how the devicetree is constructed.
These, to me, are problematic for something that claims to be generic.
The other dt_node_to_map implementations accept a being called for
either a node containing pin configuration properties or a node
containing child nodes that each contain the configuration properties.
IOW, they support the following two devicetree configurations:
| cfg {
| label: group {
| pinmux = <asjhdasjhlajskd>;
| config-item1;
| };
| };
| label: cfg {
| group1 {
| pinmux = <dsjhlfka>;
| config-item2;
| };
| group2 {
| pinmux = <lsdjhaf>;
| config-item1;
| };
| };
pinconf_generic_dt_node_to_map_pinmux() only supports the latter.
The other assumption about devicetree configuration that the function
makes is that the labeled node's parent is a "function node". The amlogic
driver uses these "function nodes" to create the functions at probe
time, and pinconf_generic_dt_node_to_map_pinmux() finds the parent of
the node it is operating on's name as part of the mapping. IOW, it
requires that the devicetree look like:
| pinctrl@bla {
|
| func-foo {
| label: group-default {
| pinmuxes = <lskdf>;
| };
| };
| };
and couldn't be used if the nodes containing the pinmux and
configuration properties are children of the pinctrl node itself:
| pinctrl@bla {
|
| label: group-default {
| pinmuxes = <lskdf>;
| };
| };
These final two reasons are mainly why I believe this is not suitable as
a generic function, and should be moved into the driver that is the sole
user and originator of the "generic" function.
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Stable-dep-of: a2539b92e4b7 ("pinctrl: meson: amlogic-a4: Fix device node reference leak in aml_dt_node_to_map_pinmux()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 71 +++++++++++++++++++++-
drivers/pinctrl/pinconf-generic.c | 69 ---------------------
include/linux/pinctrl/pinconf-generic.h | 5 --
3 files changed, 70 insertions(+), 75 deletions(-)
diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
index 40542edd557e0..dfa32b11555cd 100644
--- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
+++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
@@ -24,6 +24,7 @@
#include <dt-bindings/pinctrl/amlogic,pinctrl.h>
#include "../core.h"
+#include "../pinctrl-utils.h"
#include "../pinconf.h"
#define gpio_chip_to_bank(chip) \
@@ -672,11 +673,79 @@ static void aml_pin_dbg_show(struct pinctrl_dev *pcdev, struct seq_file *s,
seq_printf(s, " %s", dev_name(pcdev->dev));
}
+static int aml_dt_node_to_map_pinmux(struct pinctrl_dev *pctldev,
+ struct device_node *np,
+ struct pinctrl_map **map,
+ unsigned int *num_maps)
+{
+ struct device *dev = pctldev->dev;
+ struct device_node *pnode;
+ unsigned long *configs = NULL;
+ unsigned int num_configs = 0;
+ struct property *prop;
+ unsigned int reserved_maps;
+ int reserve;
+ int ret;
+
+ prop = of_find_property(np, "pinmux", NULL);
+ if (!prop) {
+ dev_info(dev, "Missing pinmux property\n");
+ return -ENOENT;
+ }
+
+ pnode = of_get_parent(np);
+ if (!pnode) {
+ dev_info(dev, "Missing function node\n");
+ return -EINVAL;
+ }
+
+ reserved_maps = 0;
+ *map = NULL;
+ *num_maps = 0;
+
+ ret = pinconf_generic_parse_dt_config(np, pctldev, &configs,
+ &num_configs);
+ if (ret < 0) {
+ dev_err(dev, "%pOF: could not parse node property\n", np);
+ return ret;
+ }
+
+ reserve = 1;
+ if (num_configs)
+ reserve++;
+
+ ret = pinctrl_utils_reserve_map(pctldev, map, &reserved_maps,
+ num_maps, reserve);
+ if (ret < 0)
+ goto exit;
+
+ ret = pinctrl_utils_add_map_mux(pctldev, map,
+ &reserved_maps, num_maps, np->name,
+ pnode->name);
+ if (ret < 0)
+ goto exit;
+
+ if (num_configs) {
+ ret = pinctrl_utils_add_map_configs(pctldev, map, &reserved_maps,
+ num_maps, np->name, configs,
+ num_configs, PIN_MAP_TYPE_CONFIGS_GROUP);
+ if (ret < 0)
+ goto exit;
+ }
+
+exit:
+ kfree(configs);
+ if (ret)
+ pinctrl_utils_free_map(pctldev, *map, *num_maps);
+
+ return ret;
+}
+
static const struct pinctrl_ops aml_pctrl_ops = {
.get_groups_count = aml_get_groups_count,
.get_group_name = aml_get_group_name,
.get_group_pins = aml_get_group_pins,
- .dt_node_to_map = pinconf_generic_dt_node_to_map_pinmux,
+ .dt_node_to_map = aml_dt_node_to_map_pinmux,
.dt_free_map = pinconf_generic_dt_free_map,
.pin_dbg_show = aml_pin_dbg_show,
};
diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
index 38a8daf4a5848..2b030bd0e6adc 100644
--- a/drivers/pinctrl/pinconf-generic.c
+++ b/drivers/pinctrl/pinconf-generic.c
@@ -385,75 +385,6 @@ int pinconf_generic_parse_dt_config(struct device_node *np,
}
EXPORT_SYMBOL_GPL(pinconf_generic_parse_dt_config);
-int pinconf_generic_dt_node_to_map_pinmux(struct pinctrl_dev *pctldev,
- struct device_node *np,
- struct pinctrl_map **map,
- unsigned int *num_maps)
-{
- struct device *dev = pctldev->dev;
- struct device_node *pnode;
- unsigned long *configs = NULL;
- unsigned int num_configs = 0;
- struct property *prop;
- unsigned int reserved_maps;
- int reserve;
- int ret;
-
- prop = of_find_property(np, "pinmux", NULL);
- if (!prop) {
- dev_info(dev, "Missing pinmux property\n");
- return -ENOENT;
- }
-
- pnode = of_get_parent(np);
- if (!pnode) {
- dev_info(dev, "Missing function node\n");
- return -EINVAL;
- }
-
- reserved_maps = 0;
- *map = NULL;
- *num_maps = 0;
-
- ret = pinconf_generic_parse_dt_config(np, pctldev, &configs,
- &num_configs);
- if (ret < 0) {
- dev_err(dev, "%pOF: could not parse node property\n", np);
- return ret;
- }
-
- reserve = 1;
- if (num_configs)
- reserve++;
-
- ret = pinctrl_utils_reserve_map(pctldev, map, &reserved_maps,
- num_maps, reserve);
- if (ret < 0)
- goto exit;
-
- ret = pinctrl_utils_add_map_mux(pctldev, map,
- &reserved_maps, num_maps, np->name,
- pnode->name);
- if (ret < 0)
- goto exit;
-
- if (num_configs) {
- ret = pinctrl_utils_add_map_configs(pctldev, map, &reserved_maps,
- num_maps, np->name, configs,
- num_configs, PIN_MAP_TYPE_CONFIGS_GROUP);
- if (ret < 0)
- goto exit;
- }
-
-exit:
- kfree(configs);
- if (ret)
- pinctrl_utils_free_map(pctldev, *map, *num_maps);
-
- return ret;
-}
-EXPORT_SYMBOL_GPL(pinconf_generic_dt_node_to_map_pinmux);
-
int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
struct device_node *np, struct pinctrl_map **map,
unsigned int *reserved_maps, unsigned int *num_maps,
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index 1be4032071c23..89277808ea614 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -250,9 +250,4 @@ static inline int pinconf_generic_dt_node_to_map_all(struct pinctrl_dev *pctldev
return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps,
PIN_MAP_TYPE_INVALID);
}
-
-int pinconf_generic_dt_node_to_map_pinmux(struct pinctrl_dev *pctldev,
- struct device_node *np,
- struct pinctrl_map **map,
- unsigned int *num_maps);
#endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 189/311] pinctrl: meson: amlogic-a4: Fix device node reference leak in aml_dt_node_to_map_pinmux()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (187 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 188/311] pinctrl: generic: move function to amlogic-am4 driver Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 190/311] pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe() Sasha Levin
` (135 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Felix Gu, Linus Walleij, Sasha Levin
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit a2539b92e4b791c1ba482930b5e51b1591975461 ]
The of_get_parent() function returns a device_node with an incremented
reference count.
Use the __free(device_node) cleanup attribute to ensure of_node_put()
is automatically called when pnode goes out of scope, fixing a
reference leak.
Fixes: 6e9be3abb78c ("pinctrl: Add driver support for Amlogic SoCs")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
index dfa32b11555cd..e2293a872dcb7 100644
--- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
+++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
@@ -679,7 +679,6 @@ static int aml_dt_node_to_map_pinmux(struct pinctrl_dev *pctldev,
unsigned int *num_maps)
{
struct device *dev = pctldev->dev;
- struct device_node *pnode;
unsigned long *configs = NULL;
unsigned int num_configs = 0;
struct property *prop;
@@ -693,7 +692,7 @@ static int aml_dt_node_to_map_pinmux(struct pinctrl_dev *pctldev,
return -ENOENT;
}
- pnode = of_get_parent(np);
+ struct device_node *pnode __free(device_node) = of_get_parent(np);
if (!pnode) {
dev_info(dev, "Missing function node\n");
return -EINVAL;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 190/311] pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (188 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 189/311] pinctrl: meson: amlogic-a4: Fix device node reference leak in aml_dt_node_to_map_pinmux() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 191/311] hwmon: (it87) Check the it87_lock() return value Sasha Levin
` (134 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Felix Gu, Charles Keepax, Linus Walleij, Sasha Levin
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit fd5bed798f45eb3a178ad527b43ab92705faaf8a ]
devm_add_action_or_reset() already invokes the action on failure,
so the explicit put causes a double-put.
Fixes: 9b07cdf86a0b ("pinctrl: cirrus: Fix fwnode leak in cs42l43_pin_probe()")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
index a8f82104a3842..227c37c360e19 100644
--- a/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
+++ b/drivers/pinctrl/cirrus/pinctrl-cs42l43.c
@@ -574,10 +574,9 @@ static int cs42l43_pin_probe(struct platform_device *pdev)
if (child) {
ret = devm_add_action_or_reset(&pdev->dev,
cs42l43_fwnode_put, child);
- if (ret) {
- fwnode_handle_put(child);
+ if (ret)
return ret;
- }
+
if (!child->dev)
child->dev = priv->dev;
fwnode = child;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 191/311] hwmon: (it87) Check the it87_lock() return value
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (189 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 190/311] pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe() Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 192/311] idpf: increment completion queue next_to_clean in sw marker wait routine Sasha Levin
` (133 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable
Cc: Bart Van Assche, Frank Crawford, Guenter Roeck, Jean Delvare,
linux-hwmon, Sasha Levin
From: Bart Van Assche <bvanassche@acm.org>
[ Upstream commit 07ed4f05bbfd2bc014974dcc4297fd3aa1cb88c0 ]
Return early in it87_resume() if it87_lock() fails instead of ignoring the
return value of that function. This patch suppresses a Clang thread-safety
warning.
Cc: Frank Crawford <frank@crawford.emu.id.au>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org
Fixes: 376e1a937b30 ("hwmon: (it87) Add calls to smbus_enable/smbus_disable as required")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20260223220102.2158611-15-bart.vanassche@linux.dev
[groeck: Declare 'ret' at the beginning of it87_resume()]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/it87.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index e233aafa8856c..5cfb98a0512f0 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -3590,10 +3590,13 @@ static int it87_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct it87_data *data = dev_get_drvdata(dev);
+ int err;
it87_resume_sio(pdev);
- it87_lock(data);
+ err = it87_lock(data);
+ if (err)
+ return err;
it87_check_pwm(dev);
it87_check_limit_regs(data);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 192/311] idpf: increment completion queue next_to_clean in sw marker wait routine
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (190 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 191/311] hwmon: (it87) Check the it87_lock() return value Sasha Levin
@ 2026-03-10 11:03 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 193/311] idpf: change IRQ naming to match netdev and ethtool queue numbering Sasha Levin
` (132 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:03 UTC (permalink / raw)
To: patches, stable; +Cc: Li Li, Aleksandr Loktionov, Tony Nguyen, Sasha Levin
From: Li Li <boolli@google.com>
[ Upstream commit 712896ac4bce38a965a1c175f6e7804ed0381334 ]
Currently, in idpf_wait_for_sw_marker_completion(), when an
IDPF_TXD_COMPLT_SW_MARKER packet is found, the routine breaks out of
the for loop and does not increment the next_to_clean counter. This
causes the subsequent NAPI polls to run into the same
IDPF_TXD_COMPLT_SW_MARKER packet again and print out the following:
[ 23.261341] idpf 0000:05:00.0 eth1: Unknown TX completion type: 5
Instead, we should increment next_to_clean regardless when an
IDPF_TXD_COMPLT_SW_MARKER packet is found.
Tested: with the patch applied, we do not see the errors above from NAPI
polls anymore.
Fixes: 9d39447051a0 ("idpf: remove SW marker handling from NAPI")
Signed-off-by: Li Li <boolli@google.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/idpf/idpf_txrx.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
index f58f616d87fc4..c558bb9c4dcbb 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
@@ -2326,7 +2326,7 @@ void idpf_wait_for_sw_marker_completion(const struct idpf_tx_queue *txq)
do {
struct idpf_splitq_4b_tx_compl_desc *tx_desc;
- struct idpf_tx_queue *target;
+ struct idpf_tx_queue *target = NULL;
u32 ctype_gen, id;
tx_desc = flow ? &complq->comp[ntc].common :
@@ -2346,14 +2346,14 @@ void idpf_wait_for_sw_marker_completion(const struct idpf_tx_queue *txq)
target = complq->txq_grp->txqs[id];
idpf_queue_clear(SW_MARKER, target);
- if (target == txq)
- break;
next:
if (unlikely(++ntc == complq->desc_count)) {
ntc = 0;
gen_flag = !gen_flag;
}
+ if (target == txq)
+ break;
} while (time_before(jiffies, timeout));
idpf_queue_assign(GEN_CHK, complq, gen_flag);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 193/311] idpf: change IRQ naming to match netdev and ethtool queue numbering
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (191 preceding siblings ...)
2026-03-10 11:03 ` [PATCH 6.19 192/311] idpf: increment completion queue next_to_clean in sw marker wait routine Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 194/311] idpf: Fix flow rule delete failure due to invalid validation Sasha Levin
` (131 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Brian Vazquez, Brett Creeley, Aleksandr Loktionov, Paul Menzel,
Eric Dumazet, Samuel Salin, Tony Nguyen, Sasha Levin
From: Brian Vazquez <brianvv@google.com>
[ Upstream commit 1500a8662d2d41d6bb03e034de45ddfe6d7d362d ]
The code uses the vidx for the IRQ name but that doesn't match ethtool
reporting nor netdev naming, this makes it hard to tune the device and
associate queues with IRQs. Sequentially requesting irqs starting from
'0' makes the output consistent.
This commit changes the interrupt numbering but preserves the name
format, maintaining ABI compatibility. Existing tools relying on the old
numbering are already non-functional, as they lack a useful correlation
to the interrupts.
Before:
ethtool -L eth1 tx 1 combined 3
grep . /proc/irq/*/*idpf*/../smp_affinity_list
/proc/irq/67/idpf-Mailbox-0/../smp_affinity_list:0-55,112-167
/proc/irq/68/idpf-eth1-TxRx-1/../smp_affinity_list:0
/proc/irq/70/idpf-eth1-TxRx-3/../smp_affinity_list:1
/proc/irq/71/idpf-eth1-TxRx-4/../smp_affinity_list:2
/proc/irq/72/idpf-eth1-Tx-5/../smp_affinity_list:3
ethtool -S eth1 | grep -v ': 0'
NIC statistics:
tx_q-0_pkts: 1002
tx_q-1_pkts: 2679
tx_q-2_pkts: 1113
tx_q-3_pkts: 1192 <----- tx_q-3 vs idpf-eth1-Tx-5
rx_q-0_pkts: 1143
rx_q-1_pkts: 3172
rx_q-2_pkts: 1074
After:
ethtool -L eth1 tx 1 combined 3
grep . /proc/irq/*/*idpf*/../smp_affinity_list
/proc/irq/67/idpf-Mailbox-0/../smp_affinity_list:0-55,112-167
/proc/irq/68/idpf-eth1-TxRx-0/../smp_affinity_list:0
/proc/irq/70/idpf-eth1-TxRx-1/../smp_affinity_list:1
/proc/irq/71/idpf-eth1-TxRx-2/../smp_affinity_list:2
/proc/irq/72/idpf-eth1-Tx-3/../smp_affinity_list:3
ethtool -S eth1 | grep -v ': 0'
NIC statistics:
tx_q-0_pkts: 118
tx_q-1_pkts: 134
tx_q-2_pkts: 228
tx_q-3_pkts: 138 <--- tx_q-3 matches idpf-eth1-Tx-3
rx_q-0_pkts: 111
rx_q-1_pkts: 366
rx_q-2_pkts: 120
Fixes: d4d558718266 ("idpf: initialize interrupts and enable vport")
Signed-off-by: Brian Vazquez <brianvv@google.com>
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/idpf/idpf_txrx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
index c558bb9c4dcbb..d365564831b0b 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
@@ -4038,7 +4038,7 @@ static int idpf_vport_intr_req_irq(struct idpf_vport *vport)
continue;
name = kasprintf(GFP_KERNEL, "%s-%s-%s-%d", drv_name, if_name,
- vec_name, vidx);
+ vec_name, vector);
err = request_irq(irq_num, idpf_vport_intr_clean_queues, 0,
name, q_vector);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 194/311] idpf: Fix flow rule delete failure due to invalid validation
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (192 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 193/311] idpf: change IRQ naming to match netdev and ethtool queue numbering Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 195/311] ice: recap the VSI and QoS info after rebuild Sasha Levin
` (130 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Sreedevi Joshi, Aleksandr Loktionov, Simon Horman, Paul Menzel,
Tony Nguyen, Sasha Levin
From: Sreedevi Joshi <sreedevi.joshi@intel.com>
[ Upstream commit 2c31557336a8e4d209ed8d4513cef2c0f15e7ef4 ]
When deleting a flow rule using "ethtool -N <dev> delete <location>",
idpf_sideband_action_ena() incorrectly validates fsp->ring_cookie even
though ethtool doesn't populate this field for delete operations. The
uninitialized ring_cookie may randomly match RX_CLS_FLOW_DISC or
RX_CLS_FLOW_WAKE, causing validation to fail and preventing legitimate
rule deletions. Remove the unnecessary sideband action enable check and
ring_cookie validation during delete operations since action validation
is not required when removing existing rules.
Fixes: ada3e24b84a0 ("idpf: add flow steering support")
Signed-off-by: Sreedevi Joshi <sreedevi.joshi@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/idpf/idpf_ethtool.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
index 2efa3c08aba5c..49cefb973f4da 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_ethtool.c
@@ -307,9 +307,6 @@ static int idpf_del_flow_steer(struct net_device *netdev,
vport_config = vport->adapter->vport_config[np->vport_idx];
user_config = &vport_config->user_config;
- if (!idpf_sideband_action_ena(vport, fsp))
- return -EOPNOTSUPP;
-
rule = kzalloc(struct_size(rule, rule_info, 1), GFP_KERNEL);
if (!rule)
return -ENOMEM;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 195/311] ice: recap the VSI and QoS info after rebuild
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (193 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 194/311] idpf: Fix flow rule delete failure due to invalid validation Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 196/311] ice: fix crash in ethtool offline loopback test Sasha Levin
` (129 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Aaron Ma, Aleksandr Loktionov, Simon Horman, Tony Nguyen,
Sasha Levin
From: Aaron Ma <aaron.ma@canonical.com>
[ Upstream commit 6aa07e23dd3ccd35a0100c06fcb6b6c3b01e7965 ]
Fix IRDMA hardware initialization timeout (-110) after resume by
separating VSI-dependent configuration from RDMA resource allocation,
ensuring VSI is rebuilt before IRDMA accesses it.
After resume from suspend, IRDMA hardware initialization fails:
ice: IRDMA hardware initialization FAILED init_state=4 status=-110
Separate RDMA initialization into two phases:
1. ice_init_rdma() - Allocate resources only (no VSI/QoS access, no plug)
2. ice_rdma_finalize_setup() - Assign VSI/QoS info and plug device
This allows:
- ice_init_rdma() to stay in ice_resume() (mirrors ice_deinit_rdma()
in ice_suspend())
- VSI assignment deferred until after ice_vsi_rebuild() completes
- QoS info updated after ice_dcb_rebuild() completes
- Device plugged only when control queues, VSI, and DCB are all ready
Fixes: bc69ad74867db ("ice: avoid IRQ collision to fix init failure on ACPI S3 resume")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice.h | 1 +
drivers/net/ethernet/intel/ice/ice_idc.c | 44 +++++++++++++++++------
drivers/net/ethernet/intel/ice/ice_main.c | 7 +++-
3 files changed, 41 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index 00f75d87c73f9..15a7fcd888b26 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -990,6 +990,7 @@ int ice_schedule_reset(struct ice_pf *pf, enum ice_reset_req reset);
void ice_print_link_msg(struct ice_vsi *vsi, bool isup);
int ice_plug_aux_dev(struct ice_pf *pf);
void ice_unplug_aux_dev(struct ice_pf *pf);
+void ice_rdma_finalize_setup(struct ice_pf *pf);
int ice_init_rdma(struct ice_pf *pf);
void ice_deinit_rdma(struct ice_pf *pf);
bool ice_is_wol_supported(struct ice_hw *hw);
diff --git a/drivers/net/ethernet/intel/ice/ice_idc.c b/drivers/net/ethernet/intel/ice/ice_idc.c
index 420d45c2558b6..ded029aa71d7d 100644
--- a/drivers/net/ethernet/intel/ice/ice_idc.c
+++ b/drivers/net/ethernet/intel/ice/ice_idc.c
@@ -360,6 +360,39 @@ void ice_unplug_aux_dev(struct ice_pf *pf)
auxiliary_device_uninit(adev);
}
+/**
+ * ice_rdma_finalize_setup - Complete RDMA setup after VSI is ready
+ * @pf: ptr to ice_pf
+ *
+ * Sets VSI-dependent information and plugs aux device.
+ * Must be called after ice_init_rdma(), ice_vsi_rebuild(), and
+ * ice_dcb_rebuild() complete.
+ */
+void ice_rdma_finalize_setup(struct ice_pf *pf)
+{
+ struct device *dev = ice_pf_to_dev(pf);
+ struct iidc_rdma_priv_dev_info *privd;
+ int ret;
+
+ if (!ice_is_rdma_ena(pf) || !pf->cdev_info)
+ return;
+
+ privd = pf->cdev_info->iidc_priv;
+ if (!privd || !pf->vsi || !pf->vsi[0] || !pf->vsi[0]->netdev)
+ return;
+
+ /* Assign VSI info now that VSI is valid */
+ privd->netdev = pf->vsi[0]->netdev;
+ privd->vport_id = pf->vsi[0]->vsi_num;
+
+ /* Update QoS info after DCB has been rebuilt */
+ ice_setup_dcb_qos_info(pf, &privd->qos_info);
+
+ ret = ice_plug_aux_dev(pf);
+ if (ret)
+ dev_warn(dev, "Failed to plug RDMA aux device: %d\n", ret);
+}
+
/**
* ice_init_rdma - initializes PF for RDMA use
* @pf: ptr to ice_pf
@@ -398,22 +431,14 @@ int ice_init_rdma(struct ice_pf *pf)
}
cdev->iidc_priv = privd;
- privd->netdev = pf->vsi[0]->netdev;
privd->hw_addr = (u8 __iomem *)pf->hw.hw_addr;
cdev->pdev = pf->pdev;
- privd->vport_id = pf->vsi[0]->vsi_num;
pf->cdev_info->rdma_protocol |= IIDC_RDMA_PROTOCOL_ROCEV2;
- ice_setup_dcb_qos_info(pf, &privd->qos_info);
- ret = ice_plug_aux_dev(pf);
- if (ret)
- goto err_plug_aux_dev;
+
return 0;
-err_plug_aux_dev:
- pf->cdev_info->adev = NULL;
- xa_erase(&ice_aux_id, pf->aux_idx);
err_alloc_xa:
kfree(privd);
err_privd_alloc:
@@ -432,7 +457,6 @@ void ice_deinit_rdma(struct ice_pf *pf)
if (!ice_is_rdma_ena(pf))
return;
- ice_unplug_aux_dev(pf);
xa_erase(&ice_aux_id, pf->aux_idx);
kfree(pf->cdev_info->iidc_priv);
kfree(pf->cdev_info);
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index d04605d3e61af..dddf1ae31952d 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -5138,6 +5138,9 @@ int ice_load(struct ice_pf *pf)
if (err)
goto err_init_rdma;
+ /* Finalize RDMA: VSI already created, assign info and plug device */
+ ice_rdma_finalize_setup(pf);
+
ice_service_task_restart(pf);
clear_bit(ICE_DOWN, pf->state);
@@ -5169,6 +5172,7 @@ void ice_unload(struct ice_pf *pf)
devl_assert_locked(priv_to_devlink(pf));
+ ice_unplug_aux_dev(pf);
ice_deinit_rdma(pf);
ice_deinit_features(pf);
ice_tc_indir_block_unregister(vsi);
@@ -5595,6 +5599,7 @@ static int ice_suspend(struct device *dev)
*/
disabled = ice_service_task_stop(pf);
+ ice_unplug_aux_dev(pf);
ice_deinit_rdma(pf);
/* Already suspended?, then there is nothing to do */
@@ -7803,7 +7808,7 @@ static void ice_rebuild(struct ice_pf *pf, enum ice_reset_req reset_type)
ice_health_clear(pf);
- ice_plug_aux_dev(pf);
+ ice_rdma_finalize_setup(pf);
if (ice_is_feature_supported(pf, ICE_F_SRIOV_LAG))
ice_lag_rebuild(pf);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 196/311] ice: fix crash in ethtool offline loopback test
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (194 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 195/311] ice: recap the VSI and QoS info after rebuild Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 197/311] i40e: Fix preempt count leak in napi poll tracepoint Sasha Levin
` (128 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Michal Schmidt, Aleksandr Loktionov, Rinitha S, Tony Nguyen,
Sasha Levin
From: Michal Schmidt <mschmidt@redhat.com>
[ Upstream commit a9c354e656597aededa027d63d2ff0973f6b033f ]
Since the conversion of ice to page pool, the ethtool loopback test
crashes:
BUG: kernel NULL pointer dereference, address: 000000000000000c
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD 1100f1067 P4D 0
Oops: Oops: 0002 [#1] SMP NOPTI
CPU: 23 UID: 0 PID: 5904 Comm: ethtool Kdump: loaded Not tainted 6.19.0-0.rc7.260128g1f97d9dcf5364.49.eln154.x86_64 #1 PREEMPT(lazy)
Hardware name: [...]
RIP: 0010:ice_alloc_rx_bufs+0x1cd/0x310 [ice]
Code: 83 6c 24 30 01 66 41 89 47 08 0f 84 c0 00 00 00 41 0f b7 dc 48 8b 44 24 18 48 c1 e3 04 41 bb 00 10 00 00 48 8d 2c 18 8b 04 24 <89> 45 0c 41 8b 4d 00 49 d3 e3 44 3b 5c 24 24 0f 83 ac fe ff ff 44
RSP: 0018:ff7894738aa1f768 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000700 RDI: 0000000000000000
RBP: 0000000000000000 R08: ff16dcae79880200 R09: 0000000000000019
R10: 0000000000000001 R11: 0000000000001000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: ff16dcae6c670000
FS: 00007fcf428850c0(0000) GS:ff16dcb149710000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000000000000c CR3: 0000000121227005 CR4: 0000000000773ef0
PKRU: 55555554
Call Trace:
<TASK>
ice_vsi_cfg_rxq+0xca/0x460 [ice]
ice_vsi_cfg_rxqs+0x54/0x70 [ice]
ice_loopback_test+0xa9/0x520 [ice]
ice_self_test+0x1b9/0x280 [ice]
ethtool_self_test+0xe5/0x200
__dev_ethtool+0x1106/0x1a90
dev_ethtool+0xbe/0x1a0
dev_ioctl+0x258/0x4c0
sock_do_ioctl+0xe3/0x130
__x64_sys_ioctl+0xb9/0x100
do_syscall_64+0x7c/0x700
entry_SYSCALL_64_after_hwframe+0x76/0x7e
[...]
It crashes because we have not initialized libeth for the rx ring.
Fix it by treating ICE_VSI_LB VSIs slightly more like normal PF VSIs and
letting them have a q_vector. It's just a dummy, because the loopback
test does not use interrupts, but it contains a napi struct that can be
passed to libeth_rx_fq_create() called from ice_vsi_cfg_rxq() ->
ice_rxq_pp_create().
Fixes: 93f53db9f9dc ("ice: switch to Page Pool")
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_base.c | 5 ++++-
drivers/net/ethernet/intel/ice/ice_ethtool.c | 4 ++++
drivers/net/ethernet/intel/ice/ice_lib.c | 15 ++++++++++-----
3 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c
index eadb1e3d12b3a..f0da50df6791c 100644
--- a/drivers/net/ethernet/intel/ice/ice_base.c
+++ b/drivers/net/ethernet/intel/ice/ice_base.c
@@ -124,6 +124,8 @@ static int ice_vsi_alloc_q_vector(struct ice_vsi *vsi, u16 v_idx)
if (vsi->type == ICE_VSI_VF) {
ice_calc_vf_reg_idx(vsi->vf, q_vector);
goto out;
+ } else if (vsi->type == ICE_VSI_LB) {
+ goto skip_alloc;
} else if (vsi->type == ICE_VSI_CTRL && vsi->vf) {
struct ice_vsi *ctrl_vsi = ice_get_vf_ctrl_vsi(pf, vsi);
@@ -662,7 +664,8 @@ static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)
u32 rx_buf_len;
int err;
- if (ring->vsi->type == ICE_VSI_PF || ring->vsi->type == ICE_VSI_SF) {
+ if (ring->vsi->type == ICE_VSI_PF || ring->vsi->type == ICE_VSI_SF ||
+ ring->vsi->type == ICE_VSI_LB) {
if (!xdp_rxq_info_is_reg(&ring->xdp_rxq)) {
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->q_index,
diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index 3565a5d96c6d1..e9f2618950c80 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -1289,6 +1289,10 @@ static u64 ice_loopback_test(struct net_device *netdev)
test_vsi->netdev = netdev;
tx_ring = test_vsi->tx_rings[0];
rx_ring = test_vsi->rx_rings[0];
+ /* Dummy q_vector and napi. Fill the minimum required for
+ * ice_rxq_pp_create().
+ */
+ rx_ring->q_vector->napi.dev = netdev;
if (ice_lbtest_prepare_rings(test_vsi)) {
ret = 2;
diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c
index d47af94f31a99..bad67e4dc044f 100644
--- a/drivers/net/ethernet/intel/ice/ice_lib.c
+++ b/drivers/net/ethernet/intel/ice/ice_lib.c
@@ -107,10 +107,6 @@ static int ice_vsi_alloc_arrays(struct ice_vsi *vsi)
if (!vsi->rxq_map)
goto err_rxq_map;
- /* There is no need to allocate q_vectors for a loopback VSI. */
- if (vsi->type == ICE_VSI_LB)
- return 0;
-
/* allocate memory for q_vector pointers */
vsi->q_vectors = devm_kcalloc(dev, vsi->num_q_vectors,
sizeof(*vsi->q_vectors), GFP_KERNEL);
@@ -239,6 +235,8 @@ static void ice_vsi_set_num_qs(struct ice_vsi *vsi)
case ICE_VSI_LB:
vsi->alloc_txq = 1;
vsi->alloc_rxq = 1;
+ /* A dummy q_vector, no actual IRQ. */
+ vsi->num_q_vectors = 1;
break;
default:
dev_warn(ice_pf_to_dev(pf), "Unknown VSI type %d\n", vsi_type);
@@ -2424,14 +2422,21 @@ static int ice_vsi_cfg_def(struct ice_vsi *vsi)
}
break;
case ICE_VSI_LB:
- ret = ice_vsi_alloc_rings(vsi);
+ ret = ice_vsi_alloc_q_vectors(vsi);
if (ret)
goto unroll_vsi_init;
+ ret = ice_vsi_alloc_rings(vsi);
+ if (ret)
+ goto unroll_alloc_q_vector;
+
ret = ice_vsi_alloc_ring_stats(vsi);
if (ret)
goto unroll_vector_base;
+ /* Simply map the dummy q_vector to the only rx_ring */
+ vsi->rx_rings[0]->q_vector = vsi->q_vectors[0];
+
break;
default:
/* clean up the resources and exit */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 197/311] i40e: Fix preempt count leak in napi poll tracepoint
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (195 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 196/311] ice: fix crash in ethtool offline loopback test Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 198/311] e1000e: clear DPG_EN after reset to avoid autonomous power-gating Sasha Levin
` (127 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Thomas Gleixner, Tony Nguyen, Przemek Kitszel, intel-wired-lan,
netdev, Joe Damato, Aleksandr Loktionov, Sasha Levin
From: Thomas Gleixner <tglx@kernel.org>
[ Upstream commit 4b3d54a85bd37ebf2d9836f0d0de775c0ff21af9 ]
Using get_cpu() in the tracepoint assignment causes an obvious preempt
count leak because nothing invokes put_cpu() to undo it:
softirq: huh, entered softirq 3 NET_RX with preempt_count 00000100, exited with 00000101?
This clearly has seen a lot of testing in the last 3+ years...
Use smp_processor_id() instead.
Fixes: 6d4d584a7ea8 ("i40e: Add i40e_napi_poll tracepoint")
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: intel-wired-lan@lists.osuosl.org
Cc: netdev@vger.kernel.org
Reviewed-by: Joe Damato <joe@dama.to>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/i40e/i40e_trace.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_trace.h b/drivers/net/ethernet/intel/i40e/i40e_trace.h
index 759f3d1c4c8f0..dde0ccd789ed1 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_trace.h
+++ b/drivers/net/ethernet/intel/i40e/i40e_trace.h
@@ -88,7 +88,7 @@ TRACE_EVENT(i40e_napi_poll,
__entry->rx_clean_complete = rx_clean_complete;
__entry->tx_clean_complete = tx_clean_complete;
__entry->irq_num = q->irq_num;
- __entry->curr_cpu = get_cpu();
+ __entry->curr_cpu = smp_processor_id();
__assign_str(qname);
__assign_str(dev_name);
__assign_bitmask(irq_affinity, cpumask_bits(&q->affinity_mask),
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 198/311] e1000e: clear DPG_EN after reset to avoid autonomous power-gating
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (196 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 197/311] i40e: Fix preempt count leak in napi poll tracepoint Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 199/311] drm/solomon: Fix page start when updating rectangle in page addressing mode Sasha Levin
` (126 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Vitaly Lifshits, Aleksandr Loktionov, Avigail Dahan, Paul Menzel,
Tony Nguyen, Sasha Levin
From: Vitaly Lifshits <vitaly.lifshits@intel.com>
[ Upstream commit 0942fc6d324eb9c6b16187b2aa994c0823557f06 ]
Panther Lake systems introduced an autonomous power gating feature for
the integrated Gigabit Ethernet in shutdown state (S5) state. As part of
it, the reset value of DPG_EN bit was changed to 1. Clear this bit after
performing hardware reset to avoid errors such as Tx/Rx hangs, or packet
loss/corruption.
Fixes: 0c9183ce61bc ("e1000e: Add support for the next LOM generation")
Signed-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Avigail Dahan <avigailx.dahan@intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/e1000e/defines.h | 1 +
drivers/net/ethernet/intel/e1000e/ich8lan.c | 9 +++++++++
2 files changed, 10 insertions(+)
diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h
index ba331899d1861..d4a1041e456dc 100644
--- a/drivers/net/ethernet/intel/e1000e/defines.h
+++ b/drivers/net/ethernet/intel/e1000e/defines.h
@@ -33,6 +33,7 @@
/* Extended Device Control */
#define E1000_CTRL_EXT_LPCD 0x00000004 /* LCD Power Cycle Done */
+#define E1000_CTRL_EXT_DPG_EN 0x00000008 /* Dynamic Power Gating Enable */
#define E1000_CTRL_EXT_SDP3_DATA 0x00000080 /* Value of SW Definable Pin 3 */
#define E1000_CTRL_EXT_FORCE_SMBUS 0x00000800 /* Force SMBus mode */
#define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 0ff8688ac3b84..2dceb5548a786 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -4932,6 +4932,15 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
reg |= E1000_KABGTXD_BGSQLBIAS;
ew32(KABGTXD, reg);
+ /* The hardware reset value of the DPG_EN bit is 1.
+ * Clear DPG_EN to prevent unexpected autonomous power gating.
+ */
+ if (hw->mac.type >= e1000_pch_ptp) {
+ reg = er32(CTRL_EXT);
+ reg &= ~E1000_CTRL_EXT_DPG_EN;
+ ew32(CTRL_EXT, reg);
+ }
+
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 199/311] drm/solomon: Fix page start when updating rectangle in page addressing mode
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (197 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 198/311] e1000e: clear DPG_EN after reset to avoid autonomous power-gating Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 200/311] netfs: Fix unbuffered/DIO writes to dispatch subrequests in strict sequence Sasha Levin
` (125 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Francesco Lavra, Javier Martinez Canillas, Sasha Levin
From: Francesco Lavra <flavra@baylibre.com>
[ Upstream commit 36d9579fed6c9429aa172f77bd28c58696ce8e2b ]
In page addressing mode, the pixel values of a dirty rectangle must be sent
to the display controller one page at a time. The range of pages
corresponding to a given rectangle is being incorrectly calculated as if
the Y value of the top left coordinate of the rectangle was 0. This can
result in rectangle updates being displayed on wrong parts of the screen.
Fix the above issue by consolidating the start page calculation in a single
place at the beginning of the update_rect function, and using the
calculated value for all addressing modes.
Fixes: b0daaa5cfaa5 ("drm/ssd130x: Support page addressing mode")
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patch.msgid.link/20260210180932.736502-1-flavra@baylibre.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/solomon/ssd130x.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/solomon/ssd130x.c b/drivers/gpu/drm/solomon/ssd130x.c
index 96cf393201372..33ceed86ed362 100644
--- a/drivers/gpu/drm/solomon/ssd130x.c
+++ b/drivers/gpu/drm/solomon/ssd130x.c
@@ -737,6 +737,7 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x,
unsigned int height = drm_rect_height(rect);
unsigned int line_length = DIV_ROUND_UP(width, 8);
unsigned int page_height = SSD130X_PAGE_HEIGHT;
+ u8 page_start = ssd130x->page_offset + y / page_height;
unsigned int pages = DIV_ROUND_UP(height, page_height);
struct drm_device *drm = &ssd130x->drm;
u32 array_idx = 0;
@@ -774,14 +775,11 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x,
*/
if (!ssd130x->page_address_mode) {
- u8 page_start;
-
/* Set address range for horizontal addressing mode */
ret = ssd130x_set_col_range(ssd130x, ssd130x->col_offset + x, width);
if (ret < 0)
return ret;
- page_start = ssd130x->page_offset + y / page_height;
ret = ssd130x_set_page_range(ssd130x, page_start, pages);
if (ret < 0)
return ret;
@@ -813,7 +811,7 @@ static int ssd130x_update_rect(struct ssd130x_device *ssd130x,
*/
if (ssd130x->page_address_mode) {
ret = ssd130x_set_page_pos(ssd130x,
- ssd130x->page_offset + i,
+ page_start + i,
ssd130x->col_offset + x);
if (ret < 0)
return ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 200/311] netfs: Fix unbuffered/DIO writes to dispatch subrequests in strict sequence
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (198 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 199/311] drm/solomon: Fix page start when updating rectangle in page addressing mode Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 201/311] nvmet-fcloop: Check remoteport port_state before calling done callback Sasha Levin
` (124 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: David Howells, Steve French, Paulo Alcantara (Red Hat), netfs,
linux-fsdevel, Christian Brauner, Sasha Levin
From: David Howells <dhowells@redhat.com>
[ Upstream commit a0b4c7a49137ed21279f354eb59f49ddae8dffc2 ]
Fix netfslib such that when it's making an unbuffered or DIO write, to make
sure that it sends each subrequest strictly sequentially, waiting till the
previous one is 'committed' before sending the next so that we don't have
pieces landing out of order and potentially leaving a hole if an error
occurs (ENOSPC for example).
This is done by copying in just those bits of issuing, collecting and
retrying subrequests that are necessary to do one subrequest at a time.
Retrying, in particular, is simpler because if the current subrequest needs
retrying, the source iterator can just be copied again and the subrequest
prepped and issued again without needing to be concerned about whether it
needs merging with the previous or next in the sequence.
Note that the issuing loop waits for a subrequest to complete right after
issuing it, but this wait could be moved elsewhere allowing preparatory
steps to be performed whilst the subrequest is in progress. In particular,
once content encryption is available in netfslib, that could be done whilst
waiting, as could cleanup of buffers that have been completed.
Fixes: 153a9961b551 ("netfs: Implement unbuffered/DIO write support")
Signed-off-by: David Howells <dhowells@redhat.com>
Link: https://patch.msgid.link/58526.1772112753@warthog.procyon.org.uk
Tested-by: Steve French <sfrench@samba.org>
Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/netfs/direct_write.c | 228 ++++++++++++++++++++++++++++++++---
fs/netfs/internal.h | 4 +-
fs/netfs/write_collect.c | 21 ----
fs/netfs/write_issue.c | 41 +------
include/trace/events/netfs.h | 4 +-
5 files changed, 221 insertions(+), 77 deletions(-)
diff --git a/fs/netfs/direct_write.c b/fs/netfs/direct_write.c
index a9d1c3b2c0842..dd1451bf7543d 100644
--- a/fs/netfs/direct_write.c
+++ b/fs/netfs/direct_write.c
@@ -9,6 +9,202 @@
#include <linux/uio.h>
#include "internal.h"
+/*
+ * Perform the cleanup rituals after an unbuffered write is complete.
+ */
+static void netfs_unbuffered_write_done(struct netfs_io_request *wreq)
+{
+ struct netfs_inode *ictx = netfs_inode(wreq->inode);
+
+ _enter("R=%x", wreq->debug_id);
+
+ /* Okay, declare that all I/O is complete. */
+ trace_netfs_rreq(wreq, netfs_rreq_trace_write_done);
+
+ if (!wreq->error)
+ netfs_update_i_size(ictx, &ictx->inode, wreq->start, wreq->transferred);
+
+ if (wreq->origin == NETFS_DIO_WRITE &&
+ wreq->mapping->nrpages) {
+ /* mmap may have got underfoot and we may now have folios
+ * locally covering the region we just wrote. Attempt to
+ * discard the folios, but leave in place any modified locally.
+ * ->write_iter() is prevented from interfering by the DIO
+ * counter.
+ */
+ pgoff_t first = wreq->start >> PAGE_SHIFT;
+ pgoff_t last = (wreq->start + wreq->transferred - 1) >> PAGE_SHIFT;
+
+ invalidate_inode_pages2_range(wreq->mapping, first, last);
+ }
+
+ if (wreq->origin == NETFS_DIO_WRITE)
+ inode_dio_end(wreq->inode);
+
+ _debug("finished");
+ netfs_wake_rreq_flag(wreq, NETFS_RREQ_IN_PROGRESS, netfs_rreq_trace_wake_ip);
+ /* As we cleared NETFS_RREQ_IN_PROGRESS, we acquired its ref. */
+
+ if (wreq->iocb) {
+ size_t written = umin(wreq->transferred, wreq->len);
+
+ wreq->iocb->ki_pos += written;
+ if (wreq->iocb->ki_complete) {
+ trace_netfs_rreq(wreq, netfs_rreq_trace_ki_complete);
+ wreq->iocb->ki_complete(wreq->iocb, wreq->error ?: written);
+ }
+ wreq->iocb = VFS_PTR_POISON;
+ }
+
+ netfs_clear_subrequests(wreq);
+}
+
+/*
+ * Collect the subrequest results of unbuffered write subrequests.
+ */
+static void netfs_unbuffered_write_collect(struct netfs_io_request *wreq,
+ struct netfs_io_stream *stream,
+ struct netfs_io_subrequest *subreq)
+{
+ trace_netfs_collect_sreq(wreq, subreq);
+
+ spin_lock(&wreq->lock);
+ list_del_init(&subreq->rreq_link);
+ spin_unlock(&wreq->lock);
+
+ wreq->transferred += subreq->transferred;
+ iov_iter_advance(&wreq->buffer.iter, subreq->transferred);
+
+ stream->collected_to = subreq->start + subreq->transferred;
+ wreq->collected_to = stream->collected_to;
+ netfs_put_subrequest(subreq, netfs_sreq_trace_put_done);
+
+ trace_netfs_collect_stream(wreq, stream);
+ trace_netfs_collect_state(wreq, wreq->collected_to, 0);
+}
+
+/*
+ * Write data to the server without going through the pagecache and without
+ * writing it to the local cache. We dispatch the subrequests serially and
+ * wait for each to complete before dispatching the next, lest we leave a gap
+ * in the data written due to a failure such as ENOSPC. We could, however
+ * attempt to do preparation such as content encryption for the next subreq
+ * whilst the current is in progress.
+ */
+static int netfs_unbuffered_write(struct netfs_io_request *wreq)
+{
+ struct netfs_io_subrequest *subreq = NULL;
+ struct netfs_io_stream *stream = &wreq->io_streams[0];
+ int ret;
+
+ _enter("%llx", wreq->len);
+
+ if (wreq->origin == NETFS_DIO_WRITE)
+ inode_dio_begin(wreq->inode);
+
+ stream->collected_to = wreq->start;
+
+ for (;;) {
+ bool retry = false;
+
+ if (!subreq) {
+ netfs_prepare_write(wreq, stream, wreq->start + wreq->transferred);
+ subreq = stream->construct;
+ stream->construct = NULL;
+ stream->front = NULL;
+ }
+
+ /* Check if (re-)preparation failed. */
+ if (unlikely(test_bit(NETFS_SREQ_FAILED, &subreq->flags))) {
+ netfs_write_subrequest_terminated(subreq, subreq->error);
+ wreq->error = subreq->error;
+ break;
+ }
+
+ iov_iter_truncate(&subreq->io_iter, wreq->len - wreq->transferred);
+ if (!iov_iter_count(&subreq->io_iter))
+ break;
+
+ subreq->len = netfs_limit_iter(&subreq->io_iter, 0,
+ stream->sreq_max_len,
+ stream->sreq_max_segs);
+ iov_iter_truncate(&subreq->io_iter, subreq->len);
+ stream->submit_extendable_to = subreq->len;
+
+ trace_netfs_sreq(subreq, netfs_sreq_trace_submit);
+ stream->issue_write(subreq);
+
+ /* Async, need to wait. */
+ netfs_wait_for_in_progress_stream(wreq, stream);
+
+ if (test_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags)) {
+ retry = true;
+ } else if (test_bit(NETFS_SREQ_FAILED, &subreq->flags)) {
+ ret = subreq->error;
+ wreq->error = ret;
+ netfs_see_subrequest(subreq, netfs_sreq_trace_see_failed);
+ subreq = NULL;
+ break;
+ }
+ ret = 0;
+
+ if (!retry) {
+ netfs_unbuffered_write_collect(wreq, stream, subreq);
+ subreq = NULL;
+ if (wreq->transferred >= wreq->len)
+ break;
+ if (!wreq->iocb && signal_pending(current)) {
+ ret = wreq->transferred ? -EINTR : -ERESTARTSYS;
+ trace_netfs_rreq(wreq, netfs_rreq_trace_intr);
+ break;
+ }
+ continue;
+ }
+
+ /* We need to retry the last subrequest, so first reset the
+ * iterator, taking into account what, if anything, we managed
+ * to transfer.
+ */
+ subreq->error = -EAGAIN;
+ trace_netfs_sreq(subreq, netfs_sreq_trace_retry);
+ if (subreq->transferred > 0)
+ iov_iter_advance(&wreq->buffer.iter, subreq->transferred);
+
+ if (stream->source == NETFS_UPLOAD_TO_SERVER &&
+ wreq->netfs_ops->retry_request)
+ wreq->netfs_ops->retry_request(wreq, stream);
+
+ __clear_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags);
+ __clear_bit(NETFS_SREQ_BOUNDARY, &subreq->flags);
+ __clear_bit(NETFS_SREQ_FAILED, &subreq->flags);
+ subreq->io_iter = wreq->buffer.iter;
+ subreq->start = wreq->start + wreq->transferred;
+ subreq->len = wreq->len - wreq->transferred;
+ subreq->transferred = 0;
+ subreq->retry_count += 1;
+ stream->sreq_max_len = UINT_MAX;
+ stream->sreq_max_segs = INT_MAX;
+
+ netfs_get_subrequest(subreq, netfs_sreq_trace_get_resubmit);
+ stream->prepare_write(subreq);
+
+ __set_bit(NETFS_SREQ_IN_PROGRESS, &subreq->flags);
+ netfs_stat(&netfs_n_wh_retry_write_subreq);
+ }
+
+ netfs_unbuffered_write_done(wreq);
+ _leave(" = %d", ret);
+ return ret;
+}
+
+static void netfs_unbuffered_write_async(struct work_struct *work)
+{
+ struct netfs_io_request *wreq = container_of(work, struct netfs_io_request, work);
+
+ netfs_unbuffered_write(wreq);
+ netfs_put_request(wreq, netfs_rreq_trace_put_complete);
+}
+
/*
* Perform an unbuffered write where we may have to do an RMW operation on an
* encrypted file. This can also be used for direct I/O writes.
@@ -70,35 +266,35 @@ ssize_t netfs_unbuffered_write_iter_locked(struct kiocb *iocb, struct iov_iter *
*/
wreq->buffer.iter = *iter;
}
+
+ wreq->len = iov_iter_count(&wreq->buffer.iter);
}
__set_bit(NETFS_RREQ_USE_IO_ITER, &wreq->flags);
- if (async)
- __set_bit(NETFS_RREQ_OFFLOAD_COLLECTION, &wreq->flags);
/* Copy the data into the bounce buffer and encrypt it. */
// TODO
/* Dispatch the write. */
__set_bit(NETFS_RREQ_UPLOAD_TO_SERVER, &wreq->flags);
- if (async)
- wreq->iocb = iocb;
- wreq->len = iov_iter_count(&wreq->buffer.iter);
- ret = netfs_unbuffered_write(wreq, is_sync_kiocb(iocb), wreq->len);
- if (ret < 0) {
- _debug("begin = %zd", ret);
- goto out;
- }
- if (!async) {
- ret = netfs_wait_for_write(wreq);
- if (ret > 0)
- iocb->ki_pos += ret;
- } else {
+ if (async) {
+ INIT_WORK(&wreq->work, netfs_unbuffered_write_async);
+ wreq->iocb = iocb;
+ queue_work(system_dfl_wq, &wreq->work);
ret = -EIOCBQUEUED;
+ } else {
+ ret = netfs_unbuffered_write(wreq);
+ if (ret < 0) {
+ _debug("begin = %zd", ret);
+ } else {
+ iocb->ki_pos += wreq->transferred;
+ ret = wreq->transferred ?: wreq->error;
+ }
+
+ netfs_put_request(wreq, netfs_rreq_trace_put_complete);
}
-out:
netfs_put_request(wreq, netfs_rreq_trace_put_return);
return ret;
diff --git a/fs/netfs/internal.h b/fs/netfs/internal.h
index 4319611f53544..d436e20d34185 100644
--- a/fs/netfs/internal.h
+++ b/fs/netfs/internal.h
@@ -198,6 +198,9 @@ struct netfs_io_request *netfs_create_write_req(struct address_space *mapping,
struct file *file,
loff_t start,
enum netfs_io_origin origin);
+void netfs_prepare_write(struct netfs_io_request *wreq,
+ struct netfs_io_stream *stream,
+ loff_t start);
void netfs_reissue_write(struct netfs_io_stream *stream,
struct netfs_io_subrequest *subreq,
struct iov_iter *source);
@@ -212,7 +215,6 @@ int netfs_advance_writethrough(struct netfs_io_request *wreq, struct writeback_c
struct folio **writethrough_cache);
ssize_t netfs_end_writethrough(struct netfs_io_request *wreq, struct writeback_control *wbc,
struct folio *writethrough_cache);
-int netfs_unbuffered_write(struct netfs_io_request *wreq, bool may_wait, size_t len);
/*
* write_retry.c
diff --git a/fs/netfs/write_collect.c b/fs/netfs/write_collect.c
index 61eab34ea67ef..83eb3dc1adf8a 100644
--- a/fs/netfs/write_collect.c
+++ b/fs/netfs/write_collect.c
@@ -399,27 +399,6 @@ bool netfs_write_collection(struct netfs_io_request *wreq)
ictx->ops->invalidate_cache(wreq);
}
- if ((wreq->origin == NETFS_UNBUFFERED_WRITE ||
- wreq->origin == NETFS_DIO_WRITE) &&
- !wreq->error)
- netfs_update_i_size(ictx, &ictx->inode, wreq->start, wreq->transferred);
-
- if (wreq->origin == NETFS_DIO_WRITE &&
- wreq->mapping->nrpages) {
- /* mmap may have got underfoot and we may now have folios
- * locally covering the region we just wrote. Attempt to
- * discard the folios, but leave in place any modified locally.
- * ->write_iter() is prevented from interfering by the DIO
- * counter.
- */
- pgoff_t first = wreq->start >> PAGE_SHIFT;
- pgoff_t last = (wreq->start + wreq->transferred - 1) >> PAGE_SHIFT;
- invalidate_inode_pages2_range(wreq->mapping, first, last);
- }
-
- if (wreq->origin == NETFS_DIO_WRITE)
- inode_dio_end(wreq->inode);
-
_debug("finished");
netfs_wake_rreq_flag(wreq, NETFS_RREQ_IN_PROGRESS, netfs_rreq_trace_wake_ip);
/* As we cleared NETFS_RREQ_IN_PROGRESS, we acquired its ref. */
diff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c
index 34894da5a23ec..437268f656409 100644
--- a/fs/netfs/write_issue.c
+++ b/fs/netfs/write_issue.c
@@ -154,9 +154,9 @@ EXPORT_SYMBOL(netfs_prepare_write_failed);
* Prepare a write subrequest. We need to allocate a new subrequest
* if we don't have one.
*/
-static void netfs_prepare_write(struct netfs_io_request *wreq,
- struct netfs_io_stream *stream,
- loff_t start)
+void netfs_prepare_write(struct netfs_io_request *wreq,
+ struct netfs_io_stream *stream,
+ loff_t start)
{
struct netfs_io_subrequest *subreq;
struct iov_iter *wreq_iter = &wreq->buffer.iter;
@@ -698,41 +698,6 @@ ssize_t netfs_end_writethrough(struct netfs_io_request *wreq, struct writeback_c
return ret;
}
-/*
- * Write data to the server without going through the pagecache and without
- * writing it to the local cache.
- */
-int netfs_unbuffered_write(struct netfs_io_request *wreq, bool may_wait, size_t len)
-{
- struct netfs_io_stream *upload = &wreq->io_streams[0];
- ssize_t part;
- loff_t start = wreq->start;
- int error = 0;
-
- _enter("%zx", len);
-
- if (wreq->origin == NETFS_DIO_WRITE)
- inode_dio_begin(wreq->inode);
-
- while (len) {
- // TODO: Prepare content encryption
-
- _debug("unbuffered %zx", len);
- part = netfs_advance_write(wreq, upload, start, len, false);
- start += part;
- len -= part;
- rolling_buffer_advance(&wreq->buffer, part);
- if (test_bit(NETFS_RREQ_PAUSE, &wreq->flags))
- netfs_wait_for_paused_write(wreq);
- if (test_bit(NETFS_RREQ_FAILED, &wreq->flags))
- break;
- }
-
- netfs_end_issue_write(wreq);
- _leave(" = %d", error);
- return error;
-}
-
/*
* Write some of a pending folio data back to the server and/or the cache.
*/
diff --git a/include/trace/events/netfs.h b/include/trace/events/netfs.h
index 64a382fbc31a8..2d366be46a1c3 100644
--- a/include/trace/events/netfs.h
+++ b/include/trace/events/netfs.h
@@ -57,6 +57,7 @@
EM(netfs_rreq_trace_done, "DONE ") \
EM(netfs_rreq_trace_end_copy_to_cache, "END-C2C") \
EM(netfs_rreq_trace_free, "FREE ") \
+ EM(netfs_rreq_trace_intr, "INTR ") \
EM(netfs_rreq_trace_ki_complete, "KI-CMPL") \
EM(netfs_rreq_trace_recollect, "RECLLCT") \
EM(netfs_rreq_trace_redirty, "REDIRTY") \
@@ -169,7 +170,8 @@
EM(netfs_sreq_trace_put_oom, "PUT OOM ") \
EM(netfs_sreq_trace_put_wip, "PUT WIP ") \
EM(netfs_sreq_trace_put_work, "PUT WORK ") \
- E_(netfs_sreq_trace_put_terminated, "PUT TERM ")
+ EM(netfs_sreq_trace_put_terminated, "PUT TERM ") \
+ E_(netfs_sreq_trace_see_failed, "SEE FAILED ")
#define netfs_folio_traces \
EM(netfs_folio_is_uptodate, "mod-uptodate") \
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 201/311] nvmet-fcloop: Check remoteport port_state before calling done callback
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (199 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 200/311] netfs: Fix unbuffered/DIO writes to dispatch subrequests in strict sequence Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 202/311] net: annotate data-races around sk->sk_{data_ready,write_space} Sasha Levin
` (123 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Justin Tee, Ewan D. Milne, Aristeu Rozanski, Daniel Wagner,
Keith Busch, Sasha Levin
From: Justin Tee <justintee8345@gmail.com>
[ Upstream commit dd677d0598387ea623820ab2bd0e029c377445a3 ]
In nvme_fc_handle_ls_rqst_work, the lsrsp->done callback is only set when
remoteport->port_state is FC_OBJSTATE_ONLINE. Otherwise, the
nvme_fc_xmt_ls_rsp's LLDD call to lport->ops->xmt_ls_rsp is expected to
fail and the nvme-fc transport layer itself will directly call
nvme_fc_xmt_ls_rsp_free instead of relying on LLDD's done callback to free
the lsrsp resources.
Update the fcloop_t2h_xmt_ls_rsp routine to check remoteport->port_state.
If online, then lsrsp->done callback will free the lsrsp. Else, return
-ENODEV to signal the nvme-fc transport to handle freeing lsrsp.
Cc: Ewan D. Milne <emilne@redhat.com>
Tested-by: Aristeu Rozanski <aris@redhat.com>
Acked-by: Aristeu Rozanski <aris@redhat.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Closes: https://lore.kernel.org/linux-nvme/21255200-a271-4fa0-b099-97755c8acd4c@work/
Fixes: 10c165af35d2 ("nvmet-fcloop: call done callback even when remote port is gone")
Signed-off-by: Justin Tee <justintee8345@gmail.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/target/fcloop.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c
index c30e9a3e014fb..38bd2db3d6bbe 100644
--- a/drivers/nvme/target/fcloop.c
+++ b/drivers/nvme/target/fcloop.c
@@ -491,6 +491,7 @@ fcloop_t2h_xmt_ls_rsp(struct nvme_fc_local_port *localport,
struct fcloop_rport *rport = remoteport->private;
struct nvmet_fc_target_port *targetport = rport->targetport;
struct fcloop_tport *tport;
+ int ret = 0;
if (!targetport) {
/*
@@ -500,12 +501,18 @@ fcloop_t2h_xmt_ls_rsp(struct nvme_fc_local_port *localport,
* We end up here from delete association exchange:
* nvmet_fc_xmt_disconnect_assoc sends an async request.
*
- * Return success because this is what LLDDs do; silently
- * drop the response.
+ * Return success when remoteport is still online because this
+ * is what LLDDs do and silently drop the response. Otherwise,
+ * return with error to signal upper layer to perform the lsrsp
+ * resource cleanup.
*/
- lsrsp->done(lsrsp);
+ if (remoteport->port_state == FC_OBJSTATE_ONLINE)
+ lsrsp->done(lsrsp);
+ else
+ ret = -ENODEV;
+
kmem_cache_free(lsreq_cache, tls_req);
- return 0;
+ return ret;
}
memcpy(lsreq->rspaddr, lsrsp->rspbuf,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 202/311] net: annotate data-races around sk->sk_{data_ready,write_space}
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (200 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 201/311] nvmet-fcloop: Check remoteport port_state before calling done callback Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 203/311] bridge: Check relevant per-VLAN options in VLAN range grouping Sasha Levin
` (122 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Eric Dumazet, syzbot+87f770387a9e5dc6b79b, Daniel Borkmann,
John Fastabend, Jakub Sitnicki, Willem de Bruijn,
Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 2ef2b20cf4e04ac8a6ba68493f8780776ff84300 ]
skmsg (and probably other layers) are changing these pointers
while other cpus might read them concurrently.
Add corresponding READ_ONCE()/WRITE_ONCE() annotations
for UDP, TCP and AF_UNIX.
Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface")
Reported-by: syzbot+87f770387a9e5dc6b79b@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/netdev/699ee9fc.050a0220.1cd54b.0009.GAE@google.com/
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Jakub Sitnicki <jakub@cloudflare.com>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260225131547.1085509-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/skmsg.c | 14 +++++++-------
net/ipv4/tcp.c | 4 ++--
net/ipv4/tcp_bpf.c | 2 +-
net/ipv4/tcp_input.c | 14 ++++++++------
net/ipv4/tcp_minisocks.c | 2 +-
net/ipv4/udp.c | 2 +-
net/ipv4/udp_bpf.c | 2 +-
net/unix/af_unix.c | 8 ++++----
8 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/net/core/skmsg.c b/net/core/skmsg.c
index ddde93dd8bc6d..12fbb0545c712 100644
--- a/net/core/skmsg.c
+++ b/net/core/skmsg.c
@@ -1205,8 +1205,8 @@ void sk_psock_start_strp(struct sock *sk, struct sk_psock *psock)
return;
psock->saved_data_ready = sk->sk_data_ready;
- sk->sk_data_ready = sk_psock_strp_data_ready;
- sk->sk_write_space = sk_psock_write_space;
+ WRITE_ONCE(sk->sk_data_ready, sk_psock_strp_data_ready);
+ WRITE_ONCE(sk->sk_write_space, sk_psock_write_space);
}
void sk_psock_stop_strp(struct sock *sk, struct sk_psock *psock)
@@ -1216,8 +1216,8 @@ void sk_psock_stop_strp(struct sock *sk, struct sk_psock *psock)
if (!psock->saved_data_ready)
return;
- sk->sk_data_ready = psock->saved_data_ready;
- psock->saved_data_ready = NULL;
+ WRITE_ONCE(sk->sk_data_ready, psock->saved_data_ready);
+ WRITE_ONCE(psock->saved_data_ready, NULL);
strp_stop(&psock->strp);
}
@@ -1296,8 +1296,8 @@ void sk_psock_start_verdict(struct sock *sk, struct sk_psock *psock)
return;
psock->saved_data_ready = sk->sk_data_ready;
- sk->sk_data_ready = sk_psock_verdict_data_ready;
- sk->sk_write_space = sk_psock_write_space;
+ WRITE_ONCE(sk->sk_data_ready, sk_psock_verdict_data_ready);
+ WRITE_ONCE(sk->sk_write_space, sk_psock_write_space);
}
void sk_psock_stop_verdict(struct sock *sk, struct sk_psock *psock)
@@ -1308,6 +1308,6 @@ void sk_psock_stop_verdict(struct sock *sk, struct sk_psock *psock)
if (!psock->saved_data_ready)
return;
- sk->sk_data_ready = psock->saved_data_ready;
+ WRITE_ONCE(sk->sk_data_ready, psock->saved_data_ready);
psock->saved_data_ready = NULL;
}
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 81666571ecfb5..699212cd6c226 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1397,7 +1397,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
err = sk_stream_error(sk, flags, err);
/* make sure we wake any epoll edge trigger waiter */
if (unlikely(tcp_rtx_and_write_queues_empty(sk) && err == -EAGAIN)) {
- sk->sk_write_space(sk);
+ READ_ONCE(sk->sk_write_space)(sk);
tcp_chrono_stop(sk, TCP_CHRONO_SNDBUF_LIMITED);
}
if (binding)
@@ -4131,7 +4131,7 @@ int do_tcp_setsockopt(struct sock *sk, int level, int optname,
break;
case TCP_NOTSENT_LOWAT:
WRITE_ONCE(tp->notsent_lowat, val);
- sk->sk_write_space(sk);
+ READ_ONCE(sk->sk_write_space)(sk);
break;
case TCP_INQ:
if (val > 1 || val < 0)
diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c
index ca8a5cb8e569d..d3d6a47af5270 100644
--- a/net/ipv4/tcp_bpf.c
+++ b/net/ipv4/tcp_bpf.c
@@ -725,7 +725,7 @@ int tcp_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore)
WRITE_ONCE(sk->sk_prot->unhash, psock->saved_unhash);
tcp_update_ulp(sk, psock->sk_proto, psock->saved_write_space);
} else {
- sk->sk_write_space = psock->saved_write_space;
+ WRITE_ONCE(sk->sk_write_space, psock->saved_write_space);
/* Pairs with lockless read in sk_clone_lock() */
sock_replace_proto(sk, psock->sk_proto);
}
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index aa4f5bf765596..adec44313772b 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5167,7 +5167,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) {
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP);
- sk->sk_data_ready(sk);
+ READ_ONCE(sk->sk_data_ready)(sk);
tcp_drop_reason(sk, skb, SKB_DROP_REASON_PROTO_MEM);
return;
}
@@ -5377,7 +5377,7 @@ int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size)
void tcp_data_ready(struct sock *sk)
{
if (tcp_epollin_ready(sk, sk->sk_rcvlowat) || sock_flag(sk, SOCK_DONE))
- sk->sk_data_ready(sk);
+ READ_ONCE(sk->sk_data_ready)(sk);
}
static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
@@ -5433,7 +5433,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
inet_csk(sk)->icsk_ack.pending |=
(ICSK_ACK_NOMEM | ICSK_ACK_NOW);
inet_csk_schedule_ack(sk);
- sk->sk_data_ready(sk);
+ READ_ONCE(sk->sk_data_ready)(sk);
if (skb_queue_len(&sk->sk_receive_queue) && skb->len) {
reason = SKB_DROP_REASON_PROTO_MEM;
@@ -5875,7 +5875,9 @@ static void tcp_new_space(struct sock *sk)
tp->snd_cwnd_stamp = tcp_jiffies32;
}
- INDIRECT_CALL_1(sk->sk_write_space, sk_stream_write_space, sk);
+ INDIRECT_CALL_1(READ_ONCE(sk->sk_write_space),
+ sk_stream_write_space,
+ sk);
}
/* Caller made space either from:
@@ -6091,7 +6093,7 @@ static void tcp_urg(struct sock *sk, struct sk_buff *skb, const struct tcphdr *t
BUG();
WRITE_ONCE(tp->urg_data, TCP_URG_VALID | tmp);
if (!sock_flag(sk, SOCK_DEAD))
- sk->sk_data_ready(sk);
+ READ_ONCE(sk->sk_data_ready)(sk);
}
}
}
@@ -7557,7 +7559,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
sock_put(fastopen_sk);
goto drop_and_free;
}
- sk->sk_data_ready(sk);
+ READ_ONCE(sk->sk_data_ready)(sk);
bh_unlock_sock(fastopen_sk);
sock_put(fastopen_sk);
} else {
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 0742a41687ffc..12f69cc285577 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -988,7 +988,7 @@ enum skb_drop_reason tcp_child_process(struct sock *parent, struct sock *child,
reason = tcp_rcv_state_process(child, skb);
/* Wakeup parent, send SIGIO */
if (state == TCP_SYN_RECV && child->sk_state != state)
- parent->sk_data_ready(parent);
+ READ_ONCE(parent->sk_data_ready)(parent);
} else {
/* Alas, it is possible again, because we do lookup
* in main socket hash table and lock on listening
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index ee63af0ef42cc..37258b54a357e 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1786,7 +1786,7 @@ int __udp_enqueue_schedule_skb(struct sock *sk, struct sk_buff *skb)
* using prepare_to_wait_exclusive().
*/
while (nb) {
- INDIRECT_CALL_1(sk->sk_data_ready,
+ INDIRECT_CALL_1(READ_ONCE(sk->sk_data_ready),
sock_def_readable, sk);
nb--;
}
diff --git a/net/ipv4/udp_bpf.c b/net/ipv4/udp_bpf.c
index 91233e37cd97a..779a3a03762f1 100644
--- a/net/ipv4/udp_bpf.c
+++ b/net/ipv4/udp_bpf.c
@@ -158,7 +158,7 @@ int udp_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore)
int family = sk->sk_family == AF_INET ? UDP_BPF_IPV4 : UDP_BPF_IPV6;
if (restore) {
- sk->sk_write_space = psock->saved_write_space;
+ WRITE_ONCE(sk->sk_write_space, psock->saved_write_space);
sock_replace_proto(sk, psock->sk_proto);
return 0;
}
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index f6d56e70c7a2c..6965b9a49d68a 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -1785,7 +1785,7 @@ static int unix_stream_connect(struct socket *sock, struct sockaddr_unsized *uad
__skb_queue_tail(&other->sk_receive_queue, skb);
spin_unlock(&other->sk_receive_queue.lock);
unix_state_unlock(other);
- other->sk_data_ready(other);
+ READ_ONCE(other->sk_data_ready)(other);
sock_put(other);
return 0;
@@ -2278,7 +2278,7 @@ static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
scm_stat_add(other, skb);
skb_queue_tail(&other->sk_receive_queue, skb);
unix_state_unlock(other);
- other->sk_data_ready(other);
+ READ_ONCE(other->sk_data_ready)(other);
sock_put(other);
scm_destroy(&scm);
return len;
@@ -2351,7 +2351,7 @@ static int queue_oob(struct sock *sk, struct msghdr *msg, struct sock *other,
sk_send_sigurg(other);
unix_state_unlock(other);
- other->sk_data_ready(other);
+ READ_ONCE(other->sk_data_ready)(other);
return 0;
out_unlock:
@@ -2477,7 +2477,7 @@ static int unix_stream_sendmsg(struct socket *sock, struct msghdr *msg,
spin_unlock(&other->sk_receive_queue.lock);
unix_state_unlock(other);
- other->sk_data_ready(other);
+ READ_ONCE(other->sk_data_ready)(other);
sent += size;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 203/311] bridge: Check relevant per-VLAN options in VLAN range grouping
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (201 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 202/311] net: annotate data-races around sk->sk_{data_ready,write_space} Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 204/311] net: ethernet: ti: am65-cpsw-nuss/cpsw-ale: Fix multicast entry handling in ALE table Sasha Levin
` (121 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Danielle Ratson, Ido Schimmel, Nikolay Aleksandrov,
Jakub Kicinski, Sasha Levin
From: Danielle Ratson <danieller@nvidia.com>
[ Upstream commit 93c9475c04acad2457a7e7ea4e3ec40a6e6d94a7 ]
The br_vlan_opts_eq_range() function determines if consecutive VLANs can
be grouped together in a range for compact netlink notifications. It
currently checks state, tunnel info, and multicast router configuration,
but misses two categories of per-VLAN options that affect the output:
1. User-visible priv_flags (neigh_suppress, mcast_enabled)
2. Port multicast context (mcast_max_groups, mcast_n_groups)
When VLANs have different settings for these options, they are incorrectly
grouped into ranges, causing netlink notifications to report only one
VLAN's settings for the entire range.
Fix by checking priv_flags equality, but only for flags that affect netlink
output (BR_VLFLAG_NEIGH_SUPPRESS_ENABLED and BR_VLFLAG_MCAST_ENABLED),
and comparing multicast context (mcast_max_groups and mcast_n_groups).
Example showing the bugs before the fix:
$ bridge vlan set vid 10 dev dummy1 neigh_suppress on
$ bridge vlan set vid 11 dev dummy1 neigh_suppress off
$ bridge -d vlan show dev dummy1
port vlan-id
dummy1 10-11
... neigh_suppress on
$ bridge vlan set vid 10 dev dummy1 mcast_max_groups 100
$ bridge vlan set vid 11 dev dummy1 mcast_max_groups 200
$ bridge -d vlan show dev dummy1
port vlan-id
dummy1 10-11
... mcast_max_groups 100
After the fix, VLANs 10 and 11 are shown as separate entries with their
correct individual settings.
Fixes: a1aee20d5db2 ("net: bridge: Add netlink knobs for number / maximum MDB entries")
Fixes: 83f6d600796c ("bridge: vlan: Allow setting VLAN neighbor suppression state")
Signed-off-by: Danielle Ratson <danieller@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20260225143956.3995415-2-danieller@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bridge/br_private.h | 10 ++++++++++
net/bridge/br_vlan_options.c | 26 +++++++++++++++++++++++---
2 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index b9b2981c48414..9b55d38ea9edb 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -1344,6 +1344,16 @@ br_multicast_ctx_options_equal(const struct net_bridge_mcast *brmctx1,
true;
}
+static inline bool
+br_multicast_port_ctx_options_equal(const struct net_bridge_mcast_port *pmctx1,
+ const struct net_bridge_mcast_port *pmctx2)
+{
+ return br_multicast_ngroups_get(pmctx1) ==
+ br_multicast_ngroups_get(pmctx2) &&
+ br_multicast_ngroups_get_max(pmctx1) ==
+ br_multicast_ngroups_get_max(pmctx2);
+}
+
static inline bool
br_multicast_ctx_matches_vlan_snooping(const struct net_bridge_mcast *brmctx)
{
diff --git a/net/bridge/br_vlan_options.c b/net/bridge/br_vlan_options.c
index 8fa89b04ee942..5514e1fc8d1fa 100644
--- a/net/bridge/br_vlan_options.c
+++ b/net/bridge/br_vlan_options.c
@@ -43,9 +43,29 @@ bool br_vlan_opts_eq_range(const struct net_bridge_vlan *v_curr,
u8 range_mc_rtr = br_vlan_multicast_router(range_end);
u8 curr_mc_rtr = br_vlan_multicast_router(v_curr);
- return v_curr->state == range_end->state &&
- __vlan_tun_can_enter_range(v_curr, range_end) &&
- curr_mc_rtr == range_mc_rtr;
+ if (v_curr->state != range_end->state)
+ return false;
+
+ if (!__vlan_tun_can_enter_range(v_curr, range_end))
+ return false;
+
+ if (curr_mc_rtr != range_mc_rtr)
+ return false;
+
+ /* Check user-visible priv_flags that affect output */
+ if ((v_curr->priv_flags ^ range_end->priv_flags) &
+ (BR_VLFLAG_NEIGH_SUPPRESS_ENABLED | BR_VLFLAG_MCAST_ENABLED))
+ return false;
+
+#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
+ if (!br_vlan_is_master(v_curr) &&
+ !br_multicast_port_ctx_vlan_disabled(&v_curr->port_mcast_ctx) &&
+ !br_multicast_port_ctx_options_equal(&v_curr->port_mcast_ctx,
+ &range_end->port_mcast_ctx))
+ return false;
+#endif
+
+ return true;
}
bool br_vlan_opts_fill(struct sk_buff *skb, const struct net_bridge_vlan *v,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 204/311] net: ethernet: ti: am65-cpsw-nuss/cpsw-ale: Fix multicast entry handling in ALE table
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (202 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 203/311] bridge: Check relevant per-VLAN options in VLAN range grouping Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 205/311] nvme-multipath: fix leak on try_module_get failure Sasha Levin
` (120 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Chintan Vankar, Simon Horman, Jakub Kicinski, Sasha Levin
From: Chintan Vankar <c-vankar@ti.com>
[ Upstream commit be11a537224d72b906db6b98510619770298c8a4 ]
In the current implementation, flushing multicast entries in MAC mode
incorrectly deletes entries for all ports instead of only the target port,
disrupting multicast traffic on other ports. The cause is adding multicast
entries by setting only host port bit, and not setting the MAC port bits.
Fix this by setting the MAC port's bit in the port mask while adding the
multicast entry. Also fix the flush logic to preserve the host port bit
during removal of MAC port and free ALE entries when mask contains only
host port.
Fixes: 5c50a856d550 ("drivers: net: ethernet: cpsw: add multicast address to ALE table")
Signed-off-by: Chintan Vankar <c-vankar@ti.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260224181359.2055322-1-c-vankar@ti.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
drivers/net/ethernet/ti/cpsw_ale.c | 9 ++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
index 5924db6be3fea..9679180504330 100644
--- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
+++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
@@ -391,7 +391,7 @@ static void am65_cpsw_nuss_ndo_slave_set_rx_mode(struct net_device *ndev)
cpsw_ale_set_allmulti(common->ale,
ndev->flags & IFF_ALLMULTI, port->port_id);
- port_mask = ALE_PORT_HOST;
+ port_mask = BIT(port->port_id) | ALE_PORT_HOST;
/* Clear all mcast from ALE */
cpsw_ale_flush_multicast(common->ale, port_mask, -1);
diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
index fbe35af615a6f..9632ad3741de1 100644
--- a/drivers/net/ethernet/ti/cpsw_ale.c
+++ b/drivers/net/ethernet/ti/cpsw_ale.c
@@ -455,14 +455,13 @@ static void cpsw_ale_flush_mcast(struct cpsw_ale *ale, u32 *ale_entry,
ale->port_mask_bits);
if ((mask & port_mask) == 0)
return; /* ports dont intersect, not interested */
- mask &= ~port_mask;
+ mask &= (~port_mask | ALE_PORT_HOST);
- /* free if only remaining port is host port */
- if (mask)
+ if (mask == 0x0 || mask == ALE_PORT_HOST)
+ cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
+ else
cpsw_ale_set_port_mask(ale_entry, mask,
ale->port_mask_bits);
- else
- cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_FREE);
}
int cpsw_ale_flush_multicast(struct cpsw_ale *ale, int port_mask, int vid)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 205/311] nvme-multipath: fix leak on try_module_get failure
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (203 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 204/311] net: ethernet: ti: am65-cpsw-nuss/cpsw-ale: Fix multicast entry handling in ALE table Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 206/311] inet: annotate data-races around isk->inet_num Sasha Levin
` (119 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Keith Busch, Nilay Shroff, John Garry, Christoph Hellwig,
Sasha Levin
From: Keith Busch <kbusch@kernel.org>
[ Upstream commit 0f5197ea9a73a4c406c75e6d8af3a13f7f96ae89 ]
We need to fall back to the synchronous removal if we can't get a
reference on the module needed for the deferred removal.
Fixes: 62188639ec16 ("nvme-multipath: introduce delayed removal of the multipath head node")
Reviewed-by: Nilay Shroff <nilay@linux.ibm.com>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/multipath.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 174027d1cc198..5e41fbaf5f46a 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -1310,13 +1310,11 @@ void nvme_mpath_remove_disk(struct nvme_ns_head *head)
if (!list_empty(&head->list))
goto out;
- if (head->delayed_removal_secs) {
- /*
- * Ensure that no one could remove this module while the head
- * remove work is pending.
- */
- if (!try_module_get(THIS_MODULE))
- goto out;
+ /*
+ * Ensure that no one could remove this module while the head
+ * remove work is pending.
+ */
+ if (head->delayed_removal_secs && try_module_get(THIS_MODULE)) {
mod_delayed_work(nvme_wq, &head->remove_work,
head->delayed_removal_secs * HZ);
} else {
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 206/311] inet: annotate data-races around isk->inet_num
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (204 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 205/311] nvme-multipath: fix leak on try_module_get failure Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 207/311] crypto: ccp - Fix use-after-free on error path Sasha Levin
` (118 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Eric Dumazet, Kuniyuki Iwashima, Jakub Kicinski, Sasha Levin
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 29252397bcc1e0a1f85e5c3bee59c325f5c26341 ]
UDP/TCP lookups are using RCU, thus isk->inet_num accesses
should use READ_ONCE() and WRITE_ONCE() where needed.
Fixes: 3ab5aee7fe84 ("net: Convert TCP & DCCP hash tables to use RCU / hlist_nulls")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260225203545.1512417-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/inet6_hashtables.h | 2 +-
include/net/inet_hashtables.h | 2 +-
include/net/ip.h | 2 +-
net/ipv4/inet_hashtables.c | 8 ++++----
net/ipv4/tcp_diag.c | 2 +-
net/ipv6/inet6_hashtables.c | 3 ++-
6 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index 282e29237d936..c16de5b7963fd 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -175,7 +175,7 @@ static inline bool inet6_match(const struct net *net, const struct sock *sk,
{
if (!net_eq(sock_net(sk), net) ||
sk->sk_family != AF_INET6 ||
- sk->sk_portpair != ports ||
+ READ_ONCE(sk->sk_portpair) != ports ||
!ipv6_addr_equal(&sk->sk_v6_daddr, saddr) ||
!ipv6_addr_equal(&sk->sk_v6_rcv_saddr, daddr))
return false;
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index ac05a52d9e138..5a979dcab5383 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -345,7 +345,7 @@ static inline bool inet_match(const struct net *net, const struct sock *sk,
int dif, int sdif)
{
if (!net_eq(sock_net(sk), net) ||
- sk->sk_portpair != ports ||
+ READ_ONCE(sk->sk_portpair) != ports ||
sk->sk_addrpair != cookie)
return false;
diff --git a/include/net/ip.h b/include/net/ip.h
index 69d5cef460040..7f9abd457e018 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -101,7 +101,7 @@ static inline void ipcm_init_sk(struct ipcm_cookie *ipcm,
ipcm->oif = READ_ONCE(inet->sk.sk_bound_dev_if);
ipcm->addr = inet->inet_saddr;
- ipcm->protocol = inet->inet_num;
+ ipcm->protocol = READ_ONCE(inet->inet_num);
}
#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb))
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c
index f5826ec4bcaa8..46817b4c141b6 100644
--- a/net/ipv4/inet_hashtables.c
+++ b/net/ipv4/inet_hashtables.c
@@ -200,7 +200,7 @@ static bool inet_bind2_bucket_addr_match(const struct inet_bind2_bucket *tb2,
void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
struct inet_bind2_bucket *tb2, unsigned short port)
{
- inet_sk(sk)->inet_num = port;
+ WRITE_ONCE(inet_sk(sk)->inet_num, port);
inet_csk(sk)->icsk_bind_hash = tb;
inet_csk(sk)->icsk_bind2_hash = tb2;
sk_add_bind_node(sk, &tb2->owners);
@@ -224,7 +224,7 @@ static void __inet_put_port(struct sock *sk)
spin_lock(&head->lock);
tb = inet_csk(sk)->icsk_bind_hash;
inet_csk(sk)->icsk_bind_hash = NULL;
- inet_sk(sk)->inet_num = 0;
+ WRITE_ONCE(inet_sk(sk)->inet_num, 0);
sk->sk_userlocks &= ~SOCK_CONNECT_BIND;
spin_lock(&head2->lock);
@@ -352,7 +352,7 @@ static inline int compute_score(struct sock *sk, const struct net *net,
{
int score = -1;
- if (net_eq(sock_net(sk), net) && sk->sk_num == hnum &&
+ if (net_eq(sock_net(sk), net) && READ_ONCE(sk->sk_num) == hnum &&
!ipv6_only_sock(sk)) {
if (sk->sk_rcv_saddr != daddr)
return -1;
@@ -1206,7 +1206,7 @@ int __inet_hash_connect(struct inet_timewait_death_row *death_row,
sk->sk_hash = 0;
inet_sk(sk)->inet_sport = 0;
- inet_sk(sk)->inet_num = 0;
+ WRITE_ONCE(inet_sk(sk)->inet_num, 0);
if (tw)
inet_twsk_bind_unhash(tw, hinfo);
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index d83efd91f461c..7935702e394b2 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -509,7 +509,7 @@ static void tcp_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,
if (r->sdiag_family != AF_UNSPEC &&
sk->sk_family != r->sdiag_family)
goto next_normal;
- if (r->id.idiag_sport != htons(sk->sk_num) &&
+ if (r->id.idiag_sport != htons(READ_ONCE(sk->sk_num)) &&
r->id.idiag_sport)
goto next_normal;
if (r->id.idiag_dport != sk->sk_dport &&
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c
index 5e1da088d8e11..182d38e6d6d8d 100644
--- a/net/ipv6/inet6_hashtables.c
+++ b/net/ipv6/inet6_hashtables.c
@@ -95,7 +95,8 @@ static inline int compute_score(struct sock *sk, const struct net *net,
{
int score = -1;
- if (net_eq(sock_net(sk), net) && inet_sk(sk)->inet_num == hnum &&
+ if (net_eq(sock_net(sk), net) &&
+ READ_ONCE(inet_sk(sk)->inet_num) == hnum &&
sk->sk_family == PF_INET6) {
if (!ipv6_addr_equal(&sk->sk_v6_rcv_saddr, daddr))
return -1;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 207/311] crypto: ccp - Fix use-after-free on error path
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (205 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 206/311] inet: annotate data-races around isk->inet_num Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 208/311] accel/amdxdna: Fill invalid payload for failed command Sasha Levin
` (117 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Alper Ak, Tom Lendacky, Herbert Xu, Sasha Levin
From: Alper Ak <alperyasinak1@gmail.com>
[ Upstream commit 889b0e2721e793eb46cf7d17b965aa3252af3ec8 ]
In the error path of sev_tsm_init_locked(), the code dereferences 't'
after it has been freed with kfree(). The pr_err() statement attempts
to access t->tio_en and t->tio_init_done after the memory has been
released.
Move the pr_err() call before kfree(t) to access the fields while the
memory is still valid.
This issue reported by Smatch static analyser
Fixes:4be423572da1 ("crypto/ccp: Implement SEV-TIO PCIe IDE (phase1)")
Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/crypto/ccp/sev-dev-tsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/crypto/ccp/sev-dev-tsm.c b/drivers/crypto/ccp/sev-dev-tsm.c
index 40d02adaf3f6d..7ad7e7a413c0f 100644
--- a/drivers/crypto/ccp/sev-dev-tsm.c
+++ b/drivers/crypto/ccp/sev-dev-tsm.c
@@ -378,9 +378,9 @@ void sev_tsm_init_locked(struct sev_device *sev, void *tio_status_page)
return;
error_exit:
- kfree(t);
pr_err("Failed to enable SEV-TIO: ret=%d en=%d initdone=%d SEV=%d\n",
ret, t->tio_en, t->tio_init_done, boot_cpu_has(X86_FEATURE_SEV));
+ kfree(t);
}
void sev_tsm_uninit(struct sev_device *sev)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 208/311] accel/amdxdna: Fill invalid payload for failed command
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (206 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 207/311] crypto: ccp - Fix use-after-free on error path Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 209/311] udp: Unhash auto-bound connected sk from 4-tuple hash table when disconnected Sasha Levin
` (116 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Lizhi Hou, Mario Limonciello (AMD), Sasha Levin
From: Lizhi Hou <lizhi.hou@amd.com>
[ Upstream commit 89ff45359abbf9d8d3c4aa3f5a57ed0be82b5a12 ]
Newer userspace applications may read the payload of a failed command
to obtain detailed error information. However, the driver and old firmware
versions may not support returning advanced error information.
In this case, initialize the command payload with an invalid value so
userspace can detect that no detailed error information is available.
Fixes: aac243092b70 ("accel/amdxdna: Add command execution")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260227004841.3080241-1-lizhi.hou@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/aie2_ctx.c | 23 ++++++++---------------
drivers/accel/amdxdna/amdxdna_ctx.c | 27 +++++++++++++++++++++++++++
drivers/accel/amdxdna/amdxdna_ctx.h | 3 +++
3 files changed, 38 insertions(+), 15 deletions(-)
diff --git a/drivers/accel/amdxdna/aie2_ctx.c b/drivers/accel/amdxdna/aie2_ctx.c
index 01a02f4c3a98d..9fc33b4298f23 100644
--- a/drivers/accel/amdxdna/aie2_ctx.c
+++ b/drivers/accel/amdxdna/aie2_ctx.c
@@ -186,13 +186,13 @@ aie2_sched_resp_handler(void *handle, void __iomem *data, size_t size)
cmd_abo = job->cmd_bo;
if (unlikely(job->job_timeout)) {
- amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_TIMEOUT);
+ amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_TIMEOUT);
ret = -EINVAL;
goto out;
}
if (unlikely(!data) || unlikely(size != sizeof(u32))) {
- amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
+ amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ABORT);
ret = -EINVAL;
goto out;
}
@@ -202,7 +202,7 @@ aie2_sched_resp_handler(void *handle, void __iomem *data, size_t size)
if (status == AIE2_STATUS_SUCCESS)
amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_COMPLETED);
else
- amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
+ amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ERROR);
out:
aie2_sched_notify(job);
@@ -244,13 +244,13 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size)
cmd_abo = job->cmd_bo;
if (unlikely(job->job_timeout)) {
- amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_TIMEOUT);
+ amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_TIMEOUT);
ret = -EINVAL;
goto out;
}
if (unlikely(!data) || unlikely(size != sizeof(u32) * 3)) {
- amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
+ amdxdna_cmd_set_error(cmd_abo, job, 0, ERT_CMD_STATE_ABORT);
ret = -EINVAL;
goto out;
}
@@ -270,19 +270,12 @@ aie2_sched_cmdlist_resp_handler(void *handle, void __iomem *data, size_t size)
fail_cmd_idx, fail_cmd_status);
if (fail_cmd_status == AIE2_STATUS_SUCCESS) {
- amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ABORT);
+ amdxdna_cmd_set_error(cmd_abo, job, fail_cmd_idx, ERT_CMD_STATE_ABORT);
ret = -EINVAL;
- goto out;
+ } else {
+ amdxdna_cmd_set_error(cmd_abo, job, fail_cmd_idx, ERT_CMD_STATE_ERROR);
}
- amdxdna_cmd_set_state(cmd_abo, ERT_CMD_STATE_ERROR);
- if (amdxdna_cmd_get_op(cmd_abo) == ERT_CMD_CHAIN) {
- struct amdxdna_cmd_chain *cc = amdxdna_cmd_get_payload(cmd_abo, NULL);
-
- cc->error_index = fail_cmd_idx;
- if (cc->error_index >= cc->command_count)
- cc->error_index = 0;
- }
out:
aie2_sched_notify(job);
return ret;
diff --git a/drivers/accel/amdxdna/amdxdna_ctx.c b/drivers/accel/amdxdna/amdxdna_ctx.c
index e42eb12fc7c1b..4e48519b699ac 100644
--- a/drivers/accel/amdxdna/amdxdna_ctx.c
+++ b/drivers/accel/amdxdna/amdxdna_ctx.c
@@ -135,6 +135,33 @@ u32 amdxdna_cmd_get_cu_idx(struct amdxdna_gem_obj *abo)
return INVALID_CU_IDX;
}
+int amdxdna_cmd_set_error(struct amdxdna_gem_obj *abo,
+ struct amdxdna_sched_job *job, u32 cmd_idx,
+ enum ert_cmd_state error_state)
+{
+ struct amdxdna_client *client = job->hwctx->client;
+ struct amdxdna_cmd *cmd = abo->mem.kva;
+ struct amdxdna_cmd_chain *cc = NULL;
+
+ cmd->header &= ~AMDXDNA_CMD_STATE;
+ cmd->header |= FIELD_PREP(AMDXDNA_CMD_STATE, error_state);
+
+ if (amdxdna_cmd_get_op(abo) == ERT_CMD_CHAIN) {
+ cc = amdxdna_cmd_get_payload(abo, NULL);
+ cc->error_index = (cmd_idx < cc->command_count) ? cmd_idx : 0;
+ abo = amdxdna_gem_get_obj(client, cc->data[0], AMDXDNA_BO_CMD);
+ if (!abo)
+ return -EINVAL;
+ cmd = abo->mem.kva;
+ }
+
+ memset(cmd->data, 0xff, abo->mem.size - sizeof(*cmd));
+ if (cc)
+ amdxdna_gem_put_obj(abo);
+
+ return 0;
+}
+
/*
* This should be called in close() and remove(). DO NOT call in other syscalls.
* This guarantee that when hwctx and resources will be released, if user
diff --git a/drivers/accel/amdxdna/amdxdna_ctx.h b/drivers/accel/amdxdna/amdxdna_ctx.h
index 16c85f08f03c6..fbdf9d0008713 100644
--- a/drivers/accel/amdxdna/amdxdna_ctx.h
+++ b/drivers/accel/amdxdna/amdxdna_ctx.h
@@ -167,6 +167,9 @@ amdxdna_cmd_get_state(struct amdxdna_gem_obj *abo)
void *amdxdna_cmd_get_payload(struct amdxdna_gem_obj *abo, u32 *size);
u32 amdxdna_cmd_get_cu_idx(struct amdxdna_gem_obj *abo);
+int amdxdna_cmd_set_error(struct amdxdna_gem_obj *abo,
+ struct amdxdna_sched_job *job, u32 cmd_idx,
+ enum ert_cmd_state error_state);
void amdxdna_sched_job_cleanup(struct amdxdna_sched_job *job);
void amdxdna_hwctx_remove_all(struct amdxdna_client *client);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 209/311] udp: Unhash auto-bound connected sk from 4-tuple hash table when disconnected.
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (207 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 208/311] accel/amdxdna: Fill invalid payload for failed command Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 210/311] tcp: give up on stronger sk_rcvbuf checks (for now) Sasha Levin
` (115 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Kuniyuki Iwashima, Eric Dumazet, Jakub Kicinski, Sasha Levin
From: Kuniyuki Iwashima <kuniyu@google.com>
[ Upstream commit 6996a2d2d0a64808c19c98002aeb5d9d1b2df6a4 ]
Let's say we bind() an UDP socket to the wildcard address with a
non-zero port, connect() it to an address, and disconnect it from
the address.
bind() sets SOCK_BINDPORT_LOCK on sk->sk_userlocks (but not
SOCK_BINDADDR_LOCK), and connect() calls udp_lib_hash4() to put
the socket into the 4-tuple hash table.
Then, __udp_disconnect() calls sk->sk_prot->rehash(sk).
It computes a new hash based on the wildcard address and moves
the socket to a new slot in the 4-tuple hash table, leaving a
garbage in the chain that no packet hits.
Let's remove such a socket from 4-tuple hash table when disconnected.
Note that udp_sk(sk)->udp_portaddr_hash needs to be udpated after
udp_hash4_dec(hslot2) in udp_unhash4().
Fixes: 78c91ae2c6de ("ipv4/udp: Add 4-tuple hash for connected socket")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260227035547.3321327-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/udp.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 37258b54a357e..fbdbb65676e0d 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2268,7 +2268,6 @@ void udp_lib_rehash(struct sock *sk, u16 newhash, u16 newhash4)
udp_sk(sk)->udp_port_hash);
hslot2 = udp_hashslot2(udptable, udp_sk(sk)->udp_portaddr_hash);
nhslot2 = udp_hashslot2(udptable, newhash);
- udp_sk(sk)->udp_portaddr_hash = newhash;
if (hslot2 != nhslot2 ||
rcu_access_pointer(sk->sk_reuseport_cb)) {
@@ -2302,19 +2301,25 @@ void udp_lib_rehash(struct sock *sk, u16 newhash, u16 newhash4)
if (udp_hashed4(sk)) {
spin_lock_bh(&hslot->lock);
- udp_rehash4(udptable, sk, newhash4);
- if (hslot2 != nhslot2) {
- spin_lock(&hslot2->lock);
- udp_hash4_dec(hslot2);
- spin_unlock(&hslot2->lock);
-
- spin_lock(&nhslot2->lock);
- udp_hash4_inc(nhslot2);
- spin_unlock(&nhslot2->lock);
+ if (inet_rcv_saddr_any(sk)) {
+ udp_unhash4(udptable, sk);
+ } else {
+ udp_rehash4(udptable, sk, newhash4);
+ if (hslot2 != nhslot2) {
+ spin_lock(&hslot2->lock);
+ udp_hash4_dec(hslot2);
+ spin_unlock(&hslot2->lock);
+
+ spin_lock(&nhslot2->lock);
+ udp_hash4_inc(nhslot2);
+ spin_unlock(&nhslot2->lock);
+ }
}
spin_unlock_bh(&hslot->lock);
}
+
+ udp_sk(sk)->udp_portaddr_hash = newhash;
}
}
EXPORT_IPV6_MOD(udp_lib_rehash);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 210/311] tcp: give up on stronger sk_rcvbuf checks (for now)
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (208 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 209/311] udp: Unhash auto-bound connected sk from 4-tuple hash table when disconnected Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 211/311] xsk: Fix fragment node deletion to prevent buffer leak Sasha Levin
` (114 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Jakub Kicinski, Eric Dumazet, Kuniyuki Iwashima, Sasha Levin
From: Jakub Kicinski <kuba@kernel.org>
[ Upstream commit 026dfef287c07f37d4d4eef7a0b5a4bfdb29b32d ]
We hit another corner case which leads to TcpExtTCPRcvQDrop
Connections which send RPCs in the 20-80kB range over loopback
experience spurious drops. The exact conditions for most of
the drops I investigated are that:
- socket exchanged >1MB of data so its not completely fresh
- rcvbuf is around 128kB (default, hasn't grown)
- there is ~60kB of data in rcvq
- skb > 64kB arrives
The sum of skb->len (!) of both of the skbs (the one already
in rcvq and the arriving one) is larger than rwnd.
My suspicion is that this happens because __tcp_select_window()
rounds the rwnd up to (1 << wscale) if less than half of
the rwnd has been consumed.
Eric suggests that given the number of Fixes we already have
pointing to 1d2fbaad7cd8 it's probably time to give up on it,
until a bigger revamp of rmem management.
Also while we could risk tweaking the rwnd math, there are other
drops on workloads I investigated, after the commit in question,
not explained by this phenomenon.
Suggested-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/20260225122355.585fd57b@kernel.org
Fixes: 1d2fbaad7cd8 ("tcp: stronger sk_rcvbuf checks")
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260227003359.2391017-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv4/tcp_input.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index adec44313772b..1c9db9a246f71 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5116,25 +5116,11 @@ static void tcp_ofo_queue(struct sock *sk)
static bool tcp_prune_ofo_queue(struct sock *sk, const struct sk_buff *in_skb);
static int tcp_prune_queue(struct sock *sk, const struct sk_buff *in_skb);
-/* Check if this incoming skb can be added to socket receive queues
- * while satisfying sk->sk_rcvbuf limit.
- *
- * In theory we should use skb->truesize, but this can cause problems
- * when applications use too small SO_RCVBUF values.
- * When LRO / hw gro is used, the socket might have a high tp->scaling_ratio,
- * allowing RWIN to be close to available space.
- * Whenever the receive queue gets full, we can receive a small packet
- * filling RWIN, but with a high skb->truesize, because most NIC use 4K page
- * plus sk_buff metadata even when receiving less than 1500 bytes of payload.
- *
- * Note that we use skb->len to decide to accept or drop this packet,
- * but sk->sk_rmem_alloc is the sum of all skb->truesize.
- */
static bool tcp_can_ingest(const struct sock *sk, const struct sk_buff *skb)
{
unsigned int rmem = atomic_read(&sk->sk_rmem_alloc);
- return rmem + skb->len <= sk->sk_rcvbuf;
+ return rmem <= sk->sk_rcvbuf;
}
static int tcp_try_rmem_schedule(struct sock *sk, const struct sk_buff *skb,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 211/311] xsk: Fix fragment node deletion to prevent buffer leak
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (209 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 210/311] tcp: give up on stronger sk_rcvbuf checks (for now) Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 212/311] xsk: Fix zero-copy AF_XDP fragment drop Sasha Levin
` (113 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Nikhil P. Rao, Maciej Fijalkowski, Jakub Kicinski, Sasha Levin
From: "Nikhil P. Rao" <nikhil.rao@amd.com>
[ Upstream commit 60abb0ac11dccd6b98fd9182bc5f85b621688861 ]
After commit b692bf9a7543 ("xsk: Get rid of xdp_buff_xsk::xskb_list_node"),
the list_node field is reused for both the xskb pool list and the buffer
free list, this causes a buffer leak as described below.
xp_free() checks if a buffer is already on the free list using
list_empty(&xskb->list_node). When list_del() is used to remove a node
from the xskb pool list, it doesn't reinitialize the node pointers.
This means list_empty() will return false even after the node has been
removed, causing xp_free() to incorrectly skip adding the buffer to the
free list.
Fix this by using list_del_init() instead of list_del() in all fragment
handling paths, this ensures the list node is reinitialized after removal,
allowing the list_empty() to work correctly.
Fixes: b692bf9a7543 ("xsk: Get rid of xdp_buff_xsk::xskb_list_node")
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Nikhil P. Rao <nikhil.rao@amd.com>
Link: https://patch.msgid.link/20260225000456.107806-2-nikhil.rao@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/xdp_sock_drv.h | 6 +++---
net/xdp/xsk.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/net/xdp_sock_drv.h b/include/net/xdp_sock_drv.h
index 242e34f771cca..aefc368449d59 100644
--- a/include/net/xdp_sock_drv.h
+++ b/include/net/xdp_sock_drv.h
@@ -122,7 +122,7 @@ static inline void xsk_buff_free(struct xdp_buff *xdp)
goto out;
list_for_each_entry_safe(pos, tmp, xskb_list, list_node) {
- list_del(&pos->list_node);
+ list_del_init(&pos->list_node);
xp_free(pos);
}
@@ -157,7 +157,7 @@ static inline struct xdp_buff *xsk_buff_get_frag(const struct xdp_buff *first)
frag = list_first_entry_or_null(&xskb->pool->xskb_list,
struct xdp_buff_xsk, list_node);
if (frag) {
- list_del(&frag->list_node);
+ list_del_init(&frag->list_node);
ret = &frag->xdp;
}
@@ -168,7 +168,7 @@ static inline void xsk_buff_del_frag(struct xdp_buff *xdp)
{
struct xdp_buff_xsk *xskb = container_of(xdp, struct xdp_buff_xsk, xdp);
- list_del(&xskb->list_node);
+ list_del_init(&xskb->list_node);
}
static inline struct xdp_buff *xsk_buff_get_head(struct xdp_buff *first)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index f093c3453f64c..f2ec4f78bbb6a 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -186,7 +186,7 @@ static int xsk_rcv_zc(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len)
err = __xsk_rcv_zc(xs, pos, len, contd);
if (err)
goto err;
- list_del(&pos->list_node);
+ list_del_init(&pos->list_node);
}
return 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 212/311] xsk: Fix zero-copy AF_XDP fragment drop
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (210 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 211/311] xsk: Fix fragment node deletion to prevent buffer leak Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 213/311] dpaa2-switch: Fix interrupt storm after receiving bad if_id in IRQ handler Sasha Levin
` (112 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Nikhil P. Rao, Jakub Kicinski, Sasha Levin
From: "Nikhil P. Rao" <nikhil.rao@amd.com>
[ Upstream commit f7387d6579d65efd490a864254101cb665f2e7a7 ]
AF_XDP should ensure that only a complete packet is sent to application.
In the zero-copy case, if the Rx queue gets full as fragments are being
enqueued, the remaining fragments are dropped.
For the multi-buffer case, add a check to ensure that the Rx queue has
enough space for all fragments of a packet before starting to enqueue
them.
Fixes: 24ea50127ecf ("xsk: support mbuf on ZC RX")
Signed-off-by: Nikhil P. Rao <nikhil.rao@amd.com>
Link: https://patch.msgid.link/20260225000456.107806-3-nikhil.rao@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/xdp/xsk.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index f2ec4f78bbb6a..a6d3938154f21 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -167,25 +167,31 @@ static int xsk_rcv_zc(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len)
struct xdp_buff_xsk *pos, *tmp;
struct list_head *xskb_list;
u32 contd = 0;
+ u32 num_desc;
int err;
- if (frags)
- contd = XDP_PKT_CONTD;
+ if (likely(!frags)) {
+ err = __xsk_rcv_zc(xs, xskb, len, contd);
+ if (err)
+ goto err;
+ return 0;
+ }
- err = __xsk_rcv_zc(xs, xskb, len, contd);
- if (err)
+ contd = XDP_PKT_CONTD;
+ num_desc = xdp_get_shared_info_from_buff(xdp)->nr_frags + 1;
+ if (xskq_prod_nb_free(xs->rx, num_desc) < num_desc) {
+ xs->rx_queue_full++;
+ err = -ENOBUFS;
goto err;
- if (likely(!frags))
- return 0;
+ }
+ __xsk_rcv_zc(xs, xskb, len, contd);
xskb_list = &xskb->pool->xskb_list;
list_for_each_entry_safe(pos, tmp, xskb_list, list_node) {
if (list_is_singular(xskb_list))
contd = 0;
len = pos->xdp.data_end - pos->xdp.data;
- err = __xsk_rcv_zc(xs, pos, len, contd);
- if (err)
- goto err;
+ __xsk_rcv_zc(xs, pos, len, contd);
list_del_init(&pos->list_node);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 213/311] dpaa2-switch: Fix interrupt storm after receiving bad if_id in IRQ handler
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (211 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 212/311] xsk: Fix zero-copy AF_XDP fragment drop Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 214/311] atm: lec: fix null-ptr-deref in lec_arp_clear_vccs Sasha Levin
` (111 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Guenter Roeck, Junrui Luo, Ioana Ciornei, Jakub Kicinski,
Sasha Levin
From: Guenter Roeck <linux@roeck-us.net>
[ Upstream commit 74badb9c20b1a9c02a95c735c6d3cd6121679c93 ]
Commit 31a7a0bbeb00 ("dpaa2-switch: add bounds check for if_id in IRQ
handler") introduces a range check for if_id to avoid an out-of-bounds
access. If an out-of-bounds if_id is detected, the interrupt status is
not cleared. This may result in an interrupt storm.
Clear the interrupt status after detecting an out-of-bounds if_id to avoid
the problem.
Found by an experimental AI code review agent at Google.
Fixes: 31a7a0bbeb00 ("dpaa2-switch: add bounds check for if_id in IRQ handler")
Cc: Junrui Luo <moonafterrain@outlook.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://patch.msgid.link/20260227055812.1777915-1-linux@roeck-us.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
index 78e21b46a5ba8..e212a014c8d41 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c
@@ -1533,7 +1533,7 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg)
if_id = (status & 0xFFFF0000) >> 16;
if (if_id >= ethsw->sw_attr.num_ifs) {
dev_err(dev, "Invalid if_id %d in IRQ status\n", if_id);
- goto out;
+ goto out_clear;
}
port_priv = ethsw->ports[if_id];
@@ -1553,6 +1553,7 @@ static irqreturn_t dpaa2_switch_irq0_handler_thread(int irq_num, void *arg)
dpaa2_switch_port_connect_mac(port_priv);
}
+out_clear:
err = dpsw_clear_irq_status(ethsw->mc_io, 0, ethsw->dpsw_handle,
DPSW_IRQ_INDEX_IF, status);
if (err)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 214/311] atm: lec: fix null-ptr-deref in lec_arp_clear_vccs
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (212 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 213/311] dpaa2-switch: Fix interrupt storm after receiving bad if_id in IRQ handler Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 215/311] net: ti: icssg-prueth: Fix ping failure after offload mode setup when link speed is not 1G Sasha Levin
` (110 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Jiayuan Chen, syzbot+72e3ea390c305de0e259, Dan Carpenter,
Simon Horman, Jakub Kicinski, Sasha Levin
From: Jiayuan Chen <jiayuan.chen@shopee.com>
[ Upstream commit 101bacb303e89dc2e0640ae6a5e0fb97c4eb45bb ]
syzkaller reported a null-ptr-deref in lec_arp_clear_vccs().
This issue can be easily reproduced using the syzkaller reproducer.
In the ATM LANE (LAN Emulation) module, the same atm_vcc can be shared by
multiple lec_arp_table entries (e.g., via entry->vcc or entry->recv_vcc).
When the underlying VCC is closed, lec_vcc_close() iterates over all
ARP entries and calls lec_arp_clear_vccs() for each matched entry.
For example, when lec_vcc_close() iterates through the hlists in
priv->lec_arp_empty_ones or other ARP tables:
1. In the first iteration, for the first matched ARP entry sharing the VCC,
lec_arp_clear_vccs() frees the associated vpriv (which is vcc->user_back)
and sets vcc->user_back to NULL.
2. In the second iteration, for the next matched ARP entry sharing the same
VCC, lec_arp_clear_vccs() is called again. It obtains a NULL vpriv from
vcc->user_back (via LEC_VCC_PRIV(vcc)) and then attempts to dereference it
via `vcc->pop = vpriv->old_pop`, leading to a null-ptr-deref crash.
Fix this by adding a null check for vpriv before dereferencing
it. If vpriv is already NULL, it means the VCC has been cleared
by a previous call, so we can safely skip the cleanup and just
clear the entry's vcc/recv_vcc pointers.
The entire cleanup block (including vcc_release_async()) is placed inside
the vpriv guard because a NULL vpriv indicates the VCC has already been
fully released by a prior iteration — repeating the teardown would
redundantly set flags and trigger callbacks on an already-closing socket.
The Fixes tag points to the initial commit because the entry->vcc path has
been vulnerable since the original code. The entry->recv_vcc path was later
added by commit 8d9f73c0ad2f ("atm: fix a memory leak of vcc->user_back")
with the same pattern, and both paths are fixed here.
Reported-by: syzbot+72e3ea390c305de0e259@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/68c95a83.050a0220.3c6139.0e5c.GAE@google.com/T/
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com>
Link: https://patch.msgid.link/20260225123250.189289-1-jiayuan.chen@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/atm/lec.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/net/atm/lec.c b/net/atm/lec.c
index afb8d3eb21850..c39dc5d367979 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1260,24 +1260,28 @@ static void lec_arp_clear_vccs(struct lec_arp_table *entry)
struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc);
struct net_device *dev = (struct net_device *)vcc->proto_data;
- vcc->pop = vpriv->old_pop;
- if (vpriv->xoff)
- netif_wake_queue(dev);
- kfree(vpriv);
- vcc->user_back = NULL;
- vcc->push = entry->old_push;
- vcc_release_async(vcc, -EPIPE);
+ if (vpriv) {
+ vcc->pop = vpriv->old_pop;
+ if (vpriv->xoff)
+ netif_wake_queue(dev);
+ kfree(vpriv);
+ vcc->user_back = NULL;
+ vcc->push = entry->old_push;
+ vcc_release_async(vcc, -EPIPE);
+ }
entry->vcc = NULL;
}
if (entry->recv_vcc) {
struct atm_vcc *vcc = entry->recv_vcc;
struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc);
- kfree(vpriv);
- vcc->user_back = NULL;
+ if (vpriv) {
+ kfree(vpriv);
+ vcc->user_back = NULL;
- entry->recv_vcc->push = entry->old_recv_push;
- vcc_release_async(entry->recv_vcc, -EPIPE);
+ entry->recv_vcc->push = entry->old_recv_push;
+ vcc_release_async(entry->recv_vcc, -EPIPE);
+ }
entry->recv_vcc = NULL;
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 215/311] net: ti: icssg-prueth: Fix ping failure after offload mode setup when link speed is not 1G
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (213 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 214/311] atm: lec: fix null-ptr-deref in lec_arp_clear_vccs Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 216/311] amd-xgbe: fix MAC_TCR_SS register width for 2.5G and 10M speeds Sasha Levin
` (109 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: MD Danish Anwar, Jakub Kicinski, Sasha Levin
From: MD Danish Anwar <danishanwar@ti.com>
[ Upstream commit 147792c395db870756a0dc87ce656c75ae7ab7e8 ]
When both eth interfaces with links up are added to a bridge or hsr
interface, ping fails if the link speed is not 1Gbps (e.g., 100Mbps).
The issue is seen because when switching to offload (bridge/hsr) mode,
prueth_emac_restart() restarts the firmware and clears DRAM with
memset_io(), setting all memory to 0. This includes PORT_LINK_SPEED_OFFSET
which firmware reads for link speed. The value 0 corresponds to
FW_LINK_SPEED_1G (0x00), so for 1Gbps links the default value is correct
and ping works. For 100Mbps links, the firmware needs FW_LINK_SPEED_100M
(0x01) but gets 0 instead, causing ping to fail. The function
emac_adjust_link() is called to reconfigure, but it detects no state change
(emac->link is still 1, speed/duplex match PHY) so new_state remains false
and icssg_config_set_speed() is never called to correct the firmware speed
value.
The fix resets emac->link to 0 before calling emac_adjust_link() in
prueth_emac_common_start(). This forces new_state=true, ensuring
icssg_config_set_speed() is called to write the correct speed value to
firmware memory.
Fixes: 06feac15406f ("net: ti: icssg-prueth: Fix emac link speed handling")
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Link: https://patch.msgid.link/20260226102356.2141871-1-danishanwar@ti.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/ti/icssg/icssg_prueth.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/ti/icssg/icssg_prueth.c b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
index f65041662173c..2c6e161225f6a 100644
--- a/drivers/net/ethernet/ti/icssg/icssg_prueth.c
+++ b/drivers/net/ethernet/ti/icssg/icssg_prueth.c
@@ -273,6 +273,14 @@ static int prueth_emac_common_start(struct prueth *prueth)
if (ret)
goto disable_class;
+ /* Reset link state to force reconfiguration in
+ * emac_adjust_link(). Without this, if the link was already up
+ * before restart, emac_adjust_link() won't detect any state
+ * change and will skip critical configuration like writing
+ * speed to firmware.
+ */
+ emac->link = 0;
+
mutex_lock(&emac->ndev->phydev->lock);
emac_adjust_link(emac->ndev);
mutex_unlock(&emac->ndev->phydev->lock);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 216/311] amd-xgbe: fix MAC_TCR_SS register width for 2.5G and 10M speeds
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (214 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 215/311] net: ti: icssg-prueth: Fix ping failure after offload mode setup when link speed is not 1G Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 217/311] regulator: mt6363: Fix incorrect and redundant IRQ disposal in probe Sasha Levin
` (108 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Raju Rangoju, Guruvendra Punugupati, Jakub Kicinski, Sasha Levin
From: Raju Rangoju <Raju.Rangoju@amd.com>
[ Upstream commit 9439a661c2e80485406ce2c90b107ca17858382d ]
Extend the MAC_TCR_SS (Speed Select) register field width from 2 bits
to 3 bits to properly support all speed settings.
The MAC_TCR register's SS field encoding requires 3 bits to represent
all supported speeds:
- 0x00: 10Gbps (XGMII)
- 0x02: 2.5Gbps (GMII) / 100Mbps
- 0x03: 1Gbps / 10Mbps
- 0x06: 2.5Gbps (XGMII) - P100a only
With only 2 bits, values 0x04-0x07 cannot be represented, which breaks
2.5G XGMII mode on newer platforms and causes incorrect speed select
values to be programmed.
Fixes: 07445f3c7ca1 ("amd-xgbe: Add support for 10 Mbps speed")
Co-developed-by: Guruvendra Punugupati <Guruvendra.Punugupati@amd.com>
Signed-off-by: Guruvendra Punugupati <Guruvendra.Punugupati@amd.com>
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
Link: https://patch.msgid.link/20260226170753.250312-1-Raju.Rangoju@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/amd/xgbe/xgbe-common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-common.h b/drivers/net/ethernet/amd/xgbe/xgbe-common.h
index 62b01de93db49..826c5caa70d71 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-common.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-common.h
@@ -431,7 +431,7 @@
#define MAC_SSIR_SSINC_INDEX 16
#define MAC_SSIR_SSINC_WIDTH 8
#define MAC_TCR_SS_INDEX 29
-#define MAC_TCR_SS_WIDTH 2
+#define MAC_TCR_SS_WIDTH 3
#define MAC_TCR_TE_INDEX 0
#define MAC_TCR_TE_WIDTH 1
#define MAC_TCR_VNE_INDEX 24
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 217/311] regulator: mt6363: Fix incorrect and redundant IRQ disposal in probe
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (215 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 216/311] amd-xgbe: fix MAC_TCR_SS register width for 2.5G and 10M speeds Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 218/311] can: bcm: fix locking for bcm_op runtime updates Sasha Levin
` (107 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Felix Gu, Mark Brown, Sasha Levin
From: Felix Gu <ustc.gu@gmail.com>
[ Upstream commit 23942b71f07cc99e39d9216a5b370df494759d8c ]
In mt6363_regulator_probe(), devm_add_action_or_reset() is used to
automatically dispose of the IRQ mapping if the probe fails or the
device is removed.
The manual call to irq_dispose_mapping() in the error path was redundant
as the reset action already triggers mt6363_irq_remove(). Furthermore,
the manual call incorrectly passed the hardware IRQ number (info->hwirq)
instead of the virtual IRQ mapping (info->virq).
Remove the redundant and incorrect manual disposal.
Fixes: 3c36965df808 ("regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators")
Signed-off-by: Felix Gu <ustc.gu@gmail.com>
Link: https://patch.msgid.link/20260223-mt6363-v1-1-c99a2e8ac621@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/regulator/mt6363-regulator.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/regulator/mt6363-regulator.c b/drivers/regulator/mt6363-regulator.c
index 03af5fa536007..0aebcbda0a196 100644
--- a/drivers/regulator/mt6363-regulator.c
+++ b/drivers/regulator/mt6363-regulator.c
@@ -899,10 +899,8 @@ static int mt6363_regulator_probe(struct platform_device *pdev)
"Failed to map IRQ%d\n", info->hwirq);
ret = devm_add_action_or_reset(dev, mt6363_irq_remove, &info->virq);
- if (ret) {
- irq_dispose_mapping(info->hwirq);
+ if (ret)
return ret;
- }
config.driver_data = info;
INIT_DELAYED_WORK(&info->oc_work, mt6363_oc_irq_enable_work);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 218/311] can: bcm: fix locking for bcm_op runtime updates
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (216 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 217/311] regulator: mt6363: Fix incorrect and redundant IRQ disposal in probe Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 219/311] can: dummy_can: dummy_can_init(): fix packet statistics Sasha Levin
` (106 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Oliver Hartkopp, syzbot+5b11eccc403dd1cea9f8, Marc Kleine-Budde,
Sasha Levin
From: Oliver Hartkopp <socketcan@hartkopp.net>
[ Upstream commit c35636e91e392e1540949bbc67932167cb48bc3a ]
Commit c2aba69d0c36 ("can: bcm: add locking for bcm_op runtime updates")
added a locking for some variables that can be modified at runtime when
updating the sending bcm_op with a new TX_SETUP command in bcm_tx_setup().
Usually the RX_SETUP only handles and filters incoming traffic with one
exception: When the RX_RTR_FRAME flag is set a predefined CAN frame is
sent when a specific RTR frame is received. Therefore the rx bcm_op uses
bcm_can_tx() which uses the bcm_tx_lock that was only initialized in
bcm_tx_setup(). Add the missing spin_lock_init() when allocating the
bcm_op in bcm_rx_setup() to handle the RTR case properly.
Fixes: c2aba69d0c36 ("can: bcm: add locking for bcm_op runtime updates")
Reported-by: syzbot+5b11eccc403dd1cea9f8@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/linux-can/699466e4.a70a0220.2c38d7.00ff.GAE@google.com/
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://patch.msgid.link/20260218-bcm_spin_lock_init-v1-1-592634c8a5b5@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/can/bcm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 7eba8ae01a5b1..ba65e6e8a923a 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -1170,6 +1170,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
if (!op)
return -ENOMEM;
+ spin_lock_init(&op->bcm_tx_lock);
op->can_id = msg_head->can_id;
op->nframes = msg_head->nframes;
op->cfsiz = CFSIZ(msg_head->flags);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 219/311] can: dummy_can: dummy_can_init(): fix packet statistics
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (217 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 218/311] can: bcm: fix locking for bcm_op runtime updates Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 220/311] can: mcp251x: fix deadlock in error path of mcp251x_open Sasha Levin
` (105 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Oliver Hartkopp, Vincent Mailhol, Marc Kleine-Budde, Sasha Levin
From: Oliver Hartkopp <socketcan@hartkopp.net>
[ Upstream commit c77bfbdd6aac31b152ee81522cd90ad1de18738f ]
The former implementation was only counting the tx_packets value but not
the tx_bytes as the skb was dropped on driver layer.
Enable CAN echo support (IFF_ECHO) in dummy_can_init(), which activates the
code for setting and retrieving the echo SKB and counts the tx_bytes
correctly.
Fixes: 816cf430e84b ("can: add dummy_can driver")
Cc: Vincent Mailhol <mailhol@kernel.org>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Reviewed-by: Vincent Mailhol <mailhol@kernel.org>
Link: https://patch.msgid.link/20260126104540.21024-1-socketcan@hartkopp.net
[mkl: make commit message imperative]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/can/dummy_can.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/can/dummy_can.c b/drivers/net/can/dummy_can.c
index 41953655e3d3c..cd23de488edce 100644
--- a/drivers/net/can/dummy_can.c
+++ b/drivers/net/can/dummy_can.c
@@ -241,6 +241,7 @@ static int __init dummy_can_init(void)
dev->netdev_ops = &dummy_can_netdev_ops;
dev->ethtool_ops = &dummy_can_ethtool_ops;
+ dev->flags |= IFF_ECHO; /* enable echo handling */
priv = netdev_priv(dev);
priv->can.bittiming_const = &dummy_can_bittiming_const;
priv->can.bitrate_max = 20 * MEGA /* BPS */;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 220/311] can: mcp251x: fix deadlock in error path of mcp251x_open
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (218 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 219/311] can: dummy_can: dummy_can_init(): fix packet statistics Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 221/311] wifi: rsi: Don't default to -EOPNOTSUPP in rsi_mac80211_config Sasha Levin
` (104 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Alban Bedel, Marc Kleine-Budde, Sasha Levin
From: Alban Bedel <alban.bedel@lht.dlh.de>
[ Upstream commit ab3f894de216f4a62adc3b57e9191888cbf26885 ]
The mcp251x_open() function call free_irq() in its error path with the
mpc_lock mutex held. But if an interrupt already occurred the
interrupt handler will be waiting for the mpc_lock and free_irq() will
deadlock waiting for the handler to finish.
This issue is similar to the one fixed in commit 7dd9c26bd6cf ("can:
mcp251x: fix deadlock if an interrupt occurs during mcp251x_open") but
for the error path.
To solve this issue move the call to free_irq() after the lock is
released. Setting `priv->force_quit = 1` beforehand ensure that the IRQ
handler will exit right away once it acquired the lock.
Signed-off-by: Alban Bedel <alban.bedel@lht.dlh.de>
Link: https://patch.msgid.link/20260209144706.2261954-1-alban.bedel@lht.dlh.de
Fixes: bf66f3736a94 ("can: mcp251x: Move to threaded interrupts instead of workqueues.")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/can/spi/mcp251x.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index fa97adf25b734..bb7782582f401 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -1214,6 +1214,7 @@ static int mcp251x_open(struct net_device *net)
{
struct mcp251x_priv *priv = netdev_priv(net);
struct spi_device *spi = priv->spi;
+ bool release_irq = false;
unsigned long flags = 0;
int ret;
@@ -1257,12 +1258,24 @@ static int mcp251x_open(struct net_device *net)
return 0;
out_free_irq:
- free_irq(spi->irq, priv);
+ /* The IRQ handler might be running, and if so it will be waiting
+ * for the lock. But free_irq() must wait for the handler to finish
+ * so calling it here would deadlock.
+ *
+ * Setting priv->force_quit will let the handler exit right away
+ * without any access to the hardware. This make it safe to call
+ * free_irq() after the lock is released.
+ */
+ priv->force_quit = 1;
+ release_irq = true;
+
mcp251x_hw_sleep(spi);
out_close:
mcp251x_power_enable(priv->transceiver, 0);
close_candev(net);
mutex_unlock(&priv->mcp_lock);
+ if (release_irq)
+ free_irq(spi->irq, priv);
return ret;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 221/311] wifi: rsi: Don't default to -EOPNOTSUPP in rsi_mac80211_config
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (219 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 220/311] can: mcp251x: fix deadlock in error path of mcp251x_open Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 222/311] drm/syncobj: Fix handle <-> fd ioctls with dirty stack Sasha Levin
` (103 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Sebastian Krzyszkowiak, Johannes Berg, Sasha Levin
From: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
[ Upstream commit d973b1039ccde6b241b438d53297edce4de45b5c ]
This triggers a WARN_ON in ieee80211_hw_conf_init and isn't the expected
behavior from the driver - other drivers default to 0 too.
Fixes: 0a44dfc07074 ("wifi: mac80211: simplify non-chanctx drivers")
Signed-off-by: Sebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Link: https://patch.msgid.link/20260221-rsi-config-ret-v1-1-9a8f805e2f31@puri.sm
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index 8c8e074a3a705..c7ae8031436ae 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -668,7 +668,7 @@ static int rsi_mac80211_config(struct ieee80211_hw *hw,
struct rsi_hw *adapter = hw->priv;
struct rsi_common *common = adapter->priv;
struct ieee80211_conf *conf = &hw->conf;
- int status = -EOPNOTSUPP;
+ int status = 0;
mutex_lock(&common->mutex);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 222/311] drm/syncobj: Fix handle <-> fd ioctls with dirty stack
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (220 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 221/311] wifi: rsi: Don't default to -EOPNOTSUPP in rsi_mac80211_config Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 223/311] drm/xe: Do not preempt fence signaling CS instructions Sasha Levin
` (102 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Julian Orth, Christian König, Sasha Levin
From: Julian Orth <ju.orth@gmail.com>
[ Upstream commit 2e3649e237237258a08d75afef96648dd2b379f7 ]
Consider the following application:
#include <fcntl.h>
#include <string.h>
#include <drm/drm.h>
#include <sys/ioctl.h>
int main(void) {
int fd = open("/dev/dri/renderD128", O_RDWR);
struct drm_syncobj_create arg1;
ioctl(fd, DRM_IOCTL_SYNCOBJ_CREATE, &arg1);
struct drm_syncobj_handle arg2;
memset(&arg2, 1, sizeof(arg2)); // simulate dirty stack
arg2.handle = arg1.handle;
arg2.flags = 0;
arg2.fd = 0;
arg2.pad = 0;
// arg2.point = 0; // userspace is required to set point to 0
ioctl(fd, DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD, &arg2);
}
The last ioctl returns EINVAL because args->point is not 0. However,
userspace developed against older kernel versions is not aware of the
new point field and might therefore not initialize it.
The correct check would be
if (args->flags & DRM_SYNCOBJ_FD_TO_HANDLE_FLAGS_TIMELINE)
return -EINVAL;
However, there might already be userspace that relies on this not
returning an error as long as point == 0. Therefore use the more lenient
check.
Fixes: c2d3a7300695 ("drm/syncobj: Extend EXPORT_SYNC_FILE for timeline syncobjs")
Signed-off-by: Julian Orth <ju.orth@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://lore.kernel.org/r/20260301-point-v1-1-21fc5fd98614@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_syncobj.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index e1b0fa4000cdd..7eb2cdbc574a0 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -900,7 +900,7 @@ drm_syncobj_handle_to_fd_ioctl(struct drm_device *dev, void *data,
return drm_syncobj_export_sync_file(file_private, args->handle,
point, &args->fd);
- if (args->point)
+ if (point)
return -EINVAL;
return drm_syncobj_handle_to_fd(file_private, args->handle,
@@ -934,7 +934,7 @@ drm_syncobj_fd_to_handle_ioctl(struct drm_device *dev, void *data,
args->handle,
point);
- if (args->point)
+ if (point)
return -EINVAL;
return drm_syncobj_fd_to_handle(file_private, args->fd,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 223/311] drm/xe: Do not preempt fence signaling CS instructions
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (221 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 222/311] drm/syncobj: Fix handle <-> fd ioctls with dirty stack Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 224/311] drm/xe/configfs: Free ctx_restore_mid_bb in release Sasha Levin
` (101 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Matthew Brost, Daniele Ceraolo Spurio, Carlos Santa, Rodrigo Vivi,
Sasha Levin
From: Matthew Brost <matthew.brost@intel.com>
[ Upstream commit cdc8a1e11f4d5b480ec750e28010c357185b95a6 ]
If a batch buffer is complete, it makes little sense to preempt the
fence signaling instructions in the ring, as the largest portion of the
work (the batch buffer) is already done and fence signaling consists of
only a few instructions. If these instructions are preempted, the GuC
would need to perform a context switch just to signal the fence, which
is costly and delays fence signaling. Avoid this scenario by disabling
preemption immediately after the BB start instruction and re-enabling it
after executing the fence signaling instructions.
Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Carlos Santa <carlos.santa@intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patch.msgid.link/20260115004546.58060-1-matthew.brost@intel.com
(cherry picked from commit 2bcbf2dcde0c839a73af664a3c77d4e77d58a3eb)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_ring_ops.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_ring_ops.c b/drivers/gpu/drm/xe/xe_ring_ops.c
index ac0c6dcffe156..803c652f5af91 100644
--- a/drivers/gpu/drm/xe/xe_ring_ops.c
+++ b/drivers/gpu/drm/xe/xe_ring_ops.c
@@ -267,6 +267,9 @@ static void __emit_job_gen12_simple(struct xe_sched_job *job, struct xe_lrc *lrc
i = emit_bb_start(batch_addr, ppgtt_flag, dw, i);
+ /* Don't preempt fence signaling */
+ dw[i++] = MI_ARB_ON_OFF | MI_ARB_DISABLE;
+
if (job->user_fence.used) {
i = emit_flush_dw(dw, i);
i = emit_store_imm_ppgtt_posted(job->user_fence.addr,
@@ -332,6 +335,9 @@ static void __emit_job_gen12_video(struct xe_sched_job *job, struct xe_lrc *lrc,
i = emit_bb_start(batch_addr, ppgtt_flag, dw, i);
+ /* Don't preempt fence signaling */
+ dw[i++] = MI_ARB_ON_OFF | MI_ARB_DISABLE;
+
if (job->user_fence.used) {
i = emit_flush_dw(dw, i);
i = emit_store_imm_ppgtt_posted(job->user_fence.addr,
@@ -384,6 +390,9 @@ static void __emit_job_gen12_render_compute(struct xe_sched_job *job,
i = emit_bb_start(batch_addr, ppgtt_flag, dw, i);
+ /* Don't preempt fence signaling */
+ dw[i++] = MI_ARB_ON_OFF | MI_ARB_DISABLE;
+
i = emit_render_cache_flush(job, dw, i);
if (job->user_fence.used)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 224/311] drm/xe/configfs: Free ctx_restore_mid_bb in release
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (222 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 223/311] drm/xe: Do not preempt fence signaling CS instructions Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 225/311] drm/xe/queue: Call fini on exec queue creation fail Sasha Levin
` (100 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Shuicheng Lin, Nitin Gote, Matt Roper, Rodrigo Vivi, Sasha Levin
From: Shuicheng Lin <shuicheng.lin@intel.com>
[ Upstream commit e377182f0266f46f02d01838e6bde67b9dac0d66 ]
ctx_restore_mid_bb memory is allocated in wa_bb_store(), but
xe_config_device_release() only frees ctx_restore_post_bb.
Free ctx_restore_mid_bb[0].cs as well to avoid leaking the allocation
when the configfs device is removed.
Fixes: b30d5de3d40c ("drm/xe/configfs: Add mid context restore bb")
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Nitin Gote <nitin.r.gote@intel.com>
Link: https://patch.msgid.link/20260225013448.3547687-2-shuicheng.lin@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit a235e7d0098337c3f2d1e8f3610c719a589e115f)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_configfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c
index 82edd04660055..4afdfd69899aa 100644
--- a/drivers/gpu/drm/xe/xe_configfs.c
+++ b/drivers/gpu/drm/xe/xe_configfs.c
@@ -830,6 +830,7 @@ static void xe_config_device_release(struct config_item *item)
mutex_destroy(&dev->lock);
+ kfree(dev->config.ctx_restore_mid_bb[0].cs);
kfree(dev->config.ctx_restore_post_bb[0].cs);
kfree(dev);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 225/311] drm/xe/queue: Call fini on exec queue creation fail
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (223 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 224/311] drm/xe/configfs: Free ctx_restore_mid_bb in release Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 226/311] blktrace: fix __this_cpu_read/write in preemptible context Sasha Levin
` (99 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Tomasz Lis, Matthew Brost, Michal Wajdeczko, Rodrigo Vivi,
Sasha Levin
From: Tomasz Lis <tomasz.lis@intel.com>
[ Upstream commit 99f9b5343cae80eb0dfe050baf6c86d722b3ba2e ]
Every call to queue init should have a corresponding fini call.
Skipping this would mean skipping removal of the queue from GuC list
(which is part of guc_id allocation). A damaged queue stored in
exec_queue_lookup list would lead to invalid memory reference,
sooner or later.
Call fini to free guc_id. This must be done before any internal
LRCs are freed.
Since the finalization with this extra call became very similar to
__xe_exec_queue_fini(), reuse that. To make this reuse possible,
alter xe_lrc_put() so it can survive NULL parameters, like other
similar functions.
v2: Reuse _xe_exec_queue_fini(). Make xe_lrc_put() aware of NULLs.
Fixes: 3c1fa4aa60b1 ("drm/xe: Move queue init before LRC creation")
Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com> (v1)
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patch.msgid.link/20260226212701.2937065-2-tomasz.lis@intel.com
(cherry picked from commit 393e5fea6f7d7054abc2c3d97a4cfe8306cd6079)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_exec_queue.c | 23 +++++++++++------------
drivers/gpu/drm/xe/xe_lrc.h | 3 ++-
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
index 779d7e7e2d2ec..1e774fa1fa190 100644
--- a/drivers/gpu/drm/xe/xe_exec_queue.c
+++ b/drivers/gpu/drm/xe/xe_exec_queue.c
@@ -185,6 +185,16 @@ static struct xe_exec_queue *__xe_exec_queue_alloc(struct xe_device *xe,
return q;
}
+static void __xe_exec_queue_fini(struct xe_exec_queue *q)
+{
+ int i;
+
+ q->ops->fini(q);
+
+ for (i = 0; i < q->width; ++i)
+ xe_lrc_put(q->lrc[i]);
+}
+
static int __xe_exec_queue_init(struct xe_exec_queue *q, u32 exec_queue_flags)
{
int i, err;
@@ -239,21 +249,10 @@ static int __xe_exec_queue_init(struct xe_exec_queue *q, u32 exec_queue_flags)
return 0;
err_lrc:
- for (i = i - 1; i >= 0; --i)
- xe_lrc_put(q->lrc[i]);
+ __xe_exec_queue_fini(q);
return err;
}
-static void __xe_exec_queue_fini(struct xe_exec_queue *q)
-{
- int i;
-
- q->ops->fini(q);
-
- for (i = 0; i < q->width; ++i)
- xe_lrc_put(q->lrc[i]);
-}
-
struct xe_exec_queue *xe_exec_queue_create(struct xe_device *xe, struct xe_vm *vm,
u32 logical_mask, u16 width,
struct xe_hw_engine *hwe, u32 flags,
diff --git a/drivers/gpu/drm/xe/xe_lrc.h b/drivers/gpu/drm/xe/xe_lrc.h
index 2fb628da5c433..96ae31df3359f 100644
--- a/drivers/gpu/drm/xe/xe_lrc.h
+++ b/drivers/gpu/drm/xe/xe_lrc.h
@@ -73,7 +73,8 @@ static inline struct xe_lrc *xe_lrc_get(struct xe_lrc *lrc)
*/
static inline void xe_lrc_put(struct xe_lrc *lrc)
{
- kref_put(&lrc->refcount, xe_lrc_destroy);
+ if (lrc)
+ kref_put(&lrc->refcount, xe_lrc_destroy);
}
/**
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 226/311] blktrace: fix __this_cpu_read/write in preemptible context
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (224 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 225/311] drm/xe/queue: Call fini on exec queue creation fail Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 227/311] rust: kunit: fix warning when !CONFIG_PRINTK Sasha Levin
` (98 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Chaitanya Kulkarni, Shinichiro Kawasaki, Steven Rostedt,
Jens Axboe, Sasha Levin
From: Chaitanya Kulkarni <kch@nvidia.com>
[ Upstream commit da46b5dfef48658d03347cda21532bcdbb521e67 ]
tracing_record_cmdline() internally uses __this_cpu_read() and
__this_cpu_write() on the per-CPU variable trace_cmdline_save, and
trace_save_cmdline() explicitly asserts preemption is disabled via
lockdep_assert_preemption_disabled(). These operations are only safe
when preemption is off, as they were designed to be called from the
scheduler context (probe_wakeup_sched_switch() / probe_wakeup()).
__blk_add_trace() was calling tracing_record_cmdline(current) early in
the blk_tracer path, before ring buffer reservation, from process
context where preemption is fully enabled. This triggers the following
using blktests/blktrace/002:
blktrace/002 (blktrace ftrace corruption with sysfs trace) [failed]
runtime 0.367s ... 0.437s
something found in dmesg:
[ 81.211018] run blktests blktrace/002 at 2026-02-25 22:24:33
[ 81.239580] null_blk: disk nullb1 created
[ 81.357294] BUG: using __this_cpu_read() in preemptible [00000000] code: dd/2516
[ 81.362842] caller is tracing_record_cmdline+0x10/0x40
[ 81.362872] CPU: 16 UID: 0 PID: 2516 Comm: dd Tainted: G N 7.0.0-rc1lblk+ #84 PREEMPT(full)
[ 81.362877] Tainted: [N]=TEST
[ 81.362878] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 04/01/2014
[ 81.362881] Call Trace:
[ 81.362884] <TASK>
[ 81.362886] dump_stack_lvl+0x8d/0xb0
...
(See '/mnt/sda/blktests/results/nodev/blktrace/002.dmesg' for the entire message)
[ 81.211018] run blktests blktrace/002 at 2026-02-25 22:24:33
[ 81.239580] null_blk: disk nullb1 created
[ 81.357294] BUG: using __this_cpu_read() in preemptible [00000000] code: dd/2516
[ 81.362842] caller is tracing_record_cmdline+0x10/0x40
[ 81.362872] CPU: 16 UID: 0 PID: 2516 Comm: dd Tainted: G N 7.0.0-rc1lblk+ #84 PREEMPT(full)
[ 81.362877] Tainted: [N]=TEST
[ 81.362878] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.17.0-0-gb52ca86e094d-prebuilt.qemu.org 04/01/2014
[ 81.362881] Call Trace:
[ 81.362884] <TASK>
[ 81.362886] dump_stack_lvl+0x8d/0xb0
[ 81.362895] check_preemption_disabled+0xce/0xe0
[ 81.362902] tracing_record_cmdline+0x10/0x40
[ 81.362923] __blk_add_trace+0x307/0x5d0
[ 81.362934] ? lock_acquire+0xe0/0x300
[ 81.362940] ? iov_iter_extract_pages+0x101/0xa30
[ 81.362959] blk_add_trace_bio+0x106/0x1e0
[ 81.362968] submit_bio_noacct_nocheck+0x24b/0x3a0
[ 81.362979] ? lockdep_init_map_type+0x58/0x260
[ 81.362988] submit_bio_wait+0x56/0x90
[ 81.363009] __blkdev_direct_IO_simple+0x16c/0x250
[ 81.363026] ? __pfx_submit_bio_wait_endio+0x10/0x10
[ 81.363038] ? rcu_read_lock_any_held+0x73/0xa0
[ 81.363051] blkdev_read_iter+0xc1/0x140
[ 81.363059] vfs_read+0x20b/0x330
[ 81.363083] ksys_read+0x67/0xe0
[ 81.363090] do_syscall_64+0xbf/0xf00
[ 81.363102] entry_SYSCALL_64_after_hwframe+0x76/0x7e
[ 81.363106] RIP: 0033:0x7f281906029d
[ 81.363111] Code: 31 c0 e9 c6 fe ff ff 50 48 8d 3d 66 63 0a 00 e8 59 ff 01 00 66 0f 1f 84 00 00 00 00 00 80 3d 41 33 0e 00 00 74 17 31 c0 0f 05 <48> 3d 00 f0 ff ff 77 5b c3 66 2e 0f 1f 84 00 00 00 00 00 48 83 ec
[ 81.363113] RSP: 002b:00007ffca127dd48 EFLAGS: 00000246 ORIG_RAX: 0000000000000000
[ 81.363120] RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f281906029d
[ 81.363122] RDX: 0000000000001000 RSI: 0000559f8bfae000 RDI: 0000000000000000
[ 81.363123] RBP: 0000000000001000 R08: 0000002863a10a81 R09: 00007f281915f000
[ 81.363124] R10: 00007f2818f77b60 R11: 0000000000000246 R12: 0000559f8bfae000
[ 81.363126] R13: 0000000000000000 R14: 0000000000000000 R15: 000000000000000a
[ 81.363142] </TASK>
The same BUG fires from blk_add_trace_plug(), blk_add_trace_unplug(),
and blk_add_trace_rq() paths as well.
The purpose of tracing_record_cmdline() is to cache the task->comm for
a given PID so that the trace can later resolve it. It is only
meaningful when a trace event is actually being recorded. Ring buffer
reservation via ring_buffer_lock_reserve() disables preemption, and
preemption remains disabled until the event is committed :-
__blk_add_trace()
__trace_buffer_lock_reserve()
__trace_buffer_lock_reserve()
ring_buffer_lock_reserve()
preempt_disable_notrace(); <---
With this fix blktests for blktrace pass:
blktests (master) # ./check blktrace
blktrace/001 (blktrace zone management command tracing) [passed]
runtime 3.650s ... 3.647s
blktrace/002 (blktrace ftrace corruption with sysfs trace) [passed]
runtime 0.411s ... 0.384s
Fixes: 7ffbd48d5cab ("tracing: Cache comms only after an event occurred")
Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/blktrace.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index c4db5c2e71037..0548e64b08f23 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -383,8 +383,6 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
cpu = raw_smp_processor_id();
if (blk_tracer) {
- tracing_record_cmdline(current);
-
buffer = blk_tr->array_buffer.buffer;
trace_ctx = tracing_gen_ctx_flags(0);
switch (bt->version) {
@@ -419,6 +417,7 @@ static void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
if (!event)
return;
+ tracing_record_cmdline(current);
switch (bt->version) {
case 1:
record_blktrace_event(ring_buffer_event_data(event),
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 227/311] rust: kunit: fix warning when !CONFIG_PRINTK
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (225 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 226/311] blktrace: fix __this_cpu_read/write in preemptible context Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 228/311] kunit: tool: copy caller args in run_kernel to prevent mutation Sasha Levin
` (97 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Alexandre Courbot, Alice Ryhl, David Gow, Shuah Khan, Sasha Levin
From: Alexandre Courbot <acourbot@nvidia.com>
[ Upstream commit 7dd34dfc8dfa92a7244242098110388367996ac3 ]
If `CONFIG_PRINTK` is not set, then the following warnings are issued
during build:
warning: unused variable: `args`
--> ../rust/kernel/kunit.rs:16:12
|
16 | pub fn err(args: fmt::Arguments<'_>) {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_args`
|
= note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default
warning: unused variable: `args`
--> ../rust/kernel/kunit.rs:32:13
|
32 | pub fn info(args: fmt::Arguments<'_>) {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_args`
Fix this by adding a no-op assignment using `args` when `CONFIG_PRINTK`
is not set.
Fixes: a66d733da801 ("rust: support running Rust documentation tests as KUnit ones")
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: David Gow <david@davidgow.net>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
rust/kernel/kunit.rs | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/rust/kernel/kunit.rs b/rust/kernel/kunit.rs
index 79436509dd73d..8907b6f89ece5 100644
--- a/rust/kernel/kunit.rs
+++ b/rust/kernel/kunit.rs
@@ -17,6 +17,10 @@
/// Public but hidden since it should only be used from KUnit generated code.
#[doc(hidden)]
pub fn err(args: fmt::Arguments<'_>) {
+ // `args` is unused if `CONFIG_PRINTK` is not set - this avoids a build-time warning.
+ #[cfg(not(CONFIG_PRINTK))]
+ let _ = args;
+
// SAFETY: The format string is null-terminated and the `%pA` specifier matches the argument we
// are passing.
#[cfg(CONFIG_PRINTK)]
@@ -33,6 +37,10 @@ pub fn err(args: fmt::Arguments<'_>) {
/// Public but hidden since it should only be used from KUnit generated code.
#[doc(hidden)]
pub fn info(args: fmt::Arguments<'_>) {
+ // `args` is unused if `CONFIG_PRINTK` is not set - this avoids a build-time warning.
+ #[cfg(not(CONFIG_PRINTK))]
+ let _ = args;
+
// SAFETY: The format string is null-terminated and the `%pA` specifier matches the argument we
// are passing.
#[cfg(CONFIG_PRINTK)]
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 228/311] kunit: tool: copy caller args in run_kernel to prevent mutation
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (226 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 227/311] rust: kunit: fix warning when !CONFIG_PRINTK Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 229/311] accel/amdxdna: Fix NULL pointer dereference of mgmt_chann Sasha Levin
` (96 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Shuvam Pandey, David Gow, Shuah Khan, Sasha Levin
From: Shuvam Pandey <shuvampandey1@gmail.com>
[ Upstream commit 40804c4974b8df2adab72f6475d343eaff72b7f6 ]
run_kernel() appended KUnit flags directly to the caller-provided args
list. When exec_tests() calls run_kernel() repeatedly (e.g. with
--run_isolated), each call mutated the same list, causing later runs
to inherit stale filter_glob values and duplicate kunit.enable flags.
Fix this by copying args at the start of run_kernel(). Add a regression
test that calls run_kernel() twice with the same list and verifies the
original remains unchanged.
Fixes: ff9e09a3762f ("kunit: tool: support running each suite/test separately")
Signed-off-by: Shuvam Pandey <shuvampandey1@gmail.com>
Reviewed-by: David Gow <david@davidgow.net>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/kunit/kunit_kernel.py | 6 ++++--
tools/testing/kunit/kunit_tool_test.py | 26 ++++++++++++++++++++++++++
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/tools/testing/kunit/kunit_kernel.py b/tools/testing/kunit/kunit_kernel.py
index 260d8d9aa1db4..2998e1bc088b2 100644
--- a/tools/testing/kunit/kunit_kernel.py
+++ b/tools/testing/kunit/kunit_kernel.py
@@ -346,8 +346,10 @@ class LinuxSourceTree:
return self.validate_config(build_dir)
def run_kernel(self, args: Optional[List[str]]=None, build_dir: str='', filter_glob: str='', filter: str='', filter_action: Optional[str]=None, timeout: Optional[int]=None) -> Iterator[str]:
- if not args:
- args = []
+ # Copy to avoid mutating the caller-supplied list. exec_tests() reuses
+ # the same args across repeated run_kernel() calls (e.g. --run_isolated),
+ # so appending to the original would accumulate stale flags on each call.
+ args = list(args) if args else []
if filter_glob:
args.append('kunit.filter_glob=' + filter_glob)
if filter:
diff --git a/tools/testing/kunit/kunit_tool_test.py b/tools/testing/kunit/kunit_tool_test.py
index bbba921e0eacb..ed45bac1548d9 100755
--- a/tools/testing/kunit/kunit_tool_test.py
+++ b/tools/testing/kunit/kunit_tool_test.py
@@ -489,6 +489,32 @@ class LinuxSourceTreeTest(unittest.TestCase):
with open(kunit_kernel.get_outfile_path(build_dir), 'rt') as outfile:
self.assertEqual(outfile.read(), 'hi\nbye\n', msg='Missing some output')
+ def test_run_kernel_args_not_mutated(self):
+ """Verify run_kernel() copies args so callers can reuse them."""
+ start_calls = []
+
+ def fake_start(start_args, unused_build_dir):
+ start_calls.append(list(start_args))
+ return subprocess.Popen(['printf', 'KTAP version 1\n'],
+ text=True, stdout=subprocess.PIPE)
+
+ with tempfile.TemporaryDirectory('') as build_dir:
+ tree = kunit_kernel.LinuxSourceTree(build_dir,
+ kunitconfig_paths=[os.devnull])
+ with mock.patch.object(tree._ops, 'start', side_effect=fake_start), \
+ mock.patch.object(kunit_kernel.subprocess, 'call'):
+ kernel_args = ['mem=1G']
+ for _ in tree.run_kernel(args=kernel_args, build_dir=build_dir,
+ filter_glob='suite.test1'):
+ pass
+ for _ in tree.run_kernel(args=kernel_args, build_dir=build_dir,
+ filter_glob='suite.test2'):
+ pass
+ self.assertEqual(kernel_args, ['mem=1G'],
+ 'run_kernel() should not modify caller args')
+ self.assertIn('kunit.filter_glob=suite.test1', start_calls[0])
+ self.assertIn('kunit.filter_glob=suite.test2', start_calls[1])
+
def test_build_reconfig_no_config(self):
with tempfile.TemporaryDirectory('') as build_dir:
with open(kunit_kernel.get_kunitconfig_path(build_dir), 'w') as f:
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 229/311] accel/amdxdna: Fix NULL pointer dereference of mgmt_chann
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (227 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 228/311] kunit: tool: copy caller args in run_kernel to prevent mutation Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 230/311] drm/amd/display: Use mpc.preblend flag to indicate 3D LUT Sasha Levin
` (95 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Lizhi Hou, Mario Limonciello (AMD), Sasha Levin
From: Lizhi Hou <lizhi.hou@amd.com>
[ Upstream commit 6270ee26e1edd862ea17e3eba148ca8fb2c99dc9 ]
mgmt_chann may be set to NULL if the firmware returns an unexpected
error in aie2_send_mgmt_msg_wait(). This can later lead to a NULL
pointer dereference in aie2_hw_stop().
Fix this by introducing a dedicated helper to destroy mgmt_chann
and by adding proper NULL checks before accessing it.
Fixes: b87f920b9344 ("accel/amdxdna: Support hardware mailbox")
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
Link: https://patch.msgid.link/20260226213857.3068474-1-lizhi.hou@amd.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/amdxdna/aie2_message.c | 21 ++++++++++++++++-----
drivers/accel/amdxdna/aie2_pci.c | 7 ++-----
drivers/accel/amdxdna/aie2_pci.h | 1 +
3 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/drivers/accel/amdxdna/aie2_message.c b/drivers/accel/amdxdna/aie2_message.c
index a758c11a05a9c..f0fb98131068c 100644
--- a/drivers/accel/amdxdna/aie2_message.c
+++ b/drivers/accel/amdxdna/aie2_message.c
@@ -40,11 +40,8 @@ static int aie2_send_mgmt_msg_wait(struct amdxdna_dev_hdl *ndev,
return -ENODEV;
ret = xdna_send_msg_wait(xdna, ndev->mgmt_chann, msg);
- if (ret == -ETIME) {
- xdna_mailbox_stop_channel(ndev->mgmt_chann);
- xdna_mailbox_destroy_channel(ndev->mgmt_chann);
- ndev->mgmt_chann = NULL;
- }
+ if (ret == -ETIME)
+ aie2_destroy_mgmt_chann(ndev);
if (!ret && *hdl->status != AIE2_STATUS_SUCCESS) {
XDNA_ERR(xdna, "command opcode 0x%x failed, status 0x%x",
@@ -871,6 +868,20 @@ void aie2_msg_init(struct amdxdna_dev_hdl *ndev)
ndev->exec_msg_ops = &legacy_exec_message_ops;
}
+void aie2_destroy_mgmt_chann(struct amdxdna_dev_hdl *ndev)
+{
+ struct amdxdna_dev *xdna = ndev->xdna;
+
+ drm_WARN_ON(&xdna->ddev, !mutex_is_locked(&xdna->dev_lock));
+
+ if (!ndev->mgmt_chann)
+ return;
+
+ xdna_mailbox_stop_channel(ndev->mgmt_chann);
+ xdna_mailbox_destroy_channel(ndev->mgmt_chann);
+ ndev->mgmt_chann = NULL;
+}
+
static inline struct amdxdna_gem_obj *
aie2_cmdlist_get_cmd_buf(struct amdxdna_sched_job *job)
{
diff --git a/drivers/accel/amdxdna/aie2_pci.c b/drivers/accel/amdxdna/aie2_pci.c
index 3356c9ed079a8..0a8e7a8710eea 100644
--- a/drivers/accel/amdxdna/aie2_pci.c
+++ b/drivers/accel/amdxdna/aie2_pci.c
@@ -343,9 +343,7 @@ static void aie2_hw_stop(struct amdxdna_dev *xdna)
aie2_runtime_cfg(ndev, AIE2_RT_CFG_CLK_GATING, NULL);
aie2_mgmt_fw_fini(ndev);
- xdna_mailbox_stop_channel(ndev->mgmt_chann);
- xdna_mailbox_destroy_channel(ndev->mgmt_chann);
- ndev->mgmt_chann = NULL;
+ aie2_destroy_mgmt_chann(ndev);
drmm_kfree(&xdna->ddev, ndev->mbox);
ndev->mbox = NULL;
aie2_psp_stop(ndev->psp_hdl);
@@ -454,8 +452,7 @@ static int aie2_hw_start(struct amdxdna_dev *xdna)
return 0;
destroy_mgmt_chann:
- xdna_mailbox_stop_channel(ndev->mgmt_chann);
- xdna_mailbox_destroy_channel(ndev->mgmt_chann);
+ aie2_destroy_mgmt_chann(ndev);
stop_psp:
aie2_psp_stop(ndev->psp_hdl);
fini_smu:
diff --git a/drivers/accel/amdxdna/aie2_pci.h b/drivers/accel/amdxdna/aie2_pci.h
index 4fdc032bc171b..482ee555f6c47 100644
--- a/drivers/accel/amdxdna/aie2_pci.h
+++ b/drivers/accel/amdxdna/aie2_pci.h
@@ -302,6 +302,7 @@ int aie2_get_array_async_error(struct amdxdna_dev_hdl *ndev,
/* aie2_message.c */
void aie2_msg_init(struct amdxdna_dev_hdl *ndev);
+void aie2_destroy_mgmt_chann(struct amdxdna_dev_hdl *ndev);
int aie2_suspend_fw(struct amdxdna_dev_hdl *ndev);
int aie2_resume_fw(struct amdxdna_dev_hdl *ndev);
int aie2_set_runtime_cfg(struct amdxdna_dev_hdl *ndev, u32 type, u64 value);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 230/311] drm/amd/display: Use mpc.preblend flag to indicate 3D LUT
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (228 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 229/311] accel/amdxdna: Fix NULL pointer dereference of mgmt_chann Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 231/311] drm/amd/display: Enable DEGAMMA and reject COLOR_PIPELINE+DEGAMMA_LUT Sasha Levin
` (94 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Alex Hung, Melissa Wen, Harry Wentland, Alex Deucher, Sasha Levin
From: Alex Hung <alex.hung@amd.com>
[ Upstream commit c28b3ec3ca034fd1abc832fef46ce36eb13f8fad ]
[WHAT]
New ASIC's 3D LUT is indicated by mpc.preblend.
Fixes: 0de2b1afea8d ("drm/amd/display: add 3D LUT colorop")
Reviewed-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 43175f6164d32cb96362d16e357689f74298145c)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c | 6 ++++--
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 3 ++-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
index 20a76d81d532d..12c52bffe9964 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
@@ -1706,6 +1706,7 @@ __set_dm_plane_colorop_3dlut(struct drm_plane_state *plane_state,
struct dc_transfer_func *tf = &dc_plane_state->in_shaper_func;
struct drm_atomic_state *state = plane_state->state;
const struct amdgpu_device *adev = drm_to_adev(colorop->dev);
+ bool has_3dlut = adev->dm.dc->caps.color.dpp.hw_3d_lut || adev->dm.dc->caps.color.mpc.preblend;
const struct drm_device *dev = colorop->dev;
const struct drm_color_lut32 *lut3d;
uint32_t lut3d_size;
@@ -1722,7 +1723,7 @@ __set_dm_plane_colorop_3dlut(struct drm_plane_state *plane_state,
}
if (colorop_state && !colorop_state->bypass && colorop->type == DRM_COLOROP_3D_LUT) {
- if (!adev->dm.dc->caps.color.dpp.hw_3d_lut) {
+ if (!has_3dlut) {
drm_dbg(dev, "3D LUT is not supported by hardware\n");
return -EINVAL;
}
@@ -1875,6 +1876,7 @@ amdgpu_dm_plane_set_colorop_properties(struct drm_plane_state *plane_state,
struct drm_colorop *colorop = plane_state->color_pipeline;
struct drm_device *dev = plane_state->plane->dev;
struct amdgpu_device *adev = drm_to_adev(dev);
+ bool has_3dlut = adev->dm.dc->caps.color.dpp.hw_3d_lut || adev->dm.dc->caps.color.mpc.preblend;
int ret;
/* 1D Curve - DEGAM TF */
@@ -1907,7 +1909,7 @@ amdgpu_dm_plane_set_colorop_properties(struct drm_plane_state *plane_state,
if (ret)
return ret;
- if (adev->dm.dc->caps.color.dpp.hw_3d_lut) {
+ if (has_3dlut) {
/* 1D Curve & LUT - SHAPER TF & LUT */
colorop = colorop->next;
if (!colorop) {
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c
index a2de3bba83464..cc124ab6aa7f7 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_colorop.c
@@ -60,6 +60,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr
struct drm_colorop *ops[MAX_COLOR_PIPELINE_OPS];
struct drm_device *dev = plane->dev;
struct amdgpu_device *adev = drm_to_adev(dev);
+ bool has_3dlut = adev->dm.dc->caps.color.dpp.hw_3d_lut || adev->dm.dc->caps.color.mpc.preblend;
int ret;
int i = 0;
@@ -112,7 +113,7 @@ int amdgpu_dm_initialize_default_pipeline(struct drm_plane *plane, struct drm_pr
i++;
- if (adev->dm.dc->caps.color.dpp.hw_3d_lut) {
+ if (has_3dlut) {
/* 1D curve - SHAPER TF */
ops[i] = kzalloc(sizeof(*ops[0]), GFP_KERNEL);
if (!ops[i]) {
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 231/311] drm/amd/display: Enable DEGAMMA and reject COLOR_PIPELINE+DEGAMMA_LUT
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (229 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 230/311] drm/amd/display: Use mpc.preblend flag to indicate 3D LUT Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 232/311] net: dsa: realtek: rtl8365mb: fix rtl8365mb_phy_ocp_write return value Sasha Levin
` (93 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Alex Hung, Melissa Wen, Harry Wentland, Alex Deucher, Sasha Levin
From: Alex Hung <alex.hung@amd.com>
[ Upstream commit a4fa2355e0add57253468ef13bd08f11285f3b6e ]
[WHAT]
Create DEGAMMA properties even if color pipeline is enabled, and enforce
the mutual exclusion in atomic check by rejecting any commit that
attempts to enable both COLOR_PIPELINE on the plane and DEGAMMA_LUT on
the CRTC simultaneously.
Fixes: 18a4127e9315 ("drm/amd/display: Disable CRTC degamma when color pipeline is enabled")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4963
Reviewed-by: Melissa Wen <mwen@igalia.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 196a6aa727f1f15eb54dda5e60a41543ea9397ee)
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 16 ++++++++--------
.../drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 8 ++++++++
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
index 9fcd72d87d25b..39fcbc3e702dc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
@@ -765,15 +765,15 @@ int amdgpu_dm_crtc_init(struct amdgpu_display_manager *dm,
dm->adev->mode_info.crtcs[crtc_index] = acrtc;
/* Don't enable DRM CRTC degamma property for
- * 1. Degamma is replaced by color pipeline.
- * 2. DCE since it doesn't support programmable degamma anywhere.
- * 3. DCN401 since pre-blending degamma LUT doesn't apply to cursor.
+ * 1. DCE since it doesn't support programmable degamma anywhere.
+ * 2. DCN401 since pre-blending degamma LUT doesn't apply to cursor.
+ * Note: DEGAMMA properties are created even if the primary plane has the
+ * COLOR_PIPELINE property. User space can use either the DEGAMMA properties
+ * or the COLOR_PIPELINE property. An atomic commit which attempts to enable
+ * both is rejected.
*/
- if (plane->color_pipeline_property)
- has_degamma = false;
- else
- has_degamma = dm->adev->dm.dc->caps.color.dpp.dcn_arch &&
- dm->adev->dm.dc->ctx->dce_version != DCN_VERSION_4_01;
+ has_degamma = dm->adev->dm.dc->caps.color.dpp.dcn_arch &&
+ dm->adev->dm.dc->ctx->dce_version != DCN_VERSION_4_01;
drm_crtc_enable_color_mgmt(&acrtc->base, has_degamma ? MAX_COLOR_LUT_ENTRIES : 0,
true, MAX_COLOR_LUT_ENTRIES);
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
index 7474f1bc1d0b8..44b9c8ca6d719 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c
@@ -1256,6 +1256,14 @@ static int amdgpu_dm_plane_atomic_check(struct drm_plane *plane,
if (ret)
return ret;
+ /* Reject commits that attempt to use both COLOR_PIPELINE and CRTC DEGAMMA_LUT */
+ if (new_plane_state->color_pipeline && new_crtc_state->degamma_lut) {
+ drm_dbg_atomic(plane->dev,
+ "[PLANE:%d:%s] COLOR_PIPELINE and CRTC DEGAMMA_LUT cannot be enabled simultaneously\n",
+ plane->base.id, plane->name);
+ return -EINVAL;
+ }
+
ret = amdgpu_dm_plane_fill_dc_scaling_info(adev, new_plane_state, &scaling_info);
if (ret)
return ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 232/311] net: dsa: realtek: rtl8365mb: fix rtl8365mb_phy_ocp_write return value
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (230 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 231/311] drm/amd/display: Enable DEGAMMA and reject COLOR_PIPELINE+DEGAMMA_LUT Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 233/311] bpf/bonding: reject vlan+srcmac xmit_hash_policy change when XDP is loaded Sasha Levin
` (92 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Mieczyslaw Nalewaj, Andrew Lunn, Luiz Angelo Daros de Luca,
Linus Walleij, Jakub Kicinski, Sasha Levin
From: Mieczyslaw Nalewaj <namiltd@yahoo.com>
[ Upstream commit 7cbe98f7bef965241a5908d50d557008cf998aee ]
Function rtl8365mb_phy_ocp_write() always returns 0, even when an error
occurs during register access. This patch fixes the return value to
propagate the actual error code from regmap operations.
Link: https://lore.kernel.org/netdev/a2dfde3c-d46f-434b-9d16-1e251e449068@yahoo.com/
Fixes: 2796728460b8 ("net: dsa: realtek: rtl8365mb: serialize indirect PHY register access")
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260301-realtek_namiltd_fix1-v1-1-43a6bb707f9c@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/dsa/realtek/rtl8365mb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/realtek/rtl8365mb.c b/drivers/net/dsa/realtek/rtl8365mb.c
index c575e164368c8..f938a3f701cc9 100644
--- a/drivers/net/dsa/realtek/rtl8365mb.c
+++ b/drivers/net/dsa/realtek/rtl8365mb.c
@@ -769,7 +769,7 @@ static int rtl8365mb_phy_ocp_write(struct realtek_priv *priv, int phy,
out:
rtl83xx_unlock(priv);
- return 0;
+ return ret;
}
static int rtl8365mb_phy_read(struct realtek_priv *priv, int phy, int regnum)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 233/311] bpf/bonding: reject vlan+srcmac xmit_hash_policy change when XDP is loaded
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (231 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 232/311] net: dsa: realtek: rtl8365mb: fix rtl8365mb_phy_ocp_write return value Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 234/311] octeon_ep: Relocate counter updates before NAPI Sasha Levin
` (91 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Jiayuan Chen, syzbot+5a287bcdc08104bc3132, Paolo Abeni,
Sasha Levin
From: Jiayuan Chen <jiayuan.chen@shopee.com>
[ Upstream commit 479d589b40b836442bbdadc3fdb37f001bb67f26 ]
bond_option_mode_set() already rejects mode changes that would make a
loaded XDP program incompatible via bond_xdp_check(). However,
bond_option_xmit_hash_policy_set() has no such guard.
For 802.3ad and balance-xor modes, bond_xdp_check() returns false when
xmit_hash_policy is vlan+srcmac, because the 802.1q payload is usually
absent due to hardware offload. This means a user can:
1. Attach a native XDP program to a bond in 802.3ad/balance-xor mode
with a compatible xmit_hash_policy (e.g. layer2+3).
2. Change xmit_hash_policy to vlan+srcmac while XDP remains loaded.
This leaves bond->xdp_prog set but bond_xdp_check() now returning false
for the same device. When the bond is later destroyed, dev_xdp_uninstall()
calls bond_xdp_set(dev, NULL, NULL) to remove the program, which hits
the bond_xdp_check() guard and returns -EOPNOTSUPP, triggering:
WARN_ON(dev_xdp_install(dev, mode, bpf_op, NULL, 0, NULL))
Fix this by rejecting xmit_hash_policy changes to vlan+srcmac when an
XDP program is loaded on a bond in 802.3ad or balance-xor mode.
commit 39a0876d595b ("net, bonding: Disallow vlan+srcmac with XDP")
introduced bond_xdp_check() which returns false for 802.3ad/balance-xor
modes when xmit_hash_policy is vlan+srcmac. The check was wired into
bond_xdp_set() to reject XDP attachment with an incompatible policy, but
the symmetric path -- preventing xmit_hash_policy from being changed to an
incompatible value after XDP is already loaded -- was left unguarded in
bond_option_xmit_hash_policy_set().
Note:
commit 094ee6017ea0 ("bonding: check xdp prog when set bond mode")
later added a similar guard to bond_option_mode_set(), but
bond_option_xmit_hash_policy_set() remained unprotected.
Reported-by: syzbot+5a287bcdc08104bc3132@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/6995aff6.050a0220.2eeac1.014e.GAE@google.com/T/
Fixes: 39a0876d595b ("net, bonding: Disallow vlan+srcmac with XDP")
Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com>
Link: https://patch.msgid.link/20260226080306.98766-2-jiayuan.chen@linux.dev
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/bonding/bond_main.c | 9 +++++++--
drivers/net/bonding/bond_options.c | 2 ++
include/net/bonding.h | 1 +
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 4c58d1dafcacb..739e6eea6b529 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -324,7 +324,7 @@ static bool bond_sk_check(struct bonding *bond)
}
}
-bool bond_xdp_check(struct bonding *bond, int mode)
+bool __bond_xdp_check(int mode, int xmit_policy)
{
switch (mode) {
case BOND_MODE_ROUNDROBIN:
@@ -335,7 +335,7 @@ bool bond_xdp_check(struct bonding *bond, int mode)
/* vlan+srcmac is not supported with XDP as in most cases the 802.1q
* payload is not in the packet due to hardware offload.
*/
- if (bond->params.xmit_policy != BOND_XMIT_POLICY_VLAN_SRCMAC)
+ if (xmit_policy != BOND_XMIT_POLICY_VLAN_SRCMAC)
return true;
fallthrough;
default:
@@ -343,6 +343,11 @@ bool bond_xdp_check(struct bonding *bond, int mode)
}
}
+bool bond_xdp_check(struct bonding *bond, int mode)
+{
+ return __bond_xdp_check(mode, bond->params.xmit_policy);
+}
+
/*---------------------------------- VLAN -----------------------------------*/
/* In the following 2 functions, bond_vlan_rx_add_vid and bond_vlan_rx_kill_vid,
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index f1c6e9d8f6167..adc216df43459 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -1574,6 +1574,8 @@ static int bond_option_fail_over_mac_set(struct bonding *bond,
static int bond_option_xmit_hash_policy_set(struct bonding *bond,
const struct bond_opt_value *newval)
{
+ if (bond->xdp_prog && !__bond_xdp_check(BOND_MODE(bond), newval->value))
+ return -EOPNOTSUPP;
netdev_dbg(bond->dev, "Setting xmit hash policy to %s (%llu)\n",
newval->string, newval->value);
bond->params.xmit_policy = newval->value;
diff --git a/include/net/bonding.h b/include/net/bonding.h
index 4620784035570..99c1bdadcd11a 100644
--- a/include/net/bonding.h
+++ b/include/net/bonding.h
@@ -698,6 +698,7 @@ void bond_debug_register(struct bonding *bond);
void bond_debug_unregister(struct bonding *bond);
void bond_debug_reregister(struct bonding *bond);
const char *bond_mode_name(int mode);
+bool __bond_xdp_check(int mode, int xmit_policy);
bool bond_xdp_check(struct bonding *bond, int mode);
void bond_setup(struct net_device *bond_dev);
unsigned int bond_get_num_tx_queues(void);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 234/311] octeon_ep: Relocate counter updates before NAPI
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (232 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 233/311] bpf/bonding: reject vlan+srcmac xmit_hash_policy change when XDP is loaded Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 235/311] octeon_ep: avoid compiler and IQ/OQ reordering Sasha Levin
` (90 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Vimlesh Kumar, Sathesh Edara, Shinas Rasheed, Paolo Abeni,
Sasha Levin
From: Vimlesh Kumar <vimleshk@marvell.com>
[ Upstream commit 18c04a808c436d629d5812ce883e3822a5f5a47f ]
Relocate IQ/OQ IN/OUT_CNTS updates to occur before NAPI completion,
and replace napi_complete with napi_complete_done.
Moving the IQ/OQ counter updates before napi_complete_done ensures
1. Counter registers are updated before re-enabling interrupts.
2. Prevents a race where new packets arrive but counters aren't properly
synchronized.
napi_complete_done (vs napi_complete) allows for better
interrupt coalescing.
Fixes: 37d79d0596062 ("octeon_ep: add Tx/Rx processing and interrupt support")
Signed-off-by: Sathesh Edara <sedara@marvell.com>
Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
Signed-off-by: Vimlesh Kumar <vimleshk@marvell.com>
Link: https://patch.msgid.link/20260227091402.1773833-2-vimleshk@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../ethernet/marvell/octeon_ep/octep_main.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
index 57db7ea2f5be9..7f8ed8f0ade49 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
@@ -555,12 +555,12 @@ static void octep_clean_irqs(struct octep_device *oct)
}
/**
- * octep_enable_ioq_irq() - Enable MSI-x interrupt of a Tx/Rx queue.
+ * octep_update_pkt() - Update IQ/OQ IN/OUT_CNT registers.
*
* @iq: Octeon Tx queue data structure.
* @oq: Octeon Rx queue data structure.
*/
-static void octep_enable_ioq_irq(struct octep_iq *iq, struct octep_oq *oq)
+static void octep_update_pkt(struct octep_iq *iq, struct octep_oq *oq)
{
u32 pkts_pend = oq->pkts_pending;
@@ -576,7 +576,17 @@ static void octep_enable_ioq_irq(struct octep_iq *iq, struct octep_oq *oq)
}
/* Flush the previous wrties before writing to RESEND bit */
- wmb();
+ smp_wmb();
+}
+
+/**
+ * octep_enable_ioq_irq() - Enable MSI-x interrupt of a Tx/Rx queue.
+ *
+ * @iq: Octeon Tx queue data structure.
+ * @oq: Octeon Rx queue data structure.
+ */
+static void octep_enable_ioq_irq(struct octep_iq *iq, struct octep_oq *oq)
+{
writeq(1UL << OCTEP_OQ_INTR_RESEND_BIT, oq->pkts_sent_reg);
writeq(1UL << OCTEP_IQ_INTR_RESEND_BIT, iq->inst_cnt_reg);
}
@@ -602,7 +612,8 @@ static int octep_napi_poll(struct napi_struct *napi, int budget)
if (tx_pending || rx_done >= budget)
return budget;
- napi_complete(napi);
+ octep_update_pkt(ioq_vector->iq, ioq_vector->oq);
+ napi_complete_done(napi, rx_done);
octep_enable_ioq_irq(ioq_vector->iq, ioq_vector->oq);
return rx_done;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 235/311] octeon_ep: avoid compiler and IQ/OQ reordering
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (233 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 234/311] octeon_ep: Relocate counter updates before NAPI Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 236/311] octeon_ep_vf: Relocate counter updates before NAPI Sasha Levin
` (89 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Vimlesh Kumar, Sathesh Edara, Shinas Rasheed, Paolo Abeni,
Sasha Levin
From: Vimlesh Kumar <vimleshk@marvell.com>
[ Upstream commit 43b3160cb639079a15daeb5f080120afbfbfc918 ]
Utilize READ_ONCE and WRITE_ONCE APIs for IO queue Tx/Rx
variable access to prevent compiler optimization and reordering.
Additionally, ensure IO queue OUT/IN_CNT registers are flushed
by performing a read-back after writing.
The compiler could reorder reads/writes to pkts_pending, last_pkt_count,
etc., causing stale values to be used when calculating packets to process
or register updates to send to hardware. The Octeon hardware requires a
read-back after writing to OUT_CNT/IN_CNT registers to ensure the write
has been flushed through any posted write buffers before the interrupt
resend bit is set. Without this, we have observed cases where the hardware
didn't properly update its internal state.
wmb/rmb only provides ordering guarantees but doesn't prevent the compiler
from performing optimizations like caching in registers, load tearing etc.
Fixes: 37d79d0596062 ("octeon_ep: add Tx/Rx processing and interrupt support")
Signed-off-by: Sathesh Edara <sedara@marvell.com>
Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
Signed-off-by: Vimlesh Kumar <vimleshk@marvell.com>
Link: https://patch.msgid.link/20260227091402.1773833-3-vimleshk@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../ethernet/marvell/octeon_ep/octep_main.c | 21 +++++++++------
.../net/ethernet/marvell/octeon_ep/octep_rx.c | 27 +++++++++++++------
2 files changed, 32 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
index 7f8ed8f0ade49..16f52d4b11e91 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_main.c
@@ -562,17 +562,22 @@ static void octep_clean_irqs(struct octep_device *oct)
*/
static void octep_update_pkt(struct octep_iq *iq, struct octep_oq *oq)
{
- u32 pkts_pend = oq->pkts_pending;
+ u32 pkts_pend = READ_ONCE(oq->pkts_pending);
+ u32 last_pkt_count = READ_ONCE(oq->last_pkt_count);
+ u32 pkts_processed = READ_ONCE(iq->pkts_processed);
+ u32 pkt_in_done = READ_ONCE(iq->pkt_in_done);
netdev_dbg(iq->netdev, "enabling intr for Q-%u\n", iq->q_no);
- if (iq->pkts_processed) {
- writel(iq->pkts_processed, iq->inst_cnt_reg);
- iq->pkt_in_done -= iq->pkts_processed;
- iq->pkts_processed = 0;
+ if (pkts_processed) {
+ writel(pkts_processed, iq->inst_cnt_reg);
+ readl(iq->inst_cnt_reg);
+ WRITE_ONCE(iq->pkt_in_done, (pkt_in_done - pkts_processed));
+ WRITE_ONCE(iq->pkts_processed, 0);
}
- if (oq->last_pkt_count - pkts_pend) {
- writel(oq->last_pkt_count - pkts_pend, oq->pkts_sent_reg);
- oq->last_pkt_count = pkts_pend;
+ if (last_pkt_count - pkts_pend) {
+ writel(last_pkt_count - pkts_pend, oq->pkts_sent_reg);
+ readl(oq->pkts_sent_reg);
+ WRITE_ONCE(oq->last_pkt_count, pkts_pend);
}
/* Flush the previous wrties before writing to RESEND bit */
diff --git a/drivers/net/ethernet/marvell/octeon_ep/octep_rx.c b/drivers/net/ethernet/marvell/octeon_ep/octep_rx.c
index f2a7c6a76c742..74de19166488f 100644
--- a/drivers/net/ethernet/marvell/octeon_ep/octep_rx.c
+++ b/drivers/net/ethernet/marvell/octeon_ep/octep_rx.c
@@ -324,10 +324,16 @@ static int octep_oq_check_hw_for_pkts(struct octep_device *oct,
struct octep_oq *oq)
{
u32 pkt_count, new_pkts;
+ u32 last_pkt_count, pkts_pending;
pkt_count = readl(oq->pkts_sent_reg);
- new_pkts = pkt_count - oq->last_pkt_count;
+ last_pkt_count = READ_ONCE(oq->last_pkt_count);
+ new_pkts = pkt_count - last_pkt_count;
+ if (pkt_count < last_pkt_count) {
+ dev_err(oq->dev, "OQ-%u pkt_count(%u) < oq->last_pkt_count(%u)\n",
+ oq->q_no, pkt_count, last_pkt_count);
+ }
/* Clear the hardware packets counter register if the rx queue is
* being processed continuously with-in a single interrupt and
* reached half its max value.
@@ -338,8 +344,9 @@ static int octep_oq_check_hw_for_pkts(struct octep_device *oct,
pkt_count = readl(oq->pkts_sent_reg);
new_pkts += pkt_count;
}
- oq->last_pkt_count = pkt_count;
- oq->pkts_pending += new_pkts;
+ WRITE_ONCE(oq->last_pkt_count, pkt_count);
+ pkts_pending = READ_ONCE(oq->pkts_pending);
+ WRITE_ONCE(oq->pkts_pending, (pkts_pending + new_pkts));
return new_pkts;
}
@@ -414,7 +421,7 @@ static int __octep_oq_process_rx(struct octep_device *oct,
u16 rx_ol_flags;
u32 read_idx;
- read_idx = oq->host_read_idx;
+ read_idx = READ_ONCE(oq->host_read_idx);
rx_bytes = 0;
desc_used = 0;
for (pkt = 0; pkt < pkts_to_process; pkt++) {
@@ -499,7 +506,7 @@ static int __octep_oq_process_rx(struct octep_device *oct,
napi_gro_receive(oq->napi, skb);
}
- oq->host_read_idx = read_idx;
+ WRITE_ONCE(oq->host_read_idx, read_idx);
oq->refill_count += desc_used;
oq->stats->packets += pkt;
oq->stats->bytes += rx_bytes;
@@ -522,22 +529,26 @@ int octep_oq_process_rx(struct octep_oq *oq, int budget)
{
u32 pkts_available, pkts_processed, total_pkts_processed;
struct octep_device *oct = oq->octep_dev;
+ u32 pkts_pending;
pkts_available = 0;
pkts_processed = 0;
total_pkts_processed = 0;
while (total_pkts_processed < budget) {
/* update pending count only when current one exhausted */
- if (oq->pkts_pending == 0)
+ pkts_pending = READ_ONCE(oq->pkts_pending);
+ if (pkts_pending == 0)
octep_oq_check_hw_for_pkts(oct, oq);
+ pkts_pending = READ_ONCE(oq->pkts_pending);
pkts_available = min(budget - total_pkts_processed,
- oq->pkts_pending);
+ pkts_pending);
if (!pkts_available)
break;
pkts_processed = __octep_oq_process_rx(oct, oq,
pkts_available);
- oq->pkts_pending -= pkts_processed;
+ pkts_pending = READ_ONCE(oq->pkts_pending);
+ WRITE_ONCE(oq->pkts_pending, (pkts_pending - pkts_processed));
total_pkts_processed += pkts_processed;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 236/311] octeon_ep_vf: Relocate counter updates before NAPI
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (234 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 235/311] octeon_ep: avoid compiler and IQ/OQ reordering Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 237/311] octeon_ep_vf: avoid compiler and IQ/OQ reordering Sasha Levin
` (88 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Vimlesh Kumar, Sathesh Edara, Shinas Rasheed, Paolo Abeni,
Sasha Levin
From: Vimlesh Kumar <vimleshk@marvell.com>
[ Upstream commit 2ae7d20fb24f598f60faa8f6ecc856dac782261a ]
Relocate IQ/OQ IN/OUT_CNTS updates to occur before NAPI completion.
Moving the IQ/OQ counter updates before napi_complete_done ensures
1. Counter registers are updated before re-enabling interrupts.
2. Prevents a race where new packets arrive but counters aren't properly
synchronized.
Fixes: 1cd3b407977c3 ("octeon_ep_vf: add Tx/Rx processing and interrupt support")
Signed-off-by: Sathesh Edara <sedara@marvell.com>
Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
Signed-off-by: Vimlesh Kumar <vimleshk@marvell.com>
Link: https://patch.msgid.link/20260227091402.1773833-4-vimleshk@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../marvell/octeon_ep_vf/octep_vf_main.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
index 1d9760b4b8f47..17efc8eab4cfb 100644
--- a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
@@ -286,12 +286,13 @@ static void octep_vf_clean_irqs(struct octep_vf_device *oct)
}
/**
- * octep_vf_enable_ioq_irq() - Enable MSI-x interrupt of a Tx/Rx queue.
+ * octep_vf_update_pkt() - Update IQ/OQ IN/OUT_CNT registers.
*
* @iq: Octeon Tx queue data structure.
* @oq: Octeon Rx queue data structure.
*/
-static void octep_vf_enable_ioq_irq(struct octep_vf_iq *iq, struct octep_vf_oq *oq)
+
+static void octep_vf_update_pkt(struct octep_vf_iq *iq, struct octep_vf_oq *oq)
{
u32 pkts_pend = oq->pkts_pending;
@@ -308,6 +309,17 @@ static void octep_vf_enable_ioq_irq(struct octep_vf_iq *iq, struct octep_vf_oq *
/* Flush the previous wrties before writing to RESEND bit */
smp_wmb();
+}
+
+/**
+ * octep_vf_enable_ioq_irq() - Enable MSI-x interrupt of a Tx/Rx queue.
+ *
+ * @iq: Octeon Tx queue data structure.
+ * @oq: Octeon Rx queue data structure.
+ */
+static void octep_vf_enable_ioq_irq(struct octep_vf_iq *iq,
+ struct octep_vf_oq *oq)
+{
writeq(1UL << OCTEP_VF_OQ_INTR_RESEND_BIT, oq->pkts_sent_reg);
writeq(1UL << OCTEP_VF_IQ_INTR_RESEND_BIT, iq->inst_cnt_reg);
}
@@ -333,6 +345,7 @@ static int octep_vf_napi_poll(struct napi_struct *napi, int budget)
if (tx_pending || rx_done >= budget)
return budget;
+ octep_vf_update_pkt(ioq_vector->iq, ioq_vector->oq);
if (likely(napi_complete_done(napi, rx_done)))
octep_vf_enable_ioq_irq(ioq_vector->iq, ioq_vector->oq);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 237/311] octeon_ep_vf: avoid compiler and IQ/OQ reordering
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (235 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 236/311] octeon_ep_vf: Relocate counter updates before NAPI Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 238/311] wifi: cw1200: Fix locking in error paths Sasha Levin
` (87 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Vimlesh Kumar, Sathesh Edara, Shinas Rasheed, Paolo Abeni,
Sasha Levin
From: Vimlesh Kumar <vimleshk@marvell.com>
[ Upstream commit 6c73126ecd1080351b468fe43353b2f705487f44 ]
Utilize READ_ONCE and WRITE_ONCE APIs for IO queue Tx/Rx
variable access to prevent compiler optimization and reordering.
Additionally, ensure IO queue OUT/IN_CNT registers are flushed
by performing a read-back after writing.
The compiler could reorder reads/writes to pkts_pending, last_pkt_count,
etc., causing stale values to be used when calculating packets to process
or register updates to send to hardware. The Octeon hardware requires a
read-back after writing to OUT_CNT/IN_CNT registers to ensure the write
has been flushed through any posted write buffers before the interrupt
resend bit is set. Without this, we have observed cases where the hardware
didn't properly update its internal state.
wmb/rmb only provides ordering guarantees but doesn't prevent the compiler
from performing optimizations like caching in registers, load tearing etc.
Fixes: 1cd3b407977c3 ("octeon_ep_vf: add Tx/Rx processing and interrupt support")
Signed-off-by: Sathesh Edara <sedara@marvell.com>
Signed-off-by: Shinas Rasheed <srasheed@marvell.com>
Signed-off-by: Vimlesh Kumar <vimleshk@marvell.com>
Link: https://patch.msgid.link/20260227091402.1773833-5-vimleshk@marvell.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../marvell/octeon_ep_vf/octep_vf_main.c | 21 ++++++++------
.../marvell/octeon_ep_vf/octep_vf_rx.c | 28 +++++++++++++------
2 files changed, 33 insertions(+), 16 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
index 17efc8eab4cfb..a3c359124887e 100644
--- a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
+++ b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c
@@ -294,17 +294,22 @@ static void octep_vf_clean_irqs(struct octep_vf_device *oct)
static void octep_vf_update_pkt(struct octep_vf_iq *iq, struct octep_vf_oq *oq)
{
- u32 pkts_pend = oq->pkts_pending;
+ u32 pkts_pend = READ_ONCE(oq->pkts_pending);
+ u32 last_pkt_count = READ_ONCE(oq->last_pkt_count);
+ u32 pkts_processed = READ_ONCE(iq->pkts_processed);
+ u32 pkt_in_done = READ_ONCE(iq->pkt_in_done);
netdev_dbg(iq->netdev, "enabling intr for Q-%u\n", iq->q_no);
- if (iq->pkts_processed) {
- writel(iq->pkts_processed, iq->inst_cnt_reg);
- iq->pkt_in_done -= iq->pkts_processed;
- iq->pkts_processed = 0;
+ if (pkts_processed) {
+ writel(pkts_processed, iq->inst_cnt_reg);
+ readl(iq->inst_cnt_reg);
+ WRITE_ONCE(iq->pkt_in_done, (pkt_in_done - pkts_processed));
+ WRITE_ONCE(iq->pkts_processed, 0);
}
- if (oq->last_pkt_count - pkts_pend) {
- writel(oq->last_pkt_count - pkts_pend, oq->pkts_sent_reg);
- oq->last_pkt_count = pkts_pend;
+ if (last_pkt_count - pkts_pend) {
+ writel(last_pkt_count - pkts_pend, oq->pkts_sent_reg);
+ readl(oq->pkts_sent_reg);
+ WRITE_ONCE(oq->last_pkt_count, pkts_pend);
}
/* Flush the previous wrties before writing to RESEND bit */
diff --git a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.c b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.c
index 6f865dbbba6c6..b579d5b545c46 100644
--- a/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.c
+++ b/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_rx.c
@@ -325,9 +325,16 @@ static int octep_vf_oq_check_hw_for_pkts(struct octep_vf_device *oct,
struct octep_vf_oq *oq)
{
u32 pkt_count, new_pkts;
+ u32 last_pkt_count, pkts_pending;
pkt_count = readl(oq->pkts_sent_reg);
- new_pkts = pkt_count - oq->last_pkt_count;
+ last_pkt_count = READ_ONCE(oq->last_pkt_count);
+ new_pkts = pkt_count - last_pkt_count;
+
+ if (pkt_count < last_pkt_count) {
+ dev_err(oq->dev, "OQ-%u pkt_count(%u) < oq->last_pkt_count(%u)\n",
+ oq->q_no, pkt_count, last_pkt_count);
+ }
/* Clear the hardware packets counter register if the rx queue is
* being processed continuously with-in a single interrupt and
@@ -339,8 +346,9 @@ static int octep_vf_oq_check_hw_for_pkts(struct octep_vf_device *oct,
pkt_count = readl(oq->pkts_sent_reg);
new_pkts += pkt_count;
}
- oq->last_pkt_count = pkt_count;
- oq->pkts_pending += new_pkts;
+ WRITE_ONCE(oq->last_pkt_count, pkt_count);
+ pkts_pending = READ_ONCE(oq->pkts_pending);
+ WRITE_ONCE(oq->pkts_pending, (pkts_pending + new_pkts));
return new_pkts;
}
@@ -369,7 +377,7 @@ static int __octep_vf_oq_process_rx(struct octep_vf_device *oct,
struct sk_buff *skb;
u32 read_idx;
- read_idx = oq->host_read_idx;
+ read_idx = READ_ONCE(oq->host_read_idx);
rx_bytes = 0;
desc_used = 0;
for (pkt = 0; pkt < pkts_to_process; pkt++) {
@@ -463,7 +471,7 @@ static int __octep_vf_oq_process_rx(struct octep_vf_device *oct,
napi_gro_receive(oq->napi, skb);
}
- oq->host_read_idx = read_idx;
+ WRITE_ONCE(oq->host_read_idx, read_idx);
oq->refill_count += desc_used;
oq->stats->packets += pkt;
oq->stats->bytes += rx_bytes;
@@ -486,22 +494,26 @@ int octep_vf_oq_process_rx(struct octep_vf_oq *oq, int budget)
{
u32 pkts_available, pkts_processed, total_pkts_processed;
struct octep_vf_device *oct = oq->octep_vf_dev;
+ u32 pkts_pending;
pkts_available = 0;
pkts_processed = 0;
total_pkts_processed = 0;
while (total_pkts_processed < budget) {
/* update pending count only when current one exhausted */
- if (oq->pkts_pending == 0)
+ pkts_pending = READ_ONCE(oq->pkts_pending);
+ if (pkts_pending == 0)
octep_vf_oq_check_hw_for_pkts(oct, oq);
+ pkts_pending = READ_ONCE(oq->pkts_pending);
pkts_available = min(budget - total_pkts_processed,
- oq->pkts_pending);
+ pkts_pending);
if (!pkts_available)
break;
pkts_processed = __octep_vf_oq_process_rx(oct, oq,
pkts_available);
- oq->pkts_pending -= pkts_processed;
+ pkts_pending = READ_ONCE(oq->pkts_pending);
+ WRITE_ONCE(oq->pkts_pending, (pkts_pending - pkts_processed));
total_pkts_processed += pkts_processed;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 238/311] wifi: cw1200: Fix locking in error paths
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (236 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 237/311] octeon_ep_vf: avoid compiler and IQ/OQ reordering Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 239/311] wifi: wlcore: Fix a locking bug Sasha Levin
` (86 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Bart Van Assche, Johannes Berg, Sasha Levin
From: Bart Van Assche <bvanassche@acm.org>
[ Upstream commit d98c24617a831e92e7224a07dcaed2dd0b02af96 ]
cw1200_wow_suspend() must only return with priv->conf_mutex locked if it
returns zero. This mutex must be unlocked if an error is returned. Add
mutex_unlock() calls to the error paths from which that call is missing.
This has been detected by the Clang thread-safety analyzer.
Fixes: a910e4a94f69 ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260223220102.2158611-25-bart.vanassche@linux.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/st/cw1200/pm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/st/cw1200/pm.c b/drivers/net/wireless/st/cw1200/pm.c
index 2002e3f9fe45b..b656afe65db07 100644
--- a/drivers/net/wireless/st/cw1200/pm.c
+++ b/drivers/net/wireless/st/cw1200/pm.c
@@ -264,12 +264,14 @@ int cw1200_wow_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
wiphy_err(priv->hw->wiphy,
"PM request failed: %d. WoW is disabled.\n", ret);
cw1200_wow_resume(hw);
+ mutex_unlock(&priv->conf_mutex);
return -EBUSY;
}
/* Force resume if event is coming from the device. */
if (atomic_read(&priv->bh_rx)) {
cw1200_wow_resume(hw);
+ mutex_unlock(&priv->conf_mutex);
return -EAGAIN;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 239/311] wifi: wlcore: Fix a locking bug
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (237 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 238/311] wifi: cw1200: Fix locking in error paths Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 240/311] wifi: mt76: mt7996: Fix possible oob access in mt7996_mac_write_txwi_80211() Sasha Levin
` (85 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Bart Van Assche, Johannes Berg, Sasha Levin
From: Bart Van Assche <bvanassche@acm.org>
[ Upstream commit 72c6df8f284b3a49812ce2ac136727ace70acc7c ]
Make sure that wl->mutex is locked before it is unlocked. This has been
detected by the Clang thread-safety analyzer.
Fixes: 45aa7f071b06 ("wlcore: Use generic runtime pm calls for wowlan elp configuration")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260223220102.2158611-26-bart.vanassche@linux.dev
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/ti/wlcore/main.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 12f0167d7380e..1f6b906594930 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1875,6 +1875,8 @@ static int __maybe_unused wl1271_op_resume(struct ieee80211_hw *hw)
wl->wow_enabled);
WARN_ON(!wl->wow_enabled);
+ mutex_lock(&wl->mutex);
+
ret = pm_runtime_force_resume(wl->dev);
if (ret < 0) {
wl1271_error("ELP wakeup failure!");
@@ -1891,8 +1893,6 @@ static int __maybe_unused wl1271_op_resume(struct ieee80211_hw *hw)
run_irq_work = true;
spin_unlock_irqrestore(&wl->wl_lock, flags);
- mutex_lock(&wl->mutex);
-
/* test the recovery flag before calling any SDIO functions */
pending_recovery = test_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS,
&wl->flags);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 240/311] wifi: mt76: mt7996: Fix possible oob access in mt7996_mac_write_txwi_80211()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (238 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 239/311] wifi: wlcore: Fix a locking bug Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 241/311] wifi: mt76: mt7925: Fix possible oob access in mt7925_mac_write_txwi_80211() Sasha Levin
` (84 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Lorenzo Bianconi, Johannes Berg, Sasha Levin
From: Lorenzo Bianconi <lorenzo@kernel.org>
[ Upstream commit 60862846308627e9e15546bb647a00de44deb27b ]
Check frame length before accessing the mgmt fields in
mt7996_mac_write_txwi_80211 in order to avoid a possible oob access.
Fixes: 98686cd21624c ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260226-mt76-addba-req-oob-access-v1-1-b0f6d1ad4850@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7996/mac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
index 2560e2f46e89a..d4f3ee943b472 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
@@ -800,6 +800,7 @@ mt7996_mac_write_txwi_80211(struct mt7996_dev *dev, __le32 *txwi,
u32 val;
if (ieee80211_is_action(fc) &&
+ skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 &&
mgmt->u.action.category == WLAN_CATEGORY_BACK &&
mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ) {
if (is_mt7990(&dev->mt76))
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 241/311] wifi: mt76: mt7925: Fix possible oob access in mt7925_mac_write_txwi_80211()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (239 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 240/311] wifi: mt76: mt7996: Fix possible oob access in mt7996_mac_write_txwi_80211() Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 242/311] wifi: mt76: Fix possible oob access in mt76_connac2_mac_write_txwi_80211() Sasha Levin
` (83 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Lorenzo Bianconi, Johannes Berg, Sasha Levin
From: Lorenzo Bianconi <lorenzo@kernel.org>
[ Upstream commit c41a9abd6ae31d130e8f332e7c8800c4c866234b ]
Check frame length before accessing the mgmt fields in
mt7925_mac_write_txwi_80211 in order to avoid a possible oob access.
Fixes: c948b5da6bbec ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260226-mt76-addba-req-oob-access-v1-2-b0f6d1ad4850@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt7925/mac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
index 871b67101976a..0d94359004233 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7925/mac.c
@@ -668,6 +668,7 @@ mt7925_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
u32 val;
if (ieee80211_is_action(fc) &&
+ skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 &&
mgmt->u.action.category == WLAN_CATEGORY_BACK &&
mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ)
tid = MT_TX_ADDBA;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 242/311] wifi: mt76: Fix possible oob access in mt76_connac2_mac_write_txwi_80211()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (240 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 241/311] wifi: mt76: mt7925: Fix possible oob access in mt7925_mac_write_txwi_80211() Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 243/311] indirect_call_wrapper: do not reevaluate function pointer Sasha Levin
` (82 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Lorenzo Bianconi, Johannes Berg, Sasha Levin
From: Lorenzo Bianconi <lorenzo@kernel.org>
[ Upstream commit 4e10a730d1b511ff49723371ed6d694dd1b2c785 ]
Check frame length before accessing the mgmt fields in
mt76_connac2_mac_write_txwi_80211 in order to avoid a possible oob
access.
Fixes: 577dbc6c656d ("mt76: mt7915: enable offloading of sequence number assignment")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260226-mt76-addba-req-oob-access-v1-3-b0f6d1ad4850@kernel.org
[fix check to also cover mgmt->u.action.u.addba_req.capab,
correct Fixes tag]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
index 3304b5971be09..b41ca1410da92 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c
@@ -413,6 +413,7 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
u32 val;
if (ieee80211_is_action(fc) &&
+ skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 + 1 + 2 &&
mgmt->u.action.category == WLAN_CATEGORY_BACK &&
mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ) {
u16 capab = le16_to_cpu(mgmt->u.action.u.addba_req.capab);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 243/311] indirect_call_wrapper: do not reevaluate function pointer
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (241 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 242/311] wifi: mt76: Fix possible oob access in mt76_connac2_mac_write_txwi_80211() Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 244/311] net/rds: Fix circular locking dependency in rds_tcp_tune Sasha Levin
` (81 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Eric Dumazet, Kuniyuki Iwashima, Paolo Abeni, Sasha Levin
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 710f5c76580306cdb9ec51fac8fcf6a8faff7821 ]
We have an increasing number of READ_ONCE(xxx->function)
combined with INDIRECT_CALL_[1234]() helpers.
Unfortunately this forces INDIRECT_CALL_[1234]() to read
xxx->function many times, which is not what we wanted.
Fix these macros so that xxx->function value is not reloaded.
$ scripts/bloat-o-meter -t vmlinux.0 vmlinux
add/remove: 0/0 grow/shrink: 1/65 up/down: 122/-1084 (-962)
Function old new delta
ip_push_pending_frames 59 181 +122
ip6_finish_output 687 681 -6
__udp_enqueue_schedule_skb 1078 1072 -6
ioam6_output 2319 2312 -7
xfrm4_rcv_encap_finish2 64 56 -8
xfrm4_output 297 289 -8
vrf_ip_local_out 278 270 -8
vrf_ip6_local_out 278 270 -8
seg6_input_finish 64 56 -8
rpl_output 700 692 -8
ipmr_forward_finish 124 116 -8
ip_forward_finish 143 135 -8
ip6mr_forward2_finish 100 92 -8
ip6_forward_finish 73 65 -8
input_action_end_bpf 1091 1083 -8
dst_input 52 44 -8
__xfrm6_output 801 793 -8
__xfrm4_output 83 75 -8
bpf_input 500 491 -9
__tcp_check_space 530 521 -9
input_action_end_dt6 291 280 -11
vti6_tnl_xmit 1634 1622 -12
bpf_xmit 1203 1191 -12
rpl_input 497 483 -14
rawv6_send_hdrinc 1355 1341 -14
ndisc_send_skb 1030 1016 -14
ipv6_srh_rcv 1377 1363 -14
ip_send_unicast_reply 1253 1239 -14
ip_rcv_finish 226 212 -14
ip6_rcv_finish 300 286 -14
input_action_end_x_core 205 191 -14
input_action_end_x 355 341 -14
input_action_end_t 205 191 -14
input_action_end_dx6_finish 127 113 -14
input_action_end_dx4_finish 373 359 -14
input_action_end_dt4 426 412 -14
input_action_end_core 186 172 -14
input_action_end_b6_encap 292 278 -14
input_action_end_b6 198 184 -14
igmp6_send 1332 1318 -14
ip_sublist_rcv 864 848 -16
ip6_sublist_rcv 1091 1075 -16
ipv6_rpl_srh_rcv 1937 1920 -17
xfrm_policy_queue_process 1246 1228 -18
seg6_output_core 903 885 -18
mld_sendpack 856 836 -20
NF_HOOK 756 736 -20
vti_tunnel_xmit 1447 1426 -21
input_action_end_dx6 664 642 -22
input_action_end 1502 1480 -22
sock_sendmsg_nosec 134 111 -23
ip6mr_forward2 388 364 -24
sock_recvmsg_nosec 134 109 -25
seg6_input_core 836 810 -26
ip_send_skb 172 146 -26
ip_local_out 140 114 -26
ip6_local_out 140 114 -26
__sock_sendmsg 162 136 -26
__ip_queue_xmit 1196 1170 -26
__ip_finish_output 405 379 -26
ipmr_queue_fwd_xmit 373 346 -27
sock_recvmsg 173 145 -28
ip6_xmit 1635 1607 -28
xfrm_output_resume 1418 1389 -29
ip_build_and_send_pkt 625 591 -34
dst_output 504 432 -72
Total: Before=25217686, After=25216724, chg -0.00%
Fixes: 283c16a2dfd3 ("indirect call wrappers: helpers to speed-up indirect calls of builtin")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260227172603.1700433-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/indirect_call_wrapper.h | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/include/linux/indirect_call_wrapper.h b/include/linux/indirect_call_wrapper.h
index 35227d47cfc98..dc272b514a01b 100644
--- a/include/linux/indirect_call_wrapper.h
+++ b/include/linux/indirect_call_wrapper.h
@@ -16,22 +16,26 @@
*/
#define INDIRECT_CALL_1(f, f1, ...) \
({ \
- likely(f == f1) ? f1(__VA_ARGS__) : f(__VA_ARGS__); \
+ typeof(f) __f1 = (f); \
+ likely(__f1 == f1) ? f1(__VA_ARGS__) : __f1(__VA_ARGS__); \
})
#define INDIRECT_CALL_2(f, f2, f1, ...) \
({ \
- likely(f == f2) ? f2(__VA_ARGS__) : \
- INDIRECT_CALL_1(f, f1, __VA_ARGS__); \
+ typeof(f) __f2 = (f); \
+ likely(__f2 == f2) ? f2(__VA_ARGS__) : \
+ INDIRECT_CALL_1(__f2, f1, __VA_ARGS__); \
})
#define INDIRECT_CALL_3(f, f3, f2, f1, ...) \
({ \
- likely(f == f3) ? f3(__VA_ARGS__) : \
- INDIRECT_CALL_2(f, f2, f1, __VA_ARGS__); \
+ typeof(f) __f3 = (f); \
+ likely(__f3 == f3) ? f3(__VA_ARGS__) : \
+ INDIRECT_CALL_2(__f3, f2, f1, __VA_ARGS__); \
})
#define INDIRECT_CALL_4(f, f4, f3, f2, f1, ...) \
({ \
- likely(f == f4) ? f4(__VA_ARGS__) : \
- INDIRECT_CALL_3(f, f3, f2, f1, __VA_ARGS__); \
+ typeof(f) __f4 = (f); \
+ likely(__f4 == f4) ? f4(__VA_ARGS__) : \
+ INDIRECT_CALL_3(__f4, f3, f2, f1, __VA_ARGS__); \
})
#define INDIRECT_CALLABLE_DECLARE(f) f
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 244/311] net/rds: Fix circular locking dependency in rds_tcp_tune
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (242 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 243/311] indirect_call_wrapper: do not reevaluate function pointer Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 245/311] xen/acpi-processor: fix _CST detection using undersized evaluation buffer Sasha Levin
` (80 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Allison Henderson, syzbot+2e2cf5331207053b8106, Paolo Abeni,
Sasha Levin
From: Allison Henderson <achender@kernel.org>
[ Upstream commit 6a877ececd6daa002a9a0002cd0fbca6592a9244 ]
syzbot reported a circular locking dependency in rds_tcp_tune() where
sk_net_refcnt_upgrade() is called while holding the socket lock:
======================================================
WARNING: possible circular locking dependency detected
======================================================
kworker/u10:8/15040 is trying to acquire lock:
ffffffff8e9aaf80 (fs_reclaim){+.+.}-{0:0},
at: __kmalloc_cache_noprof+0x4b/0x6f0
but task is already holding lock:
ffff88805a3c1ce0 (k-sk_lock-AF_INET6){+.+.}-{0:0},
at: rds_tcp_tune+0xd7/0x930
The issue occurs because sk_net_refcnt_upgrade() performs memory
allocation (via get_net_track() -> ref_tracker_alloc()) while the
socket lock is held, creating a circular dependency with fs_reclaim.
Fix this by moving sk_net_refcnt_upgrade() outside the socket lock
critical section. This is safe because the fields modified by the
sk_net_refcnt_upgrade() call (sk_net_refcnt, ns_tracker) are not
accessed by any concurrent code path at this point.
v2:
- Corrected fixes tag
- check patch line wrap nits
- ai commentary nits
Reported-by: syzbot+2e2cf5331207053b8106@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=2e2cf5331207053b8106
Fixes: 3a58f13a881e ("net: rds: acquire refcount on TCP sockets")
Signed-off-by: Allison Henderson <achender@kernel.org>
Link: https://patch.msgid.link/20260227202336.167757-1-achender@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/rds/tcp.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index 3cc2f303bf786..b66dfcc3efaa0 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -495,18 +495,24 @@ bool rds_tcp_tune(struct socket *sock)
struct rds_tcp_net *rtn;
tcp_sock_set_nodelay(sock->sk);
- lock_sock(sk);
/* TCP timer functions might access net namespace even after
* a process which created this net namespace terminated.
*/
if (!sk->sk_net_refcnt) {
- if (!maybe_get_net(net)) {
- release_sock(sk);
+ if (!maybe_get_net(net))
return false;
- }
+ /*
+ * sk_net_refcnt_upgrade() must be called before lock_sock()
+ * because it does a GFP_KERNEL allocation, which can trigger
+ * fs_reclaim and create a circular lock dependency with the
+ * socket lock. The fields it modifies (sk_net_refcnt,
+ * ns_tracker) are not accessed by any concurrent code path
+ * at this point.
+ */
sk_net_refcnt_upgrade(sk);
put_net(net);
}
+ lock_sock(sk);
rtn = net_generic(net, rds_tcp_netid);
if (rtn->sndbuf_size > 0) {
sk->sk_sndbuf = rtn->sndbuf_size;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 245/311] xen/acpi-processor: fix _CST detection using undersized evaluation buffer
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (243 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 244/311] net/rds: Fix circular locking dependency in rds_tcp_tune Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 246/311] ASoC: SDCA: Add allocation failure check for Entity name Sasha Levin
` (79 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: David Thomson, Jan Beulich, Juergen Gross, Sasha Levin
From: David Thomson <dt@linux-mail.net>
[ Upstream commit 8b57227d59a86fc06d4f09de08f98133680f2cae ]
read_acpi_id() attempts to evaluate _CST using a stack buffer of
sizeof(union acpi_object) (48 bytes), but _CST returns a nested Package
of sub-Packages (one per C-state, each containing a register descriptor,
type, latency, and power) requiring hundreds of bytes. The evaluation
always fails with AE_BUFFER_OVERFLOW.
On modern systems using FFH/MWAIT entry (where pblk is zero), this
causes the function to return before setting the acpi_id_cst_present
bit. In check_acpi_ids(), flags.power is then zero for all Phase 2 CPUs
(physical CPUs beyond dom0's vCPU count), so push_cxx_to_hypervisor() is
never called for them.
On a system with dom0_max_vcpus=2 and 8 physical CPUs, only PCPUs 0-1
receive C-state data. PCPUs 2-7 are stuck in C0/C1 idle, unable to
enter C2/C3. This costs measurable wall power (4W observed on an Intel
Core Ultra 7 265K with Xen 4.20).
The function never uses the _CST return value -- it only needs to know
whether _CST exists. Replace the broken acpi_evaluate_object() call with
acpi_has_method(), which correctly detects _CST presence using
acpi_get_handle() without any buffer allocation. This brings C-state
detection to parity with the P-state path, which already works correctly
for Phase 2 CPUs.
Fixes: 59a568029181 ("xen/acpi-processor: C and P-state driver that uploads said data to hypervisor.")
Signed-off-by: David Thomson <dt@linux-mail.net>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Message-ID: <20260224093707.19679-1-dt@linux-mail.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/xen/xen-acpi-processor.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
index f2e8eaf684ba6..8d1860bd5d578 100644
--- a/drivers/xen/xen-acpi-processor.c
+++ b/drivers/xen/xen-acpi-processor.c
@@ -379,11 +379,8 @@ read_acpi_id(acpi_handle handle, u32 lvl, void *context, void **rv)
acpi_psd[acpi_id].domain);
}
- status = acpi_evaluate_object(handle, "_CST", NULL, &buffer);
- if (ACPI_FAILURE(status)) {
- if (!pblk)
- return AE_OK;
- }
+ if (!pblk && !acpi_has_method(handle, "_CST"))
+ return AE_OK;
/* .. and it has a C-state */
__set_bit(acpi_id, acpi_id_cst_present);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 246/311] ASoC: SDCA: Add allocation failure check for Entity name
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (244 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 245/311] xen/acpi-processor: fix _CST detection using undersized evaluation buffer Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 247/311] ice: fix adding AQ LLDP filter for VF Sasha Levin
` (78 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable; +Cc: Charles Keepax, Mark Brown, Sasha Levin
From: Charles Keepax <ckeepax@opensource.cirrus.com>
[ Upstream commit 27990181031fdcdbe0f7c46011f6404e5d116386 ]
Currently find_sdca_entity_iot() can allocate a string for the
Entity name but it doesn't check if that allocation succeeded.
Add the missing NULL check after the allocation.
Fixes: 48fa77af2f4a ("ASoC: SDCA: Add terminal type into input/output widget name")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260303141707.3841635-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sdca/sdca_functions.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sdca/sdca_functions.c b/sound/soc/sdca/sdca_functions.c
index e86004c9dea03..d2de9e81b4f9f 100644
--- a/sound/soc/sdca/sdca_functions.c
+++ b/sound/soc/sdca/sdca_functions.c
@@ -1120,9 +1120,12 @@ static int find_sdca_entity_iot(struct device *dev,
if (!terminal->is_dataport) {
const char *type_name = sdca_find_terminal_name(terminal->type);
- if (type_name)
+ if (type_name) {
entity->label = devm_kasprintf(dev, GFP_KERNEL, "%s %s",
entity->label, type_name);
+ if (!entity->label)
+ return -ENOMEM;
+ }
}
ret = fwnode_property_read_u32(entity_node,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 247/311] ice: fix adding AQ LLDP filter for VF
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (245 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 246/311] ASoC: SDCA: Add allocation failure check for Entity name Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 248/311] ice: Fix memory leak in ice_set_ringparam() Sasha Levin
` (77 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Larysa Zaremba, Aleksandr Loktionov, Rafal Romanowski,
Tony Nguyen, Sasha Levin
From: Larysa Zaremba <larysa.zaremba@intel.com>
[ Upstream commit eef33aa44935d001747ca97703c08dd6f9031162 ]
The referenced commit came from a misunderstanding of the FW LLDP filter
AQ (Admin Queue) command due to the error in the internal documentation.
Contrary to the assumptions in the original commit, VFs can be added and
deleted from this filter without any problems. Introduced dev_info message
proved to be useful, so reverting the whole commit does not make sense.
Without this fix, trusted VFs do not receive LLDP traffic, if there is an
AQ LLDP filter on PF. When trusted VF attempts to add an LLDP multicast
MAC address, the following message can be seen in dmesg on host:
ice 0000:33:00.0: Failed to add Rx LLDP rule on VSI 20 error: -95
Revert checking VSI type when adding LLDP filter through AQ.
Fixes: 4d5a1c4e6d49 ("ice: do not add LLDP-specific filter if not necessary")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c
index 785bf5cc1b25e..a400bf4f239aa 100644
--- a/drivers/net/ethernet/intel/ice/ice_common.c
+++ b/drivers/net/ethernet/intel/ice/ice_common.c
@@ -6429,7 +6429,7 @@ int ice_lldp_fltr_add_remove(struct ice_hw *hw, struct ice_vsi *vsi, bool add)
struct ice_aqc_lldp_filter_ctrl *cmd;
struct libie_aq_desc desc;
- if (vsi->type != ICE_VSI_PF || !ice_fw_supports_lldp_fltr_ctrl(hw))
+ if (!ice_fw_supports_lldp_fltr_ctrl(hw))
return -EOPNOTSUPP;
cmd = libie_aq_raw(&desc);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 248/311] ice: Fix memory leak in ice_set_ringparam()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (246 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 247/311] ice: fix adding AQ LLDP filter for VF Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 249/311] libie: don't unroll if fwlog isn't supported Sasha Levin
` (76 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Zilin Guan, Paul Menzel, Aleksandr Loktionov, Rinitha S,
Tony Nguyen, Sasha Levin
From: Zilin Guan <zilin@seu.edu.cn>
[ Upstream commit fe868b499d16f55bbeea89992edb98043c9de416 ]
In ice_set_ringparam, tx_rings and xdp_rings are allocated before
rx_rings. If the allocation of rx_rings fails, the code jumps to
the done label leaking both tx_rings and xdp_rings. Furthermore, if
the setup of an individual Rx ring fails during the loop, the code jumps
to the free_tx label which releases tx_rings but leaks xdp_rings.
Fix this by introducing a free_xdp label and updating the error paths to
ensure both xdp_rings and tx_rings are properly freed if rx_rings
allocation or setup fails.
Compile tested only. Issue found using a prototype static analysis tool
and code review.
Fixes: fcea6f3da546 ("ice: Add stats and ethtool support")
Fixes: efc2214b6047 ("ice: Add support for XDP")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_ethtool.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index e9f2618950c80..5377550a2b6e1 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -3322,7 +3322,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring,
rx_rings = kcalloc(vsi->num_rxq, sizeof(*rx_rings), GFP_KERNEL);
if (!rx_rings) {
err = -ENOMEM;
- goto done;
+ goto free_xdp;
}
ice_for_each_rxq(vsi, i) {
@@ -3349,7 +3349,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring,
}
kfree(rx_rings);
err = -ENOMEM;
- goto free_tx;
+ goto free_xdp;
}
}
@@ -3402,6 +3402,13 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring,
}
goto done;
+free_xdp:
+ if (xdp_rings) {
+ ice_for_each_xdp_txq(vsi, i)
+ ice_free_tx_ring(&xdp_rings[i]);
+ kfree(xdp_rings);
+ }
+
free_tx:
/* error cleanup if the Rx allocations failed after getting Tx */
if (tx_rings) {
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 249/311] libie: don't unroll if fwlog isn't supported
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (247 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 248/311] ice: Fix memory leak in ice_set_ringparam() Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 250/311] iavf: fix netdev->max_mtu to respect actual hardware limit Sasha Levin
` (75 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Michal Swiatkowski, Aleksandr Loktionov, Simon Horman, Rinitha S,
Tony Nguyen, Sasha Levin
From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
[ Upstream commit 636cc3bd12f499c74eaf5dc9a7d5b832f1bb24ed ]
The libie_fwlog_deinit() function can be called during driver unload
even when firmware logging was never properly initialized. This led to call
trace:
[ 148.576156] Oops: Oops: 0000 [#1] SMP NOPTI
[ 148.576167] CPU: 80 UID: 0 PID: 12843 Comm: rmmod Kdump: loaded Not tainted 6.17.0-rc7next-queue-3oct-01915-g06d79d51cf51 #1 PREEMPT(full)
[ 148.576177] Hardware name: HPE ProLiant DL385 Gen10 Plus/ProLiant DL385 Gen10 Plus, BIOS A42 07/18/2020
[ 148.576182] RIP: 0010:__dev_printk+0x16/0x70
[ 148.576196] Code: 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 41 55 41 54 49 89 d4 55 48 89 fd 53 48 85 f6 74 3c <4c> 8b 6e 50 48 89 f3 4d 85 ed 75 03 4c 8b 2e 48 89 df e8 f3 27 98
[ 148.576204] RSP: 0018:ffffd2fd7ea17a48 EFLAGS: 00010202
[ 148.576211] RAX: ffffd2fd7ea17aa0 RBX: ffff8eb288ae2000 RCX: 0000000000000000
[ 148.576217] RDX: ffffd2fd7ea17a70 RSI: 00000000000000c8 RDI: ffffffffb68d3d88
[ 148.576222] RBP: ffffffffb68d3d88 R08: 0000000000000000 R09: 0000000000000000
[ 148.576227] R10: 00000000000000c8 R11: ffff8eb2b1a49400 R12: ffffd2fd7ea17a70
[ 148.576231] R13: ffff8eb3141fb000 R14: ffffffffc1215b48 R15: ffffffffc1215bd8
[ 148.576236] FS: 00007f5666ba6740(0000) GS:ffff8eb2472b9000(0000) knlGS:0000000000000000
[ 148.576242] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 148.576247] CR2: 0000000000000118 CR3: 000000011ad17000 CR4: 0000000000350ef0
[ 148.576252] Call Trace:
[ 148.576258] <TASK>
[ 148.576269] _dev_warn+0x7c/0x96
[ 148.576290] libie_fwlog_deinit+0x112/0x117 [libie_fwlog]
[ 148.576303] ixgbe_remove+0x63/0x290 [ixgbe]
[ 148.576342] pci_device_remove+0x42/0xb0
[ 148.576354] device_release_driver_internal+0x19c/0x200
[ 148.576365] driver_detach+0x48/0x90
[ 148.576372] bus_remove_driver+0x6d/0xf0
[ 148.576383] pci_unregister_driver+0x2e/0xb0
[ 148.576393] ixgbe_exit_module+0x1c/0xd50 [ixgbe]
[ 148.576430] __do_sys_delete_module.isra.0+0x1bc/0x2e0
[ 148.576446] do_syscall_64+0x7f/0x980
It can be reproduced by trying to unload ixgbe driver in recovery mode.
Fix that by checking if fwlog is supported before doing unroll.
Fixes: 641585bc978e ("ixgbe: fwlog support for e610")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/libie/fwlog.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/libie/fwlog.c b/drivers/net/ethernet/intel/libie/fwlog.c
index f39cc11cb7c56..5d890d9d3c4d5 100644
--- a/drivers/net/ethernet/intel/libie/fwlog.c
+++ b/drivers/net/ethernet/intel/libie/fwlog.c
@@ -1051,6 +1051,10 @@ void libie_fwlog_deinit(struct libie_fwlog *fwlog)
{
int status;
+ /* if FW logging isn't supported it means no configuration was done */
+ if (!libie_fwlog_supported(fwlog))
+ return;
+
/* make sure FW logging is disabled to not put the FW in a weird state
* for the next driver load
*/
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 250/311] iavf: fix netdev->max_mtu to respect actual hardware limit
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (248 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 249/311] libie: don't unroll if fwlog isn't supported Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 251/311] igb: Fix trigger of incorrect irq in igb_xsk_wakeup Sasha Levin
` (74 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Kohei Enju, Alexander Lobakin, Simon Horman, Rafal Romanowski,
Tony Nguyen, Sasha Levin
From: Kohei Enju <kohei@enjuk.jp>
[ Upstream commit b84852170153671bb0fa6737a6e48370addd8e1a ]
iavf sets LIBIE_MAX_MTU as netdev->max_mtu, ignoring vf_res->max_mtu
from PF [1]. This allows setting an MTU beyond the actual hardware
limit, causing TX queue timeouts [2].
Set correct netdev->max_mtu using vf_res->max_mtu from the PF.
Note that currently PF drivers such as ice/i40e set the frame size in
vf_res->max_mtu, not MTU. Convert vf_res->max_mtu to MTU before setting
netdev->max_mtu.
[1]
# ip -j -d link show $DEV | jq '.[0].max_mtu'
16356
[2]
iavf 0000:00:05.0 enp0s5: NETDEV WATCHDOG: CPU: 1: transmit queue 0 timed out 5692 ms
iavf 0000:00:05.0 enp0s5: NIC Link is Up Speed is 10 Gbps Full Duplex
iavf 0000:00:05.0 enp0s5: NETDEV WATCHDOG: CPU: 6: transmit queue 3 timed out 5312 ms
iavf 0000:00:05.0 enp0s5: NIC Link is Up Speed is 10 Gbps Full Duplex
...
Fixes: 5fa4caff59f2 ("iavf: switch to Page Pool")
Signed-off-by: Kohei Enju <kohei@enjuk.jp>
Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/iavf/iavf_main.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 4b0fc8f354bc9..53a0366fbf998 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -2797,7 +2797,22 @@ static void iavf_init_config_adapter(struct iavf_adapter *adapter)
netdev->watchdog_timeo = 5 * HZ;
netdev->min_mtu = ETH_MIN_MTU;
- netdev->max_mtu = LIBIE_MAX_MTU;
+
+ /* PF/VF API: vf_res->max_mtu is max frame size (not MTU).
+ * Convert to MTU.
+ */
+ if (!adapter->vf_res->max_mtu) {
+ netdev->max_mtu = LIBIE_MAX_MTU;
+ } else if (adapter->vf_res->max_mtu < LIBETH_RX_LL_LEN + ETH_MIN_MTU ||
+ adapter->vf_res->max_mtu >
+ LIBETH_RX_LL_LEN + LIBIE_MAX_MTU) {
+ netdev_warn_once(adapter->netdev,
+ "invalid max frame size %d from PF, using default MTU %d",
+ adapter->vf_res->max_mtu, LIBIE_MAX_MTU);
+ netdev->max_mtu = LIBIE_MAX_MTU;
+ } else {
+ netdev->max_mtu = adapter->vf_res->max_mtu - LIBETH_RX_LL_LEN;
+ }
if (!is_valid_ether_addr(adapter->hw.mac.addr)) {
dev_info(&pdev->dev, "Invalid MAC address %pM, using random\n",
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 251/311] igb: Fix trigger of incorrect irq in igb_xsk_wakeup
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (249 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 250/311] iavf: fix netdev->max_mtu to respect actual hardware limit Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 252/311] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function Sasha Levin
` (73 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Vivek Behera, Aleksandr Loktionov, Maciej Fijalkowski,
Saritha Sanigani, Tony Nguyen, Sasha Levin
From: Vivek Behera <vivek.behera@siemens.com>
[ Upstream commit d4c13ab36273a8c318ba06799793cc1f5d9c6fa1 ]
The current implementation in the igb_xsk_wakeup expects
the Rx and Tx queues to share the same irq. This would lead
to triggering of incorrect irq in split irq configuration.
This patch addresses this issue which could impact environments
with 2 active cpu cores
or when the number of queues is reduced to 2 or less
cat /proc/interrupts | grep eno2
167: 0 0 0 0 IR-PCI-MSIX-0000:08:00.0
0-edge eno2
168: 0 0 0 0 IR-PCI-MSIX-0000:08:00.0
1-edge eno2-rx-0
169: 0 0 0 0 IR-PCI-MSIX-0000:08:00.0
2-edge eno2-rx-1
170: 0 0 0 0 IR-PCI-MSIX-0000:08:00.0
3-edge eno2-tx-0
171: 0 0 0 0 IR-PCI-MSIX-0000:08:00.0
4-edge eno2-tx-1
Furthermore it uses the flags input argument to trigger either rx, tx or
both rx and tx irqs as specified in the ndo_xsk_wakeup api documentation
Fixes: 80f6ccf9f116 ("igb: Introduce XSK data structures and helpers")
Signed-off-by: Vivek Behera <vivek.behera@siemens.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Tested-by: Saritha Sanigani <sarithax.sanigani@intel.com> (A Contingent Worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/igb/igb_xsk.c | 38 +++++++++++++++++++-----
1 file changed, 30 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_xsk.c b/drivers/net/ethernet/intel/igb/igb_xsk.c
index 30ce5fbb5b776..ce4a7b58cad2f 100644
--- a/drivers/net/ethernet/intel/igb/igb_xsk.c
+++ b/drivers/net/ethernet/intel/igb/igb_xsk.c
@@ -524,6 +524,16 @@ bool igb_xmit_zc(struct igb_ring *tx_ring, struct xsk_buff_pool *xsk_pool)
return nb_pkts < budget;
}
+static u32 igb_sw_irq_prep(struct igb_q_vector *q_vector)
+{
+ u32 eics = 0;
+
+ if (!napi_if_scheduled_mark_missed(&q_vector->napi))
+ eics = q_vector->eims_value;
+
+ return eics;
+}
+
int igb_xsk_wakeup(struct net_device *dev, u32 qid, u32 flags)
{
struct igb_adapter *adapter = netdev_priv(dev);
@@ -542,20 +552,32 @@ int igb_xsk_wakeup(struct net_device *dev, u32 qid, u32 flags)
ring = adapter->tx_ring[qid];
- if (test_bit(IGB_RING_FLAG_TX_DISABLED, &ring->flags))
- return -ENETDOWN;
-
if (!READ_ONCE(ring->xsk_pool))
return -EINVAL;
- if (!napi_if_scheduled_mark_missed(&ring->q_vector->napi)) {
+ if (flags & XDP_WAKEUP_TX) {
+ if (test_bit(IGB_RING_FLAG_TX_DISABLED, &ring->flags))
+ return -ENETDOWN;
+
+ eics |= igb_sw_irq_prep(ring->q_vector);
+ }
+
+ if (flags & XDP_WAKEUP_RX) {
+ /* If IGB_FLAG_QUEUE_PAIRS is active, the q_vector
+ * and NAPI is shared between RX and TX.
+ * If NAPI is already running it would be marked as missed
+ * from the TX path, making this RX call a NOP
+ */
+ ring = adapter->rx_ring[qid];
+ eics |= igb_sw_irq_prep(ring->q_vector);
+ }
+
+ if (eics) {
/* Cause software interrupt */
- if (adapter->flags & IGB_FLAG_HAS_MSIX) {
- eics |= ring->q_vector->eims_value;
+ if (adapter->flags & IGB_FLAG_HAS_MSIX)
wr32(E1000_EICS, eics);
- } else {
+ else
wr32(E1000_ICS, E1000_ICS_RXDMT0);
- }
}
return 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 252/311] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (250 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 251/311] igb: Fix trigger of incorrect irq in igb_xsk_wakeup Sasha Levin
@ 2026-03-10 11:04 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 253/311] bpf: Fix a UAF issue in bpf_trampoline_link_cgroup_shim Sasha Levin
` (72 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:04 UTC (permalink / raw)
To: patches, stable
Cc: Vivek Behera, Jacob Keller, Aleksandr loktinov, Piotr Kwapulinski,
Song Yoong Siang, Avigail Dahan, Tony Nguyen, Sasha Levin
From: Vivek Behera <vivek.behera@siemens.com>
[ Upstream commit 554a1c34c11a057d01819ce9bb04653a8ffc8071 ]
This patch addresses the issue where the igc_xsk_wakeup function
was triggering an incorrect IRQ for tx-0 when the i226 is configured
with only 2 combined queues or in an environment with 2 active CPU cores.
This prevented XDP Zero-copy send functionality in such split IRQ
configurations.
The fix implements the correct logic for extracting q_vectors saved
during rx and tx ring allocation and utilizes flags provided by the
ndo_xsk_wakeup API to trigger the appropriate IRQ.
Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")
Fixes: 15fd021bc427 ("igc: Add Tx hardware timestamp request for AF_XDP zero-copy packet")
Signed-off-by: Vivek Behera <vivek.behera@siemens.com>
Reviewed-by: Jacob Keller <jacob.keller@intel.com>
Reviewed-by: Aleksandr loktinov <aleksandr.loktionov@intel.com>
Reviewed-by: Piotr Kwapulinski <piotr.kwapulinski@intel.com>
Reviewed-by: Song Yoong Siang <yoong.siang.song@intel.com>
Tested-by: Avigail Dahan <avigailx.dahan@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/igc/igc_main.c | 34 ++++++++++++++++-------
drivers/net/ethernet/intel/igc/igc_ptp.c | 3 +-
2 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 89a321a344d26..4439eeb378c1f 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -6908,28 +6908,29 @@ static int igc_xdp_xmit(struct net_device *dev, int num_frames,
return nxmit;
}
-static void igc_trigger_rxtxq_interrupt(struct igc_adapter *adapter,
- struct igc_q_vector *q_vector)
+static u32 igc_sw_irq_prep(struct igc_q_vector *q_vector)
{
- struct igc_hw *hw = &adapter->hw;
u32 eics = 0;
- eics |= q_vector->eims_value;
- wr32(IGC_EICS, eics);
+ if (!napi_if_scheduled_mark_missed(&q_vector->napi))
+ eics = q_vector->eims_value;
+
+ return eics;
}
int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
{
struct igc_adapter *adapter = netdev_priv(dev);
- struct igc_q_vector *q_vector;
+ struct igc_hw *hw = &adapter->hw;
struct igc_ring *ring;
+ u32 eics = 0;
if (test_bit(__IGC_DOWN, &adapter->state))
return -ENETDOWN;
if (!igc_xdp_is_enabled(adapter))
return -ENXIO;
-
+ /* Check if queue_id is valid. Tx and Rx queue numbers are always same */
if (queue_id >= adapter->num_rx_queues)
return -EINVAL;
@@ -6938,9 +6939,22 @@ int igc_xsk_wakeup(struct net_device *dev, u32 queue_id, u32 flags)
if (!ring->xsk_pool)
return -ENXIO;
- q_vector = adapter->q_vector[queue_id];
- if (!napi_if_scheduled_mark_missed(&q_vector->napi))
- igc_trigger_rxtxq_interrupt(adapter, q_vector);
+ if (flags & XDP_WAKEUP_RX)
+ eics |= igc_sw_irq_prep(ring->q_vector);
+
+ if (flags & XDP_WAKEUP_TX) {
+ /* If IGC_FLAG_QUEUE_PAIRS is active, the q_vector
+ * and NAPI is shared between RX and TX.
+ * If NAPI is already running it would be marked as missed
+ * from the RX path, making this TX call a NOP
+ */
+ ring = adapter->tx_ring[queue_id];
+ eics |= igc_sw_irq_prep(ring->q_vector);
+ }
+
+ if (eics)
+ /* Cause software interrupt */
+ wr32(IGC_EICS, eics);
return 0;
}
diff --git a/drivers/net/ethernet/intel/igc/igc_ptp.c b/drivers/net/ethernet/intel/igc/igc_ptp.c
index 7aae83c108fd7..44ee193867661 100644
--- a/drivers/net/ethernet/intel/igc/igc_ptp.c
+++ b/drivers/net/ethernet/intel/igc/igc_ptp.c
@@ -550,7 +550,8 @@ static void igc_ptp_free_tx_buffer(struct igc_adapter *adapter,
tstamp->buffer_type = 0;
/* Trigger txrx interrupt for transmit completion */
- igc_xsk_wakeup(adapter->netdev, tstamp->xsk_queue_index, 0);
+ igc_xsk_wakeup(adapter->netdev, tstamp->xsk_queue_index,
+ XDP_WAKEUP_TX);
return;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 253/311] bpf: Fix a UAF issue in bpf_trampoline_link_cgroup_shim
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (251 preceding siblings ...)
2026-03-10 11:04 ` [PATCH 6.19 252/311] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 254/311] smb/client: fix buffer size for smb311_posix_qinfo in smb2_compound_op() Sasha Levin
` (71 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Lang Xu, Kaiyan Mei, Martin KaFai Lau, Sasha Levin
From: Lang Xu <xulang@uniontech.com>
[ Upstream commit 56145d237385ca0e7ca9ff7b226aaf2eb8ef368b ]
The root cause of this bug is that when 'bpf_link_put' reduces the
refcount of 'shim_link->link.link' to zero, the resource is considered
released but may still be referenced via 'tr->progs_hlist' in
'cgroup_shim_find'. The actual cleanup of 'tr->progs_hlist' in
'bpf_shim_tramp_link_release' is deferred. During this window, another
process can cause a use-after-free via 'bpf_trampoline_link_cgroup_shim'.
Based on Martin KaFai Lau's suggestions, I have created a simple patch.
To fix this:
Add an atomic non-zero check in 'bpf_trampoline_link_cgroup_shim'.
Only increment the refcount if it is not already zero.
Testing:
I verified the fix by adding a delay in
'bpf_shim_tramp_link_release' to make the bug easier to trigger:
static void bpf_shim_tramp_link_release(struct bpf_link *link)
{
/* ... */
if (!shim_link->trampoline)
return;
+ msleep(100);
WARN_ON_ONCE(bpf_trampoline_unlink_prog(&shim_link->link,
shim_link->trampoline, NULL));
bpf_trampoline_put(shim_link->trampoline);
}
Before the patch, running a PoC easily reproduced the crash(almost 100%)
with a call trace similar to KaiyanM's report.
After the patch, the bug no longer occurs even after millions of
iterations.
Fixes: 69fd337a975c ("bpf: per-cgroup lsm flavor")
Reported-by: Kaiyan Mei <M202472210@hust.edu.cn>
Closes: https://lore.kernel.org/bpf/3c4ebb0b.46ff8.19abab8abe2.Coremail.kaiyanm@hust.edu.cn/
Signed-off-by: Lang Xu <xulang@uniontech.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/279EEE1BA1DDB49D+20260303095217.34436-1-xulang@uniontech.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/trampoline.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
index b9a358d7a78f1..47c70eb451f3a 100644
--- a/kernel/bpf/trampoline.c
+++ b/kernel/bpf/trampoline.c
@@ -796,10 +796,8 @@ int bpf_trampoline_link_cgroup_shim(struct bpf_prog *prog,
mutex_lock(&tr->mutex);
shim_link = cgroup_shim_find(tr, bpf_func);
- if (shim_link) {
+ if (shim_link && !IS_ERR(bpf_link_inc_not_zero(&shim_link->link.link))) {
/* Reusing existing shim attached by the other program. */
- bpf_link_inc(&shim_link->link.link);
-
mutex_unlock(&tr->mutex);
bpf_trampoline_put(tr); /* bpf_trampoline_get above */
return 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 254/311] smb/client: fix buffer size for smb311_posix_qinfo in smb2_compound_op()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (252 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 253/311] bpf: Fix a UAF issue in bpf_trampoline_link_cgroup_shim Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 255/311] smb/client: fix buffer size for smb311_posix_qinfo in SMB311_posix_query_info() Sasha Levin
` (70 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: ZhangGuoDong, ChenXiaoSong, Steve French, Sasha Levin
From: ZhangGuoDong <zhangguodong@kylinos.cn>
[ Upstream commit 12c43a062acb0ac137fc2a4a106d4d084b8c5416 ]
Use `sizeof(struct smb311_posix_qinfo)` instead of sizeof its pointer,
so the allocated buffer matches the actual struct size.
Fixes: 6a5f6592a0b6 ("SMB311: Add support for query info using posix extensions (level 100)")
Reported-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/smb2inode.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c
index 6b0420a5b52a7..5ebcc68560a06 100644
--- a/fs/smb/client/smb2inode.c
+++ b/fs/smb/client/smb2inode.c
@@ -325,7 +325,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
cfile->fid.volatile_fid,
SMB_FIND_FILE_POSIX_INFO,
SMB2_O_INFO_FILE, 0,
- sizeof(struct smb311_posix_qinfo *) +
+ sizeof(struct smb311_posix_qinfo) +
(PATH_MAX * 2) +
(sizeof(struct smb_sid) * 2), 0, NULL);
} else {
@@ -335,7 +335,7 @@ static int smb2_compound_op(const unsigned int xid, struct cifs_tcon *tcon,
COMPOUND_FID,
SMB_FIND_FILE_POSIX_INFO,
SMB2_O_INFO_FILE, 0,
- sizeof(struct smb311_posix_qinfo *) +
+ sizeof(struct smb311_posix_qinfo) +
(PATH_MAX * 2) +
(sizeof(struct smb_sid) * 2), 0, NULL);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 255/311] smb/client: fix buffer size for smb311_posix_qinfo in SMB311_posix_query_info()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (253 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 254/311] smb/client: fix buffer size for smb311_posix_qinfo in smb2_compound_op() Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 256/311] ipv6: fix NULL pointer deref in ip6_rt_get_dev_rcu() Sasha Levin
` (69 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: ZhangGuoDong, ChenXiaoSong, Steve French, Sasha Levin
From: ZhangGuoDong <zhangguodong@kylinos.cn>
[ Upstream commit 9621b996e4db1dbc2b3dc5d5910b7d6179397320 ]
SMB311_posix_query_info() is currently unused, but it may still be used in
some stable versions, so these changes are submitted as a separate patch.
Use `sizeof(struct smb311_posix_qinfo)` instead of sizeof its pointer,
so the allocated buffer matches the actual struct size.
Fixes: b1bc1874b885 ("smb311: Add support for SMB311 query info (non-compounded)")
Reported-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/smb2pdu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index b16d7b42a73c4..bf4a13acc8b86 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -3981,7 +3981,7 @@ SMB311_posix_query_info(const unsigned int xid, struct cifs_tcon *tcon,
u64 persistent_fid, u64 volatile_fid,
struct smb311_posix_qinfo *data, u32 *plen)
{
- size_t output_len = sizeof(struct smb311_posix_qinfo *) +
+ size_t output_len = sizeof(struct smb311_posix_qinfo) +
(sizeof(struct smb_sid) * 2) + (PATH_MAX * 2);
*plen = 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 256/311] ipv6: fix NULL pointer deref in ip6_rt_get_dev_rcu()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (254 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 255/311] smb/client: fix buffer size for smb311_posix_qinfo in SMB311_posix_query_info() Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 257/311] net: ipv4: fix ARM64 alignment fault in multipath hash seed Sasha Levin
` (68 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Jakub Kicinski, David Ahern, Sasha Levin
From: Jakub Kicinski <kuba@kernel.org>
[ Upstream commit 2ffb4f5c2ccb2fa1c049dd11899aee7967deef5a ]
l3mdev_master_dev_rcu() can return NULL when the slave device is being
un-slaved from a VRF. All other callers deal with this, but we lost
the fallback to loopback in ip6_rt_pcpu_alloc() -> ip6_rt_get_dev_rcu()
with commit 4832c30d5458 ("net: ipv6: put host and anycast routes on
device with address").
KASAN: null-ptr-deref in range [0x0000000000000108-0x000000000000010f]
RIP: 0010:ip6_rt_pcpu_alloc (net/ipv6/route.c:1418)
Call Trace:
ip6_pol_route (net/ipv6/route.c:2318)
fib6_rule_lookup (net/ipv6/fib6_rules.c:115)
ip6_route_output_flags (net/ipv6/route.c:2607)
vrf_process_v6_outbound (drivers/net/vrf.c:437)
I was tempted to rework the un-slaving code to clear the flag first
and insert synchronize_rcu() before we remove the upper. But looks like
the explicit fallback to loopback_dev is an established pattern.
And I guess avoiding the synchronize_rcu() is nice, too.
Fixes: 4832c30d5458 ("net: ipv6: put host and anycast routes on device with address")
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20260301194548.927324-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/route.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index cd229974b7974..e7d90a28948a4 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1063,7 +1063,8 @@ static struct net_device *ip6_rt_get_dev_rcu(const struct fib6_result *res)
*/
if (netif_is_l3_slave(dev) &&
!rt6_need_strict(&res->f6i->fib6_dst.addr))
- dev = l3mdev_master_dev_rcu(dev);
+ dev = l3mdev_master_dev_rcu(dev) ? :
+ dev_net(dev)->loopback_dev;
else if (!netif_is_l3_master(dev))
dev = dev_net(dev)->loopback_dev;
/* last case is netif_is_l3_master(dev) is true in which
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 257/311] net: ipv4: fix ARM64 alignment fault in multipath hash seed
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (255 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 256/311] ipv6: fix NULL pointer deref in ip6_rt_get_dev_rcu() Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 258/311] amd-xgbe: fix sleep while atomic on suspend/resume Sasha Levin
` (67 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Yung Chih Su, Eric Dumazet, Jakub Kicinski, Sasha Levin
From: Yung Chih Su <yuuchihsu@gmail.com>
[ Upstream commit 4ee7fa6cf78ff26d783d39e2949d14c4c1cd5e7f ]
`struct sysctl_fib_multipath_hash_seed` contains two u32 fields
(user_seed and mp_seed), making it an 8-byte structure with a 4-byte
alignment requirement.
In `fib_multipath_hash_from_keys()`, the code evaluates the entire
struct atomically via `READ_ONCE()`:
mp_seed = READ_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed).mp_seed;
While this silently works on GCC by falling back to unaligned regular
loads which the ARM64 kernel tolerates, it causes a fatal kernel panic
when compiled with Clang and LTO enabled.
Commit e35123d83ee3 ("arm64: lto: Strengthen READ_ONCE() to acquire
when CONFIG_LTO=y") strengthens `READ_ONCE()` to use Load-Acquire
instructions (`ldar` / `ldapr`) to prevent compiler reordering bugs
under Clang LTO. Since the macro evaluates the full 8-byte struct,
Clang emits a 64-bit `ldar` instruction. ARM64 architecture strictly
requires `ldar` to be naturally aligned, thus executing it on a 4-byte
aligned address triggers a strict Alignment Fault (FSC = 0x21).
Fix the read side by moving the `READ_ONCE()` directly to the `u32`
member, which emits a safe 32-bit `ldar Wn`.
Furthermore, Eric Dumazet pointed out that `WRITE_ONCE()` on the entire
struct in `proc_fib_multipath_hash_set_seed()` is also flawed. Analysis
shows that Clang splits this 8-byte write into two separate 32-bit
`str` instructions. While this avoids an alignment fault, it destroys
atomicity and exposes a tear-write vulnerability. Fix this by
explicitly splitting the write into two 32-bit `WRITE_ONCE()`
operations.
Finally, add the missing `READ_ONCE()` when reading `user_seed` in
`proc_fib_multipath_hash_seed()` to ensure proper pairing and
concurrency safety.
Fixes: 4ee2a8cace3f ("net: ipv4: Add a sysctl to set multipath hash seed")
Signed-off-by: Yung Chih Su <yuuchihsu@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20260302060247.7066-1-yuuchihsu@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/ip_fib.h | 2 +-
net/ipv4/sysctl_net_ipv4.c | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index b4495c38e0a01..318593743b6e1 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -559,7 +559,7 @@ static inline u32 fib_multipath_hash_from_keys(const struct net *net,
siphash_aligned_key_t hash_key;
u32 mp_seed;
- mp_seed = READ_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed).mp_seed;
+ mp_seed = READ_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed.mp_seed);
fib_multipath_hash_construct_key(&hash_key, mp_seed);
return flow_hash_from_keys_seed(keys, &hash_key);
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index a1a50a5c80dc1..a96875e32050a 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -486,7 +486,8 @@ static void proc_fib_multipath_hash_set_seed(struct net *net, u32 user_seed)
proc_fib_multipath_hash_rand_seed),
};
- WRITE_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed, new);
+ WRITE_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed.user_seed, new.user_seed);
+ WRITE_ONCE(net->ipv4.sysctl_fib_multipath_hash_seed.mp_seed, new.mp_seed);
}
static int proc_fib_multipath_hash_seed(const struct ctl_table *table, int write,
@@ -500,7 +501,7 @@ static int proc_fib_multipath_hash_seed(const struct ctl_table *table, int write
int ret;
mphs = &net->ipv4.sysctl_fib_multipath_hash_seed;
- user_seed = mphs->user_seed;
+ user_seed = READ_ONCE(mphs->user_seed);
tmp = *table;
tmp.data = &user_seed;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 258/311] amd-xgbe: fix sleep while atomic on suspend/resume
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (256 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 257/311] net: ipv4: fix ARM64 alignment fault in multipath hash seed Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 259/311] drm/sched: Fix kernel-doc warning for drm_sched_job_done() Sasha Levin
` (66 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Raju Rangoju, Jakub Kicinski, Sasha Levin
From: Raju Rangoju <Raju.Rangoju@amd.com>
[ Upstream commit e2f27363aa6d983504c6836dd0975535e2e9dba0 ]
The xgbe_powerdown() and xgbe_powerup() functions use spinlocks
(spin_lock_irqsave) while calling functions that may sleep:
- napi_disable() can sleep waiting for NAPI polling to complete
- flush_workqueue() can sleep waiting for pending work items
This causes a "BUG: scheduling while atomic" error during suspend/resume
cycles on systems using the AMD XGBE Ethernet controller.
The spinlock protection in these functions is unnecessary as these
functions are called from suspend/resume paths which are already serialized
by the PM core
Fix this by removing the spinlock. Since only code that takes this lock
is xgbe_powerdown() and xgbe_powerup(), remove it completely.
Fixes: c5aa9e3b8156 ("amd-xgbe: Initial AMD 10GbE platform driver")
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
Link: https://patch.msgid.link/20260302042124.1386445-1-Raju.Rangoju@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 10 ----------
drivers/net/ethernet/amd/xgbe/xgbe-main.c | 1 -
drivers/net/ethernet/amd/xgbe/xgbe.h | 3 ---
3 files changed, 14 deletions(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
index b5a60a0488967..20ce2ed4cd9f7 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c
@@ -1120,7 +1120,6 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
struct xgbe_hw_if *hw_if = &pdata->hw_if;
- unsigned long flags;
DBGPR("-->xgbe_powerdown\n");
@@ -1131,8 +1130,6 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
return -EINVAL;
}
- spin_lock_irqsave(&pdata->lock, flags);
-
if (caller == XGMAC_DRIVER_CONTEXT)
netif_device_detach(netdev);
@@ -1148,8 +1145,6 @@ int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
pdata->power_down = 1;
- spin_unlock_irqrestore(&pdata->lock, flags);
-
DBGPR("<--xgbe_powerdown\n");
return 0;
@@ -1159,7 +1154,6 @@ int xgbe_powerup(struct net_device *netdev, unsigned int caller)
{
struct xgbe_prv_data *pdata = netdev_priv(netdev);
struct xgbe_hw_if *hw_if = &pdata->hw_if;
- unsigned long flags;
DBGPR("-->xgbe_powerup\n");
@@ -1170,8 +1164,6 @@ int xgbe_powerup(struct net_device *netdev, unsigned int caller)
return -EINVAL;
}
- spin_lock_irqsave(&pdata->lock, flags);
-
pdata->power_down = 0;
xgbe_napi_enable(pdata, 0);
@@ -1186,8 +1178,6 @@ int xgbe_powerup(struct net_device *netdev, unsigned int caller)
xgbe_start_timers(pdata);
- spin_unlock_irqrestore(&pdata->lock, flags);
-
DBGPR("<--xgbe_powerup\n");
return 0;
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
index d1f0419edb234..7d45ea22a02e2 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
@@ -76,7 +76,6 @@ struct xgbe_prv_data *xgbe_alloc_pdata(struct device *dev)
pdata->netdev = netdev;
pdata->dev = dev;
- spin_lock_init(&pdata->lock);
spin_lock_init(&pdata->xpcs_lock);
mutex_init(&pdata->rss_mutex);
spin_lock_init(&pdata->tstamp_lock);
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h
index 03ef0f5484830..4ba23779b2b7e 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe.h
@@ -1003,9 +1003,6 @@ struct xgbe_prv_data {
unsigned int pp3;
unsigned int pp4;
- /* Overall device lock */
- spinlock_t lock;
-
/* XPCS indirect addressing lock */
spinlock_t xpcs_lock;
unsigned int xpcs_window_def_reg;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 259/311] drm/sched: Fix kernel-doc warning for drm_sched_job_done()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (257 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 258/311] amd-xgbe: fix sleep while atomic on suspend/resume Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 260/311] ata: libata: cancel pending work after clearing deferred_qc Sasha Levin
` (65 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Yujie Liu, Philipp Stanner, Sasha Levin
From: Yujie Liu <yujie.liu@intel.com>
[ Upstream commit 61ded1083b264ff67ca8c2de822c66b6febaf9a8 ]
There is a kernel-doc warning for the scheduler:
Warning: drivers/gpu/drm/scheduler/sched_main.c:367 function parameter 'result' not described in 'drm_sched_job_done'
Fix the warning by describing the undocumented error code.
Fixes: 539f9ee4b52a ("drm/scheduler: properly forward fence errors")
Signed-off-by: Yujie Liu <yujie.liu@intel.com>
[phasta: Flesh out commit message]
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patch.msgid.link/20260227082452.1802922-1-yujie.liu@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/scheduler/sched_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
index 1d4f1b822e7b7..2d70c06113cfe 100644
--- a/drivers/gpu/drm/scheduler/sched_main.c
+++ b/drivers/gpu/drm/scheduler/sched_main.c
@@ -361,6 +361,7 @@ static void drm_sched_run_free_queue(struct drm_gpu_scheduler *sched)
/**
* drm_sched_job_done - complete a job
* @s_job: pointer to the job which is done
+ * @result: 0 on success, -ERRNO on error
*
* Finish the job's fence and resubmit the work items.
*/
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 260/311] ata: libata: cancel pending work after clearing deferred_qc
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (258 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 259/311] drm/sched: Fix kernel-doc warning for drm_sched_job_done() Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 261/311] i2c: i801: Revert "i2c: i801: replace acpi_lock with I2C bus lock" Sasha Levin
` (64 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Niklas Cassel, syzbot+bcaf842a1e8ead8dfb89, Igor Pylypiv,
Damien Le Moal, Sasha Levin
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit aac9b27f7c1f2b2cf7f50a9ca633ecbbcaf22af9 ]
Syzbot reported a WARN_ON() in ata_scsi_deferred_qc_work(), caused by
ap->ops->qc_defer() returning non-zero before issuing the deferred qc.
ata_scsi_schedule_deferred_qc() is called during each command completion.
This function will check if there is a deferred QC, and if
ap->ops->qc_defer() returns zero, meaning that it is possible to queue the
deferred qc at this time (without being deferred), then it will queue the
work which will issue the deferred qc.
Once the work get to run, which can potentially be a very long time after
the work was scheduled, there is a WARN_ON() if ap->ops->qc_defer() returns
non-zero.
While we hold the ap->lock both when assigning and clearing deferred_qc,
and the work itself holds the ap->lock, the code currently does not cancel
the work after clearing the deferred qc.
This means that the following scenario can happen:
1) One or several NCQ commands are queued.
2) A non-NCQ command is queued, gets stored in ap->deferred_qc.
3) Last NCQ command gets completed, work is queued to issue the deferred
qc.
4) Timeout or error happens, ap->deferred_qc is cleared. The queued work is
currently NOT canceled.
5) Port is reset.
6) One or several NCQ commands are queued.
7) A non-NCQ command is queued, gets stored in ap->deferred_qc.
8) Work is finally run. Yet at this time, there is still NCQ commands in
flight.
The work in 8) really belongs to the non-NCQ command in 2), not to the
non-NCQ command in 7). The reason why the work is executed when it is not
supposed to, is because it was never canceled when ap->deferred_qc was
cleared in 4). Thus, ensure that we always cancel the work after clearing
ap->deferred_qc.
Another potential fix would have been to let ata_scsi_deferred_qc_work() do
nothing if ap->ops->qc_defer() returns non-zero. However, canceling the
work when clearing ap->deferred_qc seems slightly more logical, as we hold
the ap->lock when clearing ap->deferred_qc, so we know that the work cannot
be holding the lock. (The function could be waiting for the lock, but that
is okay since it will do nothing if ap->deferred_qc is not set.)
Reported-by: syzbot+bcaf842a1e8ead8dfb89@syzkaller.appspotmail.com
Fixes: 0ea84089dbf6 ("ata: libata-scsi: avoid Non-NCQ command starvation")
Fixes: eddb98ad9364 ("ata: libata-eh: correctly handle deferred qc timeouts")
Reviewed-by: Igor Pylypiv <ipylypiv@google.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-eh.c | 1 +
drivers/ata/libata-scsi.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index b373cceb95d23..563432400f727 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -659,6 +659,7 @@ void ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap,
*/
WARN_ON_ONCE(qc->flags & ATA_QCFLAG_ACTIVE);
ap->deferred_qc = NULL;
+ cancel_work(&ap->deferred_qc_work);
set_host_byte(scmd, DID_TIME_OUT);
scsi_eh_finish_cmd(scmd, &ap->eh_done_q);
} else if (i < ATA_MAX_QUEUE) {
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 6b954efa9adb1..98ee5e7f61eb6 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1699,6 +1699,7 @@ void ata_scsi_requeue_deferred_qc(struct ata_port *ap)
scmd = qc->scsicmd;
ap->deferred_qc = NULL;
+ cancel_work(&ap->deferred_qc_work);
ata_qc_free(qc);
scmd->result = (DID_SOFT_ERROR << 16);
scsi_done(scmd);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 261/311] i2c: i801: Revert "i2c: i801: replace acpi_lock with I2C bus lock"
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (259 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 260/311] ata: libata: cancel pending work after clearing deferred_qc Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 262/311] time/jiffies: Fix sysctl file error on configurations where USER_HZ < HZ Sasha Levin
` (63 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Charles Haithcock, Wolfram Sang, Sasha Levin
From: Charles Haithcock <chaithco@redhat.com>
[ Upstream commit cfc69c2e6c699c96949f7b0455195b0bfb7dc715 ]
This reverts commit f707d6b9e7c18f669adfdb443906d46cfbaaa0c1.
Under rare circumstances, multiple udev threads can collect i801 device
info on boot and walk i801_acpi_io_handler somewhat concurrently. The
first will note the area is reserved by acpi to prevent further touches.
This ultimately causes the area to be deregistered. The second will
enter i801_acpi_io_handler after the area is unregistered but before a
check can be made that the area is unregistered. i2c_lock_bus relies on
the now unregistered area containing lock_ops to lock the bus. The end
result is a kernel panic on boot with the following backtrace;
[ 14.971872] ioatdma 0000:09:00.2: enabling device (0100 -> 0102)
[ 14.971873] BUG: kernel NULL pointer dereference, address: 0000000000000000
[ 14.971880] #PF: supervisor read access in kernel mode
[ 14.971884] #PF: error_code(0x0000) - not-present page
[ 14.971887] PGD 0 P4D 0
[ 14.971894] Oops: 0000 [#1] PREEMPT SMP PTI
[ 14.971900] CPU: 5 PID: 956 Comm: systemd-udevd Not tainted 5.14.0-611.5.1.el9_7.x86_64 #1
[ 14.971905] Hardware name: XXXXXXXXXXXXXXXXXXXXXXX BIOS 1.20.10.SV91 01/30/2023
[ 14.971908] RIP: 0010:i801_acpi_io_handler+0x2d/0xb0 [i2c_i801]
[ 14.971929] Code: 00 00 49 8b 40 20 41 57 41 56 4d 8b b8 30 04 00 00 49 89 ce 41 55 41 89 d5 41 54 49 89 f4 be 02 00 00 00 55 4c 89 c5 53 89 fb <48> 8b 00 4c 89 c7 e8 18 61 54 e9 80 bd 80 04 00 00 00 75 09 4c 3b
[ 14.971933] RSP: 0018:ffffbaa841483838 EFLAGS: 00010282
[ 14.971938] RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff9685e01ba568
[ 14.971941] RDX: 0000000000000008 RSI: 0000000000000002 RDI: 0000000000000000
[ 14.971944] RBP: ffff9685ca22f028 R08: ffff9685ca22f028 R09: ffff9685ca22f028
[ 14.971948] R10: 000000000000000b R11: 0000000000000580 R12: 0000000000000580
[ 14.971951] R13: 0000000000000008 R14: ffff9685e01ba568 R15: ffff9685c222f000
[ 14.971954] FS: 00007f8287c0ab40(0000) GS:ffff96a47f940000(0000) knlGS:0000000000000000
[ 14.971959] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 14.971963] CR2: 0000000000000000 CR3: 0000000168090001 CR4: 00000000003706f0
[ 14.971966] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 14.971968] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 14.971972] Call Trace:
[ 14.971977] <TASK>
[ 14.971981] ? show_trace_log_lvl+0x1c4/0x2df
[ 14.971994] ? show_trace_log_lvl+0x1c4/0x2df
[ 14.972003] ? acpi_ev_address_space_dispatch+0x16e/0x3c0
[ 14.972014] ? __die_body.cold+0x8/0xd
[ 14.972021] ? page_fault_oops+0x132/0x170
[ 14.972028] ? exc_page_fault+0x61/0x150
[ 14.972036] ? asm_exc_page_fault+0x22/0x30
[ 14.972045] ? i801_acpi_io_handler+0x2d/0xb0 [i2c_i801]
[ 14.972061] acpi_ev_address_space_dispatch+0x16e/0x3c0
[ 14.972069] ? __pfx_i801_acpi_io_handler+0x10/0x10 [i2c_i801]
[ 14.972085] acpi_ex_access_region+0x5b/0xd0
[ 14.972093] acpi_ex_field_datum_io+0x73/0x2e0
[ 14.972100] acpi_ex_read_data_from_field+0x8e/0x230
[ 14.972106] acpi_ex_resolve_node_to_value+0x23d/0x310
[ 14.972114] acpi_ds_evaluate_name_path+0xad/0x110
[ 14.972121] acpi_ds_exec_end_op+0x321/0x510
[ 14.972127] acpi_ps_parse_loop+0xf7/0x680
[ 14.972136] acpi_ps_parse_aml+0x17a/0x3d0
[ 14.972143] acpi_ps_execute_method+0x137/0x270
[ 14.972150] acpi_ns_evaluate+0x1f4/0x2e0
[ 14.972158] acpi_evaluate_object+0x134/0x2f0
[ 14.972164] acpi_evaluate_integer+0x50/0xe0
[ 14.972173] ? vsnprintf+0x24b/0x570
[ 14.972181] acpi_ac_get_state.part.0+0x23/0x70
[ 14.972189] get_ac_property+0x4e/0x60
[ 14.972195] power_supply_show_property+0x90/0x1f0
[ 14.972205] add_prop_uevent+0x29/0x90
[ 14.972213] power_supply_uevent+0x109/0x1d0
[ 14.972222] dev_uevent+0x10e/0x2f0
[ 14.972228] uevent_show+0x8e/0x100
[ 14.972236] dev_attr_show+0x19/0x40
[ 14.972246] sysfs_kf_seq_show+0x9b/0x100
[ 14.972253] seq_read_iter+0x120/0x4b0
[ 14.972262] ? selinux_file_permission+0x106/0x150
[ 14.972273] vfs_read+0x24f/0x3a0
[ 14.972284] ksys_read+0x5f/0xe0
[ 14.972291] do_syscall_64+0x5f/0xe0
...
The kernel panic is mitigated by setting limiting the count of udev
children to 1. Revert to using the acpi_lock to continue protecting
marking the area as owned by firmware without relying on a lock in
a potentially unmapped region of memory.
Fixes: f707d6b9e7c1 ("i2c: i801: replace acpi_lock with I2C bus lock")
Signed-off-by: Charles Haithcock <chaithco@redhat.com>
[wsa: added Fixes-tag and updated comment stating the importance of the lock]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-i801.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 9e1789725edf7..32a3cef02c7b5 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -310,9 +310,10 @@ struct i801_priv {
/*
* If set to true the host controller registers are reserved for
- * ACPI AML use.
+ * ACPI AML use. Needs extra protection by acpi_lock.
*/
bool acpi_reserved;
+ struct mutex acpi_lock;
};
#define FEATURE_SMBUS_PEC BIT(0)
@@ -894,8 +895,11 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr,
int hwpec, ret;
struct i801_priv *priv = i2c_get_adapdata(adap);
- if (priv->acpi_reserved)
+ mutex_lock(&priv->acpi_lock);
+ if (priv->acpi_reserved) {
+ mutex_unlock(&priv->acpi_lock);
return -EBUSY;
+ }
pm_runtime_get_sync(&priv->pci_dev->dev);
@@ -935,6 +939,7 @@ static s32 i801_access(struct i2c_adapter *adap, u16 addr,
iowrite8(SMBHSTSTS_INUSE_STS | STATUS_FLAGS, SMBHSTSTS(priv));
pm_runtime_put_autosuspend(&priv->pci_dev->dev);
+ mutex_unlock(&priv->acpi_lock);
return ret;
}
@@ -1465,7 +1470,7 @@ i801_acpi_io_handler(u32 function, acpi_physical_address address, u32 bits,
* further access from the driver itself. This device is now owned
* by the system firmware.
*/
- i2c_lock_bus(&priv->adapter, I2C_LOCK_SEGMENT);
+ mutex_lock(&priv->acpi_lock);
if (!priv->acpi_reserved && i801_acpi_is_smbus_ioport(priv, address)) {
priv->acpi_reserved = true;
@@ -1485,7 +1490,7 @@ i801_acpi_io_handler(u32 function, acpi_physical_address address, u32 bits,
else
status = acpi_os_write_port(address, (u32)*value, bits);
- i2c_unlock_bus(&priv->adapter, I2C_LOCK_SEGMENT);
+ mutex_unlock(&priv->acpi_lock);
return status;
}
@@ -1545,6 +1550,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
priv->adapter.dev.parent = &dev->dev;
acpi_use_parent_companion(&priv->adapter.dev);
priv->adapter.retries = 3;
+ mutex_init(&priv->acpi_lock);
priv->pci_dev = dev;
priv->features = id->driver_data;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 262/311] time/jiffies: Fix sysctl file error on configurations where USER_HZ < HZ
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (260 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 261/311] i2c: i801: Revert "i2c: i801: replace acpi_lock with I2C bus lock" Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 263/311] drm/xe/gsc: Fix GSC proxy cleanup on early initialization failure Sasha Levin
` (62 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Gerd Rausch, Colm Harrington, Joel Granados, Sasha Levin
From: Gerd Rausch <gerd.rausch@oracle.com>
[ Upstream commit 6932256d3a3764f3a5e06e2cb8603be45b6a9fef ]
Commit 2dc164a48e6fd ("sysctl: Create converter functions with two new
macros") incorrectly returns error to user space when jiffies sysctl
converter is used. The old overflow check got replaced with an
unconditional one:
+ if (USER_HZ < HZ)
+ return -EINVAL;
which will always be true on configurations with "USER_HZ < HZ".
Remove the check; it is no longer needed as clock_t_to_jiffies() returns
ULONG_MAX for the overflow case and proc_int_u2k_conv_uop() checks for
"> INT_MAX" after conversion
Fixes: 2dc164a48e6fd ("sysctl: Create converter functions with two new macros")
Reported-by: Colm Harrington <colm.harrington@oracle.com>
Signed-off-by: Gerd Rausch <gerd.rausch@oracle.com>
Signed-off-by: Joel Granados <joel.granados@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/time/jiffies.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c
index d31a6d40d38dc..11d09cd8037c5 100644
--- a/kernel/time/jiffies.c
+++ b/kernel/time/jiffies.c
@@ -162,8 +162,6 @@ EXPORT_SYMBOL(proc_dointvec_jiffies);
int proc_dointvec_userhz_jiffies(const struct ctl_table *table, int dir,
void *buffer, size_t *lenp, loff_t *ppos)
{
- if (SYSCTL_USER_TO_KERN(dir) && USER_HZ < HZ)
- return -EINVAL;
return proc_dointvec_conv(table, dir, buffer, lenp, ppos,
do_proc_int_conv_userhz_jiffies);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 263/311] drm/xe/gsc: Fix GSC proxy cleanup on early initialization failure
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (261 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 262/311] time/jiffies: Fix sysctl file error on configurations where USER_HZ < HZ Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 264/311] drm/xe/reg_sr: Fix leak on xa_store failure Sasha Levin
` (61 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Zhanjun Dong, Daniele Ceraolo Spurio, Rodrigo Vivi, Sasha Levin
From: Zhanjun Dong <zhanjun.dong@intel.com>
[ Upstream commit b3368ecca9538b88ddf982ea99064860fd5add97 ]
xe_gsc_proxy_remove undoes what is done in both xe_gsc_proxy_init and
xe_gsc_proxy_start; however, if we fail between those 2 calls, it is
possible that the HW forcewake access hasn't been initialized yet and so
we hit errors when the cleanup code tries to write GSC register. To
avoid that, split the cleanup in 2 functions so that the HW cleanup is
only called if the HW setup was completed successfully.
Since the HW cleanup (interrupt disabling) is now removed from
xe_gsc_proxy_remove, the cleanup on error paths in xe_gsc_proxy_start
must be updated to disable interrupts before returning.
Fixes: ff6cd29b690b ("drm/xe: Cleanup unwind of gt initialization")
Signed-off-by: Zhanjun Dong <zhanjun.dong@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patch.msgid.link/20260220225308.101469-1-zhanjun.dong@intel.com
(cherry picked from commit 2b37c401b265c07b46408b5cb36a4b757c9b5060)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_gsc_proxy.c | 43 +++++++++++++++++++++++++------
drivers/gpu/drm/xe/xe_gsc_types.h | 2 ++
2 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_gsc_proxy.c b/drivers/gpu/drm/xe/xe_gsc_proxy.c
index 464282a89eef3..a6f6f0ea56526 100644
--- a/drivers/gpu/drm/xe/xe_gsc_proxy.c
+++ b/drivers/gpu/drm/xe/xe_gsc_proxy.c
@@ -435,16 +435,12 @@ static int proxy_channel_alloc(struct xe_gsc *gsc)
return 0;
}
-static void xe_gsc_proxy_remove(void *arg)
+static void xe_gsc_proxy_stop(struct xe_gsc *gsc)
{
- struct xe_gsc *gsc = arg;
struct xe_gt *gt = gsc_to_gt(gsc);
struct xe_device *xe = gt_to_xe(gt);
unsigned int fw_ref = 0;
- if (!gsc->proxy.component_added)
- return;
-
/* disable HECI2 IRQs */
xe_pm_runtime_get(xe);
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GSC);
@@ -458,6 +454,30 @@ static void xe_gsc_proxy_remove(void *arg)
xe_pm_runtime_put(xe);
xe_gsc_wait_for_worker_completion(gsc);
+ gsc->proxy.started = false;
+}
+
+static void xe_gsc_proxy_remove(void *arg)
+{
+ struct xe_gsc *gsc = arg;
+ struct xe_gt *gt = gsc_to_gt(gsc);
+ struct xe_device *xe = gt_to_xe(gt);
+
+ if (!gsc->proxy.component_added)
+ return;
+
+ /*
+ * GSC proxy start is an async process that can be ongoing during
+ * Xe module load/unload. Using devm managed action to register
+ * xe_gsc_proxy_stop could cause issues if Xe module unload has
+ * already started when the action is registered, potentially leading
+ * to the cleanup being called at the wrong time. Therefore, instead
+ * of registering a separate devm action to undo what is done in
+ * proxy start, we call it from here, but only if the start has
+ * completed successfully (tracked with the 'started' flag).
+ */
+ if (gsc->proxy.started)
+ xe_gsc_proxy_stop(gsc);
component_del(xe->drm.dev, &xe_gsc_proxy_component_ops);
gsc->proxy.component_added = false;
@@ -513,6 +533,7 @@ int xe_gsc_proxy_init(struct xe_gsc *gsc)
*/
int xe_gsc_proxy_start(struct xe_gsc *gsc)
{
+ struct xe_gt *gt = gsc_to_gt(gsc);
int err;
/* enable the proxy interrupt in the GSC shim layer */
@@ -524,12 +545,18 @@ int xe_gsc_proxy_start(struct xe_gsc *gsc)
*/
err = xe_gsc_proxy_request_handler(gsc);
if (err)
- return err;
+ goto err_irq_disable;
if (!xe_gsc_proxy_init_done(gsc)) {
- xe_gt_err(gsc_to_gt(gsc), "GSC FW reports proxy init not completed\n");
- return -EIO;
+ xe_gt_err(gt, "GSC FW reports proxy init not completed\n");
+ err = -EIO;
+ goto err_irq_disable;
}
+ gsc->proxy.started = true;
return 0;
+
+err_irq_disable:
+ gsc_proxy_irq_toggle(gsc, false);
+ return err;
}
diff --git a/drivers/gpu/drm/xe/xe_gsc_types.h b/drivers/gpu/drm/xe/xe_gsc_types.h
index 97c056656df05..5aaa2a75861fd 100644
--- a/drivers/gpu/drm/xe/xe_gsc_types.h
+++ b/drivers/gpu/drm/xe/xe_gsc_types.h
@@ -58,6 +58,8 @@ struct xe_gsc {
struct mutex mutex;
/** @proxy.component_added: whether the component has been added */
bool component_added;
+ /** @proxy.started: whether the proxy has been started */
+ bool started;
/** @proxy.bo: object to store message to and from the GSC */
struct xe_bo *bo;
/** @proxy.to_gsc: map of the memory used to send messages to the GSC */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 264/311] drm/xe/reg_sr: Fix leak on xa_store failure
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (262 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 263/311] drm/xe/gsc: Fix GSC proxy cleanup on early initialization failure Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 265/311] nvme: fix memory allocation in nvme_pr_read_keys() Sasha Levin
` (60 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Shuicheng Lin, Balasubramani Vivekanandan, Matt Roper,
Rodrigo Vivi, Sasha Levin
From: Shuicheng Lin <shuicheng.lin@intel.com>
[ Upstream commit 3091723785def05ebfe6a50866f87a044ae314ba ]
Free the newly allocated entry when xa_store() fails to avoid a memory
leak on the error path.
v2: use goto fail_free. (Bala)
Fixes: e5283bd4dfec ("drm/xe/reg_sr: Remove register pool")
Cc: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patch.msgid.link/20260204172810.1486719-2-shuicheng.lin@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
(cherry picked from commit 6bc6fec71ac45f52db609af4e62bdb96b9f5fadb)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_reg_sr.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_reg_sr.c b/drivers/gpu/drm/xe/xe_reg_sr.c
index fc8447a838c4f..6b9edc7ca4115 100644
--- a/drivers/gpu/drm/xe/xe_reg_sr.c
+++ b/drivers/gpu/drm/xe/xe_reg_sr.c
@@ -101,10 +101,12 @@ int xe_reg_sr_add(struct xe_reg_sr *sr,
*pentry = *e;
ret = xa_err(xa_store(&sr->xa, idx, pentry, GFP_KERNEL));
if (ret)
- goto fail;
+ goto fail_free;
return 0;
+fail_free:
+ kfree(pentry);
fail:
xe_gt_err(gt,
"discarding save-restore reg %04lx (clear: %08x, set: %08x, masked: %s, mcr: %s): ret=%d\n",
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 265/311] nvme: fix memory allocation in nvme_pr_read_keys()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (263 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 264/311] drm/xe/reg_sr: Fix leak on xa_store failure Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 266/311] x86/numa: Store extra copy of numa_nodes_parsed Sasha Levin
` (59 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Sungwoo Kim, Chao Shi, Weidong Zhu, Dave Tian, Christoph Hellwig,
Hannes Reinecke, Keith Busch, Sasha Levin
From: Sungwoo Kim <iam@sung-woo.kim>
[ Upstream commit c3320153769f05fd7fe9d840cb555dd3080ae424 ]
nvme_pr_read_keys() takes num_keys from userspace and uses it to
calculate the allocation size for rse via struct_size(). The upper
limit is PR_KEYS_MAX (64K).
A malicious or buggy userspace can pass a large num_keys value that
results in a 4MB allocation attempt at most, causing a warning in
the page allocator when the order exceeds MAX_PAGE_ORDER.
To fix this, use kvzalloc() instead of kzalloc().
This bug has the same reasoning and fix with the patch below:
https://lore.kernel.org/linux-block/20251212013510.3576091-1-kartikey406@gmail.com/
Warning log:
WARNING: mm/page_alloc.c:5216 at __alloc_frozen_pages_noprof+0x5aa/0x2300 mm/page_alloc.c:5216, CPU#1: syz-executor117/272
Modules linked in:
CPU: 1 UID: 0 PID: 272 Comm: syz-executor117 Not tainted 6.19.0 #1 PREEMPT(voluntary)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
RIP: 0010:__alloc_frozen_pages_noprof+0x5aa/0x2300 mm/page_alloc.c:5216
Code: ff 83 bd a8 fe ff ff 0a 0f 86 69 fb ff ff 0f b6 1d f9 f9 c4 04 80 fb 01 0f 87 3b 76 30 ff 83 e3 01 75 09 c6 05 e4 f9 c4 04 01 <0f> 0b 48 c7 85 70 fe ff ff 00 00 00 00 e9 8f fd ff ff 31 c0 e9 0d
RSP: 0018:ffffc90000fcf450 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 1ffff920001f9ea0
RDX: 0000000000000000 RSI: 000000000000000b RDI: 0000000000040dc0
RBP: ffffc90000fcf648 R08: ffff88800b6c3380 R09: 0000000000000001
R10: ffffc90000fcf840 R11: ffff88807ffad280 R12: 0000000000000000
R13: 0000000000040dc0 R14: 0000000000000001 R15: ffffc90000fcf620
FS: 0000555565db33c0(0000) GS:ffff8880be26c000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000002000000c CR3: 0000000003b72000 CR4: 00000000000006f0
Call Trace:
<TASK>
alloc_pages_mpol+0x236/0x4d0 mm/mempolicy.c:2486
alloc_frozen_pages_noprof+0x149/0x180 mm/mempolicy.c:2557
___kmalloc_large_node+0x10c/0x140 mm/slub.c:5598
__kmalloc_large_node_noprof+0x25/0xc0 mm/slub.c:5629
__do_kmalloc_node mm/slub.c:5645 [inline]
__kmalloc_noprof+0x483/0x6f0 mm/slub.c:5669
kmalloc_noprof include/linux/slab.h:961 [inline]
kzalloc_noprof include/linux/slab.h:1094 [inline]
nvme_pr_read_keys+0x8f/0x4c0 drivers/nvme/host/pr.c:245
blkdev_pr_read_keys block/ioctl.c:456 [inline]
blkdev_common_ioctl+0x1b71/0x29b0 block/ioctl.c:730
blkdev_ioctl+0x299/0x700 block/ioctl.c:786
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:597 [inline]
__se_sys_ioctl fs/ioctl.c:583 [inline]
__x64_sys_ioctl+0x1bf/0x220 fs/ioctl.c:583
x64_sys_call+0x1280/0x21b0 mnt/fuzznvme_1/fuzznvme/linux-build/v6.19/./arch/x86/include/generated/asm/syscalls_64.h:17
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x71/0x330 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x76/0x7e
RIP: 0033:0x7fb893d3108d
Code: 28 c3 e8 46 1e 00 00 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffff61f2f38 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007ffff61f3138 RCX: 00007fb893d3108d
RDX: 0000000020000040 RSI: 00000000c01070ce RDI: 0000000000000003
RBP: 0000000000000001 R08: 0000000000000000 R09: 00007ffff61f3138
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffff61f3128 R14: 00007fb893dae530 R15: 0000000000000001
</TASK>
Fixes: 5fd96a4e15de (nvme: Add pr_ops read_keys support)
Acked-by: Chao Shi <cshi008@fiu.edu>
Acked-by: Weidong Zhu <weizhu@fiu.edu>
Acked-by: Dave Tian <daveti@purdue.edu>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Sungwoo Kim <iam@sung-woo.kim>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvme/host/pr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/pr.c b/drivers/nvme/host/pr.c
index ad2ecc2f49a97..fe7dbe2648158 100644
--- a/drivers/nvme/host/pr.c
+++ b/drivers/nvme/host/pr.c
@@ -242,7 +242,7 @@ static int nvme_pr_read_keys(struct block_device *bdev,
if (rse_len > U32_MAX)
return -EINVAL;
- rse = kzalloc(rse_len, GFP_KERNEL);
+ rse = kvzalloc(rse_len, GFP_KERNEL);
if (!rse)
return -ENOMEM;
@@ -267,7 +267,7 @@ static int nvme_pr_read_keys(struct block_device *bdev,
}
free_rse:
- kfree(rse);
+ kvfree(rse);
return ret;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 266/311] x86/numa: Store extra copy of numa_nodes_parsed
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (264 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 265/311] nvme: fix memory allocation in nvme_pr_read_keys() Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 267/311] x86/topo: Add topology_num_nodes_per_package() Sasha Levin
` (58 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Peter Zijlstra, K Prateek Nayak, Ingo Molnar, Zhang Rui, Chen Yu,
Kyle Meyer, Sasha Levin
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit 48084cc153a5b0fbf0aa98d47670d3be0b9f64d5 ]
The topology setup code needs to know the total number of physical
nodes enumerated in SRAT; however NUMA_EMU can cause the existing
numa_nodes_parsed bitmap to be fictitious. Therefore, keep a copy of
the bitmap specifically to retain the physical node count.
Suggested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Chen Yu <yu.c.chen@intel.com>
Tested-by: Kyle Meyer <kyle.meyer@hpe.com>
Link: https://patch.msgid.link/20260303110059.889884023@infradead.org
Stable-dep-of: 528d89a4707e ("x86/topo: Fix SNC topology mess")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/include/asm/numa.h | 6 ++++++
arch/x86/mm/numa.c | 8 ++++++++
arch/x86/mm/srat.c | 2 ++
3 files changed, 16 insertions(+)
diff --git a/arch/x86/include/asm/numa.h b/arch/x86/include/asm/numa.h
index 53ba39ce010cd..a9063f332fa6e 100644
--- a/arch/x86/include/asm/numa.h
+++ b/arch/x86/include/asm/numa.h
@@ -22,6 +22,7 @@ extern int numa_off;
*/
extern s16 __apicid_to_node[MAX_LOCAL_APIC];
extern nodemask_t numa_nodes_parsed __initdata;
+extern nodemask_t numa_phys_nodes_parsed __initdata;
static inline void set_apicid_to_node(int apicid, s16 node)
{
@@ -48,6 +49,7 @@ extern void __init init_cpu_to_node(void);
extern void numa_add_cpu(unsigned int cpu);
extern void numa_remove_cpu(unsigned int cpu);
extern void init_gi_nodes(void);
+extern int num_phys_nodes(void);
#else /* CONFIG_NUMA */
static inline void numa_set_node(int cpu, int node) { }
static inline void numa_clear_node(int cpu) { }
@@ -55,6 +57,10 @@ static inline void init_cpu_to_node(void) { }
static inline void numa_add_cpu(unsigned int cpu) { }
static inline void numa_remove_cpu(unsigned int cpu) { }
static inline void init_gi_nodes(void) { }
+static inline int num_phys_nodes(void)
+{
+ return 1;
+}
#endif /* CONFIG_NUMA */
#ifdef CONFIG_DEBUG_PER_CPU_MAPS
diff --git a/arch/x86/mm/numa.c b/arch/x86/mm/numa.c
index 7a97327140df8..99d0a9332c145 100644
--- a/arch/x86/mm/numa.c
+++ b/arch/x86/mm/numa.c
@@ -48,6 +48,8 @@ s16 __apicid_to_node[MAX_LOCAL_APIC] = {
[0 ... MAX_LOCAL_APIC-1] = NUMA_NO_NODE
};
+nodemask_t numa_phys_nodes_parsed __initdata;
+
int numa_cpu_node(int cpu)
{
u32 apicid = early_per_cpu(x86_cpu_to_apicid, cpu);
@@ -57,6 +59,11 @@ int numa_cpu_node(int cpu)
return NUMA_NO_NODE;
}
+int __init num_phys_nodes(void)
+{
+ return bitmap_weight(numa_phys_nodes_parsed.bits, MAX_NUMNODES);
+}
+
cpumask_var_t node_to_cpumask_map[MAX_NUMNODES];
EXPORT_SYMBOL(node_to_cpumask_map);
@@ -210,6 +217,7 @@ static int __init dummy_numa_init(void)
0LLU, PFN_PHYS(max_pfn) - 1);
node_set(0, numa_nodes_parsed);
+ node_set(0, numa_phys_nodes_parsed);
numa_add_memblk(0, 0, PFN_PHYS(max_pfn));
return 0;
diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c
index 6f8e0f21c7103..44ca666517561 100644
--- a/arch/x86/mm/srat.c
+++ b/arch/x86/mm/srat.c
@@ -57,6 +57,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
}
set_apicid_to_node(apic_id, node);
node_set(node, numa_nodes_parsed);
+ node_set(node, numa_phys_nodes_parsed);
pr_debug("SRAT: PXM %u -> APIC 0x%04x -> Node %u\n", pxm, apic_id, node);
}
@@ -97,6 +98,7 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
set_apicid_to_node(apic_id, node);
node_set(node, numa_nodes_parsed);
+ node_set(node, numa_phys_nodes_parsed);
pr_debug("SRAT: PXM %u -> APIC 0x%02x -> Node %u\n", pxm, apic_id, node);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 267/311] x86/topo: Add topology_num_nodes_per_package()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (265 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 266/311] x86/numa: Store extra copy of numa_nodes_parsed Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 268/311] x86/topo: Replace x86_has_numa_in_package Sasha Levin
` (57 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Peter Zijlstra, Ingo Molnar, Tony Luck, K Prateek Nayak,
Zhang Rui, Chen Yu, Kyle Meyer, Sasha Levin
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit ae6730ff42b3a13d94b405edeb5e40108b6d21b6 ]
Use the MADT and SRAT table data to compute __num_nodes_per_package.
Specifically, SRAT has already been parsed in x86_numa_init(), which is called
before acpi_boot_init() which parses MADT. So both are available in
topology_init_possible_cpus().
This number is useful to divinate the various Intel CoD/SNC and AMD NPS modes,
since the platforms are failing to provide this otherwise.
Doing it this way is independent of the number of online CPUs and
other such shenanigans.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Tony Luck <tony.luck@intel.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Chen Yu <yu.c.chen@intel.com>
Tested-by: Kyle Meyer <kyle.meyer@hpe.com>
Link: https://patch.msgid.link/20260303110100.004091624@infradead.org
Stable-dep-of: 528d89a4707e ("x86/topo: Fix SNC topology mess")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/include/asm/topology.h | 6 ++++++
arch/x86/kernel/cpu/common.c | 3 +++
arch/x86/kernel/cpu/topology.c | 13 +++++++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index 1fadf0cf520c5..0ba9bdb998717 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -155,6 +155,7 @@ extern unsigned int __max_logical_packages;
extern unsigned int __max_threads_per_core;
extern unsigned int __num_threads_per_package;
extern unsigned int __num_cores_per_package;
+extern unsigned int __num_nodes_per_package;
const char *get_topology_cpu_type_name(struct cpuinfo_x86 *c);
enum x86_topology_cpu_type get_topology_cpu_type(struct cpuinfo_x86 *c);
@@ -179,6 +180,11 @@ static inline unsigned int topology_num_threads_per_package(void)
return __num_threads_per_package;
}
+static inline unsigned int topology_num_nodes_per_package(void)
+{
+ return __num_nodes_per_package;
+}
+
#ifdef CONFIG_X86_LOCAL_APIC
int topology_get_logical_id(u32 apicid, enum x86_topology_domains at_level);
#else
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index e7ab22fce3b57..5edafdc9680f1 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -95,6 +95,9 @@ EXPORT_SYMBOL(__max_dies_per_package);
unsigned int __max_logical_packages __ro_after_init = 1;
EXPORT_SYMBOL(__max_logical_packages);
+unsigned int __num_nodes_per_package __ro_after_init = 1;
+EXPORT_SYMBOL(__num_nodes_per_package);
+
unsigned int __num_cores_per_package __ro_after_init = 1;
EXPORT_SYMBOL(__num_cores_per_package);
diff --git a/arch/x86/kernel/cpu/topology.c b/arch/x86/kernel/cpu/topology.c
index 23190a786d310..eafcb1fc185ad 100644
--- a/arch/x86/kernel/cpu/topology.c
+++ b/arch/x86/kernel/cpu/topology.c
@@ -31,6 +31,7 @@
#include <asm/mpspec.h>
#include <asm/msr.h>
#include <asm/smp.h>
+#include <asm/numa.h>
#include "cpu.h"
@@ -492,11 +493,19 @@ void __init topology_init_possible_cpus(void)
set_nr_cpu_ids(allowed);
cnta = domain_weight(TOPO_PKG_DOMAIN);
- cntb = domain_weight(TOPO_DIE_DOMAIN);
__max_logical_packages = cnta;
+
+ pr_info("Max. logical packages: %3u\n", __max_logical_packages);
+
+ cntb = num_phys_nodes();
+ __num_nodes_per_package = DIV_ROUND_UP(cntb, cnta);
+
+ pr_info("Max. logical nodes: %3u\n", cntb);
+ pr_info("Num. nodes per package:%3u\n", __num_nodes_per_package);
+
+ cntb = domain_weight(TOPO_DIE_DOMAIN);
__max_dies_per_package = 1U << (get_count_order(cntb) - get_count_order(cnta));
- pr_info("Max. logical packages: %3u\n", cnta);
pr_info("Max. logical dies: %3u\n", cntb);
pr_info("Max. dies per package: %3u\n", __max_dies_per_package);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 268/311] x86/topo: Replace x86_has_numa_in_package
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (266 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 267/311] x86/topo: Add topology_num_nodes_per_package() Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 269/311] x86/topo: Fix SNC topology mess Sasha Levin
` (56 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Peter Zijlstra, Ingo Molnar, Tony Luck, K Prateek Nayak,
Zhang Rui, Chen Yu, Kyle Meyer, Sasha Levin
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit 717b64d58cff6fb97f97be07e382ed7641167a56 ]
.. with the brand spanking new topology_num_nodes_per_package().
Having the topology setup determine this value during MADT/SRAT parsing before
SMP bringup avoids having to detect this situation when building the SMP
topology masks.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Tony Luck <tony.luck@intel.com>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Chen Yu <yu.c.chen@intel.com>
Tested-by: Kyle Meyer <kyle.meyer@hpe.com>
Link: https://patch.msgid.link/20260303110100.123701837@infradead.org
Stable-dep-of: 528d89a4707e ("x86/topo: Fix SNC topology mess")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/smpboot.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 5cd6950ab672a..db3e481cdbb2e 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -468,13 +468,6 @@ static int x86_cluster_flags(void)
}
#endif
-/*
- * Set if a package/die has multiple NUMA nodes inside.
- * AMD Magny-Cours, Intel Cluster-on-Die, and Intel
- * Sub-NUMA Clustering have this.
- */
-static bool x86_has_numa_in_package;
-
static struct sched_domain_topology_level x86_topology[] = {
SDTL_INIT(tl_smt_mask, cpu_smt_flags, SMT),
#ifdef CONFIG_SCHED_CLUSTER
@@ -496,7 +489,7 @@ static void __init build_sched_topology(void)
* PKG domain since the NUMA domains will auto-magically create the
* right spanning domains based on the SLIT.
*/
- if (x86_has_numa_in_package) {
+ if (topology_num_nodes_per_package() > 1) {
unsigned int pkgdom = ARRAY_SIZE(x86_topology) - 2;
memset(&x86_topology[pkgdom], 0, sizeof(x86_topology[pkgdom]));
@@ -550,7 +543,7 @@ int arch_sched_node_distance(int from, int to)
case INTEL_GRANITERAPIDS_X:
case INTEL_ATOM_DARKMONT_X:
- if (!x86_has_numa_in_package || topology_max_packages() == 1 ||
+ if (topology_max_packages() == 1 || topology_num_nodes_per_package() == 1 ||
d < REMOTE_DISTANCE)
return d;
@@ -606,7 +599,7 @@ void set_cpu_sibling_map(int cpu)
o = &cpu_data(i);
if (match_pkg(c, o) && !topology_same_node(c, o))
- x86_has_numa_in_package = true;
+ WARN_ON_ONCE(topology_num_nodes_per_package() == 1);
if ((i == cpu) || (has_smt && match_smt(c, o)))
link_mask(topology_sibling_cpumask, cpu, i);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 269/311] x86/topo: Fix SNC topology mess
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (267 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 268/311] x86/topo: Replace x86_has_numa_in_package Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 270/311] sched/deadline: Fix missing ENQUEUE_REPLENISH during PI de-boosting Sasha Levin
` (55 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Peter Zijlstra, Kyle Meyer, Ingo Molnar, K Prateek Nayak,
Zhang Rui, Chen Yu, Sasha Levin
From: Peter Zijlstra <peterz@infradead.org>
[ Upstream commit 528d89a4707e5bfd86e30823c45dbb66877df900 ]
Per 4d6dd05d07d0 ("sched/topology: Fix sched domain build error for GNR, CWF in
SNC-3 mode"), the original crazy SNC-3 SLIT table was:
node distances:
node 0 1 2 3 4 5
0: 10 15 17 21 28 26
1: 15 10 15 23 26 23
2: 17 15 10 26 23 21
3: 21 28 26 10 15 17
4: 23 26 23 15 10 15
5: 26 23 21 17 15 10
And per:
https://lore.kernel.org/lkml/20250825075642.GQ3245006@noisy.programming.kicks-ass.net/
The suggestion was to average the off-trace clusters to restore sanity.
However, 4d6dd05d07d0 implements this under various assumptions:
- anything GNR/CWF with numa_in_package;
- there will never be more than 2 packages;
- the off-trace cluster will have distance >20
And then HPE shows up with a machine that matches the
Vendor-Family-Model checks but looks like this:
Here's an 8 socket (2 chassis) HPE system with SNC enabled:
node 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0: 10 12 16 16 16 16 18 18 40 40 40 40 40 40 40 40
1: 12 10 16 16 16 16 18 18 40 40 40 40 40 40 40 40
2: 16 16 10 12 18 18 16 16 40 40 40 40 40 40 40 40
3: 16 16 12 10 18 18 16 16 40 40 40 40 40 40 40 40
4: 16 16 18 18 10 12 16 16 40 40 40 40 40 40 40 40
5: 16 16 18 18 12 10 16 16 40 40 40 40 40 40 40 40
6: 18 18 16 16 16 16 10 12 40 40 40 40 40 40 40 40
7: 18 18 16 16 16 16 12 10 40 40 40 40 40 40 40 40
8: 40 40 40 40 40 40 40 40 10 12 16 16 16 16 18 18
9: 40 40 40 40 40 40 40 40 12 10 16 16 16 16 18 18
10: 40 40 40 40 40 40 40 40 16 16 10 12 18 18 16 16
11: 40 40 40 40 40 40 40 40 16 16 12 10 18 18 16 16
12: 40 40 40 40 40 40 40 40 16 16 18 18 10 12 16 16
13: 40 40 40 40 40 40 40 40 16 16 18 18 12 10 16 16
14: 40 40 40 40 40 40 40 40 18 18 16 16 16 16 10 12
15: 40 40 40 40 40 40 40 40 18 18 16 16 16 16 12 10
10 = Same chassis and socket
12 = Same chassis and socket (SNC)
16 = Same chassis and adjacent socket
18 = Same chassis and non-adjacent socket
40 = Different chassis
Turns out, the 'max 2 packages' thing is only relevant to the SNC-3 parts, the
smaller parts do 8 sockets (like usual). The above SLIT table is sane, but
violates the previous assumptions and trips a WARN.
Now that the topology code has a sensible measure of nodes-per-package, we can
use that to divinate the SNC mode at hand, and only fix up SNC-3 topologies.
There is a 'healthy' amount of paranoia code validating the assumptions on the
SLIT table, a simple pr_err(FW_BUG) print on failure and a fallback to using
the regular table. Lets see how long this lasts :-)
Fixes: 4d6dd05d07d0 ("sched/topology: Fix sched domain build error for GNR, CWF in SNC-3 mode")
Reported-by: Kyle Meyer <kyle.meyer@hpe.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Tested-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Chen Yu <yu.c.chen@intel.com>
Tested-by: Kyle Meyer <kyle.meyer@hpe.com>
Link: https://patch.msgid.link/20260303110100.238361290@infradead.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/smpboot.c | 190 ++++++++++++++++++++++++++++----------
1 file changed, 143 insertions(+), 47 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index db3e481cdbb2e..294a8ea602986 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -506,33 +506,149 @@ static void __init build_sched_topology(void)
}
#ifdef CONFIG_NUMA
-static int sched_avg_remote_distance;
-static int avg_remote_numa_distance(void)
+/*
+ * Test if the on-trace cluster at (N,N) is symmetric.
+ * Uses upper triangle iteration to avoid obvious duplicates.
+ */
+static bool slit_cluster_symmetric(int N)
{
- int i, j;
- int distance, nr_remote, total_distance;
-
- if (sched_avg_remote_distance > 0)
- return sched_avg_remote_distance;
-
- nr_remote = 0;
- total_distance = 0;
- for_each_node_state(i, N_CPU) {
- for_each_node_state(j, N_CPU) {
- distance = node_distance(i, j);
-
- if (distance >= REMOTE_DISTANCE) {
- nr_remote++;
- total_distance += distance;
- }
+ int u = topology_num_nodes_per_package();
+
+ for (int k = 0; k < u; k++) {
+ for (int l = k; l < u; l++) {
+ if (node_distance(N + k, N + l) !=
+ node_distance(N + l, N + k))
+ return false;
}
}
- if (nr_remote)
- sched_avg_remote_distance = total_distance / nr_remote;
- else
- sched_avg_remote_distance = REMOTE_DISTANCE;
- return sched_avg_remote_distance;
+ return true;
+}
+
+/*
+ * Return the package-id of the cluster, or ~0 if indeterminate.
+ * Each node in the on-trace cluster should have the same package-id.
+ */
+static u32 slit_cluster_package(int N)
+{
+ int u = topology_num_nodes_per_package();
+ u32 pkg_id = ~0;
+
+ for (int n = 0; n < u; n++) {
+ const struct cpumask *cpus = cpumask_of_node(N + n);
+ int cpu;
+
+ for_each_cpu(cpu, cpus) {
+ u32 id = topology_logical_package_id(cpu);
+
+ if (pkg_id == ~0)
+ pkg_id = id;
+ if (pkg_id != id)
+ return ~0;
+ }
+ }
+
+ return pkg_id;
+}
+
+/*
+ * Validate the SLIT table is of the form expected for SNC, specifically:
+ *
+ * - each on-trace cluster should be symmetric,
+ * - each on-trace cluster should have a unique package-id.
+ *
+ * If you NUMA_EMU on top of SNC, you get to keep the pieces.
+ */
+static bool slit_validate(void)
+{
+ int u = topology_num_nodes_per_package();
+ u32 pkg_id, prev_pkg_id = ~0;
+
+ for (int pkg = 0; pkg < topology_max_packages(); pkg++) {
+ int n = pkg * u;
+
+ /*
+ * Ensure the on-trace cluster is symmetric and each cluster
+ * has a different package id.
+ */
+ if (!slit_cluster_symmetric(n))
+ return false;
+ pkg_id = slit_cluster_package(n);
+ if (pkg_id == ~0)
+ return false;
+ if (pkg && pkg_id == prev_pkg_id)
+ return false;
+
+ prev_pkg_id = pkg_id;
+ }
+
+ return true;
+}
+
+/*
+ * Compute a sanitized SLIT table for SNC; notably SNC-3 can end up with
+ * asymmetric off-trace clusters, reflecting physical assymmetries. However
+ * this leads to 'unfortunate' sched_domain configurations.
+ *
+ * For example dual socket GNR with SNC-3:
+ *
+ * node distances:
+ * node 0 1 2 3 4 5
+ * 0: 10 15 17 21 28 26
+ * 1: 15 10 15 23 26 23
+ * 2: 17 15 10 26 23 21
+ * 3: 21 28 26 10 15 17
+ * 4: 23 26 23 15 10 15
+ * 5: 26 23 21 17 15 10
+ *
+ * Fix things up by averaging out the off-trace clusters; resulting in:
+ *
+ * node 0 1 2 3 4 5
+ * 0: 10 15 17 24 24 24
+ * 1: 15 10 15 24 24 24
+ * 2: 17 15 10 24 24 24
+ * 3: 24 24 24 10 15 17
+ * 4: 24 24 24 15 10 15
+ * 5: 24 24 24 17 15 10
+ */
+static int slit_cluster_distance(int i, int j)
+{
+ static int slit_valid = -1;
+ int u = topology_num_nodes_per_package();
+ long d = 0;
+ int x, y;
+
+ if (slit_valid < 0) {
+ slit_valid = slit_validate();
+ if (!slit_valid)
+ pr_err(FW_BUG "SLIT table doesn't have the expected form for SNC -- fixup disabled!\n");
+ else
+ pr_info("Fixing up SNC SLIT table.\n");
+ }
+
+ /*
+ * Is this a unit cluster on the trace?
+ */
+ if ((i / u) == (j / u) || !slit_valid)
+ return node_distance(i, j);
+
+ /*
+ * Off-trace cluster.
+ *
+ * Notably average out the symmetric pair of off-trace clusters to
+ * ensure the resulting SLIT table is symmetric.
+ */
+ x = i - (i % u);
+ y = j - (j % u);
+
+ for (i = x; i < x + u; i++) {
+ for (j = y; j < y + u; j++) {
+ d += node_distance(i, j);
+ d += node_distance(j, i);
+ }
+ }
+
+ return d / (2*u*u);
}
int arch_sched_node_distance(int from, int to)
@@ -542,34 +658,14 @@ int arch_sched_node_distance(int from, int to)
switch (boot_cpu_data.x86_vfm) {
case INTEL_GRANITERAPIDS_X:
case INTEL_ATOM_DARKMONT_X:
-
- if (topology_max_packages() == 1 || topology_num_nodes_per_package() == 1 ||
- d < REMOTE_DISTANCE)
+ if (topology_max_packages() == 1 ||
+ topology_num_nodes_per_package() < 3)
return d;
/*
- * With SNC enabled, there could be too many levels of remote
- * NUMA node distances, creating NUMA domain levels
- * including local nodes and partial remote nodes.
- *
- * Trim finer distance tuning for NUMA nodes in remote package
- * for the purpose of building sched domains. Group NUMA nodes
- * in the remote package in the same sched group.
- * Simplify NUMA domains and avoid extra NUMA levels including
- * different remote NUMA nodes and local nodes.
- *
- * GNR and CWF don't expect systems with more than 2 packages
- * and more than 2 hops between packages. Single average remote
- * distance won't be appropriate if there are more than 2
- * packages as average distance to different remote packages
- * could be different.
+ * Handle SNC-3 asymmetries.
*/
- WARN_ONCE(topology_max_packages() > 2,
- "sched: Expect only up to 2 packages for GNR or CWF, "
- "but saw %d packages when building sched domains.",
- topology_max_packages());
-
- d = avg_remote_numa_distance();
+ return slit_cluster_distance(from, to);
}
return d;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 270/311] sched/deadline: Fix missing ENQUEUE_REPLENISH during PI de-boosting
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (268 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 269/311] x86/topo: Fix SNC topology mess Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 271/311] timekeeping: Fix timex status validation for auxiliary clocks Sasha Levin
` (54 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Juri Lelli, Bruno Goncalves, Peter Zijlstra (Intel), Sasha Levin
From: Juri Lelli <juri.lelli@redhat.com>
[ Upstream commit d658686a1331db3bb108ca079d76deb3208ed949 ]
Running stress-ng --schedpolicy 0 on an RT kernel on a big machine
might lead to the following WARNINGs (edited).
sched: DL de-boosted task PID 22725: REPLENISH flag missing
WARNING: CPU: 93 PID: 0 at kernel/sched/deadline.c:239 dequeue_task_dl+0x15c/0x1f8
... (running_bw underflow)
Call trace:
dequeue_task_dl+0x15c/0x1f8 (P)
dequeue_task+0x80/0x168
deactivate_task+0x24/0x50
push_dl_task+0x264/0x2e0
dl_task_timer+0x1b0/0x228
__hrtimer_run_queues+0x188/0x378
hrtimer_interrupt+0xfc/0x260
...
The problem is that when a SCHED_DEADLINE task (lock holder) is
changed to a lower priority class via sched_setscheduler(), it may
fail to properly inherit the parameters of potential DEADLINE donors
if it didn't already inherit them in the past (shorter deadline than
donor's at that time). This might lead to bandwidth accounting
corruption, as enqueue_task_dl() won't recognize the lock holder as
boosted.
The scenario occurs when:
1. A DEADLINE task (donor) blocks on a PI mutex held by another
DEADLINE task (holder), but the holder doesn't inherit parameters
(e.g., it already has a shorter deadline)
2. sched_setscheduler() changes the holder from DEADLINE to a lower
class while still holding the mutex
3. The holder should now inherit DEADLINE parameters from the donor
and be enqueued with ENQUEUE_REPLENISH, but this doesn't happen
Fix the issue by introducing __setscheduler_dl_pi(), which detects when
a DEADLINE (proper or boosted) task gets setscheduled to a lower
priority class. In case, the function makes the task inherit DEADLINE
parameters of the donoer (pi_se) and sets ENQUEUE_REPLENISH flag to
ensure proper bandwidth accounting during the next enqueue operation.
Fixes: 2279f540ea7d ("sched/deadline: Fix priority inheritance with multiple scheduling classes")
Reported-by: Bruno Goncalves <bgoncalv@redhat.com>
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260302-upstream-fix-deadline-piboost-b4-v3-1-6ba32184a9e0@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/sched/syscalls.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c
index 6f10db3646e7f..cadb0e9fe19b9 100644
--- a/kernel/sched/syscalls.c
+++ b/kernel/sched/syscalls.c
@@ -284,6 +284,35 @@ static bool check_same_owner(struct task_struct *p)
uid_eq(cred->euid, pcred->uid));
}
+#ifdef CONFIG_RT_MUTEXES
+static inline void __setscheduler_dl_pi(int newprio, int policy,
+ struct task_struct *p,
+ struct sched_change_ctx *scope)
+{
+ /*
+ * In case a DEADLINE task (either proper or boosted) gets
+ * setscheduled to a lower priority class, check if it neeeds to
+ * inherit parameters from a potential pi_task. In that case make
+ * sure replenishment happens with the next enqueue.
+ */
+
+ if (dl_prio(newprio) && !dl_policy(policy)) {
+ struct task_struct *pi_task = rt_mutex_get_top_task(p);
+
+ if (pi_task) {
+ p->dl.pi_se = pi_task->dl.pi_se;
+ scope->flags |= ENQUEUE_REPLENISH;
+ }
+ }
+}
+#else /* !CONFIG_RT_MUTEXES */
+static inline void __setscheduler_dl_pi(int newprio, int policy,
+ struct task_struct *p,
+ struct sched_change_ctx *scope)
+{
+}
+#endif /* !CONFIG_RT_MUTEXES */
+
#ifdef CONFIG_UCLAMP_TASK
static int uclamp_validate(struct task_struct *p,
@@ -655,6 +684,7 @@ int __sched_setscheduler(struct task_struct *p,
__setscheduler_params(p, attr);
p->sched_class = next_class;
p->prio = newprio;
+ __setscheduler_dl_pi(newprio, policy, p, scope);
}
__setscheduler_uclamp(p, attr);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 271/311] timekeeping: Fix timex status validation for auxiliary clocks
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (269 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 270/311] sched/deadline: Fix missing ENQUEUE_REPLENISH during PI de-boosting Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 272/311] hwmon: (max6639) fix inverted polarity Sasha Levin
` (53 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Miroslav Lichvar, Thomas Gleixner, Sasha Levin
From: Miroslav Lichvar <mlichvar@redhat.com>
[ Upstream commit e48a869957a70cc39b4090cd27c36a86f8db9b92 ]
The timekeeping_validate_timex() function validates the timex status
of an auxiliary system clock even when the status is not to be changed,
which causes unexpected errors for applications that make read-only
clock_adjtime() calls, or set some other timex fields, but without
clearing the status field.
Do the AUX-specific status validation only when the modes field contains
ADJ_STATUS, i.e. the application is actually trying to change the
status. This makes the AUX-specific clock_adjtime() behavior consistent
with CLOCK_REALTIME.
Fixes: 4eca49d0b621 ("timekeeping: Prepare do_adtimex() for auxiliary clocks")
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260225085231.276751-1-mlichvar@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/time/timekeeping.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index 91fa2003351c9..c07e562ee4c1a 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -2653,7 +2653,8 @@ static int timekeeping_validate_timex(const struct __kernel_timex *txc, bool aux
if (aux_clock) {
/* Auxiliary clocks are similar to TAI and do not have leap seconds */
- if (txc->status & (STA_INS | STA_DEL))
+ if (txc->modes & ADJ_STATUS &&
+ txc->status & (STA_INS | STA_DEL))
return -EINVAL;
/* No TAI offset setting */
@@ -2661,7 +2662,8 @@ static int timekeeping_validate_timex(const struct __kernel_timex *txc, bool aux
return -EINVAL;
/* No PPS support either */
- if (txc->status & (STA_PPSFREQ | STA_PPSTIME))
+ if (txc->modes & ADJ_STATUS &&
+ txc->status & (STA_PPSFREQ | STA_PPSTIME))
return -EINVAL;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 272/311] hwmon: (max6639) fix inverted polarity
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (270 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 271/311] timekeeping: Fix timex status validation for auxiliary clocks Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 273/311] net: sched: avoid qdisc_reset_all_tx_gt() vs dequeue race for lockless qdiscs Sasha Levin
` (52 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Olivier Sobrie, Guenter Roeck, Sasha Levin
From: Olivier Sobrie <olivier@sobrie.be>
[ Upstream commit 170a4b21f49b3dcff3115b4c90758f0a0d77375a ]
According to MAX6639 documentation:
D1: PWM Output Polarity. PWM output is low at
100% duty cycle when this bit is set to zero. PWM
output is high at 100% duty cycle when this bit is set
to 1.
Up to commit 0f33272b60ed ("hwmon: (max6639) : Update hwmon init using
info structure"), the polarity was set to high (0x2) when no platform
data was set. After the patch, the polarity register wasn't set anymore
if no platform data was specified. Nowadays, since commit 7506ebcd662b
("hwmon: (max6639) : Configure based on DT property"), it is always set
to low which doesn't match with the comment above and change the
behavior compared to versions prior 0f33272b60ed.
Fixes: 0f33272b60ed ("hwmon: (max6639) : Update hwmon init using info structure")
Signed-off-by: Olivier Sobrie <olivier@sobrie.be>
Link: https://lore.kernel.org/r/20260304212039.570274-1-olivier@sobrie.be
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/max6639.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c
index 99140a2ca9955..48fde4f1a1561 100644
--- a/drivers/hwmon/max6639.c
+++ b/drivers/hwmon/max6639.c
@@ -610,7 +610,7 @@ static int max6639_init_client(struct i2c_client *client,
return err;
/* Fans PWM polarity high by default */
- err = regmap_write(data->regmap, MAX6639_REG_FAN_CONFIG2a(i), 0x00);
+ err = regmap_write(data->regmap, MAX6639_REG_FAN_CONFIG2a(i), 0x02);
if (err)
return err;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 273/311] net: sched: avoid qdisc_reset_all_tx_gt() vs dequeue race for lockless qdiscs
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (271 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 272/311] hwmon: (max6639) fix inverted polarity Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 274/311] tcp: secure_seq: add back ports to TS offset Sasha Levin
` (51 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Koichiro Den, Jakub Kicinski, Sasha Levin
From: Koichiro Den <den@valinux.co.jp>
[ Upstream commit 7f083faf59d14c04e01ec05a7507f036c965acf8 ]
When shrinking the number of real tx queues,
netif_set_real_num_tx_queues() calls qdisc_reset_all_tx_gt() to flush
qdiscs for queues which will no longer be used.
qdisc_reset_all_tx_gt() currently serializes qdisc_reset() with
qdisc_lock(). However, for lockless qdiscs, the dequeue path is
serialized by qdisc_run_begin/end() using qdisc->seqlock instead, so
qdisc_reset() can run concurrently with __qdisc_run() and free skbs
while they are still being dequeued, leading to UAF.
This can easily be reproduced on e.g. virtio-net by imposing heavy
traffic while frequently changing the number of queue pairs:
iperf3 -ub0 -c $peer -t 0 &
while :; do
ethtool -L eth0 combined 1
ethtool -L eth0 combined 2
done
With KASAN enabled, this leads to reports like:
BUG: KASAN: slab-use-after-free in __qdisc_run+0x133f/0x1760
...
Call Trace:
<TASK>
...
__qdisc_run+0x133f/0x1760
__dev_queue_xmit+0x248f/0x3550
ip_finish_output2+0xa42/0x2110
ip_output+0x1a7/0x410
ip_send_skb+0x2e6/0x480
udp_send_skb+0xb0a/0x1590
udp_sendmsg+0x13c9/0x1fc0
...
</TASK>
Allocated by task 1270 on cpu 5 at 44.558414s:
...
alloc_skb_with_frags+0x84/0x7c0
sock_alloc_send_pskb+0x69a/0x830
__ip_append_data+0x1b86/0x48c0
ip_make_skb+0x1e8/0x2b0
udp_sendmsg+0x13a6/0x1fc0
...
Freed by task 1306 on cpu 3 at 44.558445s:
...
kmem_cache_free+0x117/0x5e0
pfifo_fast_reset+0x14d/0x580
qdisc_reset+0x9e/0x5f0
netif_set_real_num_tx_queues+0x303/0x840
virtnet_set_channels+0x1bf/0x260 [virtio_net]
ethnl_set_channels+0x684/0xae0
ethnl_default_set_doit+0x31a/0x890
...
Serialize qdisc_reset_all_tx_gt() against the lockless dequeue path by
taking qdisc->seqlock for TCQ_F_NOLOCK qdiscs, matching the
serialization model already used by dev_reset_queue().
Additionally clear QDISC_STATE_NON_EMPTY after reset so the qdisc state
reflects an empty queue, avoiding needless re-scheduling.
Fixes: 6b3ba9146fe6 ("net: sched: allow qdiscs to handle locking")
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Link: https://patch.msgid.link/20260228145307.3955532-1-den@valinux.co.jp
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/sch_generic.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index c3a7268b567e0..d5d55cb21686d 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -778,13 +778,23 @@ static inline bool skb_skip_tc_classify(struct sk_buff *skb)
static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
{
struct Qdisc *qdisc;
+ bool nolock;
for (; i < dev->num_tx_queues; i++) {
qdisc = rtnl_dereference(netdev_get_tx_queue(dev, i)->qdisc);
if (qdisc) {
+ nolock = qdisc->flags & TCQ_F_NOLOCK;
+
+ if (nolock)
+ spin_lock_bh(&qdisc->seqlock);
spin_lock_bh(qdisc_lock(qdisc));
qdisc_reset(qdisc);
spin_unlock_bh(qdisc_lock(qdisc));
+ if (nolock) {
+ clear_bit(__QDISC_STATE_MISSED, &qdisc->state);
+ clear_bit(__QDISC_STATE_DRAINING, &qdisc->state);
+ spin_unlock_bh(&qdisc->seqlock);
+ }
}
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 274/311] tcp: secure_seq: add back ports to TS offset
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (272 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 273/311] net: sched: avoid qdisc_reset_all_tx_gt() vs dequeue race for lockless qdiscs Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 275/311] net: nfc: nci: Fix zero-length proprietary notifications Sasha Levin
` (50 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Eric Dumazet, Zhouyan Deng, Kuniyuki Iwashima, Florian Westphal,
Jakub Kicinski, Sasha Levin
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 165573e41f2f66ef98940cf65f838b2cb575d9d1 ]
This reverts 28ee1b746f49 ("secure_seq: downgrade to per-host timestamp offsets")
tcp_tw_recycle went away in 2017.
Zhouyan Deng reported off-path TCP source port leakage via
SYN cookie side-channel that can be fixed in multiple ways.
One of them is to bring back TCP ports in TS offset randomization.
As a bonus, we perform a single siphash() computation
to provide both an ISN and a TS offset.
Fixes: 28ee1b746f49 ("secure_seq: downgrade to per-host timestamp offsets")
Reported-by: Zhouyan Deng <dengzhouyan_nwpu@163.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Acked-by: Florian Westphal <fw@strlen.de>
Link: https://patch.msgid.link/20260302205527.1982836-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/secure_seq.h | 45 ++++++++++++++++++----
include/net/tcp.h | 6 ++-
net/core/secure_seq.c | 80 +++++++++++++++-------------------------
net/ipv4/syncookies.c | 11 ++++--
net/ipv4/tcp_input.c | 8 +++-
net/ipv4/tcp_ipv4.c | 37 +++++++++----------
net/ipv6/syncookies.c | 11 ++++--
net/ipv6/tcp_ipv6.c | 37 +++++++++----------
8 files changed, 127 insertions(+), 108 deletions(-)
diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h
index cddebafb9f779..6f996229167b3 100644
--- a/include/net/secure_seq.h
+++ b/include/net/secure_seq.h
@@ -5,16 +5,47 @@
#include <linux/types.h>
struct net;
+extern struct net init_net;
+
+union tcp_seq_and_ts_off {
+ struct {
+ u32 seq;
+ u32 ts_off;
+ };
+ u64 hash64;
+};
u64 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
u64 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
__be16 dport);
-u32 secure_tcp_seq(__be32 saddr, __be32 daddr,
- __be16 sport, __be16 dport);
-u32 secure_tcp_ts_off(const struct net *net, __be32 saddr, __be32 daddr);
-u32 secure_tcpv6_seq(const __be32 *saddr, const __be32 *daddr,
- __be16 sport, __be16 dport);
-u32 secure_tcpv6_ts_off(const struct net *net,
- const __be32 *saddr, const __be32 *daddr);
+union tcp_seq_and_ts_off
+secure_tcp_seq_and_ts_off(const struct net *net, __be32 saddr, __be32 daddr,
+ __be16 sport, __be16 dport);
+
+static inline u32 secure_tcp_seq(__be32 saddr, __be32 daddr,
+ __be16 sport, __be16 dport)
+{
+ union tcp_seq_and_ts_off ts;
+
+ ts = secure_tcp_seq_and_ts_off(&init_net, saddr, daddr,
+ sport, dport);
+
+ return ts.seq;
+}
+
+union tcp_seq_and_ts_off
+secure_tcpv6_seq_and_ts_off(const struct net *net, const __be32 *saddr,
+ const __be32 *daddr,
+ __be16 sport, __be16 dport);
+
+static inline u32 secure_tcpv6_seq(const __be32 *saddr, const __be32 *daddr,
+ __be16 sport, __be16 dport)
+{
+ union tcp_seq_and_ts_off ts;
+
+ ts = secure_tcpv6_seq_and_ts_off(&init_net, saddr, daddr,
+ sport, dport);
+ return ts.seq;
+}
#endif /* _NET_SECURE_SEQ */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 279ddb923e656..e15e1d0e6f4e2 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -43,6 +43,7 @@
#include <net/dst.h>
#include <net/mptcp.h>
#include <net/xfrm.h>
+#include <net/secure_seq.h>
#include <linux/seq_file.h>
#include <linux/memcontrol.h>
@@ -2437,8 +2438,9 @@ struct tcp_request_sock_ops {
struct flowi *fl,
struct request_sock *req,
u32 tw_isn);
- u32 (*init_seq)(const struct sk_buff *skb);
- u32 (*init_ts_off)(const struct net *net, const struct sk_buff *skb);
+ union tcp_seq_and_ts_off (*init_seq_and_ts_off)(
+ const struct net *net,
+ const struct sk_buff *skb);
int (*send_synack)(const struct sock *sk, struct dst_entry *dst,
struct flowi *fl, struct request_sock *req,
struct tcp_fastopen_cookie *foc,
diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c
index 9a39656804513..6a6f2cda5aaef 100644
--- a/net/core/secure_seq.c
+++ b/net/core/secure_seq.c
@@ -20,7 +20,6 @@
#include <net/tcp.h>
static siphash_aligned_key_t net_secret;
-static siphash_aligned_key_t ts_secret;
#define EPHEMERAL_PORT_SHUFFLE_PERIOD (10 * HZ)
@@ -28,11 +27,6 @@ static __always_inline void net_secret_init(void)
{
net_get_random_once(&net_secret, sizeof(net_secret));
}
-
-static __always_inline void ts_secret_init(void)
-{
- net_get_random_once(&ts_secret, sizeof(ts_secret));
-}
#endif
#ifdef CONFIG_INET
@@ -53,28 +47,9 @@ static u32 seq_scale(u32 seq)
#endif
#if IS_ENABLED(CONFIG_IPV6)
-u32 secure_tcpv6_ts_off(const struct net *net,
- const __be32 *saddr, const __be32 *daddr)
-{
- const struct {
- struct in6_addr saddr;
- struct in6_addr daddr;
- } __aligned(SIPHASH_ALIGNMENT) combined = {
- .saddr = *(struct in6_addr *)saddr,
- .daddr = *(struct in6_addr *)daddr,
- };
-
- if (READ_ONCE(net->ipv4.sysctl_tcp_timestamps) != 1)
- return 0;
-
- ts_secret_init();
- return siphash(&combined, offsetofend(typeof(combined), daddr),
- &ts_secret);
-}
-EXPORT_IPV6_MOD(secure_tcpv6_ts_off);
-
-u32 secure_tcpv6_seq(const __be32 *saddr, const __be32 *daddr,
- __be16 sport, __be16 dport)
+union tcp_seq_and_ts_off
+secure_tcpv6_seq_and_ts_off(const struct net *net, const __be32 *saddr,
+ const __be32 *daddr, __be16 sport, __be16 dport)
{
const struct {
struct in6_addr saddr;
@@ -87,14 +62,20 @@ u32 secure_tcpv6_seq(const __be32 *saddr, const __be32 *daddr,
.sport = sport,
.dport = dport
};
- u32 hash;
+ union tcp_seq_and_ts_off st;
net_secret_init();
- hash = siphash(&combined, offsetofend(typeof(combined), dport),
- &net_secret);
- return seq_scale(hash);
+
+ st.hash64 = siphash(&combined, offsetofend(typeof(combined), dport),
+ &net_secret);
+
+ if (READ_ONCE(net->ipv4.sysctl_tcp_timestamps) != 1)
+ st.ts_off = 0;
+
+ st.seq = seq_scale(st.seq);
+ return st;
}
-EXPORT_SYMBOL(secure_tcpv6_seq);
+EXPORT_SYMBOL(secure_tcpv6_seq_and_ts_off);
u64 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
__be16 dport)
@@ -118,33 +99,30 @@ EXPORT_SYMBOL(secure_ipv6_port_ephemeral);
#endif
#ifdef CONFIG_INET
-u32 secure_tcp_ts_off(const struct net *net, __be32 saddr, __be32 daddr)
-{
- if (READ_ONCE(net->ipv4.sysctl_tcp_timestamps) != 1)
- return 0;
-
- ts_secret_init();
- return siphash_2u32((__force u32)saddr, (__force u32)daddr,
- &ts_secret);
-}
-
/* secure_tcp_seq_and_tsoff(a, b, 0, d) == secure_ipv4_port_ephemeral(a, b, d),
* but fortunately, `sport' cannot be 0 in any circumstances. If this changes,
* it would be easy enough to have the former function use siphash_4u32, passing
* the arguments as separate u32.
*/
-u32 secure_tcp_seq(__be32 saddr, __be32 daddr,
- __be16 sport, __be16 dport)
+union tcp_seq_and_ts_off
+secure_tcp_seq_and_ts_off(const struct net *net, __be32 saddr, __be32 daddr,
+ __be16 sport, __be16 dport)
{
- u32 hash;
+ u32 ports = (__force u32)sport << 16 | (__force u32)dport;
+ union tcp_seq_and_ts_off st;
net_secret_init();
- hash = siphash_3u32((__force u32)saddr, (__force u32)daddr,
- (__force u32)sport << 16 | (__force u32)dport,
- &net_secret);
- return seq_scale(hash);
+
+ st.hash64 = siphash_3u32((__force u32)saddr, (__force u32)daddr,
+ ports, &net_secret);
+
+ if (READ_ONCE(net->ipv4.sysctl_tcp_timestamps) != 1)
+ st.ts_off = 0;
+
+ st.seq = seq_scale(st.seq);
+ return st;
}
-EXPORT_SYMBOL_GPL(secure_tcp_seq);
+EXPORT_SYMBOL_GPL(secure_tcp_seq_and_ts_off);
u64 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport)
{
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index 061751aabc8e1..fc3affd9c8014 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -378,9 +378,14 @@ static struct request_sock *cookie_tcp_check(struct net *net, struct sock *sk,
tcp_parse_options(net, skb, &tcp_opt, 0, NULL);
if (tcp_opt.saw_tstamp && tcp_opt.rcv_tsecr) {
- tsoff = secure_tcp_ts_off(net,
- ip_hdr(skb)->daddr,
- ip_hdr(skb)->saddr);
+ union tcp_seq_and_ts_off st;
+
+ st = secure_tcp_seq_and_ts_off(net,
+ ip_hdr(skb)->daddr,
+ ip_hdr(skb)->saddr,
+ tcp_hdr(skb)->dest,
+ tcp_hdr(skb)->source);
+ tsoff = st.ts_off;
tcp_opt.rcv_tsecr -= tsoff;
}
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 1c9db9a246f71..3e95b36fa2736 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -7411,6 +7411,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
const struct tcp_sock *tp = tcp_sk(sk);
struct net *net = sock_net(sk);
struct sock *fastopen_sk = NULL;
+ union tcp_seq_and_ts_off st;
struct request_sock *req;
bool want_cookie = false;
struct dst_entry *dst;
@@ -7480,9 +7481,12 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
if (!dst)
goto drop_and_free;
+ if (tmp_opt.tstamp_ok || (!want_cookie && !isn))
+ st = af_ops->init_seq_and_ts_off(net, skb);
+
if (tmp_opt.tstamp_ok) {
tcp_rsk(req)->req_usec_ts = dst_tcp_usec_ts(dst);
- tcp_rsk(req)->ts_off = af_ops->init_ts_off(net, skb);
+ tcp_rsk(req)->ts_off = st.ts_off;
}
if (!want_cookie && !isn) {
int max_syn_backlog = READ_ONCE(net->ipv4.sysctl_max_syn_backlog);
@@ -7504,7 +7508,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
goto drop_and_release;
}
- isn = af_ops->init_seq(skb);
+ isn = st.seq;
}
tcp_ecn_create_request(req, skb, sk, dst);
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index e4e7bc8782ab6..d27965294aef3 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -104,17 +104,14 @@ static DEFINE_PER_CPU(struct sock_bh_locked, ipv4_tcp_sk) = {
static DEFINE_MUTEX(tcp_exit_batch_mutex);
-static u32 tcp_v4_init_seq(const struct sk_buff *skb)
+static union tcp_seq_and_ts_off
+tcp_v4_init_seq_and_ts_off(const struct net *net, const struct sk_buff *skb)
{
- return secure_tcp_seq(ip_hdr(skb)->daddr,
- ip_hdr(skb)->saddr,
- tcp_hdr(skb)->dest,
- tcp_hdr(skb)->source);
-}
-
-static u32 tcp_v4_init_ts_off(const struct net *net, const struct sk_buff *skb)
-{
- return secure_tcp_ts_off(net, ip_hdr(skb)->daddr, ip_hdr(skb)->saddr);
+ return secure_tcp_seq_and_ts_off(net,
+ ip_hdr(skb)->daddr,
+ ip_hdr(skb)->saddr,
+ tcp_hdr(skb)->dest,
+ tcp_hdr(skb)->source);
}
int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp)
@@ -326,15 +323,16 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr_unsized *uaddr, int addr_len
rt = NULL;
if (likely(!tp->repair)) {
+ union tcp_seq_and_ts_off st;
+
+ st = secure_tcp_seq_and_ts_off(net,
+ inet->inet_saddr,
+ inet->inet_daddr,
+ inet->inet_sport,
+ usin->sin_port);
if (!tp->write_seq)
- WRITE_ONCE(tp->write_seq,
- secure_tcp_seq(inet->inet_saddr,
- inet->inet_daddr,
- inet->inet_sport,
- usin->sin_port));
- WRITE_ONCE(tp->tsoffset,
- secure_tcp_ts_off(net, inet->inet_saddr,
- inet->inet_daddr));
+ WRITE_ONCE(tp->write_seq, st.seq);
+ WRITE_ONCE(tp->tsoffset, st.ts_off);
}
atomic_set(&inet->inet_id, get_random_u16());
@@ -1677,8 +1675,7 @@ const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = {
.cookie_init_seq = cookie_v4_init_sequence,
#endif
.route_req = tcp_v4_route_req,
- .init_seq = tcp_v4_init_seq,
- .init_ts_off = tcp_v4_init_ts_off,
+ .init_seq_and_ts_off = tcp_v4_init_seq_and_ts_off,
.send_synack = tcp_v4_send_synack,
};
diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
index 7e007f013ec82..4f6f0d751d6c5 100644
--- a/net/ipv6/syncookies.c
+++ b/net/ipv6/syncookies.c
@@ -151,9 +151,14 @@ static struct request_sock *cookie_tcp_check(struct net *net, struct sock *sk,
tcp_parse_options(net, skb, &tcp_opt, 0, NULL);
if (tcp_opt.saw_tstamp && tcp_opt.rcv_tsecr) {
- tsoff = secure_tcpv6_ts_off(net,
- ipv6_hdr(skb)->daddr.s6_addr32,
- ipv6_hdr(skb)->saddr.s6_addr32);
+ union tcp_seq_and_ts_off st;
+
+ st = secure_tcpv6_seq_and_ts_off(net,
+ ipv6_hdr(skb)->daddr.s6_addr32,
+ ipv6_hdr(skb)->saddr.s6_addr32,
+ tcp_hdr(skb)->dest,
+ tcp_hdr(skb)->source);
+ tsoff = st.ts_off;
tcp_opt.rcv_tsecr -= tsoff;
}
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 9df81f85ec982..ca68ce16bcbe8 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -104,18 +104,14 @@ static void inet6_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb)
}
}
-static u32 tcp_v6_init_seq(const struct sk_buff *skb)
+static union tcp_seq_and_ts_off
+tcp_v6_init_seq_and_ts_off(const struct net *net, const struct sk_buff *skb)
{
- return secure_tcpv6_seq(ipv6_hdr(skb)->daddr.s6_addr32,
- ipv6_hdr(skb)->saddr.s6_addr32,
- tcp_hdr(skb)->dest,
- tcp_hdr(skb)->source);
-}
-
-static u32 tcp_v6_init_ts_off(const struct net *net, const struct sk_buff *skb)
-{
- return secure_tcpv6_ts_off(net, ipv6_hdr(skb)->daddr.s6_addr32,
- ipv6_hdr(skb)->saddr.s6_addr32);
+ return secure_tcpv6_seq_and_ts_off(net,
+ ipv6_hdr(skb)->daddr.s6_addr32,
+ ipv6_hdr(skb)->saddr.s6_addr32,
+ tcp_hdr(skb)->dest,
+ tcp_hdr(skb)->source);
}
static int tcp_v6_pre_connect(struct sock *sk, struct sockaddr_unsized *uaddr,
@@ -318,14 +314,16 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr_unsized *uaddr,
sk_set_txhash(sk);
if (likely(!tp->repair)) {
+ union tcp_seq_and_ts_off st;
+
+ st = secure_tcpv6_seq_and_ts_off(net,
+ np->saddr.s6_addr32,
+ sk->sk_v6_daddr.s6_addr32,
+ inet->inet_sport,
+ inet->inet_dport);
if (!tp->write_seq)
- WRITE_ONCE(tp->write_seq,
- secure_tcpv6_seq(np->saddr.s6_addr32,
- sk->sk_v6_daddr.s6_addr32,
- inet->inet_sport,
- inet->inet_dport));
- tp->tsoffset = secure_tcpv6_ts_off(net, np->saddr.s6_addr32,
- sk->sk_v6_daddr.s6_addr32);
+ WRITE_ONCE(tp->write_seq, st.seq);
+ tp->tsoffset = st.ts_off;
}
if (tcp_fastopen_defer_connect(sk, &err))
@@ -814,8 +812,7 @@ const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = {
.cookie_init_seq = cookie_v6_init_sequence,
#endif
.route_req = tcp_v6_route_req,
- .init_seq = tcp_v6_init_seq,
- .init_ts_off = tcp_v6_init_ts_off,
+ .init_seq_and_ts_off = tcp_v6_init_seq_and_ts_off,
.send_synack = tcp_v6_send_synack,
};
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 275/311] net: nfc: nci: Fix zero-length proprietary notifications
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (273 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 274/311] tcp: secure_seq: add back ports to TS offset Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 276/311] net_sched: sch_fq: clear q->band_pkt_count[] in fq_reset() Sasha Levin
` (49 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Ian Ray, Jakub Kicinski, Sasha Levin
From: Ian Ray <ian.ray@gehealthcare.com>
[ Upstream commit f7d92f11bd33a6eb49c7c812255ef4ab13681f0f ]
NCI NFC controllers may have proprietary OIDs with zero-length payload.
One example is: drivers/nfc/nxp-nci/core.c, NXP_NCI_RF_TXLDO_ERROR_NTF.
Allow a zero length payload in proprietary notifications *only*.
Before:
-- >8 --
kernel: nci: nci_recv_frame: len 3
-- >8 --
After:
-- >8 --
kernel: nci: nci_recv_frame: len 3
kernel: nci: nci_ntf_packet: NCI RX: MT=ntf, PBF=0, GID=0x1, OID=0x23, plen=0
kernel: nci: nci_ntf_packet: unknown ntf opcode 0x123
kernel: nfc nfc0: NFC: RF transmitter couldn't start. Bad power and/or configuration?
-- >8 --
After fixing the hardware:
-- >8 --
kernel: nci: nci_recv_frame: len 27
kernel: nci: nci_ntf_packet: NCI RX: MT=ntf, PBF=0, GID=0x1, OID=0x5, plen=24
kernel: nci: nci_rf_intf_activated_ntf_packet: rf_discovery_id 1
-- >8 --
Fixes: d24b03535e5e ("nfc: nci: Fix uninit-value in nci_dev_up and nci_ntf_packet")
Signed-off-by: Ian Ray <ian.ray@gehealthcare.com>
Link: https://patch.msgid.link/20260302163238.140576-1-ian.ray@gehealthcare.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/nfc/nci/core.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index e419e020a70a3..46681bdaeabff 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -1482,10 +1482,20 @@ static bool nci_valid_size(struct sk_buff *skb)
unsigned int hdr_size = NCI_CTRL_HDR_SIZE;
if (skb->len < hdr_size ||
- !nci_plen(skb->data) ||
skb->len < hdr_size + nci_plen(skb->data)) {
return false;
}
+
+ if (!nci_plen(skb->data)) {
+ /* Allow zero length in proprietary notifications (0x20 - 0x3F). */
+ if (nci_opcode_oid(nci_opcode(skb->data)) >= 0x20 &&
+ nci_mt(skb->data) == NCI_MT_NTF_PKT)
+ return true;
+
+ /* Disallow zero length otherwise. */
+ return false;
+ }
+
return true;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 276/311] net_sched: sch_fq: clear q->band_pkt_count[] in fq_reset()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (274 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 275/311] net: nfc: nci: Fix zero-length proprietary notifications Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 277/311] net: devmem: use READ_ONCE/WRITE_ONCE on binding->dev Sasha Levin
` (48 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Eric Dumazet, Praveen Kaligineedi, Neal Cardwell,
Willem de Bruijn, Jakub Kicinski, Sasha Levin
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit a4c2b8be2e5329e7fac6e8f64ddcb8958155cfcb ]
When/if a NIC resets, queues are deactivated by dev_deactivate_many(),
then reactivated when the reset operation completes.
fq_reset() removes all the skbs from various queues.
If we do not clear q->band_pkt_count[], these counters keep growing
and can eventually reach sch->limit, preventing new packets to be queued.
Many thanks to Praveen for discovering the root cause.
Fixes: 29f834aa326e ("net_sched: sch_fq: add 3 bands and WRR scheduling")
Diagnosed-by: Praveen Kaligineedi <pkaligineedi@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Link: https://patch.msgid.link/20260304015640.961780-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sched/sch_fq.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
index 6e5f2f4f24154..b570128ae10a6 100644
--- a/net/sched/sch_fq.c
+++ b/net/sched/sch_fq.c
@@ -829,6 +829,7 @@ static void fq_reset(struct Qdisc *sch)
for (idx = 0; idx < FQ_BANDS; idx++) {
q->band_flows[idx].new_flows.first = NULL;
q->band_flows[idx].old_flows.first = NULL;
+ q->band_pkt_count[idx] = 0;
}
q->delayed = RB_ROOT;
q->flows = 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 277/311] net: devmem: use READ_ONCE/WRITE_ONCE on binding->dev
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (275 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 276/311] net_sched: sch_fq: clear q->band_pkt_count[] in fq_reset() Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 278/311] nfc: nci: free skb on nci_transceive early error paths Sasha Levin
` (47 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Bobby Eshleman, Jakub Kicinski, Sasha Levin
From: Bobby Eshleman <bobbyeshleman@meta.com>
[ Upstream commit 40bf00ec2ee271df5ba67593991760adf8b5d0ed ]
binding->dev is protected on the write-side in
mp_dmabuf_devmem_uninstall() against concurrent writes, but due to the
concurrent bare reads in net_devmem_get_binding() and
validate_xmit_unreadable_skb() it should be wrapped in a
READ_ONCE/WRITE_ONCE pair to make sure no compiler optimizations play
with the underlying register in unforeseen ways.
Doesn't present a critical bug because the known compiler optimizations
don't result in bad behavior. There is no tearing on u64, and load
omissions/invented loads would only break if additional binding->dev
references were inlined together (they aren't right now).
This just more strictly follows the linux memory model (i.e.,
"Lock-Protected Writes With Lockless Reads" in
tools/memory-model/Documentation/access-marking.txt).
Fixes: bd61848900bf ("net: devmem: Implement TX path")
Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Link: https://patch.msgid.link/20260302-devmem-membar-fix-v2-1-5b33c9cbc28b@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/dev.c | 2 +-
net/core/devmem.c | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 062415cc3e5a4..d45be2357a5ce 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3983,7 +3983,7 @@ static struct sk_buff *validate_xmit_unreadable_skb(struct sk_buff *skb,
if (shinfo->nr_frags > 0) {
niov = netmem_to_net_iov(skb_frag_netmem(&shinfo->frags[0]));
if (net_is_devmem_iov(niov) &&
- net_devmem_iov_binding(niov)->dev != dev)
+ READ_ONCE(net_devmem_iov_binding(niov)->dev) != dev)
goto out_free;
}
diff --git a/net/core/devmem.c b/net/core/devmem.c
index ec4217d6c0b4f..e9c5d75091800 100644
--- a/net/core/devmem.c
+++ b/net/core/devmem.c
@@ -387,7 +387,8 @@ struct net_devmem_dmabuf_binding *net_devmem_get_binding(struct sock *sk,
* net_device.
*/
dst_dev = dst_dev_rcu(dst);
- if (unlikely(!dst_dev) || unlikely(dst_dev != binding->dev)) {
+ if (unlikely(!dst_dev) ||
+ unlikely(dst_dev != READ_ONCE(binding->dev))) {
err = -ENODEV;
goto out_unlock;
}
@@ -504,7 +505,8 @@ static void mp_dmabuf_devmem_uninstall(void *mp_priv,
xa_erase(&binding->bound_rxqs, xa_idx);
if (xa_empty(&binding->bound_rxqs)) {
mutex_lock(&binding->lock);
- binding->dev = NULL;
+ ASSERT_EXCLUSIVE_WRITER(binding->dev);
+ WRITE_ONCE(binding->dev, NULL);
mutex_unlock(&binding->lock);
}
break;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 278/311] nfc: nci: free skb on nci_transceive early error paths
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (276 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 277/311] net: devmem: use READ_ONCE/WRITE_ONCE on binding->dev Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 279/311] nfc: nci: complete pending data exchange on device close Sasha Levin
` (46 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Jakub Kicinski, Joe Damato, Sasha Levin
From: Jakub Kicinski <kuba@kernel.org>
[ Upstream commit 7bd4b0c4779f978a6528c9b7937d2ca18e936e2c ]
nci_transceive() takes ownership of the skb passed by the caller,
but the -EPROTO, -EINVAL, and -EBUSY error paths return without
freeing it.
Due to issues clearing NCI_DATA_EXCHANGE fixed by subsequent changes
the nci/nci_dev selftest hits the error path occasionally in NIPA,
and kmemleak detects leaks:
unreferenced object 0xff11000015ce6a40 (size 640):
comm "nci_dev", pid 3954, jiffies 4295441246
hex dump (first 32 bytes):
6b 6b 6b 6b 00 a4 00 0c 02 e1 03 6b 6b 6b 6b 6b kkkk.......kkkkk
6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b kkkkkkkkkkkkkkkk
backtrace (crc 7c40cc2a):
kmem_cache_alloc_node_noprof+0x492/0x630
__alloc_skb+0x11e/0x5f0
alloc_skb_with_frags+0xc6/0x8f0
sock_alloc_send_pskb+0x326/0x3f0
nfc_alloc_send_skb+0x94/0x1d0
rawsock_sendmsg+0x162/0x4c0
do_syscall_64+0x117/0xfc0
Fixes: 6a2968aaf50c ("NFC: basic NCI protocol implementation")
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260303162346.2071888-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/nfc/nci/core.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index 46681bdaeabff..f6dc0a94b8d54 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -1035,18 +1035,23 @@ static int nci_transceive(struct nfc_dev *nfc_dev, struct nfc_target *target,
struct nci_conn_info *conn_info;
conn_info = ndev->rf_conn_info;
- if (!conn_info)
+ if (!conn_info) {
+ kfree_skb(skb);
return -EPROTO;
+ }
pr_debug("target_idx %d, len %d\n", target->idx, skb->len);
if (!ndev->target_active_prot) {
pr_err("unable to exchange data, no active target\n");
+ kfree_skb(skb);
return -EINVAL;
}
- if (test_and_set_bit(NCI_DATA_EXCHANGE, &ndev->flags))
+ if (test_and_set_bit(NCI_DATA_EXCHANGE, &ndev->flags)) {
+ kfree_skb(skb);
return -EBUSY;
+ }
/* store cb and context to be used on receiving data */
conn_info->data_exchange_cb = cb;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 279/311] nfc: nci: complete pending data exchange on device close
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (277 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 278/311] nfc: nci: free skb on nci_transceive early error paths Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 280/311] nfc: nci: clear NCI_DATA_EXCHANGE before calling completion callback Sasha Levin
` (45 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Jakub Kicinski, Joe Damato, Sasha Levin
From: Jakub Kicinski <kuba@kernel.org>
[ Upstream commit 66083581945bd5b8e99fe49b5aeb83d03f62d053 ]
In nci_close_device(), complete any pending data exchange before
closing. The data exchange callback (e.g.
rawsock_data_exchange_complete) holds a socket reference.
NIPA occasionally hits this leak:
unreferenced object 0xff1100000f435000 (size 2048):
comm "nci_dev", pid 3954, jiffies 4295441245
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
27 00 01 40 00 00 00 00 00 00 00 00 00 00 00 00 '..@............
backtrace (crc ec2b3c5):
__kmalloc_noprof+0x4db/0x730
sk_prot_alloc.isra.0+0xe4/0x1d0
sk_alloc+0x36/0x760
rawsock_create+0xd1/0x540
nfc_sock_create+0x11f/0x280
__sock_create+0x22d/0x630
__sys_socket+0x115/0x1d0
__x64_sys_socket+0x72/0xd0
do_syscall_64+0x117/0xfc0
entry_SYSCALL_64_after_hwframe+0x4b/0x53
Fixes: 38f04c6b1b68 ("NFC: protect nci_data_exchange transactions")
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260303162346.2071888-4-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/nfc/nci/core.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
index f6dc0a94b8d54..d334b7aa8c172 100644
--- a/net/nfc/nci/core.c
+++ b/net/nfc/nci/core.c
@@ -567,6 +567,10 @@ static int nci_close_device(struct nci_dev *ndev)
flush_workqueue(ndev->cmd_wq);
timer_delete_sync(&ndev->cmd_timer);
timer_delete_sync(&ndev->data_timer);
+ if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags))
+ nci_data_exchange_complete(ndev, NULL,
+ ndev->cur_conn_id,
+ -ENODEV);
mutex_unlock(&ndev->req_lock);
return 0;
}
@@ -598,6 +602,11 @@ static int nci_close_device(struct nci_dev *ndev)
flush_workqueue(ndev->cmd_wq);
timer_delete_sync(&ndev->cmd_timer);
+ timer_delete_sync(&ndev->data_timer);
+
+ if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags))
+ nci_data_exchange_complete(ndev, NULL, ndev->cur_conn_id,
+ -ENODEV);
/* Clear flags except NCI_UNREG */
ndev->flags &= BIT(NCI_UNREG);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 280/311] nfc: nci: clear NCI_DATA_EXCHANGE before calling completion callback
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (278 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 279/311] nfc: nci: complete pending data exchange on device close Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 281/311] nfc: rawsock: cancel tx_work before socket teardown Sasha Levin
` (44 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Jakub Kicinski, Joe Damato, Sasha Levin
From: Jakub Kicinski <kuba@kernel.org>
[ Upstream commit 0efdc02f4f6d52f8ca5d5889560f325a836ce0a8 ]
Move clear_bit(NCI_DATA_EXCHANGE) before invoking the data exchange
callback in nci_data_exchange_complete().
The callback (e.g. rawsock_data_exchange_complete) may immediately
schedule another data exchange via schedule_work(tx_work). On a
multi-CPU system, tx_work can run and reach nci_transceive() before
the current nci_data_exchange_complete() clears the flag, causing
test_and_set_bit(NCI_DATA_EXCHANGE) to return -EBUSY and the new
transfer to fail.
This causes intermittent flakes in nci/nci_dev in NIPA:
# # RUN NCI.NCI1_0.t4t_tag_read ...
# # t4t_tag_read: Test terminated by timeout
# # FAIL NCI.NCI1_0.t4t_tag_read
# not ok 3 NCI.NCI1_0.t4t_tag_read
Fixes: 38f04c6b1b68 ("NFC: protect nci_data_exchange transactions")
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260303162346.2071888-5-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/nfc/nci/data.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
index 78f4131af3cf3..5f98c73db5afd 100644
--- a/net/nfc/nci/data.c
+++ b/net/nfc/nci/data.c
@@ -33,7 +33,8 @@ void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb,
conn_info = nci_get_conn_info_by_conn_id(ndev, conn_id);
if (!conn_info) {
kfree_skb(skb);
- goto exit;
+ clear_bit(NCI_DATA_EXCHANGE, &ndev->flags);
+ return;
}
cb = conn_info->data_exchange_cb;
@@ -45,6 +46,12 @@ void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb,
timer_delete_sync(&ndev->data_timer);
clear_bit(NCI_DATA_EXCHANGE_TO, &ndev->flags);
+ /* Mark the exchange as done before calling the callback.
+ * The callback (e.g. rawsock_data_exchange_complete) may
+ * want to immediately queue another data exchange.
+ */
+ clear_bit(NCI_DATA_EXCHANGE, &ndev->flags);
+
if (cb) {
/* forward skb to nfc core */
cb(cb_context, skb, err);
@@ -54,9 +61,6 @@ void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb,
/* no waiting callback, free skb */
kfree_skb(skb);
}
-
-exit:
- clear_bit(NCI_DATA_EXCHANGE, &ndev->flags);
}
/* ----------------- NCI TX Data ----------------- */
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 281/311] nfc: rawsock: cancel tx_work before socket teardown
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (279 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 280/311] nfc: nci: clear NCI_DATA_EXCHANGE before calling completion callback Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 282/311] net: stmmac: Fix error handling in VLAN add and delete paths Sasha Levin
` (43 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Jakub Kicinski, Joe Damato, Sasha Levin
From: Jakub Kicinski <kuba@kernel.org>
[ Upstream commit d793458c45df2aed498d7f74145eab7ee22d25aa ]
In rawsock_release(), cancel any pending tx_work and purge the write
queue before orphaning the socket. rawsock_tx_work runs on the system
workqueue and calls nfc_data_exchange which dereferences the NCI
device. Without synchronization, tx_work can race with socket and
device teardown when a process is killed (e.g. by SIGKILL), leading
to use-after-free or leaked references.
Set SEND_SHUTDOWN first so that if tx_work is already running it will
see the flag and skip transmitting, then use cancel_work_sync to wait
for any in-progress execution to finish, and finally purge any
remaining queued skbs.
Fixes: 23b7869c0fd0 ("NFC: add the NFC socket raw protocol")
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260303162346.2071888-6-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/nfc/rawsock.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c
index b049022399aea..f7d7a599fade7 100644
--- a/net/nfc/rawsock.c
+++ b/net/nfc/rawsock.c
@@ -67,6 +67,17 @@ static int rawsock_release(struct socket *sock)
if (sock->type == SOCK_RAW)
nfc_sock_unlink(&raw_sk_list, sk);
+ if (sk->sk_state == TCP_ESTABLISHED) {
+ /* Prevent rawsock_tx_work from starting new transmits and
+ * wait for any in-progress work to finish. This must happen
+ * before the socket is orphaned to avoid a race where
+ * rawsock_tx_work runs after the NCI device has been freed.
+ */
+ sk->sk_shutdown |= SEND_SHUTDOWN;
+ cancel_work_sync(&nfc_rawsock(sk)->tx_work);
+ rawsock_write_queue_purge(sk);
+ }
+
sock_orphan(sk);
sock_put(sk);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 282/311] net: stmmac: Fix error handling in VLAN add and delete paths
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (280 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 281/311] nfc: rawsock: cancel tx_work before socket teardown Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 283/311] net: stmmac: Improve double VLAN handling Sasha Levin
` (42 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Ovidiu Panait, Jakub Kicinski, Sasha Levin
From: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
[ Upstream commit 35dfedce442c4060cfe5b98368bc9643fb995716 ]
stmmac_vlan_rx_add_vid() updates active_vlans and the VLAN hash
register before writing the HW filter entry. If the filter write
fails, it leaves a stale VID in active_vlans and the hash register.
stmmac_vlan_rx_kill_vid() has the reverse problem: it clears
active_vlans before removing the HW filter. On failure, the VID is
gone from active_vlans but still present in the HW filter table.
To fix this, reorder the operations to update the hash table first,
then attempt the HW filter operation. If the HW filter fails, roll
back both the active_vlans bitmap and the hash table by calling
stmmac_vlan_update() again.
Fixes: ed64639bc1e0 ("net: stmmac: Add support for VLAN Rx filtering")
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Link: https://patch.msgid.link/20260303145828.7845-2-ovidiu.panait.rb@renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index e9493c0c27b87..f8e4d436f2967 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -6746,9 +6746,13 @@ static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid
if (priv->hw->num_vlan) {
ret = stmmac_add_hw_vlan_rx_fltr(priv, ndev, priv->hw, proto, vid);
- if (ret)
+ if (ret) {
+ clear_bit(vid, priv->active_vlans);
+ stmmac_vlan_update(priv, is_double);
goto err_pm_put;
+ }
}
+
err_pm_put:
pm_runtime_put(priv->device);
@@ -6772,15 +6776,21 @@ static int stmmac_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vi
is_double = true;
clear_bit(vid, priv->active_vlans);
+ ret = stmmac_vlan_update(priv, is_double);
+ if (ret) {
+ set_bit(vid, priv->active_vlans);
+ goto del_vlan_error;
+ }
if (priv->hw->num_vlan) {
ret = stmmac_del_hw_vlan_rx_fltr(priv, ndev, priv->hw, proto, vid);
- if (ret)
+ if (ret) {
+ set_bit(vid, priv->active_vlans);
+ stmmac_vlan_update(priv, is_double);
goto del_vlan_error;
+ }
}
- ret = stmmac_vlan_update(priv, is_double);
-
del_vlan_error:
pm_runtime_put(priv->device);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 283/311] net: stmmac: Improve double VLAN handling
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (281 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 282/311] net: stmmac: Fix error handling in VLAN add and delete paths Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 284/311] net: stmmac: Fix VLAN HW state restore Sasha Levin
` (41 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Ovidiu Panait, Jakub Kicinski, Sasha Levin
From: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
[ Upstream commit e38200e361cbe331806dc454c76c11c7cd95e1b9 ]
The double VLAN bits (EDVLP, ESVL, DOVLTC) are handled inconsistently
between the two vlan_update_hash() implementations:
- dwxgmac2_update_vlan_hash() explicitly clears the double VLAN bits when
is_double is false, meaning that adding a 802.1Q VLAN will disable
double VLAN mode:
$ ip link add link eth0 name eth0.200 type vlan id 200 protocol 802.1ad
$ ip link add link eth0 name eth0.100 type vlan id 100
# Double VLAN bits no longer set
- vlan_update_hash() sets these bits and only clears them when the last
VLAN has been removed, so double VLAN mode remains enabled even after all
802.1AD VLANs are removed.
Address both issues by tracking the number of active 802.1AD VLANs in
priv->num_double_vlans. Pass this count to stmmac_vlan_update() so both
implementations correctly set the double VLAN bits when any 802.1AD
VLAN is active, and clear them only when none remain.
Also update vlan_update_hash() to explicitly clear the double VLAN bits
when is_double is false, matching the dwxgmac2 behavior.
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Link: https://patch.msgid.link/20260303145828.7845-3-ovidiu.panait.rb@renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: bd7ad51253a7 ("net: stmmac: Fix VLAN HW state restore")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 +
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 16 ++++++++++++----
.../net/ethernet/stmicro/stmmac/stmmac_vlan.c | 8 ++++++++
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index aafd8c39be63c..78a18384e5d00 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -322,6 +322,7 @@ struct stmmac_priv {
void __iomem *ptpaddr;
void __iomem *estaddr;
unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
+ unsigned int num_double_vlans;
int sfty_irq;
int sfty_ce_irq;
int sfty_ue_irq;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index f8e4d436f2967..952ddc08a6653 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -6727,6 +6727,7 @@ static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double)
static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid)
{
struct stmmac_priv *priv = netdev_priv(ndev);
+ unsigned int num_double_vlans;
bool is_double = false;
int ret;
@@ -6738,7 +6739,8 @@ static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid
is_double = true;
set_bit(vid, priv->active_vlans);
- ret = stmmac_vlan_update(priv, is_double);
+ num_double_vlans = priv->num_double_vlans + is_double;
+ ret = stmmac_vlan_update(priv, num_double_vlans);
if (ret) {
clear_bit(vid, priv->active_vlans);
goto err_pm_put;
@@ -6748,11 +6750,13 @@ static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid
ret = stmmac_add_hw_vlan_rx_fltr(priv, ndev, priv->hw, proto, vid);
if (ret) {
clear_bit(vid, priv->active_vlans);
- stmmac_vlan_update(priv, is_double);
+ stmmac_vlan_update(priv, priv->num_double_vlans);
goto err_pm_put;
}
}
+ priv->num_double_vlans = num_double_vlans;
+
err_pm_put:
pm_runtime_put(priv->device);
@@ -6765,6 +6769,7 @@ static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid
static int stmmac_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid)
{
struct stmmac_priv *priv = netdev_priv(ndev);
+ unsigned int num_double_vlans;
bool is_double = false;
int ret;
@@ -6776,7 +6781,8 @@ static int stmmac_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vi
is_double = true;
clear_bit(vid, priv->active_vlans);
- ret = stmmac_vlan_update(priv, is_double);
+ num_double_vlans = priv->num_double_vlans - is_double;
+ ret = stmmac_vlan_update(priv, num_double_vlans);
if (ret) {
set_bit(vid, priv->active_vlans);
goto del_vlan_error;
@@ -6786,11 +6792,13 @@ static int stmmac_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vi
ret = stmmac_del_hw_vlan_rx_fltr(priv, ndev, priv->hw, proto, vid);
if (ret) {
set_bit(vid, priv->active_vlans);
- stmmac_vlan_update(priv, is_double);
+ stmmac_vlan_update(priv, priv->num_double_vlans);
goto del_vlan_error;
}
}
+ priv->num_double_vlans = num_double_vlans;
+
del_vlan_error:
pm_runtime_put(priv->device);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c
index b18404dd5a8be..de1a70e1c86ef 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c
@@ -183,6 +183,10 @@ static void vlan_update_hash(struct mac_device_info *hw, u32 hash,
value |= VLAN_EDVLP;
value |= VLAN_ESVL;
value |= VLAN_DOVLTC;
+ } else {
+ value &= ~VLAN_EDVLP;
+ value &= ~VLAN_ESVL;
+ value &= ~VLAN_DOVLTC;
}
writel(value, ioaddr + VLAN_TAG);
@@ -193,6 +197,10 @@ static void vlan_update_hash(struct mac_device_info *hw, u32 hash,
value |= VLAN_EDVLP;
value |= VLAN_ESVL;
value |= VLAN_DOVLTC;
+ } else {
+ value &= ~VLAN_EDVLP;
+ value &= ~VLAN_ESVL;
+ value &= ~VLAN_DOVLTC;
}
writel(value | perfect_match, ioaddr + VLAN_TAG);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 284/311] net: stmmac: Fix VLAN HW state restore
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (282 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 283/311] net: stmmac: Improve double VLAN handling Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 285/311] net: stmmac: Defer VLAN HW configuration when interface is down Sasha Levin
` (40 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Ovidiu Panait, Jakub Kicinski, Sasha Levin
From: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
[ Upstream commit bd7ad51253a76fb35886d01cfe9a37f0e4ed6709 ]
When the network interface is opened or resumed, a DMA reset is performed,
which resets all hardware state, including VLAN state. Currently, only
the resume path is restoring the VLAN state via
stmmac_restore_hw_vlan_rx_fltr(), but that is incomplete: the VLAN hash
table and the VLAN_TAG control bits are not restored.
Therefore, add stmmac_vlan_restore(), which restores the full VLAN
state by updating both the HW filter entries and the hash table, and
call it from both the open and resume paths.
The VLAN restore is moved outside of phylink_rx_clk_stop_block/unblock
in the resume path because receive clock stop is already disabled when
stmmac supports VLAN.
Also, remove the hash readback code in vlan_restore_hw_rx_fltr() that
attempts to restore VTHM by reading VLAN_HASH_TABLE, as it always reads
zero after DMA reset, making it dead code.
Fixes: 3cd1cfcba26e ("net: stmmac: Implement VLAN Hash Filtering in XGMAC")
Fixes: ed64639bc1e0 ("net: stmmac: Add support for VLAN Rx filtering")
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Link: https://patch.msgid.link/20260303145828.7845-4-ovidiu.panait.rb@renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 24 +++++++++++++++++--
.../net/ethernet/stmicro/stmmac/stmmac_vlan.c | 10 --------
2 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 952ddc08a6653..4ffe151774037 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -140,6 +140,7 @@ static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue);
static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue);
static void stmmac_set_dma_operation_mode(struct stmmac_priv *priv, u32 txmode,
u32 rxmode, u32 chan);
+static int stmmac_vlan_restore(struct stmmac_priv *priv);
#ifdef CONFIG_DEBUG_FS
static const struct net_device_ops stmmac_netdev_ops;
@@ -4064,6 +4065,8 @@ static int __stmmac_open(struct net_device *dev,
phylink_start(priv->phylink);
+ stmmac_vlan_restore(priv);
+
ret = stmmac_request_irq(dev);
if (ret)
goto irq_error;
@@ -6805,6 +6808,23 @@ static int stmmac_vlan_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vi
return ret;
}
+static int stmmac_vlan_restore(struct stmmac_priv *priv)
+{
+ int ret;
+
+ if (!(priv->dev->features & NETIF_F_VLAN_FEATURES))
+ return 0;
+
+ if (priv->hw->num_vlan)
+ stmmac_restore_hw_vlan_rx_fltr(priv, priv->dev, priv->hw);
+
+ ret = stmmac_vlan_update(priv, priv->num_double_vlans);
+ if (ret)
+ netdev_err(priv->dev, "Failed to restore VLANs\n");
+
+ return ret;
+}
+
static int stmmac_bpf(struct net_device *dev, struct netdev_bpf *bpf)
{
struct stmmac_priv *priv = netdev_priv(dev);
@@ -8197,10 +8217,10 @@ int stmmac_resume(struct device *dev)
stmmac_init_coalesce(priv);
phylink_rx_clk_stop_block(priv->phylink);
stmmac_set_rx_mode(ndev);
-
- stmmac_restore_hw_vlan_rx_fltr(priv, ndev, priv->hw);
phylink_rx_clk_stop_unblock(priv->phylink);
+ stmmac_vlan_restore(priv);
+
stmmac_enable_all_queues(priv);
stmmac_enable_all_dma_irq(priv);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c
index de1a70e1c86ef..fcc34867405ed 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c
@@ -139,9 +139,6 @@ static int vlan_del_hw_rx_fltr(struct net_device *dev,
static void vlan_restore_hw_rx_fltr(struct net_device *dev,
struct mac_device_info *hw)
{
- void __iomem *ioaddr = hw->pcsr;
- u32 value;
- u32 hash;
u32 val;
int i;
@@ -158,13 +155,6 @@ static void vlan_restore_hw_rx_fltr(struct net_device *dev,
vlan_write_filter(dev, hw, i, val);
}
}
-
- hash = readl(ioaddr + VLAN_HASH_TABLE);
- if (hash & VLAN_VLHT) {
- value = readl(ioaddr + VLAN_TAG);
- value |= VLAN_VTHM;
- writel(value, ioaddr + VLAN_TAG);
- }
}
static void vlan_update_hash(struct mac_device_info *hw, u32 hash,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 285/311] net: stmmac: Defer VLAN HW configuration when interface is down
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (283 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 284/311] net: stmmac: Fix VLAN HW state restore Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 286/311] block: use trylock to avoid lockdep circular dependency in sysfs Sasha Levin
` (39 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Ovidiu Panait, Jakub Kicinski, Sasha Levin
From: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
[ Upstream commit 2cd70e3968f505996d5fefdf7ca684f0f4575734 ]
VLAN register accesses on the MAC side require the PHY RX clock to be
active. When the network interface is down, the PHY is suspended and
the RX clock is unavailable, causing VLAN operations to fail with
timeouts.
The VLAN core automatically removes VID 0 after the interface goes down
and re-adds it when it comes back up, so these timeouts happen during
normal interface down/up:
# ip link set end1 down
renesas-gbeth 15c40000.ethernet end1: Timeout accessing MAC_VLAN_Tag_Filter
renesas-gbeth 15c40000.ethernet end1: failed to kill vid 0081/0
Adding VLANs while the interface is down also fails:
# ip link add link end1 name end1.10 type vlan id 10
renesas-gbeth 15c40000.ethernet end1: Timeout accessing MAC_VLAN_Tag_Filter
RTNETLINK answers: Device or resource busy
To fix this, check if the interface is up before accessing VLAN registers.
The software state is always kept up to date regardless of interface state.
When the interface is brought up, stmmac_vlan_restore() is called
to write the VLAN state to hardware.
Fixes: ed64639bc1e0 ("net: stmmac: Add support for VLAN Rx filtering")
Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
Link: https://patch.msgid.link/20260303145828.7845-5-ovidiu.panait.rb@renesas.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++
.../net/ethernet/stmicro/stmmac/stmmac_vlan.c | 42 ++++++++++---------
2 files changed, 26 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 4ffe151774037..01ede5148163e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -6721,6 +6721,9 @@ static int stmmac_vlan_update(struct stmmac_priv *priv, bool is_double)
hash = 0;
}
+ if (!netif_running(priv->dev))
+ return 0;
+
return stmmac_update_vlan_hash(priv, priv->hw, hash, pmatch, is_double);
}
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c
index fcc34867405ed..e24efe3bfedbe 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_vlan.c
@@ -76,7 +76,9 @@ static int vlan_add_hw_rx_fltr(struct net_device *dev,
}
hw->vlan_filter[0] = vid;
- vlan_write_single(dev, vid);
+
+ if (netif_running(dev))
+ vlan_write_single(dev, vid);
return 0;
}
@@ -97,12 +99,15 @@ static int vlan_add_hw_rx_fltr(struct net_device *dev,
return -EPERM;
}
- ret = vlan_write_filter(dev, hw, index, val);
+ if (netif_running(dev)) {
+ ret = vlan_write_filter(dev, hw, index, val);
+ if (ret)
+ return ret;
+ }
- if (!ret)
- hw->vlan_filter[index] = val;
+ hw->vlan_filter[index] = val;
- return ret;
+ return 0;
}
static int vlan_del_hw_rx_fltr(struct net_device *dev,
@@ -115,7 +120,9 @@ static int vlan_del_hw_rx_fltr(struct net_device *dev,
if (hw->num_vlan == 1) {
if ((hw->vlan_filter[0] & VLAN_TAG_VID) == vid) {
hw->vlan_filter[0] = 0;
- vlan_write_single(dev, 0);
+
+ if (netif_running(dev))
+ vlan_write_single(dev, 0);
}
return 0;
}
@@ -124,22 +131,23 @@ static int vlan_del_hw_rx_fltr(struct net_device *dev,
for (i = 0; i < hw->num_vlan; i++) {
if ((hw->vlan_filter[i] & VLAN_TAG_DATA_VEN) &&
((hw->vlan_filter[i] & VLAN_TAG_DATA_VID) == vid)) {
- ret = vlan_write_filter(dev, hw, i, 0);
- if (!ret)
- hw->vlan_filter[i] = 0;
- else
- return ret;
+ if (netif_running(dev)) {
+ ret = vlan_write_filter(dev, hw, i, 0);
+ if (ret)
+ return ret;
+ }
+
+ hw->vlan_filter[i] = 0;
}
}
- return ret;
+ return 0;
}
static void vlan_restore_hw_rx_fltr(struct net_device *dev,
struct mac_device_info *hw)
{
- u32 val;
int i;
/* Single Rx VLAN Filter */
@@ -149,12 +157,8 @@ static void vlan_restore_hw_rx_fltr(struct net_device *dev,
}
/* Extended Rx VLAN Filter Enable */
- for (i = 0; i < hw->num_vlan; i++) {
- if (hw->vlan_filter[i] & VLAN_TAG_DATA_VEN) {
- val = hw->vlan_filter[i];
- vlan_write_filter(dev, hw, i, val);
- }
- }
+ for (i = 0; i < hw->num_vlan; i++)
+ vlan_write_filter(dev, hw, i, hw->vlan_filter[i]);
}
static void vlan_update_hash(struct mac_device_info *hw, u32 hash,
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 286/311] block: use trylock to avoid lockdep circular dependency in sysfs
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (284 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 285/311] net: stmmac: Defer VLAN HW configuration when interface is down Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 287/311] net: Provide a PREEMPT_RT specific check for netdev_queue::_xmit_lock Sasha Levin
` (38 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Ming Lei, Yi Zhang, Jens Axboe, Sasha Levin
From: Ming Lei <ming.lei@redhat.com>
[ Upstream commit ce8ee8583ed83122405eabaa8fb351be4d9dc65c ]
Use trylock instead of blocking lock acquisition for update_nr_hwq_lock
in queue_requests_store() and elv_iosched_store() to avoid circular lock
dependency with kernfs active reference during concurrent disk deletion:
update_nr_hwq_lock -> kn->active (via del_gendisk -> kobject_del)
kn->active -> update_nr_hwq_lock (via sysfs write path)
Return -EBUSY when the lock is not immediately available.
Reported-and-tested-by: Yi Zhang <yi.zhang@redhat.com>
Closes: https://lore.kernel.org/linux-block/CAHj4cs-em-4acsHabMdT=jJhXkCzjnprD-aQH1OgrZo4nTnmMw@mail.gmail.com/
Fixes: 626ff4f8ebcb ("blk-mq: convert to serialize updating nr_requests with update_nr_hwq_lock")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Tested-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
block/blk-sysfs.c | 8 +++++++-
block/elevator.c | 12 +++++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index e0a70d26972b3..af12526d866a9 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -78,8 +78,14 @@ queue_requests_store(struct gendisk *disk, const char *page, size_t count)
/*
* Serialize updating nr_requests with concurrent queue_requests_store()
* and switching elevator.
+ *
+ * Use trylock to avoid circular lock dependency with kernfs active
+ * reference during concurrent disk deletion:
+ * update_nr_hwq_lock -> kn->active (via del_gendisk -> kobject_del)
+ * kn->active -> update_nr_hwq_lock (via this sysfs write path)
*/
- down_write(&set->update_nr_hwq_lock);
+ if (!down_write_trylock(&set->update_nr_hwq_lock))
+ return -EBUSY;
if (nr == q->nr_requests)
goto unlock;
diff --git a/block/elevator.c b/block/elevator.c
index a2f8b2251dc6e..7a97998cd8bd7 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -806,7 +806,16 @@ ssize_t elv_iosched_store(struct gendisk *disk, const char *buf,
elv_iosched_load_module(ctx.name);
ctx.type = elevator_find_get(ctx.name);
- down_read(&set->update_nr_hwq_lock);
+ /*
+ * Use trylock to avoid circular lock dependency with kernfs active
+ * reference during concurrent disk deletion:
+ * update_nr_hwq_lock -> kn->active (via del_gendisk -> kobject_del)
+ * kn->active -> update_nr_hwq_lock (via this sysfs write path)
+ */
+ if (!down_read_trylock(&set->update_nr_hwq_lock)) {
+ ret = -EBUSY;
+ goto out;
+ }
if (!blk_queue_no_elv_switch(q)) {
ret = elevator_change(q, &ctx);
if (!ret)
@@ -816,6 +825,7 @@ ssize_t elv_iosched_store(struct gendisk *disk, const char *buf,
}
up_read(&set->update_nr_hwq_lock);
+out:
if (ctx.type)
elevator_put(ctx.type);
return ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 287/311] net: Provide a PREEMPT_RT specific check for netdev_queue::_xmit_lock
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (285 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 286/311] block: use trylock to avoid lockdep circular dependency in sysfs Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 288/311] netfilter: nf_tables: unconditionally bump set->nelems before insertion Sasha Levin
` (37 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Sebastian Andrzej Siewior, Bert Karwatzki, Paolo Abeni,
Sasha Levin
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
[ Upstream commit b824c3e16c1904bf80df489e293d1e3cbf98896d ]
After acquiring netdev_queue::_xmit_lock the number of the CPU owning
the lock is recorded in netdev_queue::xmit_lock_owner. This works as
long as the BH context is not preemptible.
On PREEMPT_RT the softirq context is preemptible and without the
softirq-lock it is possible to have multiple user in __dev_queue_xmit()
submitting a skb on the same CPU. This is fine in general but this means
also that the current CPU is recorded as netdev_queue::xmit_lock_owner.
This in turn leads to the recursion alert and the skb is dropped.
Instead checking the for CPU number, that owns the lock, PREEMPT_RT can
check if the lockowner matches the current task.
Add netif_tx_owned() which returns true if the current context owns the
lock by comparing the provided CPU number with the recorded number. This
resembles the current check by negating the condition (the current check
returns true if the lock is not owned).
On PREEMPT_RT use rt_mutex_owner() to return the lock owner and compare
the current task against it.
Use the new helper in __dev_queue_xmit() and netif_local_xmit_active()
which provides a similar check.
Update comments regarding pairing READ_ONCE().
Reported-by: Bert Karwatzki <spasswolf@web.de>
Closes: https://lore.kernel.org/all/20260216134333.412332-1-spasswolf@web.de
Fixes: 3253cb49cbad4 ("softirq: Allow to drop the softirq-BKL lock on PREEMPT_RT")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reported-by: Bert Karwatzki <spasswolf@web.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/20260302162631.uGUyIqDT@linutronix.de
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/netdevice.h | 27 ++++++++++++++++++++++-----
net/core/dev.c | 5 +----
net/core/netpoll.c | 2 +-
3 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index d99b0fbc1942a..6655b0c6e42b4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -4708,7 +4708,7 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu)
{
spin_lock(&txq->_xmit_lock);
- /* Pairs with READ_ONCE() in __dev_queue_xmit() */
+ /* Pairs with READ_ONCE() in netif_tx_owned() */
WRITE_ONCE(txq->xmit_lock_owner, cpu);
}
@@ -4726,7 +4726,7 @@ static inline void __netif_tx_release(struct netdev_queue *txq)
static inline void __netif_tx_lock_bh(struct netdev_queue *txq)
{
spin_lock_bh(&txq->_xmit_lock);
- /* Pairs with READ_ONCE() in __dev_queue_xmit() */
+ /* Pairs with READ_ONCE() in netif_tx_owned() */
WRITE_ONCE(txq->xmit_lock_owner, smp_processor_id());
}
@@ -4735,7 +4735,7 @@ static inline bool __netif_tx_trylock(struct netdev_queue *txq)
bool ok = spin_trylock(&txq->_xmit_lock);
if (likely(ok)) {
- /* Pairs with READ_ONCE() in __dev_queue_xmit() */
+ /* Pairs with READ_ONCE() in netif_tx_owned() */
WRITE_ONCE(txq->xmit_lock_owner, smp_processor_id());
}
return ok;
@@ -4743,14 +4743,14 @@ static inline bool __netif_tx_trylock(struct netdev_queue *txq)
static inline void __netif_tx_unlock(struct netdev_queue *txq)
{
- /* Pairs with READ_ONCE() in __dev_queue_xmit() */
+ /* Pairs with READ_ONCE() in netif_tx_owned() */
WRITE_ONCE(txq->xmit_lock_owner, -1);
spin_unlock(&txq->_xmit_lock);
}
static inline void __netif_tx_unlock_bh(struct netdev_queue *txq)
{
- /* Pairs with READ_ONCE() in __dev_queue_xmit() */
+ /* Pairs with READ_ONCE() in netif_tx_owned() */
WRITE_ONCE(txq->xmit_lock_owner, -1);
spin_unlock_bh(&txq->_xmit_lock);
}
@@ -4843,6 +4843,23 @@ static inline void netif_tx_disable(struct net_device *dev)
local_bh_enable();
}
+#ifndef CONFIG_PREEMPT_RT
+static inline bool netif_tx_owned(struct netdev_queue *txq, unsigned int cpu)
+{
+ /* Other cpus might concurrently change txq->xmit_lock_owner
+ * to -1 or to their cpu id, but not to our id.
+ */
+ return READ_ONCE(txq->xmit_lock_owner) == cpu;
+}
+
+#else
+static inline bool netif_tx_owned(struct netdev_queue *txq, unsigned int cpu)
+{
+ return rt_mutex_owner(&txq->_xmit_lock.lock) == current;
+}
+
+#endif
+
static inline void netif_addr_lock(struct net_device *dev)
{
unsigned char nest_level = 0;
diff --git a/net/core/dev.c b/net/core/dev.c
index d45be2357a5ce..994e21a697c39 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4814,10 +4814,7 @@ int __dev_queue_xmit(struct sk_buff *skb, struct net_device *sb_dev)
if (dev->flags & IFF_UP) {
int cpu = smp_processor_id(); /* ok because BHs are off */
- /* Other cpus might concurrently change txq->xmit_lock_owner
- * to -1 or to their cpu id, but not to our id.
- */
- if (READ_ONCE(txq->xmit_lock_owner) != cpu) {
+ if (!netif_tx_owned(txq, cpu)) {
bool is_list = false;
if (dev_xmit_recursion())
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 09f72f10813cc..5af14f14a3623 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -132,7 +132,7 @@ static int netif_local_xmit_active(struct net_device *dev)
for (i = 0; i < dev->num_tx_queues; i++) {
struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
- if (READ_ONCE(txq->xmit_lock_owner) == smp_processor_id())
+ if (netif_tx_owned(txq, smp_processor_id()))
return 1;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 288/311] netfilter: nf_tables: unconditionally bump set->nelems before insertion
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (286 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 287/311] net: Provide a PREEMPT_RT specific check for netdev_queue::_xmit_lock Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 289/311] netfilter: nf_tables: clone set on flush only Sasha Levin
` (36 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Pablo Neira Ayuso, Inseo An, Florian Westphal, Sasha Levin
From: Pablo Neira Ayuso <pablo@netfilter.org>
[ Upstream commit def602e498a4f951da95c95b1b8ce8ae68aa733a ]
In case that the set is full, a new element gets published then removed
without waiting for the RCU grace period, while RCU reader can be
walking over it already.
To address this issue, add the element transaction even if set is full,
but toggle the set_full flag to report -ENFILE so the abort path safely
unwinds the set to its previous state.
As for element updates, decrement set->nelems to restore it.
A simpler fix is to call synchronize_rcu() in the error path.
However, with a large batch adding elements to already maxed-out set,
this could cause noticeable slowdown of such batches.
Fixes: 35d0ac9070ef ("netfilter: nf_tables: fix set->nelems counting with no NLM_F_EXCL")
Reported-by: Inseo An <y0un9sa@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/netfilter/nf_tables_api.c | 30 ++++++++++++++++--------------
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 6d1b34a97ec7f..92fed8723b8f9 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -7169,6 +7169,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
struct nft_data_desc desc;
enum nft_registers dreg;
struct nft_trans *trans;
+ bool set_full = false;
u64 expiration;
u64 timeout;
int err, i;
@@ -7455,10 +7456,18 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
if (err < 0)
goto err_elem_free;
+ if (!(flags & NFT_SET_ELEM_CATCHALL)) {
+ unsigned int max = nft_set_maxsize(set), nelems;
+
+ nelems = atomic_inc_return(&set->nelems);
+ if (nelems > max)
+ set_full = true;
+ }
+
trans = nft_trans_elem_alloc(ctx, NFT_MSG_NEWSETELEM, set);
if (trans == NULL) {
err = -ENOMEM;
- goto err_elem_free;
+ goto err_set_size;
}
ext->genmask = nft_genmask_cur(ctx->net);
@@ -7510,7 +7519,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
ue->priv = elem_priv;
nft_trans_commit_list_add_elem(ctx->net, trans);
- goto err_elem_free;
+ goto err_set_size;
}
}
}
@@ -7528,23 +7537,16 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
goto err_element_clash;
}
- if (!(flags & NFT_SET_ELEM_CATCHALL)) {
- unsigned int max = nft_set_maxsize(set);
-
- if (!atomic_add_unless(&set->nelems, 1, max)) {
- err = -ENFILE;
- goto err_set_full;
- }
- }
-
nft_trans_container_elem(trans)->elems[0].priv = elem.priv;
nft_trans_commit_list_add_elem(ctx->net, trans);
- return 0;
-err_set_full:
- nft_setelem_remove(ctx->net, set, elem.priv);
+ return set_full ? -ENFILE : 0;
+
err_element_clash:
kfree(trans);
+err_set_size:
+ if (!(flags & NFT_SET_ELEM_CATCHALL))
+ atomic_dec(&set->nelems);
err_elem_free:
nf_tables_set_elem_destroy(ctx, set, elem.priv);
err_parse_data:
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 289/311] netfilter: nf_tables: clone set on flush only
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (287 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 288/311] netfilter: nf_tables: unconditionally bump set->nelems before insertion Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 290/311] netfilter: nft_set_pipapo: split gc into unlink and reclaim phase Sasha Levin
` (35 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Pablo Neira Ayuso, syzbot+4924a0edc148e8b4b342, Florian Westphal,
Sasha Levin
From: Pablo Neira Ayuso <pablo@netfilter.org>
[ Upstream commit fb7fb4016300ac622c964069e286dc83166a5d52 ]
Syzbot with fault injection triggered a failing memory allocation with
GFP_KERNEL which results in a WARN splat:
iter.err
WARNING: net/netfilter/nf_tables_api.c:845 at nft_map_deactivate+0x34e/0x3c0 net/netfilter/nf_tables_api.c:845, CPU#0: syz.0.17/5992
Modules linked in:
CPU: 0 UID: 0 PID: 5992 Comm: syz.0.17 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
RIP: 0010:nft_map_deactivate+0x34e/0x3c0 net/netfilter/nf_tables_api.c:845
Code: 8b 05 86 5a 4e 09 48 3b 84 24 a0 00 00 00 75 62 48 8d 65 d8 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc cc e8 63 6d fa f7 90 <0f> 0b 90 43
+80 7c 35 00 00 0f 85 23 fe ff ff e9 26 fe ff ff 89 d9
RSP: 0018:ffffc900045af780 EFLAGS: 00010293
RAX: ffffffff89ca45bd RBX: 00000000fffffff4 RCX: ffff888028111e40
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc900045af870 R08: 0000000000400dc0 R09: 00000000ffffffff
R10: dffffc0000000000 R11: fffffbfff1d141db R12: ffffc900045af7e0
R13: 1ffff920008b5f24 R14: dffffc0000000000 R15: ffffc900045af920
FS: 000055557a6a5500(0000) GS:ffff888125496000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb5ea271fc0 CR3: 000000003269e000 CR4: 00000000003526f0
Call Trace:
<TASK>
__nft_release_table+0xceb/0x11f0 net/netfilter/nf_tables_api.c:12115
nft_rcv_nl_event+0xc25/0xdb0 net/netfilter/nf_tables_api.c:12187
notifier_call_chain+0x19d/0x3a0 kernel/notifier.c:85
blocking_notifier_call_chain+0x6a/0x90 kernel/notifier.c:380
netlink_release+0x123b/0x1ad0 net/netlink/af_netlink.c:761
__sock_release net/socket.c:662 [inline]
sock_close+0xc3/0x240 net/socket.c:1455
Restrict set clone to the flush set command in the preparation phase.
Add NFT_ITER_UPDATE_CLONE and use it for this purpose, update the rbtree
and pipapo backends to only clone the set when this iteration type is
used.
As for the existing NFT_ITER_UPDATE type, update the pipapo backend to
use the existing set clone if available, otherwise use the existing set
representation. After this update, there is no need to clone a set that
is being deleted, this includes bound anonymous set.
An alternative approach to NFT_ITER_UPDATE_CLONE is to add a .clone
interface and call it from the flush set path.
Reported-by: syzbot+4924a0edc148e8b4b342@syzkaller.appspotmail.com
Fixes: 3f1d886cc7c3 ("netfilter: nft_set_pipapo: move cloning of match info to insert/removal path")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/netfilter/nf_tables.h | 2 ++
net/netfilter/nf_tables_api.c | 10 +++++++++-
net/netfilter/nft_set_hash.c | 1 +
net/netfilter/nft_set_pipapo.c | 11 +++++++++--
net/netfilter/nft_set_rbtree.c | 8 +++++---
5 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index f1b67b40dd4de..077d3121cc9f1 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -317,11 +317,13 @@ static inline void *nft_elem_priv_cast(const struct nft_elem_priv *priv)
* @NFT_ITER_UNSPEC: unspecified, to catch errors
* @NFT_ITER_READ: read-only iteration over set elements
* @NFT_ITER_UPDATE: iteration under mutex to update set element state
+ * @NFT_ITER_UPDATE_CLONE: clone set before iteration under mutex to update element
*/
enum nft_iter_type {
NFT_ITER_UNSPEC,
NFT_ITER_READ,
NFT_ITER_UPDATE,
+ NFT_ITER_UPDATE_CLONE,
};
struct nft_set;
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 92fed8723b8f9..7b357a2a871ed 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -832,6 +832,11 @@ static void nft_map_catchall_deactivate(const struct nft_ctx *ctx,
}
}
+/* Use NFT_ITER_UPDATE iterator even if this may be called from the preparation
+ * phase, the set clone might already exist from a previous command, or it might
+ * be a set that is going away and does not require a clone. The netns and
+ * netlink release paths also need to work on the live set.
+ */
static void nft_map_deactivate(const struct nft_ctx *ctx, struct nft_set *set)
{
struct nft_set_iter iter = {
@@ -7891,9 +7896,12 @@ static int nft_set_catchall_flush(const struct nft_ctx *ctx,
static int nft_set_flush(struct nft_ctx *ctx, struct nft_set *set, u8 genmask)
{
+ /* The set backend might need to clone the set, do it now from the
+ * preparation phase, use NFT_ITER_UPDATE_CLONE iterator type.
+ */
struct nft_set_iter iter = {
.genmask = genmask,
- .type = NFT_ITER_UPDATE,
+ .type = NFT_ITER_UPDATE_CLONE,
.fn = nft_setelem_flush,
};
diff --git a/net/netfilter/nft_set_hash.c b/net/netfilter/nft_set_hash.c
index 739b992bde591..b0e571c8e3f38 100644
--- a/net/netfilter/nft_set_hash.c
+++ b/net/netfilter/nft_set_hash.c
@@ -374,6 +374,7 @@ static void nft_rhash_walk(const struct nft_ctx *ctx, struct nft_set *set,
{
switch (iter->type) {
case NFT_ITER_UPDATE:
+ case NFT_ITER_UPDATE_CLONE:
/* only relevant for netlink dumps which use READ type */
WARN_ON_ONCE(iter->skip != 0);
diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c
index 18e1903b1d3d0..cd0d2d4ae36bf 100644
--- a/net/netfilter/nft_set_pipapo.c
+++ b/net/netfilter/nft_set_pipapo.c
@@ -2145,13 +2145,20 @@ static void nft_pipapo_walk(const struct nft_ctx *ctx, struct nft_set *set,
const struct nft_pipapo_match *m;
switch (iter->type) {
- case NFT_ITER_UPDATE:
+ case NFT_ITER_UPDATE_CLONE:
m = pipapo_maybe_clone(set);
if (!m) {
iter->err = -ENOMEM;
return;
}
-
+ nft_pipapo_do_walk(ctx, set, m, iter);
+ break;
+ case NFT_ITER_UPDATE:
+ if (priv->clone)
+ m = priv->clone;
+ else
+ m = rcu_dereference_protected(priv->match,
+ nft_pipapo_transaction_mutex_held(set));
nft_pipapo_do_walk(ctx, set, m, iter);
break;
case NFT_ITER_READ:
diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
index a4fb5b517d9de..5d91b7d08d33a 100644
--- a/net/netfilter/nft_set_rbtree.c
+++ b/net/netfilter/nft_set_rbtree.c
@@ -810,13 +810,15 @@ static void nft_rbtree_walk(const struct nft_ctx *ctx,
struct nft_rbtree *priv = nft_set_priv(set);
switch (iter->type) {
- case NFT_ITER_UPDATE:
- lockdep_assert_held(&nft_pernet(ctx->net)->commit_mutex);
-
+ case NFT_ITER_UPDATE_CLONE:
if (nft_array_may_resize(set) < 0) {
iter->err = -ENOMEM;
break;
}
+ fallthrough;
+ case NFT_ITER_UPDATE:
+ lockdep_assert_held(&nft_pernet(ctx->net)->commit_mutex);
+
nft_rbtree_do_walk(ctx, set, iter);
break;
case NFT_ITER_READ:
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 290/311] netfilter: nft_set_pipapo: split gc into unlink and reclaim phase
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (288 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 289/311] netfilter: nf_tables: clone set on flush only Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 291/311] net: ethernet: mtk_eth_soc: Reset prog ptr to old_prog in case of error in mtk_xdp_setup() Sasha Levin
` (34 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Florian Westphal, Yiming Qian, Sasha Levin
From: Florian Westphal <fw@strlen.de>
[ Upstream commit 9df95785d3d8302f7c066050117b04cd3c2048c2 ]
Yiming Qian reports Use-after-free in the pipapo set type:
Under a large number of expired elements, commit-time GC can run for a very
long time in a non-preemptible context, triggering soft lockup warnings and
RCU stall reports (local denial of service).
We must split GC in an unlink and a reclaim phase.
We cannot queue elements for freeing until pointers have been swapped.
Expired elements are still exposed to both the packet path and userspace
dumpers via the live copy of the data structure.
call_rcu() does not protect us: dump operations or element lookups starting
after call_rcu has fired can still observe the free'd element, unless the
commit phase has made enough progress to swap the clone and live pointers
before any new reader has picked up the old version.
This a similar approach as done recently for the rbtree backend in commit
35f83a75529a ("netfilter: nft_set_rbtree: don't gc elements on insert").
Fixes: 3c4287f62044 ("nf_tables: Add set type for arbitrary concatenation of ranges")
Reported-by: Yiming Qian <yimingqian591@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/netfilter/nf_tables.h | 5 +++
net/netfilter/nf_tables_api.c | 5 ---
net/netfilter/nft_set_pipapo.c | 51 ++++++++++++++++++++++++++-----
net/netfilter/nft_set_pipapo.h | 2 ++
4 files changed, 50 insertions(+), 13 deletions(-)
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 077d3121cc9f1..c18cffafc9696 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -1860,6 +1860,11 @@ struct nft_trans_gc {
struct rcu_head rcu;
};
+static inline int nft_trans_gc_space(const struct nft_trans_gc *trans)
+{
+ return NFT_TRANS_GC_BATCHCOUNT - trans->count;
+}
+
static inline void nft_ctx_update(struct nft_ctx *ctx,
const struct nft_trans *trans)
{
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 7b357a2a871ed..a3865924a505d 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -10480,11 +10480,6 @@ static void nft_trans_gc_queue_work(struct nft_trans_gc *trans)
schedule_work(&trans_gc_work);
}
-static int nft_trans_gc_space(struct nft_trans_gc *trans)
-{
- return NFT_TRANS_GC_BATCHCOUNT - trans->count;
-}
-
struct nft_trans_gc *nft_trans_gc_queue_async(struct nft_trans_gc *gc,
unsigned int gc_seq, gfp_t gfp)
{
diff --git a/net/netfilter/nft_set_pipapo.c b/net/netfilter/nft_set_pipapo.c
index cd0d2d4ae36bf..d9b74d588c768 100644
--- a/net/netfilter/nft_set_pipapo.c
+++ b/net/netfilter/nft_set_pipapo.c
@@ -1681,11 +1681,11 @@ static void nft_pipapo_gc_deactivate(struct net *net, struct nft_set *set,
}
/**
- * pipapo_gc() - Drop expired entries from set, destroy start and end elements
+ * pipapo_gc_scan() - Drop expired entries from set and link them to gc list
* @set: nftables API set representation
* @m: Matching data
*/
-static void pipapo_gc(struct nft_set *set, struct nft_pipapo_match *m)
+static void pipapo_gc_scan(struct nft_set *set, struct nft_pipapo_match *m)
{
struct nft_pipapo *priv = nft_set_priv(set);
struct net *net = read_pnet(&set->net);
@@ -1698,6 +1698,8 @@ static void pipapo_gc(struct nft_set *set, struct nft_pipapo_match *m)
if (!gc)
return;
+ list_add(&gc->list, &priv->gc_head);
+
while ((rules_f0 = pipapo_rules_same_key(m->f, first_rule))) {
union nft_pipapo_map_bucket rulemap[NFT_PIPAPO_MAX_FIELDS];
const struct nft_pipapo_field *f;
@@ -1725,9 +1727,13 @@ static void pipapo_gc(struct nft_set *set, struct nft_pipapo_match *m)
* NFT_SET_ELEM_DEAD_BIT.
*/
if (__nft_set_elem_expired(&e->ext, tstamp)) {
- gc = nft_trans_gc_queue_sync(gc, GFP_KERNEL);
- if (!gc)
- return;
+ if (!nft_trans_gc_space(gc)) {
+ gc = nft_trans_gc_alloc(set, 0, GFP_KERNEL);
+ if (!gc)
+ return;
+
+ list_add(&gc->list, &priv->gc_head);
+ }
nft_pipapo_gc_deactivate(net, set, e);
pipapo_drop(m, rulemap);
@@ -1741,10 +1747,30 @@ static void pipapo_gc(struct nft_set *set, struct nft_pipapo_match *m)
}
}
- gc = nft_trans_gc_catchall_sync(gc);
+ priv->last_gc = jiffies;
+}
+
+/**
+ * pipapo_gc_queue() - Free expired elements
+ * @set: nftables API set representation
+ */
+static void pipapo_gc_queue(struct nft_set *set)
+{
+ struct nft_pipapo *priv = nft_set_priv(set);
+ struct nft_trans_gc *gc, *next;
+
+ /* always do a catchall cycle: */
+ gc = nft_trans_gc_alloc(set, 0, GFP_KERNEL);
if (gc) {
+ gc = nft_trans_gc_catchall_sync(gc);
+ if (gc)
+ nft_trans_gc_queue_sync_done(gc);
+ }
+
+ /* always purge queued gc elements. */
+ list_for_each_entry_safe(gc, next, &priv->gc_head, list) {
+ list_del(&gc->list);
nft_trans_gc_queue_sync_done(gc);
- priv->last_gc = jiffies;
}
}
@@ -1798,6 +1824,10 @@ static void pipapo_reclaim_match(struct rcu_head *rcu)
*
* We also need to create a new working copy for subsequent insertions and
* deletions.
+ *
+ * After the live copy has been replaced by the clone, we can safely queue
+ * expired elements that have been collected by pipapo_gc_scan() for
+ * memory reclaim.
*/
static void nft_pipapo_commit(struct nft_set *set)
{
@@ -1808,7 +1838,7 @@ static void nft_pipapo_commit(struct nft_set *set)
return;
if (time_after_eq(jiffies, priv->last_gc + nft_set_gc_interval(set)))
- pipapo_gc(set, priv->clone);
+ pipapo_gc_scan(set, priv->clone);
old = rcu_replace_pointer(priv->match, priv->clone,
nft_pipapo_transaction_mutex_held(set));
@@ -1816,6 +1846,8 @@ static void nft_pipapo_commit(struct nft_set *set)
if (old)
call_rcu(&old->rcu, pipapo_reclaim_match);
+
+ pipapo_gc_queue(set);
}
static void nft_pipapo_abort(const struct nft_set *set)
@@ -2280,6 +2312,7 @@ static int nft_pipapo_init(const struct nft_set *set,
f->mt = NULL;
}
+ INIT_LIST_HEAD(&priv->gc_head);
rcu_assign_pointer(priv->match, m);
return 0;
@@ -2329,6 +2362,8 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx,
struct nft_pipapo *priv = nft_set_priv(set);
struct nft_pipapo_match *m;
+ WARN_ON_ONCE(!list_empty(&priv->gc_head));
+
m = rcu_dereference_protected(priv->match, true);
if (priv->clone) {
diff --git a/net/netfilter/nft_set_pipapo.h b/net/netfilter/nft_set_pipapo.h
index eaab422aa56ab..9aee9a9eaeb75 100644
--- a/net/netfilter/nft_set_pipapo.h
+++ b/net/netfilter/nft_set_pipapo.h
@@ -156,12 +156,14 @@ struct nft_pipapo_match {
* @clone: Copy where pending insertions and deletions are kept
* @width: Total bytes to be matched for one packet, including padding
* @last_gc: Timestamp of last garbage collection run, jiffies
+ * @gc_head: list of nft_trans_gc to queue up for mem reclaim
*/
struct nft_pipapo {
struct nft_pipapo_match __rcu *match;
struct nft_pipapo_match *clone;
int width;
unsigned long last_gc;
+ struct list_head gc_head;
};
struct nft_pipapo_elem;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 291/311] net: ethernet: mtk_eth_soc: Reset prog ptr to old_prog in case of error in mtk_xdp_setup()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (289 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 290/311] netfilter: nft_set_pipapo: split gc into unlink and reclaim phase Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 292/311] selftests/harness: order TEST_F and XFAIL_ADD constructors Sasha Levin
` (33 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Lorenzo Bianconi, Paolo Valerio, Paolo Abeni, Sasha Levin
From: Lorenzo Bianconi <lorenzo@kernel.org>
[ Upstream commit 0abc73c8a40fd64ac1739c90bb4f42c418d27a5e ]
Reset eBPF program pointer to old_prog and do not decrease its ref-count
if mtk_open routine in mtk_xdp_setup() fails.
Fixes: 7c26c20da5d42 ("net: ethernet: mtk_eth_soc: add basic XDP support")
Suggested-by: Paolo Valerio <pvalerio@redhat.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260303-mtk-xdp-prog-ptr-fix-v2-1-97b6dbbe240f@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index e68997a29191b..8d3e15bc867d2 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -3749,12 +3749,21 @@ static int mtk_xdp_setup(struct net_device *dev, struct bpf_prog *prog,
mtk_stop(dev);
old_prog = rcu_replace_pointer(eth->prog, prog, lockdep_rtnl_is_held());
+
+ if (netif_running(dev) && need_update) {
+ int err;
+
+ err = mtk_open(dev);
+ if (err) {
+ rcu_assign_pointer(eth->prog, old_prog);
+
+ return err;
+ }
+ }
+
if (old_prog)
bpf_prog_put(old_prog);
- if (netif_running(dev) && need_update)
- return mtk_open(dev);
-
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 292/311] selftests/harness: order TEST_F and XFAIL_ADD constructors
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (290 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 291/311] net: ethernet: mtk_eth_soc: Reset prog ptr to old_prog in case of error in mtk_xdp_setup() Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 293/311] net: bridge: fix nd_tbl NULL dereference when IPv6 is disabled Sasha Levin
` (32 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Sun Jian, Jakub Kicinski, Sasha Levin
From: Sun Jian <sun.jian.kdev@gmail.com>
[ Upstream commit 6be2681514261324c8ee8a1c6f76cefdf700220f ]
TEST_F() allocates and registers its struct __test_metadata via mmap()
inside its constructor, and only then assigns the
_##fixture_##test##_object pointer.
XFAIL_ADD() runs in a constructor too and reads
_##fixture_##test##_object to initialize xfail->test. If XFAIL_ADD runs
first, xfail->test can be NULL and the expected failure will be reported
as FAIL.
Use constructor priorities to ensure TEST_F registration runs before
XFAIL_ADD, without adding extra state or runtime lookups.
Fixes: 2709473c9386 ("selftests: kselftest_harness: support using xfail")
Signed-off-by: Sun Jian <sun.jian.kdev@gmail.com>
Link: https://patch.msgid.link/20260225111451.347923-1-sun.jian.kdev@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/kselftest_harness.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
index 16a119a4656c7..4afaef01c22e9 100644
--- a/tools/testing/selftests/kselftest_harness.h
+++ b/tools/testing/selftests/kselftest_harness.h
@@ -76,6 +76,9 @@ static inline void __kselftest_memset_safe(void *s, int c, size_t n)
memset(s, c, n);
}
+#define KSELFTEST_PRIO_TEST_F 20000
+#define KSELFTEST_PRIO_XFAIL 20001
+
#define TEST_TIMEOUT_DEFAULT 30
/* Utilities exposed to the test definitions */
@@ -465,7 +468,7 @@ static inline void __kselftest_memset_safe(void *s, int c, size_t n)
fixture_name##_teardown(_metadata, self, variant); \
} \
static struct __test_metadata *_##fixture_name##_##test_name##_object; \
- static void __attribute__((constructor)) \
+ static void __attribute__((constructor(KSELFTEST_PRIO_TEST_F))) \
_register_##fixture_name##_##test_name(void) \
{ \
struct __test_metadata *object = mmap(NULL, sizeof(*object), \
@@ -880,7 +883,7 @@ struct __test_xfail {
.fixture = &_##fixture_name##_fixture_object, \
.variant = &_##fixture_name##_##variant_name##_object, \
}; \
- static void __attribute__((constructor)) \
+ static void __attribute__((constructor(KSELFTEST_PRIO_XFAIL))) \
_register_##fixture_name##_##variant_name##_##test_name##_xfail(void) \
{ \
_##fixture_name##_##variant_name##_##test_name##_xfail.test = \
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 293/311] net: bridge: fix nd_tbl NULL dereference when IPv6 is disabled
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (291 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 292/311] selftests/harness: order TEST_F and XFAIL_ADD constructors Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 294/311] net: vxlan: " Sasha Levin
` (31 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Fernando Fernandez Mancera, Guruprasad C P, Ido Schimmel,
Nikolay Aleksandrov, Jakub Kicinski, Sasha Levin
From: Fernando Fernandez Mancera <fmancera@suse.de>
[ Upstream commit e5e890630533bdc15b26a34bb8e7ef539bdf1322 ]
When booting with the 'ipv6.disable=1' parameter, the nd_tbl is never
initialized because inet6_init() exits before ndisc_init() is called
which initializes it. Then, if neigh_suppress is enabled and an ICMPv6
Neighbor Discovery packet reaches the bridge, br_do_suppress_nd() will
dereference ipv6_stub->nd_tbl which is NULL, passing it to
neigh_lookup(). This causes a kernel NULL pointer dereference.
BUG: kernel NULL pointer dereference, address: 0000000000000268
Oops: 0000 [#1] PREEMPT SMP NOPTI
[...]
RIP: 0010:neigh_lookup+0x16/0xe0
[...]
Call Trace:
<IRQ>
? neigh_lookup+0x16/0xe0
br_do_suppress_nd+0x160/0x290 [bridge]
br_handle_frame_finish+0x500/0x620 [bridge]
br_handle_frame+0x353/0x440 [bridge]
__netif_receive_skb_core.constprop.0+0x298/0x1110
__netif_receive_skb_one_core+0x3d/0xa0
process_backlog+0xa0/0x140
__napi_poll+0x2c/0x170
net_rx_action+0x2c4/0x3a0
handle_softirqs+0xd0/0x270
do_softirq+0x3f/0x60
Fix this by replacing IS_ENABLED(IPV6) call with ipv6_mod_enabled() in
the callers. This is in essence disabling NS/NA suppression when IPv6 is
disabled.
Fixes: ed842faeb2bd ("bridge: suppress nd pkts on BR_NEIGH_SUPPRESS ports")
Reported-by: Guruprasad C P <gurucp2005@gmail.com>
Closes: https://lore.kernel.org/netdev/CAHXs0ORzd62QOG-Fttqa2Cx_A_VFp=utE2H2VTX5nqfgs7LDxQ@mail.gmail.com/
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/20260304120357.9778-1-fmancera@suse.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/bridge/br_device.c | 2 +-
net/bridge/br_input.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index a818fdc22da9a..525d4eccd194a 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -74,7 +74,7 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
eth_hdr(skb)->h_proto == htons(ETH_P_RARP)) &&
br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED)) {
br_do_proxy_suppress_arp(skb, br, vid, NULL);
- } else if (IS_ENABLED(CONFIG_IPV6) &&
+ } else if (ipv6_mod_enabled() &&
skb->protocol == htons(ETH_P_IPV6) &&
br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED) &&
pskb_may_pull(skb, sizeof(struct ipv6hdr) +
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 1405f1061a549..2cbae0f9ae1f0 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -170,7 +170,7 @@ int br_handle_frame_finish(struct net *net, struct sock *sk, struct sk_buff *skb
(skb->protocol == htons(ETH_P_ARP) ||
skb->protocol == htons(ETH_P_RARP))) {
br_do_proxy_suppress_arp(skb, br, vid, p);
- } else if (IS_ENABLED(CONFIG_IPV6) &&
+ } else if (ipv6_mod_enabled() &&
skb->protocol == htons(ETH_P_IPV6) &&
br_opt_get(br, BROPT_NEIGH_SUPPRESS_ENABLED) &&
pskb_may_pull(skb, sizeof(struct ipv6hdr) +
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 294/311] net: vxlan: fix nd_tbl NULL dereference when IPv6 is disabled
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (292 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 293/311] net: bridge: fix nd_tbl NULL dereference when IPv6 is disabled Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 295/311] net: ipv6: fix panic when IPv4 route references loopback IPv6 nexthop Sasha Levin
` (30 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Fernando Fernandez Mancera, Jakub Kicinski, Sasha Levin
From: Fernando Fernandez Mancera <fmancera@suse.de>
[ Upstream commit 168ff39e4758897d2eee4756977d036d52884c7e ]
When booting with the 'ipv6.disable=1' parameter, the nd_tbl is never
initialized because inet6_init() exits before ndisc_init() is called
which initializes it. If an IPv6 packet is injected into the interface,
route_shortcircuit() is called and a NULL pointer dereference happens on
neigh_lookup().
BUG: kernel NULL pointer dereference, address: 0000000000000380
Oops: Oops: 0000 [#1] SMP NOPTI
[...]
RIP: 0010:neigh_lookup+0x20/0x270
[...]
Call Trace:
<TASK>
vxlan_xmit+0x638/0x1ef0 [vxlan]
dev_hard_start_xmit+0x9e/0x2e0
__dev_queue_xmit+0xbee/0x14e0
packet_sendmsg+0x116f/0x1930
__sys_sendto+0x1f5/0x200
__x64_sys_sendto+0x24/0x30
do_syscall_64+0x12f/0x1590
entry_SYSCALL_64_after_hwframe+0x76/0x7e
Fix this by adding an early check on route_shortcircuit() when protocol
is ETH_P_IPV6. Note that ipv6_mod_enabled() cannot be used here because
VXLAN can be built-in even when IPv6 is built as a module.
Fixes: e15a00aafa4b ("vxlan: add ipv6 route short circuit support")
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
Link: https://patch.msgid.link/20260304120357.9778-2-fmancera@suse.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/vxlan/vxlan_core.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index e957aa12a8a44..2a140be86bafc 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -2130,6 +2130,11 @@ static bool route_shortcircuit(struct net_device *dev, struct sk_buff *skb)
{
struct ipv6hdr *pip6;
+ /* check if nd_tbl is not initiliazed due to
+ * ipv6.disable=1 set during boot
+ */
+ if (!ipv6_stub->nd_tbl)
+ return false;
if (!pskb_may_pull(skb, sizeof(struct ipv6hdr)))
return false;
pip6 = ipv6_hdr(skb);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 295/311] net: ipv6: fix panic when IPv4 route references loopback IPv6 nexthop
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (293 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 294/311] net: vxlan: " Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 296/311] net/sched: act_ife: Fix metalist update behavior Sasha Levin
` (29 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Jiayuan Chen, Ido Schimmel, syzbot+334190e097a98a1b81bb,
David Ahern, Jakub Kicinski, Sasha Levin
From: Jiayuan Chen <jiayuan.chen@shopee.com>
[ Upstream commit 21ec92774d1536f71bdc90b0e3d052eff99cf093 ]
When a standalone IPv6 nexthop object is created with a loopback device
(e.g., "ip -6 nexthop add id 100 dev lo"), fib6_nh_init() misclassifies
it as a reject route. This is because nexthop objects have no destination
prefix (fc_dst=::), causing fib6_is_reject() to match any loopback
nexthop. The reject path skips fib_nh_common_init(), leaving
nhc_pcpu_rth_output unallocated. If an IPv4 route later references this
nexthop, __mkroute_output() dereferences NULL nhc_pcpu_rth_output and
panics.
Simplify the check in fib6_nh_init() to only match explicit reject
routes (RTF_REJECT) instead of using fib6_is_reject(). The loopback
promotion heuristic in fib6_is_reject() is handled separately by
ip6_route_info_create_nh(). After this change, the three cases behave
as follows:
1. Explicit reject route ("ip -6 route add unreachable 2001:db8::/64"):
RTF_REJECT is set, enters reject path, skips fib_nh_common_init().
No behavior change.
2. Implicit loopback reject route ("ip -6 route add 2001:db8::/32 dev lo"):
RTF_REJECT is not set, takes normal path, fib_nh_common_init() is
called. ip6_route_info_create_nh() still promotes it to reject
afterward. nhc_pcpu_rth_output is allocated but unused, which is
harmless.
3. Standalone nexthop object ("ip -6 nexthop add id 100 dev lo"):
RTF_REJECT is not set, takes normal path, fib_nh_common_init() is
called. nhc_pcpu_rth_output is properly allocated, fixing the crash
when IPv4 routes reference this nexthop.
Suggested-by: Ido Schimmel <idosch@nvidia.com>
Fixes: 493ced1ac47c ("ipv4: Allow routes to use nexthop objects")
Reported-by: syzbot+334190e097a98a1b81bb@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/698f8482.a70a0220.2c38d7.00ca.GAE@google.com/T/
Signed-off-by: Jiayuan Chen <jiayuan.chen@shopee.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20260304113817.294966-2-jiayuan.chen@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/ipv6/route.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index e7d90a28948a4..e01331d965313 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -3584,7 +3584,6 @@ int fib6_nh_init(struct net *net, struct fib6_nh *fib6_nh,
netdevice_tracker *dev_tracker = &fib6_nh->fib_nh_dev_tracker;
struct net_device *dev = NULL;
struct inet6_dev *idev = NULL;
- int addr_type;
int err;
fib6_nh->fib_nh_family = AF_INET6;
@@ -3626,11 +3625,10 @@ int fib6_nh_init(struct net *net, struct fib6_nh *fib6_nh,
fib6_nh->fib_nh_weight = 1;
- /* We cannot add true routes via loopback here,
- * they would result in kernel looping; promote them to reject routes
+ /* Reset the nexthop device to the loopback device in case of reject
+ * routes.
*/
- addr_type = ipv6_addr_type(&cfg->fc_dst);
- if (fib6_is_reject(cfg->fc_flags, dev, addr_type)) {
+ if (cfg->fc_flags & RTF_REJECT) {
/* hold loopback dev/idev if we haven't done so. */
if (dev != net->loopback_dev) {
if (dev) {
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 296/311] net/sched: act_ife: Fix metalist update behavior
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (294 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 295/311] net: ipv6: fix panic when IPv4 route references loopback IPv6 nexthop Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 297/311] xdp: use modulo operation to calculate XDP frag tailroom Sasha Levin
` (28 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Jamal Hadi Salim, Ruitong Liu, Victor Nogueira, Jakub Kicinski,
Sasha Levin
From: Jamal Hadi Salim <jhs@mojatatu.com>
[ Upstream commit e2cedd400c3ec0302ffca2490e8751772906ac23 ]
Whenever an ife action replace changes the metalist, instead of
replacing the old data on the metalist, the current ife code is appending
the new metadata. Aside from being innapropriate behavior, this may lead
to an unbounded addition of metadata to the metalist which might cause an
out of bounds error when running the encode op:
[ 138.423369][ C1] ==================================================================
[ 138.424317][ C1] BUG: KASAN: slab-out-of-bounds in ife_tlv_meta_encode (net/ife/ife.c:168)
[ 138.424906][ C1] Write of size 4 at addr ffff8880077f4ffe by task ife_out_out_bou/255
[ 138.425778][ C1] CPU: 1 UID: 0 PID: 255 Comm: ife_out_out_bou Not tainted 7.0.0-rc1-00169-gfbdfa8da05b6 #624 PREEMPT(full)
[ 138.425795][ C1] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 138.425800][ C1] Call Trace:
[ 138.425804][ C1] <IRQ>
[ 138.425808][ C1] dump_stack_lvl (lib/dump_stack.c:122)
[ 138.425828][ C1] print_report (mm/kasan/report.c:379 mm/kasan/report.c:482)
[ 138.425839][ C1] ? srso_alias_return_thunk (arch/x86/lib/retpoline.S:221)
[ 138.425844][ C1] ? __virt_addr_valid (./arch/x86/include/asm/preempt.h:95 (discriminator 1) ./include/linux/rcupdate.h:975 (discriminator 1) ./include/linux/mmzone.h:2207 (discriminator 1) arch/x86/mm/physaddr.c:54 (discriminator 1))
[ 138.425853][ C1] ? ife_tlv_meta_encode (net/ife/ife.c:168)
[ 138.425859][ C1] kasan_report (mm/kasan/report.c:221 mm/kasan/report.c:597)
[ 138.425868][ C1] ? ife_tlv_meta_encode (net/ife/ife.c:168)
[ 138.425878][ C1] kasan_check_range (mm/kasan/generic.c:186 (discriminator 1) mm/kasan/generic.c:200 (discriminator 1))
[ 138.425884][ C1] __asan_memset (mm/kasan/shadow.c:84 (discriminator 2))
[ 138.425889][ C1] ife_tlv_meta_encode (net/ife/ife.c:168)
[ 138.425893][ C1] ? ife_tlv_meta_encode (net/ife/ife.c:171)
[ 138.425898][ C1] ? srso_alias_return_thunk (arch/x86/lib/retpoline.S:221)
[ 138.425903][ C1] ife_encode_meta_u16 (net/sched/act_ife.c:57)
[ 138.425910][ C1] ? __pfx_do_raw_spin_lock (kernel/locking/spinlock_debug.c:114)
[ 138.425916][ C1] ? __asan_memcpy (mm/kasan/shadow.c:105 (discriminator 3))
[ 138.425921][ C1] ? __pfx_ife_encode_meta_u16 (net/sched/act_ife.c:45)
[ 138.425927][ C1] ? srso_alias_return_thunk (arch/x86/lib/retpoline.S:221)
[ 138.425931][ C1] tcf_ife_act (net/sched/act_ife.c:847 net/sched/act_ife.c:879)
To solve this issue, fix the replace behavior by adding the metalist to
the ife rcu data structure.
Fixes: aa9fd9a325d51 ("sched: act: ife: update parameters via rcu handling")
Reported-by: Ruitong Liu <cnitlrt@gmail.com>
Tested-by: Ruitong Liu <cnitlrt@gmail.com>
Co-developed-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Victor Nogueira <victor@mojatatu.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://patch.msgid.link/20260304140603.76500-1-jhs@mojatatu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/tc_act/tc_ife.h | 4 +-
net/sched/act_ife.c | 93 ++++++++++++++++++-------------------
2 files changed, 45 insertions(+), 52 deletions(-)
diff --git a/include/net/tc_act/tc_ife.h b/include/net/tc_act/tc_ife.h
index c7f24a2da1cad..24d4d5a62b3c2 100644
--- a/include/net/tc_act/tc_ife.h
+++ b/include/net/tc_act/tc_ife.h
@@ -13,15 +13,13 @@ struct tcf_ife_params {
u8 eth_src[ETH_ALEN];
u16 eth_type;
u16 flags;
-
+ struct list_head metalist;
struct rcu_head rcu;
};
struct tcf_ife_info {
struct tc_action common;
struct tcf_ife_params __rcu *params;
- /* list of metaids allowed */
- struct list_head metalist;
};
#define to_ife(a) ((struct tcf_ife_info *)a)
diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c
index 8e8f6af731d51..4ad01d4e820db 100644
--- a/net/sched/act_ife.c
+++ b/net/sched/act_ife.c
@@ -293,8 +293,8 @@ static int load_metaops_and_vet(u32 metaid, void *val, int len, bool rtnl_held)
/* called when adding new meta information
*/
static int __add_metainfo(const struct tcf_meta_ops *ops,
- struct tcf_ife_info *ife, u32 metaid, void *metaval,
- int len, bool atomic, bool exists)
+ struct tcf_ife_params *p, u32 metaid, void *metaval,
+ int len, bool atomic)
{
struct tcf_meta_info *mi = NULL;
int ret = 0;
@@ -313,45 +313,40 @@ static int __add_metainfo(const struct tcf_meta_ops *ops,
}
}
- if (exists)
- spin_lock_bh(&ife->tcf_lock);
- list_add_tail(&mi->metalist, &ife->metalist);
- if (exists)
- spin_unlock_bh(&ife->tcf_lock);
+ list_add_tail(&mi->metalist, &p->metalist);
return ret;
}
static int add_metainfo_and_get_ops(const struct tcf_meta_ops *ops,
- struct tcf_ife_info *ife, u32 metaid,
- bool exists)
+ struct tcf_ife_params *p, u32 metaid)
{
int ret;
if (!try_module_get(ops->owner))
return -ENOENT;
- ret = __add_metainfo(ops, ife, metaid, NULL, 0, true, exists);
+ ret = __add_metainfo(ops, p, metaid, NULL, 0, true);
if (ret)
module_put(ops->owner);
return ret;
}
-static int add_metainfo(struct tcf_ife_info *ife, u32 metaid, void *metaval,
- int len, bool exists)
+static int add_metainfo(struct tcf_ife_params *p, u32 metaid, void *metaval,
+ int len)
{
const struct tcf_meta_ops *ops = find_ife_oplist(metaid);
int ret;
if (!ops)
return -ENOENT;
- ret = __add_metainfo(ops, ife, metaid, metaval, len, false, exists);
+ ret = __add_metainfo(ops, p, metaid, metaval, len, false);
if (ret)
/*put back what find_ife_oplist took */
module_put(ops->owner);
return ret;
}
-static int use_all_metadata(struct tcf_ife_info *ife, bool exists)
+static int use_all_metadata(struct tcf_ife_params *p)
{
struct tcf_meta_ops *o;
int rc = 0;
@@ -359,7 +354,7 @@ static int use_all_metadata(struct tcf_ife_info *ife, bool exists)
read_lock(&ife_mod_lock);
list_for_each_entry(o, &ifeoplist, list) {
- rc = add_metainfo_and_get_ops(o, ife, o->metaid, exists);
+ rc = add_metainfo_and_get_ops(o, p, o->metaid);
if (rc == 0)
installed += 1;
}
@@ -371,7 +366,7 @@ static int use_all_metadata(struct tcf_ife_info *ife, bool exists)
return -EINVAL;
}
-static int dump_metalist(struct sk_buff *skb, struct tcf_ife_info *ife)
+static int dump_metalist(struct sk_buff *skb, struct tcf_ife_params *p)
{
struct tcf_meta_info *e;
struct nlattr *nest;
@@ -379,14 +374,14 @@ static int dump_metalist(struct sk_buff *skb, struct tcf_ife_info *ife)
int total_encoded = 0;
/*can only happen on decode */
- if (list_empty(&ife->metalist))
+ if (list_empty(&p->metalist))
return 0;
nest = nla_nest_start_noflag(skb, TCA_IFE_METALST);
if (!nest)
goto out_nlmsg_trim;
- list_for_each_entry(e, &ife->metalist, metalist) {
+ list_for_each_entry(e, &p->metalist, metalist) {
if (!e->ops->get(skb, e))
total_encoded += 1;
}
@@ -403,13 +398,11 @@ static int dump_metalist(struct sk_buff *skb, struct tcf_ife_info *ife)
return -1;
}
-/* under ife->tcf_lock */
-static void _tcf_ife_cleanup(struct tc_action *a)
+static void __tcf_ife_cleanup(struct tcf_ife_params *p)
{
- struct tcf_ife_info *ife = to_ife(a);
struct tcf_meta_info *e, *n;
- list_for_each_entry_safe(e, n, &ife->metalist, metalist) {
+ list_for_each_entry_safe(e, n, &p->metalist, metalist) {
list_del(&e->metalist);
if (e->metaval) {
if (e->ops->release)
@@ -422,18 +415,23 @@ static void _tcf_ife_cleanup(struct tc_action *a)
}
}
+static void tcf_ife_cleanup_params(struct rcu_head *head)
+{
+ struct tcf_ife_params *p = container_of(head, struct tcf_ife_params,
+ rcu);
+
+ __tcf_ife_cleanup(p);
+ kfree(p);
+}
+
static void tcf_ife_cleanup(struct tc_action *a)
{
struct tcf_ife_info *ife = to_ife(a);
struct tcf_ife_params *p;
- spin_lock_bh(&ife->tcf_lock);
- _tcf_ife_cleanup(a);
- spin_unlock_bh(&ife->tcf_lock);
-
p = rcu_dereference_protected(ife->params, 1);
if (p)
- kfree_rcu(p, rcu);
+ call_rcu(&p->rcu, tcf_ife_cleanup_params);
}
static int load_metalist(struct nlattr **tb, bool rtnl_held)
@@ -455,8 +453,7 @@ static int load_metalist(struct nlattr **tb, bool rtnl_held)
return 0;
}
-static int populate_metalist(struct tcf_ife_info *ife, struct nlattr **tb,
- bool exists, bool rtnl_held)
+static int populate_metalist(struct tcf_ife_params *p, struct nlattr **tb)
{
int len = 0;
int rc = 0;
@@ -468,7 +465,7 @@ static int populate_metalist(struct tcf_ife_info *ife, struct nlattr **tb,
val = nla_data(tb[i]);
len = nla_len(tb[i]);
- rc = add_metainfo(ife, i, val, len, exists);
+ rc = add_metainfo(p, i, val, len);
if (rc)
return rc;
}
@@ -523,6 +520,7 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
p = kzalloc(sizeof(*p), GFP_KERNEL);
if (!p)
return -ENOMEM;
+ INIT_LIST_HEAD(&p->metalist);
if (tb[TCA_IFE_METALST]) {
err = nla_parse_nested_deprecated(tb2, IFE_META_MAX,
@@ -567,8 +565,6 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
}
ife = to_ife(*a);
- if (ret == ACT_P_CREATED)
- INIT_LIST_HEAD(&ife->metalist);
err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack);
if (err < 0)
@@ -600,8 +596,7 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
}
if (tb[TCA_IFE_METALST]) {
- err = populate_metalist(ife, tb2, exists,
- !(flags & TCA_ACT_FLAGS_NO_RTNL));
+ err = populate_metalist(p, tb2);
if (err)
goto metadata_parse_err;
} else {
@@ -610,7 +605,7 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
* as we can. You better have at least one else we are
* going to bail out
*/
- err = use_all_metadata(ife, exists);
+ err = use_all_metadata(p);
if (err)
goto metadata_parse_err;
}
@@ -626,13 +621,14 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
if (goto_ch)
tcf_chain_put_by_act(goto_ch);
if (p)
- kfree_rcu(p, rcu);
+ call_rcu(&p->rcu, tcf_ife_cleanup_params);
return ret;
metadata_parse_err:
if (goto_ch)
tcf_chain_put_by_act(goto_ch);
release_idr:
+ __tcf_ife_cleanup(p);
kfree(p);
tcf_idr_release(*a, bind);
return err;
@@ -679,7 +675,7 @@ static int tcf_ife_dump(struct sk_buff *skb, struct tc_action *a, int bind,
if (nla_put(skb, TCA_IFE_TYPE, 2, &p->eth_type))
goto nla_put_failure;
- if (dump_metalist(skb, ife)) {
+ if (dump_metalist(skb, p)) {
/*ignore failure to dump metalist */
pr_info("Failed to dump metalist\n");
}
@@ -693,13 +689,13 @@ static int tcf_ife_dump(struct sk_buff *skb, struct tc_action *a, int bind,
return -1;
}
-static int find_decode_metaid(struct sk_buff *skb, struct tcf_ife_info *ife,
+static int find_decode_metaid(struct sk_buff *skb, struct tcf_ife_params *p,
u16 metaid, u16 mlen, void *mdata)
{
struct tcf_meta_info *e;
/* XXX: use hash to speed up */
- list_for_each_entry(e, &ife->metalist, metalist) {
+ list_for_each_entry_rcu(e, &p->metalist, metalist) {
if (metaid == e->metaid) {
if (e->ops) {
/* We check for decode presence already */
@@ -716,10 +712,13 @@ static int tcf_ife_decode(struct sk_buff *skb, const struct tc_action *a,
{
struct tcf_ife_info *ife = to_ife(a);
int action = ife->tcf_action;
+ struct tcf_ife_params *p;
u8 *ifehdr_end;
u8 *tlv_data;
u16 metalen;
+ p = rcu_dereference_bh(ife->params);
+
bstats_update(this_cpu_ptr(ife->common.cpu_bstats), skb);
tcf_lastuse_update(&ife->tcf_tm);
@@ -745,7 +744,7 @@ static int tcf_ife_decode(struct sk_buff *skb, const struct tc_action *a,
return TC_ACT_SHOT;
}
- if (find_decode_metaid(skb, ife, mtype, dlen, curr_data)) {
+ if (find_decode_metaid(skb, p, mtype, dlen, curr_data)) {
/* abuse overlimits to count when we receive metadata
* but dont have an ops for it
*/
@@ -769,12 +768,12 @@ static int tcf_ife_decode(struct sk_buff *skb, const struct tc_action *a,
/*XXX: check if we can do this at install time instead of current
* send data path
**/
-static int ife_get_sz(struct sk_buff *skb, struct tcf_ife_info *ife)
+static int ife_get_sz(struct sk_buff *skb, struct tcf_ife_params *p)
{
- struct tcf_meta_info *e, *n;
+ struct tcf_meta_info *e;
int tot_run_sz = 0, run_sz = 0;
- list_for_each_entry_safe(e, n, &ife->metalist, metalist) {
+ list_for_each_entry_rcu(e, &p->metalist, metalist) {
if (e->ops->check_presence) {
run_sz = e->ops->check_presence(skb, e);
tot_run_sz += run_sz;
@@ -795,7 +794,7 @@ static int tcf_ife_encode(struct sk_buff *skb, const struct tc_action *a,
OUTERHDR:TOTMETALEN:{TLVHDR:Metadatum:TLVHDR..}:ORIGDATA
where ORIGDATA = original ethernet header ...
*/
- u16 metalen = ife_get_sz(skb, ife);
+ u16 metalen = ife_get_sz(skb, p);
int hdrm = metalen + skb->dev->hard_header_len + IFE_METAHDRLEN;
unsigned int skboff = 0;
int new_len = skb->len + hdrm;
@@ -833,25 +832,21 @@ static int tcf_ife_encode(struct sk_buff *skb, const struct tc_action *a,
if (!ife_meta)
goto drop;
- spin_lock(&ife->tcf_lock);
-
/* XXX: we dont have a clever way of telling encode to
* not repeat some of the computations that are done by
* ops->presence_check...
*/
- list_for_each_entry(e, &ife->metalist, metalist) {
+ list_for_each_entry_rcu(e, &p->metalist, metalist) {
if (e->ops->encode) {
err = e->ops->encode(skb, (void *)(ife_meta + skboff),
e);
}
if (err < 0) {
/* too corrupt to keep around if overwritten */
- spin_unlock(&ife->tcf_lock);
goto drop;
}
skboff += err;
}
- spin_unlock(&ife->tcf_lock);
oethh = (struct ethhdr *)skb->data;
if (!is_zero_ether_addr(p->eth_src))
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 297/311] xdp: use modulo operation to calculate XDP frag tailroom
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (295 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 296/311] net/sched: act_ife: Fix metalist update behavior Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 298/311] xsk: introduce helper to determine rxq->frag_size Sasha Levin
` (27 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Larysa Zaremba, Jakub Kicinski, Aleksandr Loktionov, Sasha Levin
From: Larysa Zaremba <larysa.zaremba@intel.com>
[ Upstream commit 88b6b7f7b216108a09887b074395fa7b751880b1 ]
The current formula for calculating XDP tailroom in mbuf packets works only
if each frag has its own page (if rxq->frag_size is PAGE_SIZE), this
defeats the purpose of the parameter overall and without any indication
leads to negative calculated tailroom on at least half of frags, if shared
pages are used.
There are not many drivers that set rxq->frag_size. Among them:
* i40e and enetc always split page uniformly between frags, use shared
pages
* ice uses page_pool frags via libeth, those are power-of-2 and uniformly
distributed across page
* idpf has variable frag_size with XDP on, so current API is not applicable
* mlx5, mtk and mvneta use PAGE_SIZE or 0 as frag_size for page_pool
As for AF_XDP ZC, only ice, i40e and idpf declare frag_size for it. Modulo
operation yields good results for aligned chunks, they are all power-of-2,
between 2K and PAGE_SIZE. Formula without modulo fails when chunk_size is
2K. Buffers in unaligned mode are not distributed uniformly, so modulo
operation would not work.
To accommodate unaligned buffers, we could define frag_size as
data + tailroom, and hence do not subtract offset when calculating
tailroom, but this would necessitate more changes in the drivers.
Define rxq->frag_size as an even portion of a page that fully belongs to a
single frag. When calculating tailroom, locate the data start within such
portion by performing a modulo operation on page offset.
Fixes: bf25146a5595 ("bpf: add frags support to the bpf_xdp_adjust_tail() API")
Acked-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://patch.msgid.link/20260305111253.2317394-2-larysa.zaremba@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/filter.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 51318cb40f778..f82996e63dd72 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -4156,7 +4156,8 @@ static int bpf_xdp_frags_increase_tail(struct xdp_buff *xdp, int offset)
if (!rxq->frag_size || rxq->frag_size > xdp->frame_sz)
return -EOPNOTSUPP;
- tailroom = rxq->frag_size - skb_frag_size(frag) - skb_frag_off(frag);
+ tailroom = rxq->frag_size - skb_frag_size(frag) -
+ skb_frag_off(frag) % rxq->frag_size;
if (unlikely(offset > tailroom))
return -EINVAL;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 298/311] xsk: introduce helper to determine rxq->frag_size
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (296 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 297/311] xdp: use modulo operation to calculate XDP frag tailroom Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 299/311] ice: fix rxq info registering in mbuf packets Sasha Levin
` (26 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Larysa Zaremba, Aleksandr Loktionov, Jakub Kicinski, Sasha Levin
From: Larysa Zaremba <larysa.zaremba@intel.com>
[ Upstream commit 16394d80539937d348dd3b9ea32415c54e67a81b ]
rxq->frag_size is basically a step between consecutive strictly aligned
frames. In ZC mode, chunk size fits exactly, but if chunks are unaligned,
there is no safe way to determine accessible space to grow tailroom.
Report frag_size to be zero, if chunks are unaligned, chunk_size otherwise.
Fixes: 24ea50127ecf ("xsk: support mbuf on ZC RX")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://patch.msgid.link/20260305111253.2317394-3-larysa.zaremba@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/xdp_sock_drv.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/net/xdp_sock_drv.h b/include/net/xdp_sock_drv.h
index aefc368449d59..6b9ebae2dc952 100644
--- a/include/net/xdp_sock_drv.h
+++ b/include/net/xdp_sock_drv.h
@@ -51,6 +51,11 @@ static inline u32 xsk_pool_get_rx_frame_size(struct xsk_buff_pool *pool)
return xsk_pool_get_chunk_size(pool) - xsk_pool_get_headroom(pool);
}
+static inline u32 xsk_pool_get_rx_frag_step(struct xsk_buff_pool *pool)
+{
+ return pool->unaligned ? 0 : xsk_pool_get_chunk_size(pool);
+}
+
static inline void xsk_pool_set_rxq_info(struct xsk_buff_pool *pool,
struct xdp_rxq_info *rxq)
{
@@ -337,6 +342,11 @@ static inline u32 xsk_pool_get_rx_frame_size(struct xsk_buff_pool *pool)
return 0;
}
+static inline u32 xsk_pool_get_rx_frag_step(struct xsk_buff_pool *pool)
+{
+ return 0;
+}
+
static inline void xsk_pool_set_rxq_info(struct xsk_buff_pool *pool,
struct xdp_rxq_info *rxq)
{
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 299/311] ice: fix rxq info registering in mbuf packets
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (297 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 298/311] xsk: introduce helper to determine rxq->frag_size Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 300/311] ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz Sasha Levin
` (25 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Larysa Zaremba, Aleksandr Loktionov, Jakub Kicinski, Sasha Levin
From: Larysa Zaremba <larysa.zaremba@intel.com>
[ Upstream commit 02852b47c706772af795d3e28fca99fc9b923b2c ]
XDP RxQ info contains frag_size, which depends on the MTU. This makes the
old way of registering RxQ info before calculating new buffer sizes
invalid. Currently, it leads to frag_size being outdated, making it
sometimes impossible to grow tailroom in a mbuf packet. E.g. fragments are
actually 3K+, but frag size is still as if MTU was 1500.
Always register new XDP RxQ info after reconfiguring memory pools.
Fixes: 2fba7dc5157b ("ice: Add support for XDP multi-buffer on Rx side")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://patch.msgid.link/20260305111253.2317394-4-larysa.zaremba@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_base.c | 26 ++++++--------------
drivers/net/ethernet/intel/ice/ice_ethtool.c | 1 +
drivers/net/ethernet/intel/ice/ice_txrx.c | 4 ++-
drivers/net/ethernet/intel/ice/ice_xsk.c | 3 +++
4 files changed, 14 insertions(+), 20 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c
index f0da50df6791c..2c117ca7c76aa 100644
--- a/drivers/net/ethernet/intel/ice/ice_base.c
+++ b/drivers/net/ethernet/intel/ice/ice_base.c
@@ -666,23 +666,12 @@ static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)
if (ring->vsi->type == ICE_VSI_PF || ring->vsi->type == ICE_VSI_SF ||
ring->vsi->type == ICE_VSI_LB) {
- if (!xdp_rxq_info_is_reg(&ring->xdp_rxq)) {
- err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
- ring->q_index,
- ring->q_vector->napi.napi_id,
- ring->rx_buf_len);
- if (err)
- return err;
- }
-
ice_rx_xsk_pool(ring);
err = ice_realloc_rx_xdp_bufs(ring, ring->xsk_pool);
if (err)
return err;
if (ring->xsk_pool) {
- xdp_rxq_info_unreg(&ring->xdp_rxq);
-
rx_buf_len =
xsk_pool_get_rx_frame_size(ring->xsk_pool);
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
@@ -705,14 +694,13 @@ static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)
if (err)
return err;
- if (!xdp_rxq_info_is_reg(&ring->xdp_rxq)) {
- err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
- ring->q_index,
- ring->q_vector->napi.napi_id,
- ring->rx_buf_len);
- if (err)
- goto err_destroy_fq;
- }
+ err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
+ ring->q_index,
+ ring->q_vector->napi.napi_id,
+ ring->rx_buf_len);
+ if (err)
+ goto err_destroy_fq;
+
xdp_rxq_info_attach_page_pool(&ring->xdp_rxq,
ring->pp);
}
diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index 5377550a2b6e1..1b343c53874e1 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -3332,6 +3332,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring,
rx_rings[i].cached_phctime = pf->ptp.cached_phc_time;
rx_rings[i].desc = NULL;
rx_rings[i].xdp_buf = NULL;
+ rx_rings[i].xdp_rxq = (struct xdp_rxq_info){ };
/* this is to allow wr32 to have something to write to
* during early allocation of Rx buffers
diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index ad76768a42323..f47b96ceb9a47 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -560,7 +560,9 @@ void ice_clean_rx_ring(struct ice_rx_ring *rx_ring)
i = 0;
}
- if (rx_ring->vsi->type == ICE_VSI_PF &&
+ if ((rx_ring->vsi->type == ICE_VSI_PF ||
+ rx_ring->vsi->type == ICE_VSI_SF ||
+ rx_ring->vsi->type == ICE_VSI_LB) &&
xdp_rxq_info_is_reg(&rx_ring->xdp_rxq)) {
xdp_rxq_info_detach_mem_model(&rx_ring->xdp_rxq);
xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c
index 989ff1fd91103..102631398af3c 100644
--- a/drivers/net/ethernet/intel/ice/ice_xsk.c
+++ b/drivers/net/ethernet/intel/ice/ice_xsk.c
@@ -900,6 +900,9 @@ void ice_xsk_clean_rx_ring(struct ice_rx_ring *rx_ring)
u16 ntc = rx_ring->next_to_clean;
u16 ntu = rx_ring->next_to_use;
+ if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
+ xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
+
while (ntc != ntu) {
struct xdp_buff *xdp = *ice_xdp_buf(rx_ring, ntc);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 300/311] ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (298 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 299/311] ice: fix rxq info registering in mbuf packets Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 301/311] i40e: fix registering XDP RxQ info Sasha Levin
` (24 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Larysa Zaremba, Aleksandr Loktionov, Jakub Kicinski, Sasha Levin
From: Larysa Zaremba <larysa.zaremba@intel.com>
[ Upstream commit e142dc4ef0f451b7ef99d09aaa84e9389af629d7 ]
The only user of frag_size field in XDP RxQ info is
bpf_xdp_frags_increase_tail(). It clearly expects whole buff size instead
of DMA write size. Different assumptions in ice driver configuration lead
to negative tailroom.
This allows to trigger kernel panic, when using
XDP_ADJUST_TAIL_GROW_MULTI_BUFF xskxceiver test and changing packet size to
6912 and the requested offset to a huge value, e.g.
XSK_UMEM__MAX_FRAME_SIZE * 100.
Due to other quirks of the ZC configuration in ice, panic is not observed
in ZC mode, but tailroom growing still fails when it should not.
Use fill queue buffer truesize instead of DMA write size in XDP RxQ info.
Fix ZC mode too by using the new helper.
Fixes: 2fba7dc5157b ("ice: Add support for XDP multi-buffer on Rx side")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://patch.msgid.link/20260305111253.2317394-5-larysa.zaremba@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/ice/ice_base.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_base.c b/drivers/net/ethernet/intel/ice/ice_base.c
index 2c117ca7c76aa..5a6da2d501213 100644
--- a/drivers/net/ethernet/intel/ice/ice_base.c
+++ b/drivers/net/ethernet/intel/ice/ice_base.c
@@ -661,7 +661,6 @@ static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)
{
struct device *dev = ice_pf_to_dev(ring->vsi->back);
u32 num_bufs = ICE_DESC_UNUSED(ring);
- u32 rx_buf_len;
int err;
if (ring->vsi->type == ICE_VSI_PF || ring->vsi->type == ICE_VSI_SF ||
@@ -672,12 +671,12 @@ static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)
return err;
if (ring->xsk_pool) {
- rx_buf_len =
- xsk_pool_get_rx_frame_size(ring->xsk_pool);
+ u32 frag_size =
+ xsk_pool_get_rx_frag_step(ring->xsk_pool);
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->q_index,
ring->q_vector->napi.napi_id,
- rx_buf_len);
+ frag_size);
if (err)
return err;
err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
@@ -697,7 +696,7 @@ static int ice_vsi_cfg_rxq(struct ice_rx_ring *ring)
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->q_index,
ring->q_vector->napi.napi_id,
- ring->rx_buf_len);
+ ring->truesize);
if (err)
goto err_destroy_fq;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 301/311] i40e: fix registering XDP RxQ info
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (299 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 300/311] ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 302/311] i40e: use xdp.frame_sz as XDP RxQ info frag_size Sasha Levin
` (23 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Larysa Zaremba, Aleksandr Loktionov, Jakub Kicinski, Sasha Levin
From: Larysa Zaremba <larysa.zaremba@intel.com>
[ Upstream commit 8f497dc8a61429cc004720aa8e713743355d80cf ]
Current way of handling XDP RxQ info in i40e has a problem, where frag_size
is not updated when xsk_buff_pool is detached or when MTU is changed, this
leads to growing tail always failing for multi-buffer packets.
Couple XDP RxQ info registering with buffer allocations and unregistering
with cleaning the ring.
Fixes: a045d2f2d03d ("i40e: set xdp_rxq_info::frag_size")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://patch.msgid.link/20260305111253.2317394-6-larysa.zaremba@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 34 ++++++++++++---------
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 5 +--
2 files changed, 22 insertions(+), 17 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 02de186dcc8f5..bc00bd4f439be 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3583,18 +3583,8 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
if (ring->vsi->type != I40E_VSI_MAIN)
goto skip;
- if (!xdp_rxq_info_is_reg(&ring->xdp_rxq)) {
- err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
- ring->queue_index,
- ring->q_vector->napi.napi_id,
- ring->rx_buf_len);
- if (err)
- return err;
- }
-
ring->xsk_pool = i40e_xsk_pool(ring);
if (ring->xsk_pool) {
- xdp_rxq_info_unreg(&ring->xdp_rxq);
ring->rx_buf_len = xsk_pool_get_rx_frame_size(ring->xsk_pool);
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->queue_index,
@@ -3606,17 +3596,23 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
MEM_TYPE_XSK_BUFF_POOL,
NULL);
if (err)
- return err;
+ goto unreg_xdp;
dev_info(&vsi->back->pdev->dev,
"Registered XDP mem model MEM_TYPE_XSK_BUFF_POOL on Rx ring %d\n",
ring->queue_index);
} else {
+ err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
+ ring->queue_index,
+ ring->q_vector->napi.napi_id,
+ ring->rx_buf_len);
+ if (err)
+ return err;
err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
MEM_TYPE_PAGE_SHARED,
NULL);
if (err)
- return err;
+ goto unreg_xdp;
}
skip:
@@ -3654,7 +3650,8 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
dev_info(&vsi->back->pdev->dev,
"Failed to clear LAN Rx queue context on Rx ring %d (pf_q %d), error: %d\n",
ring->queue_index, pf_q, err);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto unreg_xdp;
}
/* set the context in the HMC */
@@ -3663,7 +3660,8 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
dev_info(&vsi->back->pdev->dev,
"Failed to set LAN Rx queue context on Rx ring %d (pf_q %d), error: %d\n",
ring->queue_index, pf_q, err);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto unreg_xdp;
}
/* configure Rx buffer alignment */
@@ -3671,7 +3669,8 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
if (I40E_2K_TOO_SMALL_WITH_PADDING) {
dev_info(&vsi->back->pdev->dev,
"2k Rx buffer is too small to fit standard MTU and skb_shared_info\n");
- return -EOPNOTSUPP;
+ err = -EOPNOTSUPP;
+ goto unreg_xdp;
}
clear_ring_build_skb_enabled(ring);
} else {
@@ -3701,6 +3700,11 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
}
return 0;
+unreg_xdp:
+ if (ring->vsi->type == I40E_VSI_MAIN)
+ xdp_rxq_info_unreg(&ring->xdp_rxq);
+
+ return err;
}
/**
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index cc0b9efc2637a..816179c7e2712 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -1470,6 +1470,9 @@ void i40e_clean_rx_ring(struct i40e_ring *rx_ring)
if (!rx_ring->rx_bi)
return;
+ if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
+ xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
+
if (rx_ring->xsk_pool) {
i40e_xsk_clean_rx_ring(rx_ring);
goto skip_free;
@@ -1527,8 +1530,6 @@ void i40e_clean_rx_ring(struct i40e_ring *rx_ring)
void i40e_free_rx_resources(struct i40e_ring *rx_ring)
{
i40e_clean_rx_ring(rx_ring);
- if (rx_ring->vsi->type == I40E_VSI_MAIN)
- xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
rx_ring->xdp_prog = NULL;
kfree(rx_ring->rx_bi);
rx_ring->rx_bi = NULL;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 302/311] i40e: use xdp.frame_sz as XDP RxQ info frag_size
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (300 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 301/311] i40e: fix registering XDP RxQ info Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 303/311] net: enetc: use truesize " Sasha Levin
` (22 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Larysa Zaremba, Aleksandr Loktionov, Jakub Kicinski, Sasha Levin
From: Larysa Zaremba <larysa.zaremba@intel.com>
[ Upstream commit c69d22c6c46a1d792ba8af3d8d6356fdc0e6f538 ]
The only user of frag_size field in XDP RxQ info is
bpf_xdp_frags_increase_tail(). It clearly expects whole buffer size instead
of DMA write size. Different assumptions in i40e driver configuration lead
to negative tailroom.
Set frag_size to the same value as frame_sz in shared pages mode, use new
helper to set frag_size when AF_XDP ZC is active.
Fixes: a045d2f2d03d ("i40e: set xdp_rxq_info::frag_size")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://patch.msgid.link/20260305111253.2317394-7-larysa.zaremba@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index bc00bd4f439be..598739220dfb9 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -3569,6 +3569,7 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
u16 pf_q = vsi->base_queue + ring->queue_index;
struct i40e_hw *hw = &vsi->back->hw;
struct i40e_hmc_obj_rxq rx_ctx;
+ u32 xdp_frame_sz;
int err = 0;
bool ok;
@@ -3578,6 +3579,7 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
memset(&rx_ctx, 0, sizeof(rx_ctx));
ring->rx_buf_len = vsi->rx_buf_len;
+ xdp_frame_sz = i40e_rx_pg_size(ring) / 2;
/* XDP RX-queue info only needed for RX rings exposed to XDP */
if (ring->vsi->type != I40E_VSI_MAIN)
@@ -3585,11 +3587,12 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
ring->xsk_pool = i40e_xsk_pool(ring);
if (ring->xsk_pool) {
+ xdp_frame_sz = xsk_pool_get_rx_frag_step(ring->xsk_pool);
ring->rx_buf_len = xsk_pool_get_rx_frame_size(ring->xsk_pool);
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->queue_index,
ring->q_vector->napi.napi_id,
- ring->rx_buf_len);
+ xdp_frame_sz);
if (err)
return err;
err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
@@ -3605,7 +3608,7 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
err = __xdp_rxq_info_reg(&ring->xdp_rxq, ring->netdev,
ring->queue_index,
ring->q_vector->napi.napi_id,
- ring->rx_buf_len);
+ xdp_frame_sz);
if (err)
return err;
err = xdp_rxq_info_reg_mem_model(&ring->xdp_rxq,
@@ -3616,7 +3619,7 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring)
}
skip:
- xdp_init_buff(&ring->xdp, i40e_rx_pg_size(ring) / 2, &ring->xdp_rxq);
+ xdp_init_buff(&ring->xdp, xdp_frame_sz, &ring->xdp_rxq);
rx_ctx.dbuff = DIV_ROUND_UP(ring->rx_buf_len,
BIT_ULL(I40E_RXQ_CTX_DBUFF_SHIFT));
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 303/311] net: enetc: use truesize as XDP RxQ info frag_size
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (301 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 302/311] i40e: use xdp.frame_sz as XDP RxQ info frag_size Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 304/311] xdp: produce a warning when calculated tailroom is negative Sasha Levin
` (21 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Larysa Zaremba, Aleksandr Loktionov, Vladimir Oltean,
Jakub Kicinski, Sasha Levin
From: Larysa Zaremba <larysa.zaremba@intel.com>
[ Upstream commit f8e18abf183dbd636a8725532c7f5aa58957de84 ]
The only user of frag_size field in XDP RxQ info is
bpf_xdp_frags_increase_tail(). It clearly expects truesize instead of DMA
write size. Different assumptions in enetc driver configuration lead to
negative tailroom.
Set frag_size to the same value as frame_sz.
Fixes: 2768b2e2f7d2 ("net: enetc: register XDP RX queues with frag_size")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://patch.msgid.link/20260305111253.2317394-9-larysa.zaremba@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/freescale/enetc/enetc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/enetc/enetc.c b/drivers/net/ethernet/freescale/enetc/enetc.c
index e380a4f398556..9fdd448e602f1 100644
--- a/drivers/net/ethernet/freescale/enetc/enetc.c
+++ b/drivers/net/ethernet/freescale/enetc/enetc.c
@@ -3468,7 +3468,7 @@ static int enetc_int_vector_init(struct enetc_ndev_priv *priv, int i,
priv->rx_ring[i] = bdr;
err = __xdp_rxq_info_reg(&bdr->xdp.rxq, priv->ndev, i, 0,
- ENETC_RXB_DMA_SIZE_XDP);
+ ENETC_RXB_TRUESIZE);
if (err)
goto free_vector;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 304/311] xdp: produce a warning when calculated tailroom is negative
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (302 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 303/311] net: enetc: use truesize " Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 305/311] accel: ethosu: Fix job submit error clean-up refcount underflows Sasha Levin
` (20 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Larysa Zaremba, Aleksandr Loktionov,
Toke Høiland-Jørgensen, Martin KaFai Lau,
Jakub Kicinski, Sasha Levin
From: Larysa Zaremba <larysa.zaremba@intel.com>
[ Upstream commit 8821e857759be9db3cde337ad328b71fe5c8a55f ]
Many ethernet drivers report xdp Rx queue frag size as being the same as
DMA write size. However, the only user of this field, namely
bpf_xdp_frags_increase_tail(), clearly expects a truesize.
Such difference leads to unspecific memory corruption issues under certain
circumstances, e.g. in ixgbevf maximum DMA write size is 3 KB, so when
running xskxceiver's XDP_ADJUST_TAIL_GROW_MULTI_BUFF, 6K packet fully uses
all DMA-writable space in 2 buffers. This would be fine, if only
rxq->frag_size was properly set to 4K, but value of 3K results in a
negative tailroom, because there is a non-zero page offset.
We are supposed to return -EINVAL and be done with it in such case, but due
to tailroom being stored as an unsigned int, it is reported to be somewhere
near UINT_MAX, resulting in a tail being grown, even if the requested
offset is too much (it is around 2K in the abovementioned test). This later
leads to all kinds of unspecific calltraces.
[ 7340.337579] xskxceiver[1440]: segfault at 1da718 ip 00007f4161aeac9d sp 00007f41615a6a00 error 6
[ 7340.338040] xskxceiver[1441]: segfault at 7f410000000b ip 00000000004042b5 sp 00007f415bffecf0 error 4
[ 7340.338179] in libc.so.6[61c9d,7f4161aaf000+160000]
[ 7340.339230] in xskxceiver[42b5,400000+69000]
[ 7340.340300] likely on CPU 6 (core 0, socket 6)
[ 7340.340302] Code: ff ff 01 e9 f4 fe ff ff 0f 1f 44 00 00 4c 39 f0 74 73 31 c0 ba 01 00 00 00 f0 0f b1 17 0f 85 ba 00 00 00 49 8b 87 88 00 00 00 <4c> 89 70 08 eb cc 0f 1f 44 00 00 48 8d bd f0 fe ff ff 89 85 ec fe
[ 7340.340888] likely on CPU 3 (core 0, socket 3)
[ 7340.345088] Code: 00 00 00 ba 00 00 00 00 be 00 00 00 00 89 c7 e8 31 ca ff ff 89 45 ec 8b 45 ec 85 c0 78 07 b8 00 00 00 00 eb 46 e8 0b c8 ff ff <8b> 00 83 f8 69 74 24 e8 ff c7 ff ff 8b 00 83 f8 0b 74 18 e8 f3 c7
[ 7340.404334] Oops: general protection fault, probably for non-canonical address 0x6d255010bdffc: 0000 [#1] SMP NOPTI
[ 7340.405972] CPU: 7 UID: 0 PID: 1439 Comm: xskxceiver Not tainted 6.19.0-rc1+ #21 PREEMPT(lazy)
[ 7340.408006] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.17.0-5.fc42 04/01/2014
[ 7340.409716] RIP: 0010:lookup_swap_cgroup_id+0x44/0x80
[ 7340.410455] Code: 83 f8 1c 73 39 48 ba ff ff ff ff ff ff ff 03 48 8b 04 c5 20 55 fa bd 48 21 d1 48 89 ca 83 e1 01 48 d1 ea c1 e1 04 48 8d 04 90 <8b> 00 48 83 c4 10 d3 e8 c3 cc cc cc cc 31 c0 e9 98 b7 dd 00 48 89
[ 7340.412787] RSP: 0018:ffffcc5c04f7f6d0 EFLAGS: 00010202
[ 7340.413494] RAX: 0006d255010bdffc RBX: ffff891f477895a8 RCX: 0000000000000010
[ 7340.414431] RDX: 0001c17e3fffffff RSI: 00fa070000000000 RDI: 000382fc7fffffff
[ 7340.415354] RBP: 00fa070000000000 R08: ffffcc5c04f7f8f8 R09: ffffcc5c04f7f7d0
[ 7340.416283] R10: ffff891f4c1a7000 R11: ffffcc5c04f7f9c8 R12: ffffcc5c04f7f7d0
[ 7340.417218] R13: 03ffffffffffffff R14: 00fa06fffffffe00 R15: ffff891f47789500
[ 7340.418229] FS: 0000000000000000(0000) GS:ffff891ffdfaa000(0000) knlGS:0000000000000000
[ 7340.419489] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 7340.420286] CR2: 00007f415bfffd58 CR3: 0000000103f03002 CR4: 0000000000772ef0
[ 7340.421237] PKRU: 55555554
[ 7340.421623] Call Trace:
[ 7340.421987] <TASK>
[ 7340.422309] ? softleaf_from_pte+0x77/0xa0
[ 7340.422855] swap_pte_batch+0xa7/0x290
[ 7340.423363] zap_nonpresent_ptes.constprop.0.isra.0+0xd1/0x270
[ 7340.424102] zap_pte_range+0x281/0x580
[ 7340.424607] zap_pmd_range.isra.0+0xc9/0x240
[ 7340.425177] unmap_page_range+0x24d/0x420
[ 7340.425714] unmap_vmas+0xa1/0x180
[ 7340.426185] exit_mmap+0xe1/0x3b0
[ 7340.426644] __mmput+0x41/0x150
[ 7340.427098] exit_mm+0xb1/0x110
[ 7340.427539] do_exit+0x1b2/0x460
[ 7340.427992] do_group_exit+0x2d/0xc0
[ 7340.428477] get_signal+0x79d/0x7e0
[ 7340.428957] arch_do_signal_or_restart+0x34/0x100
[ 7340.429571] exit_to_user_mode_loop+0x8e/0x4c0
[ 7340.430159] do_syscall_64+0x188/0x6b0
[ 7340.430672] ? __do_sys_clone3+0xd9/0x120
[ 7340.431212] ? switch_fpu_return+0x4e/0xd0
[ 7340.431761] ? arch_exit_to_user_mode_prepare.isra.0+0xa1/0xc0
[ 7340.432498] ? do_syscall_64+0xbb/0x6b0
[ 7340.433015] ? __handle_mm_fault+0x445/0x690
[ 7340.433582] ? count_memcg_events+0xd6/0x210
[ 7340.434151] ? handle_mm_fault+0x212/0x340
[ 7340.434697] ? do_user_addr_fault+0x2b4/0x7b0
[ 7340.435271] ? clear_bhb_loop+0x30/0x80
[ 7340.435788] ? clear_bhb_loop+0x30/0x80
[ 7340.436299] ? clear_bhb_loop+0x30/0x80
[ 7340.436812] ? clear_bhb_loop+0x30/0x80
[ 7340.437323] entry_SYSCALL_64_after_hwframe+0x76/0x7e
[ 7340.437973] RIP: 0033:0x7f4161b14169
[ 7340.438468] Code: Unable to access opcode bytes at 0x7f4161b1413f.
[ 7340.439242] RSP: 002b:00007ffc6ebfa770 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
[ 7340.440173] RAX: fffffffffffffe00 RBX: 00000000000005a1 RCX: 00007f4161b14169
[ 7340.441061] RDX: 00000000000005a1 RSI: 0000000000000109 RDI: 00007f415bfff990
[ 7340.441943] RBP: 00007ffc6ebfa7a0 R08: 0000000000000000 R09: 00000000ffffffff
[ 7340.442824] R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
[ 7340.443707] R13: 0000000000000000 R14: 00007f415bfff990 R15: 00007f415bfff6c0
[ 7340.444586] </TASK>
[ 7340.444922] Modules linked in: rfkill intel_rapl_msr intel_rapl_common intel_uncore_frequency_common skx_edac_common nfit libnvdimm kvm_intel vfat fat kvm snd_pcm irqbypass rapl iTCO_wdt snd_timer intel_pmc_bxt iTCO_vendor_support snd ixgbevf virtio_net soundcore i2c_i801 pcspkr libeth_xdp net_failover i2c_smbus lpc_ich failover libeth virtio_balloon joydev 9p fuse loop zram lz4hc_compress lz4_compress 9pnet_virtio 9pnet netfs ghash_clmulni_intel serio_raw qemu_fw_cfg
[ 7340.449650] ---[ end trace 0000000000000000 ]---
The issue can be fixed in all in-tree drivers, but we cannot just trust OOT
drivers to not do this. Therefore, make tailroom a signed int and produce a
warning when it is negative to prevent such mistakes in the future.
Fixes: bf25146a5595 ("bpf: add frags support to the bpf_xdp_adjust_tail() API")
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
Signed-off-by: Larysa Zaremba <larysa.zaremba@intel.com>
Link: https://patch.msgid.link/20260305111253.2317394-10-larysa.zaremba@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/core/filter.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index f82996e63dd72..8bbf24c15413e 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -4151,13 +4151,14 @@ static int bpf_xdp_frags_increase_tail(struct xdp_buff *xdp, int offset)
struct skb_shared_info *sinfo = xdp_get_shared_info_from_buff(xdp);
skb_frag_t *frag = &sinfo->frags[sinfo->nr_frags - 1];
struct xdp_rxq_info *rxq = xdp->rxq;
- unsigned int tailroom;
+ int tailroom;
if (!rxq->frag_size || rxq->frag_size > xdp->frame_sz)
return -EOPNOTSUPP;
tailroom = rxq->frag_size - skb_frag_size(frag) -
skb_frag_off(frag) % rxq->frag_size;
+ WARN_ON_ONCE(tailroom < 0);
if (unlikely(offset > tailroom))
return -EINVAL;
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 305/311] accel: ethosu: Fix job submit error clean-up refcount underflows
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (303 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 304/311] xdp: produce a warning when calculated tailroom is negative Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 306/311] accel: ethosu: Fix NPU_OP_ELEMENTWISE validation with scalar Sasha Levin
` (19 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Rob Herring (Arm), Anders Roxell, Sasha Levin
From: "Rob Herring (Arm)" <robh@kernel.org>
[ Upstream commit 150bceb3e0a4a30950279d91ea0e8cc69a736742 ]
If the job submit fails before adding the job to the scheduler queue
such as when the GEM buffer bounds checks fail, then doing a
ethosu_job_put() results in a pm_runtime_put_autosuspend() without the
corresponding pm_runtime_resume_and_get(). The dma_fence_put()'s are
also unnecessary, but seem to be harmless.
Split the ethosu_job_cleanup() function into 2 parts for the before
and after the job is queued.
Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver")
Reviewed-and-Tested-by: Anders Roxell <anders.roxell@linaro.org>
Link: https://patch.msgid.link/20260218-ethos-fixes-v1-1-be3fa3ea9a30@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/ethosu/ethosu_job.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/drivers/accel/ethosu/ethosu_job.c b/drivers/accel/ethosu/ethosu_job.c
index 26e7a2f64d71a..70a144803b096 100644
--- a/drivers/accel/ethosu/ethosu_job.c
+++ b/drivers/accel/ethosu/ethosu_job.c
@@ -143,23 +143,29 @@ static int ethosu_job_push(struct ethosu_job *job)
return ret;
}
+static void ethosu_job_err_cleanup(struct ethosu_job *job)
+{
+ unsigned int i;
+
+ for (i = 0; i < job->region_cnt; i++)
+ drm_gem_object_put(job->region_bo[i]);
+
+ drm_gem_object_put(job->cmd_bo);
+
+ kfree(job);
+}
+
static void ethosu_job_cleanup(struct kref *ref)
{
struct ethosu_job *job = container_of(ref, struct ethosu_job,
refcount);
- unsigned int i;
pm_runtime_put_autosuspend(job->dev->base.dev);
dma_fence_put(job->done_fence);
dma_fence_put(job->inference_done_fence);
- for (i = 0; i < job->region_cnt; i++)
- drm_gem_object_put(job->region_bo[i]);
-
- drm_gem_object_put(job->cmd_bo);
-
- kfree(job);
+ ethosu_job_err_cleanup(job);
}
static void ethosu_job_put(struct ethosu_job *job)
@@ -454,12 +460,16 @@ static int ethosu_ioctl_submit_job(struct drm_device *dev, struct drm_file *file
}
}
ret = ethosu_job_push(ejob);
+ if (!ret) {
+ ethosu_job_put(ejob);
+ return 0;
+ }
out_cleanup_job:
if (ret)
drm_sched_job_cleanup(&ejob->base);
out_put_job:
- ethosu_job_put(ejob);
+ ethosu_job_err_cleanup(ejob);
return ret;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 306/311] accel: ethosu: Fix NPU_OP_ELEMENTWISE validation with scalar
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (304 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 305/311] accel: ethosu: Fix job submit error clean-up refcount underflows Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 307/311] ata: libata-eh: Fix detection of deferred qc timeouts Sasha Levin
` (18 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Rob Herring (Arm), Anders Roxell, Sasha Levin
From: "Rob Herring (Arm)" <robh@kernel.org>
[ Upstream commit 838ae99f9a77a5724ee6d4e7b7b1eb079147f888 ]
The NPU_OP_ELEMENTWISE instruction uses a scalar value for IFM2 if the
IFM2_BROADCAST "scalar" mode is set. It is a bit (7) on the u65 and
part of a field (bits 3:0) on the u85. The driver was hardcoded to the
u85.
Fixes: 5a5e9c0228e6 ("accel: Add Arm Ethos-U NPU driver")
Reviewed-and-Tested-by: Anders Roxell <anders.roxell@linaro.org>
Link: https://patch.msgid.link/20260218-ethos-fixes-v1-2-be3fa3ea9a30@kernel.org
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/accel/ethosu/ethosu_gem.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/accel/ethosu/ethosu_gem.c b/drivers/accel/ethosu/ethosu_gem.c
index 7b073116314ba..4e84481a29d2f 100644
--- a/drivers/accel/ethosu/ethosu_gem.c
+++ b/drivers/accel/ethosu/ethosu_gem.c
@@ -417,7 +417,10 @@ static int ethosu_gem_cmdstream_copy_and_validate(struct drm_device *ddev,
return ret;
break;
case NPU_OP_ELEMENTWISE:
- use_ifm2 = !((st.ifm2.broadcast == 8) || (param == 5) ||
+ use_scale = ethosu_is_u65(edev) ?
+ (st.ifm2.broadcast & 0x80) :
+ (st.ifm2.broadcast == 8);
+ use_ifm2 = !(use_scale || (param == 5) ||
(param == 6) || (param == 7) || (param == 0x24));
use_ifm = st.ifm.broadcast != 8;
ret = calc_sizes_elemwise(ddev, info, cmd, &st, use_ifm, use_ifm2);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 000/311] 6.19.7-rc1 review
@ 2026-03-10 11:05 Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 001/311] perf/core: Fix refcount bug and potential UAF in perf_mmap Sasha Levin
` (324 more replies)
0 siblings, 325 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Sasha Levin, gregkh, patches, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
This is the start of the stable review cycle for the 6.19.7 release.
There are 311 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
and the diffstat can be found below.
Thanks,
Sasha
-------------
Pseudo-Shortlog of commits:
Aaron Ma (1):
ice: recap the VSI and QoS info after rebuild
Alain Volmat (1):
spi: stm32: fix missing pointer assignment in case of dma chaining
Alban Bedel (1):
can: mcp251x: fix deadlock in error path of mcp251x_open
Alex Hung (2):
drm/amd/display: Use mpc.preblend flag to indicate 3D LUT
drm/amd/display: Enable DEGAMMA and reject COLOR_PIPELINE+DEGAMMA_LUT
Alexandre Courbot (1):
rust: kunit: fix warning when !CONFIG_PRINTK
Alexey Charkov (1):
scsi: ufs: core: Fix RPMB region size detection for UFS 2.2
Allison Henderson (1):
net/rds: Fix circular locking dependency in rds_tcp_tune
Alper Ak (1):
crypto: ccp - Fix use-after-free on error path
Andrew Cooper (1):
x86/fred: Correct speculative safety in fred_extint()
Andrew Lunn (1):
net: phy: register phy led_triggers during probe to avoid AB-BA
deadlock
Ankit Garg (1):
gve: fix incorrect buffer cleanup in gve_tx_clean_pending_packets for
QPL
Ariel Silver (1):
wifi: mac80211: bounds-check link_id in ieee80211_ml_reconfiguration
Bart Van Assche (5):
drm/amdgpu: Unlock a mutex before destroying it
drm/amdgpu: Fix locking bugs in error paths
hwmon: (it87) Check the it87_lock() return value
wifi: cw1200: Fix locking in error paths
wifi: wlcore: Fix a locking bug
Bjorn Helgaas (1):
PCI: Correct PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 value
Bobby Eshleman (1):
net: devmem: use READ_ONCE/WRITE_ONCE on binding->dev
Boris Faure (1):
ASoC: sdca: Fix missing regmap dependencies in Kconfig
Brad Spengler (1):
drm/vmwgfx: Fix invalid kref_put callback in vmw_bo_dirty_release
Brian Vazquez (1):
idpf: change IRQ naming to match netdev and ethtool queue numbering
Catalin Marinas (1):
arm64: gcs: Do not set PTE_SHARED on GCS mappings if FEAT_LPA2 is
enabled
Chaitanya Kulkarni (1):
blktrace: fix __this_cpu_read/write in preemptible context
Charles Haithcock (1):
i2c: i801: Revert "i2c: i801: replace acpi_lock with I2C bus lock"
Charles Keepax (1):
ASoC: SDCA: Add allocation failure check for Entity name
Chen Ni (2):
drm/imx: parallel-display: check return value of devm_drm_bridge_add()
in imx_pd_probe()
drm/bridge: synopsys: dw-dp: Check return value of
devm_drm_bridge_add() in dw_dp_bind()
Chintan Vankar (1):
net: ethernet: ti: am65-cpsw-nuss/cpsw-ale: Fix multicast entry
handling in ALE table
Christian Brauner (1):
namespace: fix proc mount iteration
Christoph Böhmwalder (1):
drbd: fix null-pointer dereference on local read error
Christoph Hellwig (2):
zloop: advertise a volatile write cache
zloop: check for spurious options passed to remove
Conor Dooley (1):
pinctrl: generic: move function to amlogic-am4 driver
Corey Minyard (1):
ipmi: Fix use-after-free and list corruption on sender error
Dan Carpenter (1):
accel: ethosu: Fix shift overflow in cmd_to_addr()
Daniel Hodges (1):
wifi: libertas: fix use-after-free in lbs_free_adapter()
Daniel J Blueman (1):
gpio: shared: fix memory leaks
Danielle Ratson (1):
bridge: Check relevant per-VLAN options in VLAN range grouping
Daniil Dulov (1):
wifi: cfg80211: cancel rfkill_block work in wiphy_unregister()
Danilo Krummrich (1):
clk: scu/imx8qxp: do not register driver in probe()
Darrick J. Wong (1):
xfs: fix xfs_group release bug in xfs_dax_notify_dev_failure
Dave Jiang (2):
cxl: Move devm_cxl_add_nvdimm_bridge() to cxl_pmem.ko
cxl: Fix race of nvdimm_bus object when creating nvdimm objects
David Carlier (1):
sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag
David Howells (1):
netfs: Fix unbuffered/DIO writes to dispatch subrequests in strict
sequence
David Laight (1):
uaccess: Fix scoped_user_read_access() for 'pointer to const'
David Thomson (1):
xen/acpi-processor: fix _CST detection using undersized evaluation
buffer
Davide Caratti (1):
net/sched: ets: fix divide by zero in the offload path
Davidlohr Bueso (1):
cxl/mbox: validate payload size before accessing contents in
cxl_payload_from_user_allowed()
Deepanshu Kartikey (1):
mm: thp: deny THP for files on anonymous inodes
Eduard Zingerman (1):
bpf: collect only live registers in linked regs
Eric Biggers (1):
ksmbd: Compare MACs in constant time
Eric Dumazet (5):
net: annotate data-races around sk->sk_{data_ready,write_space}
inet: annotate data-races around isk->inet_num
indirect_call_wrapper: do not reevaluate function pointer
tcp: secure_seq: add back ports to TS offset
net_sched: sch_fq: clear q->band_pkt_count[] in fq_reset()
Ethan Tidmore (2):
drm/tiny: sharp-memory: fix pointer error dereference
xfs: Fix error pointer dereference
Felix Gu (7):
drm/logicvc: Fix device node reference leak in
logicvc_drm_config_parse()
regulator: fp9931: Fix PM runtime reference leak in
fp9931_hwmon_read()
regulator: bq257xx: Fix device node reference leak in
bq257xx_reg_dt_parse_gpio()
pinctrl: pinconf-generic: Fix memory leak in
pinconf_generic_parse_dt_config()
pinctrl: meson: amlogic-a4: Fix device node reference leak in
aml_dt_node_to_map_pinmux()
pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe()
regulator: mt6363: Fix incorrect and redundant IRQ disposal in probe
Fernando Fernandez Mancera (2):
net: bridge: fix nd_tbl NULL dereference when IPv6 is disabled
net: vxlan: fix nd_tbl NULL dereference when IPv6 is disabled
Florian Eckert (2):
pinctrl: equilibrium: rename irq_chip function callbacks
pinctrl: equilibrium: fix warning trace on load
Florian Westphal (1):
netfilter: nft_set_pipapo: split gc into unlink and reclaim phase
Francesco Lavra (1):
drm/solomon: Fix page start when updating rectangle in page addressing
mode
Fuad Tabba (3):
KVM: arm64: Hide S1POE from guests when not supported by the host
KVM: arm64: Fix ID register initialization for non-protected pKVM
guests
bpf, arm64: Force 8-byte alignment for JIT buffer to prevent atomic
tearing
Geoffrey D. Bennett (3):
ALSA: scarlett2: Fix DSP filter control array handling
ALSA: usb-audio: Remove VALIDATE_RATES quirk for Focusrite devices
ALSA: usb-audio: Add QUIRK_FLAG_SKIP_IFACE_SETUP
Gerd Rausch (1):
time/jiffies: Fix sysctl file error on configurations where USER_HZ <
HZ
Greg Kroah-Hartman (12):
nfc: pn533: properly drop the usb interface reference on disconnect
net: usb: kaweth: validate USB endpoints
net: usb: kalmia: validate USB endpoints
net: usb: pegasus: validate USB endpoints
can: ems_usb: ems_usb_read_bulk_callback(): check the proper length of
a message
can: usb: f81604: correctly anchor the urb in the read bulk callback
can: ucan: Fix infinite loop from zero-length messages
can: usb: etas_es58x: correctly anchor the urb in the read bulk
callback
can: usb: f81604: handle short interrupt urb messages properly
can: usb: f81604: handle bulk write errors properly
HID: Add HID_CLAIMED_INPUT guards in raw_event callbacks missing them
Revert "netfilter: nft_set_rbtree: validate open interval overlap"
Guenter Roeck (5):
hwmon: (macsmc) Fix regressions in Apple Silicon SMC hwmon driver
hwmon: (macsmc) Fix overflows, underflows, and sign extension
dpaa2-switch: Fix interrupt storm after receiving bad if_id in IRQ
handler
ata: libata-eh: Fix detection of deferred qc timeouts
tracing: Add NULL pointer check to trigger_data_free()
Hao Yu (1):
hwmon: (aht10) Fix initialization commands for AHT20
Haocheng Yu (1):
perf/core: Fix refcount bug and potential UAF in perf_mmap
Harishankar Vishwanathan (1):
bpf: Introduce tnum_step to step through tnum's members
Harry Yoo (1):
mm/slab: pass __GFP_NOWARN to refill_sheaf() if fallback is available
Heiko Carstens (2):
s390/idle: Fix cpu idle exit cpu time accounting
s390/vtime: Fix virtual timer forwarding
Heitor Alves de Siqueira (1):
Bluetooth: purge error queues in socket destructors
Henrique Carvalho (1):
smb: client: fix cifs_pick_channel when channels are equally loaded
Hou Wenlong (1):
x86/bug: Handle __WARN_printf() trap in early_fixup_exception()
Ian Forbes (1):
drm/vmwgfx: Return the correct value in vmw_translate_ptr functions
Ian Ray (2):
HID: multitouch: new class MT_CLS_EGALAX_P80H84
net: nfc: nci: Fix zero-length proprietary notifications
Ingo Molnar (3):
sched/fair: Rename cfs_rq::avg_load to cfs_rq::sum_weight
sched/fair: Rename cfs_rq::avg_vruntime to ::sum_w_vruntime, and
helper functions
sched/fair: Introduce and use the vruntime_cmp() and vruntime_op()
wrappers for wrapped-signed aritmetics
Ioana Ciornei (1):
irqchip/ls-extirq: Fix devm_of_iomap() error check
Jakub Kicinski (6):
tcp: give up on stronger sk_rcvbuf checks (for now)
ipv6: fix NULL pointer deref in ip6_rt_get_dev_rcu()
nfc: nci: free skb on nci_transceive early error paths
nfc: nci: complete pending data exchange on device close
nfc: nci: clear NCI_DATA_EXCHANGE before calling completion callback
nfc: rawsock: cancel tx_work before socket teardown
Jamal Hadi Salim (1):
net/sched: act_ife: Fix metalist update behavior
Jan Stancek (1):
x86/boot: Handle relative CONFIG_EFI_SBAT_FILE file paths
Jann Horn (1):
eventpoll: Fix integer overflow in ep_loop_check_proc()
Jason Gunthorpe (3):
IB/mthca: Add missed mthca_unmap_user_db() for mthca_create_srq()
RDMA/irdma: Fix kernel stack leak in irdma_create_user_ah()
RDMA/ionic: Fix kernel stack leak in ionic_create_cq()
Jens Axboe (2):
io_uring/cmd_net: use READ_ONCE() for ->addr3 read
media: dvb-core: fix wrong reinitialization of ringbuffer on reopen
Jiayuan Chen (5):
bpf: Fix race in cpumap on PREEMPT_RT
bpf: Fix race in devmap on PREEMPT_RT
atm: lec: fix null-ptr-deref in lec_arp_clear_vccs
bpf/bonding: reject vlan+srcmac xmit_hash_policy change when XDP is
loaded
net: ipv6: fix panic when IPv4 route references loopback IPv6 nexthop
Johannes Berg (1):
wifi: radiotap: reject radiotap with unknown bits
Jonathan Cavitt (1):
drm/client: Do not destroy NULL modes
Jonathan Teh (1):
platform/x86: thinkpad_acpi: Fix errors reading battery thresholds
Juhyung Park (2):
ALSA: hda/realtek: fix model name typo for Samsung Galaxy Book Flex
(NT950QCG-X716)
ALSA: hda/realtek: add quirk for Samsung Galaxy Book Flex
(NT950QCT-A38A)
Julian Orth (1):
drm/syncobj: Fix handle <-> fd ioctls with dirty stack
Jun Seo (1):
ALSA: usb-audio: Use correct version for UAC3 header validation
Junxiao Bi (1):
scsi: core: Fix refcount leak for tagset_refcnt
Juri Lelli (1):
sched/deadline: Fix missing ENQUEUE_REPLENISH during PI de-boosting
Justin Tee (1):
nvmet-fcloop: Check remoteport port_state before calling done callback
Keith Busch (1):
nvme-multipath: fix leak on try_module_get failure
Khushit Shah (1):
KVM: x86: Add x2APIC "features" to control EOI broadcast suppression
Kim Phillips (1):
x86/sev: Allow IBPB-on-Entry feature for SNP guests
Kohei Enju (2):
bpf: Fix stack-out-of-bounds write in devmap
iavf: fix netdev->max_mtu to respect actual hardware limit
Koichiro Den (1):
net: sched: avoid qdisc_reset_all_tx_gt() vs dequeue race for lockless
qdiscs
Kuen-Han Tsai (3):
usb: gadget: u_ether: add gether_opts for config caching
usb: gadget: u_ether: Add auto-cleanup helper for freeing net_device
usb: gadget: f_ncm: align net_device lifecycle with bind/unbind
Kuniyuki Iwashima (2):
nfsd: Fix cred ref leak in nfsd_nl_threads_set_doit().
udp: Unhash auto-bound connected sk from 4-tuple hash table when
disconnected.
Kurt Borja (2):
platform/x86: alienware-wmi-wmax: Add G-Mode support to m18 laptops
platform/x86: dell-wmi: Add audio/mic mute key codes
Lang Xu (1):
bpf: Fix a UAF issue in bpf_trampoline_link_cgroup_shim
Lars Ellenberg (1):
drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock()
Larysa Zaremba (9):
ice: fix adding AQ LLDP filter for VF
xdp: use modulo operation to calculate XDP frag tailroom
xsk: introduce helper to determine rxq->frag_size
ice: fix rxq info registering in mbuf packets
ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz
i40e: fix registering XDP RxQ info
i40e: use xdp.frame_sz as XDP RxQ info frag_size
net: enetc: use truesize as XDP RxQ info frag_size
xdp: produce a warning when calculated tailroom is negative
Li Li (1):
idpf: increment completion queue next_to_clean in sw marker wait
routine
Lijo Lazar (1):
drm/amdgpu: Fix error handling in slot reset
Lizhi Hou (11):
accel/amdxdna: Remove buffer size check when creating command BO
accel/amdxdna: Switch to always use chained command
accel/amdxdna: Fix crash when destroying a suspended hardware context
accel/amdxdna: Fix dead lock for suspend and resume
accel/amdxdna: Fix suspend failure after enabling turbo mode
accel/amdxdna: Fix command hang on suspended hardware context
accel/amdxdna: Fix out-of-bounds memset in command slot handling
accel/amdxdna: Prevent ubuf size overflow
accel/amdxdna: Validate command buffer payload count
accel/amdxdna: Fill invalid payload for failed command
accel/amdxdna: Fix NULL pointer dereference of mgmt_chann
Lorenzo Bianconi (4):
wifi: mt76: mt7996: Fix possible oob access in
mt7996_mac_write_txwi_80211()
wifi: mt76: mt7925: Fix possible oob access in
mt7925_mac_write_txwi_80211()
wifi: mt76: Fix possible oob access in
mt76_connac2_mac_write_txwi_80211()
net: ethernet: mtk_eth_soc: Reset prog ptr to old_prog in case of
error in mtk_xdp_setup()
MD Danish Anwar (1):
net: ti: icssg-prueth: Fix ping failure after offload mode setup when
link speed is not 1G
Mario Limonciello (2):
accel/amdxdna: Reduce log noise during process termination
platform/x86: hp-bioscfg: Support allocations of larger data
Mariusz Skamra (1):
Bluetooth: Fix CIS host feature condition
Mark Harmstone (6):
btrfs: fix error message order of parameters in
btrfs_delete_delayed_dir_index()
btrfs: fix incorrect key offset in error message in
check_dev_extent_item()
btrfs: fix objectid value in error message in check_extent_data_ref()
btrfs: fix warning in scrub_verify_one_metadata()
btrfs: print correct subvol num if active swapfile prevents deletion
btrfs: fix compat mask in error messages in btrfs_check_features()
Mathias Krause (1):
scsi: lpfc: Properly set WC for DPP mapping
Mathieu Desnoyers (1):
rseq: Clarify rseq registration rseq_size bound check comment
Matt Roper (1):
drm/xe/wa: Steer RMW of MCR registers while building default LRC
Matthew Brost (1):
drm/xe: Do not preempt fence signaling CS instructions
Matthieu Baerts (NGI0) (4):
mptcp: pm: avoid sending RM_ADDR over same subflow
mptcp: pm: in-kernel: always mark signal+subflow endp as used
selftests: mptcp: join: check RM_ADDR not sent over same subflow
selftests: mptcp: join: check removing signal+subflow endp
Maulik Shah (1):
pinctrl: qcom: qcs615: Add missing dual edge GPIO IRQ errata flag
Michal Schmidt (1):
ice: fix crash in ethtool offline loopback test
Michal Swiatkowski (1):
libie: don't unroll if fwlog isn't supported
Mieczyslaw Nalewaj (1):
net: dsa: realtek: rtl8365mb: fix rtl8365mb_phy_ocp_write return value
Mike Rapoport (Microsoft) (1):
x86/efi: defer freeing of boot services memory
Ming Lei (2):
nvme: fix admin queue leak on controller reset
block: use trylock to avoid lockdep circular dependency in sysfs
Miquel Sabaté Solà (1):
btrfs: free pages on error in btrfs_uring_read_extent()
Miroslav Lichvar (1):
timekeeping: Fix timex status validation for auxiliary clocks
Nam Cao (1):
irqchip/sifive-plic: Fix frozen interrupt due to affinity setting
Namhyung Kim (1):
perf/core: Fix invalid wait context in ctx_sched_in()
Natalie Vock (1):
drm/amd/display: Use GFP_ATOMIC in dc_create_stream_for_sink
Nathan Chancellor (2):
kbuild: Split .modinfo out from ELF_DETAILS
kbuild: Leave objtool binary around with 'make clean'
Nikhil P. Rao (2):
xsk: Fix fragment node deletion to prevent buffer leak
xsk: Fix zero-copy AF_XDP fragment drop
Niklas Cassel (3):
PCI: dwc: ep: Refresh MSI Message Address cache on change
PCI: dwc: ep: Flush MSI-X write before unmapping its ATU entry
ata: libata: cancel pending work after clearing deferred_qc
Oliver Hartkopp (2):
can: bcm: fix locking for bcm_op runtime updates
can: dummy_can: dummy_can_init(): fix packet statistics
Olivier Sobrie (1):
hwmon: (max6639) fix inverted polarity
Ovidiu Panait (4):
net: stmmac: Fix error handling in VLAN add and delete paths
net: stmmac: Improve double VLAN handling
net: stmmac: Fix VLAN HW state restore
net: stmmac: Defer VLAN HW configuration when interface is down
Pablo Neira Ayuso (2):
netfilter: nf_tables: unconditionally bump set->nelems before
insertion
netfilter: nf_tables: clone set on flush only
Panagiotis Foliadis (2):
ALSA: hda/intel: increase default bdl_pos_adj for Nvidia controllers
ALSA: hda/realtek: Add quirk for Acer Aspire V3-572G
Paolo Abeni (1):
selftests: mptcp: more stable simult_flows tests
Paul Chaignon (1):
bpf: Improve bounds when tnum has a single possible value
Paulo Alcantara (2):
smb: client: fix broken multichannel with krb5+signing
smb: client: fix oops due to uninitialised var in smb2_unlink()
Peter Wang (1):
scsi: ufs: core: Move link recovery for hibern8 exit failure to
wl_resume
Peter Zijlstra (9):
x86/cfi: Fix CFI rewrite for odd alignments
sched/fair: Fix zero_vruntime tracking
sched/fair: Only set slice protection at pick time
sched/fair: Fix lag clamp
perf: Fix __perf_event_overflow() vs perf_remove_from_context() race
x86/numa: Store extra copy of numa_nodes_parsed
x86/topo: Add topology_num_nodes_per_package()
x86/topo: Replace x86_has_numa_in_package
x86/topo: Fix SNC topology mess
Petr Pavlu (1):
module: Remove duplicate freeing of lockdep classes
Phillip Lougher (1):
Squashfs: check metadata block offset is within range
Prithvi Tambewagh (1):
scsi: target: Fix recursive locking in __configfs_open_file()
Qing Wang (1):
tracing: Fix WARN_ON in tracing_buffers_mmap_close
Quentin Schulz (2):
accel/rocket: fix unwinding in error path in rocket_core_init
accel/rocket: fix unwinding in error path in rocket_probe
Raju Rangoju (2):
amd-xgbe: fix MAC_TCR_SS register width for 2.5G and 10M speeds
amd-xgbe: fix sleep while atomic on suspend/resume
Richard Fitzgerald (1):
ALSA: hda: cs35l56: Fix signedness error in cs35l56_hda_posture_put()
Rob Herring (Arm) (2):
accel: ethosu: Fix job submit error clean-up refcount underflows
accel: ethosu: Fix NPU_OP_ELEMENTWISE validation with scalar
Rong Zhang (1):
ALSA: doc: usb-audio: Add doc for QUIRK_FLAG_SKIP_IFACE_SETUP
Russell King (Oracle) (1):
net: stmmac: remove support for lpi_intr_o
Salomon Dushimirimana (1):
scsi: pm8001: Fix use-after-free in pm8001_queue_command()
Sasha Levin (1):
Linux 6.19.7-rc1
Sebastian Andrzej Siewior (1):
net: Provide a PREEMPT_RT specific check for netdev_queue::_xmit_lock
Sebastian Krzyszkowiak (1):
wifi: rsi: Don't default to -EOPNOTSUPP in rsi_mac80211_config
Shuicheng Lin (2):
drm/xe/configfs: Free ctx_restore_mid_bb in release
drm/xe/reg_sr: Fix leak on xa_store failure
Shuvam Pandey (1):
kunit: tool: copy caller args in run_kernel to prevent mutation
Simon Ser (1):
drm/fourcc: fix plane order for 10/12/16-bit YCbCr formats
Sreedevi Joshi (1):
idpf: Fix flow rule delete failure due to invalid validation
Srinivas Pandruvada (1):
cpufreq: intel_pstate: Fix crash during turbo disable
Sun Jian (1):
selftests/harness: order TEST_F and XFAIL_ADD constructors
Sungwoo Kim (1):
nvme: fix memory allocation in nvme_pr_read_keys()
T.J. Mercier (1):
selftests/bpf: Fix OOB read in dmabuf_collector
Takashi Iwai (4):
ALSA: usb-audio: Cap the packet size pre-calculations
ALSA: usb-audio: Use inclusive terms
ALSA: usb: qcom: Correct parameter comment for
uaudio_transfer_buffer_setup()
ASoC: SDCA: Fix comments for sdca_irq_request()
Thomas Gleixner (2):
debugobject: Make it work with deferred page initialization - again
i40e: Fix preempt count leak in napi poll tracepoint
Thomas Weißschuh (1):
ARM: clean up the memset64() C wrapper
Thorsten Blum (2):
platform/x86: dell-wmi-sysman: Don't hex dump plaintext password data
smb: client: Don't log plaintext credentials in cifs_set_cifscreds
Tianci Cao (1):
bpf: Add bitwise tracking for BPF_END
Tom Lendacky (1):
x86/boot/sev: Move SEV decompressor variables into the .data section
Tomasz Lis (1):
drm/xe/queue: Call fini on exec queue creation fail
Tomasz Pakuła (1):
HID: pidff: Fix condition effect bit clearing
Tvrtko Ursulin (1):
drm/amdgpu/userq: Do not allow userspace to trivially triger kernel
warnings
Vahagn Vardanian (1):
wifi: mac80211: fix NULL pointer dereference in mesh_rx_csa_frame()
Vasily Gorbik (1):
s390/kexec: Disable stack protector in s390_reset_system()
Vimlesh Kumar (4):
octeon_ep: Relocate counter updates before NAPI
octeon_ep: avoid compiler and IQ/OQ reordering
octeon_ep_vf: Relocate counter updates before NAPI
octeon_ep_vf: avoid compiler and IQ/OQ reordering
Vitaly Lifshits (1):
e1000e: clear DPG_EN after reset to avoid autonomous power-gating
Vivek Behera (2):
igb: Fix trigger of incorrect irq in igb_xsk_wakeup
igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
Waiman Long (2):
cgroup/cpuset: Fix incorrect change to effective_xcpus in
partition_xcpus_del()
cgroup/cpuset: Fix incorrect use of cpuset_update_tasks_cpumask() in
update_cpumasks_hier()
Wang Tao (1):
sched/eevdf: Update se->vprot in reweight_entity()
Werner Sembach (1):
HID: multitouch: Keep latency normal on deactivate for reactivation
gesture
Will Deacon (2):
arm64: io: Rename ioremap_prot() to __ioremap_prot()
arm64: io: Extract user memory type in ioremap_prot()
Yifan Wu (1):
selftest/arm64: Fix sve2p1_sigill() to hwcap test
Yujie Liu (1):
drm/sched: Fix kernel-doc warning for drm_sched_job_done()
Yung Chih Su (1):
net: ipv4: fix ARM64 alignment fault in multipath hash seed
Zhang Heng (2):
ALSA: hda/realtek: Add quirk for HP Pavilion 15-eh1xxx to enable mute
LED
ALSA: hda/realtek: add quirk for Acer Nitro ANV15-51
ZhangGuoDong (2):
smb/client: fix buffer size for smb311_posix_qinfo in
smb2_compound_op()
smb/client: fix buffer size for smb311_posix_qinfo in
SMB311_posix_query_info()
Zhanjun Dong (1):
drm/xe/gsc: Fix GSC proxy cleanup on early initialization failure
Zide Chen (1):
perf/x86/intel/uncore: Add per-scheduler IMC CAS count events
Zilin Guan (1):
ice: Fix memory leak in ice_set_ringparam()
Documentation/sound/alsa-configuration.rst | 4 +
Documentation/virt/kvm/api.rst | 28 ++-
Makefile | 12 +-
arch/alpha/kernel/vmlinux.lds.S | 1 +
arch/arc/kernel/vmlinux.lds.S | 1 +
arch/arm/boot/compressed/vmlinux.lds.S | 1 +
arch/arm/include/asm/string.h | 14 +-
arch/arm/kernel/vmlinux-xip.lds.S | 1 +
arch/arm/kernel/vmlinux.lds.S | 1 +
arch/arm64/include/asm/io.h | 26 +-
arch/arm64/include/asm/pgtable-prot.h | 3 -
arch/arm64/kernel/acpi.c | 2 +-
arch/arm64/kernel/vmlinux.lds.S | 1 +
arch/arm64/kvm/hyp/nvhe/pkvm.c | 35 ++-
arch/arm64/kvm/sys_regs.c | 3 +
arch/arm64/mm/ioremap.c | 6 +-
arch/arm64/mm/mmap.c | 8 +-
arch/arm64/net/bpf_jit_comp.c | 2 +-
arch/csky/kernel/vmlinux.lds.S | 1 +
arch/hexagon/kernel/vmlinux.lds.S | 1 +
arch/loongarch/kernel/vmlinux.lds.S | 1 +
arch/m68k/kernel/vmlinux-nommu.lds | 1 +
arch/m68k/kernel/vmlinux-std.lds | 1 +
arch/m68k/kernel/vmlinux-sun3.lds | 1 +
arch/mips/kernel/vmlinux.lds.S | 1 +
arch/nios2/kernel/vmlinux.lds.S | 1 +
arch/openrisc/kernel/vmlinux.lds.S | 1 +
arch/parisc/boot/compressed/vmlinux.lds.S | 1 +
arch/parisc/kernel/vmlinux.lds.S | 1 +
arch/powerpc/kernel/vmlinux.lds.S | 1 +
arch/riscv/kernel/vmlinux.lds.S | 1 +
arch/s390/include/asm/idle.h | 1 +
arch/s390/kernel/idle.c | 13 +-
arch/s390/kernel/ipl.c | 2 +-
arch/s390/kernel/irq.c | 10 +-
arch/s390/kernel/vmlinux.lds.S | 1 +
arch/s390/kernel/vtime.c | 18 +-
arch/sh/kernel/vmlinux.lds.S | 1 +
arch/sparc/kernel/vmlinux.lds.S | 1 +
arch/um/kernel/dyn.lds.S | 1 +
arch/um/kernel/uml.lds.S | 1 +
arch/x86/boot/compressed/Makefile | 1 +
arch/x86/boot/compressed/sev.c | 9 +-
arch/x86/boot/compressed/vmlinux.lds.S | 2 +-
arch/x86/boot/startup/sev-shared.c | 2 +-
arch/x86/coco/sev/core.c | 1 +
arch/x86/entry/entry_fred.c | 5 +-
arch/x86/events/intel/uncore_snbep.c | 28 ++-
arch/x86/include/asm/cfi.h | 12 +-
arch/x86/include/asm/efi.h | 2 +-
arch/x86/include/asm/kvm_host.h | 7 +
arch/x86/include/asm/linkage.h | 4 +-
arch/x86/include/asm/msr-index.h | 5 +-
arch/x86/include/asm/numa.h | 6 +
arch/x86/include/asm/topology.h | 6 +
arch/x86/include/asm/traps.h | 2 +
arch/x86/include/uapi/asm/kvm.h | 6 +-
arch/x86/kernel/alternative.c | 29 ++-
arch/x86/kernel/cpu/common.c | 3 +
arch/x86/kernel/cpu/topology.c | 13 +-
arch/x86/kernel/smpboot.c | 201 ++++++++++-----
arch/x86/kernel/traps.c | 2 +-
arch/x86/kernel/vmlinux.lds.S | 1 +
arch/x86/kvm/ioapic.c | 2 +-
arch/x86/kvm/lapic.c | 76 +++++-
arch/x86/kvm/lapic.h | 2 +
arch/x86/kvm/x86.c | 21 +-
arch/x86/mm/extable.c | 7 +-
arch/x86/mm/numa.c | 8 +
arch/x86/mm/srat.c | 2 +
arch/x86/net/bpf_jit_comp.c | 13 +-
arch/x86/platform/efi/efi.c | 2 +-
arch/x86/platform/efi/quirks.c | 55 +++-
block/blk-sysfs.c | 8 +-
block/elevator.c | 12 +-
drivers/accel/amdxdna/aie2_ctx.c | 55 ++--
drivers/accel/amdxdna/aie2_message.c | 36 ++-
drivers/accel/amdxdna/aie2_pci.c | 23 +-
drivers/accel/amdxdna/aie2_pci.h | 1 +
drivers/accel/amdxdna/aie2_pm.c | 2 +-
drivers/accel/amdxdna/amdxdna_ctx.c | 51 +++-
drivers/accel/amdxdna/amdxdna_ctx.h | 3 +
drivers/accel/amdxdna/amdxdna_gem.c | 38 +--
drivers/accel/amdxdna/amdxdna_pm.c | 2 +
drivers/accel/amdxdna/amdxdna_pm.h | 11 +
drivers/accel/amdxdna/amdxdna_ubuf.c | 6 +-
drivers/accel/ethosu/ethosu_gem.c | 7 +-
drivers/accel/ethosu/ethosu_job.c | 26 +-
drivers/accel/rocket/rocket_core.c | 7 +-
drivers/accel/rocket/rocket_drv.c | 15 +-
drivers/ata/libata-eh.c | 3 +-
drivers/ata/libata-scsi.c | 1 +
drivers/block/drbd/drbd_actlog.c | 53 ++--
drivers/block/drbd/drbd_interval.h | 5 +-
drivers/block/drbd/drbd_req.c | 3 +-
drivers/block/zloop.c | 31 ++-
drivers/char/ipmi/ipmi_msghandler.c | 11 +-
drivers/clk/imx/clk-imx8qxp.c | 24 +-
drivers/clk/imx/clk-scu.c | 12 +-
drivers/clk/imx/clk-scu.h | 2 +
drivers/cpufreq/intel_pstate.c | 10 +-
drivers/crypto/ccp/sev-dev-tsm.c | 2 +-
drivers/cxl/core/mbox.c | 11 +-
drivers/cxl/core/pmem.c | 42 +++-
drivers/cxl/cxl.h | 7 +
drivers/cxl/pmem.c | 22 +-
drivers/firmware/efi/mokvar-table.c | 2 +-
drivers/gpio/gpiolib-shared.c | 6 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 +-
drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c | 12 +-
.../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 8 +-
.../amd/display/amdgpu_dm/amdgpu_dm_color.c | 6 +-
.../amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 3 +-
.../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 16 +-
.../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 8 +
.../gpu/drm/amd/display/dc/core/dc_stream.c | 2 +-
drivers/gpu/drm/bridge/synopsys/dw-dp.c | 4 +-
drivers/gpu/drm/drm_client_modeset.c | 3 +-
drivers/gpu/drm/drm_syncobj.c | 4 +-
drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +-
drivers/gpu/drm/logicvc/logicvc_drm.c | 4 +-
drivers/gpu/drm/scheduler/sched_main.c | 1 +
drivers/gpu/drm/solomon/ssd130x.c | 6 +-
drivers/gpu/drm/tiny/sharp-memory.c | 4 +-
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 +-
drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c | 9 +-
drivers/gpu/drm/xe/regs/xe_engine_regs.h | 6 +
drivers/gpu/drm/xe/xe_configfs.c | 1 +
drivers/gpu/drm/xe/xe_exec_queue.c | 23 +-
drivers/gpu/drm/xe/xe_gsc_proxy.c | 43 +++-
drivers/gpu/drm/xe/xe_gsc_types.h | 2 +
drivers/gpu/drm/xe/xe_gt.c | 66 ++++-
drivers/gpu/drm/xe/xe_lrc.h | 3 +-
drivers/gpu/drm/xe/xe_reg_sr.c | 4 +-
drivers/gpu/drm/xe/xe_ring_ops.c | 9 +
drivers/hid/hid-cmedia.c | 2 +-
drivers/hid/hid-creative-sb0540.c | 2 +-
drivers/hid/hid-multitouch.c | 43 +++-
drivers/hid/hid-zydacron.c | 2 +-
drivers/hid/usbhid/hid-pidff.c | 11 +-
drivers/hwmon/aht10.c | 6 +-
drivers/hwmon/it87.c | 5 +-
drivers/hwmon/macsmc-hwmon.c | 53 ++--
drivers/hwmon/max6639.c | 2 +-
drivers/i2c/busses/i2c-i801.c | 14 +-
.../infiniband/hw/ionic/ionic_controlpath.c | 2 +-
drivers/infiniband/hw/irdma/verbs.c | 2 +-
drivers/infiniband/hw/mthca/mthca_provider.c | 5 +-
drivers/irqchip/irq-ls-extirq.c | 6 +-
drivers/irqchip/irq-sifive-plic.c | 7 +-
drivers/media/dvb-core/dmxdev.c | 4 +-
drivers/net/bonding/bond_main.c | 9 +-
drivers/net/bonding/bond_options.c | 2 +
drivers/net/can/dummy_can.c | 1 +
drivers/net/can/spi/mcp251x.c | 15 +-
drivers/net/can/usb/ems_usb.c | 7 +-
drivers/net/can/usb/etas_es58x/es58x_core.c | 8 +-
drivers/net/can/usb/f81604.c | 45 +++-
drivers/net/can/usb/ucan.c | 2 +-
drivers/net/dsa/realtek/rtl8365mb.c | 2 +-
drivers/net/ethernet/amd/xgbe/xgbe-common.h | 2 +-
drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 10 -
drivers/net/ethernet/amd/xgbe/xgbe-main.c | 1 -
drivers/net/ethernet/amd/xgbe/xgbe.h | 3 -
.../ethernet/freescale/dpaa2/dpaa2-switch.c | 3 +-
drivers/net/ethernet/freescale/enetc/enetc.c | 2 +-
drivers/net/ethernet/google/gve/gve_tx_dqo.c | 56 ++---
drivers/net/ethernet/intel/e1000e/defines.h | 1 +
drivers/net/ethernet/intel/e1000e/ich8lan.c | 9 +
drivers/net/ethernet/intel/i40e/i40e_main.c | 41 +--
drivers/net/ethernet/intel/i40e/i40e_trace.h | 2 +-
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 5 +-
drivers/net/ethernet/intel/iavf/iavf_main.c | 17 +-
drivers/net/ethernet/intel/ice/ice.h | 1 +
drivers/net/ethernet/intel/ice/ice_base.c | 38 ++-
drivers/net/ethernet/intel/ice/ice_common.c | 2 +-
drivers/net/ethernet/intel/ice/ice_ethtool.c | 16 +-
drivers/net/ethernet/intel/ice/ice_idc.c | 44 +++-
drivers/net/ethernet/intel/ice/ice_lib.c | 15 +-
drivers/net/ethernet/intel/ice/ice_main.c | 7 +-
drivers/net/ethernet/intel/ice/ice_txrx.c | 4 +-
drivers/net/ethernet/intel/ice/ice_xsk.c | 3 +
.../net/ethernet/intel/idpf/idpf_ethtool.c | 3 -
drivers/net/ethernet/intel/idpf/idpf_txrx.c | 8 +-
drivers/net/ethernet/intel/igb/igb_xsk.c | 38 ++-
drivers/net/ethernet/intel/igc/igc_main.c | 34 ++-
drivers/net/ethernet/intel/igc/igc_ptp.c | 3 +-
drivers/net/ethernet/intel/libie/fwlog.c | 4 +
.../ethernet/marvell/octeon_ep/octep_main.c | 40 ++-
.../net/ethernet/marvell/octeon_ep/octep_rx.c | 27 +-
.../marvell/octeon_ep_vf/octep_vf_main.c | 38 ++-
.../marvell/octeon_ep_vf/octep_vf_rx.c | 28 ++-
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 15 +-
drivers/net/ethernet/stmicro/stmmac/common.h | 1 -
.../net/ethernet/stmicro/stmmac/dwmac-intel.c | 4 -
.../ethernet/stmicro/stmmac/dwmac-loongson.c | 7 -
drivers/net/ethernet/stmicro/stmmac/stmmac.h | 3 +-
.../net/ethernet/stmicro/stmmac/stmmac_main.c | 89 +++----
.../ethernet/stmicro/stmmac/stmmac_platform.c | 8 -
.../net/ethernet/stmicro/stmmac/stmmac_vlan.c | 60 ++---
drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
drivers/net/ethernet/ti/cpsw_ale.c | 9 +-
drivers/net/ethernet/ti/icssg/icssg_prueth.c | 8 +
drivers/net/phy/phy_device.c | 25 +-
drivers/net/usb/kalmia.c | 7 +
drivers/net/usb/kaweth.c | 13 +
drivers/net/usb/pegasus.c | 13 +-
drivers/net/vxlan/vxlan_core.c | 5 +
drivers/net/wireless/marvell/libertas/main.c | 4 +-
.../wireless/mediatek/mt76/mt76_connac_mac.c | 1 +
.../net/wireless/mediatek/mt76/mt7925/mac.c | 1 +
.../net/wireless/mediatek/mt76/mt7996/mac.c | 1 +
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 2 +-
drivers/net/wireless/st/cw1200/pm.c | 2 +
drivers/net/wireless/ti/wlcore/main.c | 4 +-
drivers/nfc/pn533/usb.c | 1 +
drivers/nvme/host/core.c | 7 +
drivers/nvme/host/multipath.c | 12 +-
drivers/nvme/host/pr.c | 4 +-
drivers/nvme/target/fcloop.c | 15 +-
.../pci/controller/dwc/pcie-designware-ep.c | 25 +-
drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 5 +-
drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 70 +++++-
drivers/pinctrl/pinconf-generic.c | 73 +-----
drivers/pinctrl/pinctrl-equilibrium.c | 31 ++-
drivers/pinctrl/qcom/pinctrl-qcs615.c | 1 +
.../platform/x86/dell/alienware-wmi-wmax.c | 2 +-
drivers/platform/x86/dell/dell-wmi-base.c | 6 +
.../dell-wmi-sysman/passwordattr-interface.c | 1 -
.../x86/hp/hp-bioscfg/enum-attributes.c | 9 +-
drivers/platform/x86/lenovo/thinkpad_acpi.c | 6 +-
drivers/regulator/bq257xx-regulator.c | 3 +-
drivers/regulator/fp9931.c | 7 +-
drivers/regulator/mt6363-regulator.c | 4 +-
drivers/scsi/lpfc/lpfc_init.c | 2 +
drivers/scsi/lpfc/lpfc_sli.c | 36 ++-
drivers/scsi/lpfc/lpfc_sli4.h | 3 +
drivers/scsi/pm8001/pm8001_sas.c | 5 +-
drivers/scsi/scsi_scan.c | 1 +
drivers/spi/spi-stm32.c | 3 +
drivers/target/target_core_configfs.c | 15 +-
drivers/ufs/core/ufshcd.c | 38 ++-
drivers/usb/gadget/function/f_ncm.c | 128 +++++-----
drivers/usb/gadget/function/u_ether.c | 45 ++++
drivers/usb/gadget/function/u_ether.h | 30 +++
.../usb/gadget/function/u_ether_configfs.h | 176 +++++++++++++
drivers/usb/gadget/function/u_ncm.h | 4 +-
drivers/xen/xen-acpi-processor.c | 7 +-
fs/btrfs/delayed-inode.c | 2 +-
fs/btrfs/disk-io.c | 6 +-
fs/btrfs/inode.c | 2 +-
fs/btrfs/ioctl.c | 7 +-
fs/btrfs/scrub.c | 2 +-
fs/btrfs/tree-checker.c | 4 +-
fs/eventpoll.c | 5 +-
fs/namespace.c | 20 +-
fs/netfs/direct_write.c | 228 +++++++++++++++--
fs/netfs/internal.h | 4 +-
fs/netfs/write_collect.c | 21 --
fs/netfs/write_issue.c | 41 +--
fs/nfsd/nfsctl.c | 2 +-
fs/smb/client/connect.c | 1 -
fs/smb/client/smb2inode.c | 8 +-
fs/smb/client/smb2pdu.c | 24 +-
fs/smb/client/transport.c | 21 +-
fs/smb/server/Kconfig | 1 +
fs/smb/server/auth.c | 4 +-
fs/smb/server/smb2pdu.c | 5 +-
fs/squashfs/cache.c | 3 +
fs/xfs/scrub/orphanage.c | 7 +-
fs/xfs/xfs_notify_failure.c | 4 +-
include/asm-generic/vmlinux.lds.h | 4 +-
include/linux/indirect_call_wrapper.h | 18 +-
include/linux/netdevice.h | 27 +-
include/linux/pinctrl/pinconf-generic.h | 5 -
include/linux/ring_buffer.h | 1 +
include/linux/sched.h | 1 +
include/linux/stmmac.h | 1 -
include/linux/tnum.h | 8 +
include/linux/uaccess.h | 54 ++--
include/net/bonding.h | 1 +
include/net/inet6_hashtables.h | 2 +-
include/net/inet_hashtables.h | 2 +-
include/net/ip.h | 2 +-
include/net/ip_fib.h | 2 +-
include/net/netfilter/nf_tables.h | 11 +-
include/net/sch_generic.h | 10 +
include/net/secure_seq.h | 45 +++-
include/net/tc_act/tc_ife.h | 4 +-
include/net/tcp.h | 6 +-
include/net/xdp_sock_drv.h | 16 +-
include/trace/events/netfs.h | 4 +-
include/uapi/drm/drm_fourcc.h | 12 +-
include/uapi/linux/pci_regs.h | 2 +-
io_uring/cmd_net.c | 2 +-
kernel/bpf/cpumap.c | 17 +-
kernel/bpf/devmap.c | 47 +++-
kernel/bpf/tnum.c | 72 ++++++
kernel/bpf/trampoline.c | 4 +-
kernel/bpf/verifier.c | 103 +++++++-
kernel/cgroup/cpuset.c | 4 +-
kernel/events/core.c | 83 ++++--
kernel/module/main.c | 6 -
kernel/rseq.c | 5 +-
kernel/sched/ext_internal.h | 2 +-
kernel/sched/fair.c | 238 +++++++++++++-----
kernel/sched/sched.h | 4 +-
kernel/sched/syscalls.c | 30 +++
kernel/time/jiffies.c | 2 -
kernel/time/timekeeping.c | 6 +-
kernel/trace/blktrace.c | 3 +-
kernel/trace/ring_buffer.c | 21 ++
kernel/trace/trace.c | 13 +
kernel/trace/trace_events_trigger.c | 3 +
lib/Kconfig.debug | 1 +
lib/debugobjects.c | 19 +-
mm/huge_memory.c | 3 +
mm/slub.c | 13 +-
net/atm/lec.c | 26 +-
net/bluetooth/hci_sock.c | 1 +
net/bluetooth/hci_sync.c | 2 +-
net/bluetooth/iso.c | 1 +
net/bluetooth/l2cap_sock.c | 1 +
net/bluetooth/sco.c | 1 +
net/bridge/br_device.c | 2 +-
net/bridge/br_input.c | 2 +-
net/bridge/br_private.h | 10 +
net/bridge/br_vlan_options.c | 26 +-
net/can/bcm.c | 1 +
net/core/dev.c | 7 +-
net/core/devmem.c | 6 +-
net/core/filter.c | 6 +-
net/core/netpoll.c | 2 +-
net/core/secure_seq.c | 80 +++---
net/core/skmsg.c | 14 +-
net/ipv4/inet_hashtables.c | 8 +-
net/ipv4/syncookies.c | 11 +-
net/ipv4/sysctl_net_ipv4.c | 5 +-
net/ipv4/tcp.c | 4 +-
net/ipv4/tcp_bpf.c | 2 +-
net/ipv4/tcp_diag.c | 2 +-
net/ipv4/tcp_input.c | 38 ++-
net/ipv4/tcp_ipv4.c | 37 ++-
net/ipv4/tcp_minisocks.c | 2 +-
net/ipv4/udp.c | 27 +-
net/ipv4/udp_bpf.c | 2 +-
net/ipv6/inet6_hashtables.c | 3 +-
net/ipv6/route.c | 11 +-
net/ipv6/syncookies.c | 11 +-
net/ipv6/tcp_ipv6.c | 37 ++-
net/mac80211/mesh.c | 3 +
net/mac80211/mlme.c | 3 +
net/mptcp/pm.c | 55 +++-
net/mptcp/pm_kernel.c | 9 +
net/netfilter/nf_tables_api.c | 66 +++--
net/netfilter/nft_set_hash.c | 1 +
net/netfilter/nft_set_pipapo.c | 62 ++++-
net/netfilter/nft_set_pipapo.h | 2 +
net/netfilter/nft_set_rbtree.c | 79 ++----
net/nfc/nci/core.c | 30 ++-
net/nfc/nci/data.c | 12 +-
net/nfc/rawsock.c | 11 +
net/rds/tcp.c | 14 +-
net/sched/act_ife.c | 93 ++++---
net/sched/sch_ets.c | 12 +-
net/sched/sch_fq.c | 1 +
net/unix/af_unix.c | 8 +-
net/wireless/core.c | 1 +
net/wireless/radiotap.c | 4 +-
net/xdp/xsk.c | 26 +-
rust/kernel/kunit.rs | 8 +
sound/hda/codecs/realtek/alc269.c | 13 +-
sound/hda/codecs/side-codecs/cs35l56_hda.c | 2 +-
sound/hda/controllers/intel.c | 2 +
sound/soc/sdca/Kconfig | 2 +
sound/soc/sdca/sdca_functions.c | 5 +-
sound/soc/sdca/sdca_interrupts.c | 4 +-
sound/usb/endpoint.c | 9 +-
sound/usb/mixer_scarlett2.c | 10 +-
sound/usb/qcom/qc_audio_offload.c | 2 +-
sound/usb/quirks.c | 3 +-
sound/usb/stream.c | 3 +
sound/usb/usbaudio.h | 6 +
sound/usb/validate.c | 2 +-
tools/objtool/Makefile | 8 +-
tools/testing/kunit/kunit_kernel.py | 6 +-
tools/testing/kunit/kunit_tool_test.py | 26 ++
tools/testing/selftests/arm64/abi/hwcap.c | 4 +-
.../testing/selftests/bpf/progs/dmabuf_iter.c | 2 +-
.../selftests/bpf/progs/exceptions_assert.c | 34 +--
.../selftests/bpf/progs/verifier_scalar_ids.c | 56 +++--
.../testing/selftests/bpf/verifier/precise.c | 8 +-
tools/testing/selftests/kselftest_harness.h | 7 +-
.../testing/selftests/net/mptcp/mptcp_join.sh | 49 ++++
.../selftests/net/mptcp/simult_flows.sh | 11 +-
396 files changed, 4121 insertions(+), 1792 deletions(-)
--
2.51.0
^ permalink raw reply [flat|nested] 330+ messages in thread
* [PATCH 6.19 307/311] ata: libata-eh: Fix detection of deferred qc timeouts
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (305 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 306/311] accel: ethosu: Fix NPU_OP_ELEMENTWISE validation with scalar Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 308/311] selftest/arm64: Fix sve2p1_sigill() to hwcap test Sasha Levin
` (17 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Guenter Roeck, Damien Le Moal, Niklas Cassel, Sasha Levin
From: Guenter Roeck <linux@roeck-us.net>
[ Upstream commit ee0e6e69a772d601e152e5368a1da25d656122a8 ]
If the ata_qc_for_each_raw() loop finishes without finding a matching SCSI
command for any QC, the variable qc will hold a pointer to the last element
examined, which has the tag i == ATA_MAX_QUEUE - 1. This qc can match the
port deferred QC (ap->deferred_qc).
If that happens, the condition qc == ap->deferred_qc evaluates to true
despite the loop not breaking with a match on the SCSI command for this QC.
In that case, the error handler mistakenly intercepts a command that has
not been issued yet and that has not timed out, and thus erroneously
returning a timeout error.
Fix the problem by checking for i < ATA_MAX_QUEUE in addition to
qc == ap->deferred_qc.
The problem was found by an experimental code review agent based on
gemini-3.1-pro while reviewing backports into v6.18.y.
Assisted-by: Gemini:gemini-3.1-pro
Fixes: eddb98ad9364 ("ata: libata-eh: correctly handle deferred qc timeouts")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
[cassel: modified commit log as suggested by Damien]
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ata/libata-eh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 563432400f727..23be85418b3b1 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -647,7 +647,7 @@ void ata_scsi_cmd_error_handler(struct Scsi_Host *host, struct ata_port *ap,
break;
}
- if (qc == ap->deferred_qc) {
+ if (i < ATA_MAX_QUEUE && qc == ap->deferred_qc) {
/*
* This is a deferred command that timed out while
* waiting for the command queue to drain. Since the qc
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 308/311] selftest/arm64: Fix sve2p1_sigill() to hwcap test
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (306 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 307/311] ata: libata-eh: Fix detection of deferred qc timeouts Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 309/311] tracing: Add NULL pointer check to trigger_data_free() Sasha Levin
` (16 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Yifan Wu, Mark Brown, Will Deacon, Sasha Levin
From: Yifan Wu <wuyifan50@huawei.com>
[ Upstream commit d87c828daa7ead9763416f75cc416496969cf1dc ]
The FEAT_SVE2p1 is indicated by ID_AA64ZFR0_EL1.SVEver. However,
the BFADD requires the FEAT_SVE_B16B16, which is indicated by
ID_AA64ZFR0_EL1.B16B16. This could cause the test to incorrectly
fail on a CPU that supports FEAT_SVE2.1 but not FEAT_SVE_B16B16.
LD1Q Gather load quadwords which is decoded from SVE encodings and
implied by FEAT_SVE2p1.
Fixes: c5195b027d29 ("kselftest/arm64: Add SVE 2.1 to hwcap test")
Signed-off-by: Yifan Wu <wuyifan50@huawei.com>
Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/arm64/abi/hwcap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/arm64/abi/hwcap.c b/tools/testing/selftests/arm64/abi/hwcap.c
index c41640f18e4ec..62ea450f2ccc0 100644
--- a/tools/testing/selftests/arm64/abi/hwcap.c
+++ b/tools/testing/selftests/arm64/abi/hwcap.c
@@ -473,8 +473,8 @@ static void sve2_sigill(void)
static void sve2p1_sigill(void)
{
- /* BFADD Z0.H, Z0.H, Z0.H */
- asm volatile(".inst 0x65000000" : : : "z0");
+ /* LD1Q {Z0.Q}, P0/Z, [Z0.D, X0] */
+ asm volatile(".inst 0xC400A000" : : : "z0");
}
static void sve2p2_sigill(void)
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 309/311] tracing: Add NULL pointer check to trigger_data_free()
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (307 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 308/311] selftest/arm64: Fix sve2p1_sigill() to hwcap test Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 310/311] bpf: collect only live registers in linked regs Sasha Levin
` (15 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Guenter Roeck, Miaoqian Lin, Masami Hiramatsu, Mathieu Desnoyers,
Steven Rostedt (Google), Sasha Levin
From: Guenter Roeck <linux@roeck-us.net>
[ Upstream commit 457965c13f0837a289c9164b842d0860133f6274 ]
If trigger_data_alloc() fails and returns NULL, event_hist_trigger_parse()
jumps to the out_free error path. While kfree() safely handles a NULL
pointer, trigger_data_free() does not. This causes a NULL pointer
dereference in trigger_data_free() when evaluating
data->cmd_ops->set_filter.
Fix the problem by adding a NULL pointer check to trigger_data_free().
The problem was found by an experimental code review agent based on
gemini-3.1-pro while reviewing backports into v6.18.y.
Cc: Miaoqian Lin <linmq006@gmail.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://patch.msgid.link/20260305193339.2810953-1-linux@roeck-us.net
Fixes: 0550069cc25f ("tracing: Properly process error handling in event_hist_trigger_parse()")
Assisted-by: Gemini:gemini-3.1-pro
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace_events_trigger.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c
index 06b75bcfc7b8b..871e7a99d03cb 100644
--- a/kernel/trace/trace_events_trigger.c
+++ b/kernel/trace/trace_events_trigger.c
@@ -50,6 +50,9 @@ static int trigger_kthread_fn(void *ignore)
void trigger_data_free(struct event_trigger_data *data)
{
+ if (!data)
+ return;
+
if (data->cmd_ops->set_filter)
data->cmd_ops->set_filter(NULL, data, NULL);
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 310/311] bpf: collect only live registers in linked regs
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (308 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 309/311] tracing: Add NULL pointer check to trigger_data_free() Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 311/311] Linux 6.19.7-rc1 Sasha Levin
` (14 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable
Cc: Eduard Zingerman, Emil Tsalapatis, Alexei Starovoitov,
Sasha Levin
From: Eduard Zingerman <eddyz87@gmail.com>
[ Upstream commit 2658a1720a1944fbaeda937000ad2b3c3dfaf1bb ]
Fix an inconsistency between func_states_equal() and
collect_linked_regs():
- regsafe() uses check_ids() to verify that cached and current states
have identical register id mapping.
- func_states_equal() calls regsafe() only for registers computed as
live by compute_live_registers().
- clean_live_states() is supposed to remove dead registers from cached
states, but it can skip states belonging to an iterator-based loop.
- collect_linked_regs() collects all registers sharing the same id,
ignoring the marks computed by compute_live_registers().
Linked registers are stored in the state's jump history.
- backtrack_insn() marks all linked registers for an instruction
as precise whenever one of the linked registers is precise.
The above might lead to a scenario:
- There is an instruction I with register rY known to be dead at I.
- Instruction I is reached via two paths: first A, then B.
- On path A:
- There is an id link between registers rX and rY.
- Checkpoint C is created at I.
- Linked register set {rX, rY} is saved to the jump history.
- rX is marked as precise at I, causing both rX and rY
to be marked precise at C.
- On path B:
- There is no id link between registers rX and rY,
otherwise register states are sub-states of those in C.
- Because rY is dead at I, check_ids() returns true.
- Current state is considered equal to checkpoint C,
propagate_precision() propagates spurious precision
mark for register rY along the path B.
- Depending on a program, this might hit verifier_bug()
in the backtrack_insn(), e.g. if rY ∈ [r1..r5]
and backtrack_insn() spots a function call.
The reproducer program is in the next patch.
This was hit by sched_ext scx_lavd scheduler code.
Changes in tests:
- verifier_scalar_ids.c selftests need modification to preserve
some registers as live for __msg() checks.
- exceptions_assert.c adjusted to match changes in the verifier log,
R0 is dead after conditional instruction and thus does not get
range.
- precise.c adjusted to match changes in the verifier log, register r9
is dead after comparison and it's range is not important for test.
Reported-by: Emil Tsalapatis <emil@etsalapatis.com>
Fixes: 0fb3cf6110a5 ("bpf: use register liveness information for func_states_equal")
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20260306-linked-regs-and-propagate-precision-v1-1-18e859be570d@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/bpf/verifier.c | 13 ++++-
.../selftests/bpf/progs/exceptions_assert.c | 34 +++++------
.../selftests/bpf/progs/verifier_scalar_ids.c | 56 ++++++++++++++-----
.../testing/selftests/bpf/verifier/precise.c | 8 +--
4 files changed, 73 insertions(+), 38 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index c3b58f5d062b0..b594a065b83c4 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -16895,17 +16895,24 @@ static void __collect_linked_regs(struct linked_regs *reg_set, struct bpf_reg_st
* in verifier state, save R in linked_regs if R->id == id.
* If there are too many Rs sharing same id, reset id for leftover Rs.
*/
-static void collect_linked_regs(struct bpf_verifier_state *vstate, u32 id,
+static void collect_linked_regs(struct bpf_verifier_env *env,
+ struct bpf_verifier_state *vstate,
+ u32 id,
struct linked_regs *linked_regs)
{
+ struct bpf_insn_aux_data *aux = env->insn_aux_data;
struct bpf_func_state *func;
struct bpf_reg_state *reg;
+ u16 live_regs;
int i, j;
id = id & ~BPF_ADD_CONST;
for (i = vstate->curframe; i >= 0; i--) {
+ live_regs = aux[frame_insn_idx(vstate, i)].live_regs_before;
func = vstate->frame[i];
for (j = 0; j < BPF_REG_FP; j++) {
+ if (!(live_regs & BIT(j)))
+ continue;
reg = &func->regs[j];
__collect_linked_regs(linked_regs, reg, id, i, j, true);
}
@@ -17113,9 +17120,9 @@ static int check_cond_jmp_op(struct bpf_verifier_env *env,
* if parent state is created.
*/
if (BPF_SRC(insn->code) == BPF_X && src_reg->type == SCALAR_VALUE && src_reg->id)
- collect_linked_regs(this_branch, src_reg->id, &linked_regs);
+ collect_linked_regs(env, this_branch, src_reg->id, &linked_regs);
if (dst_reg->type == SCALAR_VALUE && dst_reg->id)
- collect_linked_regs(this_branch, dst_reg->id, &linked_regs);
+ collect_linked_regs(env, this_branch, dst_reg->id, &linked_regs);
if (linked_regs.cnt > 1) {
err = push_jmp_history(env, this_branch, 0, linked_regs_pack(&linked_regs));
if (err)
diff --git a/tools/testing/selftests/bpf/progs/exceptions_assert.c b/tools/testing/selftests/bpf/progs/exceptions_assert.c
index a01c2736890f9..858af5988a38a 100644
--- a/tools/testing/selftests/bpf/progs/exceptions_assert.c
+++ b/tools/testing/selftests/bpf/progs/exceptions_assert.c
@@ -18,43 +18,43 @@
return *(u64 *)num; \
}
-__msg(": R0=0xffffffff80000000")
+__msg("R{{.}}=0xffffffff80000000")
check_assert(s64, ==, eq_int_min, INT_MIN);
-__msg(": R0=0x7fffffff")
+__msg("R{{.}}=0x7fffffff")
check_assert(s64, ==, eq_int_max, INT_MAX);
-__msg(": R0=0")
+__msg("R{{.}}=0")
check_assert(s64, ==, eq_zero, 0);
-__msg(": R0=0x8000000000000000 R1=0x8000000000000000")
+__msg("R{{.}}=0x8000000000000000")
check_assert(s64, ==, eq_llong_min, LLONG_MIN);
-__msg(": R0=0x7fffffffffffffff R1=0x7fffffffffffffff")
+__msg("R{{.}}=0x7fffffffffffffff")
check_assert(s64, ==, eq_llong_max, LLONG_MAX);
-__msg(": R0=scalar(id=1,smax=0x7ffffffe)")
+__msg("R{{.}}=scalar(id=1,smax=0x7ffffffe)")
check_assert(s64, <, lt_pos, INT_MAX);
-__msg(": R0=scalar(id=1,smax=-1,umin=0x8000000000000000,var_off=(0x8000000000000000; 0x7fffffffffffffff))")
+__msg("R{{.}}=scalar(id=1,smax=-1,umin=0x8000000000000000,var_off=(0x8000000000000000; 0x7fffffffffffffff))")
check_assert(s64, <, lt_zero, 0);
-__msg(": R0=scalar(id=1,smax=0xffffffff7fffffff")
+__msg("R{{.}}=scalar(id=1,smax=0xffffffff7fffffff")
check_assert(s64, <, lt_neg, INT_MIN);
-__msg(": R0=scalar(id=1,smax=0x7fffffff)")
+__msg("R{{.}}=scalar(id=1,smax=0x7fffffff)")
check_assert(s64, <=, le_pos, INT_MAX);
-__msg(": R0=scalar(id=1,smax=0)")
+__msg("R{{.}}=scalar(id=1,smax=0)")
check_assert(s64, <=, le_zero, 0);
-__msg(": R0=scalar(id=1,smax=0xffffffff80000000")
+__msg("R{{.}}=scalar(id=1,smax=0xffffffff80000000")
check_assert(s64, <=, le_neg, INT_MIN);
-__msg(": R0=scalar(id=1,smin=umin=0x80000000,umax=0x7fffffffffffffff,var_off=(0x0; 0x7fffffffffffffff))")
+__msg("R{{.}}=scalar(id=1,smin=umin=0x80000000,umax=0x7fffffffffffffff,var_off=(0x0; 0x7fffffffffffffff))")
check_assert(s64, >, gt_pos, INT_MAX);
-__msg(": R0=scalar(id=1,smin=umin=1,umax=0x7fffffffffffffff,var_off=(0x0; 0x7fffffffffffffff))")
+__msg("R{{.}}=scalar(id=1,smin=umin=1,umax=0x7fffffffffffffff,var_off=(0x0; 0x7fffffffffffffff))")
check_assert(s64, >, gt_zero, 0);
-__msg(": R0=scalar(id=1,smin=0xffffffff80000001")
+__msg("R{{.}}=scalar(id=1,smin=0xffffffff80000001")
check_assert(s64, >, gt_neg, INT_MIN);
-__msg(": R0=scalar(id=1,smin=umin=0x7fffffff,umax=0x7fffffffffffffff,var_off=(0x0; 0x7fffffffffffffff))")
+__msg("R{{.}}=scalar(id=1,smin=umin=0x7fffffff,umax=0x7fffffffffffffff,var_off=(0x0; 0x7fffffffffffffff))")
check_assert(s64, >=, ge_pos, INT_MAX);
-__msg(": R0=scalar(id=1,smin=0,umax=0x7fffffffffffffff,var_off=(0x0; 0x7fffffffffffffff))")
+__msg("R{{.}}=scalar(id=1,smin=0,umax=0x7fffffffffffffff,var_off=(0x0; 0x7fffffffffffffff))")
check_assert(s64, >=, ge_zero, 0);
-__msg(": R0=scalar(id=1,smin=0xffffffff80000000")
+__msg("R{{.}}=scalar(id=1,smin=0xffffffff80000000")
check_assert(s64, >=, ge_neg, INT_MIN);
SEC("?tc")
diff --git a/tools/testing/selftests/bpf/progs/verifier_scalar_ids.c b/tools/testing/selftests/bpf/progs/verifier_scalar_ids.c
index c0ce690ddb68a..1fdd85b4b8443 100644
--- a/tools/testing/selftests/bpf/progs/verifier_scalar_ids.c
+++ b/tools/testing/selftests/bpf/progs/verifier_scalar_ids.c
@@ -40,6 +40,9 @@ __naked void linked_regs_bpf_k(void)
*/
"r3 = r10;"
"r3 += r0;"
+ /* Mark r1 and r2 as alive. */
+ "r1 = r1;"
+ "r2 = r2;"
"r0 = 0;"
"exit;"
:
@@ -73,6 +76,9 @@ __naked void linked_regs_bpf_x_src(void)
*/
"r4 = r10;"
"r4 += r0;"
+ /* Mark r1 and r2 as alive. */
+ "r1 = r1;"
+ "r2 = r2;"
"r0 = 0;"
"exit;"
:
@@ -106,6 +112,10 @@ __naked void linked_regs_bpf_x_dst(void)
*/
"r4 = r10;"
"r4 += r3;"
+ /* Mark r1 and r2 as alive. */
+ "r0 = r0;"
+ "r1 = r1;"
+ "r2 = r2;"
"r0 = 0;"
"exit;"
:
@@ -143,6 +153,9 @@ __naked void linked_regs_broken_link(void)
*/
"r3 = r10;"
"r3 += r0;"
+ /* Mark r1 and r2 as alive. */
+ "r1 = r1;"
+ "r2 = r2;"
"r0 = 0;"
"exit;"
:
@@ -156,16 +169,16 @@ __naked void linked_regs_broken_link(void)
*/
SEC("socket")
__success __log_level(2)
-__msg("12: (0f) r2 += r1")
+__msg("17: (0f) r2 += r1")
/* Current state */
-__msg("frame2: last_idx 12 first_idx 11 subseq_idx -1 ")
-__msg("frame2: regs=r1 stack= before 11: (bf) r2 = r10")
+__msg("frame2: last_idx 17 first_idx 14 subseq_idx -1 ")
+__msg("frame2: regs=r1 stack= before 16: (bf) r2 = r10")
__msg("frame2: parent state regs=r1 stack=")
__msg("frame1: parent state regs= stack=")
__msg("frame0: parent state regs= stack=")
/* Parent state */
-__msg("frame2: last_idx 10 first_idx 10 subseq_idx 11 ")
-__msg("frame2: regs=r1 stack= before 10: (25) if r1 > 0x7 goto pc+0")
+__msg("frame2: last_idx 13 first_idx 13 subseq_idx 14 ")
+__msg("frame2: regs=r1 stack= before 13: (25) if r1 > 0x7 goto pc+0")
__msg("frame2: parent state regs=r1 stack=")
/* frame1.r{6,7} are marked because mark_precise_scalar_ids()
* looks for all registers with frame2.r1.id in the current state
@@ -173,20 +186,20 @@ __msg("frame2: parent state regs=r1 stack=")
__msg("frame1: parent state regs=r6,r7 stack=")
__msg("frame0: parent state regs=r6 stack=")
/* Parent state */
-__msg("frame2: last_idx 8 first_idx 8 subseq_idx 10")
-__msg("frame2: regs=r1 stack= before 8: (85) call pc+1")
+__msg("frame2: last_idx 9 first_idx 9 subseq_idx 13")
+__msg("frame2: regs=r1 stack= before 9: (85) call pc+3")
/* frame1.r1 is marked because of backtracking of call instruction */
__msg("frame1: parent state regs=r1,r6,r7 stack=")
__msg("frame0: parent state regs=r6 stack=")
/* Parent state */
-__msg("frame1: last_idx 7 first_idx 6 subseq_idx 8")
-__msg("frame1: regs=r1,r6,r7 stack= before 7: (bf) r7 = r1")
-__msg("frame1: regs=r1,r6 stack= before 6: (bf) r6 = r1")
+__msg("frame1: last_idx 8 first_idx 7 subseq_idx 9")
+__msg("frame1: regs=r1,r6,r7 stack= before 8: (bf) r7 = r1")
+__msg("frame1: regs=r1,r6 stack= before 7: (bf) r6 = r1")
__msg("frame1: parent state regs=r1 stack=")
__msg("frame0: parent state regs=r6 stack=")
/* Parent state */
-__msg("frame1: last_idx 4 first_idx 4 subseq_idx 6")
-__msg("frame1: regs=r1 stack= before 4: (85) call pc+1")
+__msg("frame1: last_idx 4 first_idx 4 subseq_idx 7")
+__msg("frame1: regs=r1 stack= before 4: (85) call pc+2")
__msg("frame0: parent state regs=r1,r6 stack=")
/* Parent state */
__msg("frame0: last_idx 3 first_idx 1 subseq_idx 4")
@@ -204,6 +217,7 @@ __naked void precision_many_frames(void)
"r1 = r0;"
"r6 = r0;"
"call precision_many_frames__foo;"
+ "r6 = r6;" /* mark r6 as live */
"exit;"
:
: __imm(bpf_ktime_get_ns)
@@ -220,6 +234,8 @@ void precision_many_frames__foo(void)
"r6 = r1;"
"r7 = r1;"
"call precision_many_frames__bar;"
+ "r6 = r6;" /* mark r6 as live */
+ "r7 = r7;" /* mark r7 as live */
"exit"
::: __clobber_all);
}
@@ -229,6 +245,8 @@ void precision_many_frames__bar(void)
{
asm volatile (
"if r1 > 7 goto +0;"
+ "r6 = 0;" /* mark r6 as live */
+ "r7 = 0;" /* mark r7 as live */
/* force r1 to be precise, this eventually marks:
* - bar frame r1
* - foo frame r{1,6,7}
@@ -340,6 +358,8 @@ __naked void precision_two_ids(void)
"r3 += r7;"
/* force r9 to be precise, this also marks r8 */
"r3 += r9;"
+ "r6 = r6;" /* mark r6 as live */
+ "r8 = r8;" /* mark r8 as live */
"exit;"
:
: __imm(bpf_ktime_get_ns)
@@ -353,7 +373,7 @@ __flag(BPF_F_TEST_STATE_FREQ)
* collect_linked_regs() can't tie more than 6 registers for a single insn.
*/
__msg("8: (25) if r0 > 0x7 goto pc+0 ; R0=scalar(id=1")
-__msg("9: (bf) r6 = r6 ; R6=scalar(id=2")
+__msg("14: (bf) r6 = r6 ; R6=scalar(id=2")
/* check that r{0-5} are marked precise after 'if' */
__msg("frame0: regs=r0 stack= before 8: (25) if r0 > 0x7 goto pc+0")
__msg("frame0: parent state regs=r0,r1,r2,r3,r4,r5 stack=:")
@@ -372,6 +392,12 @@ __naked void linked_regs_too_many_regs(void)
"r6 = r0;"
/* propagate range for r{0-6} */
"if r0 > 7 goto +0;"
+ /* keep r{1-5} live */
+ "r1 = r1;"
+ "r2 = r2;"
+ "r3 = r3;"
+ "r4 = r4;"
+ "r5 = r5;"
/* make r6 appear in the log */
"r6 = r6;"
/* force r0 to be precise,
@@ -517,7 +543,7 @@ __naked void check_ids_in_regsafe_2(void)
"*(u64*)(r10 - 8) = r1;"
/* r9 = pointer to stack */
"r9 = r10;"
- "r9 += -8;"
+ "r9 += -16;"
/* r8 = ktime_get_ns() */
"call %[bpf_ktime_get_ns];"
"r8 = r0;"
@@ -538,6 +564,8 @@ __naked void check_ids_in_regsafe_2(void)
"if r7 > 4 goto l2_%=;"
/* Access memory at r9[r6] */
"r9 += r6;"
+ "r9 += r7;"
+ "r9 += r8;"
"r0 = *(u8*)(r9 + 0);"
"l2_%=:"
"r0 = 0;"
diff --git a/tools/testing/selftests/bpf/verifier/precise.c b/tools/testing/selftests/bpf/verifier/precise.c
index 59a020c356474..ef3ec56672c22 100644
--- a/tools/testing/selftests/bpf/verifier/precise.c
+++ b/tools/testing/selftests/bpf/verifier/precise.c
@@ -44,9 +44,9 @@
mark_precise: frame0: regs=r2 stack= before 23\
mark_precise: frame0: regs=r2 stack= before 22\
mark_precise: frame0: regs=r2 stack= before 20\
- mark_precise: frame0: parent state regs=r2,r9 stack=:\
+ mark_precise: frame0: parent state regs=r2 stack=:\
mark_precise: frame0: last_idx 19 first_idx 10\
- mark_precise: frame0: regs=r2,r9 stack= before 19\
+ mark_precise: frame0: regs=r2 stack= before 19\
mark_precise: frame0: regs=r9 stack= before 18\
mark_precise: frame0: regs=r8,r9 stack= before 17\
mark_precise: frame0: regs=r0,r9 stack= before 15\
@@ -107,9 +107,9 @@
mark_precise: frame0: parent state regs=r2 stack=:\
mark_precise: frame0: last_idx 20 first_idx 20\
mark_precise: frame0: regs=r2 stack= before 20\
- mark_precise: frame0: parent state regs=r2,r9 stack=:\
+ mark_precise: frame0: parent state regs=r2 stack=:\
mark_precise: frame0: last_idx 19 first_idx 17\
- mark_precise: frame0: regs=r2,r9 stack= before 19\
+ mark_precise: frame0: regs=r2 stack= before 19\
mark_precise: frame0: regs=r9 stack= before 18\
mark_precise: frame0: regs=r8,r9 stack= before 17\
mark_precise: frame0: parent state regs= stack=:",
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* [PATCH 6.19 311/311] Linux 6.19.7-rc1
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (309 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 310/311] bpf: collect only live registers in linked regs Sasha Levin
@ 2026-03-10 11:05 ` Sasha Levin
2026-03-10 12:47 ` [PATCH 6.19 000/311] 6.19.7-rc1 review Brett A C Sheffield
` (13 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-10 11:05 UTC (permalink / raw)
To: patches, stable; +Cc: Sasha Levin
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index faab511ef38c0..10167f6e68a0f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 6
PATCHLEVEL = 19
-SUBLEVEL = 6
-EXTRAVERSION =
+SUBLEVEL = 7
+EXTRAVERSION = -rc1
NAME = Baby Opossum Posse
# *DOCUMENTATION*
--
2.51.0
^ permalink raw reply related [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (310 preceding siblings ...)
2026-03-10 11:05 ` [PATCH 6.19 311/311] Linux 6.19.7-rc1 Sasha Levin
@ 2026-03-10 12:47 ` Brett A C Sheffield
2026-03-10 14:15 ` Ronald Warsow
` (12 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Brett A C Sheffield @ 2026-03-10 12:47 UTC (permalink / raw)
To: sashal
Cc: linux-kernel, stable, gregkh, patches, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr,
Brett A C Sheffield
# Librecast Test Results
020/020 [ OK ] liblcrq
010/010 [ OK ] libmld
120/120 [ OK ] liblibrecast
CPU/kernel: Linux auntie 6.19.7-rc1-g2867504d9c53 #2 SMP PREEMPT_DYNAMIC Tue Mar 10 12:44:04 -00 2026 x86_64 AMD Ryzen 9 9950X 16-Core Processor AuthenticAMD GNU/Linux
Tested-by: Brett A C Sheffield <bacs@librecast.net>
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (311 preceding siblings ...)
2026-03-10 12:47 ` [PATCH 6.19 000/311] 6.19.7-rc1 review Brett A C Sheffield
@ 2026-03-10 14:15 ` Ronald Warsow
2026-03-10 14:22 ` Jon Hunter
` (11 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Ronald Warsow @ 2026-03-10 14:15 UTC (permalink / raw)
To: Sasha Levin, linux-kernel, stable
Cc: gregkh, patches, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
conor, hargar, broonie, achill, sr
Hi
no regressions here on x86_64 (Intel 11th Gen. CPU)
Thanks
Tested-by: Ronald Warsow <rwarsow@gmx.de>
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (312 preceding siblings ...)
2026-03-10 14:15 ` Ronald Warsow
@ 2026-03-10 14:22 ` Jon Hunter
2026-03-10 15:47 ` Dileep malepu
` (10 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Jon Hunter @ 2026-03-10 14:22 UTC (permalink / raw)
To: Sasha Levin
Cc: Sasha Levin, gregkh, patches, torvalds, akpm, linux, shuah,
patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr,
linux-tegra, stable
On Tue, 10 Mar 2026 07:05:54 -0400, Sasha Levin wrote:
>
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
> and the diffstat can be found below.
>
> Thanks,
> Sasha
All tests passing for Tegra ...
Test results for stable-v6.19:
10 builds: 10 pass, 0 fail
28 boots: 28 pass, 0 fail
133 tests: 133 pass, 0 fail
Linux version: 6.19.7-rc1-g2867504d9c53
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000,
tegra194-p3509-0000+p3668-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Jon
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (313 preceding siblings ...)
2026-03-10 14:22 ` Jon Hunter
@ 2026-03-10 15:47 ` Dileep malepu
2026-03-10 15:52 ` Mark Brown
` (9 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Dileep malepu @ 2026-03-10 15:47 UTC (permalink / raw)
To: Sasha Levin
Cc: linux-kernel, stable, gregkh, patches, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
On Tue, Mar 10, 2026 at 4:36 PM Sasha Levin <sashal@kernel.org> wrote:
>
>
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
> and the diffstat can be found below.
>
> Thanks,
> Sasha
>
> -------------
built and boot-tested the linux-stable-rc 6.19.7 kernel using QEMU.
The kernel built and booted successfully in a virtual environment
on the tested architectures. No issues were observed during boot,
and no regressions were found in the dmesg output.
Build details:
Architectures : arm64, x86_64
Kernel version: 6.19.7-rc1
Configuration : defconfig
Source : https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Commit : 2867504d9c53260444ef95c17adeebb724395237
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (314 preceding siblings ...)
2026-03-10 15:47 ` Dileep malepu
@ 2026-03-10 15:52 ` Mark Brown
2026-03-10 18:55 ` Justin Forbes
` (8 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Mark Brown @ 2026-03-10 15:52 UTC (permalink / raw)
To: Sasha Levin
Cc: linux-kernel, stable, gregkh, patches, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, achill, sr
[-- Attachment #1: Type: text/plain, Size: 349 bytes --]
On Tue, Mar 10, 2026 at 07:05:54AM -0400, Sasha Levin wrote:
>
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
Tested-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (315 preceding siblings ...)
2026-03-10 15:52 ` Mark Brown
@ 2026-03-10 18:55 ` Justin Forbes
2026-03-10 19:09 ` Florian Fainelli
` (7 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Justin Forbes @ 2026-03-10 18:55 UTC (permalink / raw)
To: Sasha Levin
Cc: linux-kernel, stable, gregkh, patches, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
On Tue, Mar 10, 2026 at 07:05:54AM -0400, Sasha Levin wrote:
>
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
> and the diffstat can be found below.
>
> Thanks,
> Sasha
Tested rc1 against the Fedora build system (aarch64, ppc64le, s390x,
x86_64), and boot tested x86_64. No regressions noted.
Tested-by: Justin M. Forbes <jforbes@fedoraproject.org>
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (316 preceding siblings ...)
2026-03-10 18:55 ` Justin Forbes
@ 2026-03-10 19:09 ` Florian Fainelli
2026-03-11 1:06 ` Sasha Levin
2026-03-10 23:20 ` Ron Economos
` (6 subsequent siblings)
324 siblings, 1 reply; 330+ messages in thread
From: Florian Fainelli @ 2026-03-10 19:09 UTC (permalink / raw)
To: Sasha Levin, linux-kernel, stable
Cc: gregkh, patches, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, sudipm.mukherjee, rwarsow, conor,
hargar, broonie, achill, sr
On 3/10/26 04:05, Sasha Levin wrote:
>
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
> and the diffstat can be found below.
>
> Thanks,
> Sasha
>
> -------------
perf fails to build the pmu-events for all of the freescale SoCs, I am
not sure yet whether this is a build environment issue or a genuine perf
build system failure:
cp: cannot stat
'pmu-events/arch/arm64/freescale/imx8mm/sys/metrics.json': No such file
or directory
CC
/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/util/maps.o
cp: cannot stat 'pmu-events/arch/arm64/freescale/imx8mm/sys/ddrc.json':
No such file or directory
cp: cannot stat
'pmu-events/arch/arm64/freescale/imx94/sys/metrics.json': No such file
or directory
cp: cannot stat 'pmu-events/arch/arm64/freescale/imx94/sys/ddrc.json':
No such file or directory
CC
/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/util/pstack.o
GEN
/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/metrics.json
CC
/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/util/session.o
make[5]: *** [pmu-events/Build:44:
/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/pmu-events/arch/arm64/freescale/imx8mm/sys/metrics.json]
Error 1
make[5]: *** Waiting for unfinished jobs....
GEN
/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/pmu-events/arch/arm64/freescale/imx91/sys/ddrc.json
make[5]: *** [pmu-events/Build:44:
/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/pmu-events/arch/arm64/freescale/imx8mm/sys/ddrc.json]
Error 1
make[5]: *** [pmu-events/Build:44:
/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/pmu-events/arch/arm64/freescale/imx94/sys/metrics.json]
Error 1
make[5]: *** [pmu-events/Build:44:
/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/pmu-events/arch/arm64/freescale/imx94/sys/ddrc.json]
Error 1
...
cp: cannot stat
'pmu-events/arch/arm64/freescale/imx8mm/sys/metrics.json': No such file
or directory
make[5]: *** [pmu-events/Build:44:
/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/pmu-events/arch/arm64/freescale/imx8mm/sys/metrics.json]
Error 1
make[4]: *** [Makefile.perf:770:
/local/users/fainelli/buildroot/output/arm64/build/linux-custom/tools/perf/pmu-events/pmu-events-in.o]
Error 2
make[4]: *** Waiting for unfinished jobs....
--
Florian
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (317 preceding siblings ...)
2026-03-10 19:09 ` Florian Fainelli
@ 2026-03-10 23:20 ` Ron Economos
2026-03-11 1:15 ` Peter Schneider
` (5 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Ron Economos @ 2026-03-10 23:20 UTC (permalink / raw)
To: Sasha Levin, linux-kernel, stable
Cc: gregkh, patches, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
On 3/10/26 04:05, Sasha Levin wrote:
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
> and the diffstat can be found below.
>
> Thanks,
> Sasha
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Tested-by: Ron Economos <re@w6rz.net>
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 19:09 ` Florian Fainelli
@ 2026-03-11 1:06 ` Sasha Levin
2026-03-11 16:47 ` Florian Fainelli
0 siblings, 1 reply; 330+ messages in thread
From: Sasha Levin @ 2026-03-11 1:06 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-kernel, stable, gregkh, patches, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
On Tue, Mar 10, 2026 at 12:09:32PM -0700, Florian Fainelli wrote:
>On 3/10/26 04:05, Sasha Levin wrote:
>>
>>This is the start of the stable review cycle for the 6.19.7 release.
>>There are 311 patches in this series, all will be posted as a response
>>to this one. If anyone has any issues with these being applied, please
>>let me know.
>>
>>Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
>>Anything received after that time might be too late.
>>
>>The whole patch series can be found in one patch at:
>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
>>or in the git tree and branch at:
>> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
>>and the diffstat can be found below.
>>
>>Thanks,
>>Sasha
>>
>>-------------
>perf fails to build the pmu-events for all of the freescale SoCs, I am
>not sure yet whether this is a build environment issue or a genuine
>perf build system failure:
Could you try building with a revert of b56111d7a464 ("perf jevents: Handle
deleted JSONS in out of source builds") please?
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (318 preceding siblings ...)
2026-03-10 23:20 ` Ron Economos
@ 2026-03-11 1:15 ` Peter Schneider
2026-03-11 2:46 ` Takeshi Ogasawara
` (4 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Peter Schneider @ 2026-03-11 1:15 UTC (permalink / raw)
To: Sasha Levin, linux-kernel, stable
Cc: gregkh, patches, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
Am 10.03.2026 um 12:05 schrieb Sasha Levin:
>
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
Builds, boots and works on my 2-socket Ivy Bridge Xeon E5-2697 v2 server. No dmesg oddities or regressions found.
Tested-by: Peter Schneider <pschneider1968@googlemail.com>
Beste Grüße,
Peter Schneider
--
Climb the mountain not to plant your flag, but to embrace the challenge,
enjoy the air and behold the view. Climb it so you can see the world,
not so the world can see you. -- David McCullough Jr.
OpenPGP: 0xA3828BD796CCE11A8CADE8866E3A92C92C3FF244
Download: https://www.peters-netzplatz.de/download/pschneider1968_pub.asc
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@googlemail.com
https://keys.mailvelope.com/pks/lookup?op=get&search=pschneider1968@gmail.com
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (319 preceding siblings ...)
2026-03-11 1:15 ` Peter Schneider
@ 2026-03-11 2:46 ` Takeshi Ogasawara
2026-03-11 13:39 ` Luna Jernberg
` (3 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Takeshi Ogasawara @ 2026-03-11 2:46 UTC (permalink / raw)
To: Sasha Levin
Cc: linux-kernel, stable, gregkh, patches, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr
Hi Sasha
On Tue, Mar 10, 2026 at 8:11 PM Sasha Levin <sashal@kernel.org> wrote:
>
>
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
> and the diffstat can be found below.
>
> Thanks,
> Sasha
>
6.19.7-rc1 tested.
Build successfully completed.
Boot successfully completed.
No dmesg regressions.
Video output normal.
Sound output normal.
Lenovo ThinkPad X1 Carbon Gen10(Intel i7-1260P(x86_64) arch linux)
[ 0.000000] Linux version 6.19.7-rc1rv-g2867504d9c53
(takeshi@ThinkPadX1Gen10J0764) (gcc (GCC) 15.2.1 20260209, GNU ld (GNU
Binutils) 2.46) #1 SMP PREEMPT_DYNAMIC Wed Mar 11 11:06:57 JST 2026
Thanks
Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com>
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (320 preceding siblings ...)
2026-03-11 2:46 ` Takeshi Ogasawara
@ 2026-03-11 13:39 ` Luna Jernberg
2026-03-11 20:56 ` Shuah Khan
` (2 subsequent siblings)
324 siblings, 0 replies; 330+ messages in thread
From: Luna Jernberg @ 2026-03-11 13:39 UTC (permalink / raw)
To: Sasha Levin
Cc: linux-kernel, stable, gregkh, patches, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, rwarsow, conor, hargar, broonie, achill, sr,
Luna Jernberg
Tested-by: Luna Jernberg <droidbittin@gmail.com>
AMD Ryzen 5 5600 6-Core Processor:
https://www.inet.se/produkt/5304697/amd-ryzen-5-5600-3-5-ghz-35mb on a
https://www.gigabyte.com/Motherboard/B550-AORUS-ELITE-V2-rev-12
https://www.inet.se/produkt/1903406/gigabyte-b550-aorus-elite-v2
motherboard :)
running Arch Linux with the testing repos enabled:
https://archlinux.org/ https://archboot.com/
https://wiki.archlinux.org/title/Arch_Testing_Team
Den tis 10 mars 2026 kl 12:11 skrev Sasha Levin <sashal@kernel.org>:
>
>
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
> and the diffstat can be found below.
>
> Thanks,
> Sasha
>
> -------------
> Pseudo-Shortlog of commits:
>
> Aaron Ma (1):
> ice: recap the VSI and QoS info after rebuild
>
> Alain Volmat (1):
> spi: stm32: fix missing pointer assignment in case of dma chaining
>
> Alban Bedel (1):
> can: mcp251x: fix deadlock in error path of mcp251x_open
>
> Alex Hung (2):
> drm/amd/display: Use mpc.preblend flag to indicate 3D LUT
> drm/amd/display: Enable DEGAMMA and reject COLOR_PIPELINE+DEGAMMA_LUT
>
> Alexandre Courbot (1):
> rust: kunit: fix warning when !CONFIG_PRINTK
>
> Alexey Charkov (1):
> scsi: ufs: core: Fix RPMB region size detection for UFS 2.2
>
> Allison Henderson (1):
> net/rds: Fix circular locking dependency in rds_tcp_tune
>
> Alper Ak (1):
> crypto: ccp - Fix use-after-free on error path
>
> Andrew Cooper (1):
> x86/fred: Correct speculative safety in fred_extint()
>
> Andrew Lunn (1):
> net: phy: register phy led_triggers during probe to avoid AB-BA
> deadlock
>
> Ankit Garg (1):
> gve: fix incorrect buffer cleanup in gve_tx_clean_pending_packets for
> QPL
>
> Ariel Silver (1):
> wifi: mac80211: bounds-check link_id in ieee80211_ml_reconfiguration
>
> Bart Van Assche (5):
> drm/amdgpu: Unlock a mutex before destroying it
> drm/amdgpu: Fix locking bugs in error paths
> hwmon: (it87) Check the it87_lock() return value
> wifi: cw1200: Fix locking in error paths
> wifi: wlcore: Fix a locking bug
>
> Bjorn Helgaas (1):
> PCI: Correct PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 value
>
> Bobby Eshleman (1):
> net: devmem: use READ_ONCE/WRITE_ONCE on binding->dev
>
> Boris Faure (1):
> ASoC: sdca: Fix missing regmap dependencies in Kconfig
>
> Brad Spengler (1):
> drm/vmwgfx: Fix invalid kref_put callback in vmw_bo_dirty_release
>
> Brian Vazquez (1):
> idpf: change IRQ naming to match netdev and ethtool queue numbering
>
> Catalin Marinas (1):
> arm64: gcs: Do not set PTE_SHARED on GCS mappings if FEAT_LPA2 is
> enabled
>
> Chaitanya Kulkarni (1):
> blktrace: fix __this_cpu_read/write in preemptible context
>
> Charles Haithcock (1):
> i2c: i801: Revert "i2c: i801: replace acpi_lock with I2C bus lock"
>
> Charles Keepax (1):
> ASoC: SDCA: Add allocation failure check for Entity name
>
> Chen Ni (2):
> drm/imx: parallel-display: check return value of devm_drm_bridge_add()
> in imx_pd_probe()
> drm/bridge: synopsys: dw-dp: Check return value of
> devm_drm_bridge_add() in dw_dp_bind()
>
> Chintan Vankar (1):
> net: ethernet: ti: am65-cpsw-nuss/cpsw-ale: Fix multicast entry
> handling in ALE table
>
> Christian Brauner (1):
> namespace: fix proc mount iteration
>
> Christoph Böhmwalder (1):
> drbd: fix null-pointer dereference on local read error
>
> Christoph Hellwig (2):
> zloop: advertise a volatile write cache
> zloop: check for spurious options passed to remove
>
> Conor Dooley (1):
> pinctrl: generic: move function to amlogic-am4 driver
>
> Corey Minyard (1):
> ipmi: Fix use-after-free and list corruption on sender error
>
> Dan Carpenter (1):
> accel: ethosu: Fix shift overflow in cmd_to_addr()
>
> Daniel Hodges (1):
> wifi: libertas: fix use-after-free in lbs_free_adapter()
>
> Daniel J Blueman (1):
> gpio: shared: fix memory leaks
>
> Danielle Ratson (1):
> bridge: Check relevant per-VLAN options in VLAN range grouping
>
> Daniil Dulov (1):
> wifi: cfg80211: cancel rfkill_block work in wiphy_unregister()
>
> Danilo Krummrich (1):
> clk: scu/imx8qxp: do not register driver in probe()
>
> Darrick J. Wong (1):
> xfs: fix xfs_group release bug in xfs_dax_notify_dev_failure
>
> Dave Jiang (2):
> cxl: Move devm_cxl_add_nvdimm_bridge() to cxl_pmem.ko
> cxl: Fix race of nvdimm_bus object when creating nvdimm objects
>
> David Carlier (1):
> sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag
>
> David Howells (1):
> netfs: Fix unbuffered/DIO writes to dispatch subrequests in strict
> sequence
>
> David Laight (1):
> uaccess: Fix scoped_user_read_access() for 'pointer to const'
>
> David Thomson (1):
> xen/acpi-processor: fix _CST detection using undersized evaluation
> buffer
>
> Davide Caratti (1):
> net/sched: ets: fix divide by zero in the offload path
>
> Davidlohr Bueso (1):
> cxl/mbox: validate payload size before accessing contents in
> cxl_payload_from_user_allowed()
>
> Deepanshu Kartikey (1):
> mm: thp: deny THP for files on anonymous inodes
>
> Eduard Zingerman (1):
> bpf: collect only live registers in linked regs
>
> Eric Biggers (1):
> ksmbd: Compare MACs in constant time
>
> Eric Dumazet (5):
> net: annotate data-races around sk->sk_{data_ready,write_space}
> inet: annotate data-races around isk->inet_num
> indirect_call_wrapper: do not reevaluate function pointer
> tcp: secure_seq: add back ports to TS offset
> net_sched: sch_fq: clear q->band_pkt_count[] in fq_reset()
>
> Ethan Tidmore (2):
> drm/tiny: sharp-memory: fix pointer error dereference
> xfs: Fix error pointer dereference
>
> Felix Gu (7):
> drm/logicvc: Fix device node reference leak in
> logicvc_drm_config_parse()
> regulator: fp9931: Fix PM runtime reference leak in
> fp9931_hwmon_read()
> regulator: bq257xx: Fix device node reference leak in
> bq257xx_reg_dt_parse_gpio()
> pinctrl: pinconf-generic: Fix memory leak in
> pinconf_generic_parse_dt_config()
> pinctrl: meson: amlogic-a4: Fix device node reference leak in
> aml_dt_node_to_map_pinmux()
> pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe()
> regulator: mt6363: Fix incorrect and redundant IRQ disposal in probe
>
> Fernando Fernandez Mancera (2):
> net: bridge: fix nd_tbl NULL dereference when IPv6 is disabled
> net: vxlan: fix nd_tbl NULL dereference when IPv6 is disabled
>
> Florian Eckert (2):
> pinctrl: equilibrium: rename irq_chip function callbacks
> pinctrl: equilibrium: fix warning trace on load
>
> Florian Westphal (1):
> netfilter: nft_set_pipapo: split gc into unlink and reclaim phase
>
> Francesco Lavra (1):
> drm/solomon: Fix page start when updating rectangle in page addressing
> mode
>
> Fuad Tabba (3):
> KVM: arm64: Hide S1POE from guests when not supported by the host
> KVM: arm64: Fix ID register initialization for non-protected pKVM
> guests
> bpf, arm64: Force 8-byte alignment for JIT buffer to prevent atomic
> tearing
>
> Geoffrey D. Bennett (3):
> ALSA: scarlett2: Fix DSP filter control array handling
> ALSA: usb-audio: Remove VALIDATE_RATES quirk for Focusrite devices
> ALSA: usb-audio: Add QUIRK_FLAG_SKIP_IFACE_SETUP
>
> Gerd Rausch (1):
> time/jiffies: Fix sysctl file error on configurations where USER_HZ <
> HZ
>
> Greg Kroah-Hartman (12):
> nfc: pn533: properly drop the usb interface reference on disconnect
> net: usb: kaweth: validate USB endpoints
> net: usb: kalmia: validate USB endpoints
> net: usb: pegasus: validate USB endpoints
> can: ems_usb: ems_usb_read_bulk_callback(): check the proper length of
> a message
> can: usb: f81604: correctly anchor the urb in the read bulk callback
> can: ucan: Fix infinite loop from zero-length messages
> can: usb: etas_es58x: correctly anchor the urb in the read bulk
> callback
> can: usb: f81604: handle short interrupt urb messages properly
> can: usb: f81604: handle bulk write errors properly
> HID: Add HID_CLAIMED_INPUT guards in raw_event callbacks missing them
> Revert "netfilter: nft_set_rbtree: validate open interval overlap"
>
> Guenter Roeck (5):
> hwmon: (macsmc) Fix regressions in Apple Silicon SMC hwmon driver
> hwmon: (macsmc) Fix overflows, underflows, and sign extension
> dpaa2-switch: Fix interrupt storm after receiving bad if_id in IRQ
> handler
> ata: libata-eh: Fix detection of deferred qc timeouts
> tracing: Add NULL pointer check to trigger_data_free()
>
> Hao Yu (1):
> hwmon: (aht10) Fix initialization commands for AHT20
>
> Haocheng Yu (1):
> perf/core: Fix refcount bug and potential UAF in perf_mmap
>
> Harishankar Vishwanathan (1):
> bpf: Introduce tnum_step to step through tnum's members
>
> Harry Yoo (1):
> mm/slab: pass __GFP_NOWARN to refill_sheaf() if fallback is available
>
> Heiko Carstens (2):
> s390/idle: Fix cpu idle exit cpu time accounting
> s390/vtime: Fix virtual timer forwarding
>
> Heitor Alves de Siqueira (1):
> Bluetooth: purge error queues in socket destructors
>
> Henrique Carvalho (1):
> smb: client: fix cifs_pick_channel when channels are equally loaded
>
> Hou Wenlong (1):
> x86/bug: Handle __WARN_printf() trap in early_fixup_exception()
>
> Ian Forbes (1):
> drm/vmwgfx: Return the correct value in vmw_translate_ptr functions
>
> Ian Ray (2):
> HID: multitouch: new class MT_CLS_EGALAX_P80H84
> net: nfc: nci: Fix zero-length proprietary notifications
>
> Ingo Molnar (3):
> sched/fair: Rename cfs_rq::avg_load to cfs_rq::sum_weight
> sched/fair: Rename cfs_rq::avg_vruntime to ::sum_w_vruntime, and
> helper functions
> sched/fair: Introduce and use the vruntime_cmp() and vruntime_op()
> wrappers for wrapped-signed aritmetics
>
> Ioana Ciornei (1):
> irqchip/ls-extirq: Fix devm_of_iomap() error check
>
> Jakub Kicinski (6):
> tcp: give up on stronger sk_rcvbuf checks (for now)
> ipv6: fix NULL pointer deref in ip6_rt_get_dev_rcu()
> nfc: nci: free skb on nci_transceive early error paths
> nfc: nci: complete pending data exchange on device close
> nfc: nci: clear NCI_DATA_EXCHANGE before calling completion callback
> nfc: rawsock: cancel tx_work before socket teardown
>
> Jamal Hadi Salim (1):
> net/sched: act_ife: Fix metalist update behavior
>
> Jan Stancek (1):
> x86/boot: Handle relative CONFIG_EFI_SBAT_FILE file paths
>
> Jann Horn (1):
> eventpoll: Fix integer overflow in ep_loop_check_proc()
>
> Jason Gunthorpe (3):
> IB/mthca: Add missed mthca_unmap_user_db() for mthca_create_srq()
> RDMA/irdma: Fix kernel stack leak in irdma_create_user_ah()
> RDMA/ionic: Fix kernel stack leak in ionic_create_cq()
>
> Jens Axboe (2):
> io_uring/cmd_net: use READ_ONCE() for ->addr3 read
> media: dvb-core: fix wrong reinitialization of ringbuffer on reopen
>
> Jiayuan Chen (5):
> bpf: Fix race in cpumap on PREEMPT_RT
> bpf: Fix race in devmap on PREEMPT_RT
> atm: lec: fix null-ptr-deref in lec_arp_clear_vccs
> bpf/bonding: reject vlan+srcmac xmit_hash_policy change when XDP is
> loaded
> net: ipv6: fix panic when IPv4 route references loopback IPv6 nexthop
>
> Johannes Berg (1):
> wifi: radiotap: reject radiotap with unknown bits
>
> Jonathan Cavitt (1):
> drm/client: Do not destroy NULL modes
>
> Jonathan Teh (1):
> platform/x86: thinkpad_acpi: Fix errors reading battery thresholds
>
> Juhyung Park (2):
> ALSA: hda/realtek: fix model name typo for Samsung Galaxy Book Flex
> (NT950QCG-X716)
> ALSA: hda/realtek: add quirk for Samsung Galaxy Book Flex
> (NT950QCT-A38A)
>
> Julian Orth (1):
> drm/syncobj: Fix handle <-> fd ioctls with dirty stack
>
> Jun Seo (1):
> ALSA: usb-audio: Use correct version for UAC3 header validation
>
> Junxiao Bi (1):
> scsi: core: Fix refcount leak for tagset_refcnt
>
> Juri Lelli (1):
> sched/deadline: Fix missing ENQUEUE_REPLENISH during PI de-boosting
>
> Justin Tee (1):
> nvmet-fcloop: Check remoteport port_state before calling done callback
>
> Keith Busch (1):
> nvme-multipath: fix leak on try_module_get failure
>
> Khushit Shah (1):
> KVM: x86: Add x2APIC "features" to control EOI broadcast suppression
>
> Kim Phillips (1):
> x86/sev: Allow IBPB-on-Entry feature for SNP guests
>
> Kohei Enju (2):
> bpf: Fix stack-out-of-bounds write in devmap
> iavf: fix netdev->max_mtu to respect actual hardware limit
>
> Koichiro Den (1):
> net: sched: avoid qdisc_reset_all_tx_gt() vs dequeue race for lockless
> qdiscs
>
> Kuen-Han Tsai (3):
> usb: gadget: u_ether: add gether_opts for config caching
> usb: gadget: u_ether: Add auto-cleanup helper for freeing net_device
> usb: gadget: f_ncm: align net_device lifecycle with bind/unbind
>
> Kuniyuki Iwashima (2):
> nfsd: Fix cred ref leak in nfsd_nl_threads_set_doit().
> udp: Unhash auto-bound connected sk from 4-tuple hash table when
> disconnected.
>
> Kurt Borja (2):
> platform/x86: alienware-wmi-wmax: Add G-Mode support to m18 laptops
> platform/x86: dell-wmi: Add audio/mic mute key codes
>
> Lang Xu (1):
> bpf: Fix a UAF issue in bpf_trampoline_link_cgroup_shim
>
> Lars Ellenberg (1):
> drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock()
>
> Larysa Zaremba (9):
> ice: fix adding AQ LLDP filter for VF
> xdp: use modulo operation to calculate XDP frag tailroom
> xsk: introduce helper to determine rxq->frag_size
> ice: fix rxq info registering in mbuf packets
> ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz
> i40e: fix registering XDP RxQ info
> i40e: use xdp.frame_sz as XDP RxQ info frag_size
> net: enetc: use truesize as XDP RxQ info frag_size
> xdp: produce a warning when calculated tailroom is negative
>
> Li Li (1):
> idpf: increment completion queue next_to_clean in sw marker wait
> routine
>
> Lijo Lazar (1):
> drm/amdgpu: Fix error handling in slot reset
>
> Lizhi Hou (11):
> accel/amdxdna: Remove buffer size check when creating command BO
> accel/amdxdna: Switch to always use chained command
> accel/amdxdna: Fix crash when destroying a suspended hardware context
> accel/amdxdna: Fix dead lock for suspend and resume
> accel/amdxdna: Fix suspend failure after enabling turbo mode
> accel/amdxdna: Fix command hang on suspended hardware context
> accel/amdxdna: Fix out-of-bounds memset in command slot handling
> accel/amdxdna: Prevent ubuf size overflow
> accel/amdxdna: Validate command buffer payload count
> accel/amdxdna: Fill invalid payload for failed command
> accel/amdxdna: Fix NULL pointer dereference of mgmt_chann
>
> Lorenzo Bianconi (4):
> wifi: mt76: mt7996: Fix possible oob access in
> mt7996_mac_write_txwi_80211()
> wifi: mt76: mt7925: Fix possible oob access in
> mt7925_mac_write_txwi_80211()
> wifi: mt76: Fix possible oob access in
> mt76_connac2_mac_write_txwi_80211()
> net: ethernet: mtk_eth_soc: Reset prog ptr to old_prog in case of
> error in mtk_xdp_setup()
>
> MD Danish Anwar (1):
> net: ti: icssg-prueth: Fix ping failure after offload mode setup when
> link speed is not 1G
>
> Mario Limonciello (2):
> accel/amdxdna: Reduce log noise during process termination
> platform/x86: hp-bioscfg: Support allocations of larger data
>
> Mariusz Skamra (1):
> Bluetooth: Fix CIS host feature condition
>
> Mark Harmstone (6):
> btrfs: fix error message order of parameters in
> btrfs_delete_delayed_dir_index()
> btrfs: fix incorrect key offset in error message in
> check_dev_extent_item()
> btrfs: fix objectid value in error message in check_extent_data_ref()
> btrfs: fix warning in scrub_verify_one_metadata()
> btrfs: print correct subvol num if active swapfile prevents deletion
> btrfs: fix compat mask in error messages in btrfs_check_features()
>
> Mathias Krause (1):
> scsi: lpfc: Properly set WC for DPP mapping
>
> Mathieu Desnoyers (1):
> rseq: Clarify rseq registration rseq_size bound check comment
>
> Matt Roper (1):
> drm/xe/wa: Steer RMW of MCR registers while building default LRC
>
> Matthew Brost (1):
> drm/xe: Do not preempt fence signaling CS instructions
>
> Matthieu Baerts (NGI0) (4):
> mptcp: pm: avoid sending RM_ADDR over same subflow
> mptcp: pm: in-kernel: always mark signal+subflow endp as used
> selftests: mptcp: join: check RM_ADDR not sent over same subflow
> selftests: mptcp: join: check removing signal+subflow endp
>
> Maulik Shah (1):
> pinctrl: qcom: qcs615: Add missing dual edge GPIO IRQ errata flag
>
> Michal Schmidt (1):
> ice: fix crash in ethtool offline loopback test
>
> Michal Swiatkowski (1):
> libie: don't unroll if fwlog isn't supported
>
> Mieczyslaw Nalewaj (1):
> net: dsa: realtek: rtl8365mb: fix rtl8365mb_phy_ocp_write return value
>
> Mike Rapoport (Microsoft) (1):
> x86/efi: defer freeing of boot services memory
>
> Ming Lei (2):
> nvme: fix admin queue leak on controller reset
> block: use trylock to avoid lockdep circular dependency in sysfs
>
> Miquel Sabaté Solà (1):
> btrfs: free pages on error in btrfs_uring_read_extent()
>
> Miroslav Lichvar (1):
> timekeeping: Fix timex status validation for auxiliary clocks
>
> Nam Cao (1):
> irqchip/sifive-plic: Fix frozen interrupt due to affinity setting
>
> Namhyung Kim (1):
> perf/core: Fix invalid wait context in ctx_sched_in()
>
> Natalie Vock (1):
> drm/amd/display: Use GFP_ATOMIC in dc_create_stream_for_sink
>
> Nathan Chancellor (2):
> kbuild: Split .modinfo out from ELF_DETAILS
> kbuild: Leave objtool binary around with 'make clean'
>
> Nikhil P. Rao (2):
> xsk: Fix fragment node deletion to prevent buffer leak
> xsk: Fix zero-copy AF_XDP fragment drop
>
> Niklas Cassel (3):
> PCI: dwc: ep: Refresh MSI Message Address cache on change
> PCI: dwc: ep: Flush MSI-X write before unmapping its ATU entry
> ata: libata: cancel pending work after clearing deferred_qc
>
> Oliver Hartkopp (2):
> can: bcm: fix locking for bcm_op runtime updates
> can: dummy_can: dummy_can_init(): fix packet statistics
>
> Olivier Sobrie (1):
> hwmon: (max6639) fix inverted polarity
>
> Ovidiu Panait (4):
> net: stmmac: Fix error handling in VLAN add and delete paths
> net: stmmac: Improve double VLAN handling
> net: stmmac: Fix VLAN HW state restore
> net: stmmac: Defer VLAN HW configuration when interface is down
>
> Pablo Neira Ayuso (2):
> netfilter: nf_tables: unconditionally bump set->nelems before
> insertion
> netfilter: nf_tables: clone set on flush only
>
> Panagiotis Foliadis (2):
> ALSA: hda/intel: increase default bdl_pos_adj for Nvidia controllers
> ALSA: hda/realtek: Add quirk for Acer Aspire V3-572G
>
> Paolo Abeni (1):
> selftests: mptcp: more stable simult_flows tests
>
> Paul Chaignon (1):
> bpf: Improve bounds when tnum has a single possible value
>
> Paulo Alcantara (2):
> smb: client: fix broken multichannel with krb5+signing
> smb: client: fix oops due to uninitialised var in smb2_unlink()
>
> Peter Wang (1):
> scsi: ufs: core: Move link recovery for hibern8 exit failure to
> wl_resume
>
> Peter Zijlstra (9):
> x86/cfi: Fix CFI rewrite for odd alignments
> sched/fair: Fix zero_vruntime tracking
> sched/fair: Only set slice protection at pick time
> sched/fair: Fix lag clamp
> perf: Fix __perf_event_overflow() vs perf_remove_from_context() race
> x86/numa: Store extra copy of numa_nodes_parsed
> x86/topo: Add topology_num_nodes_per_package()
> x86/topo: Replace x86_has_numa_in_package
> x86/topo: Fix SNC topology mess
>
> Petr Pavlu (1):
> module: Remove duplicate freeing of lockdep classes
>
> Phillip Lougher (1):
> Squashfs: check metadata block offset is within range
>
> Prithvi Tambewagh (1):
> scsi: target: Fix recursive locking in __configfs_open_file()
>
> Qing Wang (1):
> tracing: Fix WARN_ON in tracing_buffers_mmap_close
>
> Quentin Schulz (2):
> accel/rocket: fix unwinding in error path in rocket_core_init
> accel/rocket: fix unwinding in error path in rocket_probe
>
> Raju Rangoju (2):
> amd-xgbe: fix MAC_TCR_SS register width for 2.5G and 10M speeds
> amd-xgbe: fix sleep while atomic on suspend/resume
>
> Richard Fitzgerald (1):
> ALSA: hda: cs35l56: Fix signedness error in cs35l56_hda_posture_put()
>
> Rob Herring (Arm) (2):
> accel: ethosu: Fix job submit error clean-up refcount underflows
> accel: ethosu: Fix NPU_OP_ELEMENTWISE validation with scalar
>
> Rong Zhang (1):
> ALSA: doc: usb-audio: Add doc for QUIRK_FLAG_SKIP_IFACE_SETUP
>
> Russell King (Oracle) (1):
> net: stmmac: remove support for lpi_intr_o
>
> Salomon Dushimirimana (1):
> scsi: pm8001: Fix use-after-free in pm8001_queue_command()
>
> Sasha Levin (1):
> Linux 6.19.7-rc1
>
> Sebastian Andrzej Siewior (1):
> net: Provide a PREEMPT_RT specific check for netdev_queue::_xmit_lock
>
> Sebastian Krzyszkowiak (1):
> wifi: rsi: Don't default to -EOPNOTSUPP in rsi_mac80211_config
>
> Shuicheng Lin (2):
> drm/xe/configfs: Free ctx_restore_mid_bb in release
> drm/xe/reg_sr: Fix leak on xa_store failure
>
> Shuvam Pandey (1):
> kunit: tool: copy caller args in run_kernel to prevent mutation
>
> Simon Ser (1):
> drm/fourcc: fix plane order for 10/12/16-bit YCbCr formats
>
> Sreedevi Joshi (1):
> idpf: Fix flow rule delete failure due to invalid validation
>
> Srinivas Pandruvada (1):
> cpufreq: intel_pstate: Fix crash during turbo disable
>
> Sun Jian (1):
> selftests/harness: order TEST_F and XFAIL_ADD constructors
>
> Sungwoo Kim (1):
> nvme: fix memory allocation in nvme_pr_read_keys()
>
> T.J. Mercier (1):
> selftests/bpf: Fix OOB read in dmabuf_collector
>
> Takashi Iwai (4):
> ALSA: usb-audio: Cap the packet size pre-calculations
> ALSA: usb-audio: Use inclusive terms
> ALSA: usb: qcom: Correct parameter comment for
> uaudio_transfer_buffer_setup()
> ASoC: SDCA: Fix comments for sdca_irq_request()
>
> Thomas Gleixner (2):
> debugobject: Make it work with deferred page initialization - again
> i40e: Fix preempt count leak in napi poll tracepoint
>
> Thomas Weißschuh (1):
> ARM: clean up the memset64() C wrapper
>
> Thorsten Blum (2):
> platform/x86: dell-wmi-sysman: Don't hex dump plaintext password data
> smb: client: Don't log plaintext credentials in cifs_set_cifscreds
>
> Tianci Cao (1):
> bpf: Add bitwise tracking for BPF_END
>
> Tom Lendacky (1):
> x86/boot/sev: Move SEV decompressor variables into the .data section
>
> Tomasz Lis (1):
> drm/xe/queue: Call fini on exec queue creation fail
>
> Tomasz Pakuła (1):
> HID: pidff: Fix condition effect bit clearing
>
> Tvrtko Ursulin (1):
> drm/amdgpu/userq: Do not allow userspace to trivially triger kernel
> warnings
>
> Vahagn Vardanian (1):
> wifi: mac80211: fix NULL pointer dereference in mesh_rx_csa_frame()
>
> Vasily Gorbik (1):
> s390/kexec: Disable stack protector in s390_reset_system()
>
> Vimlesh Kumar (4):
> octeon_ep: Relocate counter updates before NAPI
> octeon_ep: avoid compiler and IQ/OQ reordering
> octeon_ep_vf: Relocate counter updates before NAPI
> octeon_ep_vf: avoid compiler and IQ/OQ reordering
>
> Vitaly Lifshits (1):
> e1000e: clear DPG_EN after reset to avoid autonomous power-gating
>
> Vivek Behera (2):
> igb: Fix trigger of incorrect irq in igb_xsk_wakeup
> igc: Fix trigger of incorrect irq in igc_xsk_wakeup function
>
> Waiman Long (2):
> cgroup/cpuset: Fix incorrect change to effective_xcpus in
> partition_xcpus_del()
> cgroup/cpuset: Fix incorrect use of cpuset_update_tasks_cpumask() in
> update_cpumasks_hier()
>
> Wang Tao (1):
> sched/eevdf: Update se->vprot in reweight_entity()
>
> Werner Sembach (1):
> HID: multitouch: Keep latency normal on deactivate for reactivation
> gesture
>
> Will Deacon (2):
> arm64: io: Rename ioremap_prot() to __ioremap_prot()
> arm64: io: Extract user memory type in ioremap_prot()
>
> Yifan Wu (1):
> selftest/arm64: Fix sve2p1_sigill() to hwcap test
>
> Yujie Liu (1):
> drm/sched: Fix kernel-doc warning for drm_sched_job_done()
>
> Yung Chih Su (1):
> net: ipv4: fix ARM64 alignment fault in multipath hash seed
>
> Zhang Heng (2):
> ALSA: hda/realtek: Add quirk for HP Pavilion 15-eh1xxx to enable mute
> LED
> ALSA: hda/realtek: add quirk for Acer Nitro ANV15-51
>
> ZhangGuoDong (2):
> smb/client: fix buffer size for smb311_posix_qinfo in
> smb2_compound_op()
> smb/client: fix buffer size for smb311_posix_qinfo in
> SMB311_posix_query_info()
>
> Zhanjun Dong (1):
> drm/xe/gsc: Fix GSC proxy cleanup on early initialization failure
>
> Zide Chen (1):
> perf/x86/intel/uncore: Add per-scheduler IMC CAS count events
>
> Zilin Guan (1):
> ice: Fix memory leak in ice_set_ringparam()
>
> Documentation/sound/alsa-configuration.rst | 4 +
> Documentation/virt/kvm/api.rst | 28 ++-
> Makefile | 12 +-
> arch/alpha/kernel/vmlinux.lds.S | 1 +
> arch/arc/kernel/vmlinux.lds.S | 1 +
> arch/arm/boot/compressed/vmlinux.lds.S | 1 +
> arch/arm/include/asm/string.h | 14 +-
> arch/arm/kernel/vmlinux-xip.lds.S | 1 +
> arch/arm/kernel/vmlinux.lds.S | 1 +
> arch/arm64/include/asm/io.h | 26 +-
> arch/arm64/include/asm/pgtable-prot.h | 3 -
> arch/arm64/kernel/acpi.c | 2 +-
> arch/arm64/kernel/vmlinux.lds.S | 1 +
> arch/arm64/kvm/hyp/nvhe/pkvm.c | 35 ++-
> arch/arm64/kvm/sys_regs.c | 3 +
> arch/arm64/mm/ioremap.c | 6 +-
> arch/arm64/mm/mmap.c | 8 +-
> arch/arm64/net/bpf_jit_comp.c | 2 +-
> arch/csky/kernel/vmlinux.lds.S | 1 +
> arch/hexagon/kernel/vmlinux.lds.S | 1 +
> arch/loongarch/kernel/vmlinux.lds.S | 1 +
> arch/m68k/kernel/vmlinux-nommu.lds | 1 +
> arch/m68k/kernel/vmlinux-std.lds | 1 +
> arch/m68k/kernel/vmlinux-sun3.lds | 1 +
> arch/mips/kernel/vmlinux.lds.S | 1 +
> arch/nios2/kernel/vmlinux.lds.S | 1 +
> arch/openrisc/kernel/vmlinux.lds.S | 1 +
> arch/parisc/boot/compressed/vmlinux.lds.S | 1 +
> arch/parisc/kernel/vmlinux.lds.S | 1 +
> arch/powerpc/kernel/vmlinux.lds.S | 1 +
> arch/riscv/kernel/vmlinux.lds.S | 1 +
> arch/s390/include/asm/idle.h | 1 +
> arch/s390/kernel/idle.c | 13 +-
> arch/s390/kernel/ipl.c | 2 +-
> arch/s390/kernel/irq.c | 10 +-
> arch/s390/kernel/vmlinux.lds.S | 1 +
> arch/s390/kernel/vtime.c | 18 +-
> arch/sh/kernel/vmlinux.lds.S | 1 +
> arch/sparc/kernel/vmlinux.lds.S | 1 +
> arch/um/kernel/dyn.lds.S | 1 +
> arch/um/kernel/uml.lds.S | 1 +
> arch/x86/boot/compressed/Makefile | 1 +
> arch/x86/boot/compressed/sev.c | 9 +-
> arch/x86/boot/compressed/vmlinux.lds.S | 2 +-
> arch/x86/boot/startup/sev-shared.c | 2 +-
> arch/x86/coco/sev/core.c | 1 +
> arch/x86/entry/entry_fred.c | 5 +-
> arch/x86/events/intel/uncore_snbep.c | 28 ++-
> arch/x86/include/asm/cfi.h | 12 +-
> arch/x86/include/asm/efi.h | 2 +-
> arch/x86/include/asm/kvm_host.h | 7 +
> arch/x86/include/asm/linkage.h | 4 +-
> arch/x86/include/asm/msr-index.h | 5 +-
> arch/x86/include/asm/numa.h | 6 +
> arch/x86/include/asm/topology.h | 6 +
> arch/x86/include/asm/traps.h | 2 +
> arch/x86/include/uapi/asm/kvm.h | 6 +-
> arch/x86/kernel/alternative.c | 29 ++-
> arch/x86/kernel/cpu/common.c | 3 +
> arch/x86/kernel/cpu/topology.c | 13 +-
> arch/x86/kernel/smpboot.c | 201 ++++++++++-----
> arch/x86/kernel/traps.c | 2 +-
> arch/x86/kernel/vmlinux.lds.S | 1 +
> arch/x86/kvm/ioapic.c | 2 +-
> arch/x86/kvm/lapic.c | 76 +++++-
> arch/x86/kvm/lapic.h | 2 +
> arch/x86/kvm/x86.c | 21 +-
> arch/x86/mm/extable.c | 7 +-
> arch/x86/mm/numa.c | 8 +
> arch/x86/mm/srat.c | 2 +
> arch/x86/net/bpf_jit_comp.c | 13 +-
> arch/x86/platform/efi/efi.c | 2 +-
> arch/x86/platform/efi/quirks.c | 55 +++-
> block/blk-sysfs.c | 8 +-
> block/elevator.c | 12 +-
> drivers/accel/amdxdna/aie2_ctx.c | 55 ++--
> drivers/accel/amdxdna/aie2_message.c | 36 ++-
> drivers/accel/amdxdna/aie2_pci.c | 23 +-
> drivers/accel/amdxdna/aie2_pci.h | 1 +
> drivers/accel/amdxdna/aie2_pm.c | 2 +-
> drivers/accel/amdxdna/amdxdna_ctx.c | 51 +++-
> drivers/accel/amdxdna/amdxdna_ctx.h | 3 +
> drivers/accel/amdxdna/amdxdna_gem.c | 38 +--
> drivers/accel/amdxdna/amdxdna_pm.c | 2 +
> drivers/accel/amdxdna/amdxdna_pm.h | 11 +
> drivers/accel/amdxdna/amdxdna_ubuf.c | 6 +-
> drivers/accel/ethosu/ethosu_gem.c | 7 +-
> drivers/accel/ethosu/ethosu_job.c | 26 +-
> drivers/accel/rocket/rocket_core.c | 7 +-
> drivers/accel/rocket/rocket_drv.c | 15 +-
> drivers/ata/libata-eh.c | 3 +-
> drivers/ata/libata-scsi.c | 1 +
> drivers/block/drbd/drbd_actlog.c | 53 ++--
> drivers/block/drbd/drbd_interval.h | 5 +-
> drivers/block/drbd/drbd_req.c | 3 +-
> drivers/block/zloop.c | 31 ++-
> drivers/char/ipmi/ipmi_msghandler.c | 11 +-
> drivers/clk/imx/clk-imx8qxp.c | 24 +-
> drivers/clk/imx/clk-scu.c | 12 +-
> drivers/clk/imx/clk-scu.h | 2 +
> drivers/cpufreq/intel_pstate.c | 10 +-
> drivers/crypto/ccp/sev-dev-tsm.c | 2 +-
> drivers/cxl/core/mbox.c | 11 +-
> drivers/cxl/core/pmem.c | 42 +++-
> drivers/cxl/cxl.h | 7 +
> drivers/cxl/pmem.c | 22 +-
> drivers/firmware/efi/mokvar-table.c | 2 +-
> drivers/gpio/gpiolib-shared.c | 6 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_aca.c | 1 +
> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 17 +-
> drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c | 12 +-
> .../gpu/drm/amd/amdgpu/amdgpu_userq_fence.c | 8 +-
> .../amd/display/amdgpu_dm/amdgpu_dm_color.c | 6 +-
> .../amd/display/amdgpu_dm/amdgpu_dm_colorop.c | 3 +-
> .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 16 +-
> .../amd/display/amdgpu_dm/amdgpu_dm_plane.c | 8 +
> .../gpu/drm/amd/display/dc/core/dc_stream.c | 2 +-
> drivers/gpu/drm/bridge/synopsys/dw-dp.c | 4 +-
> drivers/gpu/drm/drm_client_modeset.c | 3 +-
> drivers/gpu/drm/drm_syncobj.c | 4 +-
> drivers/gpu/drm/imx/ipuv3/parallel-display.c | 4 +-
> drivers/gpu/drm/logicvc/logicvc_drm.c | 4 +-
> drivers/gpu/drm/scheduler/sched_main.c | 1 +
> drivers/gpu/drm/solomon/ssd130x.c | 6 +-
> drivers/gpu/drm/tiny/sharp-memory.c | 4 +-
> drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 4 +-
> drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c | 9 +-
> drivers/gpu/drm/xe/regs/xe_engine_regs.h | 6 +
> drivers/gpu/drm/xe/xe_configfs.c | 1 +
> drivers/gpu/drm/xe/xe_exec_queue.c | 23 +-
> drivers/gpu/drm/xe/xe_gsc_proxy.c | 43 +++-
> drivers/gpu/drm/xe/xe_gsc_types.h | 2 +
> drivers/gpu/drm/xe/xe_gt.c | 66 ++++-
> drivers/gpu/drm/xe/xe_lrc.h | 3 +-
> drivers/gpu/drm/xe/xe_reg_sr.c | 4 +-
> drivers/gpu/drm/xe/xe_ring_ops.c | 9 +
> drivers/hid/hid-cmedia.c | 2 +-
> drivers/hid/hid-creative-sb0540.c | 2 +-
> drivers/hid/hid-multitouch.c | 43 +++-
> drivers/hid/hid-zydacron.c | 2 +-
> drivers/hid/usbhid/hid-pidff.c | 11 +-
> drivers/hwmon/aht10.c | 6 +-
> drivers/hwmon/it87.c | 5 +-
> drivers/hwmon/macsmc-hwmon.c | 53 ++--
> drivers/hwmon/max6639.c | 2 +-
> drivers/i2c/busses/i2c-i801.c | 14 +-
> .../infiniband/hw/ionic/ionic_controlpath.c | 2 +-
> drivers/infiniband/hw/irdma/verbs.c | 2 +-
> drivers/infiniband/hw/mthca/mthca_provider.c | 5 +-
> drivers/irqchip/irq-ls-extirq.c | 6 +-
> drivers/irqchip/irq-sifive-plic.c | 7 +-
> drivers/media/dvb-core/dmxdev.c | 4 +-
> drivers/net/bonding/bond_main.c | 9 +-
> drivers/net/bonding/bond_options.c | 2 +
> drivers/net/can/dummy_can.c | 1 +
> drivers/net/can/spi/mcp251x.c | 15 +-
> drivers/net/can/usb/ems_usb.c | 7 +-
> drivers/net/can/usb/etas_es58x/es58x_core.c | 8 +-
> drivers/net/can/usb/f81604.c | 45 +++-
> drivers/net/can/usb/ucan.c | 2 +-
> drivers/net/dsa/realtek/rtl8365mb.c | 2 +-
> drivers/net/ethernet/amd/xgbe/xgbe-common.h | 2 +-
> drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 10 -
> drivers/net/ethernet/amd/xgbe/xgbe-main.c | 1 -
> drivers/net/ethernet/amd/xgbe/xgbe.h | 3 -
> .../ethernet/freescale/dpaa2/dpaa2-switch.c | 3 +-
> drivers/net/ethernet/freescale/enetc/enetc.c | 2 +-
> drivers/net/ethernet/google/gve/gve_tx_dqo.c | 56 ++---
> drivers/net/ethernet/intel/e1000e/defines.h | 1 +
> drivers/net/ethernet/intel/e1000e/ich8lan.c | 9 +
> drivers/net/ethernet/intel/i40e/i40e_main.c | 41 +--
> drivers/net/ethernet/intel/i40e/i40e_trace.h | 2 +-
> drivers/net/ethernet/intel/i40e/i40e_txrx.c | 5 +-
> drivers/net/ethernet/intel/iavf/iavf_main.c | 17 +-
> drivers/net/ethernet/intel/ice/ice.h | 1 +
> drivers/net/ethernet/intel/ice/ice_base.c | 38 ++-
> drivers/net/ethernet/intel/ice/ice_common.c | 2 +-
> drivers/net/ethernet/intel/ice/ice_ethtool.c | 16 +-
> drivers/net/ethernet/intel/ice/ice_idc.c | 44 +++-
> drivers/net/ethernet/intel/ice/ice_lib.c | 15 +-
> drivers/net/ethernet/intel/ice/ice_main.c | 7 +-
> drivers/net/ethernet/intel/ice/ice_txrx.c | 4 +-
> drivers/net/ethernet/intel/ice/ice_xsk.c | 3 +
> .../net/ethernet/intel/idpf/idpf_ethtool.c | 3 -
> drivers/net/ethernet/intel/idpf/idpf_txrx.c | 8 +-
> drivers/net/ethernet/intel/igb/igb_xsk.c | 38 ++-
> drivers/net/ethernet/intel/igc/igc_main.c | 34 ++-
> drivers/net/ethernet/intel/igc/igc_ptp.c | 3 +-
> drivers/net/ethernet/intel/libie/fwlog.c | 4 +
> .../ethernet/marvell/octeon_ep/octep_main.c | 40 ++-
> .../net/ethernet/marvell/octeon_ep/octep_rx.c | 27 +-
> .../marvell/octeon_ep_vf/octep_vf_main.c | 38 ++-
> .../marvell/octeon_ep_vf/octep_vf_rx.c | 28 ++-
> drivers/net/ethernet/mediatek/mtk_eth_soc.c | 15 +-
> drivers/net/ethernet/stmicro/stmmac/common.h | 1 -
> .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 4 -
> .../ethernet/stmicro/stmmac/dwmac-loongson.c | 7 -
> drivers/net/ethernet/stmicro/stmmac/stmmac.h | 3 +-
> .../net/ethernet/stmicro/stmmac/stmmac_main.c | 89 +++----
> .../ethernet/stmicro/stmmac/stmmac_platform.c | 8 -
> .../net/ethernet/stmicro/stmmac/stmmac_vlan.c | 60 ++---
> drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
> drivers/net/ethernet/ti/cpsw_ale.c | 9 +-
> drivers/net/ethernet/ti/icssg/icssg_prueth.c | 8 +
> drivers/net/phy/phy_device.c | 25 +-
> drivers/net/usb/kalmia.c | 7 +
> drivers/net/usb/kaweth.c | 13 +
> drivers/net/usb/pegasus.c | 13 +-
> drivers/net/vxlan/vxlan_core.c | 5 +
> drivers/net/wireless/marvell/libertas/main.c | 4 +-
> .../wireless/mediatek/mt76/mt76_connac_mac.c | 1 +
> .../net/wireless/mediatek/mt76/mt7925/mac.c | 1 +
> .../net/wireless/mediatek/mt76/mt7996/mac.c | 1 +
> drivers/net/wireless/rsi/rsi_91x_mac80211.c | 2 +-
> drivers/net/wireless/st/cw1200/pm.c | 2 +
> drivers/net/wireless/ti/wlcore/main.c | 4 +-
> drivers/nfc/pn533/usb.c | 1 +
> drivers/nvme/host/core.c | 7 +
> drivers/nvme/host/multipath.c | 12 +-
> drivers/nvme/host/pr.c | 4 +-
> drivers/nvme/target/fcloop.c | 15 +-
> .../pci/controller/dwc/pcie-designware-ep.c | 25 +-
> drivers/pinctrl/cirrus/pinctrl-cs42l43.c | 5 +-
> drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 70 +++++-
> drivers/pinctrl/pinconf-generic.c | 73 +-----
> drivers/pinctrl/pinctrl-equilibrium.c | 31 ++-
> drivers/pinctrl/qcom/pinctrl-qcs615.c | 1 +
> .../platform/x86/dell/alienware-wmi-wmax.c | 2 +-
> drivers/platform/x86/dell/dell-wmi-base.c | 6 +
> .../dell-wmi-sysman/passwordattr-interface.c | 1 -
> .../x86/hp/hp-bioscfg/enum-attributes.c | 9 +-
> drivers/platform/x86/lenovo/thinkpad_acpi.c | 6 +-
> drivers/regulator/bq257xx-regulator.c | 3 +-
> drivers/regulator/fp9931.c | 7 +-
> drivers/regulator/mt6363-regulator.c | 4 +-
> drivers/scsi/lpfc/lpfc_init.c | 2 +
> drivers/scsi/lpfc/lpfc_sli.c | 36 ++-
> drivers/scsi/lpfc/lpfc_sli4.h | 3 +
> drivers/scsi/pm8001/pm8001_sas.c | 5 +-
> drivers/scsi/scsi_scan.c | 1 +
> drivers/spi/spi-stm32.c | 3 +
> drivers/target/target_core_configfs.c | 15 +-
> drivers/ufs/core/ufshcd.c | 38 ++-
> drivers/usb/gadget/function/f_ncm.c | 128 +++++-----
> drivers/usb/gadget/function/u_ether.c | 45 ++++
> drivers/usb/gadget/function/u_ether.h | 30 +++
> .../usb/gadget/function/u_ether_configfs.h | 176 +++++++++++++
> drivers/usb/gadget/function/u_ncm.h | 4 +-
> drivers/xen/xen-acpi-processor.c | 7 +-
> fs/btrfs/delayed-inode.c | 2 +-
> fs/btrfs/disk-io.c | 6 +-
> fs/btrfs/inode.c | 2 +-
> fs/btrfs/ioctl.c | 7 +-
> fs/btrfs/scrub.c | 2 +-
> fs/btrfs/tree-checker.c | 4 +-
> fs/eventpoll.c | 5 +-
> fs/namespace.c | 20 +-
> fs/netfs/direct_write.c | 228 +++++++++++++++--
> fs/netfs/internal.h | 4 +-
> fs/netfs/write_collect.c | 21 --
> fs/netfs/write_issue.c | 41 +--
> fs/nfsd/nfsctl.c | 2 +-
> fs/smb/client/connect.c | 1 -
> fs/smb/client/smb2inode.c | 8 +-
> fs/smb/client/smb2pdu.c | 24 +-
> fs/smb/client/transport.c | 21 +-
> fs/smb/server/Kconfig | 1 +
> fs/smb/server/auth.c | 4 +-
> fs/smb/server/smb2pdu.c | 5 +-
> fs/squashfs/cache.c | 3 +
> fs/xfs/scrub/orphanage.c | 7 +-
> fs/xfs/xfs_notify_failure.c | 4 +-
> include/asm-generic/vmlinux.lds.h | 4 +-
> include/linux/indirect_call_wrapper.h | 18 +-
> include/linux/netdevice.h | 27 +-
> include/linux/pinctrl/pinconf-generic.h | 5 -
> include/linux/ring_buffer.h | 1 +
> include/linux/sched.h | 1 +
> include/linux/stmmac.h | 1 -
> include/linux/tnum.h | 8 +
> include/linux/uaccess.h | 54 ++--
> include/net/bonding.h | 1 +
> include/net/inet6_hashtables.h | 2 +-
> include/net/inet_hashtables.h | 2 +-
> include/net/ip.h | 2 +-
> include/net/ip_fib.h | 2 +-
> include/net/netfilter/nf_tables.h | 11 +-
> include/net/sch_generic.h | 10 +
> include/net/secure_seq.h | 45 +++-
> include/net/tc_act/tc_ife.h | 4 +-
> include/net/tcp.h | 6 +-
> include/net/xdp_sock_drv.h | 16 +-
> include/trace/events/netfs.h | 4 +-
> include/uapi/drm/drm_fourcc.h | 12 +-
> include/uapi/linux/pci_regs.h | 2 +-
> io_uring/cmd_net.c | 2 +-
> kernel/bpf/cpumap.c | 17 +-
> kernel/bpf/devmap.c | 47 +++-
> kernel/bpf/tnum.c | 72 ++++++
> kernel/bpf/trampoline.c | 4 +-
> kernel/bpf/verifier.c | 103 +++++++-
> kernel/cgroup/cpuset.c | 4 +-
> kernel/events/core.c | 83 ++++--
> kernel/module/main.c | 6 -
> kernel/rseq.c | 5 +-
> kernel/sched/ext_internal.h | 2 +-
> kernel/sched/fair.c | 238 +++++++++++++-----
> kernel/sched/sched.h | 4 +-
> kernel/sched/syscalls.c | 30 +++
> kernel/time/jiffies.c | 2 -
> kernel/time/timekeeping.c | 6 +-
> kernel/trace/blktrace.c | 3 +-
> kernel/trace/ring_buffer.c | 21 ++
> kernel/trace/trace.c | 13 +
> kernel/trace/trace_events_trigger.c | 3 +
> lib/Kconfig.debug | 1 +
> lib/debugobjects.c | 19 +-
> mm/huge_memory.c | 3 +
> mm/slub.c | 13 +-
> net/atm/lec.c | 26 +-
> net/bluetooth/hci_sock.c | 1 +
> net/bluetooth/hci_sync.c | 2 +-
> net/bluetooth/iso.c | 1 +
> net/bluetooth/l2cap_sock.c | 1 +
> net/bluetooth/sco.c | 1 +
> net/bridge/br_device.c | 2 +-
> net/bridge/br_input.c | 2 +-
> net/bridge/br_private.h | 10 +
> net/bridge/br_vlan_options.c | 26 +-
> net/can/bcm.c | 1 +
> net/core/dev.c | 7 +-
> net/core/devmem.c | 6 +-
> net/core/filter.c | 6 +-
> net/core/netpoll.c | 2 +-
> net/core/secure_seq.c | 80 +++---
> net/core/skmsg.c | 14 +-
> net/ipv4/inet_hashtables.c | 8 +-
> net/ipv4/syncookies.c | 11 +-
> net/ipv4/sysctl_net_ipv4.c | 5 +-
> net/ipv4/tcp.c | 4 +-
> net/ipv4/tcp_bpf.c | 2 +-
> net/ipv4/tcp_diag.c | 2 +-
> net/ipv4/tcp_input.c | 38 ++-
> net/ipv4/tcp_ipv4.c | 37 ++-
> net/ipv4/tcp_minisocks.c | 2 +-
> net/ipv4/udp.c | 27 +-
> net/ipv4/udp_bpf.c | 2 +-
> net/ipv6/inet6_hashtables.c | 3 +-
> net/ipv6/route.c | 11 +-
> net/ipv6/syncookies.c | 11 +-
> net/ipv6/tcp_ipv6.c | 37 ++-
> net/mac80211/mesh.c | 3 +
> net/mac80211/mlme.c | 3 +
> net/mptcp/pm.c | 55 +++-
> net/mptcp/pm_kernel.c | 9 +
> net/netfilter/nf_tables_api.c | 66 +++--
> net/netfilter/nft_set_hash.c | 1 +
> net/netfilter/nft_set_pipapo.c | 62 ++++-
> net/netfilter/nft_set_pipapo.h | 2 +
> net/netfilter/nft_set_rbtree.c | 79 ++----
> net/nfc/nci/core.c | 30 ++-
> net/nfc/nci/data.c | 12 +-
> net/nfc/rawsock.c | 11 +
> net/rds/tcp.c | 14 +-
> net/sched/act_ife.c | 93 ++++---
> net/sched/sch_ets.c | 12 +-
> net/sched/sch_fq.c | 1 +
> net/unix/af_unix.c | 8 +-
> net/wireless/core.c | 1 +
> net/wireless/radiotap.c | 4 +-
> net/xdp/xsk.c | 26 +-
> rust/kernel/kunit.rs | 8 +
> sound/hda/codecs/realtek/alc269.c | 13 +-
> sound/hda/codecs/side-codecs/cs35l56_hda.c | 2 +-
> sound/hda/controllers/intel.c | 2 +
> sound/soc/sdca/Kconfig | 2 +
> sound/soc/sdca/sdca_functions.c | 5 +-
> sound/soc/sdca/sdca_interrupts.c | 4 +-
> sound/usb/endpoint.c | 9 +-
> sound/usb/mixer_scarlett2.c | 10 +-
> sound/usb/qcom/qc_audio_offload.c | 2 +-
> sound/usb/quirks.c | 3 +-
> sound/usb/stream.c | 3 +
> sound/usb/usbaudio.h | 6 +
> sound/usb/validate.c | 2 +-
> tools/objtool/Makefile | 8 +-
> tools/testing/kunit/kunit_kernel.py | 6 +-
> tools/testing/kunit/kunit_tool_test.py | 26 ++
> tools/testing/selftests/arm64/abi/hwcap.c | 4 +-
> .../testing/selftests/bpf/progs/dmabuf_iter.c | 2 +-
> .../selftests/bpf/progs/exceptions_assert.c | 34 +--
> .../selftests/bpf/progs/verifier_scalar_ids.c | 56 +++--
> .../testing/selftests/bpf/verifier/precise.c | 8 +-
> tools/testing/selftests/kselftest_harness.h | 7 +-
> .../testing/selftests/net/mptcp/mptcp_join.sh | 49 ++++
> .../selftests/net/mptcp/simult_flows.sh | 11 +-
> 396 files changed, 4121 insertions(+), 1792 deletions(-)
>
> --
> 2.51.0
>
>
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-11 1:06 ` Sasha Levin
@ 2026-03-11 16:47 ` Florian Fainelli
2026-03-11 23:18 ` Sasha Levin
0 siblings, 1 reply; 330+ messages in thread
From: Florian Fainelli @ 2026-03-11 16:47 UTC (permalink / raw)
To: Sasha Levin
Cc: linux-kernel, stable, gregkh, patches, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
On 3/10/2026 6:06 PM, Sasha Levin wrote:
> On Tue, Mar 10, 2026 at 12:09:32PM -0700, Florian Fainelli wrote:
>> On 3/10/26 04:05, Sasha Levin wrote:
>>>
>>> This is the start of the stable review cycle for the 6.19.7 release.
>>> There are 311 patches in this series, all will be posted as a response
>>> to this one. If anyone has any issues with these being applied, please
>>> let me know.
>>>
>>> Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
>>> Anything received after that time might be too late.
>>>
>>> The whole patch series can be found in one patch at:
>>> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-
>>> stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
>>> or in the git tree and branch at:
>>> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-
>>> stable-rc.git linux-6.19.y
>>> and the diffstat can be found below.
>>>
>>> Thanks,
>>> Sasha
>>>
>>> -------------
>> perf fails to build the pmu-events for all of the freescale SoCs, I am
>> not sure yet whether this is a build environment issue or a genuine
>> perf build system failure:
>
> Could you try building with a revert of b56111d7a464 ("perf jevents: Handle
> deleted JSONS in out of source builds") please?
>
Yes that does resolve it, thanks!
--
Florian
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (321 preceding siblings ...)
2026-03-11 13:39 ` Luna Jernberg
@ 2026-03-11 20:56 ` Shuah Khan
2026-03-11 21:11 ` Barry K. Nathan
2026-03-12 9:05 ` Miguel Ojeda
324 siblings, 0 replies; 330+ messages in thread
From: Shuah Khan @ 2026-03-11 20:56 UTC (permalink / raw)
To: Sasha Levin, linux-kernel, stable
Cc: gregkh, patches, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr, Shuah Khan
On 3/10/26 05:05, Sasha Levin wrote:
>
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
> and the diffstat can be found below.
>
> Thanks,
> Sasha
>
Compiled and booted on my test system. No dmesg regressions.
Tested-by: Shuah Khan <skhan@linuxfoundation.org>
thanks,
-- Shuah
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (322 preceding siblings ...)
2026-03-11 20:56 ` Shuah Khan
@ 2026-03-11 21:11 ` Barry K. Nathan
2026-03-12 9:05 ` Miguel Ojeda
324 siblings, 0 replies; 330+ messages in thread
From: Barry K. Nathan @ 2026-03-11 21:11 UTC (permalink / raw)
To: Sasha Levin, linux-kernel, stable
Cc: gregkh, patches, torvalds, akpm, linux, shuah, patches,
lkft-triage, pavel, jonathanh, f.fainelli, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
On 3/10/26 04:05, Sasha Levin wrote:
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
> Anything received after that time might be too late.
>
> The whole patch series can be found in one patch at:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.19.y
> and the diffstat can be found below.
>
> Thanks,
> Sasha
Tested on my amd64 DIY home NAS. Working well, no regressions observed.
Tested-by: Barry K. Nathan <barryn@pobox.com>
--
-Barry K. Nathan <barryn@pobox.com>
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-11 16:47 ` Florian Fainelli
@ 2026-03-11 23:18 ` Sasha Levin
0 siblings, 0 replies; 330+ messages in thread
From: Sasha Levin @ 2026-03-11 23:18 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-kernel, stable, gregkh, patches, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, sudipm.mukherjee,
rwarsow, conor, hargar, broonie, achill, sr
On Wed, Mar 11, 2026 at 09:47:16AM -0700, Florian Fainelli wrote:
>
>
>On 3/10/2026 6:06 PM, Sasha Levin wrote:
>>On Tue, Mar 10, 2026 at 12:09:32PM -0700, Florian Fainelli wrote:
>>>On 3/10/26 04:05, Sasha Levin wrote:
>>>>
>>>>This is the start of the stable review cycle for the 6.19.7 release.
>>>>There are 311 patches in this series, all will be posted as a response
>>>>to this one. If anyone has any issues with these being applied, please
>>>>let me know.
>>>>
>>>>Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
>>>>Anything received after that time might be too late.
>>>>
>>>>The whole patch series can be found in one patch at:
>>>>
>>>>https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-
>>>>stable-rc.git/rawdiff/?id=linux-6.19.y&id2=v6.19.6
>>>>or in the git tree and branch at:
>>>>
>>>>git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-
>>>>stable-rc.git linux-6.19.y
>>>>and the diffstat can be found below.
>>>>
>>>>Thanks,
>>>>Sasha
>>>>
>>>>-------------
>>>perf fails to build the pmu-events for all of the freescale SoCs,
>>>I am not sure yet whether this is a build environment issue or a
>>>genuine perf build system failure:
>>
>>Could you try building with a revert of b56111d7a464 ("perf jevents: Handle
>>deleted JSONS in out of source builds") please?
>>
>
>Yes that does resolve it, thanks!
Awesome! Looking at the patch, it looks like it's a backport regression and
upstream should work just fine?
Assuming it's the case, I can revert this commit after the current release
cycle.
--
Thanks,
Sasha
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 000/311] 6.19.7-rc1 review
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
` (323 preceding siblings ...)
2026-03-11 21:11 ` Barry K. Nathan
@ 2026-03-12 9:05 ` Miguel Ojeda
324 siblings, 0 replies; 330+ messages in thread
From: Miguel Ojeda @ 2026-03-12 9:05 UTC (permalink / raw)
To: sashal
Cc: achill, akpm, broonie, conor, f.fainelli, gregkh, hargar,
jonathanh, linux-kernel, linux, lkft-triage, patches, patches,
pavel, rwarsow, shuah, sr, stable, sudipm.mukherjee, torvalds,
Miguel Ojeda
On Tue, 10 Mar 2026 07:05:54 -0400 Sasha Levin <sashal@kernel.org> wrote:
>
> This is the start of the stable review cycle for the 6.19.7 release.
> There are 311 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Thu Mar 12 11:04:16 AM UTC 2026.
> Anything received after that time might be too late.
Boot-tested under QEMU for Rust x86_64, arm64 and riscv64; built-tested
for loongarch64:
Tested-by: Miguel Ojeda <ojeda@kernel.org>
Thanks!
Cheers,
Miguel
^ permalink raw reply [flat|nested] 330+ messages in thread
* Re: [PATCH 6.19 017/311] ALSA: usb-audio: Remove VALIDATE_RATES quirk for Focusrite devices
2026-03-10 11:01 ` [PATCH 6.19 017/311] ALSA: usb-audio: Remove VALIDATE_RATES quirk for Focusrite devices Sasha Levin
@ 2026-03-15 18:54 ` Geoffrey D. Bennett
0 siblings, 0 replies; 330+ messages in thread
From: Geoffrey D. Bennett @ 2026-03-15 18:54 UTC (permalink / raw)
To: Sasha Levin; +Cc: patches, stable, Takashi Iwai, Greg Kroah-Hartman
On Tue, Mar 10, 2026 at 07:01:04AM -0400, Sasha Levin wrote:
> From: "Geoffrey D. Bennett" <g@b4.vu>
>
> [ Upstream commit a8cc55bf81a45772cad44c83ea7bb0e98431094a ]
>
> Remove QUIRK_FLAG_VALIDATE_RATES for Focusrite. With the previous
> commit, focusrite_valid_sample_rate() produces correct rate tables
> without USB probing.
[...]
Hi Sasha, Greg,
This commit depends on its predecessor 24d2d3c5f940 ("ALSA: usb-audio:
Improve Focusrite sample rate filtering") which was not picked up for
stable because it didn't have a Fixes tag.
Without the rate filtering patch, the Focusrite Scarlett 18i8 3rd Gen
gets all sample rates advertised on every altsetting instead of the
correct per-altsetting subset. I've confirmed this on 6.19.7.
Could 24d2d3c5f940 be queued for stable please?
Thanks,
Geoffrey.
^ permalink raw reply [flat|nested] 330+ messages in thread
end of thread, other threads:[~2026-03-15 19:00 UTC | newest]
Thread overview: 330+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 11:05 [PATCH 6.19 000/311] 6.19.7-rc1 review Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 001/311] perf/core: Fix refcount bug and potential UAF in perf_mmap Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 002/311] drm/vmwgfx: Fix invalid kref_put callback in vmw_bo_dirty_release Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 003/311] drm/vmwgfx: Return the correct value in vmw_translate_ptr functions Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 004/311] debugobject: Make it work with deferred page initialization - again Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 005/311] drm/logicvc: Fix device node reference leak in logicvc_drm_config_parse() Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 006/311] KVM: arm64: Hide S1POE from guests when not supported by the host Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 007/311] KVM: arm64: Fix ID register initialization for non-protected pKVM guests Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 008/311] drm/fourcc: fix plane order for 10/12/16-bit YCbCr formats Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 009/311] drm/tiny: sharp-memory: fix pointer error dereference Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 010/311] irqchip/sifive-plic: Fix frozen interrupt due to affinity setting Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 011/311] scsi: lpfc: Properly set WC for DPP mapping Sasha Levin
2026-03-10 11:00 ` [PATCH 6.19 012/311] scsi: pm8001: Fix use-after-free in pm8001_queue_command() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 013/311] accel: ethosu: Fix shift overflow in cmd_to_addr() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 014/311] drm/imx: parallel-display: check return value of devm_drm_bridge_add() in imx_pd_probe() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 015/311] drm/bridge: synopsys: dw-dp: Check return value of devm_drm_bridge_add() in dw_dp_bind() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 016/311] ALSA: scarlett2: Fix DSP filter control array handling Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 017/311] ALSA: usb-audio: Remove VALIDATE_RATES quirk for Focusrite devices Sasha Levin
2026-03-15 18:54 ` Geoffrey D. Bennett
2026-03-10 11:01 ` [PATCH 6.19 018/311] ALSA: usb-audio: Add QUIRK_FLAG_SKIP_IFACE_SETUP Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 019/311] gpio: shared: fix memory leaks Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 020/311] x86/fred: Correct speculative safety in fred_extint() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 021/311] x86/bug: Handle __WARN_printf() trap in early_fixup_exception() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 022/311] x86/cfi: Fix CFI rewrite for odd alignments Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 023/311] sched/fair: Rename cfs_rq::avg_load to cfs_rq::sum_weight Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 024/311] sched/fair: Rename cfs_rq::avg_vruntime to ::sum_w_vruntime, and helper functions Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 025/311] sched/fair: Introduce and use the vruntime_cmp() and vruntime_op() wrappers for wrapped-signed aritmetics Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 026/311] sched/fair: Fix zero_vruntime tracking Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 027/311] sched/fair: Only set slice protection at pick time Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 028/311] sched/eevdf: Update se->vprot in reweight_entity() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 029/311] sched/fair: Fix lag clamp Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 030/311] rseq: Clarify rseq registration rseq_size bound check comment Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 031/311] perf/core: Fix invalid wait context in ctx_sched_in() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 032/311] accel/amdxdna: Remove buffer size check when creating command BO Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 033/311] accel/amdxdna: Switch to always use chained command Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 034/311] accel/amdxdna: Fix crash when destroying a suspended hardware context Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 035/311] accel/amdxdna: Reduce log noise during process termination Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 036/311] accel/amdxdna: Fix dead lock for suspend and resume Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 037/311] accel/amdxdna: Fix suspend failure after enabling turbo mode Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 038/311] accel/amdxdna: Fix command hang on suspended hardware context Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 039/311] accel/amdxdna: Fix out-of-bounds memset in command slot handling Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 040/311] accel/amdxdna: Prevent ubuf size overflow Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 041/311] accel/amdxdna: Validate command buffer payload count Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 042/311] drm/xe/wa: Steer RMW of MCR registers while building default LRC Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 043/311] cgroup/cpuset: Fix incorrect change to effective_xcpus in partition_xcpus_del() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 044/311] cgroup/cpuset: Fix incorrect use of cpuset_update_tasks_cpumask() in update_cpumasks_hier() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 045/311] clk: scu/imx8qxp: do not register driver in probe() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 046/311] cxl: Move devm_cxl_add_nvdimm_bridge() to cxl_pmem.ko Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 047/311] cxl: Fix race of nvdimm_bus object when creating nvdimm objects Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 048/311] cxl/mbox: validate payload size before accessing contents in cxl_payload_from_user_allowed() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 049/311] scsi: ufs: core: Move link recovery for hibern8 exit failure to wl_resume Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 050/311] regulator: fp9931: Fix PM runtime reference leak in fp9931_hwmon_read() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 051/311] regulator: bq257xx: Fix device node reference leak in bq257xx_reg_dt_parse_gpio() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 052/311] irqchip/ls-extirq: Fix devm_of_iomap() error check Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 053/311] io_uring/cmd_net: use READ_ONCE() for ->addr3 read Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 054/311] zloop: advertise a volatile write cache Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 055/311] zloop: check for spurious options passed to remove Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 056/311] drm/client: Do not destroy NULL modes Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 057/311] ALSA: usb-audio: Cap the packet size pre-calculations Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 058/311] ALSA: usb-audio: Use inclusive terms Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 059/311] perf: Fix __perf_event_overflow() vs perf_remove_from_context() race Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 060/311] s390/idle: Fix cpu idle exit cpu time accounting Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 061/311] s390/vtime: Fix virtual timer forwarding Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 062/311] s390/kexec: Disable stack protector in s390_reset_system() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 063/311] arm64: io: Rename ioremap_prot() to __ioremap_prot() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 064/311] arm64: io: Extract user memory type in ioremap_prot() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 065/311] PCI: dwc: ep: Refresh MSI Message Address cache on change Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 066/311] PCI: dwc: ep: Flush MSI-X write before unmapping its ATU entry Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 067/311] drm/amdgpu/userq: Do not allow userspace to trivially triger kernel warnings Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 068/311] drm/amdgpu: Unlock a mutex before destroying it Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 069/311] drm/amdgpu: Fix locking bugs in error paths Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 070/311] drm/amdgpu: Fix error handling in slot reset Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 071/311] ALSA: hda: cs35l56: Fix signedness error in cs35l56_hda_posture_put() Sasha Levin
2026-03-10 11:01 ` [PATCH 6.19 072/311] btrfs: free pages on error in btrfs_uring_read_extent() Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 073/311] btrfs: fix error message order of parameters in btrfs_delete_delayed_dir_index() Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 074/311] btrfs: fix incorrect key offset in error message in check_dev_extent_item() Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 075/311] btrfs: fix objectid value in error message in check_extent_data_ref() Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 076/311] btrfs: fix warning in scrub_verify_one_metadata() Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 077/311] btrfs: print correct subvol num if active swapfile prevents deletion Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 078/311] btrfs: fix compat mask in error messages in btrfs_check_features() Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 079/311] ALSA: usb: qcom: Correct parameter comment for uaudio_transfer_buffer_setup() Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 080/311] mm/slab: pass __GFP_NOWARN to refill_sheaf() if fallback is available Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 081/311] ASoC: SDCA: Fix comments for sdca_irq_request() Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 082/311] bpf, arm64: Force 8-byte alignment for JIT buffer to prevent atomic tearing Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 083/311] bpf: Fix stack-out-of-bounds write in devmap Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 084/311] selftests/bpf: Fix OOB read in dmabuf_collector Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 085/311] sched_ext: Fix SCX_EFLAG_INITIALIZED being a no-op flag Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 086/311] spi: stm32: fix missing pointer assignment in case of dma chaining Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 087/311] PCI: Correct PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 value Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 088/311] bpf: Fix race in cpumap on PREEMPT_RT Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 089/311] bpf: Fix race in devmap " Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 090/311] bpf: Add bitwise tracking for BPF_END Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 091/311] bpf: Introduce tnum_step to step through tnum's members Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 092/311] bpf: Improve bounds when tnum has a single possible value Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 093/311] uaccess: Fix scoped_user_read_access() for 'pointer to const' Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 094/311] usb: gadget: u_ether: add gether_opts for config caching Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 095/311] usb: gadget: u_ether: Add auto-cleanup helper for freeing net_device Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 096/311] usb: gadget: f_ncm: align net_device lifecycle with bind/unbind Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 097/311] accel/rocket: fix unwinding in error path in rocket_core_init Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 098/311] accel/rocket: fix unwinding in error path in rocket_probe Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 099/311] KVM: x86: Add x2APIC "features" to control EOI broadcast suppression Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 100/311] eventpoll: Fix integer overflow in ep_loop_check_proc() Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 101/311] namespace: fix proc mount iteration Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 102/311] media: dvb-core: fix wrong reinitialization of ringbuffer on reopen Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 103/311] nfc: pn533: properly drop the usb interface reference on disconnect Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 104/311] net: usb: kaweth: validate USB endpoints Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 105/311] net: usb: kalmia: " Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 106/311] net: usb: pegasus: " Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 107/311] can: ems_usb: ems_usb_read_bulk_callback(): check the proper length of a message Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 108/311] can: usb: f81604: correctly anchor the urb in the read bulk callback Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 109/311] can: ucan: Fix infinite loop from zero-length messages Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 110/311] can: usb: etas_es58x: correctly anchor the urb in the read bulk callback Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 111/311] can: usb: f81604: handle short interrupt urb messages properly Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 112/311] can: usb: f81604: handle bulk write errors properly Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 113/311] HID: Add HID_CLAIMED_INPUT guards in raw_event callbacks missing them Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 114/311] HID: pidff: Fix condition effect bit clearing Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 115/311] HID: multitouch: Keep latency normal on deactivate for reactivation gesture Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 116/311] x86/efi: defer freeing of boot services memory Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 117/311] perf/x86/intel/uncore: Add per-scheduler IMC CAS count events Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 118/311] x86/boot: Handle relative CONFIG_EFI_SBAT_FILE file paths Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 119/311] x86/sev: Allow IBPB-on-Entry feature for SNP guests Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 120/311] x86/boot/sev: Move SEV decompressor variables into the .data section Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 121/311] platform/x86: dell-wmi-sysman: Don't hex dump plaintext password data Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 122/311] platform/x86: alienware-wmi-wmax: Add G-Mode support to m18 laptops Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 123/311] platform/x86: dell-wmi: Add audio/mic mute key codes Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 124/311] ALSA: hda/realtek: Add quirk for HP Pavilion 15-eh1xxx to enable mute LED Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 125/311] ALSA: doc: usb-audio: Add doc for QUIRK_FLAG_SKIP_IFACE_SETUP Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 126/311] ALSA: usb-audio: Use correct version for UAC3 header validation Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 127/311] ALSA: hda/intel: increase default bdl_pos_adj for Nvidia controllers Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 128/311] ALSA: hda/realtek: fix model name typo for Samsung Galaxy Book Flex (NT950QCG-X716) Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 129/311] ALSA: hda/realtek: Add quirk for Acer Aspire V3-572G Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 130/311] ALSA: hda/realtek: add quirk for Samsung Galaxy Book Flex (NT950QCT-A38A) Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 131/311] ALSA: hda/realtek: add quirk for Acer Nitro ANV15-51 Sasha Levin
2026-03-10 11:02 ` [PATCH 6.19 132/311] wifi: radiotap: reject radiotap with unknown bits Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 133/311] wifi: libertas: fix use-after-free in lbs_free_adapter() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 134/311] wifi: cfg80211: cancel rfkill_block work in wiphy_unregister() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 135/311] wifi: mac80211: bounds-check link_id in ieee80211_ml_reconfiguration Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 136/311] wifi: mac80211: fix NULL pointer dereference in mesh_rx_csa_frame() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 137/311] Bluetooth: purge error queues in socket destructors Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 138/311] gve: fix incorrect buffer cleanup in gve_tx_clean_pending_packets for QPL Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 139/311] net: phy: register phy led_triggers during probe to avoid AB-BA deadlock Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 140/311] IB/mthca: Add missed mthca_unmap_user_db() for mthca_create_srq() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 141/311] RDMA/irdma: Fix kernel stack leak in irdma_create_user_ah() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 142/311] RDMA/ionic: Fix kernel stack leak in ionic_create_cq() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 143/311] ksmbd: Compare MACs in constant time Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 144/311] cpufreq: intel_pstate: Fix crash during turbo disable Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 145/311] arm64: gcs: Do not set PTE_SHARED on GCS mappings if FEAT_LPA2 is enabled Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 146/311] net/sched: ets: fix divide by zero in the offload path Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 147/311] nfsd: Fix cred ref leak in nfsd_nl_threads_set_doit() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 148/311] tracing: Fix WARN_ON in tracing_buffers_mmap_close Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 149/311] scsi: target: Fix recursive locking in __configfs_open_file() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 150/311] mm: thp: deny THP for files on anonymous inodes Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 151/311] Squashfs: check metadata block offset is within range Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 152/311] drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 153/311] drbd: fix null-pointer dereference on local read error Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 154/311] xfs: fix xfs_group release bug in xfs_dax_notify_dev_failure Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 155/311] xfs: Fix error pointer dereference Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 156/311] smb: client: fix cifs_pick_channel when channels are equally loaded Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 157/311] smb: client: fix broken multichannel with krb5+signing Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 158/311] smb: client: Don't log plaintext credentials in cifs_set_cifscreds Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 159/311] smb: client: fix oops due to uninitialised var in smb2_unlink() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 160/311] scsi: core: Fix refcount leak for tagset_refcnt Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 161/311] scsi: ufs: core: Fix RPMB region size detection for UFS 2.2 Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 162/311] mptcp: pm: avoid sending RM_ADDR over same subflow Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 163/311] mptcp: pm: in-kernel: always mark signal+subflow endp as used Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 164/311] selftests: mptcp: more stable simult_flows tests Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 165/311] selftests: mptcp: join: check RM_ADDR not sent over same subflow Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 166/311] selftests: mptcp: join: check removing signal+subflow endp Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 167/311] kbuild: Split .modinfo out from ELF_DETAILS Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 168/311] kbuild: Leave objtool binary around with 'make clean' Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 169/311] ASoC: sdca: Fix missing regmap dependencies in Kconfig Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 170/311] Revert "netfilter: nft_set_rbtree: validate open interval overlap" Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 171/311] ARM: clean up the memset64() C wrapper Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 172/311] platform/x86: hp-bioscfg: Support allocations of larger data Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 173/311] Bluetooth: Fix CIS host feature condition Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 174/311] ipmi: Fix use-after-free and list corruption on sender error Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 175/311] net: stmmac: remove support for lpi_intr_o Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 176/311] drm/amd/display: Use GFP_ATOMIC in dc_create_stream_for_sink Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 177/311] nvme: fix admin queue leak on controller reset Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 178/311] hwmon: (macsmc) Fix regressions in Apple Silicon SMC hwmon driver Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 179/311] hwmon: (macsmc) Fix overflows, underflows, and sign extension Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 180/311] hwmon: (aht10) Fix initialization commands for AHT20 Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 181/311] pinctrl: equilibrium: rename irq_chip function callbacks Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 182/311] pinctrl: equilibrium: fix warning trace on load Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 183/311] pinctrl: qcom: qcs615: Add missing dual edge GPIO IRQ errata flag Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 184/311] platform/x86: thinkpad_acpi: Fix errors reading battery thresholds Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 185/311] module: Remove duplicate freeing of lockdep classes Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 186/311] HID: multitouch: new class MT_CLS_EGALAX_P80H84 Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 187/311] pinctrl: pinconf-generic: Fix memory leak in pinconf_generic_parse_dt_config() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 188/311] pinctrl: generic: move function to amlogic-am4 driver Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 189/311] pinctrl: meson: amlogic-a4: Fix device node reference leak in aml_dt_node_to_map_pinmux() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 190/311] pinctrl: cirrus: cs42l43: Fix double-put in cs42l43_pin_probe() Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 191/311] hwmon: (it87) Check the it87_lock() return value Sasha Levin
2026-03-10 11:03 ` [PATCH 6.19 192/311] idpf: increment completion queue next_to_clean in sw marker wait routine Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 193/311] idpf: change IRQ naming to match netdev and ethtool queue numbering Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 194/311] idpf: Fix flow rule delete failure due to invalid validation Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 195/311] ice: recap the VSI and QoS info after rebuild Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 196/311] ice: fix crash in ethtool offline loopback test Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 197/311] i40e: Fix preempt count leak in napi poll tracepoint Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 198/311] e1000e: clear DPG_EN after reset to avoid autonomous power-gating Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 199/311] drm/solomon: Fix page start when updating rectangle in page addressing mode Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 200/311] netfs: Fix unbuffered/DIO writes to dispatch subrequests in strict sequence Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 201/311] nvmet-fcloop: Check remoteport port_state before calling done callback Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 202/311] net: annotate data-races around sk->sk_{data_ready,write_space} Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 203/311] bridge: Check relevant per-VLAN options in VLAN range grouping Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 204/311] net: ethernet: ti: am65-cpsw-nuss/cpsw-ale: Fix multicast entry handling in ALE table Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 205/311] nvme-multipath: fix leak on try_module_get failure Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 206/311] inet: annotate data-races around isk->inet_num Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 207/311] crypto: ccp - Fix use-after-free on error path Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 208/311] accel/amdxdna: Fill invalid payload for failed command Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 209/311] udp: Unhash auto-bound connected sk from 4-tuple hash table when disconnected Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 210/311] tcp: give up on stronger sk_rcvbuf checks (for now) Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 211/311] xsk: Fix fragment node deletion to prevent buffer leak Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 212/311] xsk: Fix zero-copy AF_XDP fragment drop Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 213/311] dpaa2-switch: Fix interrupt storm after receiving bad if_id in IRQ handler Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 214/311] atm: lec: fix null-ptr-deref in lec_arp_clear_vccs Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 215/311] net: ti: icssg-prueth: Fix ping failure after offload mode setup when link speed is not 1G Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 216/311] amd-xgbe: fix MAC_TCR_SS register width for 2.5G and 10M speeds Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 217/311] regulator: mt6363: Fix incorrect and redundant IRQ disposal in probe Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 218/311] can: bcm: fix locking for bcm_op runtime updates Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 219/311] can: dummy_can: dummy_can_init(): fix packet statistics Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 220/311] can: mcp251x: fix deadlock in error path of mcp251x_open Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 221/311] wifi: rsi: Don't default to -EOPNOTSUPP in rsi_mac80211_config Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 222/311] drm/syncobj: Fix handle <-> fd ioctls with dirty stack Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 223/311] drm/xe: Do not preempt fence signaling CS instructions Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 224/311] drm/xe/configfs: Free ctx_restore_mid_bb in release Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 225/311] drm/xe/queue: Call fini on exec queue creation fail Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 226/311] blktrace: fix __this_cpu_read/write in preemptible context Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 227/311] rust: kunit: fix warning when !CONFIG_PRINTK Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 228/311] kunit: tool: copy caller args in run_kernel to prevent mutation Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 229/311] accel/amdxdna: Fix NULL pointer dereference of mgmt_chann Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 230/311] drm/amd/display: Use mpc.preblend flag to indicate 3D LUT Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 231/311] drm/amd/display: Enable DEGAMMA and reject COLOR_PIPELINE+DEGAMMA_LUT Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 232/311] net: dsa: realtek: rtl8365mb: fix rtl8365mb_phy_ocp_write return value Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 233/311] bpf/bonding: reject vlan+srcmac xmit_hash_policy change when XDP is loaded Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 234/311] octeon_ep: Relocate counter updates before NAPI Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 235/311] octeon_ep: avoid compiler and IQ/OQ reordering Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 236/311] octeon_ep_vf: Relocate counter updates before NAPI Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 237/311] octeon_ep_vf: avoid compiler and IQ/OQ reordering Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 238/311] wifi: cw1200: Fix locking in error paths Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 239/311] wifi: wlcore: Fix a locking bug Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 240/311] wifi: mt76: mt7996: Fix possible oob access in mt7996_mac_write_txwi_80211() Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 241/311] wifi: mt76: mt7925: Fix possible oob access in mt7925_mac_write_txwi_80211() Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 242/311] wifi: mt76: Fix possible oob access in mt76_connac2_mac_write_txwi_80211() Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 243/311] indirect_call_wrapper: do not reevaluate function pointer Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 244/311] net/rds: Fix circular locking dependency in rds_tcp_tune Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 245/311] xen/acpi-processor: fix _CST detection using undersized evaluation buffer Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 246/311] ASoC: SDCA: Add allocation failure check for Entity name Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 247/311] ice: fix adding AQ LLDP filter for VF Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 248/311] ice: Fix memory leak in ice_set_ringparam() Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 249/311] libie: don't unroll if fwlog isn't supported Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 250/311] iavf: fix netdev->max_mtu to respect actual hardware limit Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 251/311] igb: Fix trigger of incorrect irq in igb_xsk_wakeup Sasha Levin
2026-03-10 11:04 ` [PATCH 6.19 252/311] igc: Fix trigger of incorrect irq in igc_xsk_wakeup function Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 253/311] bpf: Fix a UAF issue in bpf_trampoline_link_cgroup_shim Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 254/311] smb/client: fix buffer size for smb311_posix_qinfo in smb2_compound_op() Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 255/311] smb/client: fix buffer size for smb311_posix_qinfo in SMB311_posix_query_info() Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 256/311] ipv6: fix NULL pointer deref in ip6_rt_get_dev_rcu() Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 257/311] net: ipv4: fix ARM64 alignment fault in multipath hash seed Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 258/311] amd-xgbe: fix sleep while atomic on suspend/resume Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 259/311] drm/sched: Fix kernel-doc warning for drm_sched_job_done() Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 260/311] ata: libata: cancel pending work after clearing deferred_qc Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 261/311] i2c: i801: Revert "i2c: i801: replace acpi_lock with I2C bus lock" Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 262/311] time/jiffies: Fix sysctl file error on configurations where USER_HZ < HZ Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 263/311] drm/xe/gsc: Fix GSC proxy cleanup on early initialization failure Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 264/311] drm/xe/reg_sr: Fix leak on xa_store failure Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 265/311] nvme: fix memory allocation in nvme_pr_read_keys() Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 266/311] x86/numa: Store extra copy of numa_nodes_parsed Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 267/311] x86/topo: Add topology_num_nodes_per_package() Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 268/311] x86/topo: Replace x86_has_numa_in_package Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 269/311] x86/topo: Fix SNC topology mess Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 270/311] sched/deadline: Fix missing ENQUEUE_REPLENISH during PI de-boosting Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 271/311] timekeeping: Fix timex status validation for auxiliary clocks Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 272/311] hwmon: (max6639) fix inverted polarity Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 273/311] net: sched: avoid qdisc_reset_all_tx_gt() vs dequeue race for lockless qdiscs Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 274/311] tcp: secure_seq: add back ports to TS offset Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 275/311] net: nfc: nci: Fix zero-length proprietary notifications Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 276/311] net_sched: sch_fq: clear q->band_pkt_count[] in fq_reset() Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 277/311] net: devmem: use READ_ONCE/WRITE_ONCE on binding->dev Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 278/311] nfc: nci: free skb on nci_transceive early error paths Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 279/311] nfc: nci: complete pending data exchange on device close Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 280/311] nfc: nci: clear NCI_DATA_EXCHANGE before calling completion callback Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 281/311] nfc: rawsock: cancel tx_work before socket teardown Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 282/311] net: stmmac: Fix error handling in VLAN add and delete paths Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 283/311] net: stmmac: Improve double VLAN handling Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 284/311] net: stmmac: Fix VLAN HW state restore Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 285/311] net: stmmac: Defer VLAN HW configuration when interface is down Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 286/311] block: use trylock to avoid lockdep circular dependency in sysfs Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 287/311] net: Provide a PREEMPT_RT specific check for netdev_queue::_xmit_lock Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 288/311] netfilter: nf_tables: unconditionally bump set->nelems before insertion Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 289/311] netfilter: nf_tables: clone set on flush only Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 290/311] netfilter: nft_set_pipapo: split gc into unlink and reclaim phase Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 291/311] net: ethernet: mtk_eth_soc: Reset prog ptr to old_prog in case of error in mtk_xdp_setup() Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 292/311] selftests/harness: order TEST_F and XFAIL_ADD constructors Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 293/311] net: bridge: fix nd_tbl NULL dereference when IPv6 is disabled Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 294/311] net: vxlan: " Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 295/311] net: ipv6: fix panic when IPv4 route references loopback IPv6 nexthop Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 296/311] net/sched: act_ife: Fix metalist update behavior Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 297/311] xdp: use modulo operation to calculate XDP frag tailroom Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 298/311] xsk: introduce helper to determine rxq->frag_size Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 299/311] ice: fix rxq info registering in mbuf packets Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 300/311] ice: change XDP RxQ frag_size from DMA write length to xdp.frame_sz Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 301/311] i40e: fix registering XDP RxQ info Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 302/311] i40e: use xdp.frame_sz as XDP RxQ info frag_size Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 303/311] net: enetc: use truesize " Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 304/311] xdp: produce a warning when calculated tailroom is negative Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 305/311] accel: ethosu: Fix job submit error clean-up refcount underflows Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 306/311] accel: ethosu: Fix NPU_OP_ELEMENTWISE validation with scalar Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 307/311] ata: libata-eh: Fix detection of deferred qc timeouts Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 308/311] selftest/arm64: Fix sve2p1_sigill() to hwcap test Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 309/311] tracing: Add NULL pointer check to trigger_data_free() Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 310/311] bpf: collect only live registers in linked regs Sasha Levin
2026-03-10 11:05 ` [PATCH 6.19 311/311] Linux 6.19.7-rc1 Sasha Levin
2026-03-10 12:47 ` [PATCH 6.19 000/311] 6.19.7-rc1 review Brett A C Sheffield
2026-03-10 14:15 ` Ronald Warsow
2026-03-10 14:22 ` Jon Hunter
2026-03-10 15:47 ` Dileep malepu
2026-03-10 15:52 ` Mark Brown
2026-03-10 18:55 ` Justin Forbes
2026-03-10 19:09 ` Florian Fainelli
2026-03-11 1:06 ` Sasha Levin
2026-03-11 16:47 ` Florian Fainelli
2026-03-11 23:18 ` Sasha Levin
2026-03-10 23:20 ` Ron Economos
2026-03-11 1:15 ` Peter Schneider
2026-03-11 2:46 ` Takeshi Ogasawara
2026-03-11 13:39 ` Luna Jernberg
2026-03-11 20:56 ` Shuah Khan
2026-03-11 21:11 ` Barry K. Nathan
2026-03-12 9:05 ` Miguel Ojeda
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox