CVE-2026-99363: NFSD: Map flex file layout IDs through the request's user namespace
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
NFSD: Map flex file layout IDs through the request's user namespace
nfsd4_ff_proc_layoutget() and nfsd4_ff_encode_layoutget() translate the file's owner and group with init_user_ns, but every other identity nfsd places on the wire goes through nfsd_user_namespace(). When the transport carries a credential from a non-initial user namespace, the flex file layout reports host-global IDs. The client copies those IDs into the AUTH_SYS credential it presents to the data server, and svcauth_unix_accept() resolves that credential in the transport's namespace, so data server I/O runs under an identity unrelated to the file's owner.
Switching to the request's namespace introduces a second hazard. from_kuid() returns (uid_t)-1 when the target namespace has no mapping for the owner, and the IOMODE_READ arm adds one to that result to derive an identity for which the data server denies writes. The addition would wrap to zero, handing the client uid 0 instead of an identity distinct from the owner.
Translate both IDs in nfsd4_ff_proc_layoutget(), which has the svc_rqst, and carry the wire values in struct pnfs_ff_layout. from_kuid_munged() substitutes overflowuid for an unmapped owner and thus never returns (uid_t)-1, so the increment cannot wrap to zero.
The Linux kernel CVE team has assigned CVE-2026-99363 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.8 with commit 9b9960a0ca4773e21c4b153ed355583946346b25 and fixed in 6.12.118 with commit e10bf0e125ebf6b9669b3158eda5fa67b56809d4 Issue introduced in 4.8 with commit 9b9960a0ca4773e21c4b153ed355583946346b25 and fixed in 6.18.61 with commit 76bb89e8155fe29da36ecf0121e9e98afc0f4184 Issue introduced in 4.8 with commit 9b9960a0ca4773e21c4b153ed355583946346b25 and fixed in 7.3.2 with commit c0dacde381e1311bba8074e660d41ecc57c3bd2b Issue introduced in 4.8 with commit 9b9960a0ca4773e21c4b153ed355583946346b25 and fixed in 7.4-rc1 with commit f913d5d2130a584d1a027ffe3dfd88b6be2e0540
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-2026-99363
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/nfsd/flexfilelayout.c
fs/nfsd/flexfilelayoutxdr.c
fs/nfsd/flexfilelayoutxdr.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/e10bf0e125ebf6b9669b3158eda5fa67b56809d4 https://git.kernel.org/stable/c/76bb89e8155fe29da36ecf0121e9e98afc0f4184 https://git.kernel.org/stable/c/c0dacde381e1311bba8074e660d41ecc57c3bd2b https://git.kernel.org/stable/c/f913d5d2130a584d1a027ffe3dfd88b6be2e0540