[<prev] [next>] [day] [month] [year] [list]
Message-ID: <2025072509-CVE-2025-38396-92a5@gregkh>
Date: Fri, 25 Jul 2025 14:55:27 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-cve-announce@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...nel.org>
Subject: CVE-2025-38396: fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass
From: Greg Kroah-Hartman <gregkh@...nel.org>
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
Powered by blists - more mailing lists