Skip to content

Fix data race, heap use-after-free issue in bm_chttp2_transport#19342

Merged
yashykt merged 2 commits intogrpc:masterfrom
yashykt:18416fix
Jun 17, 2019
Merged

Fix data race, heap use-after-free issue in bm_chttp2_transport#19342
yashykt merged 2 commits intogrpc:masterfrom
yashykt:18416fix

Conversation

@yashykt
Copy link
Copy Markdown
Member

@yashykt yashykt commented Jun 14, 2019

Fixes #18416

The issue is that we are relying on the closures being scheduled on the exec_ctx for correctness. If the closures end up being scheduled on the executor thread, then we might end up destroying the Stream object before the grpc stream is freed.

The fix is to simply delete the Stream after the grpc stream is done being destroyed.

@yashykt yashykt added the release notes: no Indicates if PR should not be in release notes label Jun 14, 2019
@yashykt yashykt requested review from markdroth and yang-g and removed request for markdroth June 14, 2019 00:14
@yashykt
Copy link
Copy Markdown
Member Author

yashykt commented Jun 14, 2019

cc @markdroth @rmstar @jtattermusch

@yang-g
Copy link
Copy Markdown
Contributor

yang-g commented Jun 14, 2019

The other benchmark cases use a stack allocated Stream object, they could suffer from the same issue too right?

@yashykt
Copy link
Copy Markdown
Member Author

yashykt commented Jun 14, 2019

You are right. It could. I'll just convert all to heap allocate the stream

@yang-g
Copy link
Copy Markdown
Contributor

yang-g commented Jun 14, 2019

Need a push?

@yashykt
Copy link
Copy Markdown
Member Author

yashykt commented Jun 17, 2019

Interop failures are due to failures in building java, dart docker images

@yashykt
Copy link
Copy Markdown
Member Author

yashykt commented Jun 17, 2019

Thanks for reviewing!

@yashykt yashykt merged commit 7dcdabf into grpc:master Jun 17, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 15, 2019
@yashykt yashykt deleted the 18416fix branch May 18, 2023 20:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bm_chttp2_transport --benchmark_filter=BM_TransportStreamSend/134217728$ GRPC_POLL_STRATEGY=poll

2 participants