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 158581C84B7 for ; Wed, 26 Feb 2025 01:59:33 +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=1740535173; cv=none; b=l+HSevRSxPld/dD9ZMj/HkR4LkuCg96psG3R9a2sgAKe6HtpgM5cS9Kz52NE2TXI+J+B2uh51WvcgXqmudc8mwQ0vcbhT6+iR1nfbFZlwssvXpIfVrlAaa4S6p8iP8c2L+aMGbZLa6Zk05jr4eeIDJDI1LCxSoQ17roKuMCjuwA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740535173; c=relaxed/simple; bh=GpxEeaA023Jm94uGkjR1OOUvhqBI9/kOV5ozHf/DkcI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=QMi+k5BbmWbNRgxPKM9eHBFzH4WW+pVU5VksFRpPQpyMcuNs+aC/S3WKAfj54JFIURaxcq96Ylmig+xJ0n1PRSmY5LoJJuTOZ2NVGwf+/XmjTLAfDLNpJbJHi9xM4ofZ5lzl1IosZCEkzsDKlQk1FLK3QbAymTq2TZ7UyfA2+6I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qhKCA1ND; 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="qhKCA1ND" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD937C4CEDD; Wed, 26 Feb 2025 01:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740535173; bh=GpxEeaA023Jm94uGkjR1OOUvhqBI9/kOV5ozHf/DkcI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=qhKCA1NDR/OjX5G5jTc86ISVKE1S2VRHr20DHY/mhS9v4zNPHBRzDLFL/hUkIRBb1 PfTVUktplNd5ZAp8LPVhyimYlv4lM3u1XEClC0UVgnz1ZcXCITqpk0UcSRI84W3Fz9 uDf6rVnHKII5m9CL2++AFx2hew4OnbNyjQ6SkO0c= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49212: mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init Date: Wed, 26 Feb 2025 02:56:57 +0100 Message-ID: <2025022619-CVE-2022-49212-d8e6@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=3555; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=GpxEeaA023Jm94uGkjR1OOUvhqBI9/kOV5ozHf/DkcI=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7Snw2RjyTOnjiQuy0EzJ7S2sOS2Z/2G0lkyfbs8m0S d3JPetRRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEwkfCbDgkWPvqbwl6xj0JmX FXv5F+OX3epfRBkWrP2Y83Npbf+vLy+N39yMWskafNNSFgA= 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: mtd: rawnand: atmel: fix refcount issue in atmel_nand_controller_init The reference counting issue happens in several error handling paths on a refcounted object "nc->dmac". In these paths, the function simply returns the error code, forgetting to balance the reference count of "nc->dmac", increased earlier by dma_request_channel(), which may cause refcount leaks. Fix it by decrementing the refcount of specific object in those error paths. The Linux kernel CVE team has assigned CVE-2022-49212 to this issue. Affected and fixed versions =========================== Issue introduced in 4.12 with commit f88fc122cc34c2545dec9562eaab121494e401ef and fixed in 4.14.276 with commit 0856bf27057561f42b37df111603cf5a0d040294 Issue introduced in 4.12 with commit f88fc122cc34c2545dec9562eaab121494e401ef and fixed in 4.19.238 with commit 9843c9c98f26c6ad843260b19bfdaa2598f2ae1e Issue introduced in 4.12 with commit f88fc122cc34c2545dec9562eaab121494e401ef and fixed in 5.4.189 with commit 9b08d211db4c447eb1a07df65e45e0aa772e0fa6 Issue introduced in 4.12 with commit f88fc122cc34c2545dec9562eaab121494e401ef and fixed in 5.10.110 with commit a3587259ae553e41d1ce8c7435351a5d6b299a11 Issue introduced in 4.12 with commit f88fc122cc34c2545dec9562eaab121494e401ef and fixed in 5.15.33 with commit fe0e2ce5c87e9c0b9485ff566362030aa55972cf Issue introduced in 4.12 with commit f88fc122cc34c2545dec9562eaab121494e401ef and fixed in 5.16.19 with commit 8baea2b96fa90af8d0f937caf4cf2105ee094d93 Issue introduced in 4.12 with commit f88fc122cc34c2545dec9562eaab121494e401ef and fixed in 5.17.2 with commit f1694169f3674cdf7553aed06864254635679878 Issue introduced in 4.12 with commit f88fc122cc34c2545dec9562eaab121494e401ef and fixed in 5.18 with commit fecbd4a317c95d73c849648c406bcf1b6a0ec1cf 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-49212 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/mtd/nand/raw/atmel/nand-controller.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/0856bf27057561f42b37df111603cf5a0d040294 https://git.kernel.org/stable/c/9843c9c98f26c6ad843260b19bfdaa2598f2ae1e https://git.kernel.org/stable/c/9b08d211db4c447eb1a07df65e45e0aa772e0fa6 https://git.kernel.org/stable/c/a3587259ae553e41d1ce8c7435351a5d6b299a11 https://git.kernel.org/stable/c/fe0e2ce5c87e9c0b9485ff566362030aa55972cf https://git.kernel.org/stable/c/8baea2b96fa90af8d0f937caf4cf2105ee094d93 https://git.kernel.org/stable/c/f1694169f3674cdf7553aed06864254635679878 https://git.kernel.org/stable/c/fecbd4a317c95d73c849648c406bcf1b6a0ec1cf