qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] linux-user: Simplify boundary checks on g_posix


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] linux-user: Simplify boundary checks on g_posix_timers range
Date: Fri, 22 Aug 2014 12:44:43 +0100

On 22 August 2014 12:42, Alexander Graf <address@hidden> wrote:
> On 22.08.14 13:33, Peter Maydell wrote:
>> On 22 August 2014 12:19, Alexander Graf <address@hidden> 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.

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]