Skip to content

[redis_proxy] added a constraint for route.prefix().size()#12637

Merged
mattklein123 merged 14 commits intoenvoyproxy:masterfrom
jianwen612:another_fix_issue_24558
Aug 14, 2020
Merged

[redis_proxy] added a constraint for route.prefix().size()#12637
mattklein123 merged 14 commits intoenvoyproxy:masterfrom
jianwen612:another_fix_issue_24558

Conversation

@jianwen612
Copy link
Copy Markdown
Contributor

Additional Description:

In TrieLookupTable the default destructor will use call-stack to recursively find all unique_ptr and reset them. If the string added to Trie is very long, for example, with 40000 characters, the Trie will have a depth of 40000 and call-stack will encounter stack-overflow.

Added a constraint length<=1000 for route.prefix().size().

Risk Level: low
Passed a crashed test case reported by network_readfilter_fuzz_test.

[Optional Fixes #Issue] https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24558&sort=-opened&can=1&q=proj%3Aenvoy%20status%3DNew

/cc @mattklein123
/cc @asraa
/cc @samkerner

trie.

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>
: nullptr) {

for (auto const& route : config.routes()) {
if(route.prefix().size() > 1000){
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can't this be a PGV annotation?

Copy link
Copy Markdown
Contributor Author

@jianwen612 jianwen612 Aug 13, 2020

Choose a reason for hiding this comment

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

Can't this be a PGV annotation?

Oh I can make it part of PGV. Do you think 1000 is ok?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sure

Signed-off-by: jianwen <jianwendong@google.com>
@repokitteh-read-only
Copy link
Copy Markdown

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #12637 was synchronize by jianwen612.

see: more, trace.

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thank you!

@mattklein123 mattklein123 self-assigned this Aug 13, 2020
@mattklein123 mattklein123 merged commit 7852b9d into envoyproxy:master Aug 14, 2020
mpuncel added a commit to mpuncel/envoy that referenced this pull request Aug 14, 2020
* master: (67 commits)
  logger: support log control in admin interface and command line option for Fancy Logger (envoyproxy#12369)
  test: fix http_timeout_integration_test flake (envoyproxy#12654)
  [fuzz]added an input check in writefilter fuzzer and added test cases (envoyproxy#12628)
  add 'explicit' restriction. (envoyproxy#12643)
  scoped_rds_integration_test migrate from api v2 to api v3. (envoyproxy#12633)
  fuzz: added fuzz test for listener filter tls_inspector (envoyproxy#12617)
  testing: fix multiple race conditions in simulated time tests (envoyproxy#12527)
  [tls] Move handshaking behavior into SslSocketInfo. (envoyproxy#12571)
  header: getting rid of exception-throwing behaviors in header files [the rest] (envoyproxy#12611)
  router: add new ratelimited retry backoff strategy (envoyproxy#12202)
  [redis_proxy] added a constraint for route.prefix().size() (envoyproxy#12637)
  network: add tcp listener backlog config (envoyproxy#12625)
  runtime: debug log that condition is always true when fractionalPercent numerator > denominator (envoyproxy#12068)
  WatchDog Extension hook (envoyproxy#12416)
  router: add dynamic metadata header formatter (envoyproxy#11858)
  statsd: revert visibility to public (envoyproxy#12621)
  Fix regression of /build_* in gitignore (envoyproxy#12630)
  Added a missing extension point to documentation. (envoyproxy#12620)
  Reverts proxy protocol test on windows (envoyproxy#12619)
  caching: Improved the tests and coverage of the CacheFilter tree (envoyproxy#12544)
  ...

Signed-off-by: Michael Puncel <mpuncel@squareup.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.

2 participants