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: <YIu7ZqowGScElHBr@piout.net>
Date:   Fri, 30 Apr 2021 10:10:14 +0200
From:   Alexandre Belloni <alexandre.belloni@...tlin.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     John Stultz <john.stultz@...aro.org>,
        Stephen Boyd <sboyd@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] alarmtimer: check RTC features instead of ops

On 30/04/2021 09:16:40+0200, Thomas Gleixner wrote:
> On Thu, Apr 29 2021 at 23:49, Alexandre Belloni wrote:
> > Test RTC_FEATURE_ALARM instead of relying on ops->set_alarm to know whether
> > alarms are available.
> >
> > Fixes: 7ae41220ef58 ("rtc: introduce features bitfield")
> > Signed-off-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
> > ---
> > Hello,
> >
> > This doesn't seem much but this solve an issue where following a change in the
> > RTC driver, this part of the code will think the RTC is alarm capable while it
> > is not, then breaking the alarmtimer functionnality.
> 
> So a driver has the set_alarm() callback but does not advertise
> RTC_FEATURE_ALARM for whatever reason and why ever this makes sense.
> 

No, it would be the other way around. The issue happens when you have
two RTCs, rtc0 is not alarm capable and rtc1 has alarms.

The driver for rtc0 used to not have .set_alarm() to signal it didn't
support alarms, it then switched to RTC_FEATURE_ALARM, making the
alarmtimer code select that RTC instead of rtc1, breaking suspend/resume
on the platform.

> I don't mind the patch, but the changelog is a bit meager in explaining
> the WHY.
> 
> Thanks,
> 
>         tglx

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ