Skip to content

socket_option: don't set socket IP socket options on pipes.#5870

Merged
htuch merged 1 commit intoenvoyproxy:masterfrom
htuch:fix-sockopt-fuzz
Feb 7, 2019
Merged

socket_option: don't set socket IP socket options on pipes.#5870
htuch merged 1 commit intoenvoyproxy:masterfrom
htuch:fix-sockopt-fuzz

Conversation

@htuch
Copy link
Member

@htuch htuch commented Feb 7, 2019

Fixes oss-fuzz issue https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12293.

Risk level: Low
Testing: Corpus entry and unit test added.

Signed-off-by: Harvey Tuch htuch@google.com

Fixes oss-fuzz issue https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12293.

Risk level: Low
Testing: Corpus entry and unit test added.

Signed-off-by: Harvey Tuch <htuch@google.com>
Copy link
Member

@venilnoronha venilnoronha left a comment

Choose a reason for hiding this comment

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

Thanks.

if (addr->ip() != nullptr) {
return addr->ip()->version();
}
throw EnvoyException("Unable to set socket option on non-IP sockets");
Copy link
Member

Choose a reason for hiding this comment

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

Should this method throw a more generic EnvoyException, followed by setOption throwing this one?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is caught in getVersionFromSocket() and converted to a nullopt return.

Copy link
Member

Choose a reason for hiding this comment

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

I just felt that the exception message didn't match the function's operation.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, technically it doesn't, but I don't think it's a big deal given the hyper local use here.

@htuch htuch merged commit cd5dc01 into envoyproxy:master Feb 7, 2019
@htuch htuch deleted the fix-sockopt-fuzz branch February 7, 2019 19:27
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
…xy#5870)

Fixes oss-fuzz issue https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12293.

Risk level: Low
Testing: Corpus entry and unit test added.

Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Fred Douglas <fredlas@google.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