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: <87zg9m26f2.ffs@tglx>
Date:   Thu, 09 Feb 2023 16:40:49 +0100
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Michael Nazzareno Trimarchi <michael@...rulasolutions.com>
Cc:     Michael <michael@...isi.de>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        linux-rtc@...r.kernel.org, Stephen Boyd <sboyd@...nel.org>,
        linux-kernel@...r.kernel.org, John Stultz <jstultz@...gle.com>
Subject: Re: Problem when function alarmtimer_suspend returns 0 if time
 delta is zero

Michael!

On Thu, Feb 09 2023 at 12:19, Michael Nazzareno Trimarchi wrote:
> On Wed, Feb 8, 2023 at 7:06 PM Thomas Gleixner <tglx@...utronix.de> wrote:
>> I wrote that patch against the back then mainline code. No idea if it's
>> still applying, but the underlying issue is still the same AFAICT.
>>
>> It needs some polishing and a proper changelog.
>>
> Ok, I will try to update it on some mainline kernel in my environment
> and test it back. I need
> a little information if it's possible. Consider that I have no
> experience in this area. I understand how
> code was designed in general but the part around the freezer and all
> those code you remove, what was the logic behind in the removed code?

What I can oracle out of that well commented gem is:

  A userspace task invokes clock_nanosleep(CLOCK_*_ALARM, ...), which
  arms an alarm timer. The expiry of an alarmtimer causes the system to
  come out of suspend.

  As the task invokes schedule() it can also be brought back from
  schedule() via a signal. If that happens then the task cancels the
  alarmtimer and returns to handle the signal. While doing that it can
  be frozen, which means the alarm and therefore the wake from suspend
  is lost.

  To prevent that the code tries to save the earliest expiring alarm if
  the task is marked freezing() and the suspend code takes that into
  account.

John, did I summarize that correctly?

The change I made remove that magic and marks the task freezable when it
goes to schedule, which prevents the signal wakeup. That ensures that
the alarm stays armed during freeze/suspend.

That obviously needs some testing and scrunity by the folks which use
this mechanism. IIRC that's used by android, but I might be wrong.

Thanks,

        tglx


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ