From eb11cf6989704d176c18d130f873c9da876c3bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 9 Oct 2015 03:13:19 +0200 Subject: [PATCH] qfile-unpacker: do not call fdatasync() at each file (#1257) POSIX requires that a read(2) which can be proved to occur after a write() has returned returns the new data. We want here only that other processes in the same VM will see the file either fully written, or not see it at all. So ensuring that linkat(2) is called after write is completed should be enough. Fixes QubesOS/qubes-issues#1257 (cherry picked from commit c1d42f160299c0524b8d65115ca1bff6d521277a) --- qrexec-lib/unpack.c | 1 - 1 file changed, 1 deletion(-) diff --git a/qrexec-lib/unpack.c b/qrexec-lib/unpack.c index df0732e..d20d508 100644 --- a/qrexec-lib/unpack.c +++ b/qrexec-lib/unpack.c @@ -137,7 +137,6 @@ void process_one_file_reg(struct file_header *untrusted_hdr, else do_exit(errno, untrusted_name); } - fdatasync(fdout); if (use_tmpfile) { char fd_str[7]; snprintf(fd_str, sizeof(fd_str), "%d", fdout);