Skip to content

lds: ASAN repro of heap-use-after-free in LDS and a single character fix#14896

Merged
ggreenway merged 3 commits intoenvoyproxy:mainfrom
penguingao:lds
Feb 2, 2021
Merged

lds: ASAN repro of heap-use-after-free in LDS and a single character fix#14896
ggreenway merged 3 commits intoenvoyproxy:mainfrom
penguingao:lds

Conversation

@penguingao
Copy link
Copy Markdown
Contributor

Signed-off-by: pengg pengg@google.com

Commit Message: Fix a heap-use-after-free in LDS
Additional Description: ListenSocketFactoryImpl stores a const std::string& to the first Listener, which is destructed upon LDS update. When reuse_port is enabled, ListenSocketFactoryImpl reads the stale reference which may be a huge garbage string depending on where std::string::size() is aligned to the garbage memory region.
Risk Level: Low
Testing: Integration with ASAN to reproduce
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features:

Signed-off-by: pengg <pengg@google.com>
Signed-off-by: pengg <pengg@google.com>
@penguingao penguingao changed the title lds: ASAN repro of heap-use-after-free in LDS. lds: ASAN repro of heap-use-after-free in LDS and a single character fix Feb 1, 2021
@penguingao
Copy link
Copy Markdown
Contributor Author

cc @htuch @lambdai

@lambdai lambdai self-assigned this Feb 1, 2021
lizan
lizan previously approved these changes Feb 1, 2021
lambdai
lambdai previously approved these changes Feb 1, 2021
Copy link
Copy Markdown
Contributor

@lambdai lambdai left a comment

Choose a reason for hiding this comment

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

Thanks! I find the critical listener update in the integration test.

@lambdai lambdai removed their assignment Feb 1, 2021
Copy link
Copy Markdown
Member

@htuch htuch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Signed-off-by: pengg <pengg@google.com>
@penguingao penguingao dismissed stale reviews from lambdai and lizan via fa316c7 February 2, 2021 14:48
@ggreenway ggreenway merged commit 0ba9e04 into envoyproxy:main Feb 2, 2021
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.

5 participants