[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/7] linux-user/syscall.c: Enforce pselect6 sigset s
From: |
riku . voipio |
Subject: |
[Qemu-devel] [PATCH 7/7] linux-user/syscall.c: Enforce pselect6 sigset size restrictions |
Date: |
Mon, 11 Jul 2011 17:11:02 +0300 |
From: Peter Maydell <address@hidden>
Enforce the same restriction on the size of the sigset passed to
pselect6 as the Linux kernel does. This is both correct and silences
a gcc 4.6 warning about a write-only variable.
Signed-off-by: Peter Maydell <address@hidden>
Signed-off-by: Riku Voipio <address@hidden>
---
linux-user/syscall.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e2f356b..90f6789 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5699,6 +5699,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long
arg1,
if (arg_sigset) {
sig.set = &set;
+ if (arg_sigsize != sizeof(*target_sigset)) {
+ /* Like the kernel, we enforce correct size sigsets */
+ ret = -TARGET_EINVAL;
+ goto fail;
+ }
target_sigset = lock_user(VERIFY_READ, arg_sigset,
sizeof(*target_sigset), 1);
if (!target_sigset) {
--
1.7.4.1
- [Qemu-devel] [PATCH 0/7] pending linux-user patches, riku . voipio, 2011/07/11
- [Qemu-devel] [PATCH 2/7] linux-user: Add support for KD...LED ioctls, riku . voipio, 2011/07/11
- [Qemu-devel] [PATCH 1/7] arm-semi: Provide access to CLI arguments passed through the "-append" option, riku . voipio, 2011/07/11
- [Qemu-devel] [PATCH 3/7] linux-user: Add support for more VT ioctls, riku . voipio, 2011/07/11
- [Qemu-devel] [PATCH 4/7] linux-user: Add support for even more FB ioctls, riku . voipio, 2011/07/11
- [Qemu-devel] [PATCH 5/7] linux-user: Add syscall numbers from kernel 2.6.39.2, riku . voipio, 2011/07/11
- [Qemu-devel] [PATCH 6/7] linux-user: Implement prlimit64 syscall, riku . voipio, 2011/07/11
- [Qemu-devel] [PATCH 7/7] linux-user/syscall.c: Enforce pselect6 sigset size restrictions,
riku . voipio <=