Ubuntu · Packages & updates

Reboot after updates that require it, or use Livepatch

When it fails: The system has waited too long for a reboot that updates require. Updated kernel or core libraries are installed but not running, so the vulnerabilities they fix are still exploitable.

CB-UBU-PKG-013mediumactiveautomatedprofile core

As released in v0.1.0 (beta). Current state.

Description

Some updates only take effect after a reboot: the kernel, and libraries loaded by every process such as the C library, OpenSSL or systemd. When a package asks for it, update-notifier-common creates /var/run/reboot-required and lists the packages concerned in /var/run/reboot-required.pkgs. Both files disappear at the next boot (/var/run is a tmpfs).

Canonical Livepatch, part of Ubuntu Pro, applies the fixes for high and critical kernel vulnerabilities to the running kernel without a reboot.

The control fails when /var/run/reboot-required is older than {{ max_days }} days, unless every package that asked for the reboot is a kernel package (linux-*) and Livepatch is running and has applied its patches.

The control does not reboot the system: there is no automated fix. Long-running processes can also keep old libraries mapped without any reboot-required file; needrestart (installed by default on 22.04 and later servers) restarts the services concerned after updates.

Rationale

An updated package on disk does not protect the system while the old kernel or library is still in memory: a scanner reading package versions reports the system as fixed while the vulnerability can still be exploited. Systems that are never rebooted are among the most frequent audit findings. A bounded delay leaves time to plan the reboot in a maintenance window.

Impact

Rebooting interrupts the services of the system: plan a regular maintenance window, or use Unattended-Upgrade::Automatic-Reboot with Automatic-Reboot-Time on systems that can reboot on their own. Livepatch needs an Ubuntu Pro subscription and only covers the kernel.

Setting

Location/var/run/reboot-required, /var/run/reboot-required.pkgs
RecommendedAbsent, or at most {{ max_days }} days old, or only kernel packages with Livepatch applied

Parameters

ParameterCoreServerServer hardenedDesktopDesktop hardenedBounds
max_daysinteger, days. Longest accepted delay between an update that requires a reboot and the reboot.141471471 to 90

The value used is your override (tailoring file), else the profile's, else the one of the profile it extends, else the default. Bounds limit what an override may set.

Audit

  1. ls -l --time-style=+%F /var/run/reboot-required shows no file, or a date at most {{ max_days }} days ago.
  2. Otherwise, cat /var/run/reboot-required.pkgs lists only linux-* packages and canonical-livepatch status shows Livepatch running with its patches applied.

Automated: every check must pass. Scanners report each check by its id.

reboot-required

Age of /var/run/reboot-required, packages that asked for the reboot, and Livepatch state.

script: |
  f=/var/run/reboot-required
  [ -e "$f" ] || { echo "no reboot required"; exit 0; }
  age=$(( ($(date +%s) - $(stat -c %Y "$f")) / 86400 ))
  pkgs=$(sort -u "$f.pkgs" 2>/dev/null | tr '\n' ' ')
  echo "reboot required for $age days (limit $CB_MAX_DAYS) by: ${pkgs:-unknown packages}"
  [ "$age" -le "$CB_MAX_DAYS" ] && exit 0
  if [ -n "$pkgs" ] && [ -z "$(sort -u "$f.pkgs" | grep -v '^linux-')" ]; then
    lp=/snap/bin/canonical-livepatch
    if [ -x "$lp" ] && "$lp" status --format=json 2>/dev/null | grep -Eiq '"patchState": ?"(applied|nothing-to-apply)"'; then
      echo "kernel updates only, covered by Livepatch"
      exit 0
    fi
    echo "kernel updates only, Livepatch not running or not applied"
  fi
  exit 1

Remediation

Reboot the system during a maintenance window (systemctl reboot), then check that /var/run/reboot-required is gone. To keep up without a human:

  • schedule the reboot with unattended-upgrades on systems that can reboot unattended, in /etc/apt/apt.conf.d/52unattended-upgrades-local: Unattended-Upgrade::Automatic-Reboot "true"; and Unattended-Upgrade::Automatic-Reboot-Time "03:00";;
  • on systems attached to Ubuntu Pro, enable Livepatch (pro enable livepatch) to defer kernel reboots, and still reboot for the other packages.

References

Mappings

FrameworkIDRelationNote
ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0R61partialR61 asks for a regular update process; this control checks that installed fixes are actually running.
NIST SP 800-53 Rev. 55.1.1SI-2partial

How this control relates to the other framework's: equivalent, stricter, looser, partial or related.

Threats mitigated

People and lifecycle

Authors
Verified2026-10-19 by Sn0wAlice on 20.04, Proxmox VM, Ubuntu 20.04 cloud image, kernel 5.4.0-216-generic. Passes on stock; reboot-required 20 days old for libc6 fails (14 days core), 8 days old for linux-* fails with 7 days (hardened) and passes with a stub canonical-livepatch reporting patchState applied (no Pro token in the lab).
Verified2026-10-19 by Sn0wAlice on 22.04, Proxmox VM, Ubuntu 22.04 cloud image, kernel 5.15.0-198-generic. Passes on stock; reboot-required 20 days old for libc6 fails (14 days core), 8 days old for linux-* fails with 7 days (hardened) and passes with a stub canonical-livepatch reporting patchState applied (no Pro token in the lab).
Verified2026-10-19 by Sn0wAlice on 24.04, Proxmox VM, Ubuntu 24.04 cloud image, kernel 6.8.0-147-generic. Passes on stock; reboot-required 20 days old for libc6 fails (14 days core), 8 days old for linux-* fails with 7 days (hardened) and passes with a stub canonical-livepatch reporting patchState applied (no Pro token in the lab).
Verified2026-10-19 by Sn0wAlice on 26.04, Proxmox VM, Ubuntu 26.04 cloud image, kernel 7.0.0-38-generic. Passes on stock; reboot-required 20 days old for libc6 fails (14 days core), 8 days old for linux-* fails with 7 days (hardened) and passes with a stub canonical-livepatch reporting patchState applied (no Pro token in the lab).
Introduced inv0.1.0
Created, updated2026-10-19, 2026-10-19
Translationsfr