From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: John Stultz <john.stultz@linaro.org>,
Peter Zijlstra <peterz@infradead.org>,
Michael Kerrisk <mtk.manpages@gmail.com>,
air icy <icytxw@gmail.com>
Subject: [patch 0/2] posix-timers: Sanitize posix timer overrun handling
Date: Tue, 26 Jun 2018 15:21:30 +0200 [thread overview]
Message-ID: <20180626132130.345959379@linutronix.de> (raw)
Icy reported an UBSAN splat in the posix timer code, which is caused by the
way the overrun accounting works. Depending on interval and expiry time the
overrun can be larger than INT_MAX, but the accounting is int based which
basically makes the accounting values, which are visible to user space via
timer_getoverrrun(2) and siginfo::si_overrun, random.
The following series addresses this by converting the internal accounting
to 64bit and clamping the user space visible values to INT_MAX.
Thanks,
tglx
8<-------------------
b/include/linux/posix-timers.h | 4 ++--
kernel/time/alarmtimer.c | 4 ++--
kernel/time/posix-cpu-timers.c | 2 +-
kernel/time/posix-timers.c | 33 +++++++++++++++++++++------------
kernel/time/posix-timers.h | 2 +-
5 files changed, 27 insertions(+), 18 deletions(-)
next reply other threads:[~2018-06-26 13:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-26 13:21 Thomas Gleixner [this message]
2018-06-26 13:21 ` [patch 1/2] posix-timers: Make forward callback return s64 Thomas Gleixner
2018-06-29 4:25 ` John Stultz
2018-07-02 9:36 ` [tip:timers/core] " tip-bot for Thomas Gleixner
2018-06-26 13:21 ` [patch 2/2] posix-timers: Sanitize overrun handling Thomas Gleixner
2018-06-29 4:24 ` John Stultz
2018-07-02 9:37 ` [tip:timers/core] " tip-bot for Thomas Gleixner
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=20180626132130.345959379@linutronix.de \
--to=tglx@linutronix.de \
--cc=icytxw@gmail.com \
--cc=john.stultz@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=peterz@infradead.org \
/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).