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 50736481A3 for ; Wed, 1 May 2024 05:31:59 +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=1714541519; cv=none; b=HgaFi2FunJ4G9b0C547e1E70Sv6+xoGO7wGdafE6HPXlZ8kr4q2Rb6QEHj14e3knPrZJV7ziWTRv9dNHxm6n5SqOVyuLz11wDRuuJ0/1M+RCpk1PEX9MDBz0ruXKfXt73uy2BzRoe7Yz4C0vO6KP7xsxfX9kJzd5BVL+ODt94i4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714541519; c=relaxed/simple; bh=lbqvPp1Yg2tO/qVTj6/zsw59e/wnZ70jaBWrg6PbZMc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lfpIGkZYxsj2T7XVBkdVR4X32Rj/u3DhmAhMvpDqN5y2SqMn5Fik/wDKiAtlBq+7V9TPiTiHWGavjiud6Ygo+K1yjClpP0jfVQvDzroAGP18ECaChVB1QyqYBlP+arnY6vaEn3Tef2CXXNO7mDlaHg/TFNyrgG+oHhYUVI2e2sc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=maAm1z2B; 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="maAm1z2B" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEEC8C113CC; Wed, 1 May 2024 05:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714541519; bh=lbqvPp1Yg2tO/qVTj6/zsw59e/wnZ70jaBWrg6PbZMc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=maAm1z2BGHo9K1xlCbDqYm5q6WpGdLWYeWX9XnyMD5vvu3X6QhcU1FphARPdGjd4b lndl/eURREO8esMImz7hy9Ve7tCGfXfVPMY8W+3m2tmGZ7Zc/ciQ0fQOvN19v6AmdS 643XUf9qmTKGSOFDw/CfWxrnoo5we1S/40wogVlg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-27006: thermal/debugfs: Add missing count increment to thermal_debug_tz_trip_up() Date: Wed, 1 May 2024 07:31:07 +0200 Message-ID: <2024050147-CVE-2024-27006-3b6f@gregkh> X-Mailer: git-send-email 2.44.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=3009; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=lbqvPp1Yg2tO/qVTj6/zsw59e/wnZ70jaBWrg6PbZMc=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmGl9s5NXqOuJZe0HHpjPGpXR6wunXqZDmTf3/Yf25zO m4hZnS+I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACaySJRhfli80HkV0V6BO4on 5U0Dd389NFfkA8McnmXuD5idnZ8LzD4m9XS6wtt/ivUTAA== 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: thermal/debugfs: Add missing count increment to thermal_debug_tz_trip_up() The count field in struct trip_stats, representing the number of times the zone temperature was above the trip point, needs to be incremented in thermal_debug_tz_trip_up(), for two reasons. First, if a trip point is crossed on the way up for the first time, thermal_debug_update_temp() called from update_temperature() does not see it because it has not been added to trips_crossed[] array in the thermal zone's struct tz_debugfs object yet. Therefore, when thermal_debug_tz_trip_up() is called after that, the trip point's count value is 0, and the attempt to divide by it during the average temperature computation leads to a divide error which causes the kernel to crash. Setting the count to 1 before the division by incrementing it fixes this problem. Second, if a trip point is crossed on the way up, but it has been crossed on the way up already before, its count value needs to be incremented to make a record of the fact that the zone temperature is above the trip now. Without doing that, if the mitigations applied after crossing the trip cause the zone temperature to drop below its threshold, the count will not be updated for this episode at all and the average temperature in the trip statistics record will be somewhat higher than it should be. Cc :6.8+ # 6.8+ The Linux kernel CVE team has assigned CVE-2024-27006 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit 7ef01f228c9f and fixed in 6.8.8 with commit 9c8215d32e73 Issue introduced in 6.8 with commit 7ef01f228c9f and fixed in 6.9-rc5 with commit b552f63cd437 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-2024-27006 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/thermal/thermal_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/9c8215d32e730b597c809a9d2090bf8ec1b79fcf https://git.kernel.org/stable/c/b552f63cd43735048bbe9bfbb7a9dcfce166fbdd