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 4E53C26ED5E for ; Wed, 22 Oct 2025 13:25:02 +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=1761139502; cv=none; b=fzMsVO6Xhr2gAOUkaEACNM+tulTxVScTAv+ziDabuvPf+6pEspWzg/jeRrAwN3pBlg4x1RRq0nW07T1VbeHXtW+aFbWfrEgyMY9+5cfLSbfsRFLwxg5/TPA7U3ZPmaVc8o5rw2iVShVI1t0QksnESOC46XKbvqmbd8x25uhOqgM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761139502; c=relaxed/simple; bh=WOocqwJJNEUvRtv+OCpAzPkMe3lGxtTkSU7firtxOwI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kIYLg+gj5NMQTT2jS5Z/xaRJwpEgMhzJocrqqRol5C4UaBSb1kaPt9GiDuihWYR6lmY89lhYfZkAX1F6YQFtX2Hjfn6z79xNVNAK38R9maMIz2dtfbY4QmpWYzMLDMMboyyy1gcQZxeh+P6Ui7rGPWmDUK9FEeoK0ZtMTh/s+aw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uRSnuXlC; 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="uRSnuXlC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D218BC4CEF5; Wed, 22 Oct 2025 13:25:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1761139502; bh=WOocqwJJNEUvRtv+OCpAzPkMe3lGxtTkSU7firtxOwI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=uRSnuXlCfYZ3u1q5CKcV98hm+tfkpQORoUkSzmyVs3FRbYFFOc9Cwcwg0VCOSpUuq LkVj3xCo98q+tjKnadrSUi8aiJAvaqRmBSph4btoKGKp9FqSi7nFyZFzBQ4EtcUwF9 LkFLQrCW3xMuM3Octrp8JfO9/Kbt/t2WBWzofS2o= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50577: ima: Fix memory leak in __ima_inode_hash() Date: Wed, 22 Oct 2025 15:24:25 +0200 Message-ID: <2025102209-CVE-2022-50577-ebe1@gregkh> X-Mailer: git-send-email 2.51.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=2515; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=+9WD0ycLRVt4g/g6/wFOziE+wVgvCTvf07kS6lCqgfI=; b=owGbwMvMwCRo6H6F97bub03G02pJDBk/bv1UVl7tqCToL/zrfkP1h3dtb67eOfC78+4aPeO+t 3ktkrEeHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjARtr0M89PkjeusV3xjzcgN 1hbQSFvNwPj3OsM8fV9Ry4Uq6xx0FFe8+8gbvvb+XMtYAA== 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: ima: Fix memory leak in __ima_inode_hash() Commit f3cc6b25dcc5 ("ima: always measure and audit files in policy") lets measurement or audit happen even if the file digest cannot be calculated. As a result, iint->ima_hash could have been allocated despite ima_collect_measurement() returning an error. Since ima_hash belongs to a temporary inode metadata structure, declared at the beginning of __ima_inode_hash(), just add a kfree() call if ima_collect_measurement() returns an error different from -ENOMEM (in that case, ima_hash should not have been allocated). The Linux kernel CVE team has assigned CVE-2022-50577 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit 280fe8367b0dc45b6ac5e04fad03e16e99540c0c and fixed in 6.0.18 with commit c4df8cb38f139ed9f4296868c0a6f15a26e8c491 Issue introduced in 5.18 with commit 280fe8367b0dc45b6ac5e04fad03e16e99540c0c and fixed in 6.1.4 with commit f375bcf69f58fd0744c9dfd1b6b891a27301d67b Issue introduced in 5.18 with commit 280fe8367b0dc45b6ac5e04fad03e16e99540c0c and fixed in 6.2 with commit 8c1d6a050a0f16e0a9d32eaf53b965c77279c6f8 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-50577 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: security/integrity/ima/ima_main.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/c4df8cb38f139ed9f4296868c0a6f15a26e8c491 https://git.kernel.org/stable/c/f375bcf69f58fd0744c9dfd1b6b891a27301d67b https://git.kernel.org/stable/c/8c1d6a050a0f16e0a9d32eaf53b965c77279c6f8