Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

F_ADD_SEALS ignores writable shared mappings

Abierto
#442 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

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

Línea de trabajo

Start from the F_ADD_SEALS handling for memfds and the region table that tracks the process's shared writable mappings; the issue's table gives the four probe cases to reproduce. Done means F_SEAL_WRITE returns EBUSY while a writable MAP_SHARED mapping exists, and the private and no-map cases still succeed. The per-inode count across forked processes is an open design question, so settle that approach with maintainers before writing code.

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

Descripción

On Linux, fcntl(F_ADD_SEALS, F_SEAL_WRITE) fails with EBUSY while a writable MAP_SHARED mapping of the memfd exists (memfd_add_seals calls mapping_deny_writable). F_SEAL_EXEC on a memfd whose mode has an execute bit implies F_SEAL_WRITE and fails the same way. elfuse accepts both.

A probe that creates a MFD_ALLOW_SEALING memfd, sizes it to 4096 bytes, optionally maps it PROT_READ|PROT_WRITE, then adds the seal:

Case Linux 6.12 (qemu lane) elfuse
F_SEAL_WRITE, shared writable map EBUSY, seals 0x0 0, seals 0x8
F_SEAL_EXEC on a 0777 memfd, shared writable map EBUSY, seals 0x0 0, seals 0x3e
F_SEAL_WRITE, private map 0, seals 0x8 0, seals 0x8
F_SEAL_WRITE, no map 0, seals 0x8 0, seals 0x8

Linux counts writable mappings per inode, across every process. After a fork, an elfuse child is a separate host process with its own mappings, so a check against the calling process's region table alone would be right only until the first fork. The F_SEAL_WRITE case exists on main; the F_SEAL_EXEC case arrives with #421. Linux also refuses mmap(MAP_SHARED, PROT_WRITE) on a file that already carries F_SEAL_WRITE; that side has not been checked under elfuse.

Lenguaje dominante
C
Estrellas
273
Forks
29
Merge medio
2 d 10 h
PR fusionados (30 d)
17

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.