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 A9E8054BDA for ; Sun, 28 Apr 2024 13:05:28 +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=1714309528; cv=none; b=qkH8zcnTrKtub+6Hq76gR16lhr0rpIzZdfrdZ0nrWtBkYJlLka0+W0g+ZifRljEtr1BHa4GXbLjbLBiZLv9/PlBIK2O995FxknwXELNmknKnFHrhEvkI/U4J1IDA/y4JLi0T3DxHjLInwm68O81FRksCXECBRrcwX7sNSuWe+1U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714309528; c=relaxed/simple; bh=9FKqUA4Ug/qp1vG6P2nNTNIPSE7BnBR/Cnz85SxHwG0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Qugx5tSTXES6szGzYqh6PwLQrl93k9cM4IG76qeKsOdZoUNVuzbKyQO+h6mx6W/kBMjTKEpRA/nNk4uB3w6mi6cd/Kd9aPqXiRQrKVfJOkENpzt961zQD9cfhd0RM3gbdTP05XGInhV43r9nRlFSmrz+Kn8cd3+yOXHUxw92rVw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=j07H1Uee; 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="j07H1Uee" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17A8FC113CC; Sun, 28 Apr 2024 13:05:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1714309528; bh=9FKqUA4Ug/qp1vG6P2nNTNIPSE7BnBR/Cnz85SxHwG0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=j07H1UeeJi31MZhazjsJLX4kU2pAsB3vZ+UXdINmLE5qMAuAnLqjAIw2aGlK9heoD WQNKwuFIm1PedvJH1RYl4ypgbfO2zkcqpMRI0mdWJfcBGGI4FyqOWD0r94G4bQgSc1 avF3wPzrKdquC1M8NPYoPCK4usoPlEPjaj6/UrWo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48645: net: enetc: deny offload of tc-based TSN features on VF interfaces Date: Sun, 28 Apr 2024 15:05:06 +0200 Message-ID: <2024042857-CVE-2022-48645-2325@gregkh> X-Mailer: git-send-email 2.44.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=3547; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=9FKqUA4Ug/qp1vG6P2nNTNIPSE7BnBR/Cnz85SxHwG0=; b=owGbwMvMwCRo6H6F97bub03G02pJDGl6npUfF74Td1hzzvt91Lze6akyZ5KqueyvhJ3X5rsR6 HkoNKmgI5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACZytZ1hwY2n76tEb7vN/rPp yvlX6jurdtq4LGeY77MjkrnytXTXFqv7Z/8JS2mdC+MqBQA= 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: deny offload of tc-based TSN features on VF interfaces TSN features on the ENETC (taprio, cbs, gate, police) are configured through a mix of command BD ring messages and port registers: enetc_port_rd(), enetc_port_wr(). Port registers are a region of the ENETC memory map which are only accessible from the PCIe Physical Function. They are not accessible from the Virtual Functions. Moreover, attempting to access these registers crashes the kernel: $ echo 1 > /sys/bus/pci/devices/0000\:00\:00.0/sriov_numvfs pci 0000:00:01.0: [1957:ef00] type 00 class 0x020001 fsl_enetc_vf 0000:00:01.0: Adding to iommu group 15 fsl_enetc_vf 0000:00:01.0: enabling device (0000 -> 0002) fsl_enetc_vf 0000:00:01.0 eno0vf0: renamed from eth0 $ tc qdisc replace dev eno0vf0 root taprio num_tc 8 map 0 1 2 3 4 5 6 7 \ queues 1@0 1@1 1@2 1@3 1@4 1@5 1@6 1@7 base-time 0 \ sched-entry S 0x7f 900000 sched-entry S 0x80 100000 flags 0x2 Unable to handle kernel paging request at virtual address ffff800009551a08 Internal error: Oops: 96000007 [#1] PREEMPT SMP pc : enetc_setup_tc_taprio+0x170/0x47c lr : enetc_setup_tc_taprio+0x16c/0x47c Call trace: enetc_setup_tc_taprio+0x170/0x47c enetc_setup_tc+0x38/0x2dc taprio_change+0x43c/0x970 taprio_init+0x188/0x1e0 qdisc_create+0x114/0x470 tc_modify_qdisc+0x1fc/0x6c0 rtnetlink_rcv_msg+0x12c/0x390 Split enetc_setup_tc() into separate functions for the PF and for the VF drivers. Also remove enetc_qos.o from being included into enetc-vf.ko, since it serves absolutely no purpose there. The Linux kernel CVE team has assigned CVE-2022-48645 to this issue. Affected and fixed versions =========================== Issue introduced in 5.5 with commit 34c6adf1977b and fixed in 5.15.71 with commit 510e703e4ed0 Issue introduced in 5.5 with commit 34c6adf1977b and fixed in 5.19.12 with commit 23022b74b1a2 Issue introduced in 5.5 with commit 34c6adf1977b and fixed in 6.0 with commit 5641c751fe2f 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-2022-48645 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/Makefile drivers/net/ethernet/freescale/enetc/enetc.c drivers/net/ethernet/freescale/enetc/enetc.h drivers/net/ethernet/freescale/enetc/enetc_pf.c drivers/net/ethernet/freescale/enetc/enetc_vf.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/510e703e4ed0e011db860bc21228aff48fc9eea7 https://git.kernel.org/stable/c/23022b74b1a23bed044f6bc96cf92f6ca5f3e75f https://git.kernel.org/stable/c/5641c751fe2f92d3d9e8a8e03c1263ac8caa0b42