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 9D740258CDC for ; Fri, 22 Aug 2025 16:04:32 +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=1755878672; cv=none; b=uG0F50sJtsG5qUGvJsleinYAqWoiuZjxXc/HKxc+Vku8iebNC79sYgqLFeGLoHHuQ0auCwUju2tT74lJ59L4dxjedR4HsOEhvvD9Q19hVBAOtpldb/fQLM+5jiLTdIkMZ8hzKGUxEQT8ATbcJJa9mS4aI+bnVSvxK+pVBmIdALs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755878672; c=relaxed/simple; bh=aW0Fvliaq2AJqWN3peYuOd9IRJ4uacDZtASBrQdrTKg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ynb6azyT9W+sMpnnGbiuRvoVZyBxpmkCnigGEjR6eyvJGhZzdagSXeaEECWIiidZf0Wxu/KWBhGlUHdQSXps1TLzE/NCwXYiXZEZMTqLtpME/5soRhdYTgE+8KL3HTpxsFSaJocrVWVScYbtmV55dGxE1a06r0DqLy1LVF9dBoU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VbmxSIkG; 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="VbmxSIkG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD649C4CEED; Fri, 22 Aug 2025 16:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755878672; bh=aW0Fvliaq2AJqWN3peYuOd9IRJ4uacDZtASBrQdrTKg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=VbmxSIkGbRVapuYgeotnziKRuaL1sH0bLKr73Npx7MwGWx0BKmyzDtJ6RWXtrtgh6 7c8r0VllQVDTuGqRcM8n0OViFblIrFWyMOFNaPqxTUlFvfSsTqcjR4CzGBq2ECzxxA Ub9rG6pkgNjAo7GJsTwjL7nQ6Q8Ot7ZfnlifNnx8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38665: can: netlink: can_changelink(): fix NULL pointer deref of struct can_priv::do_set_mode Date: Fri, 22 Aug 2025 18:03:02 +0200 Message-ID: <2025082259-CVE-2025-38665-29e2@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=3222; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=4sBFl6R47FpSes5BOmJRIa69kBR+28jEHKTiR2OzlT8=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkrpmx5+yP9QmbrnHvVXivDHaYWO1hsFK/uPfQiqixe8 omhoYFMRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzk2hGG+YGHV1ms0Vi26vTh zjezz5kf4dp5SphhQd/KfBe9zyyJR2oNtRdJFl+SKK++BgA= 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: can: netlink: can_changelink(): fix NULL pointer deref of struct can_priv::do_set_mode Andrei Lalaev reported a NULL pointer deref when a CAN device is restarted from Bus Off and the driver does not implement the struct can_priv::do_set_mode callback. There are 2 code path that call struct can_priv::do_set_mode: - directly by a manual restart from the user space, via can_changelink() - delayed automatic restart after bus off (deactivated by default) To prevent the NULL pointer deference, refuse a manual restart or configure the automatic restart delay in can_changelink() and report the error via extack to user space. As an additional safety measure let can_restart() return an error if can_priv::do_set_mode is not set instead of dereferencing it unchecked. The Linux kernel CVE team has assigned CVE-2025-38665 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.31 with commit 39549eef3587f1c1e8c65c88a2400d10fd30ea17 and fixed in 6.1.148 with commit 6bbcf37c5114926c99a1d1e6993a5b35689d2599 Issue introduced in 2.6.31 with commit 39549eef3587f1c1e8c65c88a2400d10fd30ea17 and fixed in 6.6.101 with commit cf81a60a973358dea163f6b14062f17831ceb894 Issue introduced in 2.6.31 with commit 39549eef3587f1c1e8c65c88a2400d10fd30ea17 and fixed in 6.12.41 with commit 0ca816a96fdcf32644c80cbe7a82c7b6ce6ddda5 Issue introduced in 2.6.31 with commit 39549eef3587f1c1e8c65c88a2400d10fd30ea17 and fixed in 6.15.9 with commit 6acceb46180f9e160d4f0c56fcaf39ba562822ae Issue introduced in 2.6.31 with commit 39549eef3587f1c1e8c65c88a2400d10fd30ea17 and fixed in 6.16 with commit c1f3f9797c1f44a762e6f5f72520b2e520537b52 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-38665 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/net/can/dev/dev.c drivers/net/can/dev/netlink.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/6bbcf37c5114926c99a1d1e6993a5b35689d2599 https://git.kernel.org/stable/c/cf81a60a973358dea163f6b14062f17831ceb894 https://git.kernel.org/stable/c/0ca816a96fdcf32644c80cbe7a82c7b6ce6ddda5 https://git.kernel.org/stable/c/6acceb46180f9e160d4f0c56fcaf39ba562822ae https://git.kernel.org/stable/c/c1f3f9797c1f44a762e6f5f72520b2e520537b52