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 E540082C7E for ; Tue, 19 Nov 2024 01:34:23 +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=1731980064; cv=none; b=roVnN/k3aYKmZjHS6anHL4jXbgs0pd+zhJDNyOFmfBAiho1JpfWFiLAjUz4DGAFiS0ivuClbO7FiLlpDYEqvVERsYNMkXUCS4X94+UUDuXriS3pSTulcmpxnYmiPUqSpkjcqCEgv0lrJSnTjuZlp2+ewrtk2b8hwfX24rRMK9Js= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731980064; c=relaxed/simple; bh=Gyc4ceramA1wfoywB7Q+UbKMhJVh2kmav1QqSFDWH9E=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=a5olKkW713tn46syrUBNI5sZCEgTpeIJkEEuSB90a9jgzj/wb8skvoF6uNtxxxpYlRHlhE73MVV5y921mMkwSjI0bjCk/+Czf6dhfFgUaHUqK860C6yNe/zQ5ajPjMYF0qOSXA+iDWkEAMMcQpqlUNPW72V3LT0XeKWsDGxTohg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PnpWXIFN; 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="PnpWXIFN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB7D0C4CECC; Tue, 19 Nov 2024 01:34:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1731980063; bh=Gyc4ceramA1wfoywB7Q+UbKMhJVh2kmav1QqSFDWH9E=; h=From:To:Cc:Subject:Date:Reply-to:From; b=PnpWXIFN0Aw7HoaAdyVwhJFwZCns3bGLcJixWDjSNSFmgp1KZsVGnWjvTsDepBQXP sXngoh9xmrfDQJvII208fxydxL7FWd/WozOYCIIFkUDZBj/B8McCkYI93TItztk1WI QGghFEROKFzs2+qfR+kMLeuv7m2me90tbDaAnzgo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-50298: net: enetc: allocate vf_state during PF probes Date: Tue, 19 Nov 2024 02:32:53 +0100 Message-ID: <2024111903-CVE-2024-50298-2ef7@gregkh> X-Mailer: git-send-email 2.47.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=2839; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Gyc4ceramA1wfoywB7Q+UbKMhJVh2kmav1QqSFDWH9E=; b=owGbwMvMwCRo6H6F97bub03G02pJDOnWry68lDrE+TVx8YdtTflvhFm/Nq3buHfa6oYY5RQR5 ZcVLS+LO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiWckM8514nr/T/9ZnsZbz 3YyPBgF/79s67GJYsDWzYtbma4zSs+QTTX5flMjftG/LBAA= 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: allocate vf_state during PF probes In the previous implementation, vf_state is allocated memory only when VF is enabled. However, net_device_ops::ndo_set_vf_mac() may be called before VF is enabled to configure the MAC address of VF. If this is the case, enetc_pf_set_vf_mac() will access vf_state, resulting in access to a null pointer. The simplified error log is as follows. root@ls1028ardb:~# ip link set eno0 vf 1 mac 00:0c:e7:66:77:89 [ 173.543315] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000004 [ 173.637254] pc : enetc_pf_set_vf_mac+0x3c/0x80 Message from sy [ 173.641973] lr : do_setlink+0x4a8/0xec8 [ 173.732292] Call trace: [ 173.734740] enetc_pf_set_vf_mac+0x3c/0x80 [ 173.738847] __rtnl_newlink+0x530/0x89c [ 173.742692] rtnl_newlink+0x50/0x7c [ 173.746189] rtnetlink_rcv_msg+0x128/0x390 [ 173.750298] netlink_rcv_skb+0x60/0x130 [ 173.754145] rtnetlink_rcv+0x18/0x24 [ 173.757731] netlink_unicast+0x318/0x380 [ 173.761665] netlink_sendmsg+0x17c/0x3c8 The Linux kernel CVE team has assigned CVE-2024-50298 to this issue. Affected and fixed versions =========================== Issue introduced in 5.1 with commit d4fd0404c1c9 and fixed in 6.6.61 with commit ef0edfbe9eee Issue introduced in 5.1 with commit d4fd0404c1c9 and fixed in 6.11.8 with commit 7eb923f8d481 Issue introduced in 5.1 with commit d4fd0404c1c9 and fixed in 6.12 with commit e15c5506dd39 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-50298 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_pf.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/ef0edfbe9eeed1fccad7cb705648af5222664944 https://git.kernel.org/stable/c/7eb923f8d4819737c07d6a8d0daef0a4d7f99e0c https://git.kernel.org/stable/c/e15c5506dd39885cd047f811a64240e2e8ab401b