Re: [PATCH 1/3] sys_poll: Fix negative timeout values for x86userland on x86_64 kernels v2

From: Eric Dumazet
Date: Sun Sep 18 2011 - 04:58:53 EST


Le dimanche 18 septembre 2011 Ã 10:04 +0200, Thomas Meyer a Ãcrit :
> size of int and long differs on x86 and x86_64. the ia32 emulation calls
> directly into the sys_poll function. when the timeout is set to -1
> the test for sign will fail in sys_poll as the 64bit register is tested.
> the timeout timer will be set to 0xffffffff milliseconds, but the timer
> shouldn't get set at all in this situation.
>

As I said, you should CC stable@xxxxxxxxxx team on this patch.
All previous linux versions had this bug : A program might misbehave
because of a spurious poll(..., timeout < 0) wakeup.

Could you please refine this Changelog again ?

On 32bit user program, all negative timeout values should not set a
timout at all, not only 0xffffffff (-1)

man poll states :

The timeout argument specifies an upper limit on the time for which
poll() will block, in milliseconds. Specifying a negative value in
timeout means an infinite timeout.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/