-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
4 changed files
with
13 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters