bytecodealliance / bytecodealliance/cap-std
Use O_NOFOLLOW_ANY on macOS
- 主要言語
- Rust
- スター
- 821
- フォーク
- 57
- 平均マージ
- 1時間 16分
- マージ済み PR(30日)
- 4
説明
According to [this blog post](https://blog.malwarebytes.com/mac/2021/08/macos-11s-hidden-security-improvements/#O_NOFOLLOW_ANY), macos 11 has a new `O_NOFOLLOW_ANY` flag that causes `open` to fail if any path component is a symlink. Assuming symlinks are relatively rare, cap-std could use this as a fast path -- check that the path contains no explicit `..` and then open with `O_NOFOLLOW_ANY`; if that succeeds, then we're done. If either of those fails, open with the slow path.
コントリビューションガイド
調査の方向性
まず、cap-std のパスオープンのエントリポイントと、symlink 処理における既存の高速パスおよび低速パスを追跡します。明示的な `..` コンポーネントがどのように検出されるか、またプラットフォーム固有の open フラグがどのように定義されているかを確認します。macOS 11 が安全な場合に `O_NOFOLLOW_ANY` を使用でき、既存の低速パスが引き続きフォールバックケースを処理できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- macos, rust
- 領域
- operating-systems, security
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100