CVE-2025-38396 fs: export anon_inode_make_secure_inode() and fix secretmem LSM bypass

High 7.8 Published Updated

A Linux kernel flaw allowed secretmem file descriptors to bypass LSM/SELinux security checks due to an uncleared flag, enabling unauthorized access.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-38396?

CVE-2025-38396 is a high-severity vulnerability in Debian Debian Linux, published on 25 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Which versions are affected by CVE-2025-38396?

It affects 2 products.

Products include Debian Debian Linux, Linux kernel.

How do I fix CVE-2025-38396?

Apply the vendor's patch.

Is CVE-2025-38396 being exploited?

There is no known exploitation of CVE-2025-38396 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as AZL-65726, BELL-CVE-2025-38396, DEBIAN-CVE-2025-38396, GHSA-8m46-hm8p-v8rj, ROOT-OS-DEBIAN-12-CVE-2025-38396, ROOT-OS-UBUNTU-2404-CVE-2025-38396 and 1 more.

Is CVE-2025-38396 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free