Comment 84 for bug 1221190

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/86353
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d416f4310bb946b4b127201ec3c37e530d988714
Submitter: Jenkins
Branch: master

commit d416f4310bb946b4b127201ec3c37e530d988714
Author: Nikola Dipanov <email address hidden>
Date: Wed Apr 9 15:50:20 2014 +0200

    Avoid the possibility of truncating disk info file

    Commit dc8de42 makes nova persist image format to a file to avoid
    attacks based on changing it later. However the way it was implemented
    leaves a small window of opportunity for the file to be truncated before
    it gets written back to effectively making it possible for data to get
    lost leaving us with a potential problem next time it is attempted to be
    read.

    This patch changes the way file is updated to be atomic, thus closing
    the race window (and also removes the chown that we did not really
    need).

    It is worth noting that a better solution to this would be
    to allow the code calling the imagebackend to write the file (once!)
    and make it impossible to update after the boot process is done. This
    approach would require more refactoring of the libvirt driver code, and
    may be done in the future.

    Partial-bug: #1221190
    Change-Id: Ia1b073f38e096989f34d1774a12a1b4151773fc7