Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

F_ADD_SEALS ignores writable shared mappings

Aperta
#442 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c, linux, macos

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C
Stelle
273
Fork
29
Merge medio
2g 10h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sysprog21/elfuse

Tutte le issue di sysprog21/elfuse

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.