知识卡片
模糊驱动连接字节入口与引擎
cargo-fuzz把libFuzzer等基础设施与Rust字节入口连接,驱动将任意输入交给被测函数。示例长度判断>=3却访问data[3],三字节FUZ即可暴露越界。工具只能探索有限输入,未发现崩溃不等于没有错误,语料与覆盖也需持续维护。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter 5. Tooling Fuzz Testing · 查看原书依据
fuzz_target!(|data: &[u8]| { let _ = somecrate::is_fuzz(data); }); Running cargo +nightly fuzz run target1 continuously executes the fuzz target with random data, stopping only if a crash is found. In this case, a failure is found almost immediately: INFO: Running with entropic power schedule (0xFF, 100). INFO: Seed: 1607525774 INFO: Loaded 1 modules: 1624 [
参考来源
- 位置:《Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)》第5章《Fuzz Testing》(spine9;extracted/Effective Rust 35 Specific Ways to Improve Your Rust Code (David Drysdale)/_epub-src/OEBPS/ch05.html;u157-ch05-029)。
- 结论依据:原文在“fuzz_target!”附近的定义、例子或代码支撑本卡核心说明:cargo-fuzz把libFuzzer等基础设施与Rust字节入口连接,驱动将任意输入交给被测函数。边界按已读前提解释;示例未执行。
- 原始内容:fuzz_target!(|data: &[u8]| { let _ = somecrate::is_fuzz(data); }); Running cargo +nightly fuzz run target1 continuously executes the fuzz target with random data, stopping only if a crash is found. In this case, a failure is found almost immediately: INFO: Running with entropic power schedule (0xFF, 100). INFO: Seed: 1607525774 INFO: Loaded 1 modules: 1624 [