zeroize: do not rely on volatile operations?
还没有人认领这个 Issue。
评估
调研方向
首先检查 zeroize 的实现以及 zeroize/src/barrier.rs 中强化的 black_box,同时查看 #1252 中的 optimization_barrier 更改。确定在所有受支持的 target 上,简单写入是否可以替代 volatile 写入,然后一致地更新实现和文档。
由索引模型根据 Issue 内容生成。
描述
write_volatile docs explicitly state that:
Volatile operations are intended to act on I/O memory.
Using it on a non-volatile memory does not cause soundness issues, but it still can be considered a misuse of the function. It also can result in a very suboptimal codegen as noted in #743.
#1252 has introduced optimization_barrier which allows us to use simple writes optimizable by the compiler which are then "observed" by the barrier to prevent removal of the writes.
Unless we discover some practical issues with optimization_barrier, I think we can replace the volatile writes with simple writes. It would require changing promises made in the docs, but it should not matter in practice for downstream users.
As a potential compromise we could keep using volatile writes only on targets which do not have stable asm! macro and where optimization_barrier has to use the "hardened" black_box.
- 主要语言
- Rust
- 星标
- 674
- 派生
- 170
- 平均合并
- 1 天 12 小时
- 30 天内合并 PR
- 10
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 一周以上 新手友好度 45/100
RustCrypto/utils#1529 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 45/100
RustCrypto/utils#1510 · 1 条评论 ·
相似的 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