GrepBoard/Manuals
605 manuals ·

Ubuntu zlib USN-8954-1: find processes still using old libz

·Tested on Ubuntu 24.04 (Docker ubuntu:24.04) · zlib1g 1:1.3.dfsg-3.1ubuntu2.2 → 2.3 · 2026-10·Test scope ↓·4 steps

Ubuntu 24.04 zlib USN-8954-1 (CVE-2026-85091) is fixed in zlib1g 1:1.3.dfsg-3.1ubuntu2.3, but running processes keep old libz. Find them via /proc and lsof.

USN-8954-1, published 2026-10-22, fixes CVE-2026-85091 in zlib. On 24.04, upgrade zlib1g to **1:1.3.dfsg-3.1ubuntu2.3, then restart the processes that were already running** so they load the new library. The USN only says that a standard system update makes all the necessary changes and does not mention restarts, but as the test below shows, a process started before the update keeps the deleted old libz.so mapped.

The flaw is a heap buffer overflow in gz_vacate() while handling non-blocking gzwrite(), triggered by calling gzprintf() or gzvprintf() after a write stall. The USN mentions denial of service or possible arbitrary code execution (USN-8954-1 · CVE-2026-85091).

[1] Check the version.

console
$ apt-cache policy zlib1gzlib1g:  Installed: 1:1.3.dfsg-3.1ubuntu2.2  Candidate: 1:1.3.dfsg-3.1ubuntu2.3  Version table:     1:1.3.dfsg-3.1ubuntu2.3 500        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages *** 1:1.3.dfsg-3.1ubuntu2.2 100        100 /var/lib/dpkg/status     1:1.3.dfsg-3.1ubuntu2 500        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages

If Installed is below …ubuntu2.3, you are not fixed yet. For 24.04 the USN lists zlib1g, zlib1g-dev, and lib32z1, lib64z1, libx32z1 (each with -dev) at the same version. On 26.04 it is 1:1.3.dfsg+really1.3.1-1ubuntu3.2. On 2026-10-27, zlib for 22.04 and 20.04 was still "Needs evaluation".

[2] List every installed zlib package, then upgrade them together. Upgrading only zlib1g leaves zlib1g-dev or the 32-bit lib32z1 on the old version on hosts that have them.

console
$ dpkg -l 'zlib1g*' 'lib32z1*' 'lib64z1*' 'libx32z1*' 2>/dev/null | grep '^ii'ii  zlib1g:amd64   1:1.3.dfsg-3.1ubuntu2.2 amd64        compression library - runtime$ sudo apt-get update$ sudo apt-get install --only-upgrade zlib1g zlib1g-dev lib32z1 libx32z1Skipping zlib1g-dev, it is not installed and only upgrades are requested.Skipping lib32z1, it is not installed and only upgrades are requested.Skipping libx32z1, it is not installed and only upgrades are requested.1 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.$ dpkg -l 'zlib1g*' 'lib32z1*' 'lib64z1*' 'libx32z1*' 2>/dev/null | grep '^ii'ii  zlib1g:amd64   1:1.3.dfsg-3.1ubuntu2.3 amd64        compression library - runtime

--only-upgrade skips names that are not installed, so a generous list does not install anything new (add the -dev variants such as lib32z1-dev if you use them). Names that do not exist in the archive are different: amd64 has no lib64z1 package, and including it stops the whole command with E: Unable to locate package lib64z1 before anything is upgraded. Use only the names the first dpkg -l shows. If upgrading other packages at the same time is fine on that host, sudo apt-get upgrade is the simplest route.

[3] Find processes holding the old library. For the test, a python3 process that had loaded zlib was started before the update. Its memory mapping before and after:

console
$ grep -m1 'libz\.so' /proc/2547/maps | awk '{print $6, $7}'/usr/lib/x86_64-linux-gnu/libz.so.1.3$ grep -m1 'libz\.so' /proc/2547/maps | awk '{print $6, $7}'/usr/lib/x86_64-linux-gnu/libz.so.1.3 (deleted)

The path is the same, but (deleted) now follows it: the package replaced the file, and this process still has the deleted old file in memory. To sweep every process at once, with nothing extra installed:

console
$ for m in /proc/[0-9]*/maps; do grep -q 'libz\.so.* (deleted)' $m 2>/dev/null && p=${m%/maps} && echo "${p#/proc/} $(cat $p/comm)"; done2547 python3

With lsof installed, the same shows up as DEL:

console
$ lsof -n 2>/dev/null | grep -E 'libz\.so' | grep -E 'DEL|deleted' | awk '{print $1, $2, $4, $NF}' | sort -upython3 2547 DEL /usr/lib/x86_64-linux-gnu/libz.so.1.3

Run either command with sudo to include other users' processes. Without permission, their maps cannot be read and they are silently skipped.

[4] Restart what you found. For services, restart the unit. In the test, the process was stopped and started again, then checked the same way:

console
$ grep -m1 'libz\.so' /proc/2596/maps | awk '{print $6, $7}'/usr/lib/x86_64-linux-gnu/libz.so.1.3$ for m in /proc/[0-9]*/maps; do grep -q 'libz\.so.* (deleted)' $m 2>/dev/null && p=${m%/maps} && echo "${p#/proc/} $(cat $p/comm)"; done; echo donedone

The new process has no (deleted) and the list is empty. Restarting a service can drop in-flight requests, so do it at a quiet time and run the service's config test first if it has one. Many processes use libz, so the list can be long; if restarting them one by one is impractical, a reboot is the surest route.

To group by service or restart automatically, see Find processes on old code after a security update. The same check works for other libraries; for OpenSSL, replace libz\.so with libssl\.so (OpenSSL CVE-2026-84782 (High): check your Ubuntu libssl version).

Where checking gets confusing

  • Packages listed separately: the Ubuntu CVE table has its own rows for klibc and zsync, and on 2026-10-27 both were "Vulnerable" on every release, 24.04 included. rsync is "Vulnerable" on 20.04, 18.04 and 16.04 and "Not affected" from 22.04 on (page note: rsync builds against the system zlib since 3.2.0-1). These rows move independently of the zlib1g update; if you use those packages, the only option is to wait for their own fixed versions.
  • Affected version range: the CVE description names zlib 1.3.1.2 through 1.3.2, but the Ubuntu notes on the same page say the affected versions are unclear and lower versions may be affected too (2026-10-22). Do not read 24.04's 1.3 as "not affected"; upgrade.
  • Containers: running containers do not change when the host updates. Rebuild the image and redeploy. The ubuntu:24.04 image tested here was still at …ubuntu2.2 (unfixed) when pulled.

#zlib#usn#ubuntu#restart#lsof