径行是什么意思| 轻度脂肪肝有什么症状| 月经不调吃什么药调理最好| 什么叫淋巴结转移| 松露是什么| 儿童乘坐高铁需要什么证件| 汗血宝马什么意思| 尿发黄是什么原因男性| 瓜蒌是什么东西| 炖牛肉放什么| 7月16日什么星座| 红底白杠是什么标志| 阴虱用什么药| 柏油样便见于什么病| 脖子落枕挂什么科| 宝宝睡觉突然大哭是什么原因| 自然堂适合什么年龄| 佬是什么意思| 十三太保什么意思| 三叉神经痛用什么药| 神经炎吃什么药| 38年属什么生肖| 头晕恶心挂什么科| 白细胞2个加号是什么意思| 梅子什么时候成熟| 黄疸高是什么原因引起的| 铁蛋白低吃什么可以补| 爬高上低是什么意思| 什么旺水命| 手脚发抖是什么原因引起的| babyface是什么意思| 胰腺炎是什么症状| 琨字五行属什么| 水蚤吃什么| 中央候补委员什么级别| 补体c4偏低是什么意思| 暇步士属于什么档次| 卧蚕是什么意思| 上皮细胞是什么意思| 床上为什么会有跳蚤| 脸上长肉疙瘩是什么原因| 碱什么意思| 什么的陪伴| 1985年海中金命缺什么| 环球中心有什么好玩的| 从来就没有什么救世主| 合流是什么意思| 蚊子有什么用| 宠物兔吃什么| 秦始皇的名字叫什么| 上眼皮有痣代表什么| 鼻梁骨骨折属于什么伤| 波字五行属什么| 杀鸡给猴看什么意思| 粉红粉红的什么填空| 耳朵响是什么原因| 吃知柏地黄丸有什么副作用| 血小板高有什么危害| 掉头发吃什么药| 红粉是什么意思| 生物钟什么意思| 甲状腺功能挂什么科| 舌头发麻是什么原因| ader是什么牌子| 脸上老长痘痘是什么原因| 当兵有什么好处| 俄罗斯是什么国家| 经常头痛什么原因| 糖尿病人不能吃什么| 便秘喝什么茶好| 咳嗽什么东西不能吃| plus什么意思| 复山是什么意思| petct是什么检查| 载脂蛋白b偏高是什么意思| 右胳膊发麻是什么原因| 9月14号什么星座| 艾灸能治什么| 酸菜鱼是用什么鱼| 县检察长是什么级别| 阴道炎什么症状| 打hcg针有什么作用| 古代质子是什么意思| 头抖是什么原因| 放化疗期间吃什么好| pre是什么的缩写| 1887年属什么生肖| 鲁蛇是什么意思| 丹毒用什么抗生素| ber什么意思| 胃热吃什么食物好| 什么样的眼睛形容词| 1982属什么生肖| 黄金为什么那么贵| 甜叶菊有什么功效| 嘚瑟是什么意思| 腰椎退行性变是什么病| 1288是什么意思| 第六感是什么意思| 狗能吃巧克力吗为什么| 什么药可以推迟月经| 做梦梦到老公出轨代表什么预兆| 女票什么意思| 总是嗜睡是什么原因| 什么行业赚钱| 子宫腺肌症是什么| 红花和藏红花有什么区别| 老炮是什么意思| 烧仙草是什么| 美国为什么制裁伊朗| 晚上10点是什么时辰| butterfly是什么意思| 现在创业做什么好| 龙骨是什么骨头| 拮抗药物是什么药| 大便为什么不成形| 心脏不舒服挂什么科| 强痛定又叫什么| 栀子对妇科有什么功效| 抗核抗体是检查什么病| 移动电源和充电宝有什么区别| 梦见手机坏了是什么意思| 喉咙疼吃什么药| 胃镜取活检意味着什么| 吃什么东西可以补血| 养肝护肝吃什么最好| 安是什么意思| 美洲大蠊主治什么病| 男生的隐私长什么样| 心灵鸡汤什么意思| 催产素是什么| 睡觉流口水是什么毛病| 付之东流是什么意思| hold on什么意思| 空调风扇不转是什么原因| ray是什么意思| 红斑狼疮是什么| 阴虚吃什么水果| 蚕吃什么| 一月27日是什么星座| 10月17是什么星座| 额是什么意思| 什么叫疱疹| 射进去有什么感觉| 九月二十九号是什么星座| as材质是什么材料| 鱼跳出鱼缸有什么征兆| 一直吐口水是什么原因| 天生丽质什么意思| 努嘴是什么意思| 中的五行属性是什么| 微博是什么| 520是什么意思啊搞笑| 安宫牛黄丸治什么病| 做梦梦到牙齿掉了是什么意思| 91年出生属什么生肖| 梦见手抓屎是什么意思| 眼睛发涩是什么原因导致的| 家里为什么突然有床虱| 什么水果补铁效果最好的| 德国什么东西值得买| 魔芋是什么做的| 苋菜是什么菜| 含是什么意思| 急性肠胃炎应该吃什么药| 10月24号什么星座| 什么蛇没有毒| 脾胃虚寒者有什么症状| 人为什么会得抑郁症| 天蝎座与什么星座最配| 看见老鼠有什么预兆| 桃子不能跟什么一起吃| 急性肠胃炎能吃什么水果| 素颜霜是干什么用的| 什么是教育| 硫酸亚铁适合浇什么花| 双侧腋下见淋巴结什么意思| 牙疼吃什么食物好得快| 导乐分娩是什么意思| rian是什么意思| 来月经属于什么期| 舌钉有什么用| 空调一级能效什么意思| 罚金属于什么处罚| 人为什么打呼噜| 近字五行属什么| 烟雾病是什么原因引起的| 什么叫腺样体肥大| 一个口一个坐念什么| mmol是什么单位| 电视剧上星是什么意思| 5月22日是什么星座| 胃不好吃什么好消化又有营养| 疖子用什么药膏最好| 肝胃郁热吃什么中成药| 瘦肉炒什么配菜好吃| 高中生物学什么| 多春鱼为什么全是籽| 绩效工资是什么意思| 术语是什么意思| 疼和痛有什么区别| 可乐必妥是什么药| 梦见挖坟墓预示什么| 九斗一簸箕有什么说法| 菊花茶泡了为什么会变绿| 鼻子出血是什么原因引起的| 巨蟹座是什么象星座| 检测hpv挂什么科| 吃什么雌激素会增多| 不见棺材不落泪是什么生肖| 柠檬泡蜂蜜有什么功效| 穿山甲用什么中药代替| 98年属什么| 高危行为是什么意思| 乳腺增生结节吃什么药效果好| 荨麻疹吃什么药效果好| 罗勒叶在中国叫什么| 覆盆子是什么东西| 虾青素有什么作用| 血糖高吃什么可以降下来| 蘑菇炒什么好吃| 被子植物是什么| 挚爱的意思是什么| 早上起床眼睛浮肿是什么原因| 脚气挂什么科| 5.7是什么星座| 神经性头痛吃什么药好| 龙须菜是什么植物| 蔬菜有什么| 无意间是什么意思| 被蝎子蛰了用什么药| 子宫肌瘤有什么症状| 浑身没劲什么原因| 老赖什么意思| 单宁是什么意思| 鱼泡是鱼的什么器官| 乳头痒用什么药| 一如既往的意思是什么| 白羊座男生喜欢什么样的女生| 1955年属羊的是什么命| 蚕豆病是什么| 南京市徽为什么是貔貅| 查血脂挂什么科| 肛门潮湿是什么情况| 为什么午睡起来会头疼| 什么是氧化剂| 睡眠不足会引起什么症状| 青霉素是什么药| 新陈代谢是什么| 白蛋白是什么| tki是什么意思| 女生打呼噜是什么原因| 为什么拉屎是绿色的| 咳嗽吃什么食物好得最快最有效| 刘邦和项羽是什么关系| 脑梗有什么特效药| 不羁放纵是什么意思| 国家安全法属于什么法| 明朝后面是什么朝代| 宝宝吃益生菌有什么好处和坏处| 血压偏低是什么原因造成的| 手热是什么原因| 男性漏尿是什么原因| 感冒为什么会流眼泪| 百度

凤梨是什么

百度 大众是其品牌的纯电动车系列,其代表了大众未来的设计和技术方向。

This document walks through how to get started adding fuzz tests to Chromium.

It guides you how to use our latest fuzzing technology, called FuzzTest. This replaces earlier technology called libfuzzer. See the section at the end for reasons why you might sometimes still want to use libfuzzer.

What to fuzz

You should fuzz any function which takes input from any untrusted source, such as the internet. If the code parses, decodes, or otherwise manipulates that input, it definitely should be fuzzed!

To decide how best to fuzz it, you should decide which of these two situations best matches your input:

  • Binary data: the input is a single buffer of contiguous bytes, for example an image or some binary format which your code decodes.
  • Function arguments: the input is multiple different chunks of data, for example the arguments to a function.

In the latter case, go ahead and read this guide - it will show you how to use our latest fuzzing technology, FuzzTest.

If however your input more closely matches the former description - just a single binary blob of data - then instead use our older fuzzing technology libfuzzer - click that link for a separate getting started guide. (libfuzzer will work a little better in these cases because if the fuzzer finds a problem, the test case will exactly match the binary format.)

See http://go/chrome-fuzzing-dashboard for which directories lack fuzz coverage.

How to fuzz

  1. Find your existing unit test target. Create a new similar target alongside. (In the future, you'll be able to add them right into your unit test code directly.)
  2. Add a gn target definition a lot like a normal unit test, but with fuzztests = [ list-of-fuzztests ]. See below for details. Create a .cc file.
  3. In the unit tests code, #include "third_party/fuzztest/src/fuzztest/fuzztest.h"
  4. Add a FUZZ_TEST macro, which might be as simple as FUZZ_TEST(MyApiTest, ExistingFunctionWhichTakesUntrustedInput) (though you may wish to structure things differently, see below)
  5. Run the unit tests and ensure they pass.
  6. Land the CL.

That's it!

This fuzzer will be built automatically, using various [sanitizers], and run on our distributed fuzzing infrastructure ClusterFuzz. If it finds bugs, they'll be reported back to you.

More detail in all the following sections.

Creating a new FUZZ_TEST target

import("//testing/test.gni")

test("hypothetical_fuzztests") {
  sources = [ "hypothetical_fuzztests.cc" ]

  fuzztests = ["MyApiTest.MyApiCanSuccessfullyParseAnyString"]

  deps = [
    ":hypothetical_component",
    "//third_party/fuzztest:fuzztest_gtest_main",
  ]
}

You may also need to add third_party/fuzztest to your DEPS file.

Adding FUZZ_TEST support to a target

We also support adding FUZZ_TESTs alongside existing unit tests, even in the same .cc file.

test("existing_unit_tests") {
  sources = [ "existing_unit_tests.cc" ] # add FUZZ_TESTs here

  fuzztests = ["MyApiTest.ApiWorksAlways"]
    # Add this!

  deps = [
    ":existing_component",
    # Other stuff
  ]
}

This will:

  • add a dependency on the appropriate fuzztest libraries;
  • cause the target to be built on all our fuzzer builders
  • construct metadata so that ClusterFuzz knows how to run the resulting binary.

This relies on something, somewhere, calling base::LaunchUnitTests within your executable to initialize FuzzTest. This should be the case already.

(If you have other code targets, such as source_sets, contributing to your unit test target they may need to explicitly depend upon //third_party/fuzztest too.)

Note: This may not yet work reliably in browser_tests. We're working on it.

Adding FUZZ_TESTs in the code

First, #include "third_party/fuzztest/src/fuzztest/fuzztest.h".

Then, it‘s normal to create a function named after the thing you’re trying to prove, with assertions to prove it.

For instance,

void MyApiCanSuccessfullyParseAnyString(std::string input) {
    bool success = MyApi(input);
    EXPECT_TRUE(success);
}

Then, declare the FUZZ_TEST macro:

FUZZ_TEST(MyApiTest, MyApiCanSuccessfullyParseAnyString);

Our fuzzing infrastructure will generate all possible strings and prove it works. Obviously, that takes infinite time, so instead our fuzzing infrastructure will carefully craft strings to explore more and more branches within MyApi, mutating the input according to code coverage, so there's a good chance bugs will be found quickly.

Fuzzing should always be alongside traditional unit testing - never rely on it to find all the bugs! It should be a backstop to prevent unexpected security flaws sneaking past your regular testing.

In more complex cases, you'll need to tell FuzzTest about the expected domains of valid input. For example:

void MyApiAlwaysSucceedsOnPositiveIntegers(int i) {
  bool success = MyApi(i);
  EXPECT_TRUE(success);
}
FUZZ_TEST(MyApiTest, MyApiAlwaysSucceedsOnPositiveIntegers)
    .WithDomains(/*i:*/fuzztest::Positive<int>());

See the FuzzTest reference for all your options here.

Running this locally

Simply build and run your unit tests as normal. FUZZ_TESTs are supported only on some platforms. If you‘re on such a platform, you’ll see your fuzz test run for one second:

[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from ScaleFuzz
[ RUN      ] ApiTest.MyApiCanSuccessfullyParseAnyString
[       OK ] ApiTest.MyApiCanSuccessfullyParseAnyString (1000 ms)
[----------] 1 test from ScaleFuzz (1000 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (1000 ms total)
[  PASSED  ] 1 test.

On other platforms, the test will be ignored.

If you want to try actually fuzzing with FuzzTest, modify your gn arguments to contain:

enable_fuzztest_fuzz=true
is_component_build=false

You can then run your unit test with the extra command line argument --fuzz=, optionally specifying a test name. You'll see lots of output as it explores your code:

[*] Corpus size:     1 | Edges covered:     73 | Fuzzing time:        1.60482ms | Total runs:  1.00e+00 | Runs/secs:   623 | Max stack usage:        0
[*] Corpus size:     2 | Edges covered:    103 | Fuzzing time:          1.844ms | Total runs:  2.00e+00 | Runs/secs:  1084 | Max stack usage:        0
[*] Corpus size:     3 | Edges covered:    111 | Fuzzing time:       2.747931ms | Total runs:  3.00e+00 | Runs/secs:  1091 | Max stack usage:        0
[*] Corpus size:     4 | Edges covered:    135 | Fuzzing time:        2.92305ms | Total runs:  4.00e+00 | Runs/secs:  1368 | Max stack usage:        0
[*] Corpus size:     5 | Edges covered:    173 | Fuzzing time:        3.35237ms | Total runs:  5.00e+00 | Runs/secs:  1491 | Max stack usage:        0
[*] Corpus size:     6 | Edges covered:    178 | Fuzzing time:        4.15666ms | Total runs:  6.00e+00 | Runs/secs:  1443 | Max stack usage:        0

(“Edges covered”) is how many different code blocks have been explored (that is, sections between branches). Over time, you'll see it explore more and more until it runs out of new edges to explore.

Landing the CL

Nothing special is required here!

After a day or two, we should see ClusterFuzz starting to run your new fuzzer, and it should be visible on ClusterFuzz Fuzzer Stats. Look for fuzzers starting with centipede_ or ‘libfuzzer_’ and your test target's name.

Thanks very much for doing your part in making Chromium more secure!

Unusual cases

There are some situations where FuzzTests may not work. For example:

  • You need to run on platforms not currently supported by FuzzTest
  • You need more structured input
  • You need to mutate the input in a more precise way
  • Your fuzzer input is a single binary blob

In these cases, you may be best off creating a standalone fuzzer using our older fuzzing technology, libfuzzer. There are further options beyond that, e.g. uploading “black box” fuzzers to ClusterFuzz, or even running fuzzers outside of ClusterFuzz which then upload results to ClusterFuzz for triage and diagnosis. To explore any of those options, please discuss with the fuzzing team (email security@chromium.org if you're outside Google).

鹿茸是什么 不加要是什么字 lt是什么意思 吃什么补内膜最快 万足读什么
仲夏是什么意思 吃什么治疗便秘 左后脑勺疼是什么原因 梦见盖新房子是什么意思 黄曲霉菌是什么颜色
护士节送什么鲜花 什么是继发性高血压 为什么总长火疖子 红色学士服是什么学位 职别是什么意思
为什么招蚊子咬 9k金是什么意思 2月出生的是什么星座 好麻吉是什么意思 为什么新疆人不吃猪肉
桃李满天下是什么生肖hcv9jop1ns2r.cn 封豕长蛇是什么意思hcv8jop2ns7r.cn 高温丝假发是什么材质hcv9jop2ns8r.cn 西席是什么意思xinjiangjialails.com 什么是hpv病毒hcv7jop9ns4r.cn
五险一金指什么hcv9jop3ns5r.cn 久视伤血是什么意思jasonfriends.com 齁不住是什么意思hcv9jop8ns3r.cn 痰带血丝是什么原因hcv9jop1ns7r.cn 弓形虫抗体阳性是什么意思adwl56.com
2009年是什么年hcv8jop0ns0r.cn 羊水穿刺是检查什么hcv9jop3ns8r.cn 手麻脚麻吃什么药hcv9jop3ns4r.cn 台湾有什么特产hcv8jop3ns1r.cn 眼前发黑是什么原因hcv9jop0ns7r.cn
精虫上脑什么意思hcv8jop9ns3r.cn 什么是老年斑图片hcv9jop8ns0r.cn 一唱一和是什么生肖hcv8jop7ns2r.cn 长寿的秘诀是什么cj623037.com 肠胃不好吃什么食物好hcv9jop4ns3r.cn
百度