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-next>] [day] [month] [year] [list]
Message-ID: <CAOdF7nsiGsPWzcnUVoKPLpT4kfZC3b4VEF=HfExU3FCfsvhKsw@mail.gmail.com>
Date:   Fri, 10 Feb 2017 11:23:45 -0800
From:   Gabriel Beddingfield <gabe@...tlabs.com>
To:     John Stultz <john.stultz@...aro.org>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        LKML <linux-kernel@...r.kernel.org>,
        Harpreet Sangha <eliptus@...gle.com>,
        Andrew LeCain <alecain@...gle.com>,
        John Thompson <jthomp@...tlabs.com>,
        Paul Trautrim <paultrautrim@...gle.com>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Linux PM list <linux-pm@...r.kernel.org>,
        Eric Caruso <ejcaruso@...gle.com>,
        Greg Hackmann <ghackmann@...gle.com>,
        Todd Poynor <toddpoynor@...gle.com>,
        Rom Lemarchand <romlem@...gle.com>
Subject: Re: alarm timer/timerfd expiration does not abort suspend operation

Hi John,

Re-sending because VGER rejected my hipster HTML mail... sorry!

On Fri, Feb 10, 2017 at 10:49 AM, John Stultz <john.stultz@...aro.org> wrote:
>> I see a few ways to fix it:
>>
>> 1. Create a wakeup_source for each timerfd, and if it's an alarm timer
>> call
>> __pm_stay_awake() in timerfd_triggered() and __pm_relax() in
>> timerfd_read().
>> 2. call pm_system_wakeup() in alarmtimer_fired()
>> 3. call `if (isalarm(ctx)) pm_system_wakeup();' in timerfd_triggered()
>> 4. call __pm_wakeup_event(ws, 2 * MSECS_PER_SEC) in alarmtimer_fired()
>> 5. call `if (isalarm(ctc)) __pm_wakeup_event(ws, 2 * MSECS_PER_SEC);'
>> in
>> timerfd_triggered() (using a static struct wakeup_source).
[snip]
>> * #4 Matches the current behavior of the "happy case" if and only if
>> userspace is using the 'wakeup' system, otherwise doesn't change any
>> behavior. But, I wonder how many people think the current behavior is a
>> bug.
[snip]
> The approach you took in your patch looks basically ok to me, though I
>
> think the __pm_wakeup_event() method in #4 sounds safer, just to avoid
> the problematic issue if no one is waiting on the fd.
>
> Though I worry I'm not quite understanding the con for that case
> properly, so maybe you can clarify what concerns you there?

The concern is born of my personal experience: I was ignorant of the
"wakeup_count" protocol, and so I wasn't using it. Because of this
__pm_wakeup_event() would not block a suspend because I never wrote to
wakeup_count. On the other hand, method #2 will work unconditionally.

-gabe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ