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 F2BBA14A639 for ; Tue, 22 Jul 2025 08:04:35 +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=1753171476; cv=none; b=HpX6uCZJ+I7dUK9nSSlMTEj1BjJVK0V79a7aMXPZhlplfhiDkXRIlCrznhrCmox2dUkPWOEvcud9kQhh4TStkTt1kvvwr+5kDw5kQgxfs/ZJfeA8qPZspOqQDZZBCwNIqgRji9l2mp+ymbjl2qX6k+WVFPXOG1MGFWwZUL4DlBo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753171476; c=relaxed/simple; bh=BDdVfBCejBMfT2R4ZZqLa5uGgKFScqWvWO2nnjsieXo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=JMCXQGOX8+vYVCylK2DPnS5/h3/sK/FD7tpkMCZnOTflSeLHav+zIOpwghXb4siTZZWC8SizJWt4KdgnQJlgFmW6UeVeWyG+bDZ+v5V2gzUPt3dbPcIL76Ive+pEyS17vwe0QbeITJcLeQy+C3m9Hj5Jq++hWriznSMoLJRHK6o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2oN152WX; 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="2oN152WX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0192C4CEF4; Tue, 22 Jul 2025 08:04:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753171475; bh=BDdVfBCejBMfT2R4ZZqLa5uGgKFScqWvWO2nnjsieXo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=2oN152WXgh4yBdSEFuUO6SLXTJ6Me/8/F5BBaz/RBgfOFvL4WQt/JtKHAVDST3Tbi lzee4EK4w2uW/GDl1PSOz9TOYRjf0CowLKWCtvA0KM5OPtP3nn+Ih5kduraTgKVFIL lJ4W+Rwn/iVFog1LTVnUX8JIrztX83TuEcpKYxKE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38352: posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del() Date: Tue, 22 Jul 2025 10:04:30 +0200 Message-ID: <2025072229-CVE-2025-38352-f1de@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=3876; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=2p9xsXvWDfRoDhrwfNyiSK82wr4cTsb4PNg3KS7avQk=; b=owGbwMvMwCRo6H6F97bub03G02pJDBn1brxFOuJLTKKfnVCxF/O54nd0zeKlCg92z7W8eu9a4 iHOR/d8O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiZ9oYFvReDP0Y2M3qarm8 ZLHltdIyCf7XtxnmGZ882eAi/H3m7Lv3ljdFfE1eGcEvBAA= 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: posix-cpu-timers: fix race between handle_posix_cpu_timers() and posix_cpu_timer_del() If an exiting non-autoreaping task has already passed exit_notify() and calls handle_posix_cpu_timers() from IRQ, it can be reaped by its parent or debugger right after unlock_task_sighand(). If a concurrent posix_cpu_timer_del() runs at that moment, it won't be able to detect timer->it.cpu.firing != 0: cpu_timer_task_rcu() and/or lock_task_sighand() will fail. Add the tsk->exit_state check into run_posix_cpu_timers() to fix this. This fix is not needed if CONFIG_POSIX_CPU_TIMERS_TASK_WORK=y, because exit_task_work() is called before exit_notify(). But the check still makes sense, task_work_add(&tsk->posix_cputimers_work.work) will fail anyway in this case. The Linux kernel CVE team has assigned CVE-2025-38352 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.36 with commit 0bdd2ed4138ec04e09b4f8165981efc99e439f55 and fixed in 5.4.295 with commit 78a4b8e3795b31dae58762bc091bb0f4f74a2200 Issue introduced in 2.6.36 with commit 0bdd2ed4138ec04e09b4f8165981efc99e439f55 and fixed in 5.10.239 with commit c076635b3a42771ace7d276de8dc3bc76ee2ba1b Issue introduced in 2.6.36 with commit 0bdd2ed4138ec04e09b4f8165981efc99e439f55 and fixed in 5.15.186 with commit 2f3daa04a9328220de46f0d5c919a6c0073a9f0b Issue introduced in 2.6.36 with commit 0bdd2ed4138ec04e09b4f8165981efc99e439f55 and fixed in 6.1.142 with commit 764a7a5dfda23f69919441f2eac2a83e7db6e5bb Issue introduced in 2.6.36 with commit 0bdd2ed4138ec04e09b4f8165981efc99e439f55 and fixed in 6.6.94 with commit 2c72fe18cc5f9f1750f5bc148cf1c94c29e106ff Issue introduced in 2.6.36 with commit 0bdd2ed4138ec04e09b4f8165981efc99e439f55 and fixed in 6.12.34 with commit c29d5318708e67ac13c1b6fc1007d179fb65b4d7 Issue introduced in 2.6.36 with commit 0bdd2ed4138ec04e09b4f8165981efc99e439f55 and fixed in 6.15.3 with commit 460188bc042a3f40f72d34b9f7fc6ee66b0b757b Issue introduced in 2.6.36 with commit 0bdd2ed4138ec04e09b4f8165981efc99e439f55 and fixed in 6.16-rc2 with commit f90fff1e152dedf52b932240ebbd670d83330eca 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-38352 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/time/posix-cpu-timers.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/78a4b8e3795b31dae58762bc091bb0f4f74a2200 https://git.kernel.org/stable/c/c076635b3a42771ace7d276de8dc3bc76ee2ba1b https://git.kernel.org/stable/c/2f3daa04a9328220de46f0d5c919a6c0073a9f0b https://git.kernel.org/stable/c/764a7a5dfda23f69919441f2eac2a83e7db6e5bb https://git.kernel.org/stable/c/2c72fe18cc5f9f1750f5bc148cf1c94c29e106ff https://git.kernel.org/stable/c/c29d5318708e67ac13c1b6fc1007d179fb65b4d7 https://git.kernel.org/stable/c/460188bc042a3f40f72d34b9f7fc6ee66b0b757b https://git.kernel.org/stable/c/f90fff1e152dedf52b932240ebbd670d83330eca