]> git.proxmox.com Git - mirror_qemu.git/commit - linux-user/ioctls.h
linux-user: Correct type for BLKSSZGET
authorPeter Maydell <peter.maydell@linaro.org>
Mon, 4 Jul 2016 16:06:18 +0000 (17:06 +0100)
committerRiku Voipio <riku.voipio@linaro.org>
Tue, 19 Jul 2016 12:23:16 +0000 (15:23 +0300)
commita4a2c51f9006b9e6ee3b94f5ce87aed066f3446a
tree48547a32df4ec3c468509d7108ad28074f609c0e
parent884cdc48a98fca7d758a5934af526cd1fcedcc9e
linux-user: Correct type for BLKSSZGET

The BLKSSZGET ioctl takes an argument which is a pointer to an int.
We were incorrectly declaring it to take a pointer to a long, which
meant that we would incorrectly write to memory which we should not
if the guest is a 64-bit architecture.

In particular, kpartx uses this ioctl to write to an int on the
stack, which tends to result in it crashing immediately.

Reported-by: Chanho Park <chanho61.park@samsung.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/ioctls.h