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 D023A218E82 for ; Wed, 26 Feb 2025 02:15:27 +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=1740536127; cv=none; b=WcXN28hi/29p6+YuQ6ovnF/qshyLcRxXB+C0FS1rJgBBExQLA+NJi+EJheGWLG1hmwFonYwdYVCyjCb20bH/3DWi+oOhBifTGVuz0NiU22rX1v1RdKVHvDQ8ZxLSo+V7jXr6ZVEWM8nyX/yP34LHF2RpbFIXgCgcr4DXP7jcCa0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536127; c=relaxed/simple; bh=Vofz333HS3DwAkIOu7JpJ92bE7TgBfy9NkIUrmGtU+g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=A5Rpm/S486fqmQskX2K6R/MV/9CYaDkLKvVGA5EZIgVVY0f0bV3Y/tJxo2hn+cyUh7RqP5yv/wWTR5JYdRoPW3DzVtldzNSZLBVjCcf4AlKTQmvXEMqHM2KmpAEtARrS7lHi1noVi5Ed4cae3bxYoS7yMJowDkMCcPwNk8D0YM0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SPwC8le7; 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="SPwC8le7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5D2CC4CEDD; Wed, 26 Feb 2025 02:15:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536127; bh=Vofz333HS3DwAkIOu7JpJ92bE7TgBfy9NkIUrmGtU+g=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SPwC8le7Pe0KXLQX6Qiineeqnw4viVMipJ1t4/iRoeJ0XoyT28yRj+gmPyqKqWoaX QqNt/D7gddQ6q+mjHvXgaWjzG8xTdJ31cCI6AppVlJnxm6wbdOmdn0S3b9yV5emLh9 aKxRDJIXKd/q68yCa0XvJXwqJ43GThYPZVUagwP8= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49532: drm/virtio: fix NULL pointer dereference in virtio_gpu_conn_get_modes Date: Wed, 26 Feb 2025 03:13:26 +0100 Message-ID: <2025022613-CVE-2022-49532-1e14@gregkh> X-Mailer: git-send-email 2.48.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=5190; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Vofz333HS3DwAkIOu7JpJ92bE7TgBfy9NkIUrmGtU+g=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7Klinhn3axnS7wvrrryNhHre6In8bGR3lKXqwYEbzn 42O+8XfdMSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEKj0ZFuxZahg1TUx4XWt0 fkr5r5XfrvmqnmaYzbbvxE7bO/6V67k4lJIt+bSWVW5jBwA= 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: drm/virtio: fix NULL pointer dereference in virtio_gpu_conn_get_modes drm_cvt_mode may return NULL and we should check it. This bug is found by syzkaller: FAULT_INJECTION stacktrace: [ 168.567394] FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 1 [ 168.567403] CPU: 1 PID: 6425 Comm: syz Kdump: loaded Not tainted 4.19.90-vhulk2201.1.0.h1035.kasan.eulerosv2r10.aarch64 #1 [ 168.567406] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 [ 168.567408] Call trace: [ 168.567414] dump_backtrace+0x0/0x310 [ 168.567418] show_stack+0x28/0x38 [ 168.567423] dump_stack+0xec/0x15c [ 168.567427] should_fail+0x3ac/0x3d0 [ 168.567437] __should_failslab+0xb8/0x120 [ 168.567441] should_failslab+0x28/0xc0 [ 168.567445] kmem_cache_alloc_trace+0x50/0x640 [ 168.567454] drm_mode_create+0x40/0x90 [ 168.567458] drm_cvt_mode+0x48/0xc78 [ 168.567477] virtio_gpu_conn_get_modes+0xa8/0x140 [virtio_gpu] [ 168.567485] drm_helper_probe_single_connector_modes+0x3a4/0xd80 [ 168.567492] drm_mode_getconnector+0x2e0/0xa70 [ 168.567496] drm_ioctl_kernel+0x11c/0x1d8 [ 168.567514] drm_ioctl+0x558/0x6d0 [ 168.567522] do_vfs_ioctl+0x160/0xf30 [ 168.567525] ksys_ioctl+0x98/0xd8 [ 168.567530] __arm64_sys_ioctl+0x50/0xc8 [ 168.567536] el0_svc_common+0xc8/0x320 [ 168.567540] el0_svc_handler+0xf8/0x160 [ 168.567544] el0_svc+0x10/0x218 KASAN stacktrace: [ 168.567561] BUG: KASAN: null-ptr-deref in virtio_gpu_conn_get_modes+0xb4/0x140 [virtio_gpu] [ 168.567565] Read of size 4 at addr 0000000000000054 by task syz/6425 [ 168.567566] [ 168.567571] CPU: 1 PID: 6425 Comm: syz Kdump: loaded Not tainted 4.19.90-vhulk2201.1.0.h1035.kasan.eulerosv2r10.aarch64 #1 [ 168.567573] Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015 [ 168.567575] Call trace: [ 168.567578] dump_backtrace+0x0/0x310 [ 168.567582] show_stack+0x28/0x38 [ 168.567586] dump_stack+0xec/0x15c [ 168.567591] kasan_report+0x244/0x2f0 [ 168.567594] __asan_load4+0x58/0xb0 [ 168.567607] virtio_gpu_conn_get_modes+0xb4/0x140 [virtio_gpu] [ 168.567612] drm_helper_probe_single_connector_modes+0x3a4/0xd80 [ 168.567617] drm_mode_getconnector+0x2e0/0xa70 [ 168.567621] drm_ioctl_kernel+0x11c/0x1d8 [ 168.567624] drm_ioctl+0x558/0x6d0 [ 168.567628] do_vfs_ioctl+0x160/0xf30 [ 168.567632] ksys_ioctl+0x98/0xd8 [ 168.567636] __arm64_sys_ioctl+0x50/0xc8 [ 168.567641] el0_svc_common+0xc8/0x320 [ 168.567645] el0_svc_handler+0xf8/0x160 [ 168.567649] el0_svc+0x10/0x218 The Linux kernel CVE team has assigned CVE-2022-49532 to this issue. Affected and fixed versions =========================== Fixed in 4.9.318 with commit e0828456578cc8ba0a69147f7ae3428392eec287 Fixed in 4.14.283 with commit 848dd072744ea662ab3097e3c8282bee552df218 Fixed in 4.19.247 with commit edafcad84c4134ebec4bc24b29ca4497a1184eea Fixed in 5.4.198 with commit f85cb059fad03a3b33a50023be91e944bb065ae8 Fixed in 5.10.121 with commit fadc626cae99aaa1325094edc6a9e2b883f3e562 Fixed in 5.15.46 with commit 32e10aabc287f09a148ff759bb9ce70b01b0012c Fixed in 5.17.14 with commit c51d00472fa54b9b05c17789ed665c17adf3a25d Fixed in 5.18.3 with commit 0f8bc147a963686b7351aa35d1701124ffacac08 Fixed in 5.19 with commit 194d250cdc4a40ccbd179afd522a9e9846957402 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-49532 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/gpu/drm/virtio/virtgpu_display.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/e0828456578cc8ba0a69147f7ae3428392eec287 https://git.kernel.org/stable/c/848dd072744ea662ab3097e3c8282bee552df218 https://git.kernel.org/stable/c/edafcad84c4134ebec4bc24b29ca4497a1184eea https://git.kernel.org/stable/c/f85cb059fad03a3b33a50023be91e944bb065ae8 https://git.kernel.org/stable/c/fadc626cae99aaa1325094edc6a9e2b883f3e562 https://git.kernel.org/stable/c/32e10aabc287f09a148ff759bb9ce70b01b0012c https://git.kernel.org/stable/c/c51d00472fa54b9b05c17789ed665c17adf3a25d https://git.kernel.org/stable/c/0f8bc147a963686b7351aa35d1701124ffacac08 https://git.kernel.org/stable/c/194d250cdc4a40ccbd179afd522a9e9846957402