From: "Andreas Färber" <afaerber@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>, Alexander Graf <agraf@suse.de>
Cc: Riku Voipio <riku.voipio@iki.fi>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] linux-user: Simplify boundary checks on g_posix_timers range
Date: Fri, 22 Aug 2014 13:36:01 +0200 [thread overview]
Message-ID: <53F72B21.4010105@suse.de> (raw)
In-Reply-To: <CAFEAcA9UAzsx5cuoukD24w+DU+udUGjh+0O2Ni2T_OOidAUsKA@mail.gmail.com>
Am 22.08.2014 13:33, schrieb Peter Maydell:
> On 22 August 2014 12:19, Alexander Graf <agraf@suse.de> 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?
Or maybe just use a local int16_t variable? I.e., should 0xffff match
the <0 check there or not?
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2014-08-22 11:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-22 11:19 [Qemu-devel] [PATCH] linux-user: Simplify boundary checks on g_posix_timers range Alexander Graf
2014-08-22 11:33 ` Peter Maydell
2014-08-22 11:36 ` Andreas Färber [this message]
2014-08-22 11:45 ` Peter Maydell
2014-08-22 11:42 ` Alexander Graf
2014-08-22 11:44 ` Peter Maydell
2014-08-22 11:45 ` Alexander Graf
2014-08-22 11:49 ` Peter Maydell
2014-08-22 11:52 ` Alexander Graf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53F72B21.4010105@suse.de \
--to=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).