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] [day] [month] [year] [list]
Message-ID: <64c2b0ef-39e9-4194-aec1-8026b7fbe272@BY2FFO11FD014.protection.gbl>
Date:	Tue, 26 Aug 2014 17:35:07 -0700
From:	Sören Brinkmann <soren.brinkmann@...inx.com>
To:	"Rafael J. Wysocki" <rjw@...ysocki.net>
CC:	John Stultz <john.stultz@...aro.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Pavel Machek <pavel@....cz>, Len Brown <len.brown@...el.com>,
	<linux-kernel@...r.kernel.org>, <linux-pm@...r.kernel.org>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	Stephen Boyd <sboyd@...eaurora.org>
Subject: Re: [PATCH] PM / sleep: Fix racing timers

On Wed, 2014-08-27 at 02:32AM +0200, Rafael J. Wysocki wrote:
> Hi,
> 
> Sorry for being somewhat slow to respond to this, but I'm not sure if the
> approach here is the right one.
> 
> On Wednesday, August 20, 2014 01:55:09 PM Soren Brinkmann wrote:
> > On platforms that do not power off during suspend, successfully entering
> > suspend races with timers.
> > 
> > The race happening in a couple of location is:
> > 
> >   1. disable IRQs   		(e.g. arch_suspend_disable_irqs())
> >      ...
> >   2. syscore_suspend()
> >       -> timekeeping_suspend()
> >        -> clockevents_notify(SUSPEND)
> >         -> tick_suspend()   	(timers are turned off here)
> >      ...
> >   3. wfi            		(wait for wake-IRQ here)
> > 
> > Between steps 1 and 2 the timers can still generate interrupts that are
> > not handled and stay pending until step 3. That pending IRQ causes an
> > immediate - spurious - wake.
> 
> Well, the problem here is that the platform is not supposed to re-enable
> interrupts after syscore_suspend().  Of course, some platforms do that, because
> they don't really support system sleep and try to emulate it with something
> along the lines of suspend-to-idle.

No, IRQs are not enabled after syscore-suspend. But the wait for
interrupt state on ARM is left even with IRQs disabled. It will prevent
the core from taking the exception, but it will "wake" it up. So, my
impressions was that the core is the appropriate location to fix this. I
wouldn't know where else to do it.

It is certainly an issue caused by this probably non-standard suspend
state, but if we accept this implementation as a valid suspend
implementation, I'd say it's a core issue.

	Thanks,
	Sören
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ