[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0fabf89c-9452-3e14-6e47-69ca3e28c9e9@gmail.com>
Date: Thu, 8 Nov 2018 14:36:54 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Sasha Levin <sashal@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org, John Stultz <john.stultz@...aro.org>,
stable@...r.kernel.org, gregkh@...uxfoundation.org,
Peter Zijlstra <peterz@...radead.org>,
Michael Kerrisk <mtk.manpages@...il.com>
Subject: Re: [PATCH stable 4.9] posix-timers: Sanitize overrun handling
On 11/8/18 7:46 AM, Sasha Levin wrote:
> On Thu, Nov 08, 2018 at 07:48:16AM +0100, Thomas Gleixner wrote:
>> Florian,
>>
>> On Wed, 7 Nov 2018, Florian Fainelli wrote:
>>> On 11/1/18 1:02 PM, Florian Fainelli wrote:
>>> > From: Thomas Gleixner <tglx@...utronix.de>
>>> >
>>> > [ Upstream commit 78c9c4dfbf8c04883941445a195276bb4bb92c76 ]
>>> >
>>> > The posix timer overrun handling is broken because the forwarding
>>> functions
>>> > can return a huge number of overruns which does not fit in an int.
>>> As a
>>> > consequence timer_getoverrun(2) and siginfo::si_overrun can turn into
>>> > random number generators.
>>> >
>>> > The k_clock::timer_forward() callbacks return a 64 bit value now. Make
>>> > k_itimer::ti_overrun[_last] 64bit as well, so the kernel internal
>>> > accounting is correct. 3Remove the temporary (int) casts.
>>> >
>>> > Add a helper function which clamps the overrun value returned to
>>> user space
>>> > via timer_getoverrun(2) or siginfo::si_overrun limited to a
>>> positive value
>>> > between 0 and INT_MAX. INT_MAX is an indicator for user space that the
>>> > overrun value has been clamped.
>>> >
>>> > Reported-by: Team OWL337 <icytxw@...il.com>
>>> > Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
>>> > Acked-by: John Stultz <john.stultz@...aro.org>
>>> > Cc: Peter Zijlstra <peterz@...radead.org>
>>> > Cc: Michael Kerrisk <mtk.manpages@...il.com>
>>> > Link: https://lkml.kernel.org/r/20180626132705.018623573@linutronix.de
>>> > [florian: Make patch apply to v4.9.135]
>>> > Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
>>> > ---
>>> > Thomas, can you review for correctness? Thanks!
>>>
>>> Thomas, John, does that look like a reasonable backport for 4.9?
>>
>> Looks correct.
>
> Queued for 4.9, thanks all.
Thanks, the same patch should be applicable to earlier kernel versions
as well with little to no hunks. At least I applied it as far back as
4.1 so far. I could provide a patch for earlier kernels that did not
have the file renaming.
--
Florian
Powered by blists - more mailing lists