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 5E9C628682 for ; Thu, 4 Dec 2025 16:08:14 +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=1764864495; cv=none; b=KETJaV0L2TXcwS5etZALFZo8pIjijeMT9OIUfOx0nV5ArTJW9RrJ1iMTLpYgWGWwdtuovBUvUbcPeiNpBXOCszX5cNypXZUQBC6BaqL3jvmIGnIhjpz0ClIBs+RI1vPzDel5/0pCYMtJKMYNOAbLya/tpv6aMGJ55NL+wZ5esOk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764864495; c=relaxed/simple; bh=7lBL4Tph6RtWO00t7YWGdUyly77Q7DDNh8H9iTisk74=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UlskMdkfuNwWeOBc8s3njPI+csD3m+hgzABr89AqRIwCvwly8x39vCbBdsqZVO/e20vXttF9dRGN24HtdHXdnMl3NpM3cVQqTaBVrRREaePflMW7XwicBbIf4KNyxlHdatH3rl47K4z17L5Py0npRs2EO1Oe7rpEGWIWpDPzX7U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IFvw2TbT; 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="IFvw2TbT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74FBDC4CEFB; Thu, 4 Dec 2025 16:08:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1764864494; bh=7lBL4Tph6RtWO00t7YWGdUyly77Q7DDNh8H9iTisk74=; h=From:To:Cc:Subject:Date:Reply-To:From; b=IFvw2TbTf0hVcdAXdZDGrEg92lCihPvjffeI9yAg7Xj0eboRw5PgLAuNkd24kUPes l9Jni51RCrqUYbSjjD5YiM+eY+Si/JtAn6yLmaJDeoVJPBpAFgQrYLL6hJayp6elYA kdEbo4UhcQa7ruY0VtSkKtNyH8Np3L1iytx9MaR4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40260: sched_ext: Fix scx_enable() crash on helper kthread creation failure Date: Thu, 4 Dec 2025 16:57:41 +0100 Message-ID: <2025120433-CVE-2025-40260-41e5@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=2712; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=00oapbV6bu0+8YXBXAjwibX3OhZWXHIIITnplrh31U4=; b=owGbwMvMwCRo6H6F97bub03G02pJDJmG6/PKYoJfWmzepmHCWz8zy9Nyl+eWySoZ0Rtm3GI9b B19PjW6I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACayMYNhQY9wCiPXtyBWB/+F h/c5CL8S7vj+g2GeYv29Kz+atp/qNpkdsU6v2+wjX7YbAA== 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: sched_ext: Fix scx_enable() crash on helper kthread creation failure A crash was observed when the sched_ext selftests runner was terminated with Ctrl+\ while test 15 was running: NIP [c00000000028fa58] scx_enable.constprop.0+0x358/0x12b0 LR [c00000000028fa2c] scx_enable.constprop.0+0x32c/0x12b0 Call Trace: scx_enable.constprop.0+0x32c/0x12b0 (unreliable) bpf_struct_ops_link_create+0x18c/0x22c __sys_bpf+0x23f8/0x3044 sys_bpf+0x2c/0x6c system_call_exception+0x124/0x320 system_call_vectored_common+0x15c/0x2ec kthread_run_worker() returns an ERR_PTR() on failure rather than NULL, but the current code in scx_alloc_and_add_sched() only checks for a NULL helper. Incase of failure on SIGQUIT, the error is not handled in scx_alloc_and_add_sched() and scx_enable() ends up dereferencing an error pointer. Error handling is fixed in scx_alloc_and_add_sched() to propagate PTR_ERR() into ret, so that scx_enable() jumps to the existing error path, avoiding random dereference on failure. The Linux kernel CVE team has assigned CVE-2025-40260 to this issue. Affected and fixed versions =========================== Issue introduced in 6.16 with commit bff3b5aec1b727b620adc7c47085592802390125 and fixed in 6.17.10 with commit 625e173e2a59b6cf6cbfb51c0a6bea47f3861eab Issue introduced in 6.16 with commit bff3b5aec1b727b620adc7c47085592802390125 and fixed in 6.18 with commit 7b6216baae751369195fa3c83d434d23bcda406a 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-40260 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/sched/ext.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/625e173e2a59b6cf6cbfb51c0a6bea47f3861eab https://git.kernel.org/stable/c/7b6216baae751369195fa3c83d434d23bcda406a