summaryrefslogtreecommitdiff
path: root/ironic_python_agent/shell
diff options
context:
space:
mode:
authorLucas Alvares Gomes <lucasagomes@gmail.com>2017-01-19 17:16:38 +0000
committerLucas Alvares Gomes <lucasagomes@gmail.com>2017-01-19 18:01:30 +0000
commit449cda4fed51250992446c83a4b50bc45fd10c6d (patch)
treef0ad775ea3a0da7f12a84ebe9c84d8ccea620575 /ironic_python_agent/shell
parent7680625994093f39fa9eec8aa2d8c17c35f44e81 (diff)
downloadironic-python-agent-449cda4fed51250992446c83a4b50bc45fd10c6d.tar.gz
Limit memory usage when running qemu-img convert
This patch is limiting the memory address space to 1 GiB when invoking qemu-img convert. The qemu-img command can be exploited so we better play on the safe side (See: bug #1449062). Change-Id: I2088f74b32d1392310c569cfaa7fd368cb737421 Closes-Bug: #1657808
Diffstat (limited to 'ironic_python_agent/shell')
-rwxr-xr-xironic_python_agent/shell/write_image.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/ironic_python_agent/shell/write_image.sh b/ironic_python_agent/shell/write_image.sh
index 11abb9fc..c8cd3880 100755
--- a/ironic_python_agent/shell/write_image.sh
+++ b/ironic_python_agent/shell/write_image.sh
@@ -39,6 +39,9 @@ log "Erasing existing GPT and MBR data structures from ${DEVICE}"
sgdisk -Z $DEVICE
log "Imaging $IMAGEFILE to $DEVICE"
+
+# limit the memory usage for qemu-img to 1 GiB
+ulimit -v 1048576
qemu-img convert -t directsync -O host_device $IMAGEFILE $DEVICE
sync