wayland-server: fix socket ownership race condition
Always unlink() the lock file before closing the file descriptor for it. Otherwise, there is a race like this: Process A closes fd, releasing the lock Process B opens the same file, taking the lock Process A unlinks the lock file Process C opens the same file, which now no longer exists, and takes the lock on the newly created lock file Process B and C both 'own' the same display socket. unlink()ing while holding the lock is effectively a better way to release the lock atomically.
Loading
Please register or sign in to comment