PT-2026-162919
CVE-2026-99952
·
تاريخ النشر
2026-11-30
·
تاريخ التحديث
2026-11-30
الوصف من
الدرجة
N/A
غير متوفرلا تتوفر حاليًا تقييمات أو مقاييس للخطورة. سنحدّث المعلومات المقابلة في الصفحة فور توفرها.
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("
");
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---
وجدت خطأً في الوصف؟ لديك ما تضيفه؟ لا تتردد في مراسلتنا 👾