Concurrent writers can grow a file past RLIMIT_FSIZE
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- c, linux, macos
調査の方向性
Start with fsize_room and fsize_limit_write in src/syscall/io.c, then trace their callers for descriptor-position writes, O_APPEND, and offsetless sendfile or splice. The issue requires coordination across threads, forked processes, and independent opens without colliding with guest locks; read the linked discussion on #435 and #463 for context. Done means concurrent regular-file writes cannot grow the file past a finite RLIMIT_FSIZE.
索引モデルが issue の本文から書いたものです。
説明
Background
#463 enforces RLIMIT_FSIZE on regular-file writes. A write that goes by the descriptor's own position reads that position, sizes itself against the limit, and then the host writes at whatever the position is by then. The affected calls are write, writev, an O_APPEND descriptor, pwritev2 with RWF_APPEND, and sendfile or splice with no output offset. Two writers on one open file description can each fit the same remaining room, so the file ends past the limit by at most one write per extra writer. An O_APPEND writer has the same window even without a shared description: two writers that each opened the file with O_APPEND both size themselves against the current file size. pwrite and pwritev at an explicit offset are not affected, because each lands inside the limit by its own arithmetic.
Linux behavior
Linux has no such window: the size check in generic_write_checks and the write run under the inode lock (inode_lock in generic_file_write_iter), so concurrent writers see each other's growth.
Goal
A guest under a finite RLIMIT_FSIZE cannot grow a regular file past the limit, however many threads or processes write to it at the same time, through one open file description or through separate ones opened with O_APPEND.
Constraints
- A mutex inside one elfuse process covers threads only. Fork children are separate host processes that share the host file description, so the serialization has to reach across the fork family. Separate O_APPEND opens can come from unrelated processes, two independent elfuse invocations included, so it has to coordinate on the file itself.
- A host
flockorfcntllock on the guest's file would collide with the guest's own locks on it.
Evidence
This is from reading the code on #463 (fsize_room and fsize_limit_write in src/syscall/io.c, and their callers), not from a measured run; a reproducer depends on two writers landing in the window. First raised on #435 (https://github.com/sysprog21/elfuse/pull/435#discussion_r4245829599) and again on #463 (https://github.com/sysprog21/elfuse/pull/463#discussion_r4362471747).
- 主要言語
- C
- スター
- 275
- フォーク
- 29
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 18
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/elfuse のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 3 日以内に返信
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 3 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 3 日以内に返信
sysprog21/elfuse の issue をすべて見る
似ている issue
-
difficulty: easy
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
performance solver
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
ChefKissInc/Inferno#319 ·
-
llvm-tools
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
llvm/llvm-project#235522 ·
メンテナーはふだん 1 日以内に返信