Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6C761E6DC5 for ; Tue, 1 Apr 2025 15:48:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743522493; cv=none; b=EPwDzpuOUxAFzpRRqHmfCN6PlwNwhG6/XVhGHjmwGvpg5yZkRa9ufqg2fJo1E2z3ATwwnbdD4n7ZeMQKk66FjD0tyjY7jpPurjxPEIopZsmeZHu9eB5AJd4j7cmL10rN5iC65r0v0kHnnueR/vtuy1aVCif0GDCjAELioszkQ20= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743522493; c=relaxed/simple; bh=AxGRuXg1/RYWuN3Kj3HOedANgDpe51Vo+o0jXrPaTR0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=N34fExOXTUCZfiAmnGju1PlgIDN7Lm84hZ3STzfqpId4xWfIKpkKLnMFqqInP5EvQisf/31sOKJa/D9sebQ/kiaoW4yKB0AL5kNh22wLLtICtuGRcfSlyv6dDI/zKK7PwHow+LlbYYBjScBPuLCo9F5/afn+1Q2r+8WFnGQRjlg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EI3/tFCl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="EI3/tFCl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D5ADC4CEE4; Tue, 1 Apr 2025 15:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1743522493; bh=AxGRuXg1/RYWuN3Kj3HOedANgDpe51Vo+o0jXrPaTR0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=EI3/tFClyif6Hv/lZpOjpYsA1rGKJo8Qatl5V/ASr6jPHMT0Z6Rp56HEs1VE53XQJ ekVIl37kvq7ehnRfrm+kA/L8h3C4MJj1gI4BLmImP5IFzRorevqTeN/mgdQs+NkiV9 sUiVQKv3jbGRjdU3Cj+TU5plwh/yAw6tIkRUUF14= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21983: mm/slab/kvfree_rcu: Switch to WQ_MEM_RECLAIM wq Date: Tue, 1 Apr 2025 16:46:08 +0100 Message-ID: <2025040149-CVE-2025-21983-1bcc@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=4796; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=AxGRuXg1/RYWuN3Kj3HOedANgDpe51Vo+o0jXrPaTR0=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlvuHS7k2efXrhppdvVmUslTTgW/bu64BbXgafZk3OdJ 1y5wZ7wqyOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmcn0Bw4I139bOvlr4U9li SdOr6+cd58edFF/CME+x6Mu7pdHCfzXXRatP1V/K/NuizRgA X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: mm/slab/kvfree_rcu: Switch to WQ_MEM_RECLAIM wq Currently kvfree_rcu() APIs use a system workqueue which is "system_unbound_wq" to driver RCU machinery to reclaim a memory. Recently, it has been noted that the following kernel warning can be observed: workqueue: WQ_MEM_RECLAIM nvme-wq:nvme_scan_work is flushing !WQ_MEM_RECLAIM events_unbound:kfree_rcu_work WARNING: CPU: 21 PID: 330 at kernel/workqueue.c:3719 check_flush_dependency+0x112/0x120 Modules linked in: intel_uncore_frequency(E) intel_uncore_frequency_common(E) skx_edac(E) ... CPU: 21 UID: 0 PID: 330 Comm: kworker/u144:6 Tainted: G E 6.13.2-0_g925d379822da #1 Hardware name: Wiwynn Twin Lakes MP/Twin Lakes Passive MP, BIOS YMM20 02/01/2023 Workqueue: nvme-wq nvme_scan_work RIP: 0010:check_flush_dependency+0x112/0x120 Code: 05 9a 40 14 02 01 48 81 c6 c0 00 00 00 48 8b 50 18 48 81 c7 c0 00 00 00 48 89 f9 48 ... RSP: 0018:ffffc90000df7bd8 EFLAGS: 00010082 RAX: 000000000000006a RBX: ffffffff81622390 RCX: 0000000000000027 RDX: 00000000fffeffff RSI: 000000000057ffa8 RDI: ffff88907f960c88 RBP: 0000000000000000 R08: ffffffff83068e50 R09: 000000000002fffd R10: 0000000000000004 R11: 0000000000000000 R12: ffff8881001a4400 R13: 0000000000000000 R14: ffff88907f420fb8 R15: 0000000000000000 FS: 0000000000000000(0000) GS:ffff88907f940000(0000) knlGS:0000000000000000 CR2: 00007f60c3001000 CR3: 000000107d010005 CR4: 00000000007726f0 PKRU: 55555554 Call Trace: ? __warn+0xa4/0x140 ? check_flush_dependency+0x112/0x120 ? report_bug+0xe1/0x140 ? check_flush_dependency+0x112/0x120 ? handle_bug+0x5e/0x90 ? exc_invalid_op+0x16/0x40 ? asm_exc_invalid_op+0x16/0x20 ? timer_recalc_next_expiry+0x190/0x190 ? check_flush_dependency+0x112/0x120 ? check_flush_dependency+0x112/0x120 __flush_work.llvm.1643880146586177030+0x174/0x2c0 flush_rcu_work+0x28/0x30 kvfree_rcu_barrier+0x12f/0x160 kmem_cache_destroy+0x18/0x120 bioset_exit+0x10c/0x150 disk_release.llvm.6740012984264378178+0x61/0xd0 device_release+0x4f/0x90 kobject_put+0x95/0x180 nvme_put_ns+0x23/0xc0 nvme_remove_invalid_namespaces+0xb3/0xd0 nvme_scan_work+0x342/0x490 process_scheduled_works+0x1a2/0x370 worker_thread+0x2ff/0x390 ? pwq_release_workfn+0x1e0/0x1e0 kthread+0xb1/0xe0 ? __kthread_parkme+0x70/0x70 ret_from_fork+0x30/0x40 ? __kthread_parkme+0x70/0x70 ret_from_fork_asm+0x11/0x20 ---[ end trace 0000000000000000 ]--- To address this switch to use of independent WQ_MEM_RECLAIM workqueue, so the rules are not violated from workqueue framework point of view. Apart of that, since kvfree_rcu() does reclaim memory it is worth to go with WQ_MEM_RECLAIM type of wq because it is designed for this purpose. The Linux kernel CVE team has assigned CVE-2025-21983 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit 6c6c47b063b593785202be158e61fe5c827d6677 and fixed in 6.12.20 with commit a74979dce9e9c61f6d797c3761020252c4d8dc63 Issue introduced in 6.12 with commit 6c6c47b063b593785202be158e61fe5c827d6677 and fixed in 6.13.8 with commit 656e35bf66a11e1adde44c4c12050086dc39f241 Issue introduced in 6.12 with commit 6c6c47b063b593785202be158e61fe5c827d6677 and fixed in 6.14 with commit dfd3df31c9db752234d7d2e09bef2aeabb643ce4 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-21983 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: mm/slab_common.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/a74979dce9e9c61f6d797c3761020252c4d8dc63 https://git.kernel.org/stable/c/656e35bf66a11e1adde44c4c12050086dc39f241 https://git.kernel.org/stable/c/dfd3df31c9db752234d7d2e09bef2aeabb643ce4