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 061FF18E025 for ; Mon, 8 Dec 2025 01:17:17 +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=1765156638; cv=none; b=RrtPKS4Rv4kclfTzsqAE4ufVDDgj7ySryy/Zy5wbzfIID0ioDuWqeFV+B+S8M/XCegbWO4EGTNvwW4dq+ZtZIUiUyVdhUjsvuxMWUulQ4ZDowyqfEQmSRv9XKHRPCqEknGsxH3xBCyS1Rcm6SA1Kl518F+wzNJSJyyPU2LWZ4XQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765156638; c=relaxed/simple; bh=bXLSNPoEEafGbrHhtZtdYEff4OY+p+MOtSbUwECYWrw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=J21svAmSKa7h6Vyv9/LP3nyZiNmiSP/ftHa0PpMN4xl36VzBhcBipaIIg5FGxGtNqHndC2LSgJgRCTv9p3do60pThzK2iwjkAVCjWIHMxem7mS/XKmgbil1YD29ooFLc3ELq45FuLiqCmr5/G4THAj//ht2tuLM/ieGcZymNnt4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Jjtnzygs; 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="Jjtnzygs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C7AFC4CEFB; Mon, 8 Dec 2025 01:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765156637; bh=bXLSNPoEEafGbrHhtZtdYEff4OY+p+MOtSbUwECYWrw=; h=From:To:Cc:Subject:Date:Reply-To:From; b=JjtnzygsuM88BvPdoazhZgmLCVRjxfKWTVEkieQp7ASVOeuHeR0geG7AOu3Md6RZG keoovSEVQSO9cZT/97W5VJGggl2oMrzMsSk4sIxRRdo8WCKq9HK81zINy4Di+cqFB8 XhfXOeu4ked1Tnk6++3q3m5QmAGzrMVUibFHf9QA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50628: drm/gud: Fix UBSAN warning Date: Mon, 8 Dec 2025 10:17:05 +0900 Message-ID: <2025120854-CVE-2022-50628-69d3@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4191; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=4st8rLrsZdz3YrfmKbPPBdxM2wplumUXGKtPut0scRo=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlm6mw9u/YLMPY/KcoInp+kamrtdFWMWUPP+zUrp0GxR uTtmK0dsSwMgkwMsmKKLF+28RzdX3FI0cvQ9jTMHFYmkCEMXJwCMJGKfwzzLHPWs5Q7ZkbXtO/7 Zh0t/eDbjlM+DPOdmeN/lr69xPwwS/1eKucq14TXW84CAA== 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: drm/gud: Fix UBSAN warning UBSAN complains about invalid value for bool: [ 101.165172] [drm] Initialized gud 1.0.0 20200422 for 2-3.2:1.0 on minor 1 [ 101.213360] gud 2-3.2:1.0: [drm] fb1: guddrmfb frame buffer device [ 101.213426] usbcore: registered new interface driver gud [ 101.989431] ================================================================================ [ 101.989441] UBSAN: invalid-load in linux/include/linux/iosys-map.h:253:9 [ 101.989447] load of value 121 is not a valid value for type '_Bool' [ 101.989451] CPU: 1 PID: 455 Comm: kworker/1:6 Not tainted 5.18.0-rc5-gud-5.18-rc5 #3 [ 101.989456] Hardware name: Hewlett-Packard HP EliteBook 820 G1/1991, BIOS L71 Ver. 01.44 04/12/2018 [ 101.989459] Workqueue: events_long gud_flush_work [gud] [ 101.989471] Call Trace: [ 101.989474] [ 101.989479] dump_stack_lvl+0x49/0x5f [ 101.989488] dump_stack+0x10/0x12 [ 101.989493] ubsan_epilogue+0x9/0x3b [ 101.989498] __ubsan_handle_load_invalid_value.cold+0x44/0x49 [ 101.989504] dma_buf_vmap.cold+0x38/0x3d [ 101.989511] ? find_busiest_group+0x48/0x300 [ 101.989520] drm_gem_shmem_vmap+0x76/0x1b0 [drm_shmem_helper] [ 101.989528] drm_gem_shmem_object_vmap+0x9/0xb [drm_shmem_helper] [ 101.989535] drm_gem_vmap+0x26/0x60 [drm] [ 101.989594] drm_gem_fb_vmap+0x47/0x150 [drm_kms_helper] [ 101.989630] gud_prep_flush+0xc1/0x710 [gud] [ 101.989639] ? _raw_spin_lock+0x17/0x40 [ 101.989648] gud_flush_work+0x1e0/0x430 [gud] [ 101.989653] ? __switch_to+0x11d/0x470 [ 101.989664] process_one_work+0x21f/0x3f0 [ 101.989673] worker_thread+0x200/0x3e0 [ 101.989679] ? rescuer_thread+0x390/0x390 [ 101.989684] kthread+0xfd/0x130 [ 101.989690] ? kthread_complete_and_exit+0x20/0x20 [ 101.989696] ret_from_fork+0x22/0x30 [ 101.989706] [ 101.989708] ================================================================================ The source of this warning is in iosys_map_clear() called from dma_buf_vmap(). It conditionally sets values based on map->is_iomem. The iosys_map variables are allocated uninitialized on the stack leading to ->is_iomem having all kinds of values and not only 0/1. Fix this by zeroing the iosys_map variables. The Linux kernel CVE team has assigned CVE-2022-50628 to this issue. Affected and fixed versions =========================== Issue introduced in 5.13 with commit 40e1a70b4aedf2859a1829991b48ef0ebe650bf2 and fixed in 6.1.16 with commit 832f861a46039d50536dcfda0a9fb334b48d0f8b Issue introduced in 5.13 with commit 40e1a70b4aedf2859a1829991b48ef0ebe650bf2 and fixed in 6.2.3 with commit e1078b270d218f8d58efb4d78ea25a4d16ba3490 Issue introduced in 5.13 with commit 40e1a70b4aedf2859a1829991b48ef0ebe650bf2 and fixed in 6.3 with commit 951df98024f7272f85df5044eca7374f5b5b24ef 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-50628 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/gud/gud_pipe.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/832f861a46039d50536dcfda0a9fb334b48d0f8b https://git.kernel.org/stable/c/e1078b270d218f8d58efb4d78ea25a4d16ba3490 https://git.kernel.org/stable/c/951df98024f7272f85df5044eca7374f5b5b24ef