RUSTSEC-2026-0386: `AsyncFd::new` and related constructors violate I/O safety
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、プロジェクトの Tokio 依存関係を、 advisory の修正済みバージョン範囲と照合してください。AsyncFd::new、with_interest、try_new、try_with_interest のすべての使用箇所を確認したうえで、所有権とディスクリプタ的生命周期を保証できる、記載済みの安全でないコンストラクタへ移行してください。選択した Tokio バージョンが影響を受けず、関連するテストが安全でないファイルディスクリプタを使用せずに成功すれば、作業は完了です。
索引モデルが issue の本文から書いたものです。
説明
| Details | |
|---|---|
| Package | tokio |
| Version | 1.45.1 |
| Warning | unsound |
| URL | https://github.com/tokio-rs/tokio/pull/8587 |
| Patched Versions | >=1.51.6, <1.52.0 OR >=1.53.3 |
| Unaffected Versions | <0.3.2 |
tokio::io::unix::AsyncFd provides safe constructors (new, with_interest, try_new, and try_with_interest) that accept any T: AsRawFd rather than requiring proof of ownership or validity of the file descriptor. Because RawFd implements AsRawFd, safe code can construct an AsyncFd from an arbitrary or closed file descriptor, or close/replace the underlying file descriptor while the AsyncFd is still alive.
This violates I/O safety in two ways:
AsyncFd<T>implementsAsFdfor allT: AsRawFdby callingBorrowedFd::borrow_raw(self.as_raw_fd()), allowing safe code to obtain an arbitraryBorrowedFd<'_>without owning the file descriptor.- Tokio's I/O driver stores a pointer to an internal allocation in the
epoll/kqueueuser data for registered file descriptors. If the underlying file descriptor is duplicated and then closed while anAsyncFdis alive, and the OS reuses that file descriptor number for a another IO resource on the same runtime, dropping the firstAsyncFdderegisters the reused file descriptor number and frees the first while the original file description remains registered inepoll, leading to a use-after-free when a readiness event fires.
Starting in Tokio 1.51.6, 1.53.3, and 1.54.0, AsyncFd::new, AsyncFd::with_interest, AsyncFd::try_new, and AsyncFd::try_with_interest are deprecated in favor of the unsafe constructors AsyncFd::register and AsyncFd::register_with_interest. Callers must ensure that the file descriptor remains valid, open, and unchanged for the lifetime of the AsyncFd.
- 主要言語
- Rust
- スター
- 10
- フォーク
- 8
- 平均マージ
- 11日 12時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bitcoindevkit/electrum_streaming_client のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
bitcoindevkit/electrum_streaming_client#56 ·
メンテナーはふだん 2 日以内に返信
-
GetTx documentationオープンdocumentation
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
bitcoindevkit/electrum_streaming_client#29 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 18/100
bitcoindevkit/electrum_streaming_client#55 ·
メンテナーはふだん 2 日以内に返信
-
RUSTSEC-2026-0221: `event-listener` allows `!Send` tags to cross thread boundaries via `StackSlot`オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 51/100
bitcoindevkit/electrum_streaming_client#54 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 1/100
bitcoindevkit/electrum_streaming_client#53 ·
メンテナーはふだん 2 日以内に返信
bitcoindevkit/electrum_streaming_client の issue をすべて見る
似ている issue
-
area/backends bug session-analysis
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
メンテナーはふだん 1 日以内に返信
-
docs good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
crash
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
aaif-goose/goose#13125 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信