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 1D381286D7A for ; Wed, 18 Jun 2025 11:03: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=1750244620; cv=none; b=ZYvaAGGp/GW0R1s5K/5tOt7DyGGzd8wd6TswfTitu77z9xL1jOHlmpGNjgBH/JjCrj7E9zbNHanod9GViJTPX4SmM0uZTnepKl9rzDOuJ3DFhPGTVxtX0uE5Zh2bxzEsCq1Rh1BJBnNg996ScWBFoIc5PdpgXRy+yFfauUx8kPo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750244620; c=relaxed/simple; bh=BsdS4Qp7tZ9ixFvc2A2Mnrry86+foQudNRsyoEHzFzk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kuIpPzY+rcj8/6JlrRZ4IGpwQsxGpI7ojhd1hMNpyoL8cFSh75DTIYWtAYWJXxUCtEvMgICVGl0v08XXBPUlssdSCaYNlCAQrRCyhAxD0xpqsDKu8rCUUT3lmwo0IbDoYX40UQ45QQRxzhgTHHsSE/EEIdyoyUTRqcjlti1MOIg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Rz7xzJYm; 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="Rz7xzJYm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9CCE8C4CEE7; Wed, 18 Jun 2025 11:03:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750244620; bh=BsdS4Qp7tZ9ixFvc2A2Mnrry86+foQudNRsyoEHzFzk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Rz7xzJYm6UkiTWm+0DBRE5HVQYwLmyVaOEyy0lXiQR66fIJapfO5+qWXelt9Nk6Kf O6NgHXAWQDtGvBap46hDQ1h0O78LIL8lLf2WKQJO1HWkXrV+Usjg9537nIcxVvoPh8 IdRHp3p7V1mGqUUMeo9S4ZatqV6Yvh4flteunyfw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49983: udmabuf: Set the DMA mask for the udmabuf device (v2) Date: Wed, 18 Jun 2025 13:00:48 +0200 Message-ID: <2025061821-CVE-2022-49983-dd32@gregkh> X-Mailer: git-send-email 2.49.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=4845; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Uawv2Z7S0RJx9rAygbgQ3sGCaGUb9oe9lVdqm5Iegw8=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlBc9zSpHZavEnI10/TX39ilblY2tSk6+aXxXq8S00iL J9uuC7eEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPh/siwYK3Gx7QDqzbWaXi4 hX9fvmr5tewZWgzz8/juHcni0zaNrz1ssMLlq3TyurkZAA== 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: udmabuf: Set the DMA mask for the udmabuf device (v2) If the DMA mask is not set explicitly, the following warning occurs when the userspace tries to access the dma-buf via the CPU as reported by syzbot here: WARNING: CPU: 1 PID: 3595 at kernel/dma/mapping.c:188 __dma_map_sg_attrs+0x181/0x1f0 kernel/dma/mapping.c:188 Modules linked in: CPU: 0 PID: 3595 Comm: syz-executor249 Not tainted 5.17.0-rc2-syzkaller-00316-g0457e5153e0e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:__dma_map_sg_attrs+0x181/0x1f0 kernel/dma/mapping.c:188 Code: 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 75 71 4c 8b 3d c0 83 b5 0d e9 db fe ff ff e8 b6 0f 13 00 0f 0b e8 af 0f 13 00 <0f> 0b 45 31 e4 e9 54 ff ff ff e8 a0 0f 13 00 49 8d 7f 50 48 b8 00 RSP: 0018:ffffc90002a07d68 EFLAGS: 00010293 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff88807e25e2c0 RSI: ffffffff81649e91 RDI: ffff88801b848408 RBP: ffff88801b848000 R08: 0000000000000002 R09: ffff88801d86c74f R10: ffffffff81649d72 R11: 0000000000000001 R12: 0000000000000002 R13: ffff88801d86c680 R14: 0000000000000001 R15: 0000000000000000 FS: 0000555556e30300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000200000cc CR3: 000000001d74a000 CR4: 00000000003506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: dma_map_sgtable+0x70/0xf0 kernel/dma/mapping.c:264 get_sg_table.isra.0+0xe0/0x160 drivers/dma-buf/udmabuf.c:72 begin_cpu_udmabuf+0x130/0x1d0 drivers/dma-buf/udmabuf.c:126 dma_buf_begin_cpu_access+0xfd/0x1d0 drivers/dma-buf/dma-buf.c:1164 dma_buf_ioctl+0x259/0x2b0 drivers/dma-buf/dma-buf.c:363 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl fs/ioctl.c:860 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f62fcf530f9 Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffe3edab9b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f62fcf530f9 RDX: 0000000020000200 RSI: 0000000040086200 RDI: 0000000000000006 RBP: 00007f62fcf170e0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f62fcf17170 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 v2: Dont't forget to deregister if DMA mask setup fails. The Linux kernel CVE team has assigned CVE-2022-49983 to this issue. Affected and fixed versions =========================== Fixed in 5.4.212 with commit 63d8c1933ed280717f934e2bc2edd869bb66f329 Fixed in 5.10.141 with commit 872875c9ecf8fa2e1d82bb2f2f1963f571aa8959 Fixed in 5.15.65 with commit e658538c610c6047b3c9f552e73801894d9284b1 Fixed in 5.19.7 with commit f2f6ea1a8da1317430a84701fc0170449ee88315 Fixed in 6.0 with commit 9e9fa6a9198b767b00f48160800128e83a038f9f 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-49983 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/dma-buf/udmabuf.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/63d8c1933ed280717f934e2bc2edd869bb66f329 https://git.kernel.org/stable/c/872875c9ecf8fa2e1d82bb2f2f1963f571aa8959 https://git.kernel.org/stable/c/e658538c610c6047b3c9f552e73801894d9284b1 https://git.kernel.org/stable/c/f2f6ea1a8da1317430a84701fc0170449ee88315 https://git.kernel.org/stable/c/9e9fa6a9198b767b00f48160800128e83a038f9f