]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user: Fix target FS_IOC_GETFLAGS and FS_IOC_SETFLAGS numbers
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 12 Oct 2017 15:30:44 +0000 (16:30 +0100)
committerRiku Voipio <riku.voipio@linaro.org>
Mon, 16 Oct 2017 13:04:33 +0000 (16:04 +0300)
We were defining TARGET_FS_IOC_GETFLAGS and TARGET_FS_IOC_SETFLAGS
using the host 'long' type in the size field, which meant that
they had the wrong values if the host and guest had different
sized longs. Switch to abi_long instead.

This fixes a bug where these ioctls don't work on 32-bit guests
on 64-bit hosts (and makes the LTP test 'setxattr03' pass
where it did not previously.)

Reported-by: pgndev <pgnet.dev@gmail.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/syscall_defs.h

index 6e2287e918cb5d38ad90cea78449ef4c0ebc5fc5..447915cf80faa26965756511f53ecc2e38cafbe2 100644 (file)
@@ -1101,8 +1101,8 @@ struct target_pollfd {
 /* Note that the ioctl numbers claim type "long" but the actual type
  * used by the kernel is "int".
  */
-#define TARGET_FS_IOC_GETFLAGS TARGET_IOR('f', 1, long)
-#define TARGET_FS_IOC_SETFLAGS TARGET_IOW('f', 2, long)
+#define TARGET_FS_IOC_GETFLAGS TARGET_IOR('f', 1, abi_long)
+#define TARGET_FS_IOC_SETFLAGS TARGET_IOW('f', 2, abi_long)
 
 #define TARGET_FS_IOC_FIEMAP TARGET_IOWR('f',11,struct fiemap)