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 8B70C17F517 for ; Thu, 30 May 2024 15:29:40 +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=1717082980; cv=none; b=TNTMroheIZyR7xihSnz0rD7pS6ubPzMN7rbAe7KvPstDwhHuInTZhZHsANKrxr1rx4qpsNdeiswaE1BMhZ5SGHAANBo2hCYUskVAoZQWyX8TDBqJk2DWdHfKWaBeEwpxXbwYrR1BA5xJlEJ1bO1sorDOYdBuq4PPxZxZofJOySg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717082980; c=relaxed/simple; bh=AtxmQYtnYB7uKH0c2ZlA7kwVvPpGJZl7tnuy7e3RDIg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=u2u6TqnP4vFiAcbZ/vgZ79MozZGEmA7sL/MAqmsepJVx6otrx73dtpF0U01kRJhypUDWVx8XCITYCkZu2g6q2kcukWvs6CxyxJq3eTOXehyfGEANFyX4H+pnXlTwDWj8fcgDGLYYuHKykXwJTxjN7JX/PUB6pc12H14Vr1APl0Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yDJt5mCX; 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="yDJt5mCX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FE36C2BBFC; Thu, 30 May 2024 15:29:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1717082980; bh=AtxmQYtnYB7uKH0c2ZlA7kwVvPpGJZl7tnuy7e3RDIg=; h=From:To:Cc:Subject:Date:Reply-to:From; b=yDJt5mCXhpzGswRCJ36wPlYJgjry11bNDUw8jsHB3pDSmj4O4vk0j3+UJXEeuecEx LMoYyylDZ8eHkJ3rECwTIZoWMeJvYNALr3tlDqaS4tslCCyxBLY9/Lq45GYfKnekk0 gCsPzYwRXjjFg2JoHHEGtOwRxxOoOr2lPs9vD5r4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-36884: iommu/arm-smmu: Use the correct type in nvidia_smmu_context_fault() Date: Thu, 30 May 2024 17:28:36 +0200 Message-ID: <2024053032-CVE-2024-36884-c00b@gregkh> X-Mailer: git-send-email 2.45.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=4864; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=AtxmQYtnYB7uKH0c2ZlA7kwVvPpGJZl7tnuy7e3RDIg=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkRsxWstljkpR+KXvQ8rvvWKYsTfwwezGFhucUqHrJ5C 6f4/54HHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAnCTrRkWLJHe2uPQqJm+5lW1 tlTQb9v3sULiDHN4p7jPa7z6VHlCkyzzuocr1a16z+QCAA== 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: iommu/arm-smmu: Use the correct type in nvidia_smmu_context_fault() This was missed because of the function pointer indirection. nvidia_smmu_context_fault() is also installed as a irq function, and the 'void *' was changed to a struct arm_smmu_domain. Since the iommu_domain is embedded at a non-zero offset this causes nvidia_smmu_context_fault() to miscompute the offset. Fixup the types. Unable to handle kernel NULL pointer dereference at virtual address 0000000000000120 Mem abort info: ESR = 0x0000000096000004 EC = 0x25: DABT (current EL), IL = 32 bits SET = 0, FnV = 0 EA = 0, S1PTW = 0 FSC = 0x04: level 0 translation fault Data abort info: ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000 CM = 0, WnR = 0, TnD = 0, TagAccess = 0 GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 user pgtable: 4k pages, 48-bit VAs, pgdp=0000000107c9f000 [0000000000000120] pgd=0000000000000000, p4d=0000000000000000 Internal error: Oops: 0000000096000004 [#1] SMP Modules linked in: CPU: 1 PID: 47 Comm: kworker/u25:0 Not tainted 6.9.0-0.rc7.58.eln136.aarch64 #1 Hardware name: Unknown NVIDIA Jetson Orin NX/NVIDIA Jetson Orin NX, BIOS 3.1-32827747 03/19/2023 Workqueue: events_unbound deferred_probe_work_func pstate: 604000c9 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : nvidia_smmu_context_fault+0x1c/0x158 lr : __free_irq+0x1d4/0x2e8 sp : ffff80008044b6f0 x29: ffff80008044b6f0 x28: ffff000080a60b18 x27: ffffd32b5172e970 x26: 0000000000000000 x25: ffff0000802f5aac x24: ffff0000802f5a30 x23: ffff0000802f5b60 x22: 0000000000000057 x21: 0000000000000000 x20: ffff0000802f5a00 x19: ffff000087d4cd80 x18: ffffffffffffffff x17: 6234362066666666 x16: 6630303078302d30 x15: ffff00008156d888 x14: 0000000000000000 x13: ffff0000801db910 x12: ffff00008156d6d0 x11: 0000000000000003 x10: ffff0000801db918 x9 : ffffd32b50f94d9c x8 : 1fffe0001032fda1 x7 : ffff00008197ed00 x6 : 000000000000000f x5 : 000000000000010e x4 : 000000000000010e x3 : 0000000000000000 x2 : ffffd32b51720cd8 x1 : ffff000087e6f700 x0 : 0000000000000057 Call trace: nvidia_smmu_context_fault+0x1c/0x158 __free_irq+0x1d4/0x2e8 free_irq+0x3c/0x80 devm_free_irq+0x64/0xa8 arm_smmu_domain_free+0xc4/0x158 iommu_domain_free+0x44/0xa0 iommu_deinit_device+0xd0/0xf8 __iommu_group_remove_device+0xcc/0xe0 iommu_bus_notifier+0x64/0xa8 notifier_call_chain+0x78/0x148 blocking_notifier_call_chain+0x4c/0x90 bus_notify+0x44/0x70 device_del+0x264/0x3e8 pci_remove_bus_device+0x84/0x120 pci_remove_root_bus+0x5c/0xc0 dw_pcie_host_deinit+0x38/0xe0 tegra_pcie_config_rp+0xc0/0x1f0 tegra_pcie_dw_probe+0x34c/0x700 platform_probe+0x70/0xe8 really_probe+0xc8/0x3a0 __driver_probe_device+0x84/0x160 driver_probe_device+0x44/0x130 __device_attach_driver+0xc4/0x170 bus_for_each_drv+0x90/0x100 __device_attach+0xa8/0x1c8 device_initial_probe+0x1c/0x30 bus_probe_device+0xb0/0xc0 deferred_probe_work_func+0xbc/0x120 process_one_work+0x194/0x490 worker_thread+0x284/0x3b0 kthread+0xf4/0x108 ret_from_fork+0x10/0x20 Code: a9b97bfd 910003fd a9025bf5 f85a0035 (b94122a1) The Linux kernel CVE team has assigned CVE-2024-36884 to this issue. Affected and fixed versions =========================== Issue introduced in 6.8 with commit e0976331ad11 and fixed in 6.8.10 with commit e83de8f05b99 Issue introduced in 6.8 with commit e0976331ad11 and fixed in 6.9 with commit 65ade5653f5a 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-36884 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/iommu/arm/arm-smmu/arm-smmu-nvidia.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/e83de8f05b998e227b48cdeea54cba4c9d66d3aa https://git.kernel.org/stable/c/65ade5653f5ab5a21635e51d0c65e95f490f5b6f