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 012091F63E2 for ; Fri, 27 Dec 2024 15:03:17 +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=1735311799; cv=none; b=XPGBCd/Kq9lPRhFU/J9cqNXuUTGi5whuK8U9gLyUvLp4OvikqeUApzDrQwN3X8lhj/sc/2crm0Dlhp9FvSseABziphivP+1BJ+RnayhIJmI0X2eJCiRnjrCVlM2Co4QJ1hdlR4Bks+ObWqG0Cbro8xXKjSIDrSgNZzDkzU50jCs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735311799; c=relaxed/simple; bh=ZcGtVgkhkC4fjHrKCQt8fSwCC31X4DqtFTGZj62M1eM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NHKRDvEXMBWEX/9QgLMVkKjGp4o6c84THjWUju5CkOhHOrcyGzk3LCLB7NMUivJppMgwhWdXFpGyYbHPQZzsnhk7gliBQYPISpSYNbrGZ0w/1PR3EBhYAKMuAryBtl+kNUEKO4grNn5DTxu5fF+8Q3quzr+NJdnCDPcWfDz84cs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ae+2ORIi; 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="ae+2ORIi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AEF2C4CED0; Fri, 27 Dec 2024 15:03:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735311797; bh=ZcGtVgkhkC4fjHrKCQt8fSwCC31X4DqtFTGZj62M1eM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=ae+2ORIiWk5nmOeBZzA7Pn7uUcUDoV/JMAofzQwg2vw48wMTR90al4hsEe/zSxyQp j9nVVu4/YUG9jyT4VzwQLruEC1XlmYJjNOgMgD32sExiMq5xWouqNVnri1Lhs79iSj Z8QIIFE9xdMuctcE8ReSeY7sPLnQ1wa5R8GT4sBI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56649: net: enetc: Do not configure preemptible TCs if SIs do not support Date: Fri, 27 Dec 2024 16:02:50 +0100 Message-ID: <2024122739-CVE-2024-56649-33a6@gregkh> X-Mailer: git-send-email 2.47.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=3753; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ZcGtVgkhkC4fjHrKCQt8fSwCC31X4DqtFTGZj62M1eM=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5B/s5SyNtlPdNmFmcfFpq/WV2+ee/10+6+GvDwj3TX uxfofs3riOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmcv8tw4LmFske8Tz3uoUT a5NTZsjsW3ZkqTnDPOuZPM94Vkzf/patvz0qO/Tvm2thFQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: net: enetc: Do not configure preemptible TCs if SIs do not support Both ENETC PF and VF drivers share enetc_setup_tc_mqprio() to configure MQPRIO. And enetc_setup_tc_mqprio() calls enetc_change_preemptible_tcs() to configure preemptible TCs. However, only PF is able to configure preemptible TCs. Because only PF has related registers, while VF does not have these registers. So for VF, its hw->port pointer is NULL. Therefore, VF will access an invalid pointer when accessing a non-existent register, which will cause a crash issue. The simplified log is as follows. root@ls1028ardb:~# tc qdisc add dev eno0vf0 parent root handle 100: \ mqprio num_tc 4 map 0 0 1 1 2 2 3 3 queues 1@0 1@1 1@2 1@3 hw 1 [ 187.290775] Unable to handle kernel paging request at virtual address 0000000000001f00 [ 187.424831] pc : enetc_mm_commit_preemptible_tcs+0x1c4/0x400 [ 187.430518] lr : enetc_mm_commit_preemptible_tcs+0x30c/0x400 [ 187.511140] Call trace: [ 187.513588] enetc_mm_commit_preemptible_tcs+0x1c4/0x400 [ 187.518918] enetc_setup_tc_mqprio+0x180/0x214 [ 187.523374] enetc_vf_setup_tc+0x1c/0x30 [ 187.527306] mqprio_enable_offload+0x144/0x178 [ 187.531766] mqprio_init+0x3ec/0x668 [ 187.535351] qdisc_create+0x15c/0x488 [ 187.539023] tc_modify_qdisc+0x398/0x73c [ 187.542958] rtnetlink_rcv_msg+0x128/0x378 [ 187.547064] netlink_rcv_skb+0x60/0x130 [ 187.550910] rtnetlink_rcv+0x18/0x24 [ 187.554492] netlink_unicast+0x300/0x36c [ 187.558425] netlink_sendmsg+0x1a8/0x420 [ 187.606759] ---[ end trace 0000000000000000 ]--- In addition, some PFs also do not support configuring preemptible TCs, such as eno1 and eno3 on LS1028A. It won't crash like it does for VFs, but we should prevent these PFs from accessing these unimplemented registers. The Linux kernel CVE team has assigned CVE-2024-56649 to this issue. Affected and fixed versions =========================== Issue introduced in 6.4 with commit 827145392a4aad635b93e5235b7d7fecc2fa31c7 and fixed in 6.6.66 with commit 66127f0d1ecf00604aeab71132bde398fd9ec7c9 Issue introduced in 6.4 with commit 827145392a4aad635b93e5235b7d7fecc2fa31c7 and fixed in 6.12.5 with commit b718b68a9964181e24d15138a09ce95785a19002 Issue introduced in 6.4 with commit 827145392a4aad635b93e5235b7d7fecc2fa31c7 and fixed in 6.13-rc2 with commit b2420b8c81ec674552d00c55d46245e5c184b260 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-2024-56649 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/ethernet/freescale/enetc/enetc.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/66127f0d1ecf00604aeab71132bde398fd9ec7c9 https://git.kernel.org/stable/c/b718b68a9964181e24d15138a09ce95785a19002 https://git.kernel.org/stable/c/b2420b8c81ec674552d00c55d46245e5c184b260