Skip to content

[fuzz]network-level WriteFilter generic fuzzer#12462

Merged
mattklein123 merged 91 commits intoenvoyproxy:masterfrom
jianwen612:writefilter_fuzz
Aug 10, 2020
Merged

[fuzz]network-level WriteFilter generic fuzzer#12462
mattklein123 merged 91 commits intoenvoyproxy:masterfrom
jianwen612:writefilter_fuzz

Conversation

@jianwen612
Copy link
Contributor

@jianwen612 jianwen612 commented Aug 4, 2020

Additional Description:
A generic fuzzer to test all network-level WriteFilters. There are 5 WriteFilters now in Envoy, and now this fuzzer can cover 4 of them. Postgres_proxy doesn't support untrusted data currently(#12340), so I didn't cover it.

Risk Level: Low
Testing:
This fuzzer covered onWrite() methods of all the WriteFilters. Since those 4 filters are also subclasses of ReadFilter, onData() and onNewConnection() will be covered in by another fuzzer network_readfilter_fuzzer(#12086).

Coverage report for 4 filters with this single fuzzer(running for 60 seconds):
Directory name------------------------------------------------------------------/ Line Coverage / Functions coverage
source/extensions/filters/network/kafka/broker----------/ 36 % 32 / 89 / 45.8 % 11 / 24
source/extensions/filters/network/zookeeper_proxy-----/28 % 244 / 871 /31.8 % 27 / 85
source/extensions/filters/network/mysql_proxy-----------/11.8 % 94 / 795 /15.7 % 19 / 121
source/extensions/filters/network/mongo_proxy-----------/6.5 % 122 / 1868/ 7.6 % 17 / 233

Since this fuzzer only tests the interface of WriteFilter, the overall coverage of these filters should be a combination of WriteFilter generic fuzzer and ReadFilter generic fuzzer.

/cc @asraa
/cc @samkerner

Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
for ext_auth by enabling the mocked response.
Fixed the validation problem inside client_ssl_auth's protobuf
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
issues

Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
use-after-free problem.

Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
sqkerner
sqkerner previously approved these changes Aug 5, 2020
sqkerner
sqkerner previously approved these changes Aug 6, 2020
Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Just a couple small comments

Signed-off-by: jianwen <jianwendong@google.com>
name = "network_writefilter_fuzz_test",
srcs = ["network_writefilter_fuzz_test.cc"],
corpus = "network_writefilter_corpus",
# All Envoy network filters must be linked to the test in order for the fuzzer to pick
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the deps below added instead of envoy_all_network_filters to exclude postgres?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the deps below added instead of envoy_all_network_filters to exclude postgres?

envoy_all_network_filters includes 20 filters and only 5 of them are WriteFilters. And yes, I exclude postgres here. But another reason is to exclude all those ReadFilters to reduce linking time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good for now -- I just wonder if somoene adds a write filter it may get missed.

Copy link
Contributor

@asraa asraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@mattklein123 mattklein123 merged commit d651d2e into envoyproxy:master Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants