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: <1d532c45-ee33-9729-f0ac-b59c2bec8d7d@siemens.com>
Date:   Sun, 11 Jun 2023 15:38:04 +0200
From:   Jan Kiszka <jan.kiszka@...mens.com>
To:     Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc:     Alessandro Zummo <a.zummo@...ertech.it>, linux-rtc@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] rtc: pcf-8563: Report previously detected low-voltage via
 RTC_VL_BACKUP_LOW

On 10.06.23 10:31, Alexandre Belloni wrote:
> Hello Jan,
> 
> On 09/06/2023 23:04:12+0200, Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@...mens.com>
>>
>> The VL bit in the seconds register remains set only until seconds are
>> written under main power. As this often happens during boot-up after
>> picking up a network time, make sure to preserve the low battery state
>> across this, caching it and returning it via the RTC_VL_BACKUP_LOW bit.
>>
>> To permit userspace clearing this state during runtime, also implement
>> RTC_VL_CLR that works against the cached state.
>>
>> This is emulating RTCs which have a battery voltage check that works
>> under main power as well.
>>
> 
> Emulating doesn't work well and I deliberately chose to not implement
> it. For example, in your scenario, if you boot twice without using
> VL_READ, you anyway have lost the information. This makes emulating
> unreliabl. The fix you need is in userspace where you have to ensure you
> read the status before setting the time.

Then let's make sure the bit is also set in the hardware register. Then
also the reboot issue (which is practically a minor one) is solved. The
current situation is far from optimal.

Jan

-- 
Siemens AG, Technology
Competence Center Embedded Linux

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ