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 67DCB1CAA7A for ; Thu, 27 Mar 2025 16:44:12 +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=1743093852; cv=none; b=Wkkx8bfhd1A1BOlla5h6Kif0+R2Xw58SPBUIoSWuqzkalSQFFVs1sm/3ocoFmbI+0UfDufPf9N/Yof5cF6RhKAkELWTwVbdVjox2anA8go1lZi9yEMwnGGlgr8OeO6Zg3uDpMzatkgdzy6U4uO9KUbghz6ubxnP5VWuYUgDaJKI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743093852; c=relaxed/simple; bh=bn+K/qQ34P+N35R//jQxnhZyuWUiYdmHWGtt2h5bnAc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DDylvcOg2+trRHvcHNkOFO6VthUJjH6Cv3FcpEdCoFb9yxZV3mvLKuzf5/EUfR/qeXN2tGvmAkqO8zQAVOwhqUAoGoeg78vzRJ9Ypyn7YUR3GZ/B7MsZf4A+B41MMV6RDV6g+R+Yvg9juwG30+xX45nC5E3nWWtR6pLDBOTuPtw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=v/xBHU4m; 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="v/xBHU4m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 696EDC4CEDD; Thu, 27 Mar 2025 16:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1743093851; bh=bn+K/qQ34P+N35R//jQxnhZyuWUiYdmHWGtt2h5bnAc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=v/xBHU4mcX1QtpwZpPdiBNa4HBPnRMm3senpD1DWRDS19jtGdaLq267Wg/zSVL0Ut eoMh8wpYhn/9QNFNe0INUcjzPwmFEPxV2DJckVCk3XwiRC3o3avPTR8nSGEfK9Umjz +mkrm5FNUf56I9xf9IS43auz5T/MvdrvmvPbT5cE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49741: fbdev: smscufx: fix error handling code in ufx_usb_probe Date: Thu, 27 Mar 2025 17:42:59 +0100 Message-ID: <2025032757-CVE-2022-49741-65a7@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=4406; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=bn+K/qQ34P+N35R//jQxnhZyuWUiYdmHWGtt2h5bnAc=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlPGwTrl9mrVorq2vC6bvS4dyiPcanSgsWPD3rMnLcpm e/nJlvHjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhIWxPDgu49Uh8WbusV1tm5 66LBLKZHK6NWfWdYcNjbY6878yF9u6KXHD6TfT38ZxdwAwA= 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: fbdev: smscufx: fix error handling code in ufx_usb_probe The current error handling code in ufx_usb_probe have many unmatching issues, e.g., missing ufx_free_usb_list, destroy_modedb label should only include framebuffer_release, fb_dealloc_cmap only matches fb_alloc_cmap. My local syzkaller reports a memory leak bug: memory leak in ufx_usb_probe BUG: memory leak unreferenced object 0xffff88802f879580 (size 128): comm "kworker/0:7", pid 17416, jiffies 4295067474 (age 46.710s) hex dump (first 32 bytes): 80 21 7c 2e 80 88 ff ff 18 d0 d0 0c 80 88 ff ff .!|............. 00 d0 d0 0c 80 88 ff ff e0 ff ff ff 0f 00 00 00 ................ backtrace: [] kmalloc_trace+0x20/0x90 mm/slab_common.c:1045 [] kmalloc include/linux/slab.h:553 [inline] [] kzalloc include/linux/slab.h:689 [inline] [] ufx_alloc_urb_list drivers/video/fbdev/smscufx.c:1873 [inline] [] ufx_usb_probe+0x11c/0x15a0 drivers/video/fbdev/smscufx.c:1655 [] usb_probe_interface+0x177/0x370 drivers/usb/core/driver.c:396 [] call_driver_probe drivers/base/dd.c:560 [inline] [] really_probe+0x12d/0x390 drivers/base/dd.c:639 [] __driver_probe_device+0xbf/0x140 drivers/base/dd.c:778 [] driver_probe_device+0x2a/0x120 drivers/base/dd.c:808 [] __device_attach_driver+0xf7/0x150 drivers/base/dd.c:936 [] bus_for_each_drv+0xb7/0x100 drivers/base/bus.c:427 [] __device_attach+0x105/0x2d0 drivers/base/dd.c:1008 [] bus_probe_device+0xc6/0xe0 drivers/base/bus.c:487 [] device_add+0x642/0xdc0 drivers/base/core.c:3517 [] usb_set_configuration+0x8ef/0xb80 drivers/usb/core/message.c:2170 [] usb_generic_driver_probe+0x8c/0xc0 drivers/usb/core/generic.c:238 [] usb_probe_device+0x5c/0x140 drivers/usb/core/driver.c:293 [] call_driver_probe drivers/base/dd.c:560 [inline] [] really_probe+0x12d/0x390 drivers/base/dd.c:639 [] __driver_probe_device+0xbf/0x140 drivers/base/dd.c:778 Fix this bug by rewriting the error handling code in ufx_usb_probe. The Linux kernel CVE team has assigned CVE-2022-49741 to this issue. Affected and fixed versions =========================== Fixed in 5.4.232 with commit 3b3d3127f5b4291ae4caaf50f7b66089ad600480 Fixed in 5.10.168 with commit 3931014367ef31d26af65386a4ca496f50f0cfdf Fixed in 5.15.93 with commit 64fa364ad3245508d393e16ed4886f92d7eb423c Fixed in 6.1.11 with commit 1b4c08844628dfc8d72d3f51b657f2a5e63b7b4b Fixed in 6.2 with commit b76449ee75e21acfe9fa4c653d8598f191ed7d68 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-49741 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/video/fbdev/smscufx.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/3b3d3127f5b4291ae4caaf50f7b66089ad600480 https://git.kernel.org/stable/c/3931014367ef31d26af65386a4ca496f50f0cfdf https://git.kernel.org/stable/c/64fa364ad3245508d393e16ed4886f92d7eb423c https://git.kernel.org/stable/c/1b4c08844628dfc8d72d3f51b657f2a5e63b7b4b https://git.kernel.org/stable/c/b76449ee75e21acfe9fa4c653d8598f191ed7d68