Public bug reported:
[ Impact ]
On 26.04 (resolute), fake-hwclock moves the system clock backwards.
fake-hwclock(8) says "load" only moves the clock forwards unless
"force" is given. In 0.14build1 a plain "load" also moves it
backwards, and "load force" refuses to, because of an inverted test at
line 59 of /usr/sbin/fake-hwclock. The FORCE setting in
/etc/default/fake-hwclock is inverted too: FORCE=force, the value
noble's copy of that file suggests, now blocks backward loads instead
of forcing them.
This is a regression from 24.04 (noble, 0.13). It came in upstream
with 0.14 and is fixed in 0.15 (Debian bug #1093227). 26.10 and the
development release have 0.15, so only resolute needs the fix.
fake-hwclock-load.service runs "load" early at every boot. On machines
with a working RTC the clock goes back to the last saved time
(normally the shutdown time) until NTP steps it forward, and without
network time it stays wrong. The unit is a oneshot without
RemainAfterExit, so starting it again on a running system does the
same. On an Armbian-built 26.04 board, "systemctl isolate" to a custom
target put the clock 50 minutes back; chrony was past the three
updates in which Ubuntu's "makestep 1 3" allows a step, so it could
only slew it, about 10 hours at its maximum rate. A clock that is
behind breaks date checks, for example apt rejecting a freshly
published Release file as not valid yet.
fake-hwclock is in no Ubuntu image or seed, but Armbian installs it by
default from the Ubuntu archive (a few boards remove it; many that
keep it have an RTC). So most Armbian 26.04 images have the bug, and
they would get the fix from resolute-updates at their next upgrade,
with no Armbian change.
The fix is Aurélien Jacobs' one-character change from 0.15 ("=" to
"!=").
[ Test Plan ]
Use a fresh 26.04 VM (for example "lxc launch ubuntu:26.04 --vm"), not
a container: "date -s" in a container can change the host clock. Run
steps 1-5 first with 0.14build1 to see the bug, upgrade, then run them
again. Avoid the top of the hour, when the hourly save timer rewrites
the data file.
sudo apt update && sudo apt install fake-hwclock chrony
apt policy fake-hwclock
To put the clock right after a step that moves it (the restart renews
the three steps "makestep 1 3" allows, and waitsync confirms the
sync):
sudo systemctl restart chrony
chronyc waitsync 60 0.1 0 1 # exit status 0 = in sync
Upgrade between the runs (enable -proposed first, see
https://wiki.ubuntu.com/Testing/EnableProposed):
date -u; sudo apt install -t resolute-proposed fake-hwclock; date -u
apt policy fake-hwclock # 0.14ubuntu0.1
Expected: the second time is not earlier than the first.
1. Saved time 10 minutes behind, plain load through the unit:
date -u -d '10 min ago' '+%F %T' | sudo tee /etc/fake-hwclock.data
date -u; sudo systemctl start fake-hwclock-load.service; date -u
sudo journalctl -u fake-hwclock-load.service -n 5
Fixed: the two times differ only by the elapsed seconds, and the
journal says "fake-hwclock saved clock information is in the past".
0.14build1: the clock goes back about 10 minutes.
2. Saved time 10 minutes behind, force:
date -u -d '10 min ago' '+%F %T' | sudo tee /etc/fake-hwclock.data
date -u; sudo fake-hwclock load force; date -u
Fixed: the clock goes back about 10 minutes. 0.14build1: it refuses.
3. Saved time 10 minutes ahead, plain load:
date -u -d '10 min' '+%F %T' | sudo tee /etc/fake-hwclock.data
date -u; sudo fake-hwclock load; date -u
Both versions: the clock goes forward about 10 minutes. Afterwards
put the clock right and run "sudo fake-hwclock save".
4. FORCE in /etc/default/fake-hwclock:
echo FORCE=force | sudo tee -a /etc/default/fake-hwclock
date -u -d '10 min ago' '+%F %T' | sudo tee /etc/fake-hwclock.data
date -u; sudo systemctl start fake-hwclock-load.service; date -u
sudo sed -i '/^FORCE=force$/d' /etc/default/fake-hwclock
Fixed: the clock goes back about 10 minutes, as configured.
0.14build1: it does not move.
5. Boot, the case users hit: with the clock right, stop the VM, wait
10 minutes, start it again, then:
sudo journalctl -b -u fake-hwclock-load.service
sudo journalctl -b -u chrony | grep -E 'wrong by|stepped'
Fixed: the journal says "in the past" and shows the shutdown time as
the saved time, and chrony reports no correction of about 600
seconds. 0.14build1: the unit prints nothing (26.04's date is
silent), but its "Finished" line is stamped about 10 minutes before
its "Starting" line, and chrony then steps the clock forward by
about 600 seconds.
[ Where problems could occur ]
The forward case (saved time later than the clock) is the other half
of the same test and does not depend on FORCE, so it should not
change. If it broke anyway, machines without an RTC would boot at an
old time until NTP syncs (fsck time warnings, TLS failures before
sync). Test 3 covers it.
Anything that relied on 0.14's plain "load" moving the clock backwards
would now need "load force". The update leaves
/etc/default/fake-hwclock as it is, so a system with FORCE set to
anything but "false" there will force the load at every boot, as
configured (FORCE=force did so in 0.13 too; values such as FORCE=true
did nothing in 0.13). If someone set FORCE to work around this bug,
that shows up after the update as the clock going back at boot.
Test 4 covers it.
On upgrade the postinst runs "fake-hwclock save" and restarts
fake-hwclock-load; with the fix that restart does not move the clock
(beyond a sub-second step, as in 0.13). The upgrade step covers it.
[ Other Info ]
* Please sponsor the attached debdiff (0.14ubuntu0.1) into
resolute-proposed. fake-hwclock is a native package, so the script
is patched in place; there is no debian/patches.
* No newer-series SRU is needed: 26.10 and the development release
have 0.15. 24.04 (0.13) is not affected.
* Debian bug #1093227: https://bugs.debian.org/1093227
Introduced by upstream commit 83537e2, fixed by 875c169:
https://git.einval.com/cgi-bin/gitweb.cgi?p=fake-hwclock.git;a=commit;h=875c169
* Debian 13 still has 0.14. A trixie stable update with the same fix
was requested by mail to the Debian maintainer on 2026-11-21.
* An Armbian pull request will carry the fix in newly built images.
* Testing so far: built on 26.04; lintian reports only the existing
Standards-Version note. Live on an Armbian-built 26.04 board, with
the fixed script run through the unit via an ExecStart drop-in (the
package itself was not installed there): with the saved time about
10 minutes behind, starting fake-hwclock-load moved the clock back
601.6 s with 0.14build1 and left it alone with the fix; "load force"
still set it. The FORCE cases were checked with the same script in a
trixie userland.
An LLM assistant (Claude) helped me trace this, build and test the
package and draft this report, and separate Claude sessions
double-checked it. I checked the results and the text myself and I'm
responsible for them.
** Affects: fake-hwclock (Ubuntu)
Importance: Undecided
Status: New
** Tags: regression-release resolute
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2175490
Title:
fake-hwclock in 26.04 moves the clock backwards at boot (inverted
"force" check, fixed in 0.15)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/fake-hwclock/+bug/2175490/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs