Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

F_ADD_SEALS ignores writable shared mappings

オープン
#442 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c, linux, macos

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C
スター
273
フォーク
29
平均マージ
2日 10時間
マージ済み PR(30日)
17

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

sysprog21/elfuse のほかの issue

sysprog21/elfuse の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。