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]
Date:   Mon, 20 Feb 2023 22:53:17 +0100
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Frederic Weisbecker <frederic@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        Frederic Weisbecker <frederic@...nel.org>,
        Alexey Dobriyan <adobriyan@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Wei Li <liwei391@...wei.com>,
        Mirsad Goran Todorovac <mirsad.todorovac@....unizg.hr>,
        Yu Liao <liaoyu15@...wei.com>, Hillf Danton <hdanton@...a.com>,
        Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH 7/7] selftests/proc: Remove idle time monotonicity
 assertions

On Mon, Feb 20 2023 at 13:41, Frederic Weisbecker wrote:

> Due to broken iowait task counting design (cf: comments above
> get_cpu_idle_time_us() and nr_iowait()), it is not possible to provide
> the guarantee that /proc/stat or /proc/uptime display monotonic idle
> time values.
>
> Remove the selftests that verify the related wrong assumption so that
> testers and maintainers don't spend more time on that.
>
> Reported-by: Yu Liao <liaoyu15@...wei.com>
> Reported-by: Thomas Gleixner <tglx@...utronix.de>

I did really not ask you to remove the selftests alltogether.

Those tests check uptime and idle time. I asked you to remove the idle
time monotonicity assertion.

uptime is really supposed to be monotonically increasing. It's based on
CLOCK_BOOTTIME. If that goes backwards then we surely have more trouble
than /proc/uptime.

But it would be a good thing to change the test in the following way:

       ut1 = parse("/proc/uptime");
       bt1 = clock_gettime(CLOCK_BOOTTIME);
       assert(ut1 <= bt1);
       ut2 = parse("/proc/uptime");
       bt2 = clock_gettime(CLOCK_BOOTTIME);
       assert(ut2 <= bt2);
       assert(ut1 <= ut2);
       ....

Hmm?

Thanks,

        tglx

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ