From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60715) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKn6l-0003PC-Cv for qemu-devel@nongnu.org; Fri, 22 Aug 2014 07:34:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XKn6g-0007vU-Ea for qemu-devel@nongnu.org; Fri, 22 Aug 2014 07:34:15 -0400 Received: from mail-la0-f44.google.com ([209.85.215.44]:36695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XKn6g-0007vP-8C for qemu-devel@nongnu.org; Fri, 22 Aug 2014 07:34:10 -0400 Received: by mail-la0-f44.google.com with SMTP id el20so10087442lab.3 for ; Fri, 22 Aug 2014 04:34:09 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1408706366-43407-1-git-send-email-agraf@suse.de> References: <1408706366-43407-1-git-send-email-agraf@suse.de> From: Peter Maydell Date: Fri, 22 Aug 2014 12:33:48 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH] linux-user: Simplify boundary checks on g_posix_timers range List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Riku Voipio , QEMU Developers , =?UTF-8?Q?Andreas_F=C3=A4rber?= On 22 August 2014 12:19, Alexander Graf wrote: > We check whether the passed in counter value is negative on all calls > that involve g_posix_timers. However, we AND the value down to 16 bits > right before the check, so they can never be negative. ...but why exactly are we doing that AND with 0xffff ?? It seems unlikely that the kernel really allows random garbage in the top half of the timer ID arguments, so maybe we should drop the mask and keep the <0 bounds checks? -- PMM