Fix a Mach port dead-name leak in mojo::core::ChannelMac.
If a channel sends a message to what turns out to be a dead-name port, before the channel processes the kernel's dead-name notification, the channel would leak the dead-name right. This is because the dead-name notification message contains a port right that must be destroyed, and that right is not transferred as a normal message descriptor. Therefore, the right is not automatically released when the message remains in the kernel message queue and the associated receive right is destroyed. To fix this, if a channel fails to send a message because it is to an invalid destination (namely, a dead-name), do not immediately report the error. Instead, wait for the channel to process the dead-name notification so that the port right can be appropriately disposed. Bug: 1041682 Change-Id: I99ffdea096670ef1e133f62ae269292b1d7e290a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2013524Reviewed-by:Ken Rockot <rockot@google.com> Reviewed-by:
Mark Mentovai <mark@chromium.org> Commit-Queue: Robert Sesek <rsesek@chromium.org> Cr-Commit-Position: refs/heads/master@{#734670}
Showing
Please register or sign in to comment