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 6033B2D3731 for ; Thu, 3 Jul 2025 08:37:22 +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=1751531842; cv=none; b=H//4K2s3hWQYUbbCQcfuiW3TRjQpKxBLIrgimhzZH/k/g4dta5Q7rtH6+F4IZySzz4mIoW2JQD/Gz4s1MaaPSoWaY6GwrJXyO1xe2WOYTIsF1yV5cQuxlMhaM/VHRRqRzc0nVMouiXgSd2rOAoyUIHmvQ9c7C2JinoO1InAVKgA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751531842; c=relaxed/simple; bh=pVLJJtBXHdcJ+o+DXJ7JpqKyOEq9nX8Bqfvx+cbaha4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FPWEPhxbiOsSftblEk4lFhU0LpihC5VNrp3ozeYwW5JJTbTMCd0owTJSdwbzH+rzWykDO3LPN5OnFXN6cPqwpWPqTbLYcZmD+PZxPOWTsXJFhfdMRYwnXS9Kb1JXlEb4hEiJvWeN/uyZ7V9w9FG9DSacm66J5SgrjWlNRLZD+H0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WMnTGEGh; 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="WMnTGEGh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C3843C4CEE3; Thu, 3 Jul 2025 08:37:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751531842; bh=pVLJJtBXHdcJ+o+DXJ7JpqKyOEq9nX8Bqfvx+cbaha4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=WMnTGEGhZ4QwPcPq3vYQaKX+pgBhNbm6XHwMkMlqcbqM4FiTl2JRVYEpFjTn2Tk8W uZXwpoUh2uWJXl8KbV/aEd2mIfjq8rmhgMVT1Ouz/+sy0LRpWWzbpAU3AWc+nPe6C0 3CZQP1ShjK2qShGNk/sY0DOBqjnmWhpkOzlWkRx8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38131: coresight: prevent deactivate active config while enabling the config Date: Thu, 3 Jul 2025 10:35:48 +0200 Message-ID: <2025070330-CVE-2025-38131-2350@gregkh> X-Mailer: git-send-email 2.50.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=3790; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=f9DFhQE9KBvCFkxFTNWQ5BzuCqXgXdJ9/802HXe5/DE=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlpDpdcT827KVB3Y0vQib2nOc9EBMRd52EO7pxwt1rw6 aLsVzqVHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjARG0mGeRpf5p+tMPW+e+/7 koTraZHaJcvNWBjmyrR/YRBTWrNjTu7lT2zrJ/K1SX1wAwA= 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: coresight: prevent deactivate active config while enabling the config While enable active config via cscfg_csdev_enable_active_config(), active config could be deactivated via configfs' sysfs interface. This could make UAF issue in below scenario: CPU0 CPU1 (sysfs enable) load module cscfg_load_config_sets() activate config. // sysfs (sys_active_cnt == 1) ... cscfg_csdev_enable_active_config() lock(csdev->cscfg_csdev_lock) // here load config activate by CPU1 unlock(csdev->cscfg_csdev_lock) deactivate config // sysfs (sys_activec_cnt == 0) cscfg_unload_config_sets() unload module // access to config_desc which freed // while unloading module. cscfg_csdev_enable_config To address this, use cscfg_config_desc's active_cnt as a reference count which will be holded when - activate the config. - enable the activated config. and put the module reference when config_active_cnt == 0. The Linux kernel CVE team has assigned CVE-2025-38131 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15 with commit f8cce2ff3c04361b8843d8489620fda8880f668b and fixed in 6.1.142 with commit dfe8224c9c7a43d356eb9f74b06868aa05f90223 Issue introduced in 5.15 with commit f8cce2ff3c04361b8843d8489620fda8880f668b and fixed in 6.6.94 with commit b3b4efa2e623aecaebd7c9b9e4171f5c659e9724 Issue introduced in 5.15 with commit f8cce2ff3c04361b8843d8489620fda8880f668b and fixed in 6.12.34 with commit 31028812724cef7bd57a51525ce58a32a6d73b22 Issue introduced in 5.15 with commit f8cce2ff3c04361b8843d8489620fda8880f668b and fixed in 6.15.3 with commit ed42ee1ed05ff2f4c36938379057413a40c56680 Issue introduced in 5.15 with commit f8cce2ff3c04361b8843d8489620fda8880f668b and fixed in 6.16-rc1 with commit 408c97c4a5e0b634dcd15bf8b8808b382e888164 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-38131 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/hwtracing/coresight/coresight-config.h drivers/hwtracing/coresight/coresight-syscfg.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/dfe8224c9c7a43d356eb9f74b06868aa05f90223 https://git.kernel.org/stable/c/b3b4efa2e623aecaebd7c9b9e4171f5c659e9724 https://git.kernel.org/stable/c/31028812724cef7bd57a51525ce58a32a6d73b22 https://git.kernel.org/stable/c/ed42ee1ed05ff2f4c36938379057413a40c56680 https://git.kernel.org/stable/c/408c97c4a5e0b634dcd15bf8b8808b382e888164