Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not use path containing "/" in linkat() or stat()
This defeats the protections provided by opendir_safe(). Instead, use the already-open file descriptor for the file's containing directory. It is unclear whether this can be used to escape a bind mount, as linkat() might fail with -EXDEV in this case. However, it is definitely wrong and needs to be fixed. A search for "untrusted_name" in qrexec-lib/unpack.c finds that these are the only places where an untrusted path that may contain "/" is used as a path in a system call argument. In all other cases, either the path is trusted or only paths that are guaranteed to not contain "/" are used, ensuring that the vulnerability in Qubes Security Bulletin 014 can never be a problem again. Fixes: ce2df91 ("Initial work on safe open")
- Loading branch information