CVE-2025-40099
Description
In the Linux kernel, the following vulnerability has been resolved:
cifs: parse_dfs_referrals: prevent oob on malformed input
Malicious SMB server can send invalid reply to FSCTL_DFS_GET_REFERRALS
- reply smaller than sizeof(struct get_dfs_referral_rsp) - reply with number of referrals smaller than NumberOfReferrals in the header
Processing of such replies will cause oob.
Return -EINVAL error on such replies to prevent oob-s.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A missing bounds check in the Linux kernel's CIFS DFS referral parser allows a malicious SMB server to trigger an out-of-bounds read when processing a crafted reply.
Vulnerability
The parse_dfs_referrals function in the Linux kernel's CIFS (Common Internet File System) client lacks proper input validation when processing replies to FSCTL_DFS_GET_REFERRALS requests. A malicious SMB server can send an invalid reply that is either smaller than the expected struct get_dfs_referral_rsp header or contains a NumberOfReferrals value that is less than the actual count of referral entries in the reply. These malformed inputs can cause the parser to read beyond the bounds of the allocated buffer, leading to an out-of-bounds (OOB) access [1][2].
Exploitation
An attacker must operate a malicious SMB server that the target Linux client connects to. No authentication is required; merely triggering a DFS referral request via CIFS is sufficient. The attacker crafts a specially malformed reply, and the kernel's parser reads past the valid data, potentially accessing adjacent memory. This scenario is plausible whenever a Linux system mounts a share from an untrusted or compromised SMB server.
Impact
A successful OOB read can leak sensitive kernel memory or, in more severe cases, cause a kernel panic (denial of service). While the immediate fix prevents OOB access by returning -EINVAL, the underlying issue could have been weaponized for information disclosure or system instability.
Mitigation
The vulnerability is patched in the Linux kernel. Commits [1] and [2] introduce checks to reject replies that are too small or have a mismatched referral count, returning -EINVAL instead of proceeding with the out-of-bounds read. Users should update to a kernel version containing these fixes or apply the backported patches.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
5cfacc7441f7615c73964da9d8bc4a8d39bacbb0f2e66e1ac6447b0e35556Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- git.kernel.org/stable/c/15c73964da9df994302f579ed14ee5fdbce7a332nvd
- git.kernel.org/stable/c/6447b0e355562a1ff748c4a2ffb89aae7e84d2c9nvd
- git.kernel.org/stable/c/8bc4a8d39bac23d8b044fd3e2dbfd965f1d9b058nvd
- git.kernel.org/stable/c/bb0f2e66e1ac043a5b238f5bcab4f26f3c317039nvd
- git.kernel.org/stable/c/cfacc7441f760e4a73cc71b6ff1635261d534657nvd
News mentions
0No linked articles in our index yet.