AF_UNIX status report

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Nov 23 08:43:13 GMT 2020


On Nov 22 15:44, Ken Brown via Cygwin-developers wrote:
> On 11/18/2020 3:34 AM, Corinna Vinschen wrote:
> > On Nov 17 14:57, Ken Brown via Cygwin-developers wrote:
> > > On 11/9/2020 4:08 AM, Corinna Vinschen wrote:
> > > > The duplicated handle has to be closed at one point but otherwise
> > > > the approach makes sense.
> > > 
> > > After wasting a ridiculous amount of time because of careless mistakes with
> > > handle duplication, I've finally gotten something working (currently for
> > > disk files only and with some limitations that have to removed).  I've
> > > pushed it to the topic/af_unix branch in case you want to review it and/or
> > > test it.
> > 
> > This is soooo fantastic!  Apart from files, the nexst most interesting
> > case is sharing a socket, probably.  We could activcate the 2nd half of
> > privilege separation in sshd then.
> 
> I've pushed a first attempt to implement sending socket descriptors, but I
> haven't yet tested it.  I'll try to find a small test program and then, if
> all goes well, take a look at sshd.
> 
> > > If you do test it, the main limitation currently is that the sending process
> > > can't exit until the receiving process has received and processed the
> > > SCM_RIGHTS data.
> > 
> > While this is strictly a flaw, that may not be much of a limitation.
> > It would be interesting to know how many applications send descriptors
> > just to exit immediately.  Not so many, probably.
> 
> I don't know, but I've reduced the effect of the limitation.  Now the
> sending process waits up to about 100ms for an ack from the receiving
> process before closing the socket.  I have no idea if 100ms is reasonable in
> the real world, but it's big enough for my test programs and small enough
> that I don't notice the delay when I run the programs interactively.

100 ms may be a bit low under load.  Sounds like a good starting point, though.


Corinna


More information about the Cygwin-developers mailing list