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 947461EFFB7 for ; Mon, 8 Dec 2025 01:20:45 +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=1765156845; cv=none; b=aif5Q2CfaT73o//gB6Yc8USG0CGZ59jbod4lcpup5mpcEGgrzA1GWzPUPqzHi6pvD8WipLYT6/JNlNonRL8OqCpPznz6MKVQzHSAVPqBEgPUCgrvHmJWbkJHs1nsDnJ3U7cHybwXbmVVpgmSuBR1hMbBp5Q9uK2+SY3Ss9cmvRU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765156845; c=relaxed/simple; bh=x+7SisyeHNw1hrZTeH02WNOWFb29xk46W4B3rwTffys=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Hfg8teSwkshh+0oUTa1Ncx4Z8mofHuVXljxdlnla4dZtrNPt28zKKrWQlocqOEIZsm7RQEANb29+LyoXO94XiVqy2A/xPkUoUZ279aFqkebvGmiWpO7/+g0Ca7W86lZ6GsXC8+DmeO5eg5gq5oJuC6s7xcFrhMHf7W9ggC0FDg4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=neL/dFUs; 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="neL/dFUs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30845C4CEFB; Mon, 8 Dec 2025 01:20:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1765156845; bh=x+7SisyeHNw1hrZTeH02WNOWFb29xk46W4B3rwTffys=; h=From:To:Cc:Subject:Date:Reply-To:From; b=neL/dFUsVhwHAEk8Bc/xK5Oqwa/u3HwdUHf9y7GzAjBLjsbvFX/NPlmXVnGqDDbyo kEKneNkXBV/BbNvJQah8M6OLitksfNUwu8Or80cHFoTABmDtq1qRL4keYNNUTihqfa qMWsPJtd3RshFgfZV0NQ47iWPeBwhBtBtRFlmgUg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53768: regmap-irq: Fix out-of-bounds access when allocating config buffers Date: Mon, 8 Dec 2025 10:20:07 +0900 Message-ID: <2025120846-CVE-2023-53768-2b71@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=3640; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=9dX2cvyvMK21bZUc+nQ0hV+x7Ft/N+Ep+Yv2C/Hlq7E=; b=owGbwMvMwCRo6H6F97bub03G02pJDJlm6puSFZ5Nqwm0ieT7acsXGR2xgn/9Qm+PVm+pyaIOL /XmZ7/qiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIkseMYw302i6gnzipiaYF3F yIlvFk84ISPeyzBPhe362RXW+wJuawV+jmPy9P20QpYDAA== 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: regmap-irq: Fix out-of-bounds access when allocating config buffers When allocating the 2D array for handling IRQ type registers in regmap_add_irq_chip_fwnode(), the intent is to allocate a matrix with num_config_bases rows and num_config_regs columns. This is currently handled by allocating a buffer to hold a pointer for each row (i.e. num_config_bases). After that, the logic attempts to allocate the memory required to hold the register configuration for each row. However, instead of doing this allocation for each row (i.e. num_config_bases allocations), the logic erroneously does this allocation num_config_regs number of times. This scenario can lead to out-of-bounds accesses when num_config_regs is greater than num_config_bases. Fix this by updating the terminating condition of the loop that allocates the memory for holding the register configuration to allocate memory only for each row in the matrix. Amit Pundir reported a crash that was occurring on his db845c device due to memory corruption (see "Closes" tag for Amit's report). The KASAN report below helped narrow it down to this issue: [ 14.033877][ T1] ================================================================== [ 14.042507][ T1] BUG: KASAN: invalid-access in regmap_add_irq_chip_fwnode+0x594/0x1364 [ 14.050796][ T1] Write of size 8 at addr 06ffff8081021850 by task init/1 [ 14.242004][ T1] The buggy address belongs to the object at ffffff8081021850 [ 14.242004][ T1] which belongs to the cache kmalloc-8 of size 8 [ 14.255669][ T1] The buggy address is located 0 bytes inside of [ 14.255669][ T1] 8-byte region [ffffff8081021850, ffffff8081021858) The Linux kernel CVE team has assigned CVE-2023-53768 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit faa87ce9196dbb074d75bd4aecb8bacf18f19b4e and fixed in 6.1.40 with commit b1a726ad33e585e3d9fa70712df31ae105e4532c Issue introduced in 6.0 with commit faa87ce9196dbb074d75bd4aecb8bacf18f19b4e and fixed in 6.4.5 with commit 6e7b2337ecd028bd888a1a0be4115b8a88faf838 Issue introduced in 6.0 with commit faa87ce9196dbb074d75bd4aecb8bacf18f19b4e and fixed in 6.5 with commit 963b54df82b6d6206d7def273390bf3f7af558e1 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-2023-53768 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/base/regmap/regmap-irq.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/b1a726ad33e585e3d9fa70712df31ae105e4532c https://git.kernel.org/stable/c/6e7b2337ecd028bd888a1a0be4115b8a88faf838 https://git.kernel.org/stable/c/963b54df82b6d6206d7def273390bf3f7af558e1