graphene icon indicating copy to clipboard operation
graphene copied to clipboard

fd passing fails -- sendmsg ignores ancillary data

Open smherwig opened this issue 7 years ago • 2 comments

The msg_control field of struct msghdr is ignored. Thus, Graphene's implementation of sendmsg does not support passing file descriptors.

smherwig avatar Dec 11 '18 19:12 smherwig

Thanks for the report! Do you happen to have a simple test case (or know of an LTP test) that illustrates the issue succinctly?

donporter avatar Jan 02 '19 20:01 donporter

This limitation is still there. I once tried to fix it with this (not merged) PR: https://github.com/oscarlab/graphene/pull/1511.

But the problem with sending ancillary data in sendmsg (via SCM_RIGHTS flag) is not so trivial: we need to checkpoint the corresponding shim handle and send it to the other process, where this shim handle must be restored (and the corresponding PAL handle re-created). This requires a family of checkpoint functions, but all these functions are currently very much tied to our checkpoint-on-fork code.

So, it's definitely a nice feature to have, but we haven't heard any other requests for this feature. So it doesn't seem urgent. Also, it needs a checkpoint subsystem rewrite, so that checkpoint and restore functions can be freely called from our sendmsg/recvmsg code.

dimakuv avatar Jul 14 '21 09:07 dimakuv