From: Alexander Graf <agraf@suse.de>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Riku Voipio" <riku.voipio@iki.fi>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] linux-user: Simplify boundary checks on g_posix_timers range
Date: Fri, 22 Aug 2014 13:45:54 +0200 [thread overview]
Message-ID: <53F72D72.5050307@suse.de> (raw)
In-Reply-To: <CAFEAcA8y-pyDcNqvsEz+MsB6FXPdo87L5FpH0GZfCUGkFKn_RQ@mail.gmail.com>
On 22.08.14 13:44, Peter Maydell wrote:
> On 22 August 2014 12:42, Alexander Graf <agraf@suse.de> wrote:
>> On 22.08.14 13:33, Peter Maydell wrote:
>>> 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 we drop the AND and and the <0 check and treat arg1 as unsigned ;).
>
> That probably just requires equally many changes to
> code that is currently correct because the arg* are
> signed but would need changes if they became unsigned.
Well, I do have a downstream patch that makes them unsigned, so I'd
rather like to make the code as stable to that as I can ;).
Alex
next prev parent reply other threads:[~2014-08-22 11:46 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
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 [this message]
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=53F72D72.5050307@suse.de \
--to=agraf@suse.de \
--cc=afaerber@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).