Skip to content

Commit

Permalink
qfile-unpacker: do not call fdatasync() at each file (#1257)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
marmarek committed Oct 11, 2015
1 parent e745b87 commit c1d42f1
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion qrexec-lib/unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c1d42f1

Please sign in to comment.