From mboxrd@z Thu Jan 1 00:00:00 1970 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 C74ED12D761 for ; Fri, 24 May 2024 15:12:18 +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=1716563538; cv=none; b=EFxBio+vnH53FH/Rv6uhY9nOFtHivnnDDXKRCkguxI0jkGNsZBipOVUqWYm+lt2OK/X2sO3KXG1pbNo3fMtE66KCEPvrwh6HXKtRwMv7QWPbLmka9Urib2zlDo4Os6vDSYr1w7baQOg+EB4+WDXNbLjfj5nbImpGkjoyXvjchw8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716563538; c=relaxed/simple; bh=cuvyeu8y9vtqPm58O7gsHYSn5EfsI8Q+ypczR/Rjmjo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=g8I4f5k48sxMl32cf5bVeEKvjyb0aaJE4zDXUTDhd6+WkO4wVxq6/zENHyHOiiFgIc0wjsmhaQJ+NTNDek4EfKNgiQ0uit4h4kffsQJg3Cc9hisHzR7U0fvT+UL5yaLXQYLrTpWY+kH6Y5E+29DzpddcwZuOwPcd4fXiTrYj5eU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2XfUsgCU; 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="2XfUsgCU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50200C2BD11; Fri, 24 May 2024 15:12:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716563538; bh=cuvyeu8y9vtqPm58O7gsHYSn5EfsI8Q+ypczR/Rjmjo=; h=From:To:Cc:Subject:Date:Reply-to:From; b=2XfUsgCUb0kLP5KmPK84dcq+GhTkLEdIBAlC0FzGIO9F+kp4kiqBWF/pBhHS70ZV0 LZWyb+T63IQuUZun8PPCQLBsT8F1uKA+Nhsml/QQYgOHjSpZzyKPSOm2Jqzw9UWxHp 2n0+Jl4jdq/VI3kRNiMx4DfHux4+SuFMqyCqAiDQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47535: drm/msm/a6xx: Allocate enough space for GMU registers Date: Fri, 24 May 2024 17:09:55 +0200 Message-ID: <2024052437-CVE-2021-47535-41d3@gregkh> X-Mailer: git-send-email 2.45.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=3267; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=cuvyeu8y9vtqPm58O7gsHYSn5EfsI8Q+ypczR/Rjmjo=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkBazfeDFzmeqBb55zy4ak5fzMZZwpmBQovqhYMtH607 LCo5IX9HbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCR1YUMCzaVmx70vtqWcu8r x5ymBZPf9qm/92WYZ7uYO8Rts0zlJ+ZVyTKb9I5oMPH9BgA= 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/msm/a6xx: Allocate enough space for GMU registers In commit 142639a52a01 ("drm/msm/a6xx: fix crashstate capture for A650") we changed a6xx_get_gmu_registers() to read 3 sets of registers. Unfortunately, we didn't change the memory allocation for the array. That leads to a KASAN warning (this was on the chromeos-5.4 kernel, which has the problematic commit backported to it): BUG: KASAN: slab-out-of-bounds in _a6xx_get_gmu_registers+0x144/0x430 Write of size 8 at addr ffffff80c89432b0 by task A618-worker/209 CPU: 5 PID: 209 Comm: A618-worker Tainted: G W 5.4.156-lockdep #22 Hardware name: Google Lazor Limozeen without Touchscreen (rev5 - rev8) (DT) Call trace: dump_backtrace+0x0/0x248 show_stack+0x20/0x2c dump_stack+0x128/0x1ec print_address_description+0x88/0x4a0 __kasan_report+0xfc/0x120 kasan_report+0x10/0x18 __asan_report_store8_noabort+0x1c/0x24 _a6xx_get_gmu_registers+0x144/0x430 a6xx_gpu_state_get+0x330/0x25d4 msm_gpu_crashstate_capture+0xa0/0x84c recover_worker+0x328/0x838 kthread_worker_fn+0x32c/0x574 kthread+0x2dc/0x39c ret_from_fork+0x10/0x18 Allocated by task 209: __kasan_kmalloc+0xfc/0x1c4 kasan_kmalloc+0xc/0x14 kmem_cache_alloc_trace+0x1f0/0x2a0 a6xx_gpu_state_get+0x164/0x25d4 msm_gpu_crashstate_capture+0xa0/0x84c recover_worker+0x328/0x838 kthread_worker_fn+0x32c/0x574 kthread+0x2dc/0x39c ret_from_fork+0x10/0x18 The Linux kernel CVE team has assigned CVE-2021-47535 to this issue. Affected and fixed versions =========================== Issue introduced in 5.9 with commit 142639a52a01 and fixed in 5.10.84 with commit d646856a600e Issue introduced in 5.9 with commit 142639a52a01 and fixed in 5.15.7 with commit 83e54fcf0b14 Issue introduced in 5.9 with commit 142639a52a01 and fixed in 5.16 with commit b4d25abf9720 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-2021-47535 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/msm/adreno/a6xx_gpu_state.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/d646856a600e8635ba498f20b194219b158626e8 https://git.kernel.org/stable/c/83e54fcf0b14ca2d869dd37abe1bb6542805f538 https://git.kernel.org/stable/c/b4d25abf9720b69a03465b09d0d62d1998ed6708