From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbWpd-0004XR-Ve for qemu-devel@nongnu.org; Tue, 28 Jun 2011 07:51:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QbWpc-0002OV-Hv for qemu-devel@nongnu.org; Tue, 28 Jun 2011 07:51:53 -0400 Received: from afflict.kos.to ([92.243.29.197]:44039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QbWpc-0002OO-2Z for qemu-devel@nongnu.org; Tue, 28 Jun 2011 07:51:52 -0400 Date: Tue, 28 Jun 2011 14:51:49 +0300 From: Riku Voipio Message-ID: <20110628115149.GA17577@afflict.kos.to> References: <1309260117-28334-1-git-send-email-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1309260117-28334-1-git-send-email-peter.maydell@linaro.org> Subject: Re: [Qemu-devel] [PATCH] linux-user/syscall.c: Enforce pselect6 sigset size restrictions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Mike Frysinger , qemu-devel@nongnu.org On Tue, Jun 28, 2011 at 12:21:57PM +0100, Peter Maydell wrote: > 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. Odd but true, after all the trouble of passing the size as packed variable, even the kernel bothers nothing but check that it matches with sizeof(sigset_t)... I'll include this and your other two patches for the next round. Riku > Signed-off-by: Peter Maydell > --- > This really is the last gcc 4.6 warning fix! > > 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 fed7a8f..feb2501 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -5684,6 +5684,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.5.3