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 189202ECD3F for ; Fri, 25 Jul 2025 12:56:21 +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=1753448181; cv=none; b=rGVVJVRcDuOfvVTt+fllulGF3ZAKCmwm6FWKiXERN3zzye1AXrzT1lcrVXtt74n9KRV5i6FHyGXFut/apBInzYkY1rX2yawKV5JwYqB9O8wYFQo61PbuabTowFUpsNTGDTrVCys3WyI2DAUOdVq818nez4ubsSb8ydchAhobKp8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753448181; c=relaxed/simple; bh=4d4fazt++no0Skr8huOeaXQQKDDIJTE1+lDNQV23AnQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=N8zMKMLj1IJS5C5s6TR3zojrucx/Ugq+SqKLVk7eEqWzX3Tv1uruzyDnnU8OurxKfK++fRzzU1ztFJGorzG1YVJNrlM2saWYbgAwfnkRARs9Lc/Z7cjjPk0uymEXjrl2b+hXs3iPZvxq3tF2ig3tHtJhdZDxy5lfzduT0rNTL0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SeqReO4T; 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="SeqReO4T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78A31C4CEE7; Fri, 25 Jul 2025 12:56:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1753448181; bh=4d4fazt++no0Skr8huOeaXQQKDDIJTE1+lDNQV23AnQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SeqReO4Tj4leep70rvNA5G6igCXiDvUQEMLeOLQFAGlNaV8w2/Jn0yuu1O4Zi4OE+ NNtwatRLVx71ti/ge+fmqbMLaitz2iluzymBk++ZeoT25xvMKokuRnXjv5ZEoHcgnO sMrfNz4wwqpFRvfwIhXJYhEiRun0+ZaJ87ogewSo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38396: fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass Date: Fri, 25 Jul 2025 14:55:27 +0200 Message-ID: <2025072509-CVE-2025-38396-92a5@gregkh> X-Mailer: git-send-email 2.50.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=3240; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=Nm+S64Q0fNtj/JmEg4Q3+30XCPUZA4MqZesg8LmmzYg=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnNdWtjI9OcFvwNbizzkb68N5X9kbb6JL3OzXNdRatCP IuE4552xLIwCDIxyIopsnzZxnN0f8UhRS9D29Mwc1iZQIYwcHEKwE02ZJinU86bwyMsYLna413k Y/30rpJbjvsYFlwrPBdqzsR+hUngwrpn9vNZZns4nQcA 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: fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass Export anon_inode_make_secure_inode() to allow KVM guest_memfd to create anonymous inodes with proper security context. This replaces the current pattern of calling alloc_anon_inode() followed by inode_init_security_anon() for creating security context manually. This change also fixes a security regression in secretmem where the S_PRIVATE flag was not cleared after alloc_anon_inode(), causing LSM/SELinux checks to be bypassed for secretmem file descriptors. As guest_memfd currently resides in the KVM module, we need to export this symbol for use outside the core kernel. In the future, guest_memfd might be moved to core-mm, at which point the symbols no longer would have to be exported. When/if that happens is still unclear. The Linux kernel CVE team has assigned CVE-2025-38396 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit 2bfe15c5261212130f1a71f32a300bcf426443d4 and fixed in 6.1.146 with commit 66d29d757c968d2bee9124816da5d718eb352959 Issue introduced in 6.0 with commit 2bfe15c5261212130f1a71f32a300bcf426443d4 and fixed in 6.6.97 with commit e3eed01347721cd7a8819568161c91d538fbf229 Issue introduced in 6.0 with commit 2bfe15c5261212130f1a71f32a300bcf426443d4 and fixed in 6.12.37 with commit f94c422157f3e43dd31990567b3e5d54b3e5b32b Issue introduced in 6.0 with commit 2bfe15c5261212130f1a71f32a300bcf426443d4 and fixed in 6.15.6 with commit 6ca45ea48530332a4ba09595767bd26d3232743b Issue introduced in 6.0 with commit 2bfe15c5261212130f1a71f32a300bcf426443d4 and fixed in 6.16-rc5 with commit cbe4134ea4bc493239786220bd69cb8a13493190 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-2025-38396 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/anon_inodes.c include/linux/fs.h mm/secretmem.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/66d29d757c968d2bee9124816da5d718eb352959 https://git.kernel.org/stable/c/e3eed01347721cd7a8819568161c91d538fbf229 https://git.kernel.org/stable/c/f94c422157f3e43dd31990567b3e5d54b3e5b32b https://git.kernel.org/stable/c/6ca45ea48530332a4ba09595767bd26d3232743b https://git.kernel.org/stable/c/cbe4134ea4bc493239786220bd69cb8a13493190