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 A8D202185BC for ; Wed, 26 Feb 2025 02:15:11 +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=1740536111; cv=none; b=qiWS4VLL4cyhkiHybgX+byqkbickObq/IF1T/t4VDtmFiXJzYoELoQpVkFY/B3VnjCvGwidlM++W27IKX7saa6rbSMQzx+s+u5TyREigrdx9iU2QER8sjjMYYVbCNmrFUzwRBgIE6yNwaqY6ky3A27m/E6xRBoLhStWc29aRFKM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536111; c=relaxed/simple; bh=yrvLNvsaxETxqYAPw6ij7lxfzEh1v4uqERGAEiY/+hw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=AOziTAeKU4/tESInDdSrRpdJrBGse54LyjOr02owsCN1lDYZH0mbwMN9SnRO9iTT6d/STwdj8aNjLkt75tqm5rGxFXh42EWoyebNuUw5bWUakwU30hg3bhHwiigENUjGj8AfPHUuknv59xVdoIW8VIogeu14dt0oeR+Oa+NVpH4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=g+FjQQRA; 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="g+FjQQRA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D5E1C4CEE7; Wed, 26 Feb 2025 02:15:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536111; bh=yrvLNvsaxETxqYAPw6ij7lxfzEh1v4uqERGAEiY/+hw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=g+FjQQRAbqcy9eYZyk2NEN6fJCxQAI3vBRtmNwU8mlLGXQnuWNpM6n3iLyqiYUNgv KfmxdQGCZiXjVJDOJ1NXgY7AadQdTgLUFZeYOcsFNDn2a8IOBpJiAGpcda1D5CmXPq CM8XNFVqc0n8yaWII05VaNM9SUZl8KjI/vUEP9HI= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49507: regulator: da9121: Fix uninit-value in da9121_assign_chip_model() Date: Wed, 26 Feb 2025 03:13:01 +0100 Message-ID: <2025022608-CVE-2022-49507-16f6@gregkh> X-Mailer: git-send-email 2.48.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=3417; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=yrvLNvsaxETxqYAPw6ij7lxfzEh1v4uqERGAEiY/+hw=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7Khiub5wz7/bk/Y2hviLMcpaTnczmVetKT2jjW3FW0 OmMgYZARywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEzElY1hwZ4bLS1+88p4dpjt D3dsYV3cmRLsyTBX+pDs3yJ2/UrmmHm5U/XeOfsdzMoCAA== 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: regulator: da9121: Fix uninit-value in da9121_assign_chip_model() KASAN report slab-out-of-bounds in __regmap_init as follows: BUG: KASAN: slab-out-of-bounds in __regmap_init drivers/base/regmap/regmap.c:841 Read of size 1 at addr ffff88803678cdf1 by task xrun/9137 CPU: 0 PID: 9137 Comm: xrun Tainted: G W 5.18.0-rc2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x15a lib/dump_stack.c:88 print_report.cold+0xcd/0x69b mm/kasan/report.c:313 kasan_report+0x8e/0xc0 mm/kasan/report.c:491 __regmap_init+0x4540/0x4ba0 drivers/base/regmap/regmap.c:841 __devm_regmap_init+0x7a/0x100 drivers/base/regmap/regmap.c:1266 __devm_regmap_init_i2c+0x65/0x80 drivers/base/regmap/regmap-i2c.c:394 da9121_i2c_probe+0x386/0x6d1 drivers/regulator/da9121-regulator.c:1039 i2c_device_probe+0x959/0xac0 drivers/i2c/i2c-core-base.c:563 This happend when da9121 device is probe by da9121_i2c_id, but with invalid dts. Thus, chip->subvariant_id is set to -EINVAL, and later da9121_assign_chip_model() will access 'regmap' without init it. Fix it by return -EINVAL from da9121_assign_chip_model() if 'chip->subvariant_id' is invalid. The Linux kernel CVE team has assigned CVE-2022-49507 to this issue. Affected and fixed versions =========================== Issue introduced in 5.11 with commit f3fbd5566f6a8cdb7c48ab29bd1096205b7fbcaf and fixed in 5.15.46 with commit be96baa0c79588084e0d7a4fa21c574cec9a57f4 Issue introduced in 5.11 with commit f3fbd5566f6a8cdb7c48ab29bd1096205b7fbcaf and fixed in 5.17.14 with commit 7da64c7c82c9b29b628a62c88a8c2fb06990563d Issue introduced in 5.11 with commit f3fbd5566f6a8cdb7c48ab29bd1096205b7fbcaf and fixed in 5.18.3 with commit 60f21eda69f1b5727a97d2077da766eb27fcc21f Issue introduced in 5.11 with commit f3fbd5566f6a8cdb7c48ab29bd1096205b7fbcaf and fixed in 5.19 with commit bab76514aca36bc513224525d5598da676938218 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-49507 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/regulator/da9121-regulator.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/be96baa0c79588084e0d7a4fa21c574cec9a57f4 https://git.kernel.org/stable/c/7da64c7c82c9b29b628a62c88a8c2fb06990563d https://git.kernel.org/stable/c/60f21eda69f1b5727a97d2077da766eb27fcc21f https://git.kernel.org/stable/c/bab76514aca36bc513224525d5598da676938218