4 ms·
Their suggested methods (Unix sockets and named pipes) both use Unix filesystem ACLs which means they're resilient to this problem. This is the main reason I'v
by cyphar 10y ago
Their suggested methods (Unix sockets and named pipes) both use Unix filesystem ACLs which means they're resilient to this problem.
This is the main reason I've never liked binding to 127.0.0.1 rather than just using a socket -- you lose the access control you could have if you used sockets.
- caf 10y agoIt was once the case on BSD that filesystem DAC bits weren't applied to AF_UNIX sockets. Can that be universally relied upon now?
- cyphar 10y agoI know it works on GNU/Linux, and I'm fairly sure it works on illumos (Solaris). I don't really use any of the BSDs, so I can't comment on that. Sounds like a nasty kernel bug though -- Linux implements AF_UNIX sockets as actual filesystem objects (so you go through VFS implicitly to interact with them).
- caf 10y agoIt does work on FreeBSD now at least. It wasn't a bug, though - just a questionable design (POSIX still doesn't mandate how filesystem permissions interact with connect() on AF_UNIX sockets AFAICS).