From mboxrd@z Thu Jan 1 00:00:00 1970 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 4C7A31C84D7 for ; Tue, 9 Dec 2025 04:10: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=1765253422; cv=none; b=tMMoIANosV7bL9mxknuVHoV1BQ0S8aWjo0sHXPTI1bt0eY5y33wTh4iXC2kAf86NOJIMXsKrPwS0F4NXBAsOl8j0AkoUlt/OGBsx2X26XbHlmZeQD9bfQE4DDRM8t16z8KWom3TqPTIAMQNsWB1a5X4Rfsw/J6tpwVg+T3NutTE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765253422; c=relaxed/simple; bh=vubZvres90d5IARLQkLug2SG9WdOz81WCHh7qo01w+0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=iD8FUg/TySI2cP8ObCn++7q0uI7QrGs6Oc++SMbp1ZYeHihVrrg2t4e+U8vCr0skxDGtbYi9s4PPXPux4ywD2dmdP3jJW/MDDNlT8TANY0HRFYQ1jrPXjvQAvu6uwcLWPaxIbf1ikLZrGzHJAeTHh/FuPWVT7Qgavo3iXqGHubg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cHNFnezm; 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="cHNFnezm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9615BC4CEF5; Tue, 9 Dec 2025 04:10:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765253421; bh=vubZvres90d5IARLQkLug2SG9WdOz81WCHh7qo01w+0=; h=From:To:Cc:Subject:Date:Reply-To:From; b=cHNFnezmuBRuX2Uq1gA+pZi32HSMAYOhkph5U2ZWbs2AnJE1xuae7ovYWvAVyC0x0 Y6QEWMtDOteYpZZx9SCTtUVehdMiNfvP4NX6kID30kMmBXwdjYZimP/0frSDINec1A rC3cZsLKsN02uFIPP1gio+xIWoK6aKXAhJ8jAaFk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40327: perf/core: Fix system hang caused by cpu-clock usage Date: Tue, 9 Dec 2025 13:10:09 +0900 Message-ID: <2025120908-CVE-2025-40327-e82c@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2750; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=JWX3weV1OeRSHEpbL24e8I1GeHN8ejGTmMYJfo46YvE=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnmCxViNiucW6DFWvDH7sETsdMc0hvdlE29rzZlMp2ef 9TjGHtARywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExkyQ2GBRvf2hp7vNNJy0yZ KCv6wXOWe6ZTMMOCG5mKZ2b3X/9eaDOzcNvrk4x1OzIEAA== 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: perf/core: Fix system hang caused by cpu-clock usage cpu-clock usage by the async-profiler tool can trigger a system hang, which got bisected back to the following commit by Octavia Togami: 18dbcbfabfff ("perf: Fix the POLL_HUP delivery breakage") causes this issue The root cause of the hang is that cpu-clock is a special type of SW event which relies on hrtimers. The __perf_event_overflow() callback is invoked from the hrtimer handler for cpu-clock events, and __perf_event_overflow() tries to call cpu_clock_event_stop() to stop the event, which calls htimer_cancel() to cancel the hrtimer. But that's a recursion into the hrtimer code from a hrtimer handler, which (unsurprisingly) deadlocks. To fix this bug, use hrtimer_try_to_cancel() instead, and set the PERF_HES_STOPPED flag, which causes perf_swevent_hrtimer() to stop the event once it sees the PERF_HES_STOPPED flag. [ mingo: Fixed the comments and improved the changelog. ] The Linux kernel CVE team has assigned CVE-2025-40327 to this issue. Affected and fixed versions =========================== Issue introduced in 6.17 with commit 18dbcbfabfffc4a5d3ea10290c5ad27f22b0d240 and fixed in 6.17.8 with commit 6b8c512811644cf2f5eaf6f44e928683c54127f0 Issue introduced in 6.17 with commit 18dbcbfabfffc4a5d3ea10290c5ad27f22b0d240 and fixed in 6.18 with commit eb3182ef0405ff2f6668fd3e5ff9883f60ce8801 Issue introduced in 6.16.8 with commit b2de0c9ce8e542b5cb4cd3944620d9dd1ea1f0ac 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-40327 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: kernel/events/core.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/6b8c512811644cf2f5eaf6f44e928683c54127f0 https://git.kernel.org/stable/c/eb3182ef0405ff2f6668fd3e5ff9883f60ce8801