public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	linux-kernel@vger.kernel.org,
	John Stultz <john.stultz@linaro.org>,
	stable@vger.kernel.org, gregkh@linuxfoundation.org,
	Peter Zijlstra <peterz@infradead.org>,
	Michael Kerrisk <mtk.manpages@gmail.com>
Subject: Re: [PATCH stable 4.9] posix-timers: Sanitize overrun handling
Date: Thu, 8 Nov 2018 10:46:25 -0500	[thread overview]
Message-ID: <20181108154625.GC8097@sasha-vm> (raw)
In-Reply-To: <alpine.DEB.2.21.1811080747450.1666@nanos.tec.linutronix.de>

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@linutronix.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@gmail.com>
>> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>> > Acked-by: John Stultz <john.stultz@linaro.org>
>> > Cc: Peter Zijlstra <peterz@infradead.org>
>> > Cc: Michael Kerrisk <mtk.manpages@gmail.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@gmail.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,
Sasha

  reply	other threads:[~2018-11-09  1:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01 20:02 [PATCH stable 4.9] posix-timers: Sanitize overrun handling Florian Fainelli
2018-11-07 19:37 ` Florian Fainelli
2018-11-08  6:48   ` Thomas Gleixner
2018-11-08 15:46     ` Sasha Levin [this message]
2018-11-08 22:36       ` Florian Fainelli

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=20181108154625.GC8097@sasha-vm \
    --to=sashal@kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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