Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Issue 2791193005: Add fuzzer test for preg_parser (Closed)

Created:
3 years, 8 months ago by ljusten (tachyonic)
Modified:
3 years, 8 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, fuzzing_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add fuzzer test for preg_parser The fuzzer does not hook into ReadFile since that reads files and uses PolicyLoadStatusSample, which in turn creates a histogram entry. This leads to OOM quicky since the samples accumulate. Thus, this CL adds a new equivalent ReadData that reads data from memory and writes status to an PolicyLoadStatus enum. BUG=660007 TEST=Compiled, ran unit tests and fuzzer Review-Url: https://codereview.chromium.org/2791193005 Cr-Commit-Position: refs/heads/master@{#465179} Committed: https://chromium.googlesource.com/chromium/src/+/479c5684bd7b22ab6305c20ae7266506f39149f5

Patch Set 1 #

Patch Set 2 : Can't char string concat base::FilePath::value()s on Windows since file paths are UTF16 there. #

Total comments: 5

Patch Set 3 : Separated proper root key handling from actual fuzzer. #

Patch Set 4 : Renamed ReadData to ReadDataInternal and updated comment. #

Total comments: 12

Patch Set 5 : Comments and tweaks. #

Patch Set 6 : Compile preg parser on Linux #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -32 lines) Patch
A chrome/test/data/policy/gpo/fuzzer.dict View 1 chunk +23 lines, -0 lines 0 comments Download
A chrome/test/data/policy/gpo/fuzzer_corpus/empty.pol View Binary file 0 comments Download
A chrome/test/data/policy/gpo/fuzzer_corpus/extension_alternative_spelling.pol View Binary file 0 comments Download
A chrome/test/data/policy/gpo/fuzzer_corpus/registry.pol View Binary file 0 comments Download
A chrome/test/data/policy/gpo/fuzzer_corpus/test1.pol View Binary file 0 comments Download
A chrome/test/data/policy/gpo/fuzzer_corpus/test2.pol View Binary file 0 comments Download
A chrome/test/data/policy/gpo/fuzzer_corpus/test3.pol View Binary file 0 comments Download
A chrome/test/data/policy/gpo/fuzzer_corpus/test4.pol View Binary file 0 comments Download
A chrome/test/data/policy/gpo/fuzzer_corpus/test5.pol View Binary file 0 comments Download
A chrome/test/data/policy/gpo/fuzzer_corpus/test6.pol View Binary file 0 comments Download
M components/policy/core/common/BUILD.gn View 1 2 3 4 5 5 chunks +19 lines, -3 lines 0 comments Download
M components/policy/core/common/preg_parser.h View 1 2 3 4 3 chunks +16 lines, -4 lines 0 comments Download
M components/policy/core/common/preg_parser.cc View 1 2 3 5 chunks +42 lines, -25 lines 1 comment Download
A components/policy/core/common/preg_parser_fuzzer.cc View 1 2 3 4 1 chunk +44 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (16 generated)
ljusten (tachyonic)
Hey, PTAL.
3 years, 8 months ago (2017-04-04 12:00:31 UTC) #4
Mattias Nissler (ping if slow)
Nice! Did the fuzzer find anything? How long have you been running it? I'd personally ...
3 years, 8 months ago (2017-04-07 08:13:26 UTC) #11
Thiemo Nagel
> I'd personally have preferred to split this into two changes, > one for fixing ...
3 years, 8 months ago (2017-04-07 09:39:57 UTC) #12
Thiemo Nagel
https://codereview.chromium.org/2791193005/diff/20001/components/policy/core/common/preg_parser.h File components/policy/core/common/preg_parser.h (right): https://codereview.chromium.org/2791193005/diff/20001/components/policy/core/common/preg_parser.h#newcode45 components/policy/core/common/preg_parser.h:45: POLICY_EXPORT bool ReadData(const uint8_t* data, On 2017/04/07 09:39:57, Thiemo ...
3 years, 8 months ago (2017-04-07 09:55:41 UTC) #13
ljusten (tachyonic)
PTAL. I've split the change up and will commit the second part (proper root key ...
3 years, 8 months ago (2017-04-10 10:22:51 UTC) #15
Mattias Nissler (ping if slow)
LGTM - you need Thiemo's OWNERS stamp though.
3 years, 8 months ago (2017-04-12 08:26:58 UTC) #16
Thiemo Nagel
Lgtm % nits. Adding ochang for the fuzzer parts, please wait for his approval. https://codereview.chromium.org/2791193005/diff/60001/components/policy/core/common/preg_parser.h ...
3 years, 8 months ago (2017-04-12 17:10:06 UTC) #18
Oliver Chang
https://codereview.chromium.org/2791193005/diff/60001/components/policy/core/common/BUILD.gn File components/policy/core/common/BUILD.gn (right): https://codereview.chromium.org/2791193005/diff/60001/components/policy/core/common/BUILD.gn#newcode352 components/policy/core/common/BUILD.gn:352: if (is_win || is_chromeos) { I wasn't aware that ...
3 years, 8 months ago (2017-04-13 00:25:23 UTC) #19
ljusten (tachyonic)
Oliver, PTAL. Side question, should I check in the corpus that is generated during a ...
3 years, 8 months ago (2017-04-13 11:17:15 UTC) #20
Oliver Chang
fuzzer LGTM % comment about making this buildable on linux https://codereview.chromium.org/2791193005/diff/60001/components/policy/core/common/BUILD.gn File components/policy/core/common/BUILD.gn (right): https://codereview.chromium.org/2791193005/diff/60001/components/policy/core/common/BUILD.gn#newcode352 ...
3 years, 8 months ago (2017-04-13 19:58:24 UTC) #21
ljusten (tachyonic)
Thanks, it's compiling on Linux now. It's probably a good idea to compile and test ...
3 years, 8 months ago (2017-04-18 07:47:31 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2791193005/100001
3 years, 8 months ago (2017-04-18 07:55:02 UTC) #25
commit-bot: I haz the power
Committed patchset #6 (id:100001) as https://chromium.googlesource.com/chromium/src/+/479c5684bd7b22ab6305c20ae7266506f39149f5
3 years, 8 months ago (2017-04-18 08:50:37 UTC) #28
brucedawson
I noticed this while looking at new warnings from the experimental VC++ /analyze builder. https://codereview.chromium.org/2791193005/diff/100001/components/policy/core/common/preg_parser.cc ...
3 years, 8 months ago (2017-04-20 18:18:12 UTC) #30
ljusten (tachyonic)
3 years, 8 months ago (2017-04-20 20:16:32 UTC) #31
Message was sent while issue was closed.
Thanks, I'll take care of it. We've enabled -Wextra in our ChromeOS project,
which includes shadowing. I'd be all for enabling this for everything. It also
catches unused function parameters. I was surprised to learn that -Wall doesn't
include these warning.

Powered by Google App Engine
This is Rietveld 408576698