lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMz4kuKu9pONLRbh6wKT88QV_vyBW1AQ=ss-qx0s6_i+-AxX9g@mail.gmail.com>
Date:   Thu, 25 Jan 2018 17:18:54 +0800
From:   Baolin Wang <baolin.wang@...aro.org>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Jason Wessel <jason.wessel@...driver.com>,
        Daniel Thompson <daniel.thompson@...aro.org>,
        Ingo Molnar <mingo@...nel.org>,
        Mark Brown <broonie@...nel.org>,
        kgdb-bugreport@...ts.sourceforge.net,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kdb: Change timespec to use timespec64

On 25 January 2018 at 16:55, Arnd Bergmann <arnd@...db.de> wrote:
> On Thu, Jan 25, 2018 at 9:05 AM, Baolin Wang <baolin.wang@...aro.org> wrote:
>> @@ -2554,7 +2554,7 @@ static int kdb_summary(int argc, const char **argv)
>>         kdb_printf("domainname %s\n", init_uts_ns.name.domainname);
>>         kdb_printf("ccversion  %s\n", __stringify(CCVERSION));
>>
>> -       now = __current_kernel_time();
>> +       now = current_kernel_time64();
>>         kdb_gmtime(&now, &tm);
>>         kdb_printf("date       %04d-%02d-%02d %02d:%02d:%02d "
>>                    "tz_minuteswest %d\n",
>
> Thanks for picking this one up again, we should find a permanent solution here.
> Unfortunately you patch is incorrect, as we cannot safely call
> current_kernel_time64()
> from NMI context.

Ah, thanks for pointing out the issue, since I do not know what
context the function will be called in kdb.

>
> The __ prefix on __current_kernel_time() indicates that this is a special call
> that intentionally doesn't read the hardware time to avoid taking locks that
> might already be held in the context from which we entered the debugger.
>
> See https://patchwork.kernel.org/patch/10002097/ for my earlier patch.

This patch had not been merged into mainline?

>
>> @@ -2521,8 +2521,8 @@ static void kdb_gmtime(struct timespec *tv, struct kdb_tm *tm)
>>   */
>>  static void kdb_sysinfo(struct sysinfo *val)
>>  {
>> -       struct timespec uptime;
>> -       ktime_get_ts(&uptime);
>> +       struct timespec64 uptime;
>> +       ktime_get_ts64(&uptime);
>>         memset(val, 0, sizeof(*val));
>>         val->uptime = uptime.tv_sec;
>>         val->loads[0] = avenrun[0];
>
> This function appears to have the same problem, except that it is a preexisting
> issue in this case. I had not noticed this earlier, but we must fix it
> in a similar
> manner to the other one.

OK.

-- 
Baolin.wang
Best Regards

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ