linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Boyer <jwboyer@gmail.com>
To: John Stultz <john.stultz@linaro.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Prarit Bhargava <prarit@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Zhouping Liu <zliu@redhat.com>, CAI Qian <caiqian@redhat.com>,
	Sasha Levin <levinsasha928@gmail.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH] time: Improve sanity checking of timekeeping inputs
Date: Wed, 15 Aug 2012 07:39:19 -0400	[thread overview]
Message-ID: <CA+5PVA7k8=E6NkrrNbzT3=6wPE7UdnrQ94EjkGfxW6kU9u5MWw@mail.gmail.com> (raw)
In-Reply-To: <1344454580-17031-1-git-send-email-john.stultz@linaro.org>

On Wed, Aug 8, 2012 at 3:36 PM, John Stultz <john.stultz@linaro.org> wrote:
> Thomas, Ingo,
>         Here's a fix against tip/timers/urgent that addresses
> timekeeping edge cases detected by both a bad BIOS and system
> fuzzing w/ trinity. Thanks to Sasha Levin and CAI Qian for
> finding and reporting these!
>
> Let me know if you have any tweaks you want to see.
>
> thanks
> -john
>
> Unexpected behavior could occur if the time is set to
> a value large enough to overflow a 64bit ktime_t
> (which is something larger then the year 2262).
>
> Also unexpected behavior could occur if large negative
> offsets are injected via adjtimex.
>
> So this patch improves the sanity check timekeeping inputs
> by improving the timespec_valid() check, and then makes better
> use of timespec_valid() to make sure we don't set the time to
> an invalid negative value or one that overflows ktime_t.
>
> Note: This does not protect from setting the time close to
> overflowing ktime_t and then letting natural accumulation
> cause the overflow.
>
> Cc: Ingo Molnar <mingo@kernel.org>
> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Cc: Prarit Bhargava <prarit@redhat.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Zhouping Liu <zliu@redhat.com>
> Cc: CAI Qian <caiqian@redhat.com>
> Cc: Sasha Levin <levinsasha928@gmail.com>
> Cc: stable@vger.kernel.org
> Reported-by: CAI Qian <caiqian@redhat.com>
> Reported-by: Sasha Levin <levinsasha928@gmail.com>
> Signed-off-by: John Stultz <john.stultz@linaro.org>
> ---
>  include/linux/ktime.h     |    7 -------
>  include/linux/time.h      |   22 ++++++++++++++++++++--
>  kernel/time/timekeeping.c |   26 ++++++++++++++++++++++++--
>  3 files changed, 44 insertions(+), 11 deletions(-)

This patch fixes a boot regression on machines with crappy BIOS.  Is
this going to get committed soon?

https://bugzilla.redhat.com/show_bug.cgi?id=844249

josh

  reply	other threads:[~2012-08-15 11:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08 19:36 [PATCH] time: Improve sanity checking of timekeeping inputs John Stultz
2012-08-15 11:39 ` Josh Boyer [this message]
2012-08-15 14:04 ` [tip:timers/urgent] " tip-bot for John Stultz

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='CA+5PVA7k8=E6NkrrNbzT3=6wPE7UdnrQ94EjkGfxW6kU9u5MWw@mail.gmail.com' \
    --to=jwboyer@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=caiqian@redhat.com \
    --cc=john.stultz@linaro.org \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=prarit@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=zliu@redhat.com \
    /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).