[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1711100801330.2690@nanos>
Date: Fri, 10 Nov 2017 08:04:24 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Kees Cook <keescook@...omium.org>
cc: Arnd Bergmann <arnd@...db.de>, Anton Vorontsov <anton@...msg.org>,
Colin Cross <ccross@...roid.com>,
Tony Luck <tony.luck@...el.com>,
John Stultz <john.stultz@...aro.org>,
Stephen Boyd <sboyd@...eaurora.org>,
Ingo Molnar <mingo@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] pstore: use ktime_get_real_fast_ns() instead of
__getnstimeofday()
On Thu, 9 Nov 2017, Kees Cook wrote:
> On Thu, Nov 9, 2017 at 4:46 PM, Thomas Gleixner <tglx@...utronix.de> wrote:
> > On Fri, 10 Nov 2017, Arnd Bergmann wrote:
> >> On Fri, Nov 10, 2017 at 12:00 AM, Thomas Gleixner <tglx@...utronix.de> wrote:
> >> > Hmm, no. None of the regular accessor functions can be called from NMI
> >> > context safely.
> >>
> >> Right, that's what I mean: it must not get called from NMI context, but it
> >> currently is, at least for this case:
> >>
> >> NMI handler:
> >> something bad
> >> panic()
> >> kmsg_dump()
> >> pstore_dump()
> >> pstore_record_init()
> >> __getnstimeofday()
> >>
> >> I should probably add that to the changelog text ;-)
> >
> > Indeed.
>
> Er, so, is this safe to call there? I've had to fix this a few times
> now, so if using ktime_get_real_fast_ns() can be used here (and
> doesn't return 0) then this is easily an improvement over the existing
> "maybe read 0" case pstore has now.
ktime_get_real_fast_ns() is NMI safe and returns
before timekeeping_suspend(): correct time
after timekeeping_suspend(): timestamp which was frozen in
timekeeping_suspend()
after timekeeping_resume(): correct time
Thanks,
tglx
Powered by blists - more mailing lists