Skip to content

[fuzz] added fuzzer for network filter "ext_authz" #11702

Merged
asraa merged 11 commits intoenvoyproxy:masterfrom
jianwen612:ext_authz_fuzz
Jul 7, 2020
Merged

[fuzz] added fuzzer for network filter "ext_authz" #11702
asraa merged 11 commits intoenvoyproxy:masterfrom
jianwen612:ext_authz_fuzz

Conversation

@jianwen612
Copy link
Copy Markdown
Contributor

Commit Message:
Additional Description:
Added fuzz test code for network filter ext_authz. Added test input protobuf. Added two simple test cases.

Risk Level: Low
Testing:

After running for one minute with libfuzzer:
Line coverage for the .cc and .h files of ext_authz is 94.9 %
Function coverage for the .cc and .h files of ext_authz is 81.2%

Running with libfuzzer(compiled with opt parameter), some output:

#[1001] NEW cov: 52728 ft: 68301 corp: 231/89Kb lim: 4096 exec/s: 250 rss: 263Mb L: 516/1547 MS: 1 CustomCrossOver-

#[2001] NEW cov: 53794 ft: 76654 corp: 358/194Kb lim: 4096 exec/s: 250 rss: 339Mb L: 2186/2280 MS: 5 CustomCrossOver-CustomCrossOver-CustomCrossOver-InsertRepeatedBytes-Custom-

#[3002] NEW cov: 54462 ft: 81081 corp: 447/283Kb lim: 4096 exec/s: 230 rss: 417Mb L: 1199/2486 MS: 7 Custom-ChangeBinInt-Custom-CopyPart-EraseBytes-ChangeByte-Custom-

#[5132] NEW cov: 54812 ft: 87536 corp: 575/441Kb lim: 4096 exec/s: 233 rss: 575Mb L: 1150/3625 MS: 4 Custom-CustomCrossOver-InsertRepeatedBytes-Custom-

/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>
@jianwen612 jianwen612 requested a review from dio as a code owner June 22, 2020 21:04
"resultCaseToCheckStatus" function.

Signed-off-by: jianwen <jianwendong@google.com>
Copy link
Copy Markdown
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.

Some quick comments, @dio can you take a look from the ext_authz side?

filter_callbacks.connection_.raiseEvent(Network::ConnectionEvent::RemoteClose);
break;
}
case envoy::extensions::filters::network::ext_authz::Action::kLocalClose: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a contract about this? If the we have a LocalClose and then try to call onData, what happens?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is there a contract about this? If the we have a LocalClose and then try to call onData, what happens?

LocalClose and RemoteClose will have the same effect on the filter: if there is a call which is being processed, the filter will cancel it. And stats info will change config_->stats().active_.dec(); No other effect on following onData().

@asraa asraa self-assigned this Jun 23, 2020
variable addr

Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: jianwen <jianwendong@google.com>
@asraa
Copy link
Copy Markdown
Contributor

asraa commented Jun 24, 2020

I think you may need to merge master to fix the coverage CI failure.

Merge remote-tracking branch 'upstream/master' into ext_authz_fuzz

Signed-off-by: jianwen <jianwendong@google.com>
@jianwen612
Copy link
Copy Markdown
Contributor Author

I think you may need to merge master to fix the coverage CI failure.

Thanks! Merged.

@asraa
Copy link
Copy Markdown
Contributor

asraa commented Jun 26, 2020

@dio Can you take a quick look at this? It's a fuzzer we're writing for ext_authz network filter

@stale
Copy link
Copy Markdown

stale bot commented Jul 3, 2020

This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions!

@stale stale bot added the stale stalebot believes this issue/PR has not been touched recently label Jul 3, 2020
@stale stale bot removed the stale stalebot believes this issue/PR has not been touched recently label Jul 6, 2020
Copy link
Copy Markdown
Member

@dio dio left a comment

Choose a reason for hiding this comment

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

Looks good.

@asraa asraa merged commit e05e121 into envoyproxy:master Jul 7, 2020
scheler pushed a commit to scheler/envoy that referenced this pull request Aug 4, 2020
Added fuzz test code for network filter ext_authz. Added test input protobuf. Added two simple test cases.
After running for one minute with libfuzzer:
Line coverage for the .cc and .h files of ext_authz is 94.9 %
Function coverage for the .cc and .h files of ext_authz is 81.2%

Signed-off-by: jianwen <jianwendong@google.com>
Signed-off-by: scheler <santosh.cheler@appdynamics.com>
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.

3 participants