Fix ext_proc fuzzer test issues.#27619
Conversation
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
|
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 <yanjunxiang@google.com>
|
/assign @yanavlasov @adisuissa |
adisuissa
left a comment
There was a problem hiding this comment.
Thanks for cleaning up these issues!
Left a couple of questions.
| 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.
Is there a reason the assignment is being done as part of the Return statement?
I suggest returning the address of buffer_ directly.
| 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.
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.
Yeah,no need. removed.
Signed-off-by: Yanjun Xiang <yanjunxiang@google.com>
* Fix ext_proc fuzzer test issues. Signed-off-by: Yanjun Xiang <yanjunxiang@google.com> Signed-off-by: Ryan Eskin <ryan.eskin89@protonmail.com>
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:]