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 97117267B89 for ; Tue, 19 Aug 2025 17:19:56 +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=1755623996; cv=none; b=Aq6r536wO2bx3ujtWd1ycnUISL9Lxabm79yFjuH6B+KTRls4iDvMZ5jzKTlJBJmFWRKthSWC8TjYg9jNPtIECtg43x6BV7i/ivmiDDkz64sKnQqii5ULaVJMmEZf2LdpaASKhIOf84E05oQrWS6aiLo8EBcC4nbt5fxeL517gRg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755623996; c=relaxed/simple; bh=ekdAb88I6NSMimIccLZuUY2BOOhPww2gSrKpoy856UM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nhCiU1viqqjJgUSd4CCowjR8Vt1wOA87CslLIYFbDyCCoYj5K+AiaZAOI9Amt70158b5nyEXe3ZWpZrtQABf0LqNcPfpdbwIWwJCHYHEveV4wTb4YPhMEtMdKgFbhNXjdBURtLrYSA8EAgezTkSghEeKhqN/BBrPas2KSPI0Iss= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=vbSN99LL; 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="vbSN99LL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 093A1C4CEF1; Tue, 19 Aug 2025 17:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1755623996; bh=ekdAb88I6NSMimIccLZuUY2BOOhPww2gSrKpoy856UM=; h=From:To:Cc:Subject:Date:Reply-to:From; b=vbSN99LLtsVTNqGKyeVqWBDHNSP9nV06Bsk+J7AkYYZhKi7RLNjoQnABjDrXLdDls cWCNKfu0c6c8TWK4i9h85UJ5/EIM/VArQZv9QK4cCwjq2Ciu4gfi6UI/Hv7dhV+IEE QTX/nycjeRn8N3GStOPXyodSuC+lK6OU0mjV3iII= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38558: usb: gadget: uvc: Initialize frame-based format color matching descriptor Date: Tue, 19 Aug 2025 19:18:05 +0200 Message-ID: <2025081906-CVE-2025-38558-86a7@gregkh> X-Mailer: git-send-email 2.50.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=5560; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=88Cm7poK/0bLPRflfBPtv8pBEwJG/+CpLyIvxKT7ic0=; b=owGbwMvMwCRo6H6F97bub03G02pJDBlLNp67L3D8bMr3A2ICbu4eYQxODYorri35uLpe6+MXz wnGup9qO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi/9oY5mnoCR8uaVnnrRSx 78HMFIa+96K9ExnmKW4QK86fcebC/TjDLUWXpr+bxFtmDAA= 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: usb: gadget: uvc: Initialize frame-based format color matching descriptor Fix NULL pointer crash in uvcg_framebased_make due to uninitialized color matching descriptor for frame-based format which was added in commit f5e7bdd34aca ("usb: gadget: uvc: Allow creating new color matching descriptors") that added handling for uncompressed and mjpeg format. Crash is seen when userspace configuration (via configfs) does not explicitly define the color matching descriptor. If color_matching is not found, config_group_find_item() returns NULL. The code then jumps to out_put_cm, where it calls config_item_put(color_matching);. If color_matching is NULL, this will dereference a null pointer, leading to a crash. [ 2.746440] Unable to handle kernel NULL pointer dereference at virtual address 000000000000008c [ 2.756273] Mem abort info: [ 2.760080] ESR = 0x0000000096000005 [ 2.764872] EC = 0x25: DABT (current EL), IL = 32 bits [ 2.771068] SET = 0, FnV = 0 [ 2.771069] EA = 0, S1PTW = 0 [ 2.771070] FSC = 0x05: level 1 translation fault [ 2.771071] Data abort info: [ 2.771072] ISV = 0, ISS = 0x00000005, ISS2 = 0x00000000 [ 2.771073] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 [ 2.771074] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 [ 2.771075] user pgtable: 4k pages, 39-bit VAs, pgdp=00000000a3e59000 [ 2.771077] [000000000000008c] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000 [ 2.771081] Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP [ 2.771084] Dumping ftrace buffer: [ 2.771085] (ftrace buffer empty) [ 2.771138] CPU: 7 PID: 486 Comm: ln Tainted: G W E 6.6.58-android15 [ 2.771139] Hardware name: Qualcomm Technologies, Inc. SunP QRD HDK (DT) [ 2.771140] pstate: 61400005 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) [ 2.771141] pc : __uvcg_fill_strm+0x198/0x2cc [ 2.771145] lr : __uvcg_iter_strm_cls+0xc8/0x17c [ 2.771146] sp : ffffffc08140bbb0 [ 2.771146] x29: ffffffc08140bbb0 x28: ffffff803bc81380 x27: ffffff8023bbd250 [ 2.771147] x26: ffffff8023bbd250 x25: ffffff803c361348 x24: ffffff803d8e6768 [ 2.771148] x23: 0000000000000004 x22: 0000000000000003 x21: ffffffc08140bc48 [ 2.771149] x20: 0000000000000000 x19: ffffffc08140bc48 x18: ffffffe9f8cf4a00 [ 2.771150] x17: 000000001bf64ec3 x16: 000000001bf64ec3 x15: ffffff8023bbd250 [ 2.771151] x14: 000000000000000f x13: 004c4b40000f4240 x12: 000a2c2a00051615 [ 2.771152] x11: 000000000000004f x10: ffffffe9f76b40ec x9 : ffffffe9f7e389d0 [ 2.771153] x8 : ffffff803d0d31ce x7 : 000f4240000a2c2a x6 : 0005161500028b0a [ 2.771154] x5 : ffffff803d0d31ce x4 : 0000000000000003 x3 : 0000000000000000 [ 2.771155] x2 : ffffffc08140bc50 x1 : ffffffc08140bc48 x0 : 0000000000000000 [ 2.771156] Call trace: [ 2.771157] __uvcg_fill_strm+0x198/0x2cc [ 2.771157] __uvcg_iter_strm_cls+0xc8/0x17c [ 2.771158] uvcg_streaming_class_allow_link+0x240/0x290 [ 2.771159] configfs_symlink+0x1f8/0x630 [ 2.771161] vfs_symlink+0x114/0x1a0 [ 2.771163] do_symlinkat+0x94/0x28c [ 2.771164] __arm64_sys_symlinkat+0x54/0x70 [ 2.771164] invoke_syscall+0x58/0x114 [ 2.771166] el0_svc_common+0x80/0xe0 [ 2.771168] do_el0_svc+0x1c/0x28 [ 2.771169] el0_svc+0x3c/0x70 [ 2.771172] el0t_64_sync_handler+0x68/0xbc [ 2.771173] el0t_64_sync+0x1a8/0x1ac Initialize color matching descriptor for frame-based format to prevent NULL pointer crash by mirroring the handling done for uncompressed and mjpeg formats. The Linux kernel CVE team has assigned CVE-2025-38558 to this issue. Affected and fixed versions =========================== Issue introduced in 6.13 with commit 7b5a58952fc3b51905c2963647485565df1e5e26 and fixed in 6.15.10 with commit 6db61c1aa23075eeee90e083ca3f6567a5635da6 Issue introduced in 6.13 with commit 7b5a58952fc3b51905c2963647485565df1e5e26 and fixed in 6.16.1 with commit 7f8576fc9d1a203d12474bf52710c7af68cae490 Issue introduced in 6.13 with commit 7b5a58952fc3b51905c2963647485565df1e5e26 and fixed in 6.17-rc1 with commit 323a80a1a5ace319a722909c006d5bdb2a35d273 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-2025-38558 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/usb/gadget/function/uvc_configfs.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/6db61c1aa23075eeee90e083ca3f6567a5635da6 https://git.kernel.org/stable/c/7f8576fc9d1a203d12474bf52710c7af68cae490 https://git.kernel.org/stable/c/323a80a1a5ace319a722909c006d5bdb2a35d273