Skip to contentSkip to conversation

6.18.61-rc1 review

PATCH Applied Greg Kroah-Hartman 16 participants 1,033 messages Nov 4 – Nov 23 Page 9 of 9

Subsystems (2)
lore
Share & tools
lore
author maintainer
#933 lore raw

PATCH 927/1005 KVM: Use goto to handle errors during memslot preparation

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sean Christopherson <[email protected]>

commit 23a205797cec86f391d0be886b9bc741e1262063 upstream.

Use a goto to unwind early memslot changes if preparing for a memslot operation fails. This will allow moving the creation of guest_memfd bindings into kvm_set_memslot() without needing to copy+paste the unwind logic.

No functional change intended.

---
 virt/kvm/kvm_main.c |   31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
virt/kvm/kvm_main.c +16 -15
@@ -1937,21 +1937,8 @@ static int kvm_set_memslot(struct kvm *k
 	}
 
 	r = kvm_prepare_memory_region(kvm, old, new, change);
-	if (r) {
-		/*
-		 * For DELETE/MOVE, revert the above INVALID change.  No
-		 * modifications required since the original slot was preserved
-		 * in the inactive slots.  Changing the active memslots also
-		 * release slots_arch_lock.
-		 */
-		if (change == KVM_MR_DELETE || change == KVM_MR_MOVE) {
-			kvm_activate_memslot(kvm, invalid_slot, old);
-			kfree(invalid_slot);
-		} else {
-			mutex_unlock(&kvm->slots_arch_lock);
-		}
-		return r;
-	}
+	if (r)
+		goto err;
 
 	/*
 	 * For DELETE and MOVE, the working slot is now active as the INVALID
@@ -1983,6 +1970,20 @@ static int kvm_set_memslot(struct kvm *k
 	kvm_commit_memory_region(kvm, old, new, change);
 
 	return 0;
+
+err:
+	/*
+	 * For DELETE/MOVE, revert the above INVALID change.  No modifications
+	 * required since the original slot was preserved in the inactive slots.
+	 * Changing the active memslots also release slots_arch_lock.
+	 */
+	if (change == KVM_MR_DELETE || change == KVM_MR_MOVE) {
+		kvm_activate_memslot(kvm, invalid_slot, old);
+		kfree(invalid_slot);
+	} else {
+		mutex_unlock(&kvm->slots_arch_lock);
+	}
+	return r;
 }
 
 static bool kvm_check_memslot_overlap(struct kvm_memslots *slots, int id,
author maintainer
#934 lore raw

PATCH 928/1005 KVM: VMX: Disallow using to_vmx() in common VT code

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sean Christopherson <[email protected]>

commit f305fd31f52a8d3ce4d2bf0c88c45bb7a373809c upstream.

Poison to_vmx() in main.c and posted_intr.c so that attempting to interpret the vCPU as a VMX vCPU will fail at compile time, as opposed to failing at runtime, or worse corrupting state without outright failing.

Note, to_tdx() is buried in tdx.c, i.e. isn't broadly reachable, and so doesn't need the same treatment as to_vmx().

---
 arch/x86/kvm/vmx/main.c        |    2 ++
 arch/x86/kvm/vmx/posted_intr.c |    2 ++
 2 files changed, 4 insertions(+)
arch/x86/kvm/vmx/main.c +2 -0
@@ -10,6 +10,8 @@
 #include "tdx.h"
 #include "tdx_arch.h"
 
+#pragma GCC poison to_vmx
+
 #ifdef CONFIG_KVM_INTEL_TDX
 static_assert(offsetof(struct vcpu_vmx, vt) == offsetof(struct vcpu_tdx, vt));
 
arch/x86/kvm/vmx/posted_intr.c +2 -0
@@ -14,6 +14,8 @@
 #include "vmx.h"
 #include "tdx.h"
 
+#pragma GCC poison to_vmx
+
 /*
  * Maintain a per-CPU list of vCPUs that need to be awakened by wakeup_handler()
  * when a WAKEUP_VECTOR interrupted is posted.  vCPUs are added to the list when
author maintainer
#935 lore raw

PATCH 929/1005 KVM: VMX: Make handle_bus_lock_vmexit() a shared helper

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Xiaoyao Li <[email protected]>

commit 326fa2c9b4d3e6cab58c139eb55aaabd7179192e upstream.

Move handle_bus_lock_vmexit() from vmx.c to main.c to make it a shared helper so that TDX can use it for Bus Lock VM exit handling as well. Rename it to add vt_ prefix to reflect that it is a helper for both VMX and TDX.

---
 arch/x86/kvm/vmx/common.h |    1 +
 arch/x86/kvm/vmx/main.c   |   11 +++++++++++
 arch/x86/kvm/vmx/vmx.c    |   13 +------------
 3 files changed, 13 insertions(+), 12 deletions(-)
arch/x86/kvm/vmx/common.h +1 -0
@@ -176,5 +176,6 @@ static inline void __vmx_deliver_posted_
 }
 
 noinstr void vmx_handle_nmi(struct kvm_vcpu *vcpu);
+int vt_handle_bus_lock_vmexit(struct kvm_vcpu *vcpu);
 
 #endif /* __KVM_X86_VMX_COMMON_H */
arch/x86/kvm/vmx/main.c +11 -0
@@ -849,6 +849,17 @@ static int vt_gmem_max_mapping_level(str
 #define vt_op_tdx_only(name) NULL
 #endif /* CONFIG_KVM_INTEL_TDX */
 
+int vt_handle_bus_lock_vmexit(struct kvm_vcpu *vcpu)
+{
+	/*
+	 * Hardware may or may not set the BUS_LOCK_DETECTED flag on BUS_LOCK
+	 * VM-Exits. Unconditionally set the flag here and leave the handling
+	 * to .handle_exit() callback.
+	 */
+	to_vt(vcpu)->exit_reason.bus_lock_detected = true;
+	return 1;
+}
+
 #define VMX_REQUIRED_APICV_INHIBITS				\
 	(BIT(APICV_INHIBIT_REASON_DISABLED) |			\
 	 BIT(APICV_INHIBIT_REASON_ABSENT) |			\
arch/x86/kvm/vmx/vmx.c +1 -12
@@ -6052,17 +6052,6 @@ static int handle_encls(struct kvm_vcpu
 }
 #endif /* CONFIG_X86_SGX_KVM */
 
-static int handle_bus_lock_vmexit(struct kvm_vcpu *vcpu)
-{
-	/*
-	 * Hardware may or may not set the BUS_LOCK_DETECTED flag on BUS_LOCK
-	 * VM-Exits. Unconditionally set the flag here and leave the handling to
-	 * vmx_handle_exit().
-	 */
-	to_vt(vcpu)->exit_reason.bus_lock_detected = true;
-	return 1;
-}
-
 static int handle_notify(struct kvm_vcpu *vcpu)
 {
 	unsigned long exit_qual = vmx_get_exit_qual(vcpu);
@@ -6162,7 +6151,7 @@ static int (*kvm_vmx_exit_handlers[])(st
 	[EXIT_REASON_VMFUNC]		      = handle_vmx_instruction,
 	[EXIT_REASON_PREEMPTION_TIMER]	      = handle_preemption_timer,
 	[EXIT_REASON_ENCLS]		      = handle_encls,
-	[EXIT_REASON_BUS_LOCK]                = handle_bus_lock_vmexit,
+	[EXIT_REASON_BUS_LOCK]                = vt_handle_bus_lock_vmexit,
 	[EXIT_REASON_NOTIFY]		      = handle_notify,
 	[EXIT_REASON_SEAMCALL]		      = handle_tdx_instruction,
 	[EXIT_REASON_TDCALL]		      = handle_tdx_instruction,
author maintainer
#936 lore raw

PATCH 930/1005 KVM: VMX: Preserve negative return value in vmx_handle_exit() with bus lock detected

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Xiaoyao Li <[email protected]>

commit cef48693da1e964e9f192bfc16cd0ed287c48337 upstream.

Preserve the negative return value from __vmx_handle_exit() when a bus lock is detected, instead of always overwriting it with 0.

The purpose of bus_lock_detected handling is to force a userspace exit to inform userspace that a bus lock happened. The negative return value can achieve this purpose, and changing the negative value to 0 fails to return an error to userspace. So, preserve the negative return value.

---
 arch/x86/kvm/vmx/vmx.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/x86/kvm/vmx/vmx.c +3 -2
@@ -6645,11 +6645,12 @@ int vmx_handle_exit(struct kvm_vcpu *vcp
 	 * a bus lock in guest.
 	 */
 	if (vmx_get_exit_reason(vcpu).bus_lock_detected) {
-		if (ret > 0)
+		if (ret > 0) {
 			vcpu->run->exit_reason = KVM_EXIT_X86_BUS_LOCK;
+			ret = 0;
+		}
 
 		vcpu->run->flags |= KVM_RUN_X86_BUS_LOCK;
-		return 0;
 	}
 	return ret;
 }
author maintainer
#937 lore raw

PATCH 931/1005 KVM: x86/mmu: Bug the VM if KVM attempts to walk more levels than the MMU has

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sean Christopherson <[email protected]>

commit 115f9405a2ed6d78ee7ad8436bdd638743f6d1d4 upstream.

Extend the "EFER.LMA && !CR4.PAE" check, which exists largely to guard against KVM configuring a paging32 MMU with more than 2 levels of paging, with a very explicit check for exactly that: that KVM isn't trying to walk more levels of paging than the MMU template provides. I.e. harden KVM against all bugs that would cause KVM to generates accesses beyond the bounds of guest_walker's arrays, regardless of how KVM ended up with the misconfigured MMU.

Note, don't use w->cpu_role.base.level directly as the paging64 template only provides two levels of page tables for PAE paging on 32-bit hosts, and handles the third level by manually emulating the PDPTR access.

---
 arch/x86/kvm/mmu/paging_tmpl.h |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
arch/x86/kvm/mmu/paging_tmpl.h +7 -6
@@ -349,13 +349,14 @@ retry_walk:
 	pte_access = ~0;
 
 	/*
-	 * Queue a page fault for injection if this assertion fails, as callers
-	 * assume that walker.fault contains sane info on a walk failure.  I.e.
-	 * avoid making the situation worse by inducing even worse badness
-	 * between when the assertion fails and when KVM kicks the vCPU out to
-	 * userspace (because the VM is bugged).
+	 * Queue a page fault for injection if any of the below assertions fail,
+	 * as callers assume that walker.fault contains sane info on a walk
+	 * failure.  I.e. avoid making the situation worse by inducing even
+	 * worse badness between when the assertion fails and when KVM kicks
+	 * the vCPU out to userspace (because the VM is bugged).
 	 */
-	if (KVM_BUG_ON(is_long_mode(vcpu) && !is_pae(vcpu), vcpu->kvm))
+	if (KVM_BUG_ON(is_long_mode(vcpu) && !is_pae(vcpu), vcpu->kvm) ||
+	    KVM_BUG_ON(walker->max_level > PT_MAX_FULL_LEVELS, vcpu->kvm))
 		goto error;
 
 	++walker->level;
author maintainer
#938 lore raw

PATCH 932/1005 KVM: x86/mmu: Bug the VM if KVM calcs a CPU role with EFER.LMA=1 && CR4.PAE=0

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sean Christopherson <[email protected]>

commit 34dacbe7ae93f2d3c26cd0bf3e08200b1fa2c180 upstream.

Bug the VM if KVM attempts to construct a CPU role with the should-be- impossible combination of long mode being active without PAE paging being enabled. KVM's MMU construction assumes that EFER.LMA can be set if and only CR4.PAE is set, and will create a completely invalid MMU if that assumption fails. FNAME(walk_addr_generic) already has sanity checks to try and mitigate the fallout, but attempt to catch such bugs earlier, as this is (at least) the second time KVM has had bugs that escaped into FNAME(walk_addr_generic), and it's entirely possible the bad state could cause problems elsewhere.

---
 arch/x86/kvm/mmu/mmu.c |    3 +++
 1 file changed, 3 insertions(+)
arch/x86/kvm/mmu/mmu.c +3 -0
@@ -5639,6 +5639,9 @@ static union kvm_cpu_role kvm_calc_cpu_r
 		return role;
 	}
 
+	if (KVM_BUG_ON(____is_efer_lma(regs) && !____is_cr4_pae(regs), vcpu->kvm))
+		*(u64 *)&regs->efer &= ~EFER_LMA;
+
 	role.base.efer_nx = ____is_efer_nx(regs);
 	role.base.cr0_wp = ____is_cr0_wp(regs);
 	role.base.smep_andnot_wp = ____is_cr4_smep(regs) && !____is_cr0_wp(regs);
author maintainer
#939 lore raw

PATCH 933/1005 KVM: x86/xen: Enforce 4-byte alignment of vcpu_info registration

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: David Woodhouse <[email protected]>

commit eacdb76c5f04956035c5d7f7e1973028f30684a2 upstream.

Xen's map_guest_area() enforces that vcpu_info is aligned to sizeof(xen_ulong_t). KVM has no such check, allowing a guest to register vcpu_info at an arbitrary byte alignment.

Enforce unconditional 4-byte alignment regardless of the current shinfo mode. This is sufficient because subsequent commits ensure that all locked atomic operations on vcpu_info fields use at most 32-bit accesses. Return -ENXIO on failure, matching Xen's map_guest_area() behaviour for unaligned requests.

Originally observed in review of an unrelated patch:
https://lore.kernel.org/all/[email protected]/

---
 arch/x86/kvm/xen.c |    8 ++++++++
 1 file changed, 8 insertions(+)
arch/x86/kvm/xen.c +8 -0
@@ -926,6 +926,10 @@ int kvm_xen_vcpu_set_attr(struct kvm_vcp
 				break;
 			}
 
+			r = -ENXIO;
+			if (!IS_ALIGNED(data->u.gpa, sizeof(u32)))
+				break;
+
 			r = kvm_gpc_activate(&vcpu->arch.xen.vcpu_info_cache,
 					     data->u.gpa, sizeof(struct vcpu_info));
 		} else {
@@ -935,6 +939,10 @@ int kvm_xen_vcpu_set_attr(struct kvm_vcp
 				break;
 			}
 
+			r = -ENXIO;
+			if (!IS_ALIGNED(data->u.hva, sizeof(u32)))
+				break;
+
 			r = kvm_gpc_activate_hva(&vcpu->arch.xen.vcpu_info_cache,
 						 data->u.hva, sizeof(struct vcpu_info));
 		}
author maintainer
#940 lore raw

PATCH 934/1005 KVM: x86/xen: Take kvm->srcu in __kvm_xen_has_interrupt()

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: David Woodhouse <[email protected]>

commit aa8ad943f242ef14d136c5440b1178de77466c9e upstream.

kvm_gpc_check() checks the cached memslot generation against the current one, which dereferences kvm->memslots and therefore requires kvm->srcu to be held. __kvm_xen_has_interrupt() does not take it.

Most callers do happen to hold kvm->srcu, but not all of them:

- kvm_emulate_halt() on the VM-Exit path, via kvm_vcpu_has_events() and kvm_cpu_has_extint(). vcpu_enter_guest() drops the vCPU's SRCU lock before entering the guest, so it is not held on the way back out.

- kvm_vcpu_block() -> kvm_vcpu_check_block() -> kvm_arch_vcpu_runnable(), which is the case the existing comment in this function describes.

On a PROVE_RCU kernel the former produces:

WARNING: suspicious RCU usage
include/linux/kvm_host.h:1092 suspicious rcu_dereference_check() usage!
...

   kvm_gpc_check+0x344/0x3e0 [kvm]
   __kvm_xen_has_interrupt+0x83/0x310 [kvm]
   kvm_cpu_has_extint+0x1ff/0x370 [kvm]
   kvm_cpu_has_interrupt+0x16/0x100 [kvm]
   kvm_vcpu_has_events+0x4ce/0x690 [kvm]
   kvm_emulate_halt+0x52/0x1f0 [kvm]
   vmx_vcpu_run+0x988/0x2630 [kvm_intel]

Use guard(srcu) so that the three existing early returns don't each need an explicit unlock. SRCU read sections nest, so this is harmless on the paths which already hold it, and srcu_read_lock() does not sleep, so it is also safe in the atomic case which this function already handles.

Fixes 7caf9571563e ("KVM: x86/xen: Use gfn_to_pfn_cache for vcpu_info")
Assisted-by Claude:claude-mythos-5
---
 arch/x86/kvm/xen.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
arch/x86/kvm/xen.c +10 -0
@@ -713,6 +713,16 @@ int __kvm_xen_has_interrupt(struct kvm_v
 	BUILD_BUG_ON(sizeof(rc) !=
 		     sizeof_field(struct compat_vcpu_info, evtchn_upcall_pending));
 
+	/*
+	 * kvm_gpc_check() checks the memslot generation, so kvm->srcu must be
+	 * held. Most callers hold it already, but this is also reached from
+	 * kvm_emulate_halt() on the VM-Exit path and from kvm_vcpu_block(),
+	 * where vcpu_enter_guest() has already dropped the vCPU's SRCU lock.
+	 * Taking SRCU does not sleep, so it is safe even in the atomic case
+	 * which is handled below.
+	 */
+	guard(srcu)(&v->kvm->srcu);
+
 	read_lock_irqsave(&gpc->lock, flags);
 	while (!kvm_gpc_check(gpc, sizeof(struct vcpu_info))) {
 		read_unlock_irqrestore(&gpc->lock, flags);
author maintainer
#941 lore raw

PATCH 935/1005 KVM: x86: Clear hardware HLT state when userspace makes a vCPU not-halted

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Keqiang Duan <[email protected]>

commit 883719f57f5d3898637b130d6db4742471cad618 upstream.

Force a vCPU out of its hardware-tracked halted state when userspace puts the vCPU into any state other than HALTED via KVM_SET_MP_STATE, i.e. clear VMCS.GUEST_ACTIVITY_STATE if it says the vCPU is halted. Add an optional kvm_x86_ops hook to do the clearing, as SVM has no equivalent VMCB field.

When HLT-exiting is disabled for a VM (KVM_CAP_X86_DISABLE_EXITS with KVM_X86_DISABLE_EXITS_HLT, e.g. QEMU's "-overcommit cpu-pm=on"), a guest HLT halts the physical CPU instead of exiting to KVM, and hardware saves GUEST_ACTIVITY_STATE=HLT into the VMCS on the next VM-Exit. That field is
sticky: it survives VM-Exit/VM-Enter and is only cleared by vmx_clear_hlt() on event injection, or by vmx_vcpu_reset() on INIT / vCPU creation.

Nothing clears it on a userspace-driven state change. KVM_SET_REGS only writes the software register cache and KVM_SET_MP_STATE only writes vcpu->arch.mp_state; kvm_vcpu_running() likewise consults software state only. A VMM that emulates a machine reset therefore ends up with a vCPU that KVM happily VM-Enters while hardware refuses to fetch instructions.

Reproduce with a Linux guest by triggering a panic/kdump on a non-boot
vCPU: nmi_shootdown_cpus() parks the other vCPUs -- including vCPU0 -- in crash_nmi_callback(), which does local_irq_disable() followed by a bare HLT. The capture kernel then resets the machine via port 0xCF9. QEMU rewrites RIP to 0xfff0 and sets mp_state to RUNNABLE, but vCPU0's GUEST_ACTIVITY_STATE is still HLT, so the BSP never executes the reset vector, never sends SIPIs, and the entire VM hangs at "reboot: machine restart" forever. Only destroying and recreating the VM recovers it.

Key off "not HALTED" rather than "is RUNNABLE" as HALTED is the only target state for which retaining the hardware halted state is meaningful; every other transition either can't be reached on VMX, e.g. AP_RESET_HOLD, or goes through vmx_vcpu_reset(), which stuffs GUEST_ACTIVITY_ACTIVE anyways. This also captures the intent more directly: KVM only ever drops the hardware halted state, it never installs it.

Hook KVM_SET_MP_STATE rather than the VM-Enter path so that the clearing is driven by an explicit userspace declaration, and so that no work is added to vmx_vcpu_run(). Gate the call on kvm_hlt_in_guest() even though vmx_clear_hlt() checks it as well, as the check is cheap and makes it obvious in common code when the hardware state can exist at all.

Do nothing for TDX vCPUs as TDX doesn't support disabling HLT-exiting and KVM cannot access a TD's VMCS, i.e. the VMCS used to run the vCPU can't in HALTED state, and even if it were, KVM can't change it.

Fixes caa057a2cad6 ("KVM: X86: Provide a capability to disable HLT intercepts")
[sean: drop claim that spurious wakeups are ok, massage changelog]
---
 arch/x86/include/asm/kvm-x86-ops.h |    1 +
 arch/x86/include/asm/kvm_host.h    |    7 +++++++
 arch/x86/kvm/vmx/main.c            |   13 +++++++++++++
 arch/x86/kvm/vmx/vmx.c             |    2 +-
 arch/x86/kvm/vmx/x86_ops.h         |    1 +
 arch/x86/kvm/x86.c                 |   13 +++++++++++++
 6 files changed, 36 insertions(+), 1 deletion(-)
arch/x86/include/asm/kvm-x86-ops.h +1 -0
@@ -80,6 +80,7 @@ KVM_X86_OP(interrupt_allowed)
 KVM_X86_OP(nmi_allowed)
 KVM_X86_OP(get_nmi_mask)
 KVM_X86_OP(set_nmi_mask)
+KVM_X86_OP_OPTIONAL(clear_hlt)
 KVM_X86_OP(enable_nmi_window)
 KVM_X86_OP(enable_irq_window)
 KVM_X86_OP_OPTIONAL(update_cr8_intercept)
arch/x86/include/asm/kvm_host.h +7 -0
@@ -1824,6 +1824,13 @@ struct kvm_x86_ops {
 	int (*nmi_allowed)(struct kvm_vcpu *vcpu, bool for_injection);
 	bool (*get_nmi_mask)(struct kvm_vcpu *vcpu);
 	void (*set_nmi_mask)(struct kvm_vcpu *vcpu, bool masked);
+	/*
+	 * Force the vCPU out of any hardware-tracked halted/inactive state so
+	 * that it will fetch and execute instructions on the next VM-Enter.
+	 * Only needed by VMX, where VMCS.GUEST_ACTIVITY_STATE persists across
+	 * VM-Exit/VM-Enter; SVM has no equivalent VMCB field.
+	 */
+	void (*clear_hlt)(struct kvm_vcpu *vcpu);
 	/* Whether or not a virtual NMI is pending in hardware. */
 	bool (*is_vnmi_pending)(struct kvm_vcpu *vcpu);
 	/*
arch/x86/kvm/vmx/main.c +13 -0
@@ -590,6 +590,18 @@ static void vt_set_nmi_mask(struct kvm_v
 	vmx_set_nmi_mask(vcpu, masked);
 }
 
+static void vt_clear_hlt(struct kvm_vcpu *vcpu)
+{
+	/*
+	 * TDX doesn't support disabling HLT-exiting, and KVM can't access a
+	 * TD's VMCS, so there is never any hardware halted state to clear.
+	 */
+	if (is_td_vcpu(vcpu))
+		return;
+
+	vmx_clear_hlt(vcpu);
+}
+
 static void vt_enable_nmi_window(struct kvm_vcpu *vcpu)
 {
 	/* Refer to the comments in tdx_inject_nmi(). */
@@ -947,6 +959,7 @@ struct kvm_x86_ops vt_x86_ops __initdata
 	.nmi_allowed = vt_op(nmi_allowed),
 	.get_nmi_mask = vt_op(get_nmi_mask),
 	.set_nmi_mask = vt_op(set_nmi_mask),
+	.clear_hlt = vt_op(clear_hlt),
 	.enable_nmi_window = vt_op(enable_nmi_window),
 	.enable_irq_window = vt_op(enable_irq_window),
 	.update_cr8_intercept = vt_op(update_cr8_intercept),
arch/x86/kvm/vmx/vmx.c +1 -1
@@ -1772,7 +1772,7 @@ int vmx_skip_emulated_instruction(struct
 	return skip_emulated_instruction(vcpu);
 }
 
-static void vmx_clear_hlt(struct kvm_vcpu *vcpu)
+void vmx_clear_hlt(struct kvm_vcpu *vcpu)
 {
 	/*
 	 * Ensure that we clear the HLT state in the VMCS.  We don't need to
arch/x86/kvm/vmx/x86_ops.h +1 -0
@@ -95,6 +95,7 @@ int vmx_interrupt_allowed(struct kvm_vcp
 int vmx_nmi_allowed(struct kvm_vcpu *vcpu, bool for_injection);
 bool vmx_get_nmi_mask(struct kvm_vcpu *vcpu);
 void vmx_set_nmi_mask(struct kvm_vcpu *vcpu, bool masked);
+void vmx_clear_hlt(struct kvm_vcpu *vcpu);
 void vmx_enable_nmi_window(struct kvm_vcpu *vcpu);
 void vmx_enable_irq_window(struct kvm_vcpu *vcpu);
 void vmx_update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr);
arch/x86/kvm/x86.c +13 -0
@@ -11698,6 +11698,19 @@ int kvm_arch_vcpu_ioctl_set_mpstate(stru
 	}
 
 	kvm_set_mp_state(vcpu, mp_state->mp_state);
+
+	/*
+	 * Force the vCPU out of any hardware-tracked halted state, e.g. VMX's
+	 * GUEST_ACTIVITY_STATE=HLT, when userspace puts the vCPU into a state
+	 * other than HALTED.  The hardware state is sticky across VM-Exit and
+	 * VM-Enter and is not touched by any other ioctl, so a vCPU that halted
+	 * with HLT-exiting disabled stays wedged even after userspace rewrites
+	 * its registers, e.g. when a VMM emulates a machine reset.
+	 */
+	if (kvm_hlt_in_guest(vcpu->kvm) &&
+	    mp_state->mp_state != KVM_MP_STATE_HALTED)
+		kvm_x86_call(clear_hlt)(vcpu);
+
 	kvm_make_request(KVM_REQ_EVENT, vcpu);
 
 	ret = 0;
author maintainer
#942 lore raw

PATCH 936/1005 KVM: x86: Preserve DR6.BLD (Bus Lock Detect) when delivering #DB payload

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sean Christopherson <[email protected]>

commit 719a1d58bf43edd03b271df90b67c58c1e9a7da4 upstream.

Preserve Bus Lock Detect if it isn't present in the payload. Unlike RTM, which is explicitly modified on every #DB, DR6.BLD is modified if and only if the #DB is due to a (coincident) Bus Lock Detect.

Per Intel's SDM:

Other debug exceptions do not modify this bit.

And AMD's APM

All other #DB exceptions leave DR6[BLD] unmodified,

Restore the explicit RTM handling that was clobbered by commit 9a3ecd5e2aa1 ("KVM: X86: Rename DR6_INIT to DR6_ACTIVE_LOW"), as the semantics of any given bit are feature specific, i.e. are obviously not consistent for active-high versus active-low. In other words, while the bug was technically introduced when support for Bus Lock Detect was added, it's really that attempt to genericize handling of active-low bits that set KVM up to fail.

Fixes e8ea85fb280e ("KVM: X86: Add support for the emulation of DR6_BUS_LOCK bit")
---
 arch/x86/kvm/x86.c |   52 ++++++++++++++++++++++++++++++----------------------
 1 file changed, 30 insertions(+), 22 deletions(-)
arch/x86/kvm/x86.c +30 -22
@@ -770,30 +770,37 @@ void kvm_deliver_exception_payload(struc
 	switch (ex->vector) {
 	case DB_VECTOR:
 		/*
-		 * "Certain debug exceptions may clear bit 0-3.  The
-		 * remaining contents of the DR6 register are never
-		 * cleared by the processor".
-		 */
-		vcpu->arch.dr6 &= ~DR_TRAP_BITS;
-		/*
-		 * In order to reflect the #DB exception payload in guest
-		 * dr6, three components need to be considered: active low
-		 * bit, FIXED_1 bits and active high bits (e.g. DR6_BD,
-		 * DR6_BS and DR6_BT)
-		 * DR6_ACTIVE_LOW contains the FIXED_1 and active low bits.
-		 * In the target guest dr6:
-		 * FIXED_1 bits should always be set.
-		 * Active low bits should be cleared if 1-setting in payload.
-		 * Active high bits should be set if 1-setting in payload.
+		 * DR6 is a mess.  Reserved/unused bits are fixed-to-1, and so
+		 * to maintain backwards compatibility with existing software,
+		 * features that use previously-reserved bits have active-low
+		 * semantics, i.e. clear the bit when the feature is present in
+		 * the payload.
+		 *
+		 * Further complicating matters, some DR6 bits are preserved by
+		 * hardware, while others are explicitly modified on every #DB.
+		 * The trap bits are always set based on the payload, as is the
+		 * RTM flag (but it's active low).  All other bits are modified
+		 * if and only if a relevant debug exception occurs, e.g. BD,
+		 * BS, and BT are never cleared by hardware, and BLD is never
+		 * set by hardware (when supported, excepting RESET).
 		 *
-		 * Note, the payload is compatible with the pending debug
-		 * exceptions/exit qualification under VMX, that active_low bits
-		 * are active high in payload.
-		 * So they need to be flipped for DR6.
+		 * Lastly, the payload does NOT have active-low semantics, e.g.
+		 * so that it's compatible VMX's pending debug exceptions and
+		 * qualification fields, and to avoid bleeding the DR6 madness
+		 * into other KVM code.
+		 *
+		 * To compute DR6:
+		 *
+		 *  1. "Reset" the bits that are modified on all #DBs
+		 *  2. Clear active-low bits that are present in the payload.
+		 *  3. Set active-high bits that are present in the payload.
+		 *  4. Clear fixed-0 bits.
+		 *  5. Set fixed-1 bits.
 		 */
-		vcpu->arch.dr6 |= DR6_ACTIVE_LOW;
-		vcpu->arch.dr6 |= ex->payload;
-		vcpu->arch.dr6 ^= ex->payload & DR6_ACTIVE_LOW;
+		vcpu->arch.dr6 &= ~DR_TRAP_BITS;
+		vcpu->arch.dr6 |= DR6_RTM;
+		vcpu->arch.dr6 &= ~(ex->payload & DR6_ACTIVE_LOW);
+		vcpu->arch.dr6 |= (ex->payload & ~DR6_ACTIVE_LOW);
 
 		/*
 		 * The #DB payload is defined as compatible with the 'pending
@@ -802,6 +809,7 @@ void kvm_deliver_exception_payload(struc
 		 * breakpoint), it is reserved and must be zero in DR6.
 		 */
 		vcpu->arch.dr6 &= ~BIT(12);
+		vcpu->arch.dr6 |= DR6_FIXED_1;
 		break;
 	case PF_VECTOR:
 		vcpu->arch.cr2 = ex->payload;
author maintainer
#943 lore raw

PATCH 937/1005 KVM: x86: Request event processing for exception VM-Exits

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Loc Nguyen <[email protected]>

commit 88b23a2e8286b7016c3b58dc10093cf28c22aa3d upstream.

Request event processing whenever kvm_queue_exception_vmexit() queues an exception VM-Exit. Most callers reach the helper through kvm_multiple_exception(), which already sets KVM_REQ_EVENT, but nested asynchronous page faults call it directly.

Without another event request, vcpu_enter_guest() skips kvm_check_and_inject_events() and re-enters L2. A subsequent VM-Exit can clear the pending exception while reconstructing vectoring state, losing the synthetic #PF VM-Exit. The APF reason remains PAGE_NOT_PRESENT and a later regular #PF can consume the stale value.

Setting KVM_REQ_EVENT in the common helper ensures that L1 receives the queued VM-Exit before KVM re-enters L2.

Fixes 7709aba8f716 ("KVM: x86: Morph pending exceptions to pending VM-Exits at queue time")
---
 arch/x86/kvm/x86.c |    2 ++
 1 file changed, 2 insertions(+)
arch/x86/kvm/x86.c +2 -0
@@ -827,6 +827,8 @@ static void kvm_queue_exception_vmexit(s
 {
 	struct kvm_queued_exception *ex = &vcpu->arch.exception_vmexit;
 
+	kvm_make_request(KVM_REQ_EVENT, vcpu);
+
 	ex->vector = vector;
 	ex->injected = false;
 	ex->pending = true;
author maintainer
#944 lore raw

PATCH 938/1005 KVM: x86: Take SRCU in kvm_zap_gfn_range()

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chengfeng Ye <[email protected]>

commit b59a87c1ba3c347e8aec5f932eb7abf13064fd62 upstream.

kvm_zap_gfn_range() walks memslots and rmaps and may drop mmu_lock to reschedule. Callers that do not already hold kvm->srcu (or slots_lock) can race with memslot deletion: synchronize_srcu_expedited() does not wait, kvm_free_memslot() frees the old slot and its rmap, and the zap resumes on freed memory.

The VFIO noncoherent-DMA path hits this by zapping the entire GPA space without SRCU. KASAN reported:

  BUG: KASAN: vmalloc-out-of-bounds in slot_rmap_walk_next+0x82/0x1c0
  Read of size 8 at addr ffffc900005c1008
  Call Trace:
   slot_rmap_walk_next+0x82/0x1c0
   __kvm_rmap_zap_gfn_range+0x17a/0x280
   kvm_zap_gfn_range+0x2a6/0x6a0
   kvm_vfio_set_attr+0x576/0x770
   kvm_device_ioctl+0x1ff/0x3b0

Take SRCU inside kvm_zap_gfn_range() so every caller is covered. Nesting with an existing kvm->srcu critical section is fine; the helper uses a local index. Drop the now-redundant SRCU pair from __kvm_set_or_clear_apicv_inhibit().

Fixes 362ff6dca541 ("KVM: x86/mmu: Zap KVM TDP when noncoherent DMA assignment starts/stops")
---
 arch/x86/kvm/mmu/mmu.c |    2 ++
 arch/x86/kvm/x86.c     |    2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/kvm/mmu/mmu.c +2 -0
@@ -6876,6 +6876,8 @@ void kvm_zap_gfn_range(struct kvm *kvm,
 	if (WARN_ON_ONCE(gfn_end <= gfn_start))
 		return;
 
+	guard(srcu)(&kvm->srcu);
+
 	write_lock(&kvm->mmu_lock);
 
 	kvm_mmu_invalidate_begin(kvm);
arch/x86/kvm/x86.c +0 -2
@@ -10619,10 +10619,8 @@ void __kvm_set_or_clear_apicv_inhibit(st
 		kvm->arch.apicv_inhibit_reasons = new;
 		if (new) {
 			unsigned long gfn = gpa_to_gfn(APIC_DEFAULT_PHYS_BASE);
-			int idx = srcu_read_lock(&kvm->srcu);
 
 			kvm_zap_gfn_range(kvm, gfn, gfn+1);
-			srcu_read_unlock(&kvm->srcu, idx);
 		}
 	} else {
 		kvm->arch.apicv_inhibit_reasons = new;
author maintainer
#945 lore raw

PATCH 939/1005 KVM: x86: Zero reserved synic flags when delivering message to avoid stack leak

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sean Christopherson <[email protected]>

commit 2616f497506a772db53e7bb1024cde50b4c165e0 upstream.

Ensure all reserved flags are zeroed when setting the msg_pending flag as part of SynIC message delivery, as setting only msg_pending can leak seven bits of kernel stack data to the guest. E.g. gcc typically uses a bitwise-OR to set the msg_pending flag, without initializing the on-stack variable.

Precisely zero the flags, e.g. as opposed to zeroing the entire structure, to make it somewhat more obvious that the flags *need* to be zeroed. E.g. it would be quite easy to misread the initial read of guest memory and think that zeroing the entire structure is completely superfluous.

---
 arch/x86/kvm/hyperv.c |    2 ++
 1 file changed, 2 insertions(+)
arch/x86/kvm/hyperv.c +2 -0
@@ -798,7 +798,9 @@ static int synic_deliver_msg(struct kvm_
 		if (no_retry)
 			return 0;
 
+		hv_hdr.message_flags.asu8 = 0;
 		hv_hdr.message_flags.msg_pending = 1;
+
 		r = kvm_vcpu_write_guest_page(vcpu, msg_page_gfn,
 					      &hv_hdr.message_flags,
 					      msg_off +
author maintainer
#946 lore raw

PATCH 940/1005 KVM: TDX: Check if there is valid exit infos based on vp_enter_ret

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Xiaoyao Li <[email protected]>

commit 0966c881ea13be5ec89820c185de4d55568e80ed upstream.

Check if there is valid exit info based on vp_enter_ret instead of relying on the clobbered Exit Reason, in tdx_get_exit_info().

Current KVM uses "Exit Reason is not equal to the synthesized invalid Exit Reason, -1u," as the condition to identify there is a real TD Exit and valid exit infos. However, there is one issue with this approach:
KVM updates the Exit Reason to the synthesized invalid Exit Reason for real EPT MISCONFIG as well. This is a false positive for real EPT MISCONFIG, which has valid exit infos.

Though the issue can be addressed by changing the handling for real EPT MISCONFIG to not update the Exit Reason to the synthesized one, relying on the clobbered Exit Reason itself is brittle. Instead, check vp_enter_ret directly to identify if it is a valid Exit Reason.

---
 arch/x86/kvm/vmx/tdx.c |   22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)
arch/x86/kvm/vmx/tdx.c +14 -8
@@ -885,21 +885,27 @@ static __always_inline u32 tdcall_to_vmx
 	return EXIT_REASON_TDCALL;
 }
 
-static __always_inline u32 tdx_to_vmx_exit_reason(struct kvm_vcpu *vcpu)
+static __always_inline bool tdx_is_exit_reason_valid(u64 vp_enter_ret)
 {
-	struct vcpu_tdx *tdx = to_tdx(vcpu);
-	u32 exit_reason;
-
-	switch (tdx->vp_enter_ret & TDX_SEAMCALL_STATUS_MASK) {
+	switch (vp_enter_ret & TDX_SEAMCALL_STATUS_MASK) {
 	case TDX_SUCCESS:
 	case TDX_NON_RECOVERABLE_VCPU:
 	case TDX_NON_RECOVERABLE_TD:
 	case TDX_NON_RECOVERABLE_TD_NON_ACCESSIBLE:
 	case TDX_NON_RECOVERABLE_TD_WRONG_APIC_MODE:
-		break;
+		return true;
 	default:
-		return -1u;
+		return false;
 	}
+}
+
+static __always_inline u32 tdx_to_vmx_exit_reason(struct kvm_vcpu *vcpu)
+{
+	struct vcpu_tdx *tdx = to_tdx(vcpu);
+	u32 exit_reason;
+
+	if (!tdx_is_exit_reason_valid(tdx->vp_enter_ret))
+		return -1u;
 
 	exit_reason = tdx->vp_enter_ret;
 
@@ -2153,7 +2159,7 @@ void tdx_get_exit_info(struct kvm_vcpu *
 	struct vcpu_tdx *tdx = to_tdx(vcpu);
 
 	*reason = tdx->vt.exit_reason.full;
-	if (*reason != -1u) {
+	if (tdx_is_exit_reason_valid(tdx->vp_enter_ret)) {
 		*info1 = vmx_get_exit_qual(vcpu);
 		*info2 = tdx->ext_exit_qualification;
 		*intr_info = vmx_get_intr_info(vcpu);
author maintainer
#947 lore raw

PATCH 941/1005 KVM: TDX: Enable Notify VM exit

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Xiaoyao Li <[email protected]>

commit d93395058c1951bb657c8895dd1fc0f22263f1cc upstream.

Enable Notify VM exit functionality for TDX guests.

Notify VM exit is an existing feature supported by KVM. Userspace can enable Notify VM exit through KVM_CAP_X86_NOTIFY_VMEXIT when it's reported as supported. However, KVM reports the support of this CAP just based on the hardware capability but doesn't differentiate between VMX and TDX. This leads to the issue that userspace can enable this cap for TDX guests without getting an error, but the feature is not actually enabled because KVM doesn't call the TDX module API to program the relevant TD VMCS fields.

Enable Notify VM exit for TDX guests by:

- Invoking TDX module API calls to set NOTIFY_VM_EXITING and Notify Window in TD VMCS. It's done in tdx_vcpu_init() where other TD VMCS bits are set. Since TDX vCPU cannot be reset, it only needs to be configured once when initializing the TDX vCPU.

- Adding corresponding exit handler for TDX Notify VM Exit.

Notify VM exit can happen when executing the IRET instruction. If the IRET unblocks the NMI blocking state, bit 12 of the exit qualification is set. In this case, the VMM needs to restore the "blocked by NMI" state when it decides to re-enter the guest. For TDX, KVM cannot manage the GUEST_INTERRUPTIBILITY_INFO and it's TDX module's responsibility to handle it. Extract the common part without NMI blocking handling into a helper in common.h so that it can be shared between VMX and TDX.

Note, KVM uses "pre-production" terminology for the feature formally called Notify VM-Exit. All public versions of the SDM refer to the feature as Instruction Timeout. This will be remedied in the near future, for now, use KVM's terminology for consistency.

Note, #2, there is no enumeration bit for Notify VM exit by TDX module because all TDX modules support it, and allow to set the corresponding TD VMCS fields as long as the hardware supports the feature.

---
 arch/x86/kvm/vmx/common.h |   19 +++++++++++++++++++
 arch/x86/kvm/vmx/tdx.c    |   10 ++++++++++
 arch/x86/kvm/vmx/vmx.c    |   13 +------------
 3 files changed, 30 insertions(+), 12 deletions(-)
arch/x86/kvm/vmx/common.h +19 -0
@@ -4,6 +4,7 @@
 
 #include <linux/kvm_host.h>
 #include <asm/posted_intr.h>
+#include <asm/vmx.h>
 
 #include "mmu.h"
 
@@ -175,6 +176,24 @@ static inline void __vmx_deliver_posted_
 	kvm_vcpu_trigger_posted_interrupt(vcpu, POSTED_INTR_VECTOR);
 }
 
+static inline int __vt_handle_notify(struct kvm_vcpu *vcpu,
+				     unsigned long exit_qual)
+{
+	bool context_invalid = exit_qual & NOTIFY_VM_CONTEXT_INVALID;
+
+	++vcpu->stat.notify_window_exits;
+
+	if (vcpu->kvm->arch.notify_vmexit_flags & KVM_X86_NOTIFY_VMEXIT_USER ||
+	    context_invalid) {
+		vcpu->run->exit_reason = KVM_EXIT_NOTIFY;
+		vcpu->run->notify.flags = context_invalid ?
+					  KVM_NOTIFY_CONTEXT_INVALID : 0;
+		return 0;
+	}
+
+	return 1;
+}
+
 noinstr void vmx_handle_nmi(struct kvm_vcpu *vcpu);
 int vt_handle_bus_lock_vmexit(struct kvm_vcpu *vcpu);
 
arch/x86/kvm/vmx/tdx.c +10 -0
@@ -2140,6 +2140,9 @@ int tdx_handle_exit(struct kvm_vcpu *vcp
 		 * - If it's not an MSMI, no need to do anything here.
 		 */
 		return 1;
+	case EXIT_REASON_NOTIFY:
+		/* NMI blocking state is handled by TDX module */
+		return __vt_handle_notify(vcpu, vmx_get_exit_qual(vcpu));
 	default:
 		break;
 	}
@@ -3141,6 +3144,13 @@ static int tdx_vcpu_init(struct kvm_vcpu
 	td_vmcs_write64(tdx, POSTED_INTR_DESC_ADDR, __pa(&tdx->vt.pi_desc));
 	td_vmcs_setbit32(tdx, PIN_BASED_VM_EXEC_CONTROL, PIN_BASED_POSTED_INTR);
 
+	if (kvm_notify_vmexit_enabled(vcpu->kvm)) {
+		td_vmcs_setbit32(tdx, SECONDARY_VM_EXEC_CONTROL,
+				 SECONDARY_EXEC_NOTIFY_VM_EXITING);
+		td_vmcs_write32(tdx, NOTIFY_WINDOW,
+				vcpu->kvm->arch.notify_window);
+	}
+
 	tdx->state = VCPU_TD_STATE_INITIALIZED;
 
 	return 0;
arch/x86/kvm/vmx/vmx.c +1 -12
@@ -6055,9 +6055,6 @@ static int handle_encls(struct kvm_vcpu
 static int handle_notify(struct kvm_vcpu *vcpu)
 {
 	unsigned long exit_qual = vmx_get_exit_qual(vcpu);
-	bool context_invalid = exit_qual & NOTIFY_VM_CONTEXT_INVALID;
-
-	++vcpu->stat.notify_window_exits;
 
 	/*
 	 * Notify VM exit happened while executing iret from NMI,
@@ -6067,15 +6064,7 @@ static int handle_notify(struct kvm_vcpu
 		vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO,
 			      GUEST_INTR_STATE_NMI);
 
-	if (vcpu->kvm->arch.notify_vmexit_flags & KVM_X86_NOTIFY_VMEXIT_USER ||
-	    context_invalid) {
-		vcpu->run->exit_reason = KVM_EXIT_NOTIFY;
-		vcpu->run->notify.flags = context_invalid ?
-					  KVM_NOTIFY_CONTEXT_INVALID : 0;
-		return 0;
-	}
-
-	return 1;
+	return __vt_handle_notify(vcpu, exit_qual);
 }
 
 static int vmx_get_msr_imm_reg(struct kvm_vcpu *vcpu)
author maintainer
#948 lore raw

PATCH 942/1005 KVM: TDX: Enable Bus Lock VM exit

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Xiaoyao Li <[email protected]>

commit 63d196e2e20429de5ba501f1b6059d9b93140007 upstream.

Enable Bus Lock VM exit functionality for TDX guests.

Bus Lock VM exit is an existing feature supported by KVM. Userspace can enable Bus Lock VM exit through KVM_BUS_LOCK_DETECTION_EXIT when it's reported as supported. However, KVM reports the support of this CAP just based on the hardware capability but doesn't differentiate between VMX and TDX. This leads to the issue that userspace can enable this cap for TDX guests without getting an error, but the feature is not actually enabled because KVM doesn't call the TDX module API to program the relevant TD VMCS fields.

Enable Bus Lock VM exit for TDX guests by programming the BUS_LOCK_DETECTION control in the TD VMCS and by adding the exit handler.

Note, there is no enumeration bit for this feature by TDX module because all TDX modules support it and allow to set the TD VMCS as long as the hardware supports the feature.

---
 arch/x86/kvm/vmx/tdx.c |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
arch/x86/kvm/vmx/tdx.c +23 -1
@@ -2042,7 +2042,7 @@ int tdx_complete_emulated_msr(struct kvm
 }
 
 
-int tdx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t fastpath)
+static int __tdx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t fastpath)
 {
 	struct vcpu_tdx *tdx = to_tdx(vcpu);
 	u64 vp_enter_ret = tdx->vp_enter_ret;
@@ -2143,6 +2143,8 @@ int tdx_handle_exit(struct kvm_vcpu *vcp
 	case EXIT_REASON_NOTIFY:
 		/* NMI blocking state is handled by TDX module */
 		return __vt_handle_notify(vcpu, vmx_get_exit_qual(vcpu));
+	case EXIT_REASON_BUS_LOCK:
+		return vt_handle_bus_lock_vmexit(vcpu);
 	default:
 		break;
 	}
@@ -2156,6 +2158,22 @@ unhandled_exit:
 	return 0;
 }
 
+int tdx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t fastpath)
+{
+	int ret = __tdx_handle_exit(vcpu, fastpath);
+
+	/* Exit to user space when bus lock was detected */
+	if (vmx_get_exit_reason(vcpu).bus_lock_detected) {
+		if (ret > 0) {
+			vcpu->run->exit_reason = KVM_EXIT_X86_BUS_LOCK;
+			ret = 0;
+		}
+
+		vcpu->run->flags |= KVM_RUN_X86_BUS_LOCK;
+	}
+	return ret;
+}
+
 void tdx_get_exit_info(struct kvm_vcpu *vcpu, u32 *reason,
 		u64 *info1, u64 *info2, u32 *intr_info, u32 *error_code)
 {
@@ -3151,6 +3169,10 @@ static int tdx_vcpu_init(struct kvm_vcpu
 				vcpu->kvm->arch.notify_window);
 	}
 
+	if (vcpu->kvm->arch.bus_lock_detection_enabled)
+		td_vmcs_setbit32(tdx, SECONDARY_VM_EXEC_CONTROL,
+				 SECONDARY_EXEC_BUS_LOCK_DETECTION);
+
 	tdx->state = VCPU_TD_STATE_INITIALIZED;
 
 	return 0;
#949 lore raw

Re: [PATCH 6.18 0942/1005] KVM: TDX: Enable Bus Lock VM exit

Quoted 1 line · Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

There are some dependency patches failed to be backported [1][2][3]. What is the preferred way to handle it? prepare a separate series for 6.18-stable with all the necessary patches?

[1] https://lore.kernel.org/all/2026110415-porous-slather-09d5@gregkh/
[2] https://lore.kernel.org/all/2026110443-stage-reproach-62d3@gregkh/
[3] https://lore.kernel.org/all/2026110444-external-riverbed-0f47@gregkh/

Quoted 90 lines

------------------

From: Xiaoyao Li <[email protected]>

commit 63d196e2e20429de5ba501f1b6059d9b93140007 upstream.

Enable Bus Lock VM exit functionality for TDX guests.

Bus Lock VM exit is an existing feature supported by KVM. Userspace can enable Bus Lock VM exit through KVM_BUS_LOCK_DETECTION_EXIT when it's reported as supported. However, KVM reports the support of this CAP just based on the hardware capability but doesn't differentiate between VMX and TDX. This leads to the issue that userspace can enable this cap for TDX guests without getting an error, but the feature is not actually enabled because KVM doesn't call the TDX module API to program the relevant TD VMCS fields.

Enable Bus Lock VM exit for TDX guests by programming the BUS_LOCK_DETECTION control in the TD VMCS and by adding the exit handler.

Note, there is no enumeration bit for this feature by TDX module because all TDX modules support it and allow to set the TD VMCS as long as the hardware supports the feature.

---
 arch/x86/kvm/vmx/tdx.c |   24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
arch/x86/kvm/vmx/tdx.c +23 -1
@@ -2042,7 +2042,7 @@ int tdx_complete_emulated_msr(struct kvm
 }
 
 
-int tdx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t fastpath)
+static int __tdx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t fastpath)
 {
 	struct vcpu_tdx *tdx = to_tdx(vcpu);
 	u64 vp_enter_ret = tdx->vp_enter_ret;
@@ -2143,6 +2143,8 @@ int tdx_handle_exit(struct kvm_vcpu *vcp
 	case EXIT_REASON_NOTIFY:
 		/* NMI blocking state is handled by TDX module */
 		return __vt_handle_notify(vcpu, vmx_get_exit_qual(vcpu));
+	case EXIT_REASON_BUS_LOCK:
+		return vt_handle_bus_lock_vmexit(vcpu);
 	default:
 		break;
 	}
@@ -2156,6 +2158,22 @@ unhandled_exit:
 	return 0;
 }
 
+int tdx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t fastpath)
+{
+	int ret = __tdx_handle_exit(vcpu, fastpath);
+
+	/* Exit to user space when bus lock was detected */
+	if (vmx_get_exit_reason(vcpu).bus_lock_detected) {
+		if (ret > 0) {
+			vcpu->run->exit_reason = KVM_EXIT_X86_BUS_LOCK;
+			ret = 0;
+		}
+
+		vcpu->run->flags |= KVM_RUN_X86_BUS_LOCK;
+	}
+	return ret;
+}
+
 void tdx_get_exit_info(struct kvm_vcpu *vcpu, u32 *reason,
 		u64 *info1, u64 *info2, u32 *intr_info, u32 *error_code)
 {
@@ -3151,6 +3169,10 @@ static int tdx_vcpu_init(struct kvm_vcpu
 				vcpu->kvm->arch.notify_window);
 	}
 
+	if (vcpu->kvm->arch.bus_lock_detection_enabled)
+		td_vmcs_setbit32(tdx, SECONDARY_VM_EXEC_CONTROL,
+				 SECONDARY_EXEC_BUS_LOCK_DETECTION);
+
 	tdx->state = VCPU_TD_STATE_INITIALIZED;
 
 	return 0;
author maintainer
#950 lore raw

Re: [PATCH 6.18 0942/1005] KVM: TDX: Enable Bus Lock VM exit

Quoted 6 lines · Xiaoyao Li
Quoted 1 line · Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

There are some dependency patches failed to be backported [1][2][3]. What is the preferred way to handle it? prepare a separate series for 6.18-stable with all the necessary patches?

Yes please.

Do you want me to drop this one for now?

thanks,

greg k-h

#951 lore raw

Re: [PATCH 6.18 0942/1005] KVM: TDX: Enable Bus Lock VM exit

Quoted 11 lines · Greg Kroah-Hartman
Quoted 6 lines · Xiaoyao Li
Quoted 1 line · Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

There are some dependency patches failed to be backported [1][2][3]. What is the preferred way to handle it? prepare a separate series for 6.18-stable with all the necessary patches?

Yes please.

Do you want me to drop this one for now?

Yes, please drop it. Thanks!

maintainer
#952 lore raw

Re: [PATCH 6.18 0942/1005] KVM: TDX: Enable Bus Lock VM exit

Quoted 1 line · Sean Christopherson

Yes, please drop it. Thanks!

Dropped from the 6.18 queue only: 7.3 has the prerequisites.

Signature · 2 lines
Thanks,
Sasha
#953 lore raw

Re: [PATCH 6.18 0942/1005] KVM: TDX: Enable Bus Lock VM exit

Quoted 4 lines · Sasha Levin
Quoted 1 line · Sean Christopherson

Yes, please drop it. Thanks!

Dropped from the 6.18 queue only: 7.3 has the prerequisites.

Can you pick this patch for 6.18 queue now? I check the linux-6.18.y, which now has all the prerequisite patches now.

author maintainer
#954 lore raw

Re: [PATCH 6.18 0942/1005] KVM: TDX: Enable Bus Lock VM exit

Quoted 8 lines · Xiaoyao Li
Quoted 4 lines · Sasha Levin
Quoted 1 line · Sean Christopherson

Yes, please drop it. Thanks!

Dropped from the 6.18 queue only: 7.3 has the prerequisites.

Can you pick this patch for 6.18 queue now? I check the linux-6.18.y, which now has all the prerequisite patches now.

What is "this patch"?

You dropped the context...

#955 lore raw

Re: [PATCH 6.18 0942/1005] KVM: TDX: Enable Bus Lock VM exit

Quoted 5 lines · Greg Kroah-Hartman
Quoted 4 lines · Xiaoyao Li
Quoted 3 lines · Sasha Levin
Quoted 1 line · Sean Christopherson

Yes, please drop it. Thanks!

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Dropped from the 6.18 queue only: 7.3 has the prerequisites.

Can you pick this patch for 6.18 queue now? I check the linux-6.18.y, which now has all the prerequisite patches now.

What is "this patch"?

You dropped the context...

Exactly this one:
https://lore.kernel.org/all/[email protected]/

author maintainer
#956 lore raw

Re: [PATCH 6.18 0942/1005] KVM: TDX: Enable Bus Lock VM exit

Quoted 11 lines · Xiaoyao Li
Quoted 10 lines · Greg Kroah-Hartman
Quoted 8 lines · Xiaoyao Li
Quoted 4 lines · Sasha Levin
Quoted 1 line · Sean Christopherson

Yes, please drop it. Thanks!

Dropped from the 6.18 queue only: 7.3 has the prerequisites.

Can you pick this patch for 6.18 queue now? I check the linux-6.18.y, which now has all the prerequisite patches now.

Quoted 7 lines
Quoted 3 lines

What is "this patch"?

You dropped the context...

Exactly this one:
https://lore.kernel.org/all/[email protected]/

Please just put the info in the email itself

{sigh}

Now, to make it even easier, just send the backported patch properly and we can queue it up that way.

thanks,

greg k-h

#957 lore raw

Re: [PATCH 6.18 0942/1005] KVM: TDX: Enable Bus Lock VM exit

Quoted 20 lines · Greg Kroah-Hartman
Quoted 11 lines · Xiaoyao Li
Quoted 10 lines · Greg Kroah-Hartman
Quoted 8 lines · Xiaoyao Li
Quoted 4 lines · Sasha Levin
Quoted 1 line · Sean Christopherson

Yes, please drop it. Thanks!

Dropped from the 6.18 queue only: 7.3 has the prerequisites.

Can you pick this patch for 6.18 queue now? I check the linux-6.18.y, which now has all the prerequisite patches now.

Quoted 7 lines
Quoted 3 lines

What is "this patch"?

You dropped the context...

Exactly this one:
https://lore.kernel.org/all/[email protected]/

Quoted 6 lines

Please just put the info in the email itself

{sigh}

Now, to make it even easier, just send the backported patch properly and we can queue it up that way.

Learned.

It's good that Sasha has already queued it:
https://lore.kernel.org/all/[email protected]/

I'll make you folks easier next time.

author maintainer
#959 lore raw

PATCH 943/1005 KVM: PPC: Book3S HV: Add preempt_disable() around virtual-mode HPTE bit-lock users

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Amit Machhiwal <[email protected]>

commit abbbe5ff83e7c9ed3a4d61b73011f1df7bf87907 upstream.

kvmppc_hv_find_lock_hpte() requires virtual-mode callers to run with preemption disabled, because it can return with HPTE_V_HVLOCK still held until the caller later unlocks the HPTE. Existing virtual-mode callers in book3s_64_mmu_hv.c already follow that rule.

Two virtual-mode call paths do not:

1. kvmppc_handle_exit_hv() calls kvmppc_hpte_hv_fault() for hash-mode data-side and instruction-side faults after guest exit, with preemption already enabled. kvmppc_hpte_hv_fault() calls kvmppc_hv_find_lock_hpte() directly.

2. kvmppc_pseries_do_hcall() executes virtual-mode handlers for HPT hcalls via kvmppc_pseries_do_hpt_hcall() with preemption enabled. The handlers for H_ENTER, H_REMOVE, H_READ, H_CLEAR_MOD, H_CLEAR_REF, H_PROTECT, and H_BULK_REMOVE spin on try_lock_hpte() or lock_rmap(), and H_ENTER also reaches kvmppc_do_h_enter(), which uses arch_spin_lock() on kvm->mmu_lock. That raw lock choice is intentional because kvmppc_do_h_enter() is also used by real-mode callers, so the correct fix is to establish the proper preemption context at the virtual-mode caller boundary.

If a vCPU thread is preempted while holding HPTE_V_HVLOCK, any other thread on the same CPU trying to acquire the same bit-lock can spin indefinitely. The same applies to lock_rmap() users and to the H_ENTER path while holding the raw mmu_lock.

Fix this by adding preempt_disable()/preempt_enable() pairs around the two kvmppc_hpte_hv_fault() call sites in kvmppc_handle_exit_hv(), and around the kvmppc_pseries_do_hpt_hcall() invocation in kvmppc_pseries_do_hcall(). Targeting only the HPT hcall helper avoids wrapping non-HPT hcalls (such as H_RTAS, H_CONFER, H_REGISTER_VPA) that perform page faults, blocking memory allocations, or context switches.

Fixes 6165d5dd99db ("KVM: PPC: Book3S HV: add virtual mode handlers for HPT hcalls and page faults")
Cc [email protected] # v5.14+
---
 arch/powerpc/kvm/book3s_hv.c |    6 ++++++
 1 file changed, 6 insertions(+)
arch/powerpc/kvm/book3s_hv.c +6 -0
@@ -1208,9 +1208,11 @@ int kvmppc_pseries_do_hcall(struct kvm_v
 	case H_CLEAR_REF:
 	case H_PROTECT:
 	case H_BULK_REMOVE:
+		preempt_disable();
 		idx = srcu_read_lock(&kvm->srcu);
 		ret = kvmppc_pseries_do_hpt_hcall(vcpu, req);
 		srcu_read_unlock(&kvm->srcu, idx);
+		preempt_enable();
 		if (ret == H_TOO_HARD)
 			return RESUME_HOST;
 		break;
@@ -1830,8 +1832,10 @@ static int kvmppc_handle_exit_hv(struct
 		else
 			vsid = vcpu->arch.fault_gpa;
 
+		preempt_disable();
 		err = kvmppc_hpte_hv_fault(vcpu, vcpu->arch.fault_dar,
 				vsid, vcpu->arch.fault_dsisr, true);
+		preempt_enable();
 		if (err == 0) {
 			r = RESUME_GUEST;
 		} else if (err == -1 || err == -2) {
@@ -1877,8 +1881,10 @@ static int kvmppc_handle_exit_hv(struct
 		else
 			vsid = vcpu->arch.fault_gpa;
 
+		preempt_disable();
 		err = kvmppc_hpte_hv_fault(vcpu, vcpu->arch.fault_dar,
 				vsid, vcpu->arch.fault_dsisr, false);
+		preempt_enable();
 		if (err == 0) {
 			r = RESUME_GUEST;
 		} else if (err == -1) {
author maintainer
#960 lore raw

PATCH 944/1005 KVM: PPC: Fix get_d_signext() 12-bit displacement for paired-single D-form

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Amit Machhiwal <[email protected]>

commit 31895b0ff96778b524c74b43a108090581271603 upstream.

get_d_signext() has two compounding bugs since its introduction in 2010:

1. The extraction mask 0x8FF silently drops bits 8-10 of the 12-bit D field (PPC ISA bits 21-23), corrupting any displacement that has any of those bits set.

2. The sign-magnitude idiom "-(d & 0x7ff)" is wrong for two's-complement:
for D=0xFFC (encoding of -4) it returns -252 instead of -4.

Together these errors produce a wrong effective address for psq_l, psq_lu, psq_st, and psq_stu whenever the displacement is negative or is a positive value >= 0x100 with bits 8-10 set — essentially any real-world paired- single stack-relative access.

The D field occupies the bottom 12 bits of the instruction word (confirmed by the adjacent W and I extractions via inst_get_field(inst,16,16) and inst_get_field(inst,17,19)). Replace the open-coded logic with the standard sign_extend32(inst & 0xfff, 11), which correctly performs two's-complement sign extension from 12 bits to 32 bits.

---
 arch/powerpc/kvm/book3s_paired_singles.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
arch/powerpc/kvm/book3s_paired_singles.c +1 -6
@@ -479,12 +479,7 @@ static bool kvmppc_inst_is_paired_single
 
 static int get_d_signext(u32 inst)
 {
-	int d = inst & 0x8ff;
-
-	if (d & 0x800)
-		return -(d & 0x7ff);
-
-	return (d & 0x7ff);
+	return sign_extend32(inst & 0xfff, 11);
 }
 
 static int kvmppc_ps_three_in(struct kvm_vcpu *vcpu, bool rc,
author maintainer
#961 lore raw

PATCH 945/1005 HID: zydacron: validate key report length

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit 9932c9af185f8586e883d44ca562c12f4487c762 upstream.

The HID core invokes raw_event callbacks before validating the report length. zc_raw_event() verifies the report ID in byte zero and then reads the key code from byte one for report IDs 0x02 and 0x03 without checking that the second byte is present.

A one-byte report reproduced the issue under KASAN:

  BUG: KASAN: slab-out-of-bounds in zc_raw_event+0x54c/0x580
  Read of size 1 by task hidtrigger/93
  Call Trace:
   zc_raw_event+0x54c/0x580
   __hid_input_report+0x2ef/0x3a0
   inject_store+0x479/0x490 [faketrans]

Require both the report ID and key code before processing the report.

Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw_event length validation to hid-asus.

Fixes d0742abaa1c3 ("HID: add omitted hid-zydacron.c file")
---
 drivers/hid/hid-zydacron.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-zydacron.c +3 -0
@@ -114,6 +114,9 @@ static int zc_raw_event(struct hid_devic
 	unsigned key;
 	unsigned short index;
 
+	if (size < 2)
+		return 0;
+
 	if (report->id == data[0] && (hdev->claimed & HID_CLAIMED_INPUT)) {
 
 		/* break keys */
author maintainer
#962 lore raw

PATCH 946/1005 HID: amd_sfh: Remove unsupported motion-state field from accelerometer report

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Basavaraj Natikar <[email protected]>

commit 6ff86122906357687735dd379c6279e3b2fa26af upstream.

The accelerometer HID report descriptor declares a trailing motion-state field (usage 0x0451), but the Sensor Fusion Hub never reports this data, so each accelerometer input report is one byte shorter than the descriptor advertises.

This was previously harmless because hid-core zero-padded short reports. Since commit 0a3fe972a7cb ("HID: core: Mitigate potential OOB by removing bogus memset()") such reports are rejected instead:

hid-sensor-hub 0020:1022:0001.0003: Event data for report 1 was too short (15 vs 14)

As a result the accelerometer input events are dropped and screen auto-rotation stops working on AMD SFH systems.

Remove the motion-state field from the accelerometer report descriptor and drop the unused in_accel_shake_detection member, so the descriptor matches the report actually provided by the hardware.

---
 drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h        |    2 --
 drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h |    7 -------
 2 files changed, 9 deletions(-)
drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.h +0 -2
@@ -48,8 +48,6 @@ struct accel3_input_report {
 	int in_accel_x_value;
 	int in_accel_y_value;
 	int in_accel_z_value;
-	/* include if required to support the "shake" event */
-	u8 in_accel_shake_detection;
 } __packed;
 
 struct gyro_feature_report {
drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_report_desc.h +0 -7
@@ -169,13 +169,6 @@ static const u8 accel3_report_descriptor
 0x95, 1,		/* HID report count (1) */
 0x55, 0x0E,		/* HID unit exponent(0x0E) */
 0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
-
-0x0A, 0x51, 0x04,	/* HID usage sensor data motion state */
-0x15, 0,		/* HID logical Min_8(0) False = Still*/
-0x25, 1,		/* HID logical Min_8(1) True = In motion */
-0x75, 8,		/* HID report size(8) */
-0x95, 1,		/* HID report count (1) */
-0X81, 0x02,		/* HID Input (Data_Arr_Abs) */
 0xC0			/* HID end collection */
 };
 
author maintainer
#963 lore raw

PATCH 947/1005 HID: amd_sfh: Use report type from request node

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Basavaraj Natikar <[email protected]>

commit 85f1bea97f1909f81577cfcf3e4db9017e7f5337 upstream.

Use report type from request node while sending feature and input reports to HID core. The cli_data report type array is never assigned and feature reports are sent as input reports.

Fixes 1434f9fc0e47 ("SFH: Create HID report to Enable support of AMD sensor fusion Hub (SFH)")
---
 drivers/hid/amd-sfh-hid/amd_sfh_client.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/amd-sfh-hid/amd_sfh_client.c +2 -2
@@ -95,7 +95,7 @@ void amd_sfh_work(struct work_struct *wo
 						    cli_data->feature_report[current_index]);
 		if (report_size)
 			hid_input_report(cli_data->hid_sensor_hubs[current_index],
-					 cli_data->report_type[current_index],
+					 node_type,
 					 cli_data->feature_report[current_index], report_size, 0);
 		else
 			pr_err("AMDSFH: Invalid report size\n");
@@ -104,7 +104,7 @@ void amd_sfh_work(struct work_struct *wo
 		report_size = mp2_ops->get_in_rep(current_index, sensor_index, report_id, in_data);
 		if (report_size)
 			hid_input_report(cli_data->hid_sensor_hubs[current_index],
-					 cli_data->report_type[current_index],
+					 node_type,
 					 in_data->input_report[current_index], report_size, 0);
 		else
 			pr_err("AMDSFH: Invalid report size\n");
author maintainer
#964 lore raw

PATCH 948/1005 HID: core: Fix out-of-bounds left shift by 32 in s32ton()

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Alan Stern <[email protected]>

commit 5fe63b415c636c7f4f6848a8e53bdd4bbf0c300d upstream.

Syzbot reported an out-of-bounds shift (32-bit integer shifted left by
32) in the s32ton() routine in the HID core. This routine converts a signed 32-bit integer to a signed n-bit integer, and it caps the value of n at 32. But when n == 32 there's no need to do anything; it can simply return the input value. This will avoid calculating (1 << n) when n is 32, which was the cause of the invalid shift.

---
 drivers/hid/hid-core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-core.c +2 -2
@@ -71,8 +71,8 @@ static u32 s32ton(__s32 value, unsigned
 	if (!value || !n)
 		return 0;
 
-	if (n > 32)
-		n = 32;
+	if (n >= 32)
+		return (u32) value;
 
 	a = value >> (n - 1);
 	if (a && a != -1)
author maintainer
#965 lore raw

PATCH 949/1005 HID: cougar: reject short special-key reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit c6c0df8a4b73a0d563c5e64de640ef5ff525fc82 upstream.

The HID core invokes raw_event callbacks before validating the report length. cougar_raw_event() reads the key code and action from offsets one and two without checking that those bytes are present. A short report on the special interface can therefore cause an out-of-bounds read.

Consume reports that do not contain the action field before accessing the fixed offsets, consistent with the callback's handling of other reports on the special interface.

Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw_event length validation to hid-asus.

Fixes b8e759b8f6da ("HID: cougar: Add support for the Cougar 500k Gaming Keyboard")
---
 drivers/hid/hid-cougar.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-cougar.c +3 -0
@@ -270,6 +270,9 @@ static int cougar_raw_event(struct hid_d
 	if (!shared->enabled || !shared->input)
 		return -EPERM;
 
+	if (size <= COUGAR_FIELD_ACTION)
+		return -EPERM;
+
 	code = data[COUGAR_FIELD_CODE];
 	action = data[COUGAR_FIELD_ACTION];
 	for (i = 0; cougar_mapping[i][0]; i++) {
author maintainer
#966 lore raw

PATCH 950/1005 HID: cp2112: validate response report lengths

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit fc54e71a063c0dcc4bceba6d0f71805a9b84082d upstream.

The HID core invokes raw_event callbacks before validating the report length. cp2112_raw_event() reads every field of a transfer status response without checking size. For a data response, it reads the length at offset two and copies that many bytes from offset three, again without ensuring that the input report contains them.

Require a complete transfer status structure. For data responses, first require the header and then ensure the clamped payload length fits in the received report before copying it.

Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw_event length validation to hid-asus.

Fixes e932d8178667 ("HID: add hid-cp2112 driver")
---
 drivers/hid/hid-cp2112.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/hid/hid-cp2112.c +8 -1
@@ -1389,6 +1389,9 @@ static int cp2112_raw_event(struct hid_d
 
 	switch (data[0]) {
 	case CP2112_TRANSFER_STATUS_RESPONSE:
+		if (size < sizeof(*xfer))
+			return 0;
+
 		hid_dbg(hdev, "xfer status: %02x %02x %04x %04x\n",
 			xfer->status0, xfer->status1,
 			be16_to_cpu(xfer->retries), be16_to_cpu(xfer->length));
@@ -1422,11 +1425,16 @@ static int cp2112_raw_event(struct hid_d
 		atomic_set(&dev->xfer_avail, 1);
 		break;
 	case CP2112_DATA_READ_RESPONSE:
+		if (size < 3)
+			return 0;
+
 		hid_dbg(hdev, "read response: %02x %02x\n", data[1], data[2]);
 
 		dev->read_length = data[2];
 		if (dev->read_length > sizeof(dev->read_data))
 			dev->read_length = sizeof(dev->read_data);
+		if (dev->read_length > size - 3)
+			return 0;
 
 		memcpy(dev->read_data, &data[3], dev->read_length);
 		atomic_set(&dev->read_avail, 1);
@@ -1453,4 +1461,3 @@ module_hid_driver(cp2112_driver);
 MODULE_DESCRIPTION("Silicon Labs HID USB to SMBus master bridge");
 MODULE_AUTHOR("David Barksdale <[email protected]>");
 MODULE_LICENSE("GPL");
-
author maintainer
#967 lore raw

PATCH 951/1005 HID: elo: reject short touchscreen reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit 1cb92fcb2ac344d78737e3c5cb7b061dfb2850b1 upstream.

The HID core invokes raw_event callbacks before validating the report length. elo_raw_event() only checks the first-byte packet marker before elo_process_data() reads coordinates, flags, and pressure through offset seven. A truncated packet beginning with the expected marker can therefore cause an out-of-bounds read.

Require the complete eight-byte SmartSet packet before parsing it.

Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw_event length validation to hid-asus.

Fixes d23efc19478a ("HID: add driver for ELO 4000/4500")
---
 drivers/hid/hid-elo.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-elo.c +3 -0
@@ -85,6 +85,9 @@ static int elo_raw_event(struct hid_devi
 	if (!(hdev->claimed & HID_CLAIMED_INPUT) || list_empty(&hdev->inputs))
 		return 0;
 
+	if (size < ELO_SMARTSET_PACKET_SIZE)
+		return 0;
+
 	hidinput = list_first_entry(&hdev->inputs, struct hid_input, list);
 
 	switch (report->id) {
author maintainer
#968 lore raw

PATCH 952/1005 HID: logitech-dj: validate unnumbered keyboard reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit c2deafcb4c8227771f768d77ed3c0a489250e9b2 upstream.

The HID core invokes raw_event callbacks before validating the report length. For an unnumbered keyboard report, logi_dj_raw_event() uses the second byte as temporary storage while prepending a report ID. A one-byte report therefore makes both the initial write and the later restoration access data beyond the received report.

Reject unnumbered keyboard reports that do not provide the temporary byte.

Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw_event length validation to hid-asus.

Fixes 74808f9115ce ("HID: logitech-dj: add support for non unifying receivers")
---
 drivers/hid/hid-logitech-dj.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-logitech-dj.c +3 -0
@@ -1682,6 +1682,9 @@ static int logi_dj_raw_event(struct hid_
 	if (!hdev->report_enum[HID_INPUT_REPORT].numbered) {
 
 		if (djrcv_dev->unnumbered_application == HID_GD_KEYBOARD) {
+			if (size < 2)
+				return false;
+
 			/*
 			 * For the keyboard, we can reuse the same report by
 			 * using the second byte which is constant in the USB
author maintainer
#969 lore raw

PATCH 953/1005 HID: mcp2200: validate READ_ALL response length

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit 26ce0e6bf0b27fc6a2f490f38555dfd0a27c9605 upstream.

The HID core invokes raw_event callbacks before validating the report length. mcp2200_raw_event() casts a READ_ALL response to struct mcp_read_all_resp and reads fields through offset ten without checking that the response contains the structure.

A one-byte READ_ALL response reproduced the issue under KASAN:

  BUG: KASAN: slab-out-of-bounds in mcp2200_raw_event+0x24b/0x3a0
  Read of size 1 by task hidtrigger/89
  Call Trace:
   mcp2200_raw_event+0x24b/0x3a0
   kasan_report+0x139/0x170

Reject an incomplete READ_ALL response with a protocol error before reading its fields. The common completion path then wakes the command waiter with the error instead of leaving it to time out.

Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw_event length validation to hid-asus.

Fixes 740329d7120f ("HID: mcp2200: added driver for GPIOs of MCP2200")
---
 drivers/hid/hid-mcp2200.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/hid/hid-mcp2200.c +5 -0
@@ -301,6 +301,11 @@ static int mcp2200_raw_event(struct hid_
 
 	switch (data[0]) {
 	case READ_ALL:
+		if (size < sizeof(*all_resp)) {
+			mcp->status = -EPROTO;
+			break;
+		}
+
 		all_resp = (struct mcp_read_all_resp *) data;
 		mcp->status = 0;
 		mcp->gpio_inval = all_resp->io_port_val_bmap;
author maintainer
#970 lore raw

PATCH 954/1005 HID: mcp2221: validate response report length

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit 1ae40774d386b7a51e4799200106429a7e14e8ec upstream.

MCP2221 responses are 64-byte reports, but mcp2221_raw_event() currently accepts any report of at least four bytes. Several response handlers read far beyond that minimum. In particular, the I2C status response reads offset 20 and copies ADC samples starting at offset 50. Other GPIO, SRAM, and flash response handlers also access fixed offsets beyond byte three.

The HID core invokes raw_event callbacks before validating the report length, so a truncated response can cause an out-of-bounds read. Require a complete protocol report before dispatching any response handler.

Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw_event length validation to hid-asus.

Fixes 67a95c21463d ("HID: mcp2221: add usb to i2c-smbus host bridge")
---
 drivers/hid/hid-mcp2221.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-mcp2221.c +1 -1
@@ -858,7 +858,7 @@ static int mcp2221_raw_event(struct hid_
 	u8 *buf;
 	struct mcp2221 *mcp = hid_get_drvdata(hdev);
 
-	if (size < 4)
+	if (size < sizeof(mcp->txbuf))
 		return 0;
 
 	switch (data[0]) {
author maintainer
#971 lore raw

PATCH 955/1005 HID: picoLCD: check for fb_deferred_io_init() error

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Lorenzo Stoakes (ARM) <[email protected]>

commit feade898fc958ff355101adf12d5632272e64220 upstream.

fb_deferred_io_init() allocates deferred I/O state, populating info->fbdefio_state, or leaving it NULL if an error occurs.

Currently picolcd_init_framebuffer() ignores its return value.

Therefore if an error arises in fb_deferred_io_init() (for instance, due to an allocation failure) info->fbdefio_state is left NULL.

When the file is subsequently opened, fb_open() will dereference a NULL pointer (calling fb_deferred_io_open()).

Fix this by checking for the error.

Also correct cleanup ordering - defio is initialised after the sysfs file, so cleanup defio first.

Fixes 56c134f7f1b5 ("fbdev: Track deferred-I/O pages in pageref struct")
---
 drivers/hid/hid-picolcd_fb.c |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/hid/hid-picolcd_fb.c +9 -3
@@ -531,17 +531,23 @@ int picolcd_init_framebuffer(struct pico
 		goto err_cleanup;
 	}
 
-	fb_deferred_io_init(info);
+	error = fb_deferred_io_init(info);
+	if (error) {
+		dev_err(dev, "failed to initialize deferred I/O\n");
+		goto err_sysfs;
+	}
+
 	error = register_framebuffer(info);
 	if (error) {
 		dev_err(dev, "failed to register framebuffer\n");
-		goto err_sysfs;
+		goto err_defio;
 	}
 	return 0;
 
+err_defio:
+	fb_deferred_io_cleanup(info);
 err_sysfs:
 	device_remove_file(dev, &dev_attr_fb_update_rate);
-	fb_deferred_io_cleanup(info);
 err_cleanup:
 	data->fb_info    = NULL;
 
author maintainer
#972 lore raw

PATCH 956/1005 HID: prodikeys: validate fixed-format MIDI reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit 0ff37294c41bd925258893310398bc2b45fcd4a7 upstream.

The HID core invokes raw_event callbacks before validating the report length. Prodikeys reports 0x01 and 0x04 are passed to handlers that always read bytes one through three, regardless of the supplied size. A truncated report can therefore cause an out-of-bounds read.

Require four bytes for the two fixed-format reports. Keep report 0x03 on its existing variable-length path, which derives the number of note pairs from size and only accesses complete pairs.

Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw_event length validation to hid-asus.

Fixes 3a370ca1dcf8 ("HID: Prodikeys PC-MIDI HID Driver")
---
 drivers/hid/hid-prodikeys.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/hid/hid-prodikeys.c +6 -1
@@ -772,8 +772,13 @@ static int pk_raw_event(struct hid_devic
 		if (report->id == data[0])
 			switch (report->id) {
 			case 0x01: /* midi keys (qwerty)*/
-			case 0x03: /* midi keyboard (musical)*/
 			case 0x04: /* extra/midi keys (qwerty)*/
+				if (size < 4)
+					break;
+				ret = pcmidi_handle_report(pm, report->id,
+							   data, size);
+				break;
+			case 0x03: /* midi keyboard (musical)*/
 				ret = pcmidi_handle_report(pm,
 						report->id, data, size);
 				break;
author maintainer
#973 lore raw

PATCH 957/1005 HID: pxrc: reject short input reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit 0deb22da5a8c6663c3e071f55fd7d7e3189f5517 upstream.

The HID core invokes raw_event callbacks before validating the report length. pxrc_raw_event() reads byte seven and writes bytes one and seven without checking that the report contains those bytes.

A one-byte input report reproduced the first invalid access under KASAN:

  BUG: KASAN: slab-out-of-bounds in pxrc_raw_event+0x161/0x260
  Read of size 1 by task hidtrigger/90
  Call Trace:
   pxrc_raw_event+0x161/0x260
   kasan_report+0x139/0x170

Require all eight bytes before reading or rewriting the report.

Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw_event length validation to hid-asus.

Fixes acc3e34613da ("HID: Add driver for PhoenixRC Flight Controller")
---
 drivers/hid/hid-pxrc.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-pxrc.c +3 -0
@@ -55,6 +55,9 @@ static int pxrc_raw_event(struct hid_dev
 {
 	struct pxrc_priv *priv = hid_get_drvdata(hdev);
 
+	if (size < 8)
+		return 0;
+
 	if (priv->alternate)
 		priv->slider = data[7];
 	else
author maintainer
#974 lore raw

PATCH 958/1005 HID: quirks: Always poll the Anne Pro 2 with product ID a292

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Gabor Tanz <[email protected]>

commit cbc13a78a89d087252947d0a51048e576cfcb3ef upstream.

The wired Anne Pro 2 identifying as 04d9:a292 stops delivering keyboard input after a period of inactivity. Unplugging and reconnecting the keyboard restores input.

Keeping ObinsKit running prevents the problem. A read-only userspace reader that keeps USB HID interface 1 open also prevents it, as does usbhid.quirks=0x04d9:0xa292:0x00000400 without either application running.

Commit ca28aff0e1dc ("HID: quirks: Always poll Obins Anne Pro 2 keyboard") added HID_QUIRK_ALWAYS_POLL for product ID a293. The variant identifying as 04d9:a292 exhibits the same symptom. Apply the quirk to this product ID as well.

---
 drivers/hid/hid-ids.h    |    1 +
 drivers/hid/hid-quirks.c |    1 +
 2 files changed, 2 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -719,6 +719,7 @@
 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081	0xa081
 #define USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2	0xa0c2
 #define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096	0xa096
+#define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A292	0xa292
 #define USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A293	0xa293
 
 #define USB_VENDOR_ID_IMATION		0x0718
drivers/hid/hid-quirks.c +1 -0
@@ -102,6 +102,7 @@ static const struct hid_device_id hid_qu
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FIGHTING), HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING), HID_QUIRK_BADPAD | HID_QUIRK_MULTI_INPUT },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A096), HID_QUIRK_NO_INIT_REPORTS },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A292), HID_QUIRK_ALWAYS_POLL },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD_A293), HID_QUIRK_ALWAYS_POLL },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0A4A), HID_QUIRK_ALWAYS_POLL },
 	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_ELITE_PRESENTER_MOUSE_464A), HID_QUIRK_MULTI_INPUT },
author maintainer
#975 lore raw

PATCH 959/1005 HID: roccat: isku: reject short button reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit 93e5f7f6189af76a2b2e2dfe647838a7b9f99d21 upstream.

The raw event callback runs before HID core validates and zero-pads the report. It passes the buffer to helpers which inspect data[0] and, for a button report, read the complete struct isku_report_button. A truncated report can therefore cause an out-of-bounds read.

Require enough data for the button report before calling either helper. Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw-event length validation to hid-asus.

Fixes d41c2a7011df ("HID: roccat: Add support for Isku keyboard")
---
 drivers/hid/hid-roccat-isku.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-roccat-isku.c +3 -0
@@ -411,6 +411,9 @@ static int isku_raw_event(struct hid_dev
 	if (isku == NULL)
 		return 0;
 
+	if (size < sizeof(struct isku_report_button))
+		return 0;
+
 	isku_keep_values_up_to_date(isku, data);
 
 	if (isku->roccat_claimed)
author maintainer
#976 lore raw

PATCH 960/1005 HID: roccat: koneplus: reject short button reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit d879e17a8b4c572c0b53b4e42a36849484e8f00c upstream.

The raw event callback runs before HID core validates and zero-pads the report. It passes the buffer to helpers which inspect data[0] and, for a button report, read the complete struct koneplus_mouse_report_button. A truncated report can therefore cause an out-of-bounds read.

Require enough data for the button report before calling either helper. Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw-event length validation to hid-asus.

Fixes 47dbdbffe15b ("HID: roccat: Add support for Roccat Kone[+] v2")
---
 drivers/hid/hid-roccat-koneplus.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-roccat-koneplus.c +3 -0
@@ -523,6 +523,9 @@ static int koneplus_raw_event(struct hid
 	if (koneplus == NULL)
 		return 0;
 
+	if (size < sizeof(struct koneplus_mouse_report_button))
+		return 0;
+
 	koneplus_keep_values_up_to_date(koneplus, data);
 
 	if (koneplus->roccat_claimed)
author maintainer
#977 lore raw

PATCH 961/1005 HID: roccat: konepure: reject short button reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit 1590b7c9bea0abe7a5d25dbfe06287c48c238a6f upstream.

The raw event callback runs before HID core validates and zero-pads the report. It reads the report number without checking the received length and passes matching data to roccat_report_event(), which copies a complete struct konepure_mouse_report_button. A truncated report can therefore cause an out-of-bounds read and expose adjacent data through the Roccat character device.

Require a complete button report before inspecting or forwarding it. Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw-event length validation to hid-asus.

Fixes 8936aa31cd5f ("HID: roccat: add support for Roccat Kone Pure gaming mouse")
---
 drivers/hid/hid-roccat-konepure.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-roccat-konepure.c +3 -0
@@ -181,6 +181,9 @@ static int konepure_raw_event(struct hid
 			!= USB_INTERFACE_PROTOCOL_MOUSE)
 		return 0;
 
+	if (size < sizeof(struct konepure_mouse_report_button))
+		return 0;
+
 	if (data[0] != KONEPURE_MOUSE_REPORT_NUMBER_BUTTON)
 		return 0;
 
author maintainer
#978 lore raw

PATCH 962/1005 HID: roccat: kovaplus: reject short button reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit e95917a606f486e46f5136fc1b72190742a091d6 upstream.

The raw event callback runs before HID core validates and zero-pads the report. It passes the buffer to helpers which inspect data[0] and read a complete struct kovaplus_mouse_report_button for button reports. A truncated report can therefore cause an out-of-bounds read.

Require enough data for the button report before calling either helper. Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw-event length validation to hid-asus.

Fixes 0e70f97f257e ("HID: roccat: Add support for Kova[+] mouse")
---
 drivers/hid/hid-roccat-kovaplus.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-roccat-kovaplus.c +3 -0
@@ -614,6 +614,9 @@ static int kovaplus_raw_event(struct hid
 	if (kovaplus == NULL)
 		return 0;
 
+	if (size < sizeof(struct kovaplus_mouse_report_button))
+		return 0;
+
 	kovaplus_keep_values_up_to_date(kovaplus, data);
 
 	if (kovaplus->roccat_claimed)
author maintainer
#979 lore raw

PATCH 963/1005 HID: roccat: pyra: reject short button reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit 493268f459bb6aeeecbc77f2204c11ad74d05213 upstream.

The raw event callback runs before HID core validates and zero-pads the report. It passes the buffer to helpers which inspect data[0] and read a complete struct pyra_mouse_event_button for button reports. A truncated report can therefore cause an out-of-bounds read.

Require enough data for the button report before calling either helper. Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw-event length validation to hid-asus.

Fixes cb7cf3da0daa ("HID: roccat: add driver for Roccat Pyra mouse")
---
 drivers/hid/hid-roccat-pyra.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-roccat-pyra.c +3 -0
@@ -557,6 +557,9 @@ static int pyra_raw_event(struct hid_dev
 	if (pyra == NULL)
 		return 0;
 
+	if (size < sizeof(struct pyra_mouse_event_button))
+		return 0;
+
 	pyra_keep_values_up_to_date(pyra, data);
 
 	if (pyra->roccat_claimed)
author maintainer
#980 lore raw

PATCH 964/1005 HID: roccat: ryos: reject short special reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit 02f3607d0beb82e76481568bf631235e6a319b47 upstream.

The raw event callback runs before HID core validates and zero-pads the report. It reads the report number without checking the received length and passes matching data to roccat_report_event(), which copies a complete struct ryos_report_special. A truncated report can therefore cause an out-of-bounds read and expose adjacent data through the Roccat character device.

Require a complete special report before inspecting or forwarding it. Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw-event length validation to hid-asus.

Fixes 6f3a19360545 ("HID: roccat: add support for Ryos MK keyboards")
---
 drivers/hid/hid-roccat-ryos.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-roccat-ryos.c +3 -0
@@ -189,6 +189,9 @@ static int ryos_raw_event(struct hid_dev
 			!= RYOS_USB_INTERFACE_PROTOCOL)
 		return 0;
 
+	if (size < sizeof(struct ryos_report_special))
+		return 0;
+
 	if (data[0] != RYOS_REPORT_NUMBER_SPECIAL)
 		return 0;
 
author maintainer
#981 lore raw

PATCH 965/1005 HID: roccat: savu: reject short special reports

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiale Yao <[email protected]>

commit 76c51fdc825a0486f8d88ff896d39acec8f377b4 upstream.

The raw event callback runs before HID core validates and zero-pads the report. It passes the buffer to a helper which inspects data[0] and, for a special report, reads the complete struct savu_mouse_report_special. A truncated report can therefore cause an out-of-bounds read.

Require enough data for the special report before calling the helper. Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init sequence") added the same kind of raw-event length validation to hid-asus.

Fixes 6a2a6390cf09 ("HID: roccat: add support for Roccat Savu")
---
 drivers/hid/hid-roccat-savu.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/hid/hid-roccat-savu.c +3 -0
@@ -182,6 +182,9 @@ static int savu_raw_event(struct hid_dev
 	if (savu == NULL)
 		return 0;
 
+	if (size < sizeof(struct savu_mouse_report_special))
+		return 0;
+
 	if (savu->roccat_claimed)
 		savu_report_to_chrdev(savu, data);
 
author maintainer
#982 lore raw

PATCH 966/1005 ovl: check that the parents of volatile/dirty are dirs

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chris Mason <[email protected]>

commit e34d2ef818e4c7676d8d8e1bf43e6a1ed39efb2a upstream.

An unprivileged user crashes the kernel by mounting overlayfs with the volatile option.

A dentry that serves as the parent of a lookup must be a directory. ovl_create_volatile_dirty() walks work/incompat/volatile/dirty by name, and ovl_lookup_or_create() returns an existing entry whatever its type. A file or a symlink that another task creates during the mount becomes the parent of the next lookup, which calls a NULL ->lookup.

An unprivileged user mounted overlayfs with "volatile" in a user namespace while a second process created a symlink named work/incompat, and the mount task oopsed on a NULL ->lookup call.

Fix this by returning -ENOTDIR from ovl_lookup_or_create() when the caller asked for a directory and the existing entry is a non-dir.

Fixes c86243b090bc ("ovl: provide a mount option "volatile"")

[backport: no ovl_start_creating_upper(), check the child of
ovl_lookup_upper() in ovl_lookup_or_create() instead]

---
 fs/overlayfs/super.c |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
fs/overlayfs/super.c +12 -4
@@ -624,15 +624,23 @@ cleanup_temp:
 
 static struct dentry *ovl_lookup_or_create(struct ovl_fs *ofs,
 					   struct dentry *parent,
-					   const char *name, umode_t mode)
+					   const char *name, bool is_dir)
 {
 	size_t len = strlen(name);
 	struct dentry *child;
 
 	inode_lock_nested(parent->d_inode, I_MUTEX_PARENT);
 	child = ovl_lookup_upper(ofs, name, parent, len);
-	if (!IS_ERR(child) && !child->d_inode)
-		child = ovl_create_real(ofs, parent, child, OVL_CATTR(mode));
+	if (!IS_ERR(child)) {
+		if (!child->d_inode) {
+			child = ovl_create_real(ofs, parent, child,
+						OVL_CATTR(is_dir ? S_IFDIR :
+								   S_IFREG));
+		} else if (is_dir && !d_can_lookup(child)) {
+			dput(child);
+			child = ERR_PTR(-ENOTDIR);
+		}
+	}
 	inode_unlock(parent->d_inode);
 	dput(parent);
 
@@ -653,7 +661,7 @@ static int ovl_create_volatile_dirty(str
 	const char *const *name = volatile_path;
 
 	for (ctr = ARRAY_SIZE(volatile_path); ctr; ctr--, name++) {
-		d = ovl_lookup_or_create(ofs, d, *name, ctr > 1 ? S_IFDIR : S_IFREG);
+		d = ovl_lookup_or_create(ofs, d, *name, ctr > 1);
 		if (IS_ERR(d))
 			return PTR_ERR(d);
 	}
author maintainer
#983 lore raw

PATCH 967/1005 ovl: hold a reference on the parent in readdir

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chris Mason <[email protected]>

commit 16d319e12328acafeafd3eecdf09c46d7fb43452 upstream.

Listing a directory on an overlay uses a freed dentry and crashes the kernel when a lookup moves the directory at the same time.

Code that can sleep may only use d_parent without a reference while something stops a move of the dentry. ovl_iterate_real(), ovl_need_adjust_d_ino() and ovl_cache_update() use the d_parent of the listed directory and hold only the lock of that directory. When a lookup finds the directory under another parent after a change to a layer, d_splice_alias() moves it without that lock and drops its reference on the old parent.

With a delay in ovl_iterate_real(), getdents64 on an overlay directory raced a rename in the lower layer and a lookup that moved its dentry, and after an rmdir of the old parent KASAN reported a use-after-free in security_inode_getattr().

Fix this by using dget_parent() in the three functions.

Fixes b5efccbe0a12 ("ovl: constant d_ino across copy up")
[amir: fix comments in ovl_need_adjust_d_ino()]

[backport: no ovl_need_adjust_d_ino(), take the parent with dget_parent()
in ovl_iterate() and test a local flag]

---
 fs/overlayfs/readdir.c |   26 +++++++++++++++++++-------
 1 file changed, 19 insertions(+), 7 deletions(-)
fs/overlayfs/readdir.c +19 -7
@@ -572,8 +572,8 @@ static int ovl_cache_update(const struct
 			goto get;
 		}
 		if (p->len == 2 && p->name[1] == '.') {
-			/* we shall not be moved */
-			this = dget(dir->d_parent);
+			/* d_splice_alias() can move even a locked dir */
+			this = dget_parent(dir);
 			goto get;
 		}
 	}
@@ -802,6 +802,7 @@ static int ovl_iterate_real(struct file
 	struct dentry *dir = file->f_path.dentry;
 	struct ovl_fs *ofs = OVL_FS(dir->d_sb);
 	const struct ovl_layer *lower_layer = ovl_layer_lower(dir);
+	struct dentry *parent;
 	struct ovl_readdir_translate rdt = {
 		.ctx.actor = ovl_fill_real,
 		.ctx.count = ctx->count,
@@ -813,18 +814,26 @@ static int ovl_iterate_real(struct file
 	if (rdt.xinobits && lower_layer)
 		rdt.fsid = lower_layer->fsid;
 
-	if (OVL_TYPE_MERGE(ovl_path_type(dir->d_parent))) {
+	/*
+	 * The lock on dir does not stop d_splice_alias() from moving it to
+	 * another parent, which drops the reference dir holds on this one.
+	 */
+	parent = dget_parent(dir);
+	if (OVL_TYPE_MERGE(ovl_path_type(parent))) {
 		struct kstat stat;
 		struct path statpath = file->f_path;
 
-		statpath.dentry = dir->d_parent;
+		statpath.dentry = parent;
 		err = vfs_getattr(&statpath, &stat, STATX_INO, 0);
-		if (err)
+		if (err) {
+			dput(parent);
 			return err;
+		}
 
 		WARN_ON_ONCE(dir->d_sb->s_dev != stat.dev);
 		rdt.parent_ino = stat.ino;
 	}
+	dput(parent);
 
 	if (ovl_is_impure_dir(file)) {
 		rdt.cache = ovl_cache_get_impure(&file->f_path);
@@ -853,6 +862,10 @@ static int ovl_iterate(struct file *file
 		ovl_dir_reset(file);
 
 	if (od->is_real) {
+		struct dentry *parent = dget_parent(dentry);
+		bool parent_merge = OVL_TYPE_MERGE(ovl_path_type(parent));
+
+		dput(parent);
 		/*
 		 * If parent is merge, then need to adjust d_ino for '..', if
 		 * dir is impure then need to adjust d_ino for copied up
@@ -860,8 +873,7 @@ static int ovl_iterate(struct file *file
 		 */
 		if (ovl_xino_bits(ofs) ||
 		    (ovl_same_fs(ofs) &&
-		     (ovl_is_impure_dir(file) ||
-		      OVL_TYPE_MERGE(ovl_path_type(dentry->d_parent))))) {
+		     (ovl_is_impure_dir(file) || parent_merge))) {
 			err = ovl_iterate_real(file, ctx);
 		} else {
 			err = iterate_dir(od->realfile, ctx);
author maintainer
#984 lore raw

PATCH 968/1005 ovl: do not copy up a dentry that was removed

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chris Mason <[email protected]>

commit f635192ad223d2009ee640b63adf5ce3198aa338 upstream.

A change to a removed file through an open descriptor replaces whatever has its old name in the upper layer.

Copy up must only create a name in the upper directory, never replace one. After an unlink, an rmdir or a rename over a lower dentry, a dentry that an open file keeps alive still has its old parent and name, but in the upper directory that name is now a whiteout or a new object. ovl_copy_up_workdir() renames the copy over it, which brings back the removed object and destroys whatever took its name.

An unprivileged user opened a lower FIFO and unlinked it, root created a file at that name, and fchmod on the old descriptor replaced the file of root with the FIFO.

Fix this by looking up the target name of the rename in ovl_copy_up_workdir() with LOOKUP_EXCL, so that copy up fails with -EEXIST if the name is taken, as copy up with O_TMPFILE already does when it links the copy to the name.

Fixes e9be9d5e76e3 ("overlay filesystem")
[amir: use LOOKUP_EXCL instead of relying on d_unhashed()]

[backport: no start_renaming_dentry() and LOOKUP_EXCL, fail with -EEXIST if
the target of ovl_lookup_upper() is positive]

---
 fs/overlayfs/copy_up.c |    7 +++++++
 1 file changed, 7 insertions(+)
fs/overlayfs/copy_up.c +7 -0
@@ -830,6 +830,13 @@ static int ovl_copy_up_workdir(struct ov
 	if (IS_ERR(upper))
 		goto cleanup;
 
+	/* The name may have been taken since lookup, never replace it */
+	err = -EEXIST;
+	if (d_is_positive(upper)) {
+		dput(upper);
+		goto cleanup;
+	}
+
 	err = ovl_do_rename(ofs, c->workdir, temp, c->destdir, upper, 0);
 	unlock_rename(c->workdir, c->destdir);
 	dput(upper);
author maintainer
#985 lore raw

PATCH 969/1005 ovl: fix mount setup failing when override_creds drops CAP_SYS_ADMIN

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Amir Goldstein <[email protected]>

commit 333ad304d4794d6384087ea7fc16e58ab642809b upstream.

When a process drops CAP_SYS_ADMIN and calls fsconfig(FSCONFIG_SET_FLAG, "override_creds"), overlayfs saves those restricted credentials in ofs->creator_cred. ovl_fill_super() then wraps the entire mount setup in with_ovl_creds(), switching to those restricted credentials for the duration.

Mount setup calls clone_private_mount(), which checks CAP_SYS_ADMIN against current credentials. With restricted credentials active, this check fails with -EPERM even though the task issuing FSCONFIG_CMD_CREATE is fully privileged.

Use the mounter's real credentials only for cloning the private layer mounts. Keep all other backing filesystem operations during mount setup under the stashed credentials.

Fixes c28f922c9dcee ("clone_private_mnt(): make sure that caller has CAP_SYS_ADMIN in the right userns")
[backport: 6.18 has no scoped_with_creds(), use scoped_class(override_creds)]
---
 fs/overlayfs/super.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
fs/overlayfs/super.c +16 -2
@@ -498,6 +498,20 @@ static int ovl_report_in_use(struct ovl_
 	}
 }
 
+/*
+ * clone_private_mount() checks CAP_SYS_ADMIN in current->cred.
+ * ovl_fill_super() runs under the stashed creator cred, which
+ * override_creds may have dropped.
+ * The task that issued FSCONFIG_CMD_CREATE is still current->real_cred, so
+ * use that only for the clone. creator_cred stays in effect for every other
+ * backing-fs operation.
+ */
+static struct vfsmount *ovl_clone_private_mount(const struct path *path)
+{
+	scoped_class(override_creds, cred, current_real_cred())
+		return clone_private_mount(path);
+}
+
 static int ovl_get_upper(struct super_block *sb, struct ovl_fs *ofs,
 			 struct ovl_layer *upper_layer,
 			 const struct path *upperpath)
@@ -521,7 +535,7 @@ static int ovl_get_upper(struct super_bl
 	if (err)
 		goto out;
 
-	upper_mnt = clone_private_mount(upperpath);
+	upper_mnt = ovl_clone_private_mount(upperpath);
 	err = PTR_ERR(upper_mnt);
 	if (IS_ERR(upper_mnt)) {
 		pr_err("failed to clone upperpath\n");
@@ -1102,7 +1116,7 @@ static int ovl_get_layers(struct super_b
 			}
 		}
 
-		mnt = clone_private_mount(&l->path);
+		mnt = ovl_clone_private_mount(&l->path);
 		err = PTR_ERR(mnt);
 		if (IS_ERR(mnt)) {
 			pr_err("failed to clone lowerpath\n");
author maintainer
#986 lore raw

PATCH 970/1005 smb: smbdirect: fix buffer length underflow in RDMA transfers

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Stefan Metzmacher <[email protected]>

commit 7193241a49c958782ba4b8df06da3734d1e317d2 upstream.

When a remote buffer descriptor is larger than the remaining local buffer, smbdirect_connection_rdma_xmit() clamps its length and sets buf_len to zero. The common accounting code then subtracts the clamped length from buf_len, causing it to underflow. If another descriptor follows, the loop processes it with a wrapped remaining length and includes memory beyond the local buffer in the RDMA transfer.

A client can trigger an out-of-bounds kernel write with an SMB WRITE request, or an out-of-bounds kernel read with an SMB READ request, by supplying multiple RDMA buffer descriptors with an oversized descriptor before the last one.

Remove the premature assignment to buf_len. Subtracting the clamped length already consumes the remaining buffer, so the next iteration stops and only descriptors within the local buffer are used to build work requests.

Fixes e628bf939aaf ("ksmbd: reduce descriptor size if remaining bytes is less than request size")

[ metze: in 6.18 the code is smb_direct_rdma_xmit() in
fs/smb/server/transport_rdma.c ]

Assisted-by Claude:claude-opus-5-5
---
 fs/smb/server/transport_rdma.c |    1 -
 1 file changed, 1 deletion(-)
fs/smb/server/transport_rdma.c +0 -1
@@ -1724,7 +1724,6 @@ static int smb_direct_rdma_xmit(struct s
 		if (desc_buf_len > buf_len) {
 			desc_buf_len = buf_len;
 			desc[i].length = cpu_to_le32(desc_buf_len);
-			buf_len = 0;
 		}
 
 		credits_needed += calc_rw_credits(sc, desc_buf, desc_buf_len);
author maintainer
#987 lore raw

PATCH 971/1005 io_uring/kbuf: advance head when a pickup empties the buffer ring

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Yichong Chen <[email protected]>

Commit 8742f4b5a472c347fe568a73468a2d9e4d630b33 upstream.

io_ring_buffers_peek() flags the request with REQ_F_BL_EMPTY if the buffers it picked were the last ones available, comparing head to tail. When the loop breaks because max_len was exhausted the buffer was picked, but head is left pointing at it, so the flag isn't set if it was the last buffer. A bundle receive then retries, finds no buffer, and the request, which has received data, is marked as failed on account of the -ENOBUFS. That severs a link, and ends a multishot.

Fixes 35c8711c8fc4 ("io_uring/kbuf: add helpers for getting/peeking multiple buffers")
---
 io_uring/kbuf.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
io_uring/kbuf.c +3 -1
@@ -314,8 +314,10 @@ static int io_ring_buffers_peek(struct i
 
 		arg->out_len += len;
 		arg->max_len -= len;
-		if (!arg->max_len)
+		if (!arg->max_len) {
+			head++;
 			break;
+		}
 
 		buf = io_ring_head_to_buf(br, ++head, bl->mask);
 	} while (--nr_iovs);
author maintainer
#988 lore raw

PATCH 972/1005 io_uring/net: keep recvmsg buffer select length within MAX_RW_COUNT

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Yichong Chen <[email protected]>

Commit 18d3f56eb6e6500a65d81cf265f0fe74fd9ecab6 upstream.

io_recvmsg() takes the transfer length from the ring provided buffer when sqe->len is 0, and such a buffer can be up to 4G. min_ret is an int, so 2G or more makes it negative and the (ret < min_ret) block is skipped, and the oversized length reaches the socket layer unchanged: an empty socket then completes with 0 instead of arming poll, and a short read is reported as complete. Clamp the length to MAX_RW_COUNT, as io_recv() does.

Fixes c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers")
---
 io_uring/net.c |    1 +
 1 file changed, 1 insertion(+)
io_uring/net.c +1 -0
@@ -1066,6 +1066,7 @@ retry_multishot:
 		sel = io_buffer_select(req, &len, sr->buf_group, issue_flags);
 		if (!sel.addr)
 			return -ENOBUFS;
+		len = min_t(size_t, len, MAX_RW_COUNT);
 
 		if (req->flags & REQ_F_APOLL_MULTISHOT) {
 			ret = io_recvmsg_prep_multishot(kmsg, sr, &sel.addr, &len);
author maintainer
#989 lore raw

PATCH 973/1005 io_uring/net: dont retry a non-blocking connect() that fails with -EAGAIN

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Daan De Meyer <[email protected]>

Commit 71537ed811107c514c0342e98902d489d6d2b7cd upstream.

IORING_OP_CONNECT on an O_NONBLOCK AF_UNIX stream socket retries a connect that fails with -EAGAIN because the listener's backlog is full. Polling the client socket doesn't help: an unconnected stream socket reports EPOLLOUT and EPOLLHUP right away, before the backlog drains. So io_uring retries the connect until the apoll retry limit is hit, then punts the request to io-wq. With a full backlog, io_connect() runs 128 times in the submitting task and once more in a new io-wq worker. That worker stays in the task's thread group, so a later unshare(CLONE_NEWUSER) fails with -EINVAL.

None of this changes the result. __sys_connect_file() adds the socket's own O_NONBLOCK to every attempt, so the attempt from io-wq fails with -EAGAIN as well. That -EAGAIN becomes the CQE result, and connect(2) returns the same -EAGAIN.

Let's complete the request with -EAGAIN right away when the socket has O_NONBLOCK set, like connect(2) does. io_accept() already completes -EAGAIN this way for IORING_ACCEPT_DONTWAIT. -EINPROGRESS still waits for the connection to complete. A blocking socket still ends up in io-wq, where the connect sleeps until the listener accepts.

---
 io_uring/net.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
io_uring/net.c +11 -0
@@ -1864,6 +1864,17 @@ int io_connect(struct io_kiocb *req, uns
 			if (connect->seen_econnaborted)
 				goto out;
 			connect->seen_econnaborted = true;
+		} else if (req->file->f_flags & O_NONBLOCK) {
+			/*
+			 * __sys_connect_file() adds O_NONBLOCK from the socket
+			 * to every attempt, so a retry from io-wq fails with
+			 * -EAGAIN as well. A poll on the socket doesn't wait
+			 * until a retry can succeed. For example, an AF_UNIX
+			 * client reports EPOLLOUT right away while the
+			 * listener's backlog is full. Complete the request
+			 * with -EAGAIN, like connect(2) does.
+			 */
+			goto out;
 		}
 		return -EAGAIN;
 	}
author maintainer
#990 lore raw

PATCH 974/1005 io_uring/io-wq: no new workers once the exit has begun

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Josef Bacik <[email protected]>

Commit 47c68f925062a6013235d06add85a59f7d91e0fb upstream.

io_wq_exit_start() sets IO_WQ_BIT_EXIT, but worker creation task_work queued before that stays queued until io_wq_exit_workers() cancels it. In between the task runs its task_work while canceling requests, and a worker can still get created.

That's a problem for exec. begin_new_exec() calls io_uring_task_cancel() after de_thread(), when it's supposedly the only thread left, and io_wq_exit_workers() only waits for ->worker_done, which a worker completes before do_exit(). So the exiting worker is still in the thread group, using the mm, files and sighand, while exec replaces them. Easy to hit with a signal pending when create_io_thread() fails and the retry gets queued right before execve().

Cancel the queued creation task_work as soon as the exit bit is set. Pending work that isn't otherwise canceled now ends with -ECANCELED when the io-wq is destroyed, rather than depending on whether the task happened to run its task_work first.

Fixes 685fe7feedb9 ("io-wq: eliminate the need for a manager thread")

[axboe: the barrier is already upstream, see 0e5663856b69, only the
cancel is new]

---
 io_uring/io-wq.c |    6 ++++++
 1 file changed, 6 insertions(+)
io_uring/io-wq.c +6 -0
@@ -1412,6 +1412,12 @@ void io_wq_exit_start(struct io_wq *wq)
 	set_bit(IO_WQ_BIT_EXIT, &wq->state);
 	/* Pairs with task_work_add() in io_queue_worker_create(). */
 	smp_mb__after_atomic();
+	/*
+	 * No more workers from here on. The caller is going to run its task
+	 * work, and on exec a thread that is created now would still be
+	 * around, exiting, by the time that the caller must be on its own.
+	 */
+	io_wq_cancel_tw_create(wq);
 }
 
 static void io_wq_cancel_tw_create(struct io_wq *wq)
author maintainer
#991 lore raw

PATCH 975/1005 io_uring/rsrc: charge buffer arrays and nodes to memcg

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chris Mason <[email protected]>

Commit 075d5837bafc317e796548f721b8fbf7add6821d upstream.

The io_mapped_ubuf of a registered buffer has one bio_vec per page, unless the pages coalesce into huge pages. Huge pages only count against RLIMIT_MEMLOCK once per ring, so a buffer that maps the same 2MB folio over and over in a way that defeats coalescing gets a full bvec array per registration while only the one folio counts as locked. 1GB of that registered in 100 slots took several times a 64MB memory.max, with 2.6MB charged.

Allocate the io_mapped_ubuf and the io_rsrc_node with GFP_KERNEL_ACCOUNT. An object reused from the ring caches stays charged to whoever allocated it first, same as the io_kiocb cache.

Fixes de2939388be5 ("io_uring: improve registered buffer accounting for huge pages")

[axboe: 6.18 uses kvmalloc() + struct_size_t() rather than kvmalloc_flex()]

---
 io_uring/rsrc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
io_uring/rsrc.c +3 -3
@@ -110,9 +110,9 @@ static struct io_mapped_ubuf *io_alloc_i
 					   int nr_bvecs)
 {
 	if (nr_bvecs <= IO_CACHED_BVECS_SEGS)
-		return io_cache_alloc(&ctx->imu_cache, GFP_KERNEL);
+		return io_cache_alloc(&ctx->imu_cache, GFP_KERNEL_ACCOUNT);
 	return kvmalloc(struct_size_t(struct io_mapped_ubuf, bvec, nr_bvecs),
-			GFP_KERNEL);
+			GFP_KERNEL_ACCOUNT);
 }
 
 static void io_free_imu(struct io_ring_ctx *ctx, struct io_mapped_ubuf *imu)
@@ -140,7 +140,7 @@ struct io_rsrc_node *io_rsrc_node_alloc(
 {
 	struct io_rsrc_node *node;
 
-	node = io_cache_alloc(&ctx->node_cache, GFP_KERNEL);
+	node = io_cache_alloc(&ctx->node_cache, GFP_KERNEL_ACCOUNT);
 	if (node) {
 		node->type = type;
 		node->refs = 1;
author maintainer
#992 lore raw

PATCH 976/1005 io_uring: charge tctx nodes and personalities

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chris Mason <[email protected]>

Commit 0b34e7b20a48710b6f53716bf7030920b69fdbdd upstream.

The io_tctx_node allocated the first time a task touches a ring, and the XArray nodes behind tctx->xa and ctx->personalities, are plain GFP_KERNEL. tctx->xa is indexed by the ring pointer, so nearly every entry needs nodes of its own, and a task gets one entry per ring it has used. 642 threads on 4000 rings held 2.3GB with 59MB charged against a 64MB memory.max.

Allocate the node with GFP_KERNEL_ACCOUNT and set XA_FLAGS_ACCOUNT on both XArrays.

Fixes 0f2122045b94 ("io_uring: don't rely on weak ->files references")

[axboe: 6.18 has kmalloc() for the node, inline in __io_uring_add_tctx_node()]

---
 io_uring/io_uring.c |    2 +-
 io_uring/tctx.c     |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
io_uring/io_uring.c +1 -1
@@ -332,7 +332,7 @@ static __cold struct io_ring_ctx *io_rin
 	if (ret)
 		goto free_ref;
 	init_completion(&ctx->ref_comp);
-	xa_init_flags(&ctx->personalities, XA_FLAGS_ALLOC1);
+	xa_init_flags(&ctx->personalities, XA_FLAGS_ALLOC1 | XA_FLAGS_ACCOUNT);
 	mutex_init(&ctx->uring_lock);
 	init_waitqueue_head(&ctx->cq_wait);
 	init_waitqueue_head(&ctx->poll_wq);
io_uring/tctx.c +2 -2
@@ -91,7 +91,7 @@ __cold int io_uring_alloc_task_context(s
 	}
 
 	tctx->task = task;
-	xa_init(&tctx->xa);
+	xa_init_flags(&tctx->xa, XA_FLAGS_ACCOUNT);
 	init_waitqueue_head(&tctx->wait);
 	atomic_set(&tctx->in_cancel, 0);
 	atomic_set(&tctx->inflight_tracked, 0);
@@ -131,7 +131,7 @@ int __io_uring_add_tctx_node(struct io_r
 	if (tctx->io_wq)
 		io_wq_set_exit_on_idle(tctx->io_wq, false);
 	if (!xa_load(&tctx->xa, (unsigned long)ctx)) {
-		node = kmalloc(sizeof(*node), GFP_KERNEL);
+		node = kmalloc(sizeof(*node), GFP_KERNEL_ACCOUNT);
 		if (!node)
 			return -ENOMEM;
 		node->ctx = ctx;
author maintainer
#993 lore raw

PATCH 977/1005 io_uring: free XArray nodes left by a failed store

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chris Mason <[email protected]>

Commit 51bab09b7ca1a9a6dd9303a3b7ee346f8128c963 upstream.

A failed xa_store() can leave nodes without entries in the tree, and erasing every entry doesn't free those. An XArray needs xa_destroy() before it goes away, even an empty one. That was dropped for tctx->xa in commit ca6484cd308a ("io_uring: no need to call xa_destroy() on empty xarray") over a lockdep report from freeing the tctx in softirq context, and ctx->personalities never had it.

Now that the nodes are charged, a store can fail at memory.max and the leaked nodes stay charged. Call xa_destroy() in io_uring_clean_tctx(), which the task runs itself in process context before the tctx is freed, in the error path of __io_uring_add_tctx_node(), and for ctx->personalities in io_ring_ctx_free().

Fixes ca6484cd308a ("io_uring: no need to call xa_destroy() on empty xarray")

[axboe: 6.18 installs the tctx before adding the node and has no error path that frees it, drop that hunk. There's no ctx->hpage_acct either]

---
 io_uring/io_uring.c |    1 +
 io_uring/tctx.c     |    2 ++
 2 files changed, 3 insertions(+)
io_uring/io_uring.c +1 -0
@@ -3039,6 +3039,7 @@ static __cold void io_ring_ctx_free(stru
 	io_napi_free(ctx);
 	kvfree(ctx->cancel_table.hbs);
 	xa_destroy(&ctx->io_bl_xa);
+	xa_destroy(&ctx->personalities);
 	kfree(ctx);
 }
 
io_uring/tctx.c +2 -0
@@ -206,6 +206,8 @@ __cold void io_uring_clean_tctx(struct i
 		io_uring_del_tctx_node(index);
 		cond_resched();
 	}
+	/* A failed xa_store() leaves nodes with no entry behind. */
+	xa_destroy(&tctx->xa);
 	if (wq) {
 		/*
 		 * Must be after io_uring_del_tctx_node() (removes nodes under
author maintainer
#994 lore raw

PATCH 978/1005 io_uring/sqpoll: dont wait for the thread to exit

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Chris Mason <[email protected]>

Commit 360395e8dbf9d23579f74b84a1af11190813b0f8 upstream.

io_sq_thread_stop() wakes the SQPOLL thread and waits for it to exit. The thread belongs to the thread group that created the ring, so a SIGSTOP or the cgroup freezer holds it in get_signal(), and the wake up doesn't change that. io_ring_exit_work() then sleeps in that wait until someone continues or kills the process. iou_exit has 64 slots, so 64 closed SQPOLL rings of a stopped process keep every other ring from being freed, for everyone.

Don't wait. Set the stop bit, wake the thread, and let it exit when it gets to run again. The sqd can now outlive its last ring, so give it a second refcount with one reference for the rings and one for the thread, and free it with the last one. The thread can't reach a freed ring, rings leave ctx_list before dropping their reference, and the io-wq hash is refcounted.

Fixes 16efa4fce3b7 ("io_uring: allow IO worker threads to be frozen")
---
 io_uring/sqpoll.c |   28 +++++++++++++++++++++++-----
 io_uring/sqpoll.h |    3 ++-
 2 files changed, 25 insertions(+), 6 deletions(-)
io_uring/sqpoll.c +23 -5
@@ -62,6 +62,24 @@ void io_sq_thread_park(struct io_sq_data
 	}
 }
 
+/*
+ * The sqd has two holders: its rings, as one, and its thread. Neither waits
+ * for the other to let go. The one that lets go last frees the sqd.
+ */
+static void io_sq_data_release(struct io_sq_data *sqd)
+{
+	if (refcount_dec_and_test(&sqd->free_refs))
+		kfree(sqd);
+}
+
+/*
+ * Ask the thread to exit, and don't wait for it. A thread that is stopped or
+ * frozen exits only when a user lets it run again, and the exit work of the
+ * ring would keep its place in the workqueue until then. All rings have left
+ * ctx_list by now and have no request left, so the thread can reach none of
+ * them. What it still uses is its own or counted: the sqd by free_refs, the
+ * hash of its io-wq by hash->refs.
+ */
 void io_sq_thread_stop(struct io_sq_data *sqd)
 {
 	struct task_struct *tsk;
@@ -76,7 +94,6 @@ void io_sq_thread_stop(struct io_sq_data
 		wake_up_process(tsk);
 	}
 	mutex_unlock(&sqd->lock);
-	wait_for_completion(&sqd->exited);
 }
 
 void io_put_sq_data(struct io_sq_data *sqd)
@@ -85,7 +102,7 @@ void io_put_sq_data(struct io_sq_data *s
 		WARN_ON_ONCE(atomic_read(&sqd->park_pending));
 
 		io_sq_thread_stop(sqd);
-		kfree(sqd);
+		io_sq_data_release(sqd);
 	}
 }
 
@@ -159,10 +176,10 @@ static struct io_sq_data *io_get_sq_data
 
 	atomic_set(&sqd->park_pending, 0);
 	refcount_set(&sqd->refs, 1);
+	refcount_set(&sqd->free_refs, 2);
 	INIT_LIST_HEAD(&sqd->ctx_list);
 	mutex_init(&sqd->lock);
 	init_waitqueue_head(&sqd->wait);
-	init_completion(&sqd->exited);
 	return sqd;
 }
 
@@ -429,7 +446,7 @@ static int io_sq_thread(void *data)
 	io_run_task_work();
 	mutex_unlock(&sqd->lock);
 err_out:
-	complete(&sqd->exited);
+	io_sq_data_release(sqd);
 	do_exit(0);
 }
 
@@ -543,7 +560,8 @@ __cold int io_sq_offload_create(struct i
 	}
 	return 0;
 err_sqpoll:
-	complete(&ctx->sq_data->exited);
+	/* no thread was made: let go of its share */
+	io_sq_data_release(ctx->sq_data);
 err:
 	io_sq_thread_finish(ctx);
 	return ret;
io_uring/sqpoll.h +2 -1
@@ -2,6 +2,8 @@
 
 struct io_sq_data {
 	refcount_t		refs;
+	/* one for all the rings, one for the thread: the last put frees */
+	refcount_t		free_refs;
 	atomic_t		park_pending;
 	struct mutex		lock;
 
@@ -18,7 +20,6 @@ struct io_sq_data {
 
 	u64			work_time;
 	unsigned long		state;
-	struct completion	exited;
 };
 
 int io_sq_offload_create(struct io_ring_ctx *ctx, struct io_uring_params *p);
author maintainer
#995 lore raw

PATCH 979/1005 io_uring: defer foreign io-wq enqueues to task_work

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kyle Zeng <[email protected]>

Commit 3de16279b43dc285ed2222aba06cebdc82fdb28b upstream.

An IOPOLL ring without DEFER_TASKRUN can be reaped by a task other than the one that submitted the I/O. If a polled request is marked REQ_F_REISSUE, io_free_batch_list() calls io_queue_iowq() with the original tctx. Ordinary task exit can tear down tctx->io_wq after draining only the tracked requests. The live request pins the task, but not its io-wq, so the foreign task can race io_wq_put_and_exit() and enqueue through a freed or NULL queue.

Forward foreign userspace enqueues to the owning task before accessing tctx->io_wq. Use a dedicated task_work callback so reissues still go straight to io-wq, and fail them if task_work is running in cancellation mode. Preserve the existing PF_KTHREAD cancellation path. This also covers the other callers of io_queue_iowq() without changing the worker-owned enqueue path.

[axboe: 6.18 lacks 13b0742fd058, which removed io_req_queue_iowq(). Name the new task_work callback io_queue_iowq_foreign_tw() so it doesn't clash with the existing io_req_queue_iowq_tw()]

---
 io_uring/io_uring.c |   27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)
io_uring/io_uring.c +25 -2
@@ -483,6 +483,19 @@ static __always_inline bool io_assign_fi
 	return !!req->file;
 }
 
+static void io_queue_iowq(struct io_kiocb *req);
+
+static void io_queue_iowq_foreign_tw(struct io_tw_req tw_req, io_tw_token_t tw)
+{
+	struct io_kiocb *req = tw_req.req;
+
+	io_tw_lock(req->ctx, tw);
+	if (unlikely(tw.cancel))
+		io_req_defer_failed(req, -ECANCELED);
+	else
+		io_queue_iowq(req);
+}
+
 static void io_queue_iowq(struct io_kiocb *req)
 {
 	struct io_uring_task *tctx = req->tctx;
@@ -490,10 +503,17 @@ static void io_queue_iowq(struct io_kioc
 	BUG_ON(!tctx);
 	lockdep_assert_held(&req->ctx->uring_lock);
 
-	if ((current->flags & PF_KTHREAD) || !tctx->io_wq) {
-		io_req_task_queue_fail(req, -ECANCELED);
+	if (current->flags & PF_KTHREAD)
+		goto cancel;
+
+	/* Only the submitter can safely access its io-wq during task exit. */
+	if (unlikely(current != tctx->task)) {
+		req->io_task_work.func = io_queue_iowq_foreign_tw;
+		io_req_task_work_add(req);
 		return;
 	}
+	if (!tctx->io_wq)
+		goto cancel;
 
 	/*
 	 * The file is looked up as late as possible, as it may be the result
@@ -522,6 +542,9 @@ static void io_queue_iowq(struct io_kioc
 
 	trace_io_uring_queue_async_work(req, io_wq_is_hashed(&req->work));
 	io_wq_enqueue(tctx->io_wq, &req->work);
+	return;
+cancel:
+	io_req_task_queue_fail(req, -ECANCELED);
 }
 
 static void io_req_queue_iowq_tw(struct io_tw_req tw_req, io_tw_token_t tw)
author maintainer
#996 lore raw

PATCH 980/1005 io_uring/timeout: count cancelled timeouts in cq_timeouts

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Cheng Yongkang <[email protected]>

Commit 1c8b49851543f41fc8bb18bcd1f15cc93d14b530 upstream.

io_timeout_cancel() posts the cancelled timeout's -ECANCELED CQE without advancing ctx->cq_timeouts. io_timeout_fn() and io_kill_timeout() advance it for every timeout CQE they post, and io_flush_timeouts() computes the number of non-timeout completions as

seq = cached_cq_tail - cq_timeouts

to compare against each off timeout's target_seq. The cancelled timeout's CQE is therefore counted as a regular completion, so every cancellation makes an already armed off timeout fire one completion early.

A ring with a keep-alive timeout of off=4 completes it after two NOPs when one off=100 victim is cancelled through IORING_OP_ASYNC_CANCEL, and before any NOP when two victims are cancelled. The cancel CQE should count, but the cancelled timeouts' -ECANCELED CQEs must not: the expected counts are three and two NOPs respectively.

Advance cq_timeouts when io_timeout_extract() succeeds, under timeout_lock and before the -ECANCELED completion is queued, matching io_timeout_fn() and io_kill_timeout(). The -ENOENT and -EALREADY paths post no new timeout CQE and keep their accounting. Both the ASYNC_CANCEL and the TIMEOUT_REMOVE path go through io_timeout_cancel().

Fixes bfe68a221905 ("io_uring: off timeouts based only on completions")
Assisted-by LLM
---
 io_uring/timeout.c |    3 +++
 1 file changed, 3 insertions(+)
io_uring/timeout.c +3 -0
@@ -327,6 +327,9 @@ int io_timeout_cancel(struct io_ring_ctx
 
 	raw_spin_lock_irq(&ctx->timeout_lock);
 	req = io_timeout_extract(ctx, cd);
+	if (!IS_ERR(req))
+		atomic_set(&ctx->cq_timeouts,
+			   atomic_read(&ctx->cq_timeouts) + 1);
 	raw_spin_unlock_irq(&ctx->timeout_lock);
 
 	if (IS_ERR(req))
author maintainer
#997 lore raw

PATCH 981/1005 io_uring/net: fix multishot recv length limit accounting

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Cheng Yongkang <[email protected]>

Commit 3e3aebb7570ccdde5cc49c9bfc8fd3a436b71b0c upstream.

io_recv_finish() debits sr->mshot_total_len with min_t(int, sel->val, sr->mshot_total_len). sel->val is the cumulative byte count of the
request: on a bundle retry the receive path adds sr->done_io back to the return value, and the bundle branch in io_recv_finish() recovers the new bytes with this_ret = sel->val - sr->done_io. The debit therefore uses the wrong value after a bundle retry, and the int cast truncates a limit above INT_MAX.

For an IORING_OP_RECV multishot request with optlen above INT_MAX, the limit becomes negative when cast to int, so the first completion debits the entire limit and ends the multishot with IORING_RECV_MSHOT_DONE while the socket still holds data that covers the limit. With 120 bytes queued, a 64-byte buffer and optlen 0x80000000, the first 64-byte CQE lacks IORING_CQE_F_MORE and 56 bytes remain unread; the same setup with optlen 0x7fffffff posts 64 and 56 bytes with F_MORE.

After a bundle retry, the bytes already debited for the previous attempts are debited again, so the limit is exhausted early. With 1400 bytes queued, optlen 1000 and buffers of 600, 100, 100, 50, 50 and 200 bytes, the first attempt delivers 700 bytes and retries; the second delivers 200 more, but the debit accounts for 900 and finishes the request with a terminal 900-byte CQE while 500 bytes remain unread. The limit could have been reached.

Debit only the bytes received by this invocation, sel->val - sr->done_io, and compare as unsigned so a limit above INT_MAX is accounted correctly. Non-bundle multishot requests keep sr->done_io at zero, so their accounting is unchanged.

Fixes 0ebc9a7ecf6a ("io_uring/net: Support multishot receive len cap")
Assisted-by LLM
[axboe: fix-up near-by incorrect comment while in there]
---
 io_uring/net.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
io_uring/net.c +7 -4
@@ -879,12 +879,15 @@ static inline bool io_recv_finish(struct
 		cflags |= IORING_CQE_F_SOCK_NONEMPTY;
 
 	if (sel->val > 0 && sr->flags & IORING_RECV_MSHOT_LIM) {
+		unsigned int this_len = sel->val - sr->done_io;
+
 		/*
-		 * If sr->len hits zero, the limit has been reached. Mark
-		 * mshot as finished, and flag MSHOT_DONE as well to prevent
-		 * a potential bundle from being retried.
+		 * If sr->mshot_total_len hits zero, the limit has been reached.
+		 * Mark mshot as finished, and flag MSHOT_DONE as well to
+		 * prevent a potential bundle from being retried.
 		 */
-		sr->mshot_total_len -= min_t(int, sel->val, sr->mshot_total_len);
+		sr->mshot_total_len -= min_t(unsigned int, this_len,
+					     sr->mshot_total_len);
 		if (!sr->mshot_total_len) {
 			sr->flags |= IORING_RECV_MSHOT_DONE;
 			mshot_finished = true;
author maintainer
#998 lore raw

PATCH 982/1005 smb: client: do not pass a NULL buf to is_oplock_break()

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Zikang Gao <[email protected]>

[ Upstream commit 2225ab306575e424b3dad2ee1be2521c89249d15 ]

receive_encrypted_read() sets *num_mids = 1 and never writes the caller's bufs[]. Offload returns -1 with *num_mids = 0, so the demultiplex thread skips the frame. The inline decrypt path returns 0 even when smb2_find_mid() fails.

cifs_demultiplex_thread() then treats mids[i] == NULL as an oplock break and calls is_oplock_break(bufs[i], server) with bufs[i] still NULL. smb2_is_valid_oplock_break() reads hdr.Command at offset 12 and oopses.

A large encrypted READ whose MessageId does not match is enough to panic cifsd.

    Oops: general protection fault, probably for non-canonical address
    0xdffffc0000000001: 0000 [#1] SMP KASAN PTI
    KASAN: null-ptr-deref in range
    [0x0000000000000008-0x000000000000000f]
    CPU: 0 PID: 100 Comm: cifsd
    RIP: smb2_is_valid_oplock_break+0xc8/0x2270 [cifs]
    cifs_demultiplex_thread
    Kernel panic - not syncing: Fatal exception

Return -1 when inline decrypt finds no mid, and skip is_oplock_break() plus the unknown-frame dump when bufs[i] is NULL. receive_encrypted_standard() already assigns bufs[*num_mids].

Fixes c42a6abe3012 ("CIFS: Add capability to decrypt big read responses")
Assisted-by LLM
[ sashal: Adjusted context to retain the existing one-argument mid_execute_callback() and release_mid() calls. ]
---
 fs/smb/client/connect.c | 4 +++-
 fs/smb/client/smb2ops.c | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)
fs/smb/client/connect.c +3 -1
index e908d522920c8..ca71026799e0c 100644
@@ -1400,12 +1400,14 @@ cifs_demultiplex_thread(void *p)
 					mid_execute_callback(mids[i]);
 
 				release_mid(mids[i]);
-			} else if (server->ops->is_oplock_break &&
+			} else if (bufs[i] && server->ops->is_oplock_break &&
 				   server->ops->is_oplock_break(bufs[i],
 								server)) {
 				smb2_add_credits_from_hdr(bufs[i], server);
 				cifs_dbg(FYI, "Received oplock break\n");
 			} else {
+				if (!bufs[i])
+					continue;
 				cifs_server_dbg(VFS, "No task to wake, unknown frame received! NumMids %d\n",
 						atomic_read(&mid_count));
 				cifs_dump_mem("Received Data is: ", bufs[i],
fs/smb/client/smb2ops.c +1 -0
index 5ad3804826d9a..702e32e0e51ad 100644
@@ -5357,6 +5357,7 @@ receive_encrypted_read(struct TCP_Server_Info *server, struct mid_q_entry **mid,
 	*mid = smb2_find_mid(server, buf);
 	if (*mid == NULL) {
 		cifs_dbg(FYI, "mid not found\n");
+		rc = -1;
 	} else {
 		cifs_dbg(FYI, "mid found\n");
 		(*mid)->decrypted = true;
Signature · 1 line
2.53.0
author maintainer
#999 lore raw

PATCH 983/1005 smb: client: fix early procfs exposure race

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Fredric Cover <[email protected]>

[ Upstream commit 7b1afb631395c958993cda4631002258ef4151ea ]

Currently, init_cifs() calls cifs_proc_init() near the beginning of the function, before INIT_LIST_HEAD, leading to a momentarily uninitialized, but exposed, procfs. If a userspace process reads this empty procfs, iterating over a zeroed list_head leads to a NULL pointer dereference and a kernel oops/panic.

For example, if a delay is added between cifs_proc_init() and INIT_LIST_HEAD, and a userspace process is polling /proc/fs/cifs/DebugData, the following oops occurs:

BUG: kernel NULL pointer dereference, address: 0000000000000608
Oops: Oops: 0000 [#1] SMP PTI
CPU: 0 UID: 0 PID: 3477 Comm: cat Not tainted
7.3.0-02212-g4df4d2a577db-dirty #6 PREEMPT(lazy)
RIP: 0010:cifs_debug_data_proc_show+0x103/0xd80 [cifs]
Call Trace:
<TASK>
 ? seq_read_iter+0x86/0x400
 ? seq_read_iter+0x86/0x400
 seq_read_iter+0x183/0x400
 proc_reg_read_iter+0x62/0x90
 copy_splice_read+0x215/0x310
 splice_file_to_pipe+0xec/0x1c0
 do_splice+0x4b8/0x780
 __se_sys_splice+0x18f/0x250
 do_syscall_64+0x109/0x330
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
</TASK>

Fix this by moving cifs_proc_init() down in init_cifs(), ensuring it runs only after all internal lists, locks, counters, and workqueues are fully ready, but before registering the filesystem. Update the error cleanup ladder and exit_cifs() to maintain proper LIFO order.

Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")
[ sashal: Adjusted init_cifs() context because smb1_init_maperror() and smb2_init_maperror() are absent. ]
---
 fs/smb/client/cifsfs.c |   20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
fs/smb/client/cifsfs.c +9 -11
@@ -1972,7 +1972,6 @@ static int __init
 init_cifs(void)
 {
 	int rc = 0;
-	cifs_proc_init();
 	INIT_LIST_HEAD(&cifs_tcp_ses_list);
 /*
  *  Initialize Global counters
@@ -2021,10 +2020,8 @@ init_cifs(void)
 	cifsiod_wq = alloc_workqueue("cifsiod",
 				     WQ_FREEZABLE | WQ_MEM_RECLAIM | WQ_PERCPU,
 				     0);
-	if (!cifsiod_wq) {
-		rc = -ENOMEM;
-		goto out_clean_proc;
-	}
+	if (!cifsiod_wq)
+		return -ENOMEM;
 
 	/*
 	 * Consider in future setting limit!=0 maybe to min(num_of_cores - 1, 3)
@@ -2115,19 +2112,22 @@ init_cifs(void)
 	if (rc)
 		goto out_cifs_swn_init;
 
+	cifs_proc_init();
+
 	rc = register_filesystem(&cifs_fs_type);
 	if (rc)
-		goto out_init_cifs_idmap;
+		goto out_clean_proc;
 
 	rc = register_filesystem(&smb3_fs_type);
 	if (rc) {
 		unregister_filesystem(&cifs_fs_type);
-		goto out_init_cifs_idmap;
+		goto out_clean_proc;
 	}
 
 	return 0;
 
-out_init_cifs_idmap:
+out_clean_proc:
+	cifs_proc_clean();
 	exit_cifs_idmap();
 out_cifs_swn_init:
 #ifdef CONFIG_CIFS_SWN_UPCALL
@@ -2163,8 +2163,6 @@ out_destroy_decrypt_wq:
 	destroy_workqueue(decrypt_wq);
 out_destroy_cifsiod_wq:
 	destroy_workqueue(cifsiod_wq);
-out_clean_proc:
-	cifs_proc_clean();
 	return rc;
 }
 
@@ -2174,6 +2172,7 @@ exit_cifs(void)
 	cifs_dbg(NOISY, "exit_smb3\n");
 	unregister_filesystem(&cifs_fs_type);
 	unregister_filesystem(&smb3_fs_type);
+	cifs_proc_clean();
 	cifs_release_automount_timer();
 	exit_cifs_idmap();
 #ifdef CONFIG_CIFS_SWN_UPCALL
@@ -2196,7 +2195,6 @@ exit_cifs(void)
 	destroy_workqueue(serverclose_wq);
 	destroy_workqueue(cfid_put_wq);
 	destroy_workqueue(cifsiod_wq);
-	cifs_proc_clean();
 }
 
 MODULE_AUTHOR("Steve French");
author maintainer
#1000 lore raw

PATCH 984/1005 driver core: Check drivers_autoprobe for all added devices

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Vincent Liu <[email protected]>

[ Upstream commit ea34511aaf755349999a1067b2984a541bee1492 ]

When a device is hot-plugged, the drivers_autoprobe sysfs attribute is not checked (at least for PCI devices). This means that drivers_autoprobe is not working as intended, e.g. hot-plugged PCI devices will still be autoprobed and bound to drivers even with drivers_autoprobe disabled.

The problem likely started when device_add() was removed from pci_bus_add_device() in commit 4f535093cf8f ("PCI: Put pci_dev in device tree as early as possible") which means that the check for drivers_autoprobe which used to happen in bus_probe_device() is no longer present (previously bus_add_device() calls bus_probe_device()). Conveniently, in commit 91703041697c ("PCI: Allow built-in drivers to use async initial probing") device_attach() was replaced with device_initial_probe() which faciliates this change to push the check for drivers_autoprobe into device_initial_probe().

Make sure all devices check drivers_autoprobe by pushing the drivers_autoprobe check into device_initial_probe(). This will only affect devices on the PCI bus for now as device_initial_probe() is only called by pci_bus_add_device() and bus_probe_device(), but bus_probe_device() already checks for autoprobe, so callers of bus_probe_device() should not observe changes on autoprobing. Note also that pushing this check into device_initial_probe() rather than device_attach() makes it only affect automatic probing of drivers (e.g. when a device is hot-plugged), userspace can still choose to manually bind a driver by writing to drivers_probe sysfs attribute, even with autoprobe disabled.

Any future callers of device_initial_probe() will respect the drivers_autoprobe sysfs attribute, which is the intended purpose of drivers_autoprobe.

Stable-dep-of: 187a62f99da2 ("driver core: take parent lock in async device attach")

---
 drivers/base/bus.c |    3 +--
 drivers/base/dd.c  |   10 +++++++++-
 2 files changed, 10 insertions(+), 3 deletions(-)
drivers/base/bus.c +1 -2
@@ -573,8 +573,7 @@ static void __bus_probe_device(struct de
 	if (!sp)
 		return;
 
-	if (sp->drivers_autoprobe)
-		device_initial_probe(dev);
+	device_initial_probe(dev);
 
 	mutex_lock(&sp->mutex);
 	list_for_each_entry(sif, &sp->interfaces, node)
drivers/base/dd.c +9 -1
@@ -1157,7 +1157,15 @@ EXPORT_SYMBOL_GPL(device_attach);
 
 void device_initial_probe(struct device *dev)
 {
-	__device_attach(dev, true);
+	struct subsys_private *sp = bus_to_subsys(dev->bus);
+
+	if (!sp)
+		return;
+
+	if (sp->drivers_autoprobe)
+		__device_attach(dev, true);
+
+	subsys_put(sp);
 }
 
 /*
author maintainer
#1001 lore raw

PATCH 985/1005 driver core: take parent lock in async device attach

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Mario Peter <[email protected]>

[ Upstream commit 187a62f99da29b1a55602b0d401a783d8dc86161 ]

For device types with need_parent_lock set (only USB interfaces), probe() must run with the parent device locked. A synchronous attach after device_add() gets this from the caller, e.g. usb_set_configuration() holds the udev lock while adding interfaces. __device_attach_async_helper() runs the probe from an async worker instead, where that lock isn't held, and only takes device_lock(dev).

With async probing enabled for the hub driver (e.g. driver_async_probe=* or driver_async_probe=hub), this races when a multi-TT hub is configured. For multi-TT hubs, hub_probe() calls usb_set_interface(hdev, 0, 1) to select the TT-per-port altsetting, and usb_set_interface() creates the endpoint devices of the interface a second time:

usb_set_configuration() async worker

    [udev locked]
    device_add(intf)
      queues the probe  ----------> __device_attach_async_helper()
                                      [intf locked, udev not locked]
                                      hub_probe()
                                        usb_set_interface(hdev, 0, 1)
    create_intf_ep_devs(intf)             create_intf_ep_devs(intf)

create_intf_ep_devs() checks and sets intf->ep_devs_created without a lock of its own. If usb_set_configuration() has created ep_81 but not yet set the flag, usb_set_interface() skips removing the endpoint devices of the old altsetting and creates ep_81 again. With a synchronous probe, hub_probe() runs inside device_add() with the udev lock held, and usb_set_configuration() then finds ep_devs_created already set.

Single-TT hubs don't call usb_set_interface() from hub_probe() and don't show this warning, but their probe runs without the udev lock as well.

On an i.MX8MM board with an onboard USB2514 hub this hit 11 of 100 boots:

sysfs: cannot create duplicate filename '.../1-1/1-1:1.0/ep_81'

  Call trace:
   sysfs_warn_dup
   usb_create_ep_devs
   create_intf_ep_devs
   usb_set_interface
   hub_probe
   usb_probe_interface
   really_probe
   __device_attach_async_helper
   async_run_entry_fn

It also shows on v7.3-rc6 in QEMU, with dummy_hcd and a raw-gadget program emulating a multi-TT hub: re-authorizing the hub in a loop, while a SCHED_FIFO task preempts the writing task at random points for 3 ms, hit the warning in 29 of 6000 iterations.

Take the parent lock in __device_attach_async_helper() as well, like __driver_attach_async_helper() does, and move __device_driver_lock/unlock() up for that. With this the warning was gone in 300 boots on the board and in 6000 iterations in QEMU.

Fixes 765230b5f084 ("driver-core: add asynchronous probing support for drivers")
Cc Dmitry Torokhov <[email protected]>

[ johan: switch to async_schedule_dev_nocall() to avoid deadlock if
async_schedule_dev() runs synchronously when parent lock is held ]

[ Fold the nested conditions into a single if statement; correct commit
message to mention "device types" rather than "buses" for "need_parent_lock". - Danilo ]

---
 drivers/base/dd.c |   83 +++++++++++++++++++++++++++++-------------------------
 1 file changed, 45 insertions(+), 38 deletions(-)
drivers/base/dd.c +45 -38
@@ -1042,6 +1042,38 @@ static int __device_attach_driver(struct
 	return ret == 0;
 }
 
+/*
+ * __device_driver_lock - acquire locks needed to manipulate dev->drv
+ * @dev: Device we will update driver info for
+ * @parent: Parent device. Needed if the device type requires parent lock
+ *
+ * This function will take the required locks for manipulating dev->drv.
+ * Normally this will just be the @dev lock, but when called for a USB
+ * interface, @parent lock will be held as well.
+ */
+static void __device_driver_lock(struct device *dev, struct device *parent)
+{
+	if (dev->type && dev->type->need_parent_lock && parent)
+		device_lock(parent);
+	device_lock(dev);
+}
+
+/*
+ * __device_driver_unlock - release locks needed to manipulate dev->drv
+ * @dev: Device we will update driver info for
+ * @parent: Parent device. Needed if the device type requires parent lock
+ *
+ * This function will release the required locks for manipulating dev->drv.
+ * Normally this will just be the @dev lock, but when called for a
+ * USB interface, @parent lock will be released as well.
+ */
+static void __device_driver_unlock(struct device *dev, struct device *parent)
+{
+	device_unlock(dev);
+	if (dev->type && dev->type->need_parent_lock && parent)
+		device_unlock(parent);
+}
+
 static void __device_attach_async_helper(void *_dev, async_cookie_t cookie)
 {
 	struct device *dev = _dev;
@@ -1051,7 +1083,7 @@ static void __device_attach_async_helper
 		.want_async	= true,
 	};
 
-	device_lock(dev);
+	__device_driver_lock(dev, dev->parent);
 
 	/*
 	 * Check if device has already been removed or claimed. This may
@@ -1073,7 +1105,7 @@ static void __device_attach_async_helper
 	if (dev->parent)
 		pm_runtime_put(dev->parent);
 out_unlock:
-	device_unlock(dev);
+	__device_driver_unlock(dev, dev->parent);
 
 	put_device(dev);
 }
@@ -1130,8 +1162,11 @@ static int __device_attach(struct device
 	}
 out_unlock:
 	device_unlock(dev);
-	if (async)
-		async_schedule_dev(__device_attach_async_helper, dev);
+	if (async && !async_schedule_dev_nocall(__device_attach_async_helper, dev)) {
+		put_device(dev);
+		ret = 2;	/* retry synchronously */
+	}
+
 	return ret;
 }
 
@@ -1158,48 +1193,20 @@ EXPORT_SYMBOL_GPL(device_attach);
 void device_initial_probe(struct device *dev)
 {
 	struct subsys_private *sp = bus_to_subsys(dev->bus);
+	int ret;
 
 	if (!sp)
 		return;
 
-	if (sp->drivers_autoprobe)
-		__device_attach(dev, true);
+	if (sp->drivers_autoprobe) {
+		ret = __device_attach(dev, true);
+		if (ret == 2)
+			__device_attach(dev, false);
+	}
 
 	subsys_put(sp);
 }
 
-/*
- * __device_driver_lock - acquire locks needed to manipulate dev->drv
- * @dev: Device we will update driver info for
- * @parent: Parent device. Needed if the device type requires parent lock
- *
- * This function will take the required locks for manipulating dev->drv.
- * Normally this will just be the @dev lock, but when called for a USB
- * interface, @parent lock will be held as well.
- */
-static void __device_driver_lock(struct device *dev, struct device *parent)
-{
-	if (dev->type && dev->type->need_parent_lock && parent)
-		device_lock(parent);
-	device_lock(dev);
-}
-
-/*
- * __device_driver_unlock - release locks needed to manipulate dev->drv
- * @dev: Device we will update driver info for
- * @parent: Parent device. Needed if the device type requires parent lock
- *
- * This function will release the required locks for manipulating dev->drv.
- * Normally this will just be the @dev lock, but when called for a
- * USB interface, @parent lock will be released as well.
- */
-static void __device_driver_unlock(struct device *dev, struct device *parent)
-{
-	device_unlock(dev);
-	if (dev->type && dev->type->need_parent_lock && parent)
-		device_unlock(parent);
-}
-
 /**
  * device_driver_attach - attach a specific driver to a specific device
  * @drv: Driver to attach
author maintainer
#1002 lore raw

PATCH 986/1005 ksmbd: deny access for an empty DACL instead of granting the request

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Aamir Ahmed <[email protected]>

[ Upstream commit de0cffef897c1c232ed973f89928cd6c93d0b1e3 ]

smb_check_perm_dacl() returns the access mask it computes to the SMB2 CREATE handler, which uses it as the granted access for the open. For a security descriptor whose DACL is present but contains no ACEs, the function is supposed to deny access: an empty (non-NULL) DACL grants no access to anyone except the object owner's implicit READ_CONTROL and WRITE_DAC (MS-DTYP 2.4.5).

The empty-DACL branch only denies when both

- the DACL has no trailing bytes (pdacl_size == sizeof(struct smb_acl)), and
- the request contains bits beyond READ_CONTROL / WRITE_DAC.

In every other case it takes the shared "goto err_out" with rc still 0, which returns success without modifying *pdaccess, so the caller grants the full requested access. Three problems follow:

- The READ_CONTROL / WRITE_DAC carve-out models the owner's implicit rights, but the check runs before is_owner is computed, so those rights are handed to *every* caller, not just the owner. For READ_CONTROL the SMB2 CREATE path does not fall back to inode_permission(), so any user can read the security descriptor of an object whose empty DACL is meant to deny them.

- A request of exactly READ_CONTROL and/or WRITE_DAC is granted to any caller. WRITE_DAC lets the handle rewrite the DACL.

- A DACL that declares zero ACEs but carries trailing bytes (pdacl_size > sizeof(struct smb_acl)) skips the deny entirely and is granted whatever was requested.

On shares where the NT ACL is the authoritative access control -- e.g. "force user" shares, where every client maps to one POSIX identity so POSIX cannot distinguish users -- this is an access-control bypass.

Compute is_owner before the empty-DACL branch and deny access from an empty DACL unless the caller is the owner requesting no more than READ_CONTROL / WRITE_DAC.

Fixes e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Assisted-by LLM
[ sashal: added missing ownership declarations and initialization of is_owner using the mount’s ID mapping ]
---
 fs/smb/server/smbacl.c |   26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)
fs/smb/server/smbacl.c +18 -8
@@ -1469,6 +1469,8 @@ int smb_check_perm_dacl(struct ksmbd_con
 	struct posix_acl_entry *pa_entry;
 	unsigned int sid_type = SIDOWNER;
 	unsigned short ace_size;
+	bool is_owner;
+	vfsuid_t vfsuid;
 
 	ksmbd_debug(SMB, "check permission using windows acl\n");
 	pntsd_size = ksmbd_vfs_get_sd_xattr(conn, idmap,
@@ -1489,19 +1491,27 @@ int smb_check_perm_dacl(struct ksmbd_con
 	if (pdacl_size > acl_size || pdacl_size < sizeof(struct smb_acl))
 		goto err_out;
 
+	if (!uid)
+		sid_type = SIDUNIX_USER;
+	id_to_sid(uid, sid_type, &sid);
+	vfsuid = i_uid_into_vfsuid(idmap, d_inode(path->dentry));
+	is_owner = uid == from_kuid(&init_user_ns, vfsuid_into_kuid(vfsuid));
+
 	if (!pdacl->num_aces) {
-		if (!(pdacl_size - sizeof(struct smb_acl)) &&
-		    *pdaccess & ~(FILE_READ_CONTROL_LE | FILE_WRITE_DAC_LE)) {
+		/*
+		 * An empty (present, zero-ACE) DACL grants no access to
+		 * anyone except the object owner's implicit READ_CONTROL
+		 * and WRITE_DAC (MS-DTYP 2.4.5). Deny every other caller,
+		 * deny the owner any access beyond those two bits, and do
+		 * not let trailing bytes after a zero-ACE DACL become an
+		 * implicit grant.
+		 */
+		if (!is_owner ||
+		    (*pdaccess & ~(FILE_READ_CONTROL_LE | FILE_WRITE_DAC_LE)))
 			rc = -EACCES;
-			goto err_out;
-		}
 		goto err_out;
 	}
 
-	if (!uid)
-		sid_type = SIDUNIX_USER;
-	id_to_sid(uid, sid_type, &sid);
-
 	if (*pdaccess & FILE_MAXIMAL_ACCESS_LE) {
 		access_bits = READ_CONTROL | WRITE_DAC | FILE_READ_ATTRIBUTES |
 			DELETE;
author maintainer
#1003 lore raw

PATCH 987/1005 ksmbd: fix session reference leak on compounded SESSION_SETUP

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ian Bridges <[email protected]>

[ Upstream commit 03bd8f5279e490e15e0c0f0fa388ffbd2fbacd65 ]

A compound request can place SESSION_SETUP after another command. That earlier command leaves a reference to its session in work->sess. smb2_sess_setup() then overwrites work->sess with the session it looks up or creates, and the dispatcher later puts work->sess only once. The inherited reference is never dropped. That leaks the session, together with its setup connection and socket, and every repeat of the compound leaks another.

unreferenced object (size 512):

    __kmalloc_cache_noprof+0x32c/0x3a0
    ksmbd_smb2_session_create+0xf6/0x9c0 [ksmbd]
    smb2_sess_setup+0xda4/0x6280 [ksmbd]
    handle_ksmbd_work+0x88c/0x1cb0 [ksmbd]

Save the inherited session on entry. After the request has been processed, release it once, but only when smb2_sess_setup() has replaced work->sess with its own session or cleared it. Do this after ksmbd_conn_unlock() so the put does not run under srv_mutex. An error path may instead leave the inherited session in work->sess. Keep it there, so the dispatcher still puts it and the error response is still signed or encrypted with it as before.

Fixes 7aa8804c0b67 ("ksmbd: fix user-after-free from session log off")
[ sashal: Omitted the installed = true assignment for the absent rejected-binding signature-check block. ]
---
 fs/smb/server/smb2pdu.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
fs/smb/server/smb2pdu.c +11 -0
@@ -1698,6 +1698,8 @@ int smb2_sess_setup(struct ksmbd_work *w
 	struct smb2_sess_setup_req *req;
 	struct smb2_sess_setup_rsp *rsp;
 	struct ksmbd_session *sess;
+	struct ksmbd_session *prev_sess = work->sess;
+	bool installed = false;
 	struct negotiate_message *negblob;
 	unsigned int negblob_len, negblob_off;
 	int rc = 0;
@@ -1835,6 +1837,7 @@ int smb2_sess_setup(struct ksmbd_work *w
 		conn->binding = false;
 	}
 	work->sess = sess;
+	installed = true;
 
 	negblob_off = le16_to_cpu(req->SecurityBufferOffset);
 	negblob_len = le16_to_cpu(req->SecurityBufferLength);
@@ -1988,6 +1991,14 @@ out_err:
 	}
 
 	ksmbd_conn_unlock(conn);
+
+	/*
+	 * Later in a compound, work->sess holds the reference that an
+	 * earlier command took. Drop it once this request has installed
+	 * its own session there or cleared it.
+	 */
+	if (prev_sess && (installed || !work->sess))
+		ksmbd_user_session_put(prev_sess);
 	return rc;
 }
 
author maintainer
#1004 lore raw

PATCH 988/1005 ksmbd: prevent share root removal through empty paths

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Namjae Jeon <[email protected]>

[ Upstream commit 9fd1fcbbf84986a7bcf601a2b90540899069d263 ]

A FileLinkInformation request can supply "/" as the new link name. smb2_get_name() strips the trailing slash and passes an empty string to ksmbd_vfs_kern_path_start_removing().

ksmbd_vfs_path_lookup() resolves an empty pathname as the configured share path, without LOOKUP_BENEATH. With ReplaceIfExists set, smb2_create_link() can therefore remove the share root from its parent before link creation fails. An authenticated client with a writable share and DELETE access to a file can trigger this if the share root is empty and the mapped user has write and search permission on its parent directory.

Return -EINVAL for empty pathnames when for_remove is set, before resolving the share path or acquiring removal resources. Ordinary lookups continue to accept empty pathnames for opening the share root.

Fixes 74d7970febf7 ("ksmbd: fix racy issue from using ->d_parent and ->d_name")
[ sashal: Replaced for_remove with the existing do_lock parameter. ]
---
 fs/smb/server/vfs.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/smb/server/vfs.c +4 -0
@@ -78,6 +78,10 @@ static int ksmbd_vfs_path_lookup(struct
 	struct dentry *d;
 
 	if (pathname[0] == '\0') {
+		/* The share root must never be removed. */
+		if (do_lock)
+			return -EINVAL;
+
 		pathname = share_conf->path;
 		root_share_path = NULL;
 	} else {
author maintainer
#1005 lore raw

PATCH 989/1005 ksmbd: prevent stale data from being written by SMB2 WRITE requests

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Namjae Jeon <[email protected]>

[ Upstream commit bc0e0f5ac1d7b044d403f859406b4b66d4b1ce9b ]

Initialize the compatibility byte in request buffers without zeroing the entire allocation. Keep the one-byte compatibility exception for SMB2 messages so valid zero-length WRITE requests remain compatible, and validate the data range in the WRITE handlers against the current compound request before accessing it.

This prevents stale request-buffer data from being written to files or sent to IPC pipes.

Fixes 443d61d1fa9f ("ksmbd: allocate one more byte for implied bcc[0]")
[ sashal: Inlined the unavailable smb2_current_req_len() helper and omitted the decompression change because compression support is absent. ]
---
 fs/smb/server/connection.c |    1 +
 fs/smb/server/smb2pdu.c    |   36 ++++++++++++++++++++++++++----------
 2 files changed, 27 insertions(+), 10 deletions(-)
fs/smb/server/connection.c +1 -0
@@ -520,6 +520,7 @@ recheck:
 		if (!conn->request_buf)
 			break;
 
+		conn->request_buf[pdu_size + 4] = 0;
 		memcpy(conn->request_buf, hdr_buf, sizeof(hdr_buf));
 
 		/*
fs/smb/server/smb2pdu.c +26 -10
@@ -7218,23 +7218,28 @@ static noinline int smb2_write_pipe(stru
 	int err = 0, ret = 0;
 	char *data_buf;
 	size_t length;
+	unsigned int data_offset, req_len;
 
 	WORK_BUFFERS(work, req, rsp);
 
 	length = le32_to_cpu(req->Length);
 	id = req->VolatileFileId;
-
-	if ((u64)le16_to_cpu(req->DataOffset) + length >
-	    get_rfc1002_len(work->request_buf)) {
-		pr_err("invalid write data offset %u, smb_len %u\n",
-		       le16_to_cpu(req->DataOffset),
-		       get_rfc1002_len(work->request_buf));
+	data_offset = le16_to_cpu(req->DataOffset);
+	req_len = le32_to_cpu(req->hdr.NextCommand);
+	if (!req_len)
+		req_len = get_rfc1002_len(work->request_buf) -
+			work->next_smb2_rcv_hdr_off;
+
+	if (data_offset < offsetof(struct smb2_write_req, Buffer) ||
+	    data_offset > req_len || length > req_len - data_offset) {
+		pr_err("invalid write data offset %u, length %zu, req_len %u\n",
+		       data_offset, length, req_len);
 		err = -EINVAL;
 		goto out;
 	}
 
 	data_buf = (char *)(((char *)&req->hdr.ProtocolId) +
-			   le16_to_cpu(req->DataOffset));
+			   data_offset);
 
 	rpc_resp = ksmbd_rpc_write(work->sess, id, data_buf, length);
 	if (rpc_resp) {
@@ -7391,14 +7396,25 @@ int smb2_write(struct ksmbd_work *work)
 		writethrough = true;
 
 	if (is_rdma_channel == false) {
-		if (le16_to_cpu(req->DataOffset) <
-		    offsetof(struct smb2_write_req, Buffer)) {
+		unsigned int data_offset = le16_to_cpu(req->DataOffset);
+		unsigned int req_len = le32_to_cpu(req->hdr.NextCommand);
+
+		if (!req_len)
+			req_len = get_rfc1002_len(work->request_buf) -
+				work->next_smb2_rcv_hdr_off;
+
+		if (data_offset < offsetof(struct smb2_write_req, Buffer) ||
+		    data_offset > req_len ||
+		    length > req_len - data_offset) {
+			ksmbd_debug(SMB,
+				    "invalid write data offset %u, length %zu, req_len %u\n",
+				    data_offset, length, req_len);
 			err = -EINVAL;
 			goto out;
 		}
 
 		data_buf = (char *)(((char *)&req->hdr.ProtocolId) +
-				    le16_to_cpu(req->DataOffset));
+				    data_offset);
 
 		ksmbd_debug(SMB, "filename %pD, offset %lld, len %zu\n",
 			    fp->filp, offset, length);
author maintainer
#1006 lore raw

PATCH 990/1005 ksmbd: fix invalid pointer dereference when get_inode_acl() fails

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Henry Hu <[email protected]>

[ Upstream commit 19d180c7baab7126af5848ed87d5f7b5add0cef2 ]

When get_inode_acl() fails, it returns an ERR_PTR(), but ksmbd_acls_fattr() stored that pointer in smb_fattr without checking for errors. Later callers then passed the error pointer to security descriptor helpers or posix_acl_release(), resulting in an invalid pointer dereference.

This was reproduced on an XFS-backed share when xfs_get_acl() returned ERR_PTR(-ENOMEM). Querying the SMB ACL from a CIFS client triggered the crash:

  BUG: unable to handle page fault for address: fffffffffffffff8
  RIP: smb_acl_sec_desc_scratch_len+0x58/0x90 [ksmbd]
  Call Trace:
   smb2_query_info+0x40d/0x17c0 [ksmbd]
   handle_ksmbd_work+0x1ca/0x770 [ksmbd]

Fix this by checking the return values from get_inode_acl() in ksmbd_acls_fattr(). Treat -EOPNOTSUPP as indicating that no ACL is available, and propagate all other errors to the callers. Update smb2_open() and smb2_get_info_sec() to handle these errors.

Fixes e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Assisted-by Codex:gpt-5.6-sol
[ sashal: retained the non-const mnt_idmap parameter in ksmbd_acls_fattr() ]
---
 fs/smb/server/smb2pdu.c |   42 ++++++++++++++++++++++++++++++++++--------
 1 file changed, 34 insertions(+), 8 deletions(-)
fs/smb/server/smb2pdu.c +34 -8
@@ -2730,10 +2730,11 @@ static int smb2_create_sd_buffer(struct
 			    le32_to_cpu(sd_buf->ccontext.DataLength), true, false);
 }
 
-static void ksmbd_acls_fattr(struct smb_fattr *fattr,
-			     struct mnt_idmap *idmap,
-			     struct inode *inode)
+static int ksmbd_acls_fattr(struct smb_fattr *fattr,
+			    struct mnt_idmap *idmap,
+			    struct inode *inode)
 {
+	struct posix_acl *acl;
 	vfsuid_t vfsuid = i_uid_into_vfsuid(idmap, inode);
 	vfsgid_t vfsgid = i_gid_into_vfsgid(idmap, inode);
 
@@ -2744,10 +2745,28 @@ static void ksmbd_acls_fattr(struct smb_
 	fattr->cf_dacls = NULL;
 
 	if (IS_ENABLED(CONFIG_FS_POSIX_ACL)) {
-		fattr->cf_acls = get_inode_acl(inode, ACL_TYPE_ACCESS);
-		if (S_ISDIR(inode->i_mode))
-			fattr->cf_dacls = get_inode_acl(inode, ACL_TYPE_DEFAULT);
+		acl = get_inode_acl(inode, ACL_TYPE_ACCESS);
+		if (IS_ERR(acl)) {
+			if (acl != ERR_PTR(-EOPNOTSUPP))
+				return PTR_ERR(acl);
+			acl = NULL;
+		}
+		fattr->cf_acls = acl;
+
+		if (S_ISDIR(inode->i_mode)) {
+			acl = get_inode_acl(inode, ACL_TYPE_DEFAULT);
+			if (IS_ERR(acl)) {
+				if (acl != ERR_PTR(-EOPNOTSUPP)) {
+					posix_acl_release(fattr->cf_acls);
+					return PTR_ERR(acl);
+				}
+				acl = NULL;
+			}
+			fattr->cf_dacls = acl;
+		}
 	}
+
+	return 0;
 }
 
 enum {
@@ -3482,7 +3501,10 @@ int smb2_open(struct ksmbd_work *work)
 					int pntsd_size;
 					size_t scratch_len;
 
-					ksmbd_acls_fattr(&fattr, idmap, inode);
+					rc = ksmbd_acls_fattr(&fattr, idmap, inode);
+					if (rc)
+						goto err_out;
+
 					scratch_len = smb_acl_sec_desc_scratch_len(&fattr,
 							NULL, 0,
 							OWNER_SECINFO | GROUP_SECINFO |
@@ -5953,7 +5975,11 @@ static int smb2_get_info_sec(struct ksmb
 
 	idmap = file_mnt_idmap(fp->filp);
 	inode = file_inode(fp->filp);
-	ksmbd_acls_fattr(&fattr, idmap, inode);
+	rc = ksmbd_acls_fattr(&fattr, idmap, inode);
+	if (rc) {
+		ksmbd_fd_put(work, fp);
+		return rc;
+	}
 
 	if (test_share_config_flag(work->tcon->share_conf,
 				   KSMBD_SHARE_FLAG_ACL_XATTR))
author maintainer
#1007 lore raw

PATCH 991/1005 ksmbd: use the existing xattr name for a named stream

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: DaeMyung Kang <[email protected]>

[ Upstream commit a7d1d52748e0fe4d06fdb871fc9899904fbba93f ]

SMB stream names are case-insensitive, but ksmbd stores each named stream in an xattr whose name is case-sensitive. Opening an existing stream finds its xattr with a case-insensitive match, yet the handle keeps the name as the client spelled it, and every later operation that needs an exact name uses that spelling:

- a WRITE or an end-of-file change creates a second xattr, so a stream created as "Foo" and written through "foo" ends up stored twice, and which value a later lookup returns depends on xattr list order;
- delete-on-close and delete-pending removal can fail with -ENODATA, or remove only a case-variant copy and leave the original;
- the share mode check compares stream names with strcmp(), so two opens of the same stream that differ only in case do not conflict.

Have ksmbd_vfs_casexattr_len() copy the matching xattr's name into the handle when the stream is opened, so later operations use the name already on disk. The match must have the same length as the name it replaces; the stream lookup passes a length that includes the terminating NUL, which already guarantees that, and the check makes the copy safe for any caller. A stream that does not exist yet keeps the client's spelling, as before.

smb2_rename() compares and looks up fp->stream.name case-insensitively, so it behaves the same with either spelling.

Fixes e2f34481b24d ("cifsd: add server-side procedures for SMB3")
[ sashal: adapted stream lookup signature changes to the existing callers and non-const mnt_idmap interface ]
---
 fs/smb/server/smb2pdu.c |    8 ++++----
 fs/smb/server/vfs.c     |    7 ++++++-
 fs/smb/server/vfs.h     |    2 +-
 3 files changed, 11 insertions(+), 6 deletions(-)
fs/smb/server/smb2pdu.c +4 -4
@@ -2475,7 +2475,7 @@ static int smb2_set_ea(struct smb2_ea_in
 						     path->dentry,
 						     attr_name,
 						     XATTR_USER_PREFIX_LEN +
-						     eabuf->EaNameLength);
+						     eabuf->EaNameLength, NULL);
 
 			/* delete the EA only when it exits */
 			if (rc > 0) {
@@ -2547,11 +2547,11 @@ static noinline int smb2_set_stream_name
 	fp->stream.name = xattr_stream_name;
 	fp->stream.size = xattr_stream_size;
 
-	/* Check if there is stream prefix in xattr space */
+	/* Keep the existing xattr's case for subsequent writes and removal. */
 	rc = ksmbd_vfs_casexattr_len(idmap,
 				     path->dentry,
 				     xattr_stream_name,
-				     xattr_stream_size);
+				     xattr_stream_size, xattr_stream_name);
 	if (rc >= 0)
 		return 0;
 	if (rc != -ENOENT && rc != -ENODATA)
@@ -5276,7 +5276,7 @@ static int get_file_stream_info(struct k
 		 */
 		slen = ksmbd_vfs_casexattr_len(file_mnt_idmap(fp->filp),
 						path->dentry, stream_name,
-						strlen(stream_name) + 1);
+						strlen(stream_name) + 1, NULL);
 		ssize = slen < 0 ? 0 : (loff_t)slen;
 		file_info->StreamSize = cpu_to_le64(ssize);
 		file_info->StreamAllocationSize = cpu_to_le64(ssize);
fs/smb/server/vfs.c +6 -1
@@ -1816,7 +1816,7 @@ int ksmbd_vfs_fill_dentry_attrs(struct k
 
 ssize_t ksmbd_vfs_casexattr_len(struct mnt_idmap *idmap,
 				struct dentry *dentry, char *attr_name,
-				int attr_name_len)
+				int attr_name_len, char *actual_name)
 {
 	char *name, *xattr_list = NULL;
 	ssize_t value_len = -ENOENT, xattr_list_len;
@@ -1834,8 +1834,13 @@ ssize_t ksmbd_vfs_casexattr_len(struct m
 		ksmbd_debug(VFS, "%s, len %zd\n", name, strlen(name));
 		if (strncasecmp(attr_name, name, attr_name_len))
 			continue;
+		if (actual_name && strlen(name) + 1 != attr_name_len)
+			continue;
 
 		value_len = ksmbd_vfs_xattr_len(idmap, dentry, name);
+		/* The caller provides attr_name_len bytes for the actual name. */
+		if (value_len >= 0 && actual_name)
+			memcpy(actual_name, name, attr_name_len);
 		break;
 	}
 
fs/smb/server/vfs.h +1 -1
@@ -107,7 +107,7 @@ ssize_t ksmbd_vfs_getxattr(struct mnt_id
 			   char **xattr_buf);
 ssize_t ksmbd_vfs_casexattr_len(struct mnt_idmap *idmap,
 				struct dentry *dentry, char *attr_name,
-				int attr_name_len);
+				int attr_name_len, char *actual_name);
 int ksmbd_vfs_setxattr(struct mnt_idmap *idmap,
 		       const struct path *path, const char *attr_name,
 		       void *attr_value, size_t attr_size, int flags,
author maintainer
#1008 lore raw

PATCH 992/1005 ksmbd: fix out-of-bounds read when padding the final compound response

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ian Bridges <[email protected]>

[ Upstream commit 714f27729121d59f103ca4dad7b0c2d1c125cd71 ]

Compound response handling pads the last response of a compound to an 8-byte boundary by growing the final iov and the RFC1002 length. smb2_allocate_rsp_buf() allocates exactly response_sz. A command can fill the response buffer to within 7 bytes of its end, for example a QUERY_INFO whose output is bounded only by the space left. The padding can then run past the allocation, and ksmbd_tcp_writev() reads those bytes when it sends the response.

  BUG: KASAN: slab-out-of-bounds in _copy_from_iter+0x744/0x10e0
  Call Trace:
   _copy_from_iter+0x744/0x10e0
   tcp_sendmsg_locked+0x2290/0x3f80
   ksmbd_tcp_writev+0x10c7/0x1ab0 [ksmbd]

Allocate room for the padding when the request is a compound, as smb2_read() and smb2_read_pipe() do for their payloads. response_sz is unchanged, so commands still fill only up to it, and kvzalloc() zeroes the padding.

Fixes e2f34481b24d ("cifsd: add server-side procedures for SMB3")
[ sashal: Adjusted context to retain work->conn->vals->max_trans_size instead of vals->max_trans_size. ]
---
 fs/smb/server/smb2pdu.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
fs/smb/server/smb2pdu.c +10 -3
@@ -539,7 +539,7 @@ int smb2_allocate_rsp_buf(struct ksmbd_w
 	struct smb2_hdr *hdr = smb_get_msg(work->request_buf);
 	size_t small_sz = MAX_CIFS_SMALL_BUFFER_SIZE;
 	size_t large_sz = small_sz + work->conn->vals->max_trans_size;
-	size_t sz = small_sz;
+	size_t sz = small_sz, pad_sz = 0;
 	int cmd = le16_to_cpu(hdr->Command);
 
 	if (cmd == SMB2_IOCTL_HE || cmd == SMB2_QUERY_DIRECTORY_HE)
@@ -561,10 +561,17 @@ int smb2_allocate_rsp_buf(struct ksmbd_w
 	}
 
 	/* allocate large response buf for chained commands */
-	if (le32_to_cpu(hdr->NextCommand) > 0)
+	if (le32_to_cpu(hdr->NextCommand) > 0) {
 		sz = large_sz;
+		/*
+		 * is_chained_smb2_message() pads the last response of a
+		 * compound to 8 bytes, which can take it past response_sz.
+		 * Leave room for the padding. kvzalloc() zeroes it.
+		 */
+		pad_sz = ALIGN(sz - sizeof(__be32), 8) - (sz - sizeof(__be32));
+	}
 
-	work->response_buf = kvzalloc(sz, KSMBD_DEFAULT_GFP);
+	work->response_buf = kvzalloc(sz + pad_sz, KSMBD_DEFAULT_GFP);
 	if (!work->response_buf)
 		return -ENOMEM;
 
author maintainer
#1009 lore raw

PATCH 993/1005 ksmbd: fix named stream write and EOF handling

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: DaeMyung Kang <[email protected]>

[ Upstream commit 02165c8d402392278a5cd2cf97645ed73a7ad4a1 ]

An SMB WRITE to an existing named stream can silently discard data after its written range. ksmbd stores streams as xattr values, but the write path passes offset + count as the length of the replacement xattr even when the old stream is longer. Writing 26 bytes at offset 0 to a 60-byte stream reports 26 bytes written while discarding the remaining 34 bytes.

Keep the existing xattr length when an in-place write ends before EOF. Reject writes that cross XATTR_SIZE_MAX rather than storing only the portion that fits while reporting the full requested count.

Commit 4ea0bb8aaedf ("ksmbd: handle set/get info file for streamed file") intentionally skipped ordinary inode truncation for stream handles: an EOF SetInfo on an ADS had truncated the base file. That fixed the base file corruption but left stream EOF changes reporting success without resizing the stream. Handle these requests by resizing only the stream xattr; the base file size remains untouched. Zero-fill stream extensions. This is needed alongside the write fix: a short write's accidental truncation previously masked an ignored explicit EOF change. The stream resize helper returns xattr errors directly rather than using the base-file truncate path's EBADF conversion.

Fixes f44158485826 ("cifsd: add file operations")
Fixes 4ea0bb8aaedf ("ksmbd: handle set/get info file for streamed file")
[ sashal: changed const struct mnt_idmap pointers to non-const pointers ]
---
 fs/smb/server/smb2pdu.c |    5 ++-
 fs/smb/server/vfs.c     |   72 ++++++++++++++++++++++++++++++++++++++++++------
 fs/smb/server/vfs.h     |    1 
 3 files changed, 68 insertions(+), 10 deletions(-)
fs/smb/server/smb2pdu.c +3 -2
@@ -6590,6 +6590,8 @@ static int set_end_of_file_info(struct k
 
 	newsize = le64_to_cpu(file_eof_info->EndOfFile);
 	inode = file_inode(fp->filp);
+	if (ksmbd_stream_fd(fp))
+		return ksmbd_vfs_stream_truncate(fp, newsize);
 
 	/*
 	 * If FILE_END_OF_FILE_INFORMATION of set_info_file is called
@@ -6598,8 +6600,7 @@ static int set_end_of_file_info(struct k
 	 * truncate of some filesystem like FAT32 fill zero data in
 	 * truncated range.
 	 */
-	if (inode->i_sb->s_magic != MSDOS_SUPER_MAGIC &&
-	    ksmbd_stream_fd(fp) == false) {
+	if (inode->i_sb->s_magic != MSDOS_SUPER_MAGIC) {
 		ksmbd_debug(SMB, "truncated to newsize %lld\n", newsize);
 		rc = ksmbd_vfs_truncate(work, fp, newsize);
 		if (rc) {
fs/smb/server/vfs.c +64 -8

106 lines not on this page · raw message

fs/smb/server/vfs.h +1 -0
@@ -82,6 +82,7 @@ int ksmbd_vfs_read(struct ksmbd_work *wo
 int ksmbd_vfs_write(struct ksmbd_work *work, struct ksmbd_file *fp,
 		    char *buf, size_t count, loff_t *pos, bool sync,
 		    ssize_t *written);
+int ksmbd_vfs_stream_truncate(struct ksmbd_file *fp, loff_t newsize);
 int ksmbd_vfs_fsync(struct ksmbd_work *work, u64 fid, u64 p_id);
 int ksmbd_vfs_remove_file(struct ksmbd_work *work, const struct path *path);
 int ksmbd_vfs_link(struct ksmbd_work *work,
author maintainer
#1010 lore raw

PATCH 994/1005 ksmbd: verify transform SessionId matches the decrypted header

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Dairui Zhang <[email protected]>

[ Upstream commit 798214e6fafcdcc29f5ba2661a473232b5e70cfb ]

When an encrypted request comes in, the decryption key is picked by the SessionId in the transform header, but the request is then authorized under whatever session the decrypted inner header names. Nothing ever compares the two, so on a connection with more than one session a client can get a request decrypted with one session's key and run it as another session. Encrypted requests are exempt from signing too, so a valid AEAD tag is the only proof of session identity, and it is checked against the wrong session.

MS-SMB2 says the server must check that the transform SessionId matches the one in the decrypted SMB2 header and treat a mismatch as a protocol error. Add that check in __handle_ksmbd_work() after decryption, before dispatching: the message has to be at least one fixed SMB2 header, the first operation must not set SMB2_FLAGS_RELATED_OPERATIONS and its SessionId must match the transform SessionId, and every following non-related operation in a compound chain must carry the same SessionId. NextCommand offsets must be 8-byte aligned and stay inside the message; the bounds check is done by subtraction so it cannot wrap.

When the decrypted payload is a compression transform, the existing decompression step runs first and the decompressed SMB2 message is checked instead, since a compression transform header carries no SessionId.

Fixes e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Assisted-by LLM
[ sashal: Placed session validation directly after decryption because the intervening decompression code is absent. ]
---
 fs/smb/server/server.c  |   16 ++++++++++++++
 fs/smb/server/smb2pdu.c |   54 ++++++++++++++++++++++++++++++++++++++++++++++++
 fs/smb/server/smb2pdu.h |    1 
 3 files changed, 71 insertions(+)
fs/smb/server/server.c +16 -0
@@ -169,12 +169,28 @@ static void __handle_ksmbd_work(struct k
 
 	if (conn->ops->is_transform_hdr &&
 	    conn->ops->is_transform_hdr(work->request_buf)) {
+		u64 tr_sess_id;
+
+		if (get_rfc1002_len(work->request_buf) <
+		    sizeof(struct smb2_transform_hdr)) {
+			ksmbd_conn_abort(conn);
+			return;
+		}
+		tr_sess_id = le64_to_cpu(((struct smb2_transform_hdr *)
+				smb_get_msg(work->request_buf))->SessionId);
+
 		rc = conn->ops->decrypt_req(work);
 		if (rc < 0) {
 			ksmbd_conn_abort(conn);
 			return;
 		}
 		work->encrypted = true;
+
+		rc = ksmbd_check_transform_session(work, tr_sess_id);
+		if (rc < 0) {
+			ksmbd_conn_abort(conn);
+			return;
+		}
 	}
 
 	if (conn->ops->allocate_rsp_buf(work))
fs/smb/server/smb2pdu.c +54 -0

60 lines not on this page · raw message

fs/smb/server/smb2pdu.h +1 -0
@@ -441,6 +441,7 @@ struct channel *lookup_chann_list(struct
 void smb3_preauth_hash_rsp(struct ksmbd_work *work);
 bool smb3_is_transform_hdr(void *buf);
 int smb3_decrypt_req(struct ksmbd_work *work);
+int ksmbd_check_transform_session(struct ksmbd_work *work, u64 tr_sess_id);
 int smb3_encrypt_resp(struct ksmbd_work *work);
 bool smb3_11_final_sess_setup_resp(struct ksmbd_work *work);
 int smb2_set_rsp_credits(struct ksmbd_work *work);
author maintainer
#1011 lore raw

PATCH 995/1005 ksmbd: fix use-after-free after a failed durable reconnect

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ian Bridges <[email protected]>

[ Upstream commit 248b5819591c577727930e4e255a455235fab50a ]

ksmbd_reopen_durable_fd() republishes a detached durable handle in the reconnecting session's file table and takes no reference for that entry. If smb2_open() then fails, cleanup relies on the final ksmbd_fd_put() to remove the volatile id.

Two reconnects of the same handle can both take a lookup reference before either attaches it. If the one that reopens first then fails and drops its references first, the other request makes the final put through ksmbd_put_durable_fd(). That frees the handle without removing the first session's table entry, so tearing that session down writes to freed memory.

  BUG: KASAN: slab-use-after-free in __close_file_table_ids+0x14d/0x740 [ksmbd]
  Call Trace:
   __close_file_table_ids+0x14d/0x740 [ksmbd]
   ksmbd_destroy_file_table+0x76/0x100 [ksmbd]
   ksmbd_session_destroy+0xf8/0x480 [ksmbd]
   ksmbd_dispose_sessions+0x13e/0x200 [ksmbd]
   ksmbd_conn_sessions_cleanup+0x4c3/0x6d0 [ksmbd]
  Freed by task 1030:
   __ksmbd_close_fd+0x97d/0x1000 [ksmbd]
   smb2_open+0x14eb/0xd9f0 [ksmbd]

Commit 3515503322f4 ("ksmbd: fix durable reconnect error path file lifetime") handles a final put made by the reconnecting request, but not one made by another holder.

Remove the volatile id under the file-table lock on this error path, before the references are dropped, as ksmbd_close_fd() does on the request_open path just above. Removal then no longer depends on which holder makes the final put. The stale comment in the reconnect cleanup is updated to match. A successful reconnect is unchanged.

Fixes c8efcc786146 ("ksmbd: add support for durable handles v1/v2")
[ sashal: Adapted the cleanup call to a braced if (fp) block because the replay and request-open cleanup branches are absent. ]
---
 fs/smb/server/smb2pdu.c   |   12 +++++++-----
 fs/smb/server/vfs_cache.c |   28 ++++++++++++++++++++++++++++
 fs/smb/server/vfs_cache.h |    2 ++
 3 files changed, 37 insertions(+), 5 deletions(-)
fs/smb/server/smb2pdu.c +7 -5
@@ -3933,8 +3933,11 @@ err_out2:
 		if (!rsp->hdr.Status)
 			rsp->hdr.Status = STATUS_UNEXPECTED_IO_ERROR;
 
-		if (fp)
+		if (fp) {
+			if (dh_info.reconnected && fp == dh_info.fp)
+				ksmbd_unpublish_reopened_fd(work, fp);
 			ksmbd_fd_put(work, fp);
+		}
 		smb2_set_err_rsp(work);
 		ksmbd_debug(SMB, "Error response: %x\n", rsp->hdr.Status);
 	}
@@ -3942,10 +3945,9 @@ err_out2:
 	if (dh_info.reconnected) {
 		/*
 		 * If reconnect succeeded, fp was republished in the
-		 * session file table.  On a later error, ksmbd_fd_put()
-		 * above drops the session reference; drop the durable
-		 * lookup reference through the same session-aware path so
-		 * final close removes the volatile id before freeing fp.
+		 * session file table, and the error path above has
+		 * already removed its volatile id.  Drop the durable
+		 * lookup reference through the same session-aware path.
 		 */
 		if (rc && fp == dh_info.fp)
 			ksmbd_fd_put(work, dh_info.fp);
fs/smb/server/vfs_cache.c +28 -0
@@ -486,6 +486,34 @@ static void set_close_state_blocked_work
 	spin_unlock(&fp->f_lock);
 }
 
+/**
+ * ksmbd_unpublish_reopened_fd() - remove a reopened durable handle from the
+ *	session file table after its CREATE failed
+ * @work:	smb work of the failed CREATE
+ * @fp:		durable handle republished by ksmbd_reopen_durable_fd()
+ *
+ * The reopen publishes @fp in this session's table without taking a reference
+ * for the entry, so the CREATE error path's puts need not be the last ones.
+ * Another holder of a global-table reference, such as a concurrent reconnect
+ * of the same handle, can drop the last one through ksmbd_put_durable_fd(),
+ * which frees @fp without touching this table.  Remove the id here, while
+ * the caller still holds its references.
+ *
+ * Every path that removes the id before the final put also clears
+ * @fp->volatile_id under ft->lock, so a valid id is still @fp's entry.
+ */
+void ksmbd_unpublish_reopened_fd(struct ksmbd_work *work, struct ksmbd_file *fp)
+{
+	struct ksmbd_file_table *ft = &work->sess->file_table;
+
+	write_lock(&ft->lock);
+	if (has_file_id(fp->volatile_id)) {
+		idr_remove(ft->idr, fp->volatile_id);
+		fp->volatile_id = KSMBD_NO_FID;
+	}
+	write_unlock(&ft->lock);
+}
+
 int ksmbd_close_fd(struct ksmbd_work *work, u64 id)
 {
 	struct ksmbd_file	*fp;
fs/smb/server/vfs_cache.h +2 -0
@@ -158,6 +158,8 @@ static inline bool ksmbd_stream_fd(struc
 int ksmbd_init_file_table(struct ksmbd_file_table *ft);
 void ksmbd_destroy_file_table(struct ksmbd_session *sess);
 int ksmbd_close_fd(struct ksmbd_work *work, u64 id);
+void ksmbd_unpublish_reopened_fd(struct ksmbd_work *work,
+				 struct ksmbd_file *fp);
 struct ksmbd_file *ksmbd_lookup_fd_fast(struct ksmbd_work *work, u64 id);
 struct ksmbd_file *ksmbd_lookup_foreign_fd(struct ksmbd_work *work, u64 id);
 struct ksmbd_file *ksmbd_lookup_fd_slow(struct ksmbd_work *work, u64 id,
author maintainer
#1012 lore raw

PATCH 996/1005 media: ipu-bridge: Fix use-after-free in IVSC error path

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Yibo Tan <[email protected]>

[ Upstream commit 3d42d1c82717f0853379b516a7fab54b636e09cc ]

ipu_bridge_get_ivsc_acpi_dev() returns an ACPI device with a reference held. If no matching CSI device is found, ipu_bridge_check_ivsc_dev() drops that reference before passing the device to dev_err(). Concurrent CSI device and ACPI namespace removal can drop the other references, making this the final put. dev_err() then reads the freed struct acpi_device and its kobject name.

This was reproduced without kprobes by racing normal CSI platform-device unregistration and ACPI configfs table removal against the production ipu_bridge_init() entry. KASAN reported the final free through device_release(), followed by invalid reads through _dev_err().

Emit the error message while the lookup reference is still held, then drop the reference as before.

Source reproducers and vulnerable/fixed serial logs, with only the build hostname redacted, are available at:
https://github.com/kimaiden1984-boop/linux-ipu-bridge-acpi-uaf-reproducer

The fixed target builds with W=1 on x86-64. This was not tested on physical IPU hardware. The tests establish runtime reachability but do not measure occurrence frequency on shipping systems or establish exploitability.

Fixes c66821f381ae ("media: pci: intel: Add IVSC support for IPU bridge driver")
Assisted-by Codex:GPT-5
[ sashal: Retained the existing "MEI CSI dev" diagnostic because CVS support is absent. ]
---
 drivers/media/pci/intel/ipu-bridge.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/intel/ipu-bridge.c +1 -1
@@ -191,8 +191,8 @@ static int ipu_bridge_check_ivsc_dev(str
 	if (adev) {
 		csi_dev = ipu_bridge_get_ivsc_csi_dev(adev);
 		if (!csi_dev) {
-			acpi_dev_put(adev);
 			dev_err(ADEV_DEV(adev), "Failed to find MEI CSI dev\n");
+			acpi_dev_put(adev);
 			return -ENODEV;
 		}
 
author maintainer
#1013 lore raw

PATCH 997/1005 pps: change pps_gen_class to a const struct

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jori Koolstra <[email protected]>

[ Upstream commit 4dc0c899b14c3ea2c9b5f42b523301040d1c8100 ]

The class_create() call has been deprecated in favor of class_register() as the driver core now allows for a struct class to be in read-only memory. Change pps_gen_class to be a const struct class and drop the class_create() call.

Stable-dep-of: d19552611cb2 ("pps: generators: fix use-after-free when closing a removed device")

---
 drivers/pps/generators/pps_gen.c |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/pps/generators/pps_gen.c +12 -10
@@ -26,7 +26,10 @@
  */
 
 static dev_t pps_gen_devt;
-static struct class *pps_gen_class;
+static const struct class pps_gen_class = {
+	.name		= "pps-gen",
+	.dev_groups	= pps_gen_groups
+};
 
 static DEFINE_IDA(pps_gen_ida);
 
@@ -183,7 +186,7 @@ static int pps_gen_register_cdev(struct
 				MAJOR(pps_gen_devt), pps_gen->id);
 		goto free_ida;
 	}
-	pps_gen->dev = device_create(pps_gen_class, pps_gen->info->parent, devt,
+	pps_gen->dev = device_create(&pps_gen_class, pps_gen->info->parent, devt,
 				     pps_gen, "pps-gen%d", pps_gen->id);
 	if (IS_ERR(pps_gen->dev)) {
 		err = PTR_ERR(pps_gen->dev);
@@ -207,7 +210,7 @@ free_ida:
 static void pps_gen_unregister_cdev(struct pps_gen_device *pps_gen)
 {
 	pr_debug("unregistering pps-gen%d\n", pps_gen->id);
-	device_destroy(pps_gen_class, pps_gen->dev->devt);
+	device_destroy(&pps_gen_class, pps_gen->dev->devt);
 }
 
 /*
@@ -307,7 +310,7 @@ EXPORT_SYMBOL(pps_gen_event);
 
 static void __exit pps_gen_exit(void)
 {
-	class_destroy(pps_gen_class);
+	class_unregister(&pps_gen_class);
 	unregister_chrdev_region(pps_gen_devt, PPS_GEN_MAX_SOURCES);
 }
 
@@ -315,12 +318,11 @@ static int __init pps_gen_init(void)
 {
 	int err;
 
-	pps_gen_class = class_create("pps-gen");
-	if (IS_ERR(pps_gen_class)) {
-		pr_err("failed to allocate class\n");
-		return PTR_ERR(pps_gen_class);
+	err = class_register(&pps_gen_class);
+	if (err) {
+		pr_err("failed to register class\n");
+		return err;
 	}
-	pps_gen_class->dev_groups = pps_gen_groups;
 
 	err = alloc_chrdev_region(&pps_gen_devt, 0,
 					PPS_GEN_MAX_SOURCES, "pps-gen");
@@ -332,7 +334,7 @@ static int __init pps_gen_init(void)
 	return 0;
 
 remove_class:
-	class_destroy(pps_gen_class);
+	class_unregister(&pps_gen_class);
 	return err;
 }
 
author maintainer
#1014 lore raw

PATCH 998/1005 pps: generators: fix use-after-free when closing a removed device

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Danish Khateeb <[email protected]>

[ Upstream commit d19552611cb2eb6329826871565e5309bec2f288 ]

The cdev of a PPS generator is embedded in struct pps_gen_device, but nothing ties the lifetime of that structure to the cdev: pps_gen is freed by the release function of its device, and an open file holds a device reference only until pps_gen_cdev_release() drops it.

When the generator is unregistered while /dev/pps-genN is open, that put_device() drops the last reference and frees pps_gen, and __fput() then calls cdev_put() on the freed cdev:

  BUG: KASAN: slab-use-after-free in cdev_put+0x53/0x60
  Read of size 8 at addr ffff88801383e138 by task ppsgen64/149
  Call Trace:
   cdev_put+0x53/0x60
   __fput+0x745/0xad0
   fput_close_sync+0xd9/0x1b0
   __x64_sys_close+0x86/0xf0
  ...
  Freed by task 149:
   kfree+0x25a/0x6d0
   device_release+0xca/0x3c0
   kobject_put+0x169/0x320
   pps_gen_cdev_release+0x51/0x80
   __fput+0x36a/0xad0

pps.c had the same bug, fixed in commit c79a39dc8d06 ("pps: Fix a use-after-free").

Fix it the usual way: embed the struct device in pps_gen_device and register both with cdev_device_add(). This makes the device the parent of the cdev, so the cdev holds a device reference until the last file is closed.

---
 drivers/pps/generators/pps_gen.c |   63 +++++++++++++++++++--------------------
 include/linux/pps_gen_kernel.h   |    2 -
 2 files changed, 32 insertions(+), 33 deletions(-)
drivers/pps/generators/pps_gen.c +31 -32
@@ -63,7 +63,7 @@ static long pps_gen_cdev_ioctl(struct fi
 
 	switch (cmd) {
 	case PPS_GEN_SETENABLE:
-		dev_dbg(pps_gen->dev, "PPS_GEN_SETENABLE\n");
+		dev_dbg(&pps_gen->dev, "PPS_GEN_SETENABLE\n");
 
 		ret = get_user(status, uiuarg);
 		if (ret)
@@ -77,7 +77,7 @@ static long pps_gen_cdev_ioctl(struct fi
 		break;
 
 	case PPS_GEN_USESYSTEMCLOCK:
-		dev_dbg(pps_gen->dev, "PPS_GEN_USESYSTEMCLOCK\n");
+		dev_dbg(&pps_gen->dev, "PPS_GEN_USESYSTEMCLOCK\n");
 
 		ret = put_user(pps_gen->info->use_system_clock, uiuarg);
 		if (ret)
@@ -89,12 +89,12 @@ static long pps_gen_cdev_ioctl(struct fi
 		struct pps_gen_event info;
 		unsigned int ev = pps_gen->last_ev;
 
-		dev_dbg(pps_gen->dev, "PPS_GEN_FETCHEVENT\n");
+		dev_dbg(&pps_gen->dev, "PPS_GEN_FETCHEVENT\n");
 
 		ret = wait_event_interruptible(pps_gen->queue,
 				ev != pps_gen->last_ev);
 		if (ret == -ERESTARTSYS) {
-			dev_dbg(pps_gen->dev, "pending signal caught\n");
+			dev_dbg(&pps_gen->dev, "pending signal caught\n");
 			return -EINTR;
 		}
 
@@ -121,7 +121,7 @@ static int pps_gen_cdev_open(struct inod
 	struct pps_gen_device *pps_gen = container_of(inode->i_cdev,
 				struct pps_gen_device, cdev);
 
-	get_device(pps_gen->dev);
+	get_device(&pps_gen->dev);
 	file->private_data = pps_gen;
 	return 0;
 }
@@ -130,7 +130,7 @@ static int pps_gen_cdev_release(struct i
 {
 	struct pps_gen_device *pps_gen = file->private_data;
 
-	put_device(pps_gen->dev);
+	put_device(&pps_gen->dev);
 	return 0;
 }
 
@@ -151,19 +151,15 @@ static void pps_gen_device_destruct(stru
 {
 	struct pps_gen_device *pps_gen = dev_get_drvdata(dev);
 
-	cdev_del(&pps_gen->cdev);
-
 	pr_debug("deallocating pps-gen%d\n", pps_gen->id);
 	ida_free(&pps_gen_ida, pps_gen->id);
 
-	kfree(dev);
 	kfree(pps_gen);
 }
 
 static int pps_gen_register_cdev(struct pps_gen_device *pps_gen)
 {
 	int err;
-	dev_t devt;
 
 	err = ida_alloc_max(&pps_gen_ida, PPS_GEN_MAX_SOURCES - 1, GFP_KERNEL);
 	if (err < 0) {
@@ -171,46 +167,52 @@ static int pps_gen_register_cdev(struct
 			pr_err("too many PPS sources in the system\n");
 			err = -EBUSY;
 		}
+		kfree(pps_gen);
 		return err;
 	}
 	pps_gen->id = err;
 
-	devt = MKDEV(MAJOR(pps_gen_devt), pps_gen->id);
+	/*
+	 * From here on pps_gen belongs to its device and is freed by
+	 * pps_gen_device_destruct(). The cdev holds a reference to the
+	 * device, so pps_gen stays around until the last file is closed.
+	 */
+	device_initialize(&pps_gen->dev);
+	pps_gen->dev.class = &pps_gen_class;
+	pps_gen->dev.parent = pps_gen->info->parent;
+	pps_gen->dev.devt = MKDEV(MAJOR(pps_gen_devt), pps_gen->id);
+	pps_gen->dev.release = pps_gen_device_destruct;
+	dev_set_drvdata(&pps_gen->dev, pps_gen);
 
 	cdev_init(&pps_gen->cdev, &pps_gen_cdev_fops);
 	pps_gen->cdev.owner = pps_gen->info->owner;
 
-	err = cdev_add(&pps_gen->cdev, devt, 1);
+	err = dev_set_name(&pps_gen->dev, "pps-gen%d", pps_gen->id);
+	if (err)
+		goto put_dev;
+
+	err = cdev_device_add(&pps_gen->cdev, &pps_gen->dev);
 	if (err) {
 		pr_err("failed to add char device %d:%d\n",
 				MAJOR(pps_gen_devt), pps_gen->id);
-		goto free_ida;
+		goto put_dev;
 	}
-	pps_gen->dev = device_create(&pps_gen_class, pps_gen->info->parent, devt,
-				     pps_gen, "pps-gen%d", pps_gen->id);
-	if (IS_ERR(pps_gen->dev)) {
-		err = PTR_ERR(pps_gen->dev);
-		goto del_cdev;
-	}
-	pps_gen->dev->release = pps_gen_device_destruct;
-	dev_set_drvdata(pps_gen->dev, pps_gen);
 
 	pr_debug("generator got cdev (%d:%d)\n",
 			MAJOR(pps_gen_devt), pps_gen->id);
 
 	return 0;
 
-del_cdev:
-	cdev_del(&pps_gen->cdev);
-free_ida:
-	ida_free(&pps_gen_ida, pps_gen->id);
+put_dev:
+	put_device(&pps_gen->dev);
 	return err;
 }
 
 static void pps_gen_unregister_cdev(struct pps_gen_device *pps_gen)
 {
 	pr_debug("unregistering pps-gen%d\n", pps_gen->id);
-	device_destroy(&pps_gen_class, pps_gen->dev->devt);
+	cdev_device_del(&pps_gen->cdev, &pps_gen->dev);
+	put_device(&pps_gen->dev);
 }
 
 /*
@@ -244,18 +246,15 @@ struct pps_gen_device *pps_gen_register_
 	init_waitqueue_head(&pps_gen->queue);
 	spin_lock_init(&pps_gen->lock);
 
-	/* Create the char device */
+	/* Create the char device, this frees pps_gen on failure */
 	err = pps_gen_register_cdev(pps_gen);
 	if (err < 0) {
 		pr_err(" unable to create char device\n");
-		goto kfree_pps_gen;
+		goto pps_gen_register_source_exit;
 	}
 
 	return pps_gen;
 
-kfree_pps_gen:
-	kfree(pps_gen);
-
 pps_gen_register_source_exit:
 	pr_err("unable to register generator\n");
 
@@ -289,7 +288,7 @@ void pps_gen_event(struct pps_gen_device
 {
 	unsigned long flags;
 
-	dev_dbg(pps_gen->dev, "PPS generator event %u\n", event);
+	dev_dbg(&pps_gen->dev, "PPS generator event %u\n", event);
 
 	spin_lock_irqsave(&pps_gen->lock, flags);
 
include/linux/pps_gen_kernel.h +1 -1
@@ -54,7 +54,7 @@ struct pps_gen_device {
 
 	unsigned int id;			/* PPS generator unique ID */
 	struct cdev cdev;
-	struct device *dev;
+	struct device dev;
 	struct fasync_struct *async_queue;	/* fasync method */
 	spinlock_t lock;
 };
author maintainer
#1015 lore raw

PATCH 999/1005 mm/rmap: dont discard lazyfree THPs at PMD level

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Zi Yan <[email protected]>

commit 984c0700854e35779a2bcce6b02783e709b6efa2 upstream.

__discard_anon_folio_pmd_locked() clears a lazyfree THP's PMD before it determines whether the folio can be discarded, and restores it if the folio is dirty or has extra references. It is done under only the PMD lock and the anon_vma read lock inside try_to_unmap_one() and no mmap lock is held. The temporarily none PMD causes UAF.

A parallel munmap() or mremap() is supposed to serialize with it on the PMD lock, but zap_pmd_range() (called by munmap()) and move_page_tables() (called by mremap()) do not take the lock when they see the temporarily none PMD and skip the PMD. There is no more page table walk after the none PMD is restored:

- munmap(): free_pgtables() waits in unlink_anon_vmas() for the anon_vma lock, then free_pmd_range() drops the restored PMD as bad without removing the rmap, so the folio keeps a stale mapcount.

- whole-VMA MREMAP_DONTUNMAP: dontunmap_complete() unlinks the source VMA from its anon_vma while the restored PMD still maps the folio.

- plain mremap(): the THP is not moved but unmapped, so the THP's data is lost.

In the first two cases, the folio stays mapped, but no VMA that maps it is linked to its anon_vma. When the anon_vma is freed, it is still reachable when one rmap walks the folio. Racing lazyfree reclaim against MREMAP_DONTUNMAP as an unprivileged user reproduces a KASAN use-after-free in folio_lock_anon_vma_read() as reported in the Closes link.

One solution is to use an invalidated PMD instead of a cleared one until the discard is committed, but it needs arch fixes first.
1. GUP-fast still follows an invalidated PMD on riscv, LoongArch and s390.
2. sparc64 miscounts thp_pte_count when an invalidated PMD is set again or cleared.

To keep the fix simple for backport, stop discarding lazyfree THPs at PMD level instead. try_to_unmap_one() splits the PMD and discards the folio at PTE level.

unmap_huge_pmd_locked() and __discard_anon_folio_pmd_locked() are left in place, unused, to minimize this fix for backport and the invalidated PMD approach is planned as a follow-up series to use them again.

---
 mm/rmap.c |   11 -----------
 1 file changed, 11 deletions(-)
mm/rmap.c +0 -11
@@ -1963,17 +1963,6 @@ static bool try_to_unmap_one(struct foli
 		}
 
 		if (!pvmw.pte) {
-			if (folio_test_anon(folio) && !folio_test_swapbacked(folio)) {
-				if (unmap_huge_pmd_locked(vma, pvmw.address, pvmw.pmd, folio))
-					goto walk_done;
-				/*
-				 * unmap_huge_pmd_locked has either already marked
-				 * the folio as swap-backed or decided to retain it
-				 * due to GUP or speculative references.
-				 */
-				goto walk_abort;
-			}
-
 			if (flags & TTU_SPLIT_HUGE_PMD) {
 				/*
 				 * We temporarily have to drop the PTL and
author maintainer
#1016 lore raw

PATCH 1000/1005 media: rc: Fix build failure with CONFIG_LIRC disabled

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sean Young <[email protected]>

commit 0c795849fd70d6bdb99aea5dd08d9b43128612f6 upstream.

commit 37efd09ba2c6 ("media: rc: Ensure registered is cleared in error path") broke the build if CONFIG_LIRC was not enabled.

Fixes 37efd09ba2c6 ("media: rc: Ensure registered is cleared in error path")
---
 drivers/media/rc/lirc_dev.c |    3 +++
 drivers/media/rc/rc-main.c  |    3 +--
 2 files changed, 4 insertions(+), 2 deletions(-)
drivers/media/rc/lirc_dev.c +3 -0
@@ -775,6 +775,9 @@ void lirc_unregister(struct rc_dev *dev)
 	unsigned long flags;
 	struct lirc_fh *fh;
 
+	if (!device_is_registered(&dev->lirc_dev))
+		return;
+
 	dev_dbg(&dev->dev, "lirc_dev: driver %s unregistered from minor = %d\n",
 		dev->driver_name, MINOR(dev->lirc_dev.devt));
 
drivers/media/rc/rc-main.c +1 -2
@@ -1981,8 +1981,7 @@ out_lirc:
 	scoped_guard(mutex, &dev->lock)
 		dev->registered = false;
 
-	if (device_is_registered(&dev->lirc_dev))
-		lirc_unregister(dev);
+	lirc_unregister(dev);
 	device_del(&dev->dev);
 	/* registered already cleared above */
 	goto out_free_table;
author maintainer
#1017 lore raw

PATCH 1001/1005 selftests: ublk: add missing gitignore for metadata_size binary

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Alexander Atanasov <[email protected]>

commit 8e5bcc3a955a2cc4460b391f55d3b49905eb248e upstream.

A new utility metadata_size was added in
commit 261b67f4e347 ("selftests: ublk: add utility to get block device metadata size") but it was not added to .gitignore. Fix that by adding it there.

While at it sort all entries alphabetically and add a SPDX license header.

Fixes 261b67f4e347 ("selftests: ublk: add utility to get block device metadata size")
---
 tools/testing/selftests/ublk/.gitignore |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
tools/testing/selftests/ublk/.gitignore +4 -2
@@ -1,3 +1,5 @@
-kublk
-/tools
+# SPDX-License-Identifier: GPL-2.0
 *-verify.state
+/tools
+kublk
+metadata_size
author maintainer
#1018 lore raw

PATCH 1002/1005 drm/amdgpu/powerplay: Align get_tonga_state_array() header with prototype

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Srinivasan Shanmugam <[email protected]>

commit 4986757d3207383c052689532e505edccc6df7c8 upstream.

The function header above get_tonga_state_array() still refers to check_powerplay_tables() and does not describe all of the function parameters.

Update it to match the current function prototype and include the missing parameter description.

Fixes 1ac24df78c56 ("drm/amd/pm: Validate Tonga PowerPlay state array bounds")
Cc Yang Wang <[email protected]>
Cc Hawking Zhang <[email protected]>
---
 drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/process_pptables_v1_0.c +4 -3
@@ -1500,11 +1500,12 @@ static int init_thermal_controller(
 }
 
 /**
- * check_powerplay_tables - Private Function used during initialization.
- * Inspect the PowerPlay table for obvious signs of corruption.
+ * get_tonga_state_array - Get the Tonga state array from the PowerPlay table.
  * @hwmgr: Pointer to the hardware manager.
  * @powerplay_table: Pointer to the PowerPlay Table.
- * Exception:  2 if the powerplay table is incorrect.
+ * @state_array: Pointer to the returned Tonga state array.
+ *
+ * Return: 0 on success, negative error code on failure.
  */
 static int get_tonga_state_array(struct pp_hwmgr *hwmgr,
 	const ATOM_Tonga_POWERPLAYTABLE *powerplay_table,
author maintainer
#1019 lore raw

PATCH 1003/1005 netfilter: conntrack: always lower timeout for non-closing RST packets

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Pablo Neira Ayuso <[email protected]>

commit 73df81b38cb7f70a347a97370386378a86e53019 upstream.

The existing check might extend the timeout if the ESTABLISHED timeout has been tuned to be lower than UNACK via sysctl. Reported by sashiko.

Fixes bf80e6802273 ("netfilter: conntrack: tcp: use UNACK timeout for non-closing RST packets")
---
 net/netfilter/nf_conntrack_proto_tcp.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nf_conntrack_proto_tcp.c +2 -1
@@ -1326,7 +1326,8 @@ int nf_conntrack_tcp_packet(struct nf_co
 	    timeouts[new_state] > timeouts[TCP_CONNTRACK_RETRANS])
 		timeout = timeouts[TCP_CONNTRACK_RETRANS];
 	else if (unlikely(index == TCP_RST_SET &&
-			  new_state == TCP_CONNTRACK_ESTABLISHED))
+			  new_state == TCP_CONNTRACK_ESTABLISHED) &&
+		 timeouts[new_state] > timeouts[TCP_CONNTRACK_UNACK])
 		timeout = timeouts[TCP_CONNTRACK_UNACK];
 	else if ((ct->proto.tcp.seen[0].flags | ct->proto.tcp.seen[1].flags) &
 		 IP_CT_TCP_FLAG_DATA_UNACKNOWLEDGED &&
author maintainer
#1020 lore raw

PATCH 1004/1005 opp: fix use after free in _update_opp_table_clk()

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Peter Griffin <[email protected]>

commit 1f6de65e3314519ce462bfd3a1d29e918f97e4e5 upstream.

dev_pm_opp_put_opp_table() frees the opp_table which is subsquently used by dev_err_probe(). This causes an Oops during boot on gs101-oriole.

cpu cpu0: error 000000006b6b6b6b: Couldn't find clock

Unable to handle kernel paging request at virtual address 006b6b6b6b6b6cd3
...
Hardware name: Oriole (DT)
pstate: 00400005 (nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : _of_add_table_indexed+0x80/0xbb0
lr : _of_add_table_indexed+0x6c/0xbb0
...
Call trace:
 _of_add_table_indexed+0x80/0xbb0 (P)
 dev_pm_opp_of_cpumask_add_table+0x70/0x120
 dt_cpufreq_probe+0x23c/0x480
 platform_probe+0x64/0xb8
Fixes 84f05af0975c9 ("opp: Use clk_get_optional() to avoid leaving opp_table->clk as an error pointer")
[ Viresh: use return value of dev_err_probe() ]
---
 drivers/opp/core.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/opp/core.c +4 -2
@@ -1579,6 +1579,8 @@ static struct opp_table *_update_opp_tab
 					       struct opp_table *opp_table,
 					       bool getclk)
 {
+	int ret;
+
 	/*
 	 * Return early if we don't need to get clk or we have already done it
 	 * earlier.
@@ -1605,9 +1607,9 @@ static struct opp_table *_update_opp_tab
 	opp_table->clk = clk_get_optional(dev, NULL);
 
 	if (IS_ERR(opp_table->clk)) {
+		ret = dev_err_probe(dev, PTR_ERR(opp_table->clk), "Couldn't find clock\n");
 		dev_pm_opp_put_opp_table(opp_table);
-		dev_err_probe(dev, PTR_ERR(opp_table->clk), "Couldn't find clock\n");
-		return ERR_CAST(opp_table->clk);
+		return ERR_PTR(ret);
 	}
 
 	if (opp_table->clk)
author maintainer
#1021 lore raw

PATCH 1005/1005 ALSA: hda/realtek: Fix audio after Windows reboot on ASUS Q423SA

In reply to Greg Kroah-Hartman

6.18-stable review patch. If anyone has any objections, please let me know.

------------------

From: Scott Gauche <[email protected]>

commit 8acd6469f42784f38872ad83b14c41152d986b63 upstream.

The ASUS Vivobook S 14 Q423SA-U5512 (DMI family S5406SA) with the ALC294 codec has working analog audio when booted directly after a full shutdown. After a warm reboot from Windows 11, audio works briefly during Linux startup, then both the internal speakers and headphones become silent. PCM playback continues without errors.

Coefficient 0x1b is 0x4e4b on a direct cold boot, but 0x4a4b after the Windows warm reboot. Restoring bit 10 changes it back to 0x4e4b and immediately enables both analog outputs. Speaker playback, headphone playback, jack switching, cold boot, and suspend/resume were tested successfully. The same 0x4a4b state and immediate recovery with 0x4e4b were independently confirmed on another S5406SA with subsystem 1043:10c4.

The same coefficient write is already used by ALC294_FIXUP_ASUS_COEF_1B for the ASUS UX431DA. That fixup cannot be reused here because it chains to ALC289_FIXUP_ASUS_GA401 and applies unrelated DAC routing and microphone pin configuration.

Add a model-specific fixup for subsystem 1043:10c4 and chain it to the existing ALC2XX_FIXUP_HEADSET_MIC fixup instead.

Fixes f2d08f3651fb ("ALSA: hda/realtek: Fix headset mic on ASUS Vivobook S14 S5406SA")
---
 sound/hda/codecs/realtek/alc269.c |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
sound/hda/codecs/realtek/alc269.c +13 -1
@@ -3842,6 +3842,7 @@ enum {
 	ALC294_FIXUP_ASUS_I2C_HEADSET_MIC,
 	ALC294_FIXUP_ASUS_SPI_HEADSET_MIC,
 	ALC294_FIXUP_ASUS_SPK,
+	ALC294_FIXUP_ASUS_Q423SA,
 	ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
 	ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE,
 	ALC255_FIXUP_ACER_HEADSET_MIC,
@@ -5263,6 +5264,17 @@ static const struct hda_fixup alc269_fix
 		.chained = true,
 		.chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC
 	},
+	[ALC294_FIXUP_ASUS_Q423SA] = {
+		.type = HDA_FIXUP_VERBS,
+		.v.verbs = (const struct hda_verb[]) {
+			/* Restore bit 10 lost after reboot from Windows */
+			{ 0x20, AC_VERB_SET_COEF_INDEX, 0x1b },
+			{ 0x20, AC_VERB_SET_PROC_COEF, 0x4e4b },
+			{ }
+		},
+		.chained = true,
+		.chain_id = ALC2XX_FIXUP_HEADSET_MIC,
+	},
 	[ALC295_FIXUP_CHROME_BOOK] = {
 		.type = HDA_FIXUP_FUNC,
 		.v.func = alc295_fixup_chromebook,
@@ -7161,7 +7173,7 @@ static const struct hda_quirk alc269_fix
 	SND_PCI_QUIRK(0x1043, 0x10a1, "ASUS UX391UA", ALC294_FIXUP_ASUS_SPK),
 	SND_PCI_QUIRK(0x1043, 0x10a4, "ASUS TP3407SA", ALC287_FIXUP_TAS2781_I2C),
 	SND_PCI_QUIRK(0x1043, 0x10c0, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC),
-	SND_PCI_QUIRK(0x1043, 0x10c4, "ASUS Vivobook S14 S5406SA", ALC2XX_FIXUP_HEADSET_MIC),
+	SND_PCI_QUIRK(0x1043, 0x10c4, "ASUS S5406SA/Q423SA", ALC294_FIXUP_ASUS_Q423SA),
 	SND_PCI_QUIRK(0x1043, 0x10d0, "ASUS X540LA/X540LJ", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE),
 	SND_PCI_QUIRK(0x1043, 0x10d3, "ASUS K6500ZC", ALC294_FIXUP_ASUS_SPK),
 	SND_PCI_QUIRK(0x1043, 0x1154, "ASUS TP3607SH", ALC287_FIXUP_TAS2781_I2C),
Tested-by on the v1 series
#1022 lore raw
In reply to Greg Kroah-Hartman
Quoted 7 lines · On Wed, 4 Nov 2026 15:55:33 -0500 Greg Kroah-Hartman…

This is the start of the stable review cycle for the 6.18.61 release. There are 1005 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 Fri, 06 Nov 2026 21:07:23 +0000. Anything received after that time might be too late.

This rc kernel passes DAMON functionality test [1] on my test machine.

[1] https://github.com/damonitor/damon-tests/tree/next/corr

Thanks,
SJ

[...]

Tested-by on the v1 series
#1023 lore raw
In reply to Greg Kroah-Hartman

Am 04.11.2026 um 21:55 schrieb Greg Kroah-Hartman:

Quoted 4 lines

This is the start of the stable review cycle for the 6.18.61 release. There are 1005 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-2697v2 server. No dmesg oddities or regressions found.

Beste Grüße,
Peter Schneider

Signature · 8 lines
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&[email protected]
https://keys.mailvelope.com/pks/lookup?op=get&[email protected]
Tested-by on the v1 series
#1024 lore raw
In reply to Greg Kroah-Hartman

Build tested in our x86,arm64,loongarch,riscv config successfully without error.

Best Regards
Wentao Guan

Log:
Linux version 6.18.61-rc1-ga7c80de5ffd0 (guanwentao@uos-PC) (aarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #2 SMP PREEMPT_DYNAMIC Thu Nov 5 18:01:38 CST 2026 Linux version 6.18.61-rc1-ga7c80de5ffd0 (guanwentao@uos-PC) (loongarch64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #3 SMP PREEMPT_DYNAMIC Thu Nov 5 18:21:56 CST 2026 Linux version 6.18.61-rc1+ (guanwentao@uos-PC) (riscv64-linux-gnu-gcc-12 (Deepin 12.3.0-17deepin8) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #4 SMP PREEMPT Thu Nov 5 18:41:25 CST 2026 Linux version 6.18.61-rc1-ga7c80de5ffd0 (guanwentao@uos-PC) (gcc (Deepin 12.3.0-17deepin18) 12.3.0, GNU ld (GNU Binutils for Deepin) 2.41) #1 SMP PREEMPT_DYNAMIC Thu Nov 5 17:40:11 CST 2026

Tested-by on the v1 series
#1025 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.18.61 release. There are 1005 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 Fri, 06 Nov 2026 21:07:23 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.61-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.18.y
and the diffstat can be found below.

thanks,

greg k-h

Built and booted successfully on RISC-V RV64 (HiFive Unmatched).

syzbot Tested-by [email protected] on the v1 series
#1026 lore raw
In reply to Greg Kroah-Hartman
syzbot ci has tested the following series

syzbot ci has tested the following series

[v1] 6.18.61-rc1 review
https://lore.kernel.org/all/[email protected]
* [PATCH 6.18 0001/1005] net: skbuff: propagate shared-frag marker in skb_zerocopy()
* [PATCH 6.18 0002/1005] ksmbd: wait for negotiation before receiving another PDU
* [PATCH 6.18 0003/1005] mm: vmscan: fix dirty folios throttling on cgroup v1 for MGLRU
* [PATCH 6.18 0004/1005] iio: hid-sensor: als: scale each channel individually
* [PATCH 6.18 0005/1005] platform: cznic: turris-omnia-mcu: Add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0006/1005] kbuild: link-vmlinux.sh: improve detection of third pass requirement
* [PATCH 6.18 0007/1005] hwmon: (lm90) Rely on subsystem locking
* [PATCH 6.18 0008/1005] exec: cancel io_uring requests before de_thread()
* [PATCH 6.18 0009/1005] fork: move the coredump and exec checks into create_io_thread()
* [PATCH 6.18 0010/1005] fork: dont create io threads once PF_POSTCOREDUMP is set
* [PATCH 6.18 0011/1005] coredump: prevent TIF_NOTIFY_SIGNAL from interrupting coredumps
* [PATCH 6.18 0012/1005] net: bonding: use workqueue to make sure peer notify updated in lacp mode
* [PATCH 6.18 0013/1005] net: bonding: move bond_should_notify_peers, e.g. into rtnl lock block
* [PATCH 6.18 0014/1005] ALSA: line6: Clear prev_fbuf on capture buffer release
* [PATCH 6.18 0015/1005] drm/rockchip: dw_hdmi: Use resume_early pm ops for system suspend
* [PATCH 6.18 0016/1005] drm/virtio: abort virtqueue wait on device removal to avoid hung task
* [PATCH 6.18 0017/1005] drm/panel-edp: Add BOE NV116WH2-M30, BOE NT116WHM-N21, BOE NV116FH1-M31, BOE NV116FH1-M30
* [PATCH 6.18 0018/1005] drm/amdgpu/mes_v12_0: use mes schedule pipe for legacy queues on unified MES
* [PATCH 6.18 0019/1005] drm/amd/pm: Validate OD DPM triples before mutating tables
* [PATCH 6.18 0020/1005] drm/amdgpu: Gate debugfs MMIO access on kernel lockdown
* [PATCH 6.18 0021/1005] drm/amd/display: fix max dispclk_khz/dppclk_khz double 1000
* [PATCH 6.18 0022/1005] drm/radeon: avoid double free in r600 DPM cleanup
* [PATCH 6.18 0023/1005] drm/amdgpu: add buf length check
* [PATCH 6.18 0024/1005] drm/amdgpu: add bounds check to prevent array overflow
* [PATCH 6.18 0025/1005] gpio: pca9570: Use I2C match data
* [PATCH 6.18 0026/1005] selftests/filesystems/overlayfs: fix set_layers_via_fds link error
* [PATCH 6.18 0027/1005] HID: wacom: avoid copying Bluetooth input reports
* [PATCH 6.18 0028/1005] w1: ds2482: add OF device match table
* [PATCH 6.18 0029/1005] ALSA: hda: Add support for Hygon family 18h model 5h HD-Audio
* [PATCH 6.18 0030/1005] ALSA: hda: Force resume if acomp notified during system suspend
* [PATCH 6.18 0031/1005] media: cec: stm32: return an error when log-address wait times out
* [PATCH 6.18 0032/1005] ALSA: usb-audio: Release components on probe errors
* [PATCH 6.18 0033/1005] irqdomain: Plug leak in irq_domain_alloc_irqs_locked() error path
* [PATCH 6.18 0034/1005] ASoC: sma1303: remove fault-check sysfs group on remove
* [PATCH 6.18 0035/1005] spi: qpic-snand: free OOB buffer with ECC context
* [PATCH 6.18 0036/1005] clk: zynq: handle kasprintf() failure in periph_clk registration
* [PATCH 6.18 0037/1005] ASoC: tlv320aic26: remove keyclick sysfs file
* [PATCH 6.18 0038/1005] ASoC: hdac_hdmi: Fix resource cleanup on probe failure
* [PATCH 6.18 0039/1005] regmap: maple: Workaround for another false-positive compiler warning
* [PATCH 6.18 0040/1005] selftests/cgroup: Adjust cpu test duration based on HZ
* [PATCH 6.18 0041/1005] ARM: OMAP2+: Add CFI type for omap4_finish_suspend
* [PATCH 6.18 0042/1005] iio: accel: fxls8962af: clamp the device-reported FIFO sample count
* [PATCH 6.18 0043/1005] perf/x86/intel: Fallback to sw branch type decoding if no hw decoding
* [PATCH 6.18 0044/1005] drm/sysfb: simpledrm: Validate mmap size against framebuffer size
* [PATCH 6.18 0045/1005] perf/core: Fix kernel register info leak via hardware skid
* [PATCH 6.18 0046/1005] fat: reject name longer than NAME_MAX in msdos_format_name()
* [PATCH 6.18 0047/1005] perf/x86/intel/uncore: Fix PCI PMU cleanup on setup failure
* [PATCH 6.18 0048/1005] fs/namespace: notify pollers of legacy propagation changes
* [PATCH 6.18 0049/1005] spi: bcm-qspi: return error from failed controller suspend
* [PATCH 6.18 0050/1005] spi: bcm63xx: return error from failed controller suspend
* [PATCH 6.18 0051/1005] spi: bcm63xx-hsspi: return error from failed controller suspend
* [PATCH 6.18 0052/1005] drm/panel-edp: Add BOE NE160QDM-NY1 panel
* [PATCH 6.18 0053/1005] spi: fsl-dspi: clean up after failed suspend and resume
* [PATCH 6.18 0054/1005] spi: nxp-fspi: disable runtime PM on probe failures
* [PATCH 6.18 0055/1005] spi: bcmbca-hsspi: return error from failed controller suspend
* [PATCH 6.18 0056/1005] memory: stm32_omm: initialize ret in stm32_omm_set_amcr
* [PATCH 6.18 0057/1005] wifi: ath12k: avoid setting 320MHz support on non 6GHz band
* [PATCH 6.18 0058/1005] i2c: amd-asf: Validate firmware-reported length
* [PATCH 6.18 0059/1005] netpoll: do not warn when the best-effort pool refill fails
* [PATCH 6.18 0060/1005] i2c: acpi: Force ELAN1300 touchpads to 100 kHz
* [PATCH 6.18 0061/1005] drm/amdgpu: Add checks to vbios fetch through ATRM
* [PATCH 6.18 0062/1005] drm/amdgpu: Validate ATPX buffer length before use
* [PATCH 6.18 0063/1005] drm/amdgpu: Fix kobject cleanup in xcp sysfs
* [PATCH 6.18 0064/1005] drm/amdgpu: Validate ATIF buffer length before use
* [PATCH 6.18 0065/1005] drm/amdgpu: validate XCP topology counts before division
* [PATCH 6.18 0066/1005] drm/amd/pm: validate vega10 profile mode inputs
* [PATCH 6.18 0067/1005] drm/amdgpu: Support some Barco AMD based graphics adapters
* [PATCH 6.18 0068/1005] drm/amdgpu: Guard reads in pcie state readout
* [PATCH 6.18 0069/1005] drm/amdgpu: add check for xcp id
* [PATCH 6.18 0070/1005] drm/amd/pm: Validate Vega hwmgr PowerPlay table bounds
* [PATCH 6.18 0071/1005] drm/amd/pm: Validate pp_table header before reading size
* [PATCH 6.18 0072/1005] drm/amd/pm: Use uploaded size for legacy custom PPTable
* [PATCH 6.18 0073/1005] drm/amdkfd: use node XCC count for v9 CRIU control stack restore
* [PATCH 6.18 0074/1005] drm/amd/pm: Validate Tonga PowerPlay state array bounds
* [PATCH 6.18 0075/1005] drm/amd/pm: Guard VBIOS AC timing table walk
* [PATCH 6.18 0076/1005] drm/amd/pm: Validate Tonga PPTable subtable bounds
* [PATCH 6.18 0077/1005] drm/amd/pm: Validate Vega10 PPTable subtable bounds
* [PATCH 6.18 0078/1005] drm/amd/pm: Validate legacy hwmgr PP table offsets
* [PATCH 6.18 0079/1005] drm/amdkfd: add sanity check in svm_range_is_valid
* [PATCH 6.18 0080/1005] drm/panel-edp: Support MB116AS013 edp panel
* [PATCH 6.18 0081/1005] libbpf: Skip bpf_object__probe_loading() when BPF token is in use
* [PATCH 6.18 0082/1005] net: usb: rtl8150: handle link status read failures
* [PATCH 6.18 0083/1005] netfilter: ebtables: bound num_counters like nentries in do_replace()
* [PATCH 6.18 0084/1005] soundwire: dmi-quirks: Disable ghost Realtek on Asus Expertbook
* [PATCH 6.18 0085/1005] dmaengine: pl330: remove debugfs file on teardown
* [PATCH 6.18 0086/1005] net: mvneta_bm: add suspend/resume support to prevent crash after resume
* [PATCH 6.18 0087/1005] dmaengine: dw-axi-dmac: fix __le32 on set of CH_CTL_H_LLI_VALID
* [PATCH 6.18 0088/1005] wifi: rtlwifi: rtl8723be: Remove unnecessary irq save/restore in hw_init()
* [PATCH 6.18 0089/1005] wifi: rtw89: wow: only WiFi 6 chips initialize RF registers in WoWLAN mode
* [PATCH 6.18 0090/1005] wifi: rtlwifi: fix disabling of ASPM for RTL8723BE with AER flooding
* [PATCH 6.18 0091/1005] wifi: rtw89: wow: add QoS control field to WoWLAN ARP response for MLO
* [PATCH 6.18 0092/1005] soc: amlogic: meson-clk-measure: remove debugfs tree
* [PATCH 6.18 0093/1005] block: reject block device inodes with i_rdev == 0 in lookup_bdev()
* [PATCH 6.18 0094/1005] iio: adc: max1241: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0095/1005] RDMA/irdma: Suppress PF reset on HMC error
* [PATCH 6.18 0096/1005] soc: qcom: socinfo: Add SoC ID for SDM850
* [PATCH 6.18 0097/1005] RDMA/rxe: Check PDs for memory window binds
* [PATCH 6.18 0098/1005] dt-bindings: arm: qcom,ids: Add SoC ID for Snapdragon SDM 850
* [PATCH 6.18 0099/1005] gpio: sifive: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0100/1005] mmc: moxart: report DMA completion timeout
* [PATCH 6.18 0101/1005] mmc: cqhci: fix to missed endian conversions
* [PATCH 6.18 0102/1005] mmc: sdhci-of-ma35d1: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0103/1005] mmc: dw_mmc: stop and complete DMA also in STATE_DATA_BUSY state
* [PATCH 6.18 0104/1005] clk: sunxi-ng: fix ccu probe clock unregister on error
* [PATCH 6.18 0105/1005] remoteproc: core: Full attach detach during recovery
* [PATCH 6.18 0106/1005] nvme: handle positive error codes in nuse_show()
* [PATCH 6.18 0107/1005] nvme-auth: use crypto_memneq for DH-HMAC-CHAP response comparison
* [PATCH 6.18 0108/1005] nvme: zns: cap zone report nr_zones by DMA buffer size
* [PATCH 6.18 0109/1005] staging: rtl8723bs: fix missing unregister_netdev on sdio_alloc_irq failure
* [PATCH 6.18 0110/1005] usb: typec: mux: tusb1046: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0111/1005] udf: validate extent partition references in udf_current_aext()
* [PATCH 6.18 0112/1005] udf: avoid recursive s_alloc_mutex deadlock when freeing AED blocks
* [PATCH 6.18 0113/1005] ASoC: codecs: uda1342: Leave cache-only mode before syncing
* [PATCH 6.18 0114/1005] drm/amdgpu/atomfirmware: WARN() rather than BUG()
* [PATCH 6.18 0115/1005] drm/amdgpu/gfx11: WARN() rather than BUG() for invalid SDMA engine
* [PATCH 6.18 0116/1005] nvme: dont reference NS after unlocking in nvme_ns_head_ctrl_ioctl()
* [PATCH 6.18 0117/1005] bus: mhi: core: Fix sys error transition latency
* [PATCH 6.18 0118/1005] platform/x86/amd/hsmp: Validate ACPI UID before parsing socket index
* [PATCH 6.18 0119/1005] ASoC: codecs: max98396: Unwind supplies on resume failure
* [PATCH 6.18 0120/1005] platform/x86/amd/hsmp: Validate _DSD mailbox sub-package element count
* [PATCH 6.18 0121/1005] PCI/ATS: Ensure pci_ats_supported() is PF-aware for VFs
* [PATCH 6.18 0122/1005] rpmsg: char: Check for ongoing chrdev destroy
* [PATCH 6.18 0123/1005] media: cec: tegra: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0124/1005] media: v4l2-tpg: reduce stack usage for kasan builds
* [PATCH 6.18 0125/1005] mmc: block: reject invalid perdev_minors before division
* [PATCH 6.18 0126/1005] serial: 8250: force synchronous probe for the ISA and PNP drivers
* [PATCH 6.18 0127/1005] tty: serial: pch_uart: add check for pci_get_slot()
* [PATCH 6.18 0128/1005] serial: qcom_geni: Disable closing_wait for console to prevent shutdown timeout
* [PATCH 6.18 0129/1005] usb: fsl_qe_udc: check qe_alloc_request() failure in ch9getstatus()
* [PATCH 6.18 0130/1005] usb: gadget: u_audio: clean up capture endpoint on feedback failure
* [PATCH 6.18 0131/1005] usb_string_copy: Use kzalloc() to avoid leaking old data
* [PATCH 6.18 0132/1005] USB: gadget: inode: fix mm lifetime handling
* [PATCH 6.18 0133/1005] pinctrl: sx150x: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0134/1005] crypto: keembay - add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0135/1005] gpio: vf610: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0136/1005] pmdomain: qcom: rpmhpd: Skip retention by default
* [PATCH 6.18 0137/1005] mmc: rtsx_usb_sdmmc: suppress false CD after init timeout
* [PATCH 6.18 0138/1005] media: em28xx: dev_info->pr_info since dev has been freed
* [PATCH 6.18 0139/1005] media: em28xx: requeue buffers if start_streaming fails
* [PATCH 6.18 0140/1005] media: em28xx: use vb2_video_unregister_device
* [PATCH 6.18 0141/1005] drm/xe: only resume exec queues that were actually suspended
* [PATCH 6.18 0142/1005] soundwire: dmi-quirks: add a global ghost list
* [PATCH 6.18 0143/1005] soundwire: intel_auxdevice: Add cs42l44 to wake_capable_list
* [PATCH 6.18 0144/1005] hfs: validate catalog CNIDs before instantiating inodes
* [PATCH 6.18 0145/1005] nvme: bound ns descriptor header and body to identify buffer
* [PATCH 6.18 0146/1005] iwlwifi: dvm: add missing cleaup for on error path
* [PATCH 6.18 0147/1005] nvme: clamp FDP nruhsd to allocated RUH status descriptor count
* [PATCH 6.18 0148/1005] media: i2c: ov8865: Drop the runtime PM usage count on stream failure
* [PATCH 6.18 0149/1005] drm/etnaviv: check all modules for idle after reset
* [PATCH 6.18 0150/1005] drm/etnaviv: check MMUv2 status after reset
* [PATCH 6.18 0151/1005] media: i2c: ov8865: Program the sensor on stream start
* [PATCH 6.18 0152/1005] media: ivtv: stop VBI start-code scan before short tail
* [PATCH 6.18 0153/1005] media: cx18: stop VBI start-code scan before short tail
* [PATCH 6.18 0154/1005] media: go7007: avoid undefined shifts in MPEG-4 headers
* [PATCH 6.18 0155/1005] remoteproc: qcom: Check subdev start status in rproc_stop()
* [PATCH 6.18 0156/1005] wifi: iwlwifi: validate PNVM SKU TLV length
* [PATCH 6.18 0157/1005] wifi: iwlwifi: support TTL platform device ID
* [PATCH 6.18 0158/1005] wifi: iwlwifi: validate UEFI reduced-power SKU TLV length
* [PATCH 6.18 0159/1005] wifi: iwlwifi: mld: validate D3_END notif size
* [PATCH 6.18 0160/1005] remoteproc: core: cancel crash_handler work in rproc_add() error path
* [PATCH 6.18 0161/1005] wifi: iwlwifi: mld: reset the driver state upon firmware recovery
* [PATCH 6.18 0162/1005] ASoC: cs35l56: Add support for CS35L62 for SoundWire
* [PATCH 6.18 0163/1005] wifi: iwlwifi: mvm: reset the smart fifo state upon FW stop
* [PATCH 6.18 0164/1005] wifi: iwlwifi: mld: cancel wiphy work before freeing wiphy
* [PATCH 6.18 0165/1005] tools/lib/api: Fix potential double-free from fdarray__grow()
* [PATCH 6.18 0166/1005] gpu: host1x: Wait for timeout worker completion on channel free
* [PATCH 6.18 0167/1005] wifi: iwlwifi: mld: support aborting an ongoing ftm request
* [PATCH 6.18 0168/1005] wifi: iwlwifi: mld: Do not cleanup FW state when the device is dead
* [PATCH 6.18 0169/1005] scsi: qla2xxx: Handle INTx not connected while passing through
* [PATCH 6.18 0170/1005] media: cec: tegra_cec: dont break off msg on NACK
* [PATCH 6.18 0171/1005] media: cec/core: drop cec_post_state_event call
* [PATCH 6.18 0172/1005] usb: musb: host: clear stale RX interrupt on three-strikes error
* [PATCH 6.18 0173/1005] usb: misc: cypress_cy7c63: check result of IO
* [PATCH 6.18 0174/1005] USB: misc: uss720: Fix leak in get_1284_register
* [PATCH 6.18 0175/1005] uio: sercos3: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0176/1005] comedi: ni_atmio16d: Add sanity check to interrupt handler
* [PATCH 6.18 0177/1005] comedi: ni_at_a2150: Fix sanity check in interrupt handler
* [PATCH 6.18 0178/1005] comedi: pcm818: Fix sanity check in interrupt handler
* [PATCH 6.18 0179/1005] comedi: quatech_daqp_cs: Fix sanity check in interrupt handler
* [PATCH 6.18 0180/1005] comedi: das6402: Add sanity check to interrupt handler
* [PATCH 6.18 0181/1005] comedi: dt2811: Fix sanity check in interrupt handler
* [PATCH 6.18 0182/1005] comedi: pcm711: Fix sanity check in interrupt handler
* [PATCH 6.18 0183/1005] comedi: aio_iiro_16: Add sanity check to interrupt handler
* [PATCH 6.18 0184/1005] comedi: pcmmio: Add sanity check to interrupt handler
* [PATCH 6.18 0185/1005] comedi: pcm816: Fix sanity check in interrupt handler
* [PATCH 6.18 0186/1005] comedi: pcmuio: Add sanity check to interrupt handler
* [PATCH 6.18 0187/1005] misc: bcm-vk: validate write size before allocation
* [PATCH 6.18 0188/1005] misc: genwqe: handle a first DMA address of zero
* [PATCH 6.18 0189/1005] misc: hpilo: validate device queue entries before use
* [PATCH 6.18 0190/1005] misc: rp1: clear chained IRQ handlers on teardown
* [PATCH 6.18 0191/1005] greybus: manifest: validate string descriptor header
* [PATCH 6.18 0192/1005] misc: ibmvmc: release send buffer on write errors
* [PATCH 6.18 0193/1005] ipack: ipoctal: add rwsem to guard against TOCTOU in remove path
* [PATCH 6.18 0194/1005] misc: ibmvmc: reject oversized inbound messages
* [PATCH 6.18 0195/1005] PCI: switchtec: Add Microchip PCI1008 device ID
* [PATCH 6.18 0196/1005] PCI: switchtec: Add Microchip PCI1008 to NTB DMA alias quirk
* [PATCH 6.18 0197/1005] driver core: attribute_container: Unwind device_add() on attr failure
* [PATCH 6.18 0198/1005] drm/msm/adreno: Add support for A704 GPU
* [PATCH 6.18 0199/1005] wifi: iwlwifi: mld: validate wake packet crypto overhead
* [PATCH 6.18 0200/1005] wifi: iwlwifi: mld: drop connection on D3 resume failure
* [PATCH 6.18 0201/1005] wifi: iwlwifi: mvm: ignore sync frames when sync is disabled
* [PATCH 6.18 0202/1005] media: dvb-core: fix feed leak on failed DMX_ADD_PID
* [PATCH 6.18 0203/1005] media: go7007: s2250: propagate control I/O failures
* [PATCH 6.18 0204/1005] drm/panel: panel-edp: Adjust T8 timing for AUO B116XAK01.6 and B140XTK02.4
* [PATCH 6.18 0205/1005] platform/x86: asus-nb-wmi: map ProArt key (0x8b) to KEY_PROG3
* [PATCH 6.18 0206/1005] ALSA: hda: Check snd_hda_power_pm construct error before executing verb
* [PATCH 6.18 0207/1005] ACPI: FPDT: validate table and record lengths
* [PATCH 6.18 0208/1005] ACPI: battery: Sanitise model_number by dropping unprintable characters
* [PATCH 6.18 0209/1005] platform/x86/amd/pmc: Add T14 Gen2 AMD (20XL) to s2idle quirk list
* [PATCH 6.18 0210/1005] ext4: reduce max cluster size to match documented 256MB limit
* [PATCH 6.18 0211/1005] PCI: vmd: Handle BUS_RESTRICT_CFG value 3 for Arrow Lake-HX
* [PATCH 6.18 0212/1005] ext4: set EXT4_STATE_NO_EXPAND in ext4_evict_inode
* [PATCH 6.18 0213/1005] wifi: mac80211: ibss: read deauth reason_code after frame length check
* [PATCH 6.18 0214/1005] wifi: mac80211_hwsim: clear PMSR request state on abort
* [PATCH 6.18 0215/1005] ACPI: sysfs: Properly map BERT and CCEL data to their ACPI tables
* [PATCH 6.18 0216/1005] riscv, bpf: Add support for BPF_SDIV and BPF_SMOD in RV32 JIT
* [PATCH 6.18 0217/1005] power: supply: cros_pchg: unregister EC notifier
* [PATCH 6.18 0218/1005] net: sfp: add quirk for HORACO copper SFP+ module
* [PATCH 6.18 0219/1005] net: prestera: ignore duplicate RIF destruction events
* [PATCH 6.18 0220/1005] power: reset: piix4-poweroff: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0221/1005] riscv, bpf: Add support for BPF_MOVSX in RV32 JIT
* [PATCH 6.18 0222/1005] wifi: cfg80211: include cf1 offset when sending chandef
* [PATCH 6.18 0223/1005] ext4: reject mount if clusters/inodes per group are not 8-aligned
* [PATCH 6.18 0224/1005] iommu/arm-smmu-qcom: Add SM8450 MDSS compatible
* [PATCH 6.18 0225/1005] drm/panel: simple: Add Kyocera tcg070wvlq panel
* [PATCH 6.18 0226/1005] iommu/qcom: Check pm_runtime_resume_and_get() return in probe
* [PATCH 6.18 0227/1005] iommu/qcom: Enable clocks before hardware access in qcom_iommu_ctx_probe()
* [PATCH 6.18 0228/1005] thermal: intel: int340x: clean up RFIM groups on DVFS failure
* [PATCH 6.18 0229/1005] iommu/qcom: Publish pgtbl_ops before releasing init_mutex
* [PATCH 6.18 0230/1005] net: libwx: disable TX VLAN offload for packets with >2 VLAN tags
* [PATCH 6.18 0231/1005] wifi: ath11k: validate regulatory capability phy_id
* [PATCH 6.18 0232/1005] wifi: ath10k: trigger hardware recovery upon rx failures
* [PATCH 6.18 0233/1005] wifi: ath12k: fix scan command endianness on big endian
* [PATCH 6.18 0234/1005] ext4: check return value of ext4_get_block() in ext4_load_tail_bh()
* [PATCH 6.18 0235/1005] ext4: use FGP_WRITEBEGIN for tail block zeroing
* [PATCH 6.18 0236/1005] bitops: make the *_bit_le functions use unsigned long
* [PATCH 6.18 0237/1005] ata: pata_ep93xx: fix PIO fallback when DMA init fails
* [PATCH 6.18 0238/1005] drm/etnaviv: force flush on power register ops
* [PATCH 6.18 0239/1005] soc: ixp4xx: qmgr: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0240/1005] ntfs3: initialize err in attr_wof_frame_info
* [PATCH 6.18 0241/1005] PCI/portdrv: Allow probing even without child services
* [PATCH 6.18 0242/1005] fs/ntfs3: reserve NUL byte when converting UTF-16 names
* [PATCH 6.18 0243/1005] ntfs3: fix info-leak in ntfs_rename()
* [PATCH 6.18 0244/1005] fs/ntfs3: fix lseek EINVAL on sparse/compressed files with 64-bit clusters
* [PATCH 6.18 0245/1005] fs/ntfs3: load ATTR_BITMAP run extents from $MFT extension records
* [PATCH 6.18 0246/1005] platform/x86: int1092: Fix info leak in parse_package()
* [PATCH 6.18 0247/1005] firmware: imx: scu: manage mailbox channels and global handle
* [PATCH 6.18 0248/1005] pinctrl: npcm8xx: enable RMII outputs from RMII groups
* [PATCH 6.18 0249/1005] pinctrl: npcm8xx: clear pending GPIO events during init
* [PATCH 6.18 0250/1005] pinctrl: npcm8xx: fix debounce register selection
* [PATCH 6.18 0251/1005] pinctrl: npcm8xx: move GPIO IRQ setup into request_resources
* [PATCH 6.18 0252/1005] hsi: omap_ssi: remove debugfs on port creation failure
* [PATCH 6.18 0253/1005] iommu/rockchip: Clear stale page faults before enabling stall
* [PATCH 6.18 0254/1005] scsi: ibmvfc: check for NULL evt in implicit LOGO and target delete path
* [PATCH 6.18 0255/1005] scsi: ibmvfc: free ibmvfc_target allocations with mempool_free
* [PATCH 6.18 0256/1005] udf: Fix bh leak for unallocated space entries
* [PATCH 6.18 0257/1005] udf: bound lengthAllocDescs from unallocated space entry
* [PATCH 6.18 0258/1005] exfat: write moved entry before removing source
* [PATCH 6.18 0259/1005] remoteproc: Force shutdown during device removal
* [PATCH 6.18 0260/1005] iommu/tegra241-cmdqv: Rate-limit the error ISRs log message
* [PATCH 6.18 0261/1005] clk: imx: imx8qxp: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0262/1005] clk: imx: imx8qxp-lpcg: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0263/1005] media: cx88: fix memory leak in cx8802_register_driver() error path
* [PATCH 6.18 0264/1005] clk: mediatek: mt6735-vdecsys: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0265/1005] clk: mediatek: mt6735-vencsys: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0266/1005] clk: tegra: support 48MHz clock for pll_p_out1
* [PATCH 6.18 0267/1005] clk: clocking-wizard: fix clock difference detection
* [PATCH 6.18 0268/1005] ata: ata_generic: Dont store pci_device_id
* [PATCH 6.18 0269/1005] i2c: qup: Propagate clock enable failures
* [PATCH 6.18 0270/1005] scsi: smartpqi: Add new PCI device-ids
* [PATCH 6.18 0271/1005] drm/amdkfd: Fix signal reset event
* [PATCH 6.18 0272/1005] drm/amd/display: Fix rounding errors in CalculatePrefetchSchedule
* [PATCH 6.18 0273/1005] arm64/runtime-const: Use aarch64_insn_patch_text_nosync() for patching
* [PATCH 6.18 0274/1005] exfat: clean up new entry on add entry failure
* [PATCH 6.18 0275/1005] ALSA: hda/conexant: Add NULL check for dc_mode_path
* [PATCH 6.18 0276/1005] drm/msm: Move nr_cmds initialization
* [PATCH 6.18 0277/1005] drm/msm: Fix barriers accessing ctx vm
* [PATCH 6.18 0278/1005] platform/x86: dell-smbios-wmi: Fix chardev resource management
* [PATCH 6.18 0279/1005] s390/mm: Add missing mm check to do_secure_storage_access()
* [PATCH 6.18 0280/1005] s390/mm: Fix handling of vmalloc area in do_secure_storage_access()
* [PATCH 6.18 0281/1005] drm/panel-edp: Add BOE NE140QDM-NX2
* [PATCH 6.18 0282/1005] soc: mediatek: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0283/1005] exfat: free new directory cluster if zeroing fails
* [PATCH 6.18 0284/1005] ALSA: hda/realtek: add missing NULL check for codec->bus->pci
* [PATCH 6.18 0285/1005] fs/ntfs3: Fix memory leak in indx_find_sort()
* [PATCH 6.18 0286/1005] mfd: ipaq-micro: Fix out-of-bounds stack read in ipaq_micro_str
* [PATCH 6.18 0287/1005] ALSA: hda/realtek: add missing error checks for COEF index reads in alc269
* [PATCH 6.18 0288/1005] mfd: axp20x: Preserve other control bits when powering off
* [PATCH 6.18 0289/1005] regulator: rt6245: Restore state on enable failure
* [PATCH 6.18 0290/1005] md/raid5: complete discard bios while reshape is active
* [PATCH 6.18 0291/1005] romfs: detect hard link cycles
* [PATCH 6.18 0292/1005] nvmem: brcm_nvram: reject empty NVRAM partition
* [PATCH 6.18 0293/1005] nvmem: brcm_nvram: fix out-of-bounds access on malformed flash data
* [PATCH 6.18 0294/1005] virtio_console: take a kref in find_port_by_vq() to fix port UAF
* [PATCH 6.18 0295/1005] wifi: mt76: mt7603: free beacon SKB on error
* [PATCH 6.18 0296/1005] wifi: mt76: mt76x02: report rx FCS errors to mac80211
* [PATCH 6.18 0297/1005] wifi: mt76: mt7915: configure noise floor reporting on reset
* [PATCH 6.18 0298/1005] wifi: mt76: mt7921: fix memory leak when skb_linearize fails in mcu rx event
* [PATCH 6.18 0299/1005] wifi: mt76: mt7603: add 0x7592 EEPROM chip ID
* [PATCH 6.18 0300/1005] wifi: mt76: wed: fix kernel panic on non-DBDC MT7986
* [PATCH 6.18 0301/1005] netfilter: conntrack: tcp: use UNACK timeout for non-closing RST packets
* [PATCH 6.18 0302/1005] netfilter: nf_tables: call skb_valid_dst() before skb_dst()
* [PATCH 6.18 0303/1005] perf: marvell: Cancel CN10K DDR PMU hrtimer on device remove
* [PATCH 6.18 0304/1005] wifi: ath11k: fix resource leak on error in ext IRQ setup
* [PATCH 6.18 0305/1005] ASoC: SOF: Intel: mtl: Power down DSP if it is left enabled in pre_fw_run()
* [PATCH 6.18 0306/1005] wifi: mt76: mt7615: fix NULL deref in mt7615_mac_set_rates
* [PATCH 6.18 0307/1005] wifi: mt76: set the EOSP bit in the QoS header of the last released frame
* [PATCH 6.18 0308/1005] wifi: mt76: mt7603: fix U-APSD service period termination
* [PATCH 6.18 0309/1005] wifi: mt76: mt7603: restore hardware PS buffering after a service period
* [PATCH 6.18 0310/1005] wifi: brcmfmac: Set DMA direction for msgbuf packet IDs
* [PATCH 6.18 0311/1005] wifi: brcmfmac: validate msgbuf flowring IDs before use
* [PATCH 6.18 0312/1005] wifi: wilc1000: validate monitor transmit frame headers
* [PATCH 6.18 0313/1005] ALSA: hda/realtek: Add quirk for ASUS VivoBook M515DA/X515DAP
* [PATCH 6.18 0314/1005] HID: logitech-hidpp: Add support for G502 X Plus USB mouse
* [PATCH 6.18 0315/1005] HID: quirks: Add ALWAYS_POLL quirk for Beitong BTP-KP20D dongle
* [PATCH 6.18 0316/1005] HID: quirks: add ALWAYS_POLL quirk for AULA Mini 60 HE Pro Dongle
* [PATCH 6.18 0317/1005] HID: intel-ish-hid: ignore post-init ENUM_DEVICES from firmware
* [PATCH 6.18 0318/1005] net/rds: dont use unpin_user_pages_dirty_lock() from atomic context
* [PATCH 6.18 0319/1005] net/rds: hold the socket while an rds_mr references it
* [PATCH 6.18 0320/1005] net/rds: fix rds_message leak in the rds_send_xmit() drop path
* [PATCH 6.18 0321/1005] net/rds: unpin MR pages with unpin_user_pages_dirty_lock()
* [PATCH 6.18 0322/1005] kconfig: abort rather than loop for ever on EOF
* [PATCH 6.18 0323/1005] s390/dasd: Snapshot intrc before freeing the request block
* [PATCH 6.18 0324/1005] ALSA: hda/realtek: Add mute LED support for HP Pavilion 15-eh2xxx
* [PATCH 6.18 0325/1005] ACPI: video: force native backlight on Acer Nitro AN515-46
* [PATCH 6.18 0326/1005] wifi: mt76: mt7603: file buffered frames under the TID reported to mac80211
* [PATCH 6.18 0327/1005] net: stmmac: raise TX completion interrupt at the end of an xmit burst
* [PATCH 6.18 0328/1005] net: usb: cdc_ether: add quirk for AMI BMC stale link events
* [PATCH 6.18 0329/1005] xsk: account ring allocations to memcg
* [PATCH 6.18 0330/1005] ALSA: hda/realtek: Enable mute LED on HP Laptop 15-dy0xxx
* [PATCH 6.18 0331/1005] ALSA: hda/realtek: Limit mic boost on Positivo N15RPE-S
* [PATCH 6.18 0332/1005] opp: Use clk_get_optional() to avoid leaving opp_table->clk as an error pointer
* [PATCH 6.18 0333/1005] soundwire: dmi-quirks: Disable ghost Realtek on Asus Zenbook Duo
* [PATCH 6.18 0334/1005] wifi: rsi: Fix types to appease CFI
* [PATCH 6.18 0335/1005] arm64: mm: fix accidental linear mapping of no-map reserved memory
* [PATCH 6.18 0336/1005] drm/amd/pm: derive stable PPT limits from PPTable
* [PATCH 6.18 0337/1005] HID: rmi: check report length before trimming sentinel bytes
* [PATCH 6.18 0338/1005] ext4: guard against NULL s_group_info in ext4_get_group_info
* [PATCH 6.18 0339/1005] ALSA: hda/realtek: Enable mute LEDs on HP Spectre x360 16-aa0xxx
* [PATCH 6.18 0340/1005] md/raid5: reject zero-sector reshape chunks
* [PATCH 6.18 0341/1005] md: skip bitmap accounting for empty write ranges
* [PATCH 6.18 0342/1005] md: add cond_resched() to md_do_sync()s skip path
* [PATCH 6.18 0343/1005] tools/lib/thermal: Fix misplaced extern "C" closing brace
* [PATCH 6.18 0344/1005] selftests/ftrace: Force C locale in ftracetest
* [PATCH 6.18 0345/1005] Bluetooth: btusb: Add USB ID 13d3:3625 for MediaTek MT7922
* [PATCH 6.18 0346/1005] Bluetooth: btusb: Add support for 1357:c123 Realtek 8852BE device
* [PATCH 6.18 0347/1005] Bluetooth: hci_nokia: validate firmware packet bounds
* [PATCH 6.18 0348/1005] Bluetooth: btnxpuart: Fix use-after-free in probe error path
* [PATCH 6.18 0349/1005] Bluetooth: bfusb: validate received block boundaries
* [PATCH 6.18 0350/1005] btrfs: fix memory barrier order in reloc_root_is_dead()
* [PATCH 6.18 0351/1005] drm/amd: Add DCN6 register headers
* [PATCH 6.18 0352/1005] ACPI: APEI: Handle repeated SEA error storms
* [PATCH 6.18 0353/1005] ALSA: hda/realtek: Fix headset mic on ASUS Vivobook S14 S5406SA
* [PATCH 6.18 0354/1005] ALSA: hda/realtek: Fix speakers on ASUS ROG Zephyrus G14 GA403UM
* [PATCH 6.18 0355/1005] ALSA: hda/conexant: Add pin config quirk for Huawei Matebook
* [PATCH 6.18 0356/1005] ALSA: hda/realtek: Add quirk for Acer Nitro ANV16-42 headset mic
* [PATCH 6.18 0357/1005] Bluetooth: btrsi: Move set_bt_context after successful HCI registration
* [PATCH 6.18 0358/1005] Bluetooth: hci_bcsp: validate received packet lengths
* [PATCH 6.18 0359/1005] Bluetooth: fix BT dependency for submodules
* [PATCH 6.18 0360/1005] Bluetooth: hci_sync: Disable legacy instances ext adv before setup snapshot
* [PATCH 6.18 0361/1005] net: dsa: mt7530: error out on failed PHY_IAC command writes
* [PATCH 6.18 0362/1005] Bluetooth: hci_event: fix out-of-bounds read in LE PA report reassembly
* [PATCH 6.18 0363/1005] net: dsa: mt7530: check bus->read() error in core_rmw()
* [PATCH 6.18 0364/1005] net: pcs: mtk-lynxi: check regmap reads in mtk_pcs_lynxi_get_state()
* [PATCH 6.18 0365/1005] net: dsa: mt7530: check CORE_PLL_GROUP4 access in mt7531_setup()
* [PATCH 6.18 0366/1005] riscv: kprobes: Prevent probes in breakpoint handlers
* [PATCH 6.18 0367/1005] RISC-V: perf: fix resource cleanup on driver probe failure
* [PATCH 6.18 0368/1005] fbdev: omap2: dsi: do not copy isr table
* [PATCH 6.18 0369/1005] fbdev: udlfb: validate vendor descriptor items
* [PATCH 6.18 0370/1005] iommu/vt-d: Fix CACHE_TAG_NESTING_DEVTLB polluting shared variables in flush loop
* [PATCH 6.18 0371/1005] ALSA: usx2y: Stop clearing urb->hcpriv before submission
* [PATCH 6.18 0372/1005] perf/x86: Unregister PMI handler on PMU init failure
* [PATCH 6.18 0373/1005] perf/x86: Free hybrid state on PMU init failure
* [PATCH 6.18 0374/1005] nvmet: passthru: fix OOB reads when parsing ns id descriptor list
* [PATCH 6.18 0375/1005] selftests/net: fin_ack_lat: fix latency threshold typo
* [PATCH 6.18 0376/1005] docs: cgroup-v2: fix stale "io" controller introduction
* [PATCH 6.18 0377/1005] nvme-tcp: look up host_iface in the current netns
* [PATCH 6.18 0378/1005] tap: fix incorrect variable used for USO check in set_offload()
* [PATCH 6.18 0379/1005] apparmor: fix auditing of mount binary data
* [PATCH 6.18 0380/1005] selftests: net: reuseport_bpf_numa: consider cpuless numa node
* [PATCH 6.18 0381/1005] iommu/amd: Fix missing CMD_COMPLETE_PPR response for invalid PPR requests
* [PATCH 6.18 0382/1005] nfc: mrvl: spi: Unregister dev on allocation fail
* [PATCH 6.18 0383/1005] nfc: nxp-nci: Add remove on IRQ error
* [PATCH 6.18 0384/1005] nvme: ratelimit the completion-path messages driven by device data
* [PATCH 6.18 0385/1005] alpha: run the remote RTC access in a worker, not an IPI callback
* [PATCH 6.18 0386/1005] ALSA: hda/conexant: Add mute LED quirk for HP ProBook 440 G5
* [PATCH 6.18 0387/1005] hfsplus: validate extent record length before writing it back
* [PATCH 6.18 0388/1005] regulator: fan53555: Add support for FAN53555BUC23X type
* [PATCH 6.18 0389/1005] soundwire: dmi-quirks: Disable ghost Realtek on Asus ROG Zephyrus Duo
* [PATCH 6.18 0390/1005] ipmi: Fix leak in __ipmi_bmc_register
* [PATCH 6.18 0391/1005] PCI: Avoid saving config space state if inaccessible
* [PATCH 6.18 0392/1005] ALSA: hda/intel: Add sanity check for BAR0 size
* [PATCH 6.18 0393/1005] xhci: include all root port children in recovery prevention on link error
* [PATCH 6.18 0394/1005] ALSA: usb-audio: Rename the Audient iD14 monitor mix volume control
* [PATCH 6.18 0395/1005] HID: amd_sfh: Serialize access to the shared emp2 pointer
* [PATCH 6.18 0396/1005] drm/virtio: reclaim pending vbufs before tearing down vqs
* [PATCH 6.18 0397/1005] exfat: keep FITRIM within the requested range
* [PATCH 6.18 0398/1005] gre: fix ERSPAN o_flags race/corruption in xmit and fill_info
* [PATCH 6.18 0399/1005] crypto: keembay - use crypto_memneq() to compare GCM AEAD tags
* [PATCH 6.18 0400/1005] crypto: sa2ul - use crypto_memneq() to compare AEAD tag
* [PATCH 6.18 0401/1005] libbpf: Fix ring buffer consumer loop on 32-bit position wrap
* [PATCH 6.18 0402/1005] crypto: keembay - use crypto_memneq() to compare CCM AEAD tags
* [PATCH 6.18 0403/1005] ksmbd: protect private extended attributes
* [PATCH 6.18 0404/1005] ksmbd: preserve access denied status for copychunk
* [PATCH 6.18 0405/1005] ksmbd: allow I/O on directory named streams
* [PATCH 6.18 0406/1005] ksmbd: fix durable handle v2 default timeout units (60 -> 60000)
* [PATCH 6.18 0407/1005] ksmbd: reject SMB3.1.1 binding with mismatched cipher
* [PATCH 6.18 0408/1005] ksmbd: fix off-by-one rejecting minimal COPYCHUNK query-limits request
* [PATCH 6.18 0409/1005] ksmbd: return buffer too small for short security queries
* [PATCH 6.18 0410/1005] ksmbd: handle empty QUERY_ALLOCATED_RANGES output
* [PATCH 6.18 0411/1005] ksmbd: honor byte-range locks for zero data
* [PATCH 6.18 0412/1005] ksmbd: allow FSCTL_SET_SPARSE without input buffer
* [PATCH 6.18 0413/1005] ksmbd: skip fallocate for SMB2_CREATE_ALLOCATION_SIZE on a stream handle
* [PATCH 6.18 0414/1005] ksmbd: report actual xattr value length in stream enumeration
* [PATCH 6.18 0415/1005] smb/server: cancel async requests when closing connection
* [PATCH 6.18 0416/1005] ALSA: hda/realtek: Fix mute LED for HP Victus 15-fa1xxx (MB 8C3F)
* [PATCH 6.18 0417/1005] ksmbd: fix SMB2 byte-range lock end offset
* [PATCH 6.18 0418/1005] ksmbd: fix AsyncId zeroed before use in smb2_lock() cancel response
* [PATCH 6.18 0419/1005] ksmbd: reject blocking compound lock requests
* [PATCH 6.18 0420/1005] ksmbd: honor client signing-required in all modes
* [PATCH 6.18 0421/1005] smb: server: Make sure that passkey is not leaked on the heap in user_config.c
* [PATCH 6.18 0422/1005] pNFS: honor clora_changed when recalling a layout
* [PATCH 6.18 0423/1005] ksmbd: notify parent directory leases on child create
* [PATCH 6.18 0424/1005] smb: server: Free session data in user_session.c with kfree_sensitive()
* [PATCH 6.18 0425/1005] NFS: Verify symlink inode before caching target
* [PATCH 6.18 0426/1005] ALSA: hda: Add Lisuan HDMI controller and codec support
* [PATCH 6.18 0427/1005] NFSv4: pin the superblock for active state owners
* [PATCH 6.18 0428/1005] net: stmmac: use dma_addr_t for DMA addresses
* [PATCH 6.18 0429/1005] NFSv4/flexfiles: report cancelled I/O as a layout error
* [PATCH 6.18 0430/1005] platform/x86: msi-ec: Add MSI Katana GF76 11UEK EC firmware
* [PATCH 6.18 0431/1005] platform/x86: thinkpad_acpi: Fix fan speed reporting on Edge E330
* [PATCH 6.18 0432/1005] ASoC: codec: max98926: fixup invert setup mask
* [PATCH 6.18 0433/1005] vdpa_sim: hold iommu_lock across dma_unmap passthrough transition
* [PATCH 6.18 0434/1005] drm/radeon: fix internal display on iMac11, 1 (RV770/DCE3.1)
* [PATCH 6.18 0435/1005] vdpa/mlx5: roll back MR update after VQ setup failure
* [PATCH 6.18 0436/1005] ALSA: usb-audio: Add MIN_MUTE quirk for Creative Sound Blaster Play! 3
* [PATCH 6.18 0437/1005] virtio_balloon: warn on failed buffer add in tell_host()
* [PATCH 6.18 0438/1005] rtc: ab-eoz9: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0439/1005] PCI: vmd: Add Nova Lake (NVL) and Dunlow (DNL) Device IDs
* [PATCH 6.18 0440/1005] virtio_ring: fix infinite loop in virtnet_poll_cleantx when device is broken
* [PATCH 6.18 0441/1005] ASoC: rt712-sdca: Pull high JD2 to prevent from entering TV mode
* [PATCH 6.18 0442/1005] rtc: ds1307: fix RX8130 wakeup alarm WADA bit for day-of-month mode
* [PATCH 6.18 0443/1005] rtc: brcmstb-waketimer: add missing MODULE_DEVICE_TABLE()
* [PATCH 6.18 0444/1005] spi: loongson: pm: add .freeze .poweroff .thaw .restore
* [PATCH 6.18 0445/1005] i2c: imx-lpi2c: properly unwind resources on probe failure
* [PATCH 6.18 0446/1005] fbdev: maxine: fix 64-bit build error
* [PATCH 6.18 0447/1005] fbdev: platinumfb: add error checking for ioremap calls
* [PATCH 6.18 0448/1005] ksmbd: enable TCP keepalive for accepted connections
* [PATCH 6.18 0449/1005] sched_ext/scx_flatcg: expire cached hweights on weight changes
* [PATCH 6.18 0450/1005] ACPI: button: Add DMI quirk for Razer Blade Pro 17 early 2020 lid switch
* [PATCH 6.18 0451/1005] f2fs: avoid setting SBI_NEED_FSCK on transient resize failure
* [PATCH 6.18 0452/1005] ALSA: hda/realtek: Fix ALC700 audio on Intel Hades Canyon
* [PATCH 6.18 0453/1005] ALSA: usb-audio: Add iD14 MkI to monitor-mix volume quirk
* [PATCH 6.18 0454/1005] scsi: snic: Fix SCSI host leak on workqueue allocation failure
* [PATCH 6.18 0455/1005] docs: block: fix dead http link in blk-mq.rst
* [PATCH 6.18 0456/1005] net: ethernet: mtk_wed: increase WED v2 WDMA RESV_BUFF to 0x80
* [PATCH 6.18 0457/1005] fbcon: Fix KASAN slab-out-of-bounds Read in fbcon_prepare_logo
* [PATCH 6.18 0458/1005] powercap: intel_rapl: Fix kernel panic during PMU unbind
* [PATCH 6.18 0459/1005] net: stmmac: fix device node reference leaks in stmmac_mtl_setup()
* [PATCH 6.18 0460/1005] ALSA: hda/realtek: Add quirk for Lenovo IdeaPad Slim 3 15ABR8
* [PATCH 6.18 0461/1005] fuse: zero the partial EOF page when extending a file
* [PATCH 6.18 0462/1005] ASoC: amd: yc: Add DMI entry for Alienware m18 R1 AMD
* [PATCH 6.18 0463/1005] HID: i2c-hid: Add a quirk for a Cirque I2C device.
* [PATCH 6.18 0464/1005] HID: multitouch: Fix stale MT slots when contact count drops to zero
* [PATCH 6.18 0465/1005] tpm: tpm_tis_spi: fix nodef CR50 tpm_tis_spi_resume is null
* [PATCH 6.18 0466/1005] tpm: atmel: depend on X86
* [PATCH 6.18 0467/1005] ALSA: usb-audio: Skip mixer creation on M-Audio Venom
* [PATCH 6.18 0468/1005] ASoC: amd: acp3x-es83xx: Add HVY-WXX9/M1060 DMI quirk
* [PATCH 6.18 0469/1005] ceph: do not cache negative dentries for snapped directories
* [PATCH 6.18 0470/1005] ALSA: hda/conexant: Always enable the headset-mic pin on plugin
* [PATCH 6.18 0471/1005] ASoC: amd: acp-config: Add HVY-WXX9/M1060 DMI quirk
* [PATCH 6.18 0472/1005] ceph: fix use-after-dereference of NULL ci in __ceph_remove_cap()
* [PATCH 6.18 0473/1005] netfilter: tproxy: use DEBUG_NET_WARN_ON_ONCE for protocol fallbacks
* [PATCH 6.18 0474/1005] ksmbd: handle allocated range queries on dense files
* [PATCH 6.18 0475/1005] regmap: irq: Free the irqdomain we create
* [PATCH 6.18 0476/1005] HID: i2c-hid: Add i2c-hid-quirk-bad-input-size quirk for 0911:5288 device
* [PATCH 6.18 0477/1005] HID: i2c-hid: add reset quirk for Lenovo Yoga Slim 7x Gen 11 keyboard
* [PATCH 6.18 0478/1005] HID: elecom: Add support for ELECOM M-XT4DRBK (018E)
* [PATCH 6.18 0479/1005] nvme-fc: do not warn on controller removal race
* [PATCH 6.18 0480/1005] HID: roccat: fix locking in roccat_connect() and roccat_disconnect()
* [PATCH 6.18 0481/1005] scsi: devinfo: Add BLIST_SKIP_IO_HINTS for EMC Symmetrix
* [PATCH 6.18 0482/1005] ASoC: amd: yc: Add Lenovo ThinkPad E16 Gen 2 (21JN) to quirks
* [PATCH 6.18 0483/1005] gpio: mvebu: keep resume masks within the irqchip cache
* [PATCH 6.18 0484/1005] sfc: add X4D PF support
* [PATCH 6.18 0485/1005] ASoC: amd: yc: Add DMI quirk for Lenovo V15 G6 ARP
* [PATCH 6.18 0486/1005] HID: universal-pidff: Add support for Turtle Beach VelocityOne Race
* [PATCH 6.18 0487/1005] HID: Intel-thc-hid: Intel-quickspi: Fix buffer overflow
* [PATCH 6.18 0488/1005] HID: Intel-thc-hid: Intel-quicki2c: Fix buffer overflow
* [PATCH 6.18 0489/1005] ASoC: Intel: bytcr_rt5651: Add quirk for Chuwi Hi8 with generic DMI strings
* [PATCH 6.18 0490/1005] nvme-tcp: delay nvme_tcp_reclassify_socket()
* [PATCH 6.18 0491/1005] docs: update the unmount propagation rule
* [PATCH 6.18 0492/1005] ALSA: hda/realtek: Limit internal mic boost on HP Pavilion 15 (103c:2164)
* [PATCH 6.18 0493/1005] ALSA: usb-audio: Add mixer mapping for MSI MAG B850M MORTAR WIFI
* [PATCH 6.18 0494/1005] ALSA: hda/realtek: Add quirk for Lenovo ThinkBook 16p Gen 3 ARH (21EK)
* [PATCH 6.18 0495/1005] ALSA: hda/realtek: Add quirk for Lenovo ThinkBook G8+
* [PATCH 6.18 0496/1005] ALSA: hda/realtek: Add mute LED quirk for HP Pavilion 15-ec1xxx
* [PATCH 6.18 0497/1005] ALSA: hda/realtek: Add quirk for HP ENVY 13-aq1xxx
* [PATCH 6.18 0498/1005] ALSA: hda/realtek: Add mute LED quirk for HP Victus 15-fb2xxx
* [PATCH 6.18 0499/1005] ALSA: hda/realtek: Add quirk for Acer Nitro AN515-45
* [PATCH 6.18 0500/1005] ALSA: hda/realtek: Fix speakers on ASUS PM3406CHA
* [PATCH 6.18 0501/1005] ALSA: hda/realtek: Add mute LED quirk for HP Pavilion 14-dv1001TU
* [PATCH 6.18 0502/1005] usb: mtu3: Fix double dereference in TP_printk
* [PATCH 6.18 0503/1005] net: usb: qmi_wwan: add Rolling Wireless RN947R
* [PATCH 6.18 0504/1005] ALSA: hda/realtek: Add quirk for ASRock NUC BOX-358H
* [PATCH 6.18 0505/1005] ALSA: hda/realtek: Add ALC235 support for headset mode
* [PATCH 6.18 0506/1005] spi: cadence-qspi: Fix status polling with octal DTR chips
* [PATCH 6.18 0507/1005] ALSA: hda/realtek: Add mute LED quirk for HP Pavilion 15-eg3xxx (103c:8bfd)
* [PATCH 6.18 0508/1005] ALSA: usb-audio: Add native DSD support for Cambridge Audio streamers
* [PATCH 6.18 0509/1005] drm/amdgpu/gfx12: set KMD_QUEUE for kernel gfx queues
* [PATCH 6.18 0510/1005] drm/amdgpu/gfx11: set KMD_QUEUE for kernel gfx queues
* [PATCH 6.18 0511/1005] RISC-V: errata: Add SiFive MAL-9092 workaround
* [PATCH 6.18 0512/1005] regmap: Remove debugfs before cache teardown
* [PATCH 6.18 0513/1005] nbcon/reboot: Switch NBCON consoles into the emergency mode in emergency_restart()
* [PATCH 6.18 0514/1005] Revert "namei: dont reveal overmounted entries in refwalk"
* [PATCH 6.18 0515/1005] media: em28xx: use video_unregister_device for radio_dev
* [PATCH 6.18 0516/1005] ARM: 9524/1: mm: align hugetlb mappings to the huge page size
* [PATCH 6.18 0517/1005] blk-crypto: fix NULL deref and UAF in __blk_crypto_evict_key()
* [PATCH 6.18 0518/1005] ceph: fail readdir when the MDS reply carries no dirfrag
* [PATCH 6.18 0519/1005] fuse: dont BUG when the copy buffer is exhausted
* [PATCH 6.18 0520/1005] kcov: ignore an out-of-range comparison count in write_comp_data()
* [PATCH 6.18 0521/1005] kcsan: Avoid division by zero in kcsan_prandom_u32_max()
* [PATCH 6.18 0522/1005] libceph: bound mon_command ack decode to front len
* [PATCH 6.18 0523/1005] media: cx88: Disable PCI device on MPEG initialization failure
* [PATCH 6.18 0524/1005] media: em28xx: reject audio endpoint with zero packet size
* [PATCH 6.18 0525/1005] media: go7007: only set audio_enabled if go7007_snd_init() succeeded
* [PATCH 6.18 0526/1005] net: ipv4: add zero check for snd_cwnd_clamp
* [PATCH 6.18 0527/1005] net: usb: pegasus: do not advance rx_skb->data on dropped frames
* [PATCH 6.18 0528/1005] nfsd: fix race between client_info_show() and free_client()
* [PATCH 6.18 0529/1005] ocfs2/dlm: drain join handlers before releasing module text
* [PATCH 6.18 0530/1005] ocfs2: drain quorum work before removing the cluster
* [PATCH 6.18 0531/1005] ocfs2: pin owning modules for open debugfs files
* [PATCH 6.18 0532/1005] ocfs2: publish the filecheck owner before adding sysfs attributes
* [PATCH 6.18 0533/1005] thunderbolt: Do not RPM complete unrelated subtrees on unplug
* [PATCH 6.18 0534/1005] udf: fix return value for non-recorded-allocated extents in udf_map_block()
* [PATCH 6.18 0535/1005] wwan: wwan_hwsim: Pin module for debugfs file operations
* [PATCH 6.18 0536/1005] xfs: fix integer overflow problem when setting large free areas
* [PATCH 6.18 0537/1005] netfilter: nf_conntrack_expect: use conntrack GC to reap expectations
* [PATCH 6.18 0538/1005] netfilter: nf_conntrack_expect: add and use nf_ct_expect_related_pair()
* [PATCH 6.18 0539/1005] netfilter: ctnetlink: do not expose expectation DEAD flag
* [PATCH 6.18 0540/1005] sctp: auth: discard auth_chunk when skb_clone fails
* [PATCH 6.18 0541/1005] dt-bindings: interrupt-controller: gicv5: Relax IRS properties constraints
* [PATCH 6.18 0542/1005] irqchip/gic-v5: Fix standalone IRSes OF probe
* [PATCH 6.18 0543/1005] drm/xe/display: skip FORCE_WC and vm_bound check for external dma-bufs
* [PATCH 6.18 0544/1005] KVM: x86: Always initialize EFER reserved bits on vendor initialization
* [PATCH 6.18 0545/1005] mm/migrate: use huge_ptep_get() in remove_migration_pte()
* [PATCH 6.18 0546/1005] HID: input: read battery capacity from its actual report offset
* [PATCH 6.18 0547/1005] mm/page_alloc: dont spin_trylock() when disallowed in free_one_page()
* [PATCH 6.18 0548/1005] i3c: master: Fix potential UAF in i3c_device_uevent()
* [PATCH 6.18 0549/1005] LoongArch: KVM: Check kvm_request_pending() in kvm_late_check_requests()
* [PATCH 6.18 0550/1005] LoongArch: KVM: Deliver interrupt after IN_GUEST_MODE is set
* [PATCH 6.18 0551/1005] LoongArch: KVM: Set vcpu->cpu before IN_GUEST_MODE is set
* [PATCH 6.18 0552/1005] rust: bug: fix warn_on macro build error on UML
* [PATCH 6.18 0553/1005] nfsd: dedup nfs4_client_to_reclaim inserts
* [PATCH 6.18 0554/1005] nfsd: use test_and_clear_bit for somebody_reclaimed to prevent lost update
* [PATCH 6.18 0555/1005] LoongArch: Expand module virtual address space to 2GB
* [PATCH 6.18 0556/1005] rust: cfi: disable function merging if CFI is enabled
* [PATCH 6.18 0557/1005] mm/kmemleak: stop the task stack scan early when interrupted
* [PATCH 6.18 0558/1005] mm/kmemleak: report RCU-tasks quiescent states during the scan
* [PATCH 6.18 0559/1005] mm/migrate_device: clear stale mapping after freeing swapcache
* [PATCH 6.18 0560/1005] smb: client: reject SetEA requests that do not fit the request buffer
* [PATCH 6.18 0561/1005] riscv: hwprobe: initialize pair->value in hwprobe_one_pair()
* [PATCH 6.18 0562/1005] ipv6: udp: Create exceptions before socket matching
* [PATCH 6.18 0563/1005] thunderbolt: Make the DP tunnel activation callback mandatory
* [PATCH 6.18 0564/1005] drm/amd/display: DML2.1 Reintegration
* [PATCH 6.18 0565/1005] drm/amd/display: Update P-state naming for clarity.
* [PATCH 6.18 0566/1005] drm/amd/display: add const qualifiers to watermark params struct
* [PATCH 6.18 0567/1005] drm/amd/display: Remove const Qualifier From Non-Pointer Fields
* [PATCH 6.18 0568/1005] LoongArch: KVM: Add unregister helpers for the KVM interrupt devices
* [PATCH 6.18 0569/1005] LoongArch: KVM: Fix resource leak in kvm_loongarch_env_init() error path
* [PATCH 6.18 0570/1005] s390/crypto: Replace cond_resched() with msleep(1)
* [PATCH 6.18 0571/1005] s390/crypto: Fix return code handling at skcipher_walk_done in PAES algorithms
* [PATCH 6.18 0572/1005] s390/crypto: Fix use of mutex in atomic context in PAES
* [PATCH 6.18 0573/1005] s390/crypto: Fix handling of EBUSY in PAES when req is pushed to crypto engine
* [PATCH 6.18 0574/1005] MIPS: Fix HOTPLUG_PARALLEL dependency
* [PATCH 6.18 0575/1005] mips: select CONFIG_WEAK_REORDERING_BEYOND_LLSC from CONFIG_EYEQ
* [PATCH 6.18 0576/1005] smb: client: fix uid/gid override in getattr with posix extensions
* [PATCH 6.18 0577/1005] smb: client: fix WSL reparse point uid/gid override
* [PATCH 6.18 0578/1005] hwmon: (asus_rog_ryujin) Rely on subsystem locking
* [PATCH 6.18 0579/1005] hwmon: (asus_rog_ryujin) Add per-device configuration
* [PATCH 6.18 0580/1005] hwmon: (asus_rog_ryujin) Validate HID report lengths
* [PATCH 6.18 0581/1005] hwmon: (asus_rog_ryujin) Synchronize HID command and report handling
* [PATCH 6.18 0582/1005] drm/amd/pm: fix gpu metrics energy accumulator for smu 13.0.0/13.0.7
* [PATCH 6.18 0583/1005] selftests/ublk: fix Makefile to rebuild on header changes
* [PATCH 6.18 0584/1005] selftests: ublk: add utility to get block device metadata size
* [PATCH 6.18 0585/1005] selftests: ublk: increase timeout to 150 seconds
* [PATCH 6.18 0586/1005] selftests: ublk: install test_common.sh and trace/ scripts
* [PATCH 6.18 0587/1005] smb: client: fix fattr leaking on wsl_to_fattr() failure
* [PATCH 6.18 0588/1005] RISC-V: KVM: Release unused page after MMU invalidation
* [PATCH 6.18 0589/1005] RISC-V: KVM: Fix sdata leak and stale snapshot_addr in snapshot_set_shmem
* [PATCH 6.18 0590/1005] xfs: dont cross reference rmapbt with bitmaps if theyre incomplete
* [PATCH 6.18 0591/1005] drm/amdkfd: Guard m->cp_hqd_eop_control setting by q->eop_ring_buffer_size
* [PATCH 6.18 0592/1005] drm/amdkfd: Avoid integer underflow with ffs in EOP ring size calc
* [PATCH 6.18 0593/1005] drm/amdkfd: Avoid integer underflow in EOP ring size calculation.
* [PATCH 6.18 0594/1005] smb: client: delete compound mids on send failure before unlock
* [PATCH 6.18 0595/1005] KVM: x86: Fill kvm_run exit fields in common get_nested_state_pages() error paths
* [PATCH 6.18 0596/1005] serial: serial_core: simplify uart_ioctl() returns
* [PATCH 6.18 0597/1005] serial: fix ioctl hangup race
* [PATCH 6.18 0598/1005] serial: abort TIOCMIWAIT on hangup
* [PATCH 6.18 0599/1005] net/sched: act_ct: remove add_helper dead code
* [PATCH 6.18 0600/1005] KVM: SVM: Preserve TLB control (i.e. pending TLB flush) on failed VMRUN
* [PATCH 6.18 0601/1005] KVM: SVM: Update control fields on #VMEXIT if and only if VMRUN succeeded
* [PATCH 6.18 0602/1005] ALSA: hda/realtek: add quirk for Acer Nitro ANV15-51
* [PATCH 6.18 0603/1005] ALSA: hda/realtek: Add micmute LED quirk for Acer Swift SFG16-72
* [PATCH 6.18 0604/1005] smb: client: clear post-EOF pagecache when extending a file via truncate
* [PATCH 6.18 0605/1005] smb: client: discard post-EOF pagecache when extending a file via clone range
* [PATCH 6.18 0606/1005] smb: client: drain and invalidate before server-side copy/clone
* [PATCH 6.18 0607/1005] smb: client: only require read lease for size-extending zero range
* [PATCH 6.18 0608/1005] smb: client: require stable pages for signed connections
* [PATCH 6.18 0609/1005] tools/power turbostat: Read complete CPU lists
* [PATCH 6.18 0610/1005] drm/amd/display: Fix fast updates on DCE 6.x
* [PATCH 6.18 0611/1005] drm/amdgpu: remove gart_window_lock usage from gmc v12
* [PATCH 6.18 0612/1005] drm/amdgpu/gmc12: properly pass flush_type to gmc_v12_0_flush_vm_hub()
* [PATCH 6.18 0613/1005] drm/amd/display: guard dc_sink dereferences in MST mode validation
* [PATCH 6.18 0614/1005] accel/rocket: search every core slot when looking up a scheduler
* [PATCH 6.18 0615/1005] ipc: create_ipc_ns: drop mqueue mount on sysctl setup failure
* [PATCH 6.18 0616/1005] ipc: drop the mqueue mount with kern_unmount() on setup failure
* [PATCH 6.18 0617/1005] ntfs3: free replaced mount options after a grace period
* [PATCH 6.18 0618/1005] tracing: Fix fully-qualified variable reference printing in histograms
* [PATCH 6.18 0619/1005] tracing: Use __free() for expr_str() buffer
* [PATCH 6.18 0620/1005] tracing: Return ERR_PTR() from expr_str()
* [PATCH 6.18 0621/1005] tracing: Bound histogram expression strings with seq_buf
* [PATCH 6.18 0622/1005] tracing: Fix NULL dereference when copying keys for a field variable
* [PATCH 6.18 0623/1005] drm/amdgpu/uvd3.1: Fix checking whether UVD firmware keyselect was already set
* [PATCH 6.18 0624/1005] RISC-V: KVM: Fix double-free of sdata in kvm_pmu_clear_snapshot_area()
* [PATCH 6.18 0625/1005] serial: core: fix TIOCSSERIAL and TIOCSERCONFIG on uninitialised ports
* [PATCH 6.18 0626/1005] net/sched: cls_bpf: accept dev-bound programs on shared blocks
* [PATCH 6.18 0627/1005] net/sched: cls_flower: avoid stale mask references after delete
* [PATCH 6.18 0628/1005] net/sched: sch_teql: fix slaves_lock IRQ deadlock
* [PATCH 6.18 0629/1005] net/sched: sch_teql: fix use-after-free on lower qdisc drop
* [PATCH 6.18 0630/1005] net/sched: fix packet reordering on requeue
* [PATCH 6.18 0631/1005] net/sched: act_ife: do not consume the inner header on egress
* [PATCH 6.18 0632/1005] driver core: take parent lock on deferred probe
* [PATCH 6.18 0633/1005] driver core: Limit the messages on a refused uevent
* [PATCH 6.18 0634/1005] driver core: fix parent lock use-after-free on USB disconnect
* [PATCH 6.18 0635/1005] Drivers: hv: vmbus: Bounds check the shared ring buffer indices
* [PATCH 6.18 0636/1005] backlight: lm3630a: Cancel delayed work before destroying workqueue
* [PATCH 6.18 0637/1005] backlight: qcom-wled: Fix NULL pointer dereference in wled_remove()
* [PATCH 6.18 0638/1005] backlight: qcom-wled: Fix unbalanced OVP IRQ enable at probe
* [PATCH 6.18 0639/1005] backlight: qcom-wled: Fix WLED3 brightness register stride
* [PATCH 6.18 0640/1005] ksmbd: accept share config responses from ksmbd-tools before 3.5.3
* [PATCH 6.18 0641/1005] ksmbd: avoid restoring only in-memory EOF after allocation change
* [PATCH 6.18 0642/1005] ksmbd: fix extended session security negotiation for raw NTLMSSP
* [PATCH 6.18 0643/1005] ksmbd: fix OOB read and cross-share confusion in ksmbd_validate_name_reconnect()
* [PATCH 6.18 0644/1005] ksmbd: fix overflow in dacloffset bounds check in build_sec_desc()
* [PATCH 6.18 0645/1005] ksmbd: fix parent dentry lifetime in directory enumeration
* [PATCH 6.18 0646/1005] ksmbd: ignore network devices of other namespaces
* [PATCH 6.18 0647/1005] ksmbd: preserve unreadable named streams on open
* [PATCH 6.18 0648/1005] ksmbd: reserve space for the UTF-16 terminator in stream info
* [PATCH 6.18 0649/1005] ksmbd: return end of file for reads past a named streams data
* [PATCH 6.18 0650/1005] ksmbd: use u8 for SMB2 oplock level values
* [PATCH 6.18 0651/1005] ksmbd: validate security descriptor offsets before pointer arithmetic
* [PATCH 6.18 0652/1005] tcp: Fix potential UAF in reqsk_timer_handler().
* [PATCH 6.18 0653/1005] vlan: restore HW VLAN tag insertion with reorder_hdr off
* [PATCH 6.18 0654/1005] cgroup: serialize migrations of newly forked processes
* [PATCH 6.18 0655/1005] Revert "Bluetooth: btusb: Add ASUS USB-BT600 for Realtek 8761CU"
* [PATCH 6.18 0656/1005] Revert "Bluetooth: btusb: Add ASUS USB-BT540 for Realtek 8761CU"
* [PATCH 6.18 0657/1005] KVM: x86/mmu: pass PFERR_GUEST_PAGE/FINAL_MASK to kvm_translate_gpa
* [PATCH 6.18 0658/1005] KVM: x86: Tell ->inject_page_fault() whether or a fault came from hardware
* [PATCH 6.18 0659/1005] KVM: VMX: Synthesize nested EPT violation GVA_IS_VALID/GVA_TRANSLATED bits
* [PATCH 6.18 0660/1005] x86/ioperm: Prevent NULL dereference on theoretical missing IO bitmap
* [PATCH 6.18 0661/1005] wifi: b43: fix use-after-free in b43_bcma_remove()
* [PATCH 6.18 0662/1005] SUNRPC: fix netns use-after-free in write_gssp()
* [PATCH 6.18 0663/1005] spmi: Fix potential use-after-free by grabbing of_node reference
* [PATCH 6.18 0664/1005] smb: client: fix use-after-free infoleak via the readdir resume name
* [PATCH 6.18 0665/1005] smb: client: fix use-after-free in cifs_ses_add_channel()
* [PATCH 6.18 0666/1005] RDMA/irdma: avoid use-after-free in icrdma_remove
* [PATCH 6.18 0667/1005] rapidio: mport_cdev: fix use-after-free in mport_mm_close()
* [PATCH 6.18 0668/1005] platform/x86/amd: hfi: Fix a use-after-free when unloading the driver
* [PATCH 6.18 0669/1005] nvmet: fix use-after-free of the old registrant in nvmet_pr_preempt()
* [PATCH 6.18 0670/1005] nvmet-fc: fix use-after-free in nvmet_fc_ls_create_connection()
* [PATCH 6.18 0671/1005] iommufd: Fix event queue release use-after-free
* [PATCH 6.18 0672/1005] landlock: Fix superblock use-after-free in release_inode()
* [PATCH 6.18 0673/1005] lockd: Fix use-after-free in nlmsvc_retry_blocked
* [PATCH 6.18 0674/1005] media: au0828: fix use-after-free in bulk_timeout timer on disconnect
* [PATCH 6.18 0675/1005] media: cx23885: Fix use-after-free in cx23885_finidev due to race condition
* [PATCH 6.18 0676/1005] media: hackrf: fix use-after-free in hackrf_alloc_urbs() error path
* [PATCH 6.18 0677/1005] media: imon: fix use-after-free in display_close via dev_dbg
* [PATCH 6.18 0678/1005] mm/hugetlb: fix use-after-free in hugetlb_mfill_atomic_pte()
* [PATCH 6.18 0679/1005] mm/hugetlb: fix use-after-free of a new anon folio
* [PATCH 6.18 0680/1005] apparmor: fix a use-after-free in aa_lookupn_ns()
* [PATCH 6.18 0681/1005] ASoC: audio-graph-card2: Fix use-after-free in audio_graph2_link_c2c()
* [PATCH 6.18 0682/1005] ata: sata_fsl: Fix use-after-free of host_priv on probe() failure
* [PATCH 6.18 0683/1005] drm/msm: Fix vm_bo use-after-free in with_vm_locks()
* [PATCH 6.18 0684/1005] s390/cpum_cf: Check session mask before cpu offline
* [PATCH 6.18 0685/1005] s390/extable: Fix mvcos instruction decoding
* [PATCH 6.18 0686/1005] s390/kprobes: Prevent kprobes on instructions with exception table entry
* [PATCH 6.18 0687/1005] s390/probes: Fix wrong opcode for cgrb fixup
* [PATCH 6.18 0688/1005] s390/signal: Fix incorrect return address in signal frame
* [PATCH 6.18 0689/1005] s390/zcrypt: Fix out-of-bounds ptr advance in cca_query_crypto_facility()
* [PATCH 6.18 0690/1005] HID: wacom: Use hdev->product in wacom_setup_touch_input_capabilities
* [PATCH 6.18 0691/1005] HID: wacom: Advertise SW_MUTE_DEVICE capability prior to registration
* [PATCH 6.18 0692/1005] HID: wacom: Fix Use-After-Free in wacom_intuos_pad
* [PATCH 6.18 0693/1005] HID: wacom: Fix Use-After-Free in wacom_bamboo_pad
* [PATCH 6.18 0694/1005] HID: wacom: Redesign shared sibling data lifecycle
* [PATCH 6.18 0695/1005] HID: wacom: Setup SW_MUTE_DEVICE according to the order of input registration
* [PATCH 6.18 0696/1005] HID: wacom: Write shared touch initial status only once
* [PATCH 6.18 0697/1005] klist: avoid accesses after waking klist_remove()
* [PATCH 6.18 0698/1005] objtool/rust: add one more noreturn Rust function for Rust 1.101.0
* [PATCH 6.18 0699/1005] rust: bitmap: restrict bitmap length to at most i32::MAX
* [PATCH 6.18 0700/1005] rust: block: fix Send bound for GenDisk
* [PATCH 6.18 0701/1005] rust: block: require Sync for Operations::QueueData
* [PATCH 6.18 0702/1005] rust: configfs: fix data offset calculation for subsystem callbacks
* [PATCH 6.18 0703/1005] rust: cpufreq: reject NULL from cpufreq_cpu_get()
* [PATCH 6.18 0704/1005] rust: rcpufreq_dt: add module alias
* [PATCH 6.18 0705/1005] ALSA: control: Fix UAF in snd_ctl_elem_add() on card disconnect
* [PATCH 6.18 0706/1005] ALSA: emux: Fix UAF of soundfont zones at note-on
* [PATCH 6.18 0707/1005] ALSA: pcmtest: handle multiple wraps in random capture fill
* [PATCH 6.18 0708/1005] ASoC: amd: ps: fix snd_acp63_remove() teardown ordering
* [PATCH 6.18 0709/1005] Bluetooth: hci_vhci: Pin module for debugfs file operations
* [PATCH 6.18 0710/1005] drm/panthor: Fix TOCTOU race between GROUP_REGISTERED check and erase
* [PATCH 6.18 0711/1005] fbdev: atmel_lcdfb: Prevent FIFO work after removal
* [PATCH 6.18 0712/1005] fbdev: udlfb: dont rebuild the mode list while the framebuffer is in use
* [PATCH 6.18 0713/1005] fs/proc/task_mmu: pin mm_users in do_pagemap_scan()
* [PATCH 6.18 0714/1005] genirq: Defer kfree(irqaction) until irq_thread_dtor() finishes
* [PATCH 6.18 0715/1005] genirq: Move interrupt thread exit_work object to irqaction
* [PATCH 6.18 0716/1005] HID: hiddev: keep state alive through disconnect unlock
* [PATCH 6.18 0717/1005] io_uring/io-wq: save worker type before dropping its reference
* [PATCH 6.18 0718/1005] iomap: dont resubmit an ioend after ->writeback_submit() failed
* [PATCH 6.18 0719/1005] iommu/arm-smmu-v3: Disable the impl before disabling the SMMU on shutdown
* [PATCH 6.18 0720/1005] KVM: PPC: Book3S HV: Add SRCU protection for virtual-mode HPT hcalls
* [PATCH 6.18 0721/1005] media: cx23885: unregister DVB bus when SP2 CI setup fails
* [PATCH 6.18 0722/1005] media: gspca: use vb2_video_unregister_device() on disconnect
* [PATCH 6.18 0723/1005] media: imx-jpeg: cancel timeout worker when streaming stops
* [PATCH 6.18 0724/1005] media: marvell: mcam: stop DMA and cancel s_bh_work before freeing DMA buffers
* [PATCH 6.18 0725/1005] media: microchip-csi2dc: fix async notifier leak on probe error path
* [PATCH 6.18 0726/1005] media: microchip-isc: take a reference on the parsed endpoints
* [PATCH 6.18 0727/1005] media: redrat3: fix UAF in probe error path leaving rc device registered
* [PATCH 6.18 0728/1005] media: s5p-mfc: use timer_shutdown_sync() for the self-rearming watchdog
* [PATCH 6.18 0729/1005] mm/slab: sample slab_state once in kmem_cache_destroy()
* [PATCH 6.18 0730/1005] mm: khugepaged: fix folio is used after folio_put/unlock()
* [PATCH 6.18 0731/1005] scsi: dc395x: sync the waiting_timer before freeing the host
* [PATCH 6.18 0732/1005] serial: core: shut down initialized port on removal
* [PATCH 6.18 0733/1005] xen-blkfront: unbind irq before tearing down ring and shadow requests
* [PATCH 6.18 0734/1005] wifi: ath9k: delete channel-context timers on deinit
* [PATCH 6.18 0735/1005] wifi: mt76: mt7996: unlink TWT flow if the MCU rejects the agreement
* [PATCH 6.18 0736/1005] usb: gadget: fix refcount underflow in gadgetfs_bind() error path
* [PATCH 6.18 0737/1005] ufs: use u64 for directory size in ufs_last_byte
* [PATCH 6.18 0738/1005] spi: spi-pci1xxxx: quiesce DMA engines on transfer timeout
* [PATCH 6.18 0739/1005] resource: report a devm_request_resource() conflict under the lock
* [PATCH 6.18 0740/1005] phy: core: Fix race-condition between _of_phy_get() and try_module_get()
* [PATCH 6.18 0741/1005] power: supply: sbs-battery: disable polling before supply teardown
* [PATCH 6.18 0742/1005] nvmem: core: Fix OOB read for bit offsets of more than one byte
* [PATCH 6.18 0743/1005] media: rc: Ensure that rc_unregister_device() does not free input device
* [PATCH 6.18 0744/1005] media: rc: Ensure registered is cleared in error path
* [PATCH 6.18 0745/1005] media: rc: fintek-cir: process a full RX buffer instead of overflowing it
* [PATCH 6.18 0746/1005] media: rc: Fix race between bpf(BPG_PROG_ATTACH) and device unregister
* [PATCH 6.18 0747/1005] media: rc: mce_kbd: Fix inconsistent locking of keylock
* [PATCH 6.18 0748/1005] media: rc: Use after free in ir_raw_event_handle()
* [PATCH 6.18 0749/1005] media: rc: After rc_unregister_device() timers can be re-armed
* [PATCH 6.18 0750/1005] media: rc: Fix use after free in bpf progs
* [PATCH 6.18 0751/1005] media: rc: Fix ABBA deadlock by making locks more fine grained
* [PATCH 6.18 0752/1005] ocfs2/heartbeat: unlink live slots when their node is missing
* [PATCH 6.18 0753/1005] ocfs2/dlm: hold a lock reference across grant AST enqueue
* [PATCH 6.18 0754/1005] ocfs2/dlm: hold the lookup reference across convert AST enqueue
* [PATCH 6.18 0755/1005] ocfs2: cancel quota sync work before freeing quota info
* [PATCH 6.18 0756/1005] ocfs2: fix chunk number of the first chunk in a local quota file
* [PATCH 6.18 0757/1005] ocfs2: pin refcount trees before dropping the lookup lock
* [PATCH 6.18 0758/1005] ocfs2: snapshot dentry names in file and setattr traces
* [PATCH 6.18 0759/1005] smb: client: fix OOB last_entry pointer from unbounded LastNameOffset
* [PATCH 6.18 0760/1005] smb: client: stop processing a read response after a receive error
* [PATCH 6.18 0761/1005] ovl: set OVL_WHITEOUTS before publishing the upper dir
* [PATCH 6.18 0762/1005] ovl: take a snapshot of the name for copy up
* [PATCH 6.18 0763/1005] ovl: use the pinned upper dir in ovl_fix_origin()
* [PATCH 6.18 0764/1005] ovl: always encode the origin fh when index is enabled
* [PATCH 6.18 0765/1005] ovl: check the casefold flag of directories only
* [PATCH 6.18 0766/1005] ovl: do not copy up an xattr value that was never read
* [PATCH 6.18 0767/1005] ovl: fix a torn path in ovl_get_redirect()
* [PATCH 6.18 0768/1005] ovl: fortify ovl_copy_xattr() against underlying layer modifications
* [PATCH 6.18 0769/1005] ovl: read the nlink xattr of every indexed non-dir
* [PATCH 6.18 0770/1005] ovl: reserve space for the casefolded name terminator
* [PATCH 6.18 0771/1005] ovl: set the revalidate flags after d_instantiate()
* [PATCH 6.18 0772/1005] ovl: skip copy up of empty security.capability
* [PATCH 6.18 0773/1005] xfs: clear the symlink zapped flag if inline symlink is ok
* [PATCH 6.18 0774/1005] xfs: mark cow extents bad if theres no rmap mapping for them
* [PATCH 6.18 0775/1005] xfs: compute the correct fdblocks/frextents for repair when theyre negative
* [PATCH 6.18 0776/1005] xfs: fix ondisk symlink target validation in xrep_dinode_check_dfork
* [PATCH 6.18 0777/1005] xfs: fix xfs_rename_space_res for non-pptr filesystems
* [PATCH 6.18 0778/1005] xfs: fix missing xfs_qm_adjust_dqlimits call in quotacheck repair
* [PATCH 6.18 0779/1005] xfs: fix buffer overruns in xfs_ioc_attr_list
* [PATCH 6.18 0780/1005] xfs: online quotacheck must dirty dquot if enforcement adjustments needed
* [PATCH 6.18 0781/1005] xfs: avoid cross-rtgroup reaping after a repair
* [PATCH 6.18 0782/1005] xfs: actually lock the metafile reservation when adjusting after repair
* [PATCH 6.18 0783/1005] xfs: fix unnecessary dapos truncation in xchk_dir_walk
* [PATCH 6.18 0784/1005] xfs: fix buffer overflow in corrupt inline attr structure
* [PATCH 6.18 0785/1005] xfs: actually report corrupt xattrs as XFAIL during cross-referencing
* [PATCH 6.18 0786/1005] xfs: fix inode btree repair when a cluster is larger than a chunk
* [PATCH 6.18 0787/1005] xfs: always reset incore attr fork buffer when resetting fork
* [PATCH 6.18 0788/1005] xfs: dont pass iget failures up when marking ondisk inodes
* [PATCH 6.18 0789/1005] xfs: zero out di_metatype when removing the metadir file iflag
* [PATCH 6.18 0790/1005] xfs: flag excessive delalloc rt extents as corruption
* [PATCH 6.18 0791/1005] xfs: dont fix the directory tree if live update fails
* [PATCH 6.18 0792/1005] xfs: validate rc_domain in xchk_rtrefcount_mergeable
* [PATCH 6.18 0793/1005] xfs: dont proceed with xattr repair if the live update fails
* [PATCH 6.18 0794/1005] xfs: fix skipped inode mask handling in iscan
* [PATCH 6.18 0795/1005] xfs: dont repair fs summary counters with garbage
* [PATCH 6.18 0796/1005] xfs: fix lost errno returned from xfarray_foliosort
* [PATCH 6.18 0797/1005] xfs: allow softlimit with no hardlimit in quota scrub
* [PATCH 6.18 0798/1005] xfs: assign an owner to scrub_stats_fops
* [PATCH 6.18 0799/1005] xfs: bail out of directory tree repairs on error
* [PATCH 6.18 0800/1005] xfs: fix revalidation of xchk_dquot_iter cached mappings
* [PATCH 6.18 0801/1005] xfs: abort dirtree repair if the live update hook dies
* [PATCH 6.18 0802/1005] xfs: check fork type against dabtree block magic number
* [PATCH 6.18 0803/1005] xfs: mark overfull dabtree node blocks as corrupt
* [PATCH 6.18 0804/1005] xfs: jump out of xchk_bmap_check_rmap if fatal signals
* [PATCH 6.18 0805/1005] xfs: cross-reference the primary superblock
* [PATCH 6.18 0806/1005] xfs: adjust checks for cross-AG reaping issues
* [PATCH 6.18 0807/1005] xfs: actually check XFS_DIFLAG2_METADATA for metadata btree data forks
* [PATCH 6.18 0808/1005] xfs: fix xchk_stats_estimate_bufsize to allow for the trailing null
* [PATCH 6.18 0809/1005] sched_ext: sync disable_irq_work in bpf_scx_unreg()
* [PATCH 6.18 0810/1005] sched_ext: Fix scx_flush_disable_work() UAF race
* [PATCH 6.18 0811/1005] netfilter: disable payload mangling in userns
* [PATCH 6.18 0812/1005] ipv6: Implement limits on extension header parsing
* [PATCH 6.18 0813/1005] netfilter: nfnetlink_queue: restrict writes to network header
* [PATCH 6.18 0814/1005] netfilter: nft_meta: add double-tagged vlan and pppoe support
* [PATCH 6.18 0815/1005] netfilter: nftables: restrict linklayer and network header writes
* [PATCH 6.18 0816/1005] netfilter: nftables: restrict checkum update offset
* [PATCH 6.18 0817/1005] netfilter: validate L4 headers after userspace packet writes
* [PATCH 6.18 0818/1005] netfilter: nft_payload: restrict checksum offsets to known values
* [PATCH 6.18 0819/1005] netfilter: nf_tables: fix netdev hook allocation memleak with dormant tables
* [PATCH 6.18 0820/1005] ksmbd: serialize directory emptiness checks with readdir
* [PATCH 6.18 0821/1005] ksmbd: fix breaking_cnt leak on early return in oplock_break()
* [PATCH 6.18 0822/1005] rtnetlink: wait for RCU readers in rtnl_link_unregister()
* [PATCH 6.18 0823/1005] EDAC/mc: Really fix error path ordering in edac_mc_alloc()
* [PATCH 6.18 0824/1005] Revert "net: Convert proto_ops bind() callbacks to use sockaddr_unsized"
* [PATCH 6.18 0825/1005] media: usbtv: drop redundant device reference
* [PATCH 6.18 0826/1005] media: usbtv: fix null-pointer dereference on disconnect
* [PATCH 6.18 0827/1005] xfs: reduce new btree slack factor if free space is negative
* [PATCH 6.18 0828/1005] xfs: reject absurdly large xattr value lengths in xchk_xattr_actor
* [PATCH 6.18 0829/1005] xfs: reject out-of-range attribute value lengths in xfs_attr_copy_value
* [PATCH 6.18 0830/1005] xfs: reject remote xattr entries with an out-of-range value length
* [PATCH 6.18 0831/1005] xfs: release ip after unlinked list store failure
* [PATCH 6.18 0832/1005] xfs: rescan the AGs if incore delalloc counter is negative
* [PATCH 6.18 0833/1005] xfs: update quota flags on secondary supers when metadir enabled
* [PATCH 6.18 0834/1005] xfs: abort directory tree repair whenever dl->aborted is set
* [PATCH 6.18 0835/1005] xfs: always forget cached ACLs if the attr fork swap succeeds
* [PATCH 6.18 0836/1005] xfs: always report inode repair setup failures
* [PATCH 6.18 0837/1005] xfs: always report scrub errors in tracepoints
* [PATCH 6.18 0838/1005] xfs: always zero the whole shortform header when zeroing attr fork
* [PATCH 6.18 0839/1005] xfs: bound da-node entry count against the correct geometry
* [PATCH 6.18 0840/1005] xfs: bound inode fork length against the fork size during log recovery
* [PATCH 6.18 0841/1005] xfs: check for fragments when full-extent sharing matches
* [PATCH 6.18 0842/1005] xfs: check for termination during rmap btree walk
* [PATCH 6.18 0843/1005] xfs: clarify various parts of the bitmap API
* [PATCH 6.18 0844/1005] xfs: clear set[ug]id mode bits when zapping attr fork
* [PATCH 6.18 0845/1005] xfs: complain loudly when dirtree checker finds broken links
* [PATCH 6.18 0846/1005] xfs: dont allow sm_agno for non-group metadir path checking
* [PATCH 6.18 0847/1005] xfs: dont clear COWEXTSIZE on directories on reflink filesystems
* [PATCH 6.18 0848/1005] xfs: dont overrun incore inode when cleaning attr forks
* [PATCH 6.18 0849/1005] xfs: dont queue rmap update twice when reaping a fork
* [PATCH 6.18 0850/1005] xfs: dont rescan ifree and icount when frozen
* [PATCH 6.18 0851/1005] xfs: dont scan across metadata/regular directory trees for dirents
* [PATCH 6.18 0852/1005] xfs: dont set a metadata directorys parent to sb_rootino
* [PATCH 6.18 0853/1005] xfs: dont subtract excess usage twice when computing agf_btreeblks
* [PATCH 6.18 0854/1005] xfs: dont try to repair rtsummary if the summary file isnt computed
* [PATCH 6.18 0855/1005] xfs: dont try to scrub self-referential dirent in metapath checker
* [PATCH 6.18 0856/1005] xfs: fix correction of unwritten extents in quota file data fork
* [PATCH 6.18 0857/1005] xfs: fix data fork block count check in xrep_inode_blockcounts
* [PATCH 6.18 0858/1005] xfs: init inode number for tracepoint
* [PATCH 6.18 0859/1005] xfs: never reset the default quota timer
* [PATCH 6.18 0860/1005] xfs: only written file data blocks can be shared
* [PATCH 6.18 0861/1005] xfs: opportunistically skip btree block checks
* [PATCH 6.18 0862/1005] xfs: propagate errors while checking null siblings
* [PATCH 6.18 0863/1005] xfs: range-check bc_levels array access in scrub tracepoints
* [PATCH 6.18 0864/1005] xfs: reattach dquots after changing inode ids
* [PATCH 6.18 0865/1005] x86/bugs: Adapt SRSO mitigation to Zen6
* [PATCH 6.18 0866/1005] smb: server: size directory name conversion buffer correctly
* [PATCH 6.18 0867/1005] smb: client: dont resurrect an exiting tcon from cached dir workers
* [PATCH 6.18 0868/1005] smb: client: fix buffer overflow in SMB2_tcon()
* [PATCH 6.18 0869/1005] smb: client: fix fiemap wild read on empty truncated response
* [PATCH 6.18 0870/1005] smb: client: fix slab-out-of-bounds write in id_mode_to_cifs_acl()
* [PATCH 6.18 0871/1005] smb: client: validate NT transaction response layout and offsets
* [PATCH 6.18 0872/1005] pNFS: Fix CB_NOTIFY_DEVICEID CHANGE to consume ndc_immediate
* [PATCH 6.18 0873/1005] pnfs/blocklayout: Complete a device upcall only on its own reply
* [PATCH 6.18 0874/1005] pnfs/blocklayout: Complete a device upcall when the pipe is closed
* [PATCH 6.18 0875/1005] NFSv4/pnfs: Free the netid when draining a data-server address list
* [PATCH 6.18 0876/1005] NFSv4.1/pnfs: suspend pNFS on NFS4ERR_TOOSMALL from LAYOUTGET
* [PATCH 6.18 0877/1005] NFSv4/filelayout: Anchor page coalescing on pattern_offset
* [PATCH 6.18 0878/1005] NFSv4/flexfiles: fail I/O to the data server once a lock is lost
* [PATCH 6.18 0879/1005] NFSv4/flexfiles: Use the full 64-bit offset for read DS selection
* [PATCH 6.18 0880/1005] NFSv4/flexfiles: Use the full 64-bit stripe_unit
* [PATCH 6.18 0881/1005] NFSv4/flexfiles: Bound page coalescing on the absolute stripe offset
* [PATCH 6.18 0882/1005] NFS: Fix stale negative cache on failed nfs_mkdir()
* [PATCH 6.18 0883/1005] NFS/localio: fix nfs_local_dio_misaligned tracepoint
* [PATCH 6.18 0884/1005] NFS/localio: report the stability a DIO WRITE actually has
* [PATCH 6.18 0885/1005] NFSD: cap the number of listeners accepted in listener_set
* [PATCH 6.18 0886/1005] nfsd: clear XDR padding in GETXATTR replies
* [PATCH 6.18 0887/1005] NFSD: copy SETXATTR data from all XDR buffer segments
* [PATCH 6.18 0888/1005] NFSD: Do not send CB_RECALL_ANY to NFSv4.0 clients
* [PATCH 6.18 0889/1005] NFSD: Dont complete a cld upcall the daemon has not read
* [PATCH 6.18 0890/1005] nfsd: dont modify a session slot when replaying its cached reply
* [PATCH 6.18 0891/1005] NFSD: Fail a pool_threads read whose reply does not fit
* [PATCH 6.18 0892/1005] nfsd: fetch direct I/O alignment for files handed to the filecache
* [PATCH 6.18 0893/1005] nfsd: Fix id-to-name cache entry leak in idtoname_parse()
* [PATCH 6.18 0894/1005] NFSD: Fix out-of-bounds read in the rpc_status dump
* [PATCH 6.18 0895/1005] nfsd: hold cl_lock in client_has_openowners()
* [PATCH 6.18 0896/1005] nfsd: honour client-provided attributes for NFS4_CREATE_EXCLUSIVE4_1
* [PATCH 6.18 0897/1005] NFSD: map fh_verify() status codes for NFS_ACLv3 replies
* [PATCH 6.18 0898/1005] NFSD: Map flex file layout IDs through the requests user namespace
* [PATCH 6.18 0899/1005] nfsd: preflight SEQUENCE replies before accepting a slot
* [PATCH 6.18 0900/1005] nfsd: propagate SETXATTR value decode errors
* [PATCH 6.18 0901/1005] NFSD: Reject an oversized principal hash from nfsdcld
* [PATCH 6.18 0902/1005] NFSD: Resolve the recall-any mask names in the trace format
* [PATCH 6.18 0903/1005] NFSD: Return NFSERR_ISDIR for NFSv2 READ and WRITE on a non-regular file
* [PATCH 6.18 0904/1005] NFSD: Set nn->cld_net before registering the cld pipe
* [PATCH 6.18 0905/1005] NFSD: validate transport name in listener_set before serv creation
* [PATCH 6.18 0906/1005] nfsd: zero NFSv4 COMPOUND tag padding
* [PATCH 6.18 0907/1005] SUNRPC: Copy the deferred RPC Call from the head buffer
* [PATCH 6.18 0908/1005] SUNRPC: Do not credit control-record octets to the RPC stream
* [PATCH 6.18 0909/1005] SUNRPC: fix oversized GSS proxy token copy
* [PATCH 6.18 0910/1005] SUNRPC: keep the first error in svc_register()
* [PATCH 6.18 0911/1005] sunrpc: pin gss module across auth_domain RCU free
* [PATCH 6.18 0912/1005] SUNRPC: Reject a socket that already has an svc_sock attached
* [PATCH 6.18 0913/1005] SUNRPC: Reject a TLS alert record that is not two octets
* [PATCH 6.18 0914/1005] SUNRPC: Resume receiving after a TLS control record
* [PATCH 6.18 0915/1005] SUNRPC: trace an accepted transport before publishing it
* [PATCH 6.18 0916/1005] sunrpc: treat empty auth.unix.gid replies as negative entries
* [PATCH 6.18 0917/1005] SUNRPC: Treat every TLS error alert as fatal
* [PATCH 6.18 0918/1005] rxrpc: Fix update of call->tx_pending without holding lock
* [PATCH 6.18 0919/1005] rxrpc: Fix lack of short-send handling in rxrpc_kernel_send_data()
* [PATCH 6.18 0920/1005] afs: Fix afs to abort the rxrpc call on send error
* [PATCH 6.18 0921/1005] rxrpc: Fix double IRQ enablement
* [PATCH 6.18 0922/1005] rxrpc: Fix return in rxrpc_recvmsg_data() for service calls
* [PATCH 6.18 0923/1005] x86/cpuid: Mark CPUID function 0x23 as being indexed
* [PATCH 6.18 0924/1005] x86/mm/pat: Fix effective RW computation in lookup_address_in_pgd_attr()
* [PATCH 6.18 0925/1005] KVM: SVM: Trigger new ASID allocation in both VMCBs on pCPU switch
* [PATCH 6.18 0926/1005] KVM: nSVM: Ignore EFER.LMA if EFER.LME=0 when preparing L2 state
* [PATCH 6.18 0927/1005] KVM: Use goto to handle errors during memslot preparation
* [PATCH 6.18 0928/1005] KVM: VMX: Disallow using to_vmx() in common VT code
* [PATCH 6.18 0929/1005] KVM: VMX: Make handle_bus_lock_vmexit() a shared helper
* [PATCH 6.18 0930/1005] KVM: VMX: Preserve negative return value in vmx_handle_exit() with bus lock detected
* [PATCH 6.18 0931/1005] KVM: x86/mmu: Bug the VM if KVM attempts to walk more levels than the MMU has
* [PATCH 6.18 0932/1005] KVM: x86/mmu: Bug the VM if KVM calcs a CPU role with EFER.LMA=1 && CR4.PAE=0
* [PATCH 6.18 0933/1005] KVM: x86/xen: Enforce 4-byte alignment of vcpu_info registration
* [PATCH 6.18 0934/1005] KVM: x86/xen: Take kvm->srcu in __kvm_xen_has_interrupt()
* [PATCH 6.18 0935/1005] KVM: x86: Clear hardware HLT state when userspace makes a vCPU not-halted
* [PATCH 6.18 0936/1005] KVM: x86: Preserve DR6.BLD (Bus Lock Detect) when delivering #DB payload
* [PATCH 6.18 0937/1005] KVM: x86: Request event processing for exception VM-Exits
* [PATCH 6.18 0938/1005] KVM: x86: Take SRCU in kvm_zap_gfn_range()
* [PATCH 6.18 0939/1005] KVM: x86: Zero reserved synic flags when delivering message to avoid stack leak
* [PATCH 6.18 0940/1005] KVM: TDX: Check if there is valid exit infos based on vp_enter_ret
* [PATCH 6.18 0941/1005] KVM: TDX: Enable Notify VM exit
* [PATCH 6.18 0942/1005] KVM: TDX: Enable Bus Lock VM exit
* [PATCH 6.18 0943/1005] KVM: PPC: Book3S HV: Add preempt_disable() around virtual-mode HPTE bit-lock users
* [PATCH 6.18 0944/1005] KVM: PPC: Fix get_d_signext() 12-bit displacement for paired-single D-form
* [PATCH 6.18 0945/1005] HID: zydacron: validate key report length
* [PATCH 6.18 0946/1005] HID: amd_sfh: Remove unsupported motion-state field from accelerometer report
* [PATCH 6.18 0947/1005] HID: amd_sfh: Use report type from request node
* [PATCH 6.18 0948/1005] HID: core: Fix out-of-bounds left shift by 32 in s32ton()
* [PATCH 6.18 0949/1005] HID: cougar: reject short special-key reports
* [PATCH 6.18 0950/1005] HID: cp2112: validate response report lengths
* [PATCH 6.18 0951/1005] HID: elo: reject short touchscreen reports
* [PATCH 6.18 0952/1005] HID: logitech-dj: validate unnumbered keyboard reports
* [PATCH 6.18 0953/1005] HID: mcp2200: validate READ_ALL response length
* [PATCH 6.18 0954/1005] HID: mcp2221: validate response report length
* [PATCH 6.18 0955/1005] HID: picoLCD: check for fb_deferred_io_init() error
* [PATCH 6.18 0956/1005] HID: prodikeys: validate fixed-format MIDI reports
* [PATCH 6.18 0957/1005] HID: pxrc: reject short input reports
* [PATCH 6.18 0958/1005] HID: quirks: Always poll the Anne Pro 2 with product ID a292
* [PATCH 6.18 0959/1005] HID: roccat: isku: reject short button reports
* [PATCH 6.18 0960/1005] HID: roccat: koneplus: reject short button reports
* [PATCH 6.18 0961/1005] HID: roccat: konepure: reject short button reports
* [PATCH 6.18 0962/1005] HID: roccat: kovaplus: reject short button reports
* [PATCH 6.18 0963/1005] HID: roccat: pyra: reject short button reports
* [PATCH 6.18 0964/1005] HID: roccat: ryos: reject short special reports
* [PATCH 6.18 0965/1005] HID: roccat: savu: reject short special reports
* [PATCH 6.18 0966/1005] ovl: check that the parents of volatile/dirty are dirs
* [PATCH 6.18 0967/1005] ovl: hold a reference on the parent in readdir
* [PATCH 6.18 0968/1005] ovl: do not copy up a dentry that was removed
* [PATCH 6.18 0969/1005] ovl: fix mount setup failing when override_creds drops CAP_SYS_ADMIN
* [PATCH 6.18 0970/1005] smb: smbdirect: fix buffer length underflow in RDMA transfers
* [PATCH 6.18 0971/1005] io_uring/kbuf: advance head when a pickup empties the buffer ring
* [PATCH 6.18 0972/1005] io_uring/net: keep recvmsg buffer select length within MAX_RW_COUNT
* [PATCH 6.18 0973/1005] io_uring/net: dont retry a non-blocking connect() that fails with -EAGAIN
* [PATCH 6.18 0974/1005] io_uring/io-wq: no new workers once the exit has begun
* [PATCH 6.18 0975/1005] io_uring/rsrc: charge buffer arrays and nodes to memcg
* [PATCH 6.18 0976/1005] io_uring: charge tctx nodes and personalities
* [PATCH 6.18 0977/1005] io_uring: free XArray nodes left by a failed store
* [PATCH 6.18 0978/1005] io_uring/sqpoll: dont wait for the thread to exit
* [PATCH 6.18 0979/1005] io_uring: defer foreign io-wq enqueues to task_work
* [PATCH 6.18 0980/1005] io_uring/timeout: count cancelled timeouts in cq_timeouts
* [PATCH 6.18 0981/1005] io_uring/net: fix multishot recv length limit accounting
* [PATCH 6.18 0982/1005] smb: client: do not pass a NULL buf to is_oplock_break()
* [PATCH 6.18 0983/1005] smb: client: fix early procfs exposure race
* [PATCH 6.18 0984/1005] driver core: Check drivers_autoprobe for all added devices
* [PATCH 6.18 0985/1005] driver core: take parent lock in async device attach
* [PATCH 6.18 0986/1005] ksmbd: deny access for an empty DACL instead of granting the request
* [PATCH 6.18 0987/1005] ksmbd: fix session reference leak on compounded SESSION_SETUP
* [PATCH 6.18 0988/1005] ksmbd: prevent share root removal through empty paths
* [PATCH 6.18 0989/1005] ksmbd: prevent stale data from being written by SMB2 WRITE requests
* [PATCH 6.18 0990/1005] ksmbd: fix invalid pointer dereference when get_inode_acl() fails
* [PATCH 6.18 0991/1005] ksmbd: use the existing xattr name for a named stream
* [PATCH 6.18 0992/1005] ksmbd: fix out-of-bounds read when padding the final compound response
* [PATCH 6.18 0993/1005] ksmbd: fix named stream write and EOF handling
* [PATCH 6.18 0994/1005] ksmbd: verify transform SessionId matches the decrypted header
* [PATCH 6.18 0995/1005] ksmbd: fix use-after-free after a failed durable reconnect
* [PATCH 6.18 0996/1005] media: ipu-bridge: Fix use-after-free in IVSC error path
* [PATCH 6.18 0997/1005] pps: change pps_gen_class to a const struct
* [PATCH 6.18 0998/1005] pps: generators: fix use-after-free when closing a removed device
* [PATCH 6.18 0999/1005] mm/rmap: dont discard lazyfree THPs at PMD level
* [PATCH 6.18 1000/1005] media: rc: Fix build failure with CONFIG_LIRC disabled
* [PATCH 6.18 1001/1005] selftests: ublk: add missing gitignore for metadata_size binary
* [PATCH 6.18 1002/1005] drm/amdgpu/powerplay: Align get_tonga_state_array() header with prototype
* [PATCH 6.18 1003/1005] netfilter: conntrack: always lower timeout for non-closing RST packets
* [PATCH 6.18 1004/1005] opp: fix use after free in _update_opp_table_clk()
* [PATCH 6.18 1005/1005] ALSA: hda/realtek: Fix audio after Windows reboot on ASUS Q423SA

and found the following issue:
WARNING: lock held when returning to user space in uart_set_ldisc

Full report is available here:
https://ci.syzbot.org/series/530f70c1-b89b-4aea-9f60-b37ea51b8ceb

***

WARNING: lock held when returning to user space in uart_set_ldisc

tree:      stable
URL:       https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux-stable.git
base:      f45ed76d6791cf72ff1265ee93511175bbbc2f18
arch:      amd64
compiler:  Debian clang version 22.1.8 (1~deb13u4), Debian LLD 22.1.8
config:    https://ci.syzbot.org/builds/29ef7d8d-54c9-4916-91c8-e2793ec684f2/config
syz repro: https://ci.syzbot.org/findings/a8ef2ca8-d3da-4fa6-b5c9-47061f7b2d3f/syz_repro

================================================
WARNING: lock held when returning to user space!
syzkaller #0 Not tainted
------------------------------------------------
syz.2.19/5834 is leaving the kernel with locks still held!
1 lock held by syz.2.19/5834:
#0: ffff888109e20e90 (&port->mutex){+.+.}-{4:4}, at: uart_set_ldisc+0x51/0x1e0 drivers/tty/serial/serial_core.c:1658

***

If these findings have caused you to resend the series or submit a separate fix, please add the following tag to your commit message:

---
This report is generated by a bot. It may contain errors. syzbot ci engineers can be reached at [email protected].

To test a fix for this bug, please reply with #syz test (on a separate line) and attach the patch to the email.

Notes:
- The patch will be applied on top of the tested series (as an incremental fix).
- To test a new version of the whole series, please send it directly to [email protected].
- Arguments like custom git repos and branches are not supported.

Tested-by on the v1 series
#1027 lore raw
In reply to Greg Kroah-Hartman

Hi!

Quoted 4 lines

This is the start of the stable review cycle for the 6.18.61 release. There are 1005 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.

CIP testing did not find any problems here:

https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/tree/linux-6.18.y

Best regards,
Pavel

Tested-by on the v1 series
#1029 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.18.61 release. There are 1005 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 Fri, 06 Nov 2026 21:07:23 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.61-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.18.y
and the diffstat can be found below.

thanks,

greg k-h

On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:

Signature · 1 line
Florian
Tested-by on the v1 series
#1030 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.18.61 release. There are 1005 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 Fri, 06 Nov 2026 21:07:23 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 9 lines
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.61-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.18.y
and the diffstat can be found below.

thanks,

greg k-h

Compiled and booted on my test system. No dmesg regressions.

thanks,
-- Shuah

Tested-by on the v1 series
#1031 lore raw
In reply to Greg Kroah-Hartman
Quoted 8 lines · On Wed, 04 Nov 2026 15:55:33 -0500 Greg Kroah-Hartman…

This is the start of the stable review cycle for the 6.18.61 release. There are 1005 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 Fri, 06 Nov 2026 21:07:23 +0000. Anything received after that time might be too late.

Boot-tested under QEMU for Rust x86_64, arm64 and riscv64; built-tested for loongarch64 and arm32:

I replied individually about a few things I noticed in bitmap, loongarch64 and UML:

https://lore.kernel.org/stable/[email protected]/
https://lore.kernel.org/stable/[email protected]/
https://lore.kernel.org/stable/[email protected]/

[ Cc'ing Konstantin: I guess this may have been mentioned before, in
which case I am sorry for the noise, but just in case: public-inbox or Lore seems to have a maximum of 1000 emails in a thread (?), which given the size of the recent stable releases, it makes it a bit hard to see here the reports etc.:

    https://lore.kernel.org/stable/[email protected]/

]

Thanks!

Cheers,
Miguel

Tested-by on the v1 series
#1032 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

This is the start of the stable review cycle for the 6.18.61 release. There are 1005 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 Fri, 06 Nov 2026 21:07:23 +0000. Anything received after that time might be too late.

The whole patch series can be found in one patch at:

Quoted 8 lines
	https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.18.61-rc1.gz

or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.18.y
and the diffstat can be found below.

thanks,

greg k-h

I tested 6.18.60 + stable-queue as of commit aa65920a134b0366b65f438be80335f2060ed664 ("fuzz cleanup"). This is after the broken xfs patch was reverted, but before the tun patch was added to the queue.

Tested on an amd64 laptop (Lenovo ThinkPad T14 Gen 1) and an arm64 virtual machine. Working well, no regressions observed.

Signature · 1 line
-Barry K. Nathan  <[email protected]>