zeroize: possible UB in `Zeroize` implementation for `Option<T>`
まだ誰も着手していません。
評価
調査の方向性
zeroize/src/lib.rs の330行目付近から始め、リンクされた Rust Playground または Miri の例を使って報告された動作を再現します。Option の実装に対する健全なアプローチを決定し、結果として得られる動作が報告された未定義動作エラーをもはや発生させないことを検証します。
索引モデルが issue の本文から書いたものです。
説明
Originally filed by @jessa0 as https://github.com/iqlusioninc/crates/issues/782:
It seems the
Zeroizeimplementation forOption<T> where T: Zeroizehas language-level UB here:I believe, as a
repr(Rust)enum, the memory layout and set of valid bit-patterns forOptionis not defined, and that setting an enum's storage to an invalid bit-pattern while a reference to it exists, even if the value is never read, is instant language-level UB. The documentation forOptiondoes mention guarantees for several special cases, but theNonecase still isn't defined for many of those cases, and theZeroizeimplementation is more generic than that. Here's an example of a miri error in such a situation, that scottmcm came up with on URLO here.
- 主要言語
- Rust
- スター
- 674
- フォーク
- 170
- 平均マージ
- 1日 12時間
- マージ済み PR(30日)
- 10
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RustCrypto/utils のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
RustCrypto/utils#1546 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
RustCrypto/utils#1537 · コメント 7 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
RustCrypto/utils#1534 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
RustCrypto/utils#1529 · コメント 4 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
RustCrypto/utils#1510 · コメント 1 件 ·
RustCrypto/utils の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
bug core
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW オープンfuzz
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ClickHouse/ClickHouse#122114 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
linebender/vello_svg#90 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100