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 1B9727F47F for ; Thu, 29 Feb 2024 13:36:02 +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=1709213763; cv=none; b=k9FNL5Z/J2HsdMZk+rrZgUeO6TGueUEAWR+HQU8GILtHJ8UTPlS35uQfDw2IF+FdUNA39g3aaf+NU9VU9Cgghq62eXzwmgFJuLjenL+NE29f8XHi9GGtzAH7eM+htqqDImkBj6MEZmo0F7AXj8R9U6dJRqjx9uXDUFm8wfT0FkM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709213763; c=relaxed/simple; bh=Pf/GcPm1aMgiuhJG/zONSib5rRzR7EQpiWrqJ1p4ofw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=X4tpW1g/djOyg8ujp6+2gdtvmgVjkk+joI6byiw/H3W0wbPdD/78a2Kbq/uBu9/S+mU3RmF/E6x12pHmK+LpmwGmlawKttq/+yY3q730Tno8xDwv14c2mh/ZozPlJOCy6jtGyyK8Uzuel6N2+NdnIUqzxn5lP3aGRssWeQ6CiRY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=U/5Vddr9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="U/5Vddr9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00F09C43390; Thu, 29 Feb 2024 13:36:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709213762; bh=Pf/GcPm1aMgiuhJG/zONSib5rRzR7EQpiWrqJ1p4ofw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=U/5Vddr9n81IdQ0yM7RV1GC0tAi4h+1ztyMStH3gBZrMcZLqOdVKPOdgX6qD2jo6K QkR/p38S1D+oDTjoPws6m9ZyYP7iSiV8NkPQEIR1GPgCpFuURNJXASmWHUGNb5in8r 5TRFI2hMb7cRXdVremW4llQM40Uelr5M4zkRas1Et+YDZmh0vqWb/laDYJZAOOhF4T dXTTjtFo/4htnNCf58xAJXYuFo7lq6tuSsCq4cK5nv7AYgBz75HS/LhXMxhCv5sPc+ 0zFm935TU2GtxZAVetfMOavzeaJ2grXH2mgOi7pA2YKJBtmvXSY9s3mV/17TgOKYC3 9dKV4GlcBc8hw== From: Lee Jones To: linux-cve-announce@vger.kernel.org Cc: Lee Jones Subject: CVE-2024-26607: drm/bridge: sii902x: Fix probing race issue Date: Thu, 29 Feb 2024 13:35:15 +0000 Message-ID: <20240229133514.1480195-2-lee@kernel.org> X-Mailer: git-send-email 2.44.0.rc1.240.g4c46232300-goog 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=4296; i=lee@kernel.org; h=from:subject; bh=Pf/GcPm1aMgiuhJG/zONSib5rRzR7EQpiWrqJ1p4ofw=; b=owEBbQKS/ZANAwAKAVGvii+H/HdhAcsmYgBl4IgSlUVLOo/UGOt532wUC0jt3apDCM8N0yyop 1LZUWCjU+2JAjMEAAEKAB0WIQR2tsk1o74gmpTwh0hRr4ovh/x3YQUCZeCIEgAKCRBRr4ovh/x3 YSWxD/oCUZ1PMCHmXQnYa25qt2YgvO19m2jLysA0f9L4z2m8CKKQJQiPyvvzTpkNkzH3KuZfBzA yaa4LytYClncpd3tMZ4gBBqiLXQTR4u0qkV1jj/zNKagaeDZIqMaEQcTks/7ZlO+fjyc1nz3WfS LrO4uJdyb0yWB2J7B8oK/+PjQkfO72+nmjLssLEtccgJG+WxBNgRlYn65gaJoneh01/w/jC6LWI 5xd8edDKvicViFv5tMu0hNJ5agnyz52F8wXAIuBwNJCEg2kqZcZCBnD2XtG6/hmHsiA7kNb6iQO bge3LLs8dL6IdCO9UBObtloC2RoPEmfNq/9v1+c9y1j2RZHRAdd2bMoWWi6qExgdPu45+lCOIGp DlCfwcKdDsicWig9N8pcSYcadX1Xj878r0WlUJrk3TM/MRF7dy0eMhOv5XOLjCDgdju1ypqadc4 quPT8oHb9nc9D9IM8zN998yBMCkfqOQSbmRxrSN9+29nDeYZld78MsD8SMPg4Kz8Z9YHoiVUl6a 8ajm9tqWdvuj6sQZ8H6TKjOQFRa0goUwh3M/wT6z79nNnufXd+mWuM7nPTRRMd3veesompKgT1v xkQbHE74lLgDiRoeZ67/yk9xmf4vvqZwW5MwZ0ZKr84CGJvZKPBreEq2/Lm0B3ja2LXoIO+wFd4 U9WfKQUsgP4BSzQ== X-Developer-Key: i=lee@kernel.org; a=openpgp; fpr=76B6C935A3BE209A94F0874851AF8A2F87FC7761 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: drm/bridge: sii902x: Fix probing race issue A null pointer dereference crash has been observed rarely on TI platforms using sii9022 bridge: [ 53.271356] sii902x_get_edid+0x34/0x70 [sii902x] [ 53.276066] sii902x_bridge_get_edid+0x14/0x20 [sii902x] [ 53.281381] drm_bridge_get_edid+0x20/0x34 [drm] [ 53.286305] drm_bridge_connector_get_modes+0x8c/0xcc [drm_kms_helper] [ 53.292955] drm_helper_probe_single_connector_modes+0x190/0x538 [drm_kms_helper] [ 53.300510] drm_client_modeset_probe+0x1f0/0xbd4 [drm] [ 53.305958] __drm_fb_helper_initial_config_and_unlock+0x50/0x510 [drm_kms_helper] [ 53.313611] drm_fb_helper_initial_config+0x48/0x58 [drm_kms_helper] [ 53.320039] drm_fbdev_dma_client_hotplug+0x84/0xd4 [drm_dma_helper] [ 53.326401] drm_client_register+0x5c/0xa0 [drm] [ 53.331216] drm_fbdev_dma_setup+0xc8/0x13c [drm_dma_helper] [ 53.336881] tidss_probe+0x128/0x264 [tidss] [ 53.341174] platform_probe+0x68/0xc4 [ 53.344841] really_probe+0x188/0x3c4 [ 53.348501] __driver_probe_device+0x7c/0x16c [ 53.352854] driver_probe_device+0x3c/0x10c [ 53.357033] __device_attach_driver+0xbc/0x158 [ 53.361472] bus_for_each_drv+0x88/0xe8 [ 53.365303] __device_attach+0xa0/0x1b4 [ 53.369135] device_initial_probe+0x14/0x20 [ 53.373314] bus_probe_device+0xb0/0xb4 [ 53.377145] deferred_probe_work_func+0xcc/0x124 [ 53.381757] process_one_work+0x1f0/0x518 [ 53.385770] worker_thread+0x1e8/0x3dc [ 53.389519] kthread+0x11c/0x120 [ 53.392750] ret_from_fork+0x10/0x20 The issue here is as follows: - tidss probes, but is deferred as sii902x is still missing. - sii902x starts probing and enters sii902x_init(). - sii902x calls drm_bridge_add(). Now the sii902x bridge is ready from DRM's perspective. - sii902x calls sii902x_audio_codec_init() and platform_device_register_data() - The registration of the audio platform device causes probing of the deferred devices. - tidss probes, which eventually causes sii902x_bridge_get_edid() to be called. - sii902x_bridge_get_edid() tries to use the i2c to read the edid. However, the sii902x driver has not set up the i2c part yet, leading to the crash. Fix this by moving the drm_bridge_add() to the end of the sii902x_init(), which is also at the very end of sii902x_probe(). The Linux kernel CVE team has assigned CVE-2024-26607 to this issue. Affected and fixed versions =========================== Issue introduced in 5.0 with commit 21d808405fe4 and fixed in 6.1.76 with commit e0f83c234ea7 Issue introduced in 5.0 with commit 21d808405fe4 and fixed in 6.6.15 with commit 56f96cf6eb11 Issue introduced in 5.0 with commit 21d808405fe4 and fixed in 6.7.3 with commit 2a4c6af7934a Issue introduced in 5.0 with commit 21d808405fe4 and fixed in 6.8-rc2 with commit 08ac6f132dd7 Please see https://www.kernel.org or 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-2024-26607 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/bridge/sii902x.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/e0f83c234ea7a3dec1f84e5d02caa1c51664a076 https://git.kernel.org/stable/c/56f96cf6eb11a1c2d594367c3becbfb06a855ec1 https://git.kernel.org/stable/c/2a4c6af7934a7b4c304542c38fee35e09cc1770c https://git.kernel.org/stable/c/08ac6f132dd77e40f786d8af51140c96c6d739c9