CVE-2026-99952

Source
https://cve.org/CVERecord?id=CVE-2026-99952
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99952.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2026-99952
Downstream
Published
2026-11-30T13:18:35Z
Modified
2026-11-30T15:02:33Z
Summary
statmount: don't copy the reserved empty string past the buffer
Details

In the Linux kernel, the following vulnerability has been resolved:

statmount: don't copy the reserved empty string past the buffer

statmount_string() reserves an empty string at the start of the seq buffer before it calls the handler for the requested string. That's what the offsets of unset strings point to since commit e52e97f09fb6 ("statmount: let unset strings be empty").

If the handler emits nothing the early return from commit 75ead69a7173 ("fs: don't let statmount return empty strings") skips the size check against the caller's buffer. Back then an empty emission meant an empty seq buffer and there was nothing to copy. Now the reserved NUL byte is there and copy_statmount_to_user() copies it to buf + sizeof(struct statmount) no matter how small bufsize is.

So request a string that may turn out empty with a buffer that's smaller than struct statmount and the kernel writes one zero byte past the caller's buffer and reports a size that's larger than the buffer. STATMOUNT_MNT_UIDMAP or STATMOUNT_MNT_GIDMAP on a mount that isn't idmapped will do, so will STATMOUNT_FS_SUBTYPE on anything but fuse or STATMOUNT_OPT_ARRAY on a filesystem without ->show_options(). None of this needs privileges. The byte only lands in the caller's own address space but that's still not ok.

prepare_kstatmount() already refuses a buffer of exactly sizeof(struct statmount) for string requests. A smaller buffer can't hold a string either and it can't even hold the reserved empty string. So refuse any buffer that isn't larger than the fixed part. That's also what the uapi header says: string requests need space after the fixed part of the structure.

Reproducer, unprivileged, on any mount that isn't idmapped:

#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <unistd.h>
#define STATMOUNT_FS_SUBTYPE	0x00000100U
#define STATMOUNT_MNT_UIDMAP	0x00002000U
#define STATX_MNT_ID_UNIQUE	0x00004000U
#define SM_SIZE			512 /* sizeof(struct statmount) */
struct mnt_id_req {
	uint32_t size, mnt_ns_fd;
	uint64_t mnt_id, param, mnt_ns_id;
};
static uint64_t root_mnt_id(void)
{
	unsigned char stx[256]; /* struct statx, stx_mnt_id at offset 144 */
	uint64_t id;
	if (syscall(__NR_statx, AT_FDCWD, "/", 0, STATX_MNT_ID_UNIQUE, stx))
		_exit(1);
	memcpy(&id, stx + 144, sizeof(id));
	return id;
}
static void probe(uint64_t mnt_id, uint64_t mask, int guard)
{
	struct mnt_id_req req = {
		.size = sizeof(req), .mnt_id = mnt_id, .param = mask,
	};
	long page = sysconf(_SC_PAGESIZE);
	unsigned char *map, *buf;
	uint32_t size;
	long ret;
	map = mmap(NULL, 2 * page, PROT_READ | PROT_WRITE,
		   MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
	memset(map, 0xaa, 2 * page);
	/* 100 byte buffer ending right at the page boundary */
	buf = map + page - 100;
	if (guard)
		mprotect(map + page, page, PROT_NONE);
	errno = 0;
	ret = syscall(__NR_statmount, &req, buf, 100, 0);
	printf("mask 0x%04llx%s: ret %ld errno %d", (unsigned long long)mask,
	       guard ? " guard page" : "", ret, errno);
	if (!guard) {
		memcpy(&size, buf, sizeof(size));
		printf(", size 0x%x, byte[%d] 0x%02x", size, SM_SIZE,
		       buf[SM_SIZE]);
	}
	printf("\n");
	munmap(map, 2 * page);
}
int main(void)
{
	uint64_t id = root_mnt_id();
	probe(id, STATMOUNT_MNT_UIDMAP, 0);
	probe(id, STATMOUNT_FS_SUBTYPE, 0);
	probe(id, STATMOUNT_MNT_UIDMAP, 1);
	return 0;
}

Before, on 7.3.0-rc7-00252-g4e3259b08c54 (vfs.fixes) in a VM, the same on a distro 7.1.13:

mask 0x2000: ret 0 errno 0, size 0x65, byte[512] 0x00
mask 0x0100: ret 0 errno 0, size 0x65, byte[512] 0x00
mask 0x2000 guard page: ret -1 errno 14

After:

mask 0x2000: ret -1 er

---truncated---

Database specific
{
    "cna_assigner":  "Linux",
    "osv_generated_from":  "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99952.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
d49c64c1d723c167f521833f429ab28d3ca7e0d9
Fixed
adbd15a2d4a92eeff7eacee40c378460d0ea0c6f
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
e52e97f09fb66fd868260d05bd6b74a9a3db39ee
Fixed
0be8ba845e49ae45cdaf60e3f38be8514efe5f00
Fixed
a522c991eb26a8b011793fa41659596e6f444f67
Fixed
11eef75006819f4e71d04ca2b9a1fb1580854a55
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
c3787a4fae66e710543137b4b1b073cb2bff3bca

Affected versions

v6.*
v6.12.100
v6.12.101
v6.12.102
v6.12.103
v6.12.104
v6.12.105
v6.12.106
v6.12.107
v6.12.108
v6.12.109
v6.12.110
v6.12.111
v6.12.112
v6.12.113
v6.12.114
v6.12.115
v6.12.116
v6.12.14
v6.12.15
v6.12.16
v6.12.17
v6.12.18
v6.12.19
v6.12.20
v6.12.21
v6.12.22
v6.12.23
v6.12.24
v6.12.25
v6.12.26
v6.12.27
v6.12.28
v6.12.29
v6.12.30
v6.12.31
v6.12.32
v6.12.33
v6.12.34
v6.12.35
v6.12.36
v6.12.37
v6.12.38
v6.12.39
v6.12.40
v6.12.41
v6.12.42
v6.12.43
v6.12.44
v6.12.45
v6.12.46
v6.12.47
v6.12.48
v6.12.49
v6.12.50
v6.12.51
v6.12.52
v6.12.53
v6.12.54
v6.12.55
v6.12.56
v6.12.57
v6.12.58
v6.12.59
v6.12.60
v6.12.61
v6.12.62
v6.12.63
v6.12.64
v6.12.65
v6.12.66
v6.12.67
v6.12.68
v6.12.69
v6.12.70
v6.12.71
v6.12.72
v6.12.73
v6.12.74
v6.12.75
v6.12.76
v6.12.77
v6.12.78
v6.12.79
v6.12.80
v6.12.81
v6.12.82
v6.12.83
v6.12.84
v6.12.85
v6.12.86
v6.12.87
v6.12.88
v6.12.89
v6.12.90
v6.12.91
v6.12.92
v6.12.93
v6.12.94
v6.12.95
v6.12.96
v6.12.97
v6.12.98
v6.12.99
v6.13.10
v6.13.11
v6.13.12
v6.13.3
v6.13.4
v6.13.5
v6.13.6
v6.13.7
v6.13.8
v6.13.9

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99952.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
6.12.14
Fixed
6.12.117
Type
ECOSYSTEM
Events
Introduced
6.13.3
Fixed
6.14
Type
ECOSYSTEM
Events
Introduced
6.14.0
Fixed
6.18.63
Type
ECOSYSTEM
Events
Introduced
6.19.0
Fixed
7.3.4

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99952.json"