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 F1A6278F2F for ; Mon, 3 Nov 2025 12:15:20 +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=1762172121; cv=none; b=lMI5vzEzk3o5tZVwTluyyn7VrqP/DWSBMmhX1zdgiaGl32MvsDEsb1wwd4CulOSxfEd1rM0raiCQvnKV4v5ZHL8bgFYPIF6rgYNEsNZTyJhaEOjTZMxIqV9RhTWUX6T0cK3HI40W5E7Y0XzE1VbWsnfWQ4tZQNYFVp2e2kjtQYQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762172121; c=relaxed/simple; bh=wqRytqXeNHwB6zyL973plBXJTVpYO3rP4fihJMuourQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=rzNv8yo7mDfk2vCa4OHxqrnaXwta4vB3TRodGzQLcLSiud4wszd1jh7UT2TIUAD3ekPkSLg5nUhlwIpG1QFRHTrXycjLYR8zqGixLLe5uimrFlrUg2+pAwhjzPN35BzLGsnAl047CjbDro6feJLBpm7mtOY0uQPE8u32DcAkrcM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CL/lgVoj; 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="CL/lgVoj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38DCBC4CEE7; Mon, 3 Nov 2025 12:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1762172120; bh=wqRytqXeNHwB6zyL973plBXJTVpYO3rP4fihJMuourQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=CL/lgVojzmyI8INvtCcFVMqUIFGrH622/y81AHu0SnCmCprgzteB5fcabYMqnzd7z LjPsEwboDgEjWdWNES88nJbN6gUzJdyLpKuQUvivwc6LzoN+cR4CPVqixoPeRDwosH go80Cgq7IJ+IFVuY+Xh1NCOLw2yt135OhIsRCJ1A= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-40107: can: hi311x: fix null pointer dereference when resuming from sleep before interface was enabled Date: Mon, 3 Nov 2025 21:15:16 +0900 Message-ID: <2025110316-CVE-2025-40107-5bac@gregkh> X-Mailer: git-send-email 2.51.2 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=2939; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=cxo1LJr573bPidc5md+Cloo2Qpju8dH8m8L39pJ92ig=; b=owGbwMvMwCRo6H6F97bub03G02pJDJkcc658b3/CnGk1s2vr4Z9ijxMyl+lafOQ+U8yxNU8ss eAm18d3HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRzbsZFqzmdJ2Xl7mo+3Sl 9veXHeFLFwpGP2VYcOB6YbSCaVfYpZNzp1ib2vTV3Z0hCgA= 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: hi311x: fix null pointer dereference when resuming from sleep before interface was enabled This issue is similar to the vulnerability in the `mcp251x` driver, which was fixed in commit 03c427147b2d ("can: mcp251x: fix resume from sleep before interface was brought up"). In the `hi311x` driver, when the device resumes from sleep, the driver schedules `priv->restart_work`. However, if the network interface was not previously enabled, the `priv->wq` (workqueue) is not allocated and initialized, leading to a null pointer dereference. To fix this, we move the allocation and initialization of the workqueue from the `hi3110_open` function to the `hi3110_can_probe` function. This ensures that the workqueue is properly initialized before it is used during device resume. And added logic to destroy the workqueue in the error handling paths of `hi3110_can_probe` and in the `hi3110_can_remove` function to prevent resource leaks. The Linux kernel CVE team has assigned CVE-2025-40107 to this issue. Affected and fixed versions =========================== Fixed in 6.1.156 with commit d1fc4c041459e2d4856c1b2501486ba4f0cbf96b Fixed in 6.6.111 with commit e93af787187e585933570563c643337fa731584a Fixed in 6.12.52 with commit 1d2ef21f02baff0c109ad78b9e835fb4acb14533 Fixed in 6.16.12 with commit fd00cf38fd437c979f0e5905e3ebdfc3f55a4b96 Fixed in 6.17 with commit 6b696808472197b77b888f50bc789a3bae077743 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-40107 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/spi/hi311x.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/d1fc4c041459e2d4856c1b2501486ba4f0cbf96b https://git.kernel.org/stable/c/e93af787187e585933570563c643337fa731584a https://git.kernel.org/stable/c/1d2ef21f02baff0c109ad78b9e835fb4acb14533 https://git.kernel.org/stable/c/fd00cf38fd437c979f0e5905e3ebdfc3f55a4b96 https://git.kernel.org/stable/c/6b696808472197b77b888f50bc789a3bae077743