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 6527F481C7 for ; Fri, 17 May 2024 13:27:44 +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=1715952464; cv=none; b=H8lXXezqSpxrYGHEvqyCdJHabma99fONfF5EbSP6FAI1J+cB+aVX9Siu94d0dyqZa6Gad7EhTjDwNWj5y4cydr550GGtGVsTfEsEpR9cJhTxIraSOnv51Ms5S1WJgMJlnhcfam7lz5O6EWTL3a7AgTAwvj126KosewS7JZuOsao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715952464; c=relaxed/simple; bh=FVq+rDZSxOh7fGyYrb5LvvBsgrREV7PQTRnR1TySqwU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=I770iG7nXGsFK1Mb/aSqb5kbP6iQyOQcDwPt/08fmWlsL50IcAC5hvOHpmb0MobMg2jn1hespQZVkObtKo5CFM8NZuMoYTenTDP7k9vyERFQ500HoGDdTlc0NJ9PxYT4Btga8/GYV/+ttd2l6U4mdbovasMZvkoohWMV04h2pgw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PFzGjP4e; 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="PFzGjP4e" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5B07C2BD10; Fri, 17 May 2024 13:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1715952464; bh=FVq+rDZSxOh7fGyYrb5LvvBsgrREV7PQTRnR1TySqwU=; h=From:To:Cc:Subject:Date:Reply-to:From; b=PFzGjP4e2EqDDDiA1ls8zukh7uZx2MatANmujC8zYKdumzJ0RkomN3+LqtRPZV2TZ voH+9+559zEcRq/9lxWCHKW19T+0X6PK2v79082PQA7BS7h0UXe41RIiwK6XyoNzqB Ja85kXn+HsfnyPBTuqJNoDuJ3L2kd2utcr7pREnY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35824: misc: lis3lv02d_i2c: Fix regulators getting en-/dis-abled twice on suspend/resume Date: Fri, 17 May 2024 15:27:36 +0200 Message-ID: <2024051737-CVE-2024-35824-7302@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=3435; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=FVq+rDZSxOh7fGyYrb5LvvBsgrREV7PQTRnR1TySqwU=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnu0Z6HsrhWLDtkor2Fe+uSEKF4xsx5X6u3zOKfcfTkY rZ1+yoKO2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiho8Z5rvzXn+jNfXuG3tR y3jL2js/N75M2s0wP2PRVN2c26JpHzvmW3I9Xswye0PXcwA= 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: misc: lis3lv02d_i2c: Fix regulators getting en-/dis-abled twice on suspend/resume When not configured for wakeup lis3lv02d_i2c_suspend() will call lis3lv02d_poweroff() even if the device has already been turned off by the runtime-suspend handler and if configured for wakeup and the device is runtime-suspended at this point then it is not turned back on to serve as a wakeup source. Before commit b1b9f7a49440 ("misc: lis3lv02d_i2c: Add missing setting of the reg_ctrl callback"), lis3lv02d_poweroff() failed to disable the regulators which as a side effect made calling poweroff() twice ok. Now that poweroff() correctly disables the regulators, doing this twice triggers a WARN() in the regulator core: unbalanced disables for regulator-dummy WARNING: CPU: 1 PID: 92 at drivers/regulator/core.c:2999 _regulator_disable ... Fix lis3lv02d_i2c_suspend() to not call poweroff() a second time if already runtime-suspended and add a poweron() call when necessary to make wakeup work. lis3lv02d_i2c_resume() has similar issues, with an added weirness that it always powers on the device if it is runtime suspended, after which the first runtime-resume will call poweron() again, causing the enabled count for the regulator to increase by 1 every suspend/resume. These unbalanced regulator_enable() calls cause the regulator to never be turned off and trigger the following WARN() on driver unbind: WARNING: CPU: 1 PID: 1724 at drivers/regulator/core.c:2396 _regulator_put Fix this by making lis3lv02d_i2c_resume() mirror the new suspend(). The Linux kernel CVE team has assigned CVE-2024-35824 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1.77 with commit 2c1164ad927e and fixed in 6.1.84 with commit 4154e7673541 Issue introduced in 6.6.16 with commit 1229ce1c4acd and fixed in 6.6.24 with commit 997ca4153846 Issue introduced in 6.7.4 with commit 755182e1e866 and fixed in 6.7.12 with commit f6df761182fc 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-2024-35824 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/misc/lis3lv02d/lis3lv02d_i2c.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/4154e767354140db7804207117e7238fb337b0e7 https://git.kernel.org/stable/c/997ca415384612c8df76d99d9a768e0b3f42b325 https://git.kernel.org/stable/c/f6df761182fc953907b18aba5049fc2a044ecb45 https://git.kernel.org/stable/c/ac3e0384073b2408d6cb0d972fee9fcc3776053d