mmap of non-mappable character devices succeeds

Abierto
#499 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c, linux

Línea de trabajo

Start by tracing the mmap handling and mmap_refused_errno logic, then compare how character-device and anon-inode file descriptors are classified. The issue gives /dev/null, /dev/urandom, /dev/zero, and several anon-inode descriptors as cases to investigate. Done means the no-limit and over-limit results match Linux for these cases, including ENODEV for devices that cannot be mapped.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

mmap of a character device that Linux cannot map succeeds under elfuse. Linux returns ENODEV, because the device's file operations have no mmap.

Measured with a probe, under elfuse at #485 (6fbbc9f) and on Linux:

fd Linux, no limit elfuse, no limit Linux, over RLIMIT_AS elfuse, over RLIMIT_AS
/dev/null ENODEV maps ENODEV ENOMEM
/dev/urandom ENODEV maps ENODEV ENOMEM
/dev/zero maps maps ENOMEM ENOMEM
eventfd, epoll, timerfd, signalfd ENODEV other errno ENODEV ENODEV

"Over RLIMIT_AS" is an 8 GiB MAP_PRIVATE PROT_READ request with the limit at 4 GiB. The probe found two gaps:

  • Character devices: elfuse does not track which ones can be mapped. A fix would decide this per device (for example, allow /dev/zero and refuse the others with ENODEV) on the no-limit path. The over-limit path in mmap_refused_errno would then use the same check.
  • Anon-inode fds: with no limit set, they return a different errno than Linux's ENODEV.

Raised by review on #485 (r4506898326).

Lenguaje dominante
C
Estrellas
287
Forks
33
Merge medio
2 d 17 h
PR fusionados (30 d)
18

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de sysprog21/elfuse

Todos los issues de sysprog21/elfuse

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.