[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 08/11] linux-user: Fix ioctl cmd type mismatch on 64-
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PULL 08/11] linux-user: Fix ioctl cmd type mismatch on 64-bit targets |
Date: |
Tue, 27 Jan 2015 23:07:19 +0200 |
From: Ed Swierk <address@hidden>
linux-user passes the cmd argument of the ioctl syscall as a signed long,
but compares it to an unsigned int when iterating through the ioctl_entries
list. When the cmd is a large value like 0x80047476 (TARGET_TIOCSWINSZ on
mips64) it gets sign-extended to 0xffffffff80047476, causing the comparison
to fail and resulting in lots of spurious "Unsupported ioctl" errors.
Changing the target_cmd field in the ioctl_entries list to a signed int
causes those values to be sign-extended as well during the comparison.
Signed-off-by: Ed Swierk <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5658b66..683f8cc 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3278,7 +3278,7 @@ typedef abi_long do_ioctl_fn(const IOCTLEntry *ie,
uint8_t *buf_temp,
int fd, abi_long cmd, abi_long arg);
struct IOCTLEntry {
- unsigned int target_cmd;
+ int target_cmd;
unsigned int host_cmd;
const char *name;
int access;
--
2.1.4
- [Qemu-devel] [PULL 00/11] linux-user-updates, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 03/11] linux-user/arm/nwfpe: Delete unused aCC array, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 04/11] linux-user/main.c: Call cpu_exec_start/end on all target archs, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 08/11] linux-user: Fix ioctl cmd type mismatch on 64-bit targets,
riku . voipio <=
- [Qemu-devel] [PULL 01/11] linux-user/signal.c: Remove current_exec_domain_sig(), riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 09/11] mips64-linux-user: Fix definition of struct sigaltstack, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 06/11] linux-user/signal.c: Remove unnecessary wrapper copy_siginfo_to_user, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 11/11] linux-user: support target-to-host SCM_CREDENTIALS, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 07/11] linux-user: translate resource also for prlimit64, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 05/11] linux-user/main.c: Mark end_exclusive() as possibly unused, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 10/11] linux-user: Fix broken m68k signal handling on 64 bit hosts, riku . voipio, 2015/01/27
- [Qemu-devel] [PULL 02/11] linux-user/alpha: Add define for NR_shmat to enable shmat syscall, riku . voipio, 2015/01/27
- Re: [Qemu-devel] [PULL 00/11] linux-user-updates, Peter Maydell, 2015/01/27