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 D9811198E6F for ; Thu, 1 May 2025 14:19:42 +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=1746109182; cv=none; b=egG/1z32CuuPCRApif0u3CPAZsm4Fih/w0207sAONeXxNLf6XUxL07kYwwwONRyWVj0I9XtyslRzbk8IL+xl/r0gemFywRRcl0rqjxPpGUJpjR91BmJ2uIyIeFO6KdZd03YkIsU9ljIn3AsCE7YoyUipUEcpUIXTv4ypse7of0U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746109182; c=relaxed/simple; bh=WUrtjFk+O+MB0M2ft8sXRgFlSreLjHd52fdTOZPc5BI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CpySAA8JpMtvfL8O2avCqfGD+D+MXsSa+MY6K16eK8OdwZSBI0XhqPpeTEozmq9j+ImTy/Dx/MUh3/qIOPa1AWt5PGGEhcZAbKOYV5WHaZXatjLZG6MXE7vhN4kKz+cfMyXtjhFzkrf4EpPq3VtRuPpjMiQZo8agQz6HS8VTIds= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Up8uYSws; 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="Up8uYSws" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4FD66C4CEE3; Thu, 1 May 2025 14:19:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746109182; bh=WUrtjFk+O+MB0M2ft8sXRgFlSreLjHd52fdTOZPc5BI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Up8uYSws761WxYbLS9bmWho0syuka+6PEJBcW8gJHX/u3kgo+DR8k70InOT6A4kIy xvCcvrtVcE7hSXrL1WQRz9OidpZHVe2VEcpKrOOZcVmMy+wJ0rlDao8Qm8EBvPlYDx nyadCVNhJVHb/p/3oQ23Nyjt/9d+A9moejFGf0zA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49897: fscrypt: fix keyring memory leak on mount failure Date: Thu, 1 May 2025 16:11:27 +0200 Message-ID: <2025050100-CVE-2022-49897-6af8@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=2167; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=iSwl+jgQ1Z3Hm/NWq6VMfUHwLWASZulNxIZpnJ7Fb/U=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDTtiFpWdmBmip9PlFn5p7+6TEg+CmJVOVad3fjwaX R6bOvNYRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEyE5RvDgpvVv1teiNbnClyQ iphaqDBzE9uEFQzzjG9//jXjik6x4Jb7XY08FtcKpmU/BgA= 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: fscrypt: fix keyring memory leak on mount failure Commit d7e7b9af104c ("fscrypt: stop using keyrings subsystem for fscrypt_master_key") moved the keyring destruction from __put_super() to generic_shutdown_super() so that the filesystem's block device(s) are still available. Unfortunately, this causes a memory leak in the case where a mount is attempted with the test_dummy_encryption mount option, but the mount fails after the option has already been processed. To fix this, attempt the keyring destruction in both places. The Linux kernel CVE team has assigned CVE-2022-49897 to this issue. Affected and fixed versions =========================== Issue fixed in mainline with commit ccd30a4 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-49897 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: fs/crypto/keyring.c fs/super.c include/linux/fscrypt.h 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/29997a6fa60de1de2fa0de471e7652efa6e95868 https://git.kernel.org/stable/c/cff805b1518f38d57866065343db2285f2dcd5ab https://git.kernel.org/stable/c/0b1747653b102c555bac745ebe5ca86cdd20e43f https://git.kernel.org/stable/c/ccd30a476f8e864732de220bd50e6f372f5ebcab