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 5CB1931961C for ; Fri, 19 Sep 2025 15:29:01 +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=1758295741; cv=none; b=tb+iLyxc0jU6EugF/5yW9I+phRDzHn8IfX2g7xsV354KTEX5iqmhD9DI9D+Kq2DYg4b4LYme2U1lWZCPTvAw0VecmChLBZgKpLUznnyl+N+jZc7zktSdgaeMpAHHYJimfrYLBxLW6YjJuNbY1gmgL626Kr8tEemdNogV9owFdtM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758295741; c=relaxed/simple; bh=R62vmay4Y11Z9adX0vjIsAfjBkL3jxooGXIiZGT4eMA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hVqAfsE5dZfs0rU+ttLpuHkYBoLRC708sFtrLBwludPwq+q4Tg2t2hfP6u9Uo367SkQ8Eo+lN0Yfdb5v9x9de38HqKv4epMSkG9Me+YvL3XIIon2MUaAxc/I9YK911MbYth9HHTStbPgz0jq4udjQPc1ZjVqfIyIPHn+TNcGwig= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Yr02d07z; 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="Yr02d07z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3AB6C4CEFB; Fri, 19 Sep 2025 15:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1758295741; bh=R62vmay4Y11Z9adX0vjIsAfjBkL3jxooGXIiZGT4eMA=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Yr02d07zann3KN9lWzOYTg/59pappgDwXTkk+OmGfhjmoEM/fzb5dfmXJ5jo5mKum H3C7eaUJub+9Cq+Coi8dSz+vhQzz5FDgP8IifrdKz0hCb/L6OFCTKEBh9Phz/6HXJv wo5IlrytRfMNcuy2eOcZx1jdkNBMMQQBo6+Coks0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39859: ptp: ocp: fix use-after-free bugs causing by ptp_ocp_watchdog Date: Fri, 19 Sep 2025 17:28:23 +0200 Message-ID: <2025091905-CVE-2025-39859-52d5@gregkh> X-Mailer: git-send-email 2.51.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=2692; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=g0GBfpi6zKYk56EmdOTc3qdneeZivhubRbyVqhzHWbE=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlny1pPtXLHT7z78tefxbs814scr/eaJP21L/vMg0l+W 42CNm0P6IhlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJFCUzLNh+0FrDTlQrctZ3 05pli4yKmKuOhDAsaH4t8IJtXY3pY59dK1u38EgqP07jAQA= 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: ptp: ocp: fix use-after-free bugs causing by ptp_ocp_watchdog The ptp_ocp_detach() only shuts down the watchdog timer if it is pending. However, if the timer handler is already running, the timer_delete_sync() is not called. This leads to race conditions where the devlink that contains the ptp_ocp is deallocated while the timer handler is still accessing it, resulting in use-after-free bugs. The following details one of the race scenarios. (thread 1) | (thread 2) ptp_ocp_remove() | ptp_ocp_detach() | ptp_ocp_watchdog() if (timer_pending(&bp->watchdog))| bp = timer_container_of() timer_delete_sync() | | devlink_free(devlink) //free | | bp-> //use Resolve this by unconditionally calling timer_delete_sync() to ensure the timer is reliably deactivated, preventing any access after free. The Linux kernel CVE team has assigned CVE-2025-39859 to this issue. Affected and fixed versions =========================== Issue introduced in 5.15 with commit 773bda96492153e11d21eb63ac814669b51fc701 and fixed in 6.16.6 with commit f10d3c7267ac7387a5129d5506c3c5f2460cfd9b Issue introduced in 5.15 with commit 773bda96492153e11d21eb63ac814669b51fc701 and fixed in 6.17-rc5 with commit 8bf935cf789872350b04c1a6468b0a509f67afb2 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-39859 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/ptp/ptp_ocp.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/f10d3c7267ac7387a5129d5506c3c5f2460cfd9b https://git.kernel.org/stable/c/8bf935cf789872350b04c1a6468b0a509f67afb2