Bug#890891: systemd: PID1 getting stuck printing "systemd[1]: Time has been changed" continuously

Gert Wollny gewo at debian.org
Tue Feb 20 11:40:33 GMT 2018


Package: systemd
Version: 236-3
Severity: normal
Tags: upstream

Dear Maintainer,

on an 32 bit arm system when the RTC is set to a wrong time booting the system might 
fail because systemd gets stuck in a loop printing "systemd[1]: Time has been changed". 

The problem is known upstream and claimed to be a problem of the kernel: 
  https://github.com/systemd/systemd/issues/1143

However, while upstream is certainly correct that a kernel bug is the trigger of 
the lockup, systemd should not hang on this, because if sending messages to systemd 
can lock up the system then this is actually an attack vector for a DoS attack. 

A approach to work around this problem is posted in above bug report by user wtarreau and 
repeated here (comment included): 

  Basically manager_clock_watch() could start with something more or less like this
  (assuming it's the one responsible for this endless loop) :

   gettimeofday(&now, NULL);
   if (m->last_change == now.tv_sec) {
      m->change_count++;
   }
   else {
      if (m->change_count > 1)
         log("Time changed %d times in the last second\n", m->change_count);
      if (m->change_count >= 100) {
         log("Timerfd is broken on this system, disabling time change detection\n");
         manager_listen_stop(m);
         return 0;
      }
      m->change_count = 0;
      m->last_change = now.tv_sec;
   }

Best, 
Gert 

-- Package-specific info:

-- System Information:
Debian Release: buster/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: armhf (armv7l)

Kernel: Linux 4.15.1-cm-fx6-my (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C), LANGUAGE=en_US.UTF-8 (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages systemd depends on:
ii  adduser         3.117
ii  libacl1         2.2.52-3+b1
ii  libapparmor1    2.12-2
ii  libaudit1       1:2.8.2-1
ii  libblkid1       2.30.2-0.3
ii  libc6           2.26-6
ii  libcap2         1:2.25-1.2
ii  libcryptsetup4  2:1.7.5-1
ii  libgcrypt20     1.8.1-4
ii  libgpg-error0   1.27-6
ii  libidn11        1.33-2.1
ii  libip4tc0       1.6.2-1
ii  libkmod2        25-1
ii  liblz4-1        0.0~r131-2+b1
ii  liblzma5        5.2.2-1.3
ii  libmount1       2.30.2-0.3
ii  libpam0g        1.1.8-3.7
ii  libseccomp2     2.3.1-2.1
ii  libselinux1     2.7-2+b1
ii  libsystemd0     236-3
ii  mount           2.30.2-0.3
ii  procps          2:3.3.12-3
ii  util-linux      2.30.2-0.3

Versions of packages systemd recommends:
ii  dbus            1.12.4-1
ii  libpam-systemd  236-3

Versions of packages systemd suggests:
ii  policykit-1        0.105-18
pn  systemd-container  <none>

Versions of packages systemd is related to:
pn  dracut           <none>
pn  initramfs-tools  <none>
ii  udev             236-3

-- no debconf information



More information about the Pkg-systemd-maintainers mailing list