timedatectl list-timezones shows timezones that are not installed

Bug #2125405 reported by Nick Rosbrook
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
Medium
Nick Rosbrook
Noble
Fix Released
Medium
Nick Rosbrook
Plucky
Won't Fix
Medium
Unassigned

Bug Description

[Impact]

The org.freedesktop.timedate1.ListTimezones DBus method may return a list that contains timezones that are not installed on the system.

To build the list, systemd-timedated parses /usr/share/zoneinfo/tzdata.zi from the tzdata package (or /usr/share/zoneinfo/zone1970.tab as a fallback). However, not all timezones listed in tzdata.zi are included in the main tzdata package, but in the tzdata-legacy package.

But, systemd-timedated does not validate the timezones when building the list, which makes the following possible:

$ timedatectl list-timezones | grep "US/Alaska"
US/Alaska

$ timedatectl set-timezone US/Alaska
Failed to set time zone: Invalid or not installed time zone 'US/Alaska'

[Test Plan]

Select a timezone from the tzdata-legacy package, e.g. US/Alaska.

Confirm that /usr/share/zoneinfo/US/Alaska does not exist, and that the tzdata-legacy package is not installed:

$ stat /usr/share/zoneinfo/US/Alaska
$ apt policy tzdata-legacy

Check if US/Alaska is included the the list from systemd-timedated:

$ timedatectl list-timezones | grep "US/Alaska"

With the fix, US/Alaska should not be listed. But, after installing tzdata-legacy, US/Alaska should be installed.

$ apt install tzdata-legacy
$ timedatectl list-timezones | grep "US/Alaska"

[Where problems could occur]

The patch uses an existing timezone_is_valid() function to validate timezones before returning a list in get_timezones(). In addition to systemd-timedated, get_timezones() is used in systemd-firstboot.

If external programs depend on the current buggy behavior, this fix could cause a regression.

Note that the org.freedesktop.timedate1.SetTimezone method already uses timezone_is_valid() to validate timezones (as demonstrated in the Impact section).

Nick Rosbrook (enr0n)
Changed in systemd (Ubuntu):
importance: Undecided → Medium
Changed in systemd (Ubuntu Noble):
importance: Undecided → Medium
Changed in systemd (Ubuntu Plucky):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 257.9-0ubuntu2

---------------
systemd (257.9-0ubuntu2) questing; urgency=medium

  * basic: validate timezones in get_timezones() (LP: #2125405)
  * debian/libnss-systemd.nss: install after 'compat' too (LP: #2125403)
  * d/t/boot-and-services: use coreutils tunable in apparmor test (LP: #2125614)
  * d/t/upstream: use GNU cp in test setup (LP: #2122363)

 -- Nick Rosbrook <email address hidden> Thu, 25 Sep 2025 12:45:39 -0400

Changed in systemd (Ubuntu):
status: New → Fix Released
Revision history for this message
Nick Rosbrook (enr0n) wrote :

Given this is fixed is questing, I will opt to not fix this in plucky, according to https://documentation.ubuntu.com/sru/en/latest/reference/requirements/#general-requirements-for-all-srus.

Changed in systemd (Ubuntu Plucky):
status: New → Won't Fix
Changed in systemd (Ubuntu Noble):
assignee: nobody → Nick Rosbrook (enr0n)
status: New → Triaged
Revision history for this message
Bugra Aydogar (bugraaydogar) wrote :

Hi Nick,

When will this be back ported to 255.4-1 (noble)?

Thanks,
Bugra

Revision history for this message
Nick Rosbrook (enr0n) wrote :

In the next SRU, which I plan to initiate in the next couple weeks.

Nick Rosbrook (enr0n)
Changed in systemd (Ubuntu Noble):
status: Triaged → In Progress
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Nick, or anyone else affected,

Accepted systemd into noble-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/255.4-1ubuntu8.12 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-noble to verification-done-noble. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-noble. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Noble):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-noble
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/255.4-1ubuntu8.12)

All autopkgtests for the newly accepted systemd (255.4-1ubuntu8.12) for noble have finished running.
The following regressions have been reported in tests triggered by the package:

apport/2.28.1-0ubuntu3.8 (armhf, s390x)
apt/2.8.3 (amd64)
asterisk/1:20.6.0~dfsg+~cs6.13.40431414-2build5 (armhf)
at-spi2-core/2.52.0-1build1 (s390x)
casper/1.498 (amd64)
cron/3.0pl1-184ubuntu2 (amd64)
debci/3.9 (armhf)
debos/1.1.3-1ubuntu0.3 (amd64)
docker.io-app/28.2.2-0ubuntu1~24.04.1 (amd64, arm64, s390x)
fwupd/1.9.31-0ubuntu1~24.04.1 (arm64)
initramfs-tools/0.142ubuntu25.5 (armhf, s390x)
jami/unknown (armhf)
libei/1.2.1-1 (armhf)
linux-azure-6.11/6.11.0-1018.18~24.04.1 (amd64)
linux-azure-nvidia/6.8.0-1028.31 (arm64)
linux-azure-nvidia-6.14/6.14.0-1009.9 (arm64)
linux-lowlatency/6.8.0-88.89.1 (arm64)
linux-lowlatency-hwe-6.11/6.11.0-1016.17~24.04.1 (amd64, arm64)
linux-nvidia/6.8.0-1043.46 (amd64)
linux-nvidia-6.11/6.11.0-1016.16 (amd64, arm64)
linux-oem-6.14/6.14.0-1016.16 (amd64)
linux-oem-6.8/6.8.0-1032.32 (amd64)
linux-oracle-6.14/6.14.0-1017.17~24.04.1 (arm64)
logiops/unknown (armhf)
mediawiki/unknown (armhf)
munin/2.0.75-1ubuntu1 (armhf)
netplan.io/1.1.2-8ubuntu1~24.04.1 (amd64, arm64, s390x)
netplan.io/unknown (armhf)
ovn/24.03.6-0ubuntu0.24.04.1 (s390x)
puppet-agent/8.4.0-1 (armhf)
pystemd/0.13.2-1build2 (armhf)
rsyslog/8.2312.0-3ubuntu9.1 (armhf)
systemd/255.4-1ubuntu8.12 (arm64)
tinyssh/20240101-2 (armhf)
upower/1.90.3-1 (s390x)
wireshark/unknown (armhf)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/noble/update_excuses.html#systemd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Nick Rosbrook (enr0n) wrote :

First, confirmed the bug is present:

root@n:~# apt policy systemd
systemd:
  Installed: 255.4-1ubuntu8.11
  Candidate: 255.4-1ubuntu8.11
  Version table:
     255.4-1ubuntu8.12 100
        100 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages
 *** 255.4-1ubuntu8.11 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     255.4-1ubuntu8.8 500
        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
     255.4-1ubuntu8 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
root@n:~# stat /usr/share/zoneinfo/US/Alaska
stat: cannot statx '/usr/share/zoneinfo/US/Alaska': No such file or directory
root@n:~# apt policy tzdata-legacy
tzdata-legacy:
  Installed: (none)
  Candidate: 2025b-0ubuntu0.24.04.1
  Version table:
     2025b-0ubuntu0.24.04.1 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
     2024a-2ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
root@n:~# timedatectl list-timezones | grep "US/Alaska"
US/Alaska

Then, after installing systemd from noble-proposed, confirmed the fix:

root@n:~# apt policy systemd
systemd:
  Installed: 255.4-1ubuntu8.12
  Candidate: 255.4-1ubuntu8.12
  Version table:
 *** 255.4-1ubuntu8.12 100
        100 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     255.4-1ubuntu8.11 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
     255.4-1ubuntu8.8 500
        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
     255.4-1ubuntu8 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
root@n:~# stat /usr/share/zoneinfo/US/Alaska
stat: cannot statx '/usr/share/zoneinfo/US/Alaska': No such file or directory
root@n:~# apt policy tzdata-legacy
tzdata-legacy:
  Installed: (none)
  Candidate: 2025b-0ubuntu0.24.04.1
  Version table:
     2025b-0ubuntu0.24.04.1 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
     2024a-2ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
root@n:~# timedatectl list-timezones | grep "US/Alaska"
root@n:~#

tags: added: verification-done verification-done-noble
removed: verification-needed verification-needed-noble
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 255.4-1ubuntu8.12

---------------
systemd (255.4-1ubuntu8.12) noble; urgency=medium

  * basic: validate timezones in get_timezones() (LP: #2125405)
  * ukify: fix insertion of padding in merged sections (LP: #2132666)
  * core: downgrade a log message from warning to debug (LP: #2130554)
  * test: skip testcase_multipath_basic_failover.
    This test has been failing on Ubuntu infrastructure for a long time.
    Leaving this alone at the moment allows other failures to potentially go
    unnoticed, because the migration reference baseline has been reset to
    fail. Skip the test to try and reset the baseline to pass.
  * d/gbp.conf: stop using wrap_cl.py

 -- Nick Rosbrook <email address hidden> Tue, 25 Nov 2025 13:16:31 -0500

Changed in systemd (Ubuntu Noble):
status: Fix Committed → Fix Released
Revision history for this message
Julian Andres Klode (juliank) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.