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 EECB81991BF for ; Thu, 27 Mar 2025 16:37:54 +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=1743093475; cv=none; b=VL5YCrCLV6kyk8/PbZQ7tU6N12sJJIeedyiso8jLh69+At70TVygGu+meZgEkrepLxNszs2lvuqbjBEyzZBi7q71ystVhKwnt2VY2SoxmM+BDOGmh1JTtVh9cPi8pZbm0bfSdoc+qk2cEfQUgPW1DTxAv/Vh+OnAwf1JH2Dtn+w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743093475; c=relaxed/simple; bh=FjfhOIlw09b6sUbQsCGdRAfh2vVw8xj+gQTR8ihRRdE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=tNc7gtbOR4/BdpkXfnlNpCfqXhL436qbF78jw3rEA7C7QxWtZjDTxHGteew7lH0b3qXA45tYmDjJfR2MJZGEAkBqgUbnd+Yf7zH+9YVoVwmAEUFXCO1IdKd625D31CBDz/+OHzF614AzW/2nDjYdadGutlfzb0qQl0aPGHxLG+E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=0Y5ThrTT; 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="0Y5ThrTT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E05BC4CEDD; Thu, 27 Mar 2025 16:37:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1743093474; bh=FjfhOIlw09b6sUbQsCGdRAfh2vVw8xj+gQTR8ihRRdE=; h=From:To:Cc:Subject:Date:Reply-to:From; b=0Y5ThrTTGIYOn+bn9daghjKpmW2KVRwqxKdudTpaMcxG/I1ikKJqr0E1B/yArTZYf Co8pM0MLFqOdDq2OSkGz3kuQrq6FnOcrK80tF2Klq5o01kAdgf6x8zUo1BHnT8xvPY zUgdLgT7hi8fdu5St0QCVuvtmKAZLn5/ECsdWtmc= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-52929: nvmem: core: fix cleanup after dev_set_name() Date: Thu, 27 Mar 2025 17:37:19 +0100 Message-ID: <2025032719-CVE-2023-52929-7900@gregkh> X-Mailer: git-send-email 2.49.0 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=2476; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=FjfhOIlw09b6sUbQsCGdRAfh2vVw8xj+gQTR8ihRRdE=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlP6/bLqB35nLWk45phbGKQCefnua/Wf3lX8rjXcUsgj 4xI6MqOjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhIoD7DgsNnHuzfZ32Uo7Dg B9NZ+7o9DN8PTGGY73rhjWDAnLl/pc30flRPvrXj0kI5HgA= 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: nvmem: core: fix cleanup after dev_set_name() If dev_set_name() fails, we leak nvmem->wp_gpio as the cleanup does not put this. While a minimal fix for this would be to add the gpiod_put() call, we can do better if we split device_register(), and use the tested nvmem_release() cleanup code by initialising the device early, and putting the device. This results in a slightly larger fix, but results in clear code. Note: this patch depends on "nvmem: core: initialise nvmem->id early" and "nvmem: core: remove nvmem_config wp_gpio". [Srini: Fixed subject line and error code handing with wp_gpio while applying.] The Linux kernel CVE team has assigned CVE-2023-52929 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1 with commit 5544e90c81261e82e02bbf7c6015a4b9c8c825ef and fixed in 6.1.11 with commit 39708bc8da7858de0bed9b3a88b3beb1d1e0b443 Issue introduced in 6.1 with commit 5544e90c81261e82e02bbf7c6015a4b9c8c825ef and fixed in 6.2 with commit 560181d3ace61825f4ca9dd3481d6c0ee6709fa8 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-52929 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/nvmem/core.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/23676ecd2eb377f7c24a6ff578b0f4c7135658b6 https://git.kernel.org/stable/c/8f9c4b2a3b132bf6698e477aba6ee194b40c75f4 https://git.kernel.org/stable/c/39708bc8da7858de0bed9b3a88b3beb1d1e0b443 https://git.kernel.org/stable/c/560181d3ace61825f4ca9dd3481d6c0ee6709fa8