-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ext_proc fuzzer test issues. #27619
Fix ext_proc fuzzer test issues. #27619
Conversation
Signed-off-by: Yanjun Xiang <[email protected]>
Signed-off-by: Yanjun Xiang <[email protected]>
ext_proc fuzzer is hitting below crash. This is due to some of the mock functions of decoder_callbacks is missing, which causing the state.addBufferedData() is no-op. This issue is a fuzzer only issue. [2023-05-25 17:25:25.880][4130221][debug][ext_proc] [source/extensions/filters/http/ext_proc/processor_state.cc:30] Traffic direction INBOUND: 200 ms timer enabled
|
Signed-off-by: Yanjun Xiang <[email protected]>
/assign @yanavlasov @adisuissa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for cleaning up these issues!
Left a couple of questions.
ON_CALL(decoder_callbacks_, connection()) | ||
.WillByDefault(Return(OptRef<const Network::Connection>{connection_})); | ||
connection_.stream_info_.downstream_connection_info_provider_->setRemoteAddress(addr_); | ||
connection_.stream_info_.downstream_connection_info_provider_->setLocalAddress(addr_); | ||
ON_CALL(decoder_callbacks_, addDecodedTrailers()).WillByDefault(ReturnRef(request_trailers_)); | ||
ON_CALL(encoder_callbacks_, addEncodedTrailers()).WillByDefault(ReturnRef(response_trailers_)); | ||
ON_CALL(decoder_callbacks_, addDecodedData(_, _)).WillByDefault(Return()); | ||
ON_CALL(encoder_callbacks_, addEncodedData(_, _)).WillByDefault(Return()); | ||
ON_CALL(decoder_callbacks_, decodingBuffer()).WillByDefault(Return(buffer_ptr_ = &buffer_)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason the assignment is being done as part of the Return
statement?
I suggest returning the address of buffer_
directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ON_CALL(decoder_callbacks_, connection()) | ||
.WillByDefault(Return(OptRef<const Network::Connection>{connection_})); | ||
connection_.stream_info_.downstream_connection_info_provider_->setRemoteAddress(addr_); | ||
connection_.stream_info_.downstream_connection_info_provider_->setLocalAddress(addr_); | ||
ON_CALL(decoder_callbacks_, addDecodedTrailers()).WillByDefault(ReturnRef(request_trailers_)); | ||
ON_CALL(encoder_callbacks_, addEncodedTrailers()).WillByDefault(ReturnRef(response_trailers_)); | ||
ON_CALL(decoder_callbacks_, addDecodedData(_, _)).WillByDefault(Return()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I fully understand this, but I thought that the default behavior of a (Nice)Mock is to return the default value. Do these override a different ON_CALL somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah,no need. removed.
Signed-off-by: Yanjun Xiang <[email protected]>
* Fix ext_proc fuzzer test issues. Signed-off-by: Yanjun Xiang <[email protected]> Signed-off-by: Ryan Eskin <[email protected]>
Fix an ext_proc fuzzer issue.
The crash issue is due to some of the decoder_callbacks mock function are missing. Adding them.
Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]