F_ADD_SEALS ignores writable shared mappings
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
- Ambito
- operating-systems
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
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di sysprog21/elfuse
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 62/100
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di sysprog21/elfuse
Issue simili
-
tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
antoxa2584x/nfsu2-sw#44 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
codepointerapp/codepointer#231 ·