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 3F0761F8733 for ; Tue, 19 Aug 2025 17:22:30 +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=1755624150; cv=none; b=UBkR77E8NjY22FSfPifptGwamDXiImMwAXaMULlgyvHpo7vQxjzBf3CofHgZzS36G8BswqemO6e6uteDWouq4w1c/F3mS1PPr56Y/a6X5bpK5m2ePsxaQ+JxoY+7dSO4eoSXYB3ASvUYDevx/89WQFRKMejcCPUqBwBpfuwBA54= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755624150; c=relaxed/simple; bh=UCM9KNwsFVUmkvCYL3Ky3bxfh7M/w998wQtlogtg2K0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gIh3kW73uUkz4S/wFUDmbuaql7hCR7kFn4i7BfHjKCuAgB0PDPAE0N+9dhOGQe/zmSkRLu8ALaBnKgRIi3gD4hOa6jC1OA/ni+W8ClLheIzKdJkPsOMBQFVowm4aAtTHLdWGGj0Kh3O6tXJajbylFwK5fKh0fpfY7QGuokAnmkY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rUFZ2AsQ; 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="rUFZ2AsQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8109DC4CEF1; Tue, 19 Aug 2025 17:22:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755624150; bh=UCM9KNwsFVUmkvCYL3Ky3bxfh7M/w998wQtlogtg2K0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=rUFZ2AsQmzLmDuulhCBwWJLS2NX8MsodgoF9f8o+TJRwYzBdEzaS/W4cNpw5Pogc7 RgCT/yLLb8PmQmkGKb2cK4L3oW+BhtZL7BZXvpV9tmosaSh/iY+5H7fZGx1WLe6mqI wHBoWQsNWBV/DmbLIA3Ze6Tk46tB4y2b+rtPpaqI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38581: crypto: ccp - Fix crash when rebind ccp device for ccp.ko Date: Tue, 19 Aug 2025 19:18:27 +0200 Message-ID: <2025081913-CVE-2025-38581-04e8@gregkh> X-Mailer: git-send-email 2.50.1 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=4777; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=dz5gefYhCrbttbf+rW7YUFcvjHJksmAbf/SzyY+CRo0=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlLNl5VdT7/43/K+Yr+3woJy2T9n5zY2n1Ct9NCSIcr/ Ibqhrn3O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi5joMcwVXBXZFWz86cS9d UKh9Y2Uy11EzVYbZLIf4HB85b7M/f+rXFs9Q4TuXPddOAwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: crypto: ccp - Fix crash when rebind ccp device for ccp.ko When CONFIG_CRYPTO_DEV_CCP_DEBUGFS is enabled, rebinding the ccp device causes the following crash: $ echo '0000:0a:00.2' > /sys/bus/pci/drivers/ccp/unbind $ echo '0000:0a:00.2' > /sys/bus/pci/drivers/ccp/bind [ 204.976930] BUG: kernel NULL pointer dereference, address: 0000000000000098 [ 204.978026] #PF: supervisor write access in kernel mode [ 204.979126] #PF: error_code(0x0002) - not-present page [ 204.980226] PGD 0 P4D 0 [ 204.981317] Oops: Oops: 0002 [#1] SMP NOPTI ... [ 204.997852] Call Trace: [ 204.999074] [ 205.000297] start_creating+0x9f/0x1c0 [ 205.001533] debugfs_create_dir+0x1f/0x170 [ 205.002769] ? srso_return_thunk+0x5/0x5f [ 205.004000] ccp5_debugfs_setup+0x87/0x170 [ccp] [ 205.005241] ccp5_init+0x8b2/0x960 [ccp] [ 205.006469] ccp_dev_init+0xd4/0x150 [ccp] [ 205.007709] sp_init+0x5f/0x80 [ccp] [ 205.008942] sp_pci_probe+0x283/0x2e0 [ccp] [ 205.010165] ? srso_return_thunk+0x5/0x5f [ 205.011376] local_pci_probe+0x4f/0xb0 [ 205.012584] pci_device_probe+0xdb/0x230 [ 205.013810] really_probe+0xed/0x380 [ 205.015024] __driver_probe_device+0x7e/0x160 [ 205.016240] device_driver_attach+0x2f/0x60 [ 205.017457] bind_store+0x7c/0xb0 [ 205.018663] drv_attr_store+0x28/0x40 [ 205.019868] sysfs_kf_write+0x5f/0x70 [ 205.021065] kernfs_fop_write_iter+0x145/0x1d0 [ 205.022267] vfs_write+0x308/0x440 [ 205.023453] ksys_write+0x6d/0xe0 [ 205.024616] __x64_sys_write+0x1e/0x30 [ 205.025778] x64_sys_call+0x16ba/0x2150 [ 205.026942] do_syscall_64+0x56/0x1e0 [ 205.028108] entry_SYSCALL_64_after_hwframe+0x76/0x7e [ 205.029276] RIP: 0033:0x7fbc36f10104 [ 205.030420] Code: 89 02 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 8d 05 e1 08 2e 00 8b 00 85 c0 75 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 f3 c3 66 90 41 54 55 49 89 d4 53 48 89 f5 This patch sets ccp_debugfs_dir to NULL after destroying it in ccp5_debugfs_destroy, allowing the directory dentry to be recreated when rebinding the ccp device. Tested on AMD Ryzen 7 1700X. The Linux kernel CVE team has assigned CVE-2025-38581 to this issue. Affected and fixed versions =========================== Issue introduced in 4.13 with commit 3cdbe346ed3f380eae1cb3e9febfe703e7d8a7b0 and fixed in 6.1.148 with commit 2d4060f05e74dbee884ba723f6afd9282befc3c5 Issue introduced in 4.13 with commit 3cdbe346ed3f380eae1cb3e9febfe703e7d8a7b0 and fixed in 6.6.102 with commit db111468531777cac8b4beb6515a88a54b0c4a74 Issue introduced in 4.13 with commit 3cdbe346ed3f380eae1cb3e9febfe703e7d8a7b0 and fixed in 6.12.42 with commit 9dea08eac4f6d6fbbae59992978252e2edab995d Issue introduced in 4.13 with commit 3cdbe346ed3f380eae1cb3e9febfe703e7d8a7b0 and fixed in 6.15.10 with commit 6eadf50c1d894cb34f3237064063207460946040 Issue introduced in 4.13 with commit 3cdbe346ed3f380eae1cb3e9febfe703e7d8a7b0 and fixed in 6.16.1 with commit 64ec9a7e7a6398b172ab6feba60e952163a1c3d5 Issue introduced in 4.13 with commit 3cdbe346ed3f380eae1cb3e9febfe703e7d8a7b0 and fixed in 6.17-rc1 with commit 181698af38d3f93381229ad89c09b5bd0496661a 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-38581 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: drivers/crypto/ccp/ccp-debugfs.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/2d4060f05e74dbee884ba723f6afd9282befc3c5 https://git.kernel.org/stable/c/db111468531777cac8b4beb6515a88a54b0c4a74 https://git.kernel.org/stable/c/9dea08eac4f6d6fbbae59992978252e2edab995d https://git.kernel.org/stable/c/6eadf50c1d894cb34f3237064063207460946040 https://git.kernel.org/stable/c/64ec9a7e7a6398b172ab6feba60e952163a1c3d5 https://git.kernel.org/stable/c/181698af38d3f93381229ad89c09b5bd0496661a