Fix use-after-free in net::WebSocketChannel::ReadFrames
Recently network::WebSocket started using mojo datapipe rather than ReadOnlyBuffer. Unlike usual mojo message, an error to write bytes to data pipe is detected synchronously. We called WebSocket::Reset which deletes the associated net::WebSocketChannel synchronously, but the net::WebSocketChannel didn't know it and keeped running after destruction. This CL makes the Reset call asynchronous. This doesn't lead to any races because we actually don't write bytes in such a case - it looks like the data pipe buffer becomes full, and Reset is called afterwards. Bug: 994000 Change-Id: I8b9213720b60314f1e638af9cd492e807cbab56d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767478 Commit-Queue: Yutaka Hirano <yhirano@chromium.org> Reviewed-by:Adam Rice <ricea@chromium.org> Reviewed-by:
Kinuko Yasuda <kinuko@chromium.org> Reviewed-by:
Yoichi Osato <yoichio@chromium.org> Cr-Commit-Position: refs/heads/master@{#690275}
Showing
Please register or sign in to comment