Memory usage grows beyond 6 GB when scanning a dpkg status file containing linux-libc-dev (Ubuntu 24.04)

Author: xWuWuxCreated Sep 25, 2026Updated Sep 29, 2026

Summary

Scanning a dpkg status file that contains the Ubuntu 24.04 linux-libc-dev package (source package linux) makes osv-scanner scan source allocate memory without bound. It passes 6 GB within about 2.5 minutes and the kernel OOM killer stops it. Without that one package, the same file scans in seconds.

We hit this in CI: on a GitHub-hosted runner with 7 GB RAM, the scan used up all memory and took down the runner agent. The job ended with "The operation was canceled" and uploaded no logs.

Minimal reproduction

status (a single stanza, taken from a stock ubuntu:24.04 image after apt-get install build-essential):

Package: linux-libc-dev
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 7592
Maintainer: Ubuntu Kernel Team <[email protected]>
Architecture: amd64
Multi-Arch: same
Source: linux
Version: 6.8.0-142.142
bash
# capped at 2 GB so the machine stays responsive
systemd-run --user --scope -p MemoryMax=2G -p MemorySwapMax=0 \
  osv-scanner scan source --no-resolve --format json --output-file /dev/null -L dpkg-status:status

Result: after 46 s, Failed with result 'oom-kill', 2G memory peak (exit code 143).

Measurements

osv-scanner 2.6.0 (release binary osv-scanner_linux_amd64), online mode (default, no --offline), each run in a systemd scope with a hard memory limit:

dpkg status file Packages Result Time Peak memory
stock ubuntu:24.04 image 92 completes (exit 1, 267 vulns) 2 s 86 MB
ubuntu:24.04 + build-essential default-jdk-headless r-base-dev python3-dev git curl and a few -dev libs, without linux-libc-dev 294 completes (exit 1) 7 s 1.2 GB
only linux-libc-dev (above) 1 OOM-killed at 6 GB limit 160 s > 6 GB
full image including linux-libc-dev 295 OOM-killed at 3 GB limit 99 s > 3 GB

I found the package by bisecting the 295-package file (1 GB / 60 s budget per attempt). Every step pointed to linux-libc-dev.

Expected behavior

The scan finishes with bounded memory, like it does for the other packages. The linux source package has a very large number of advisories, so it may take longer, but it should not need gigabytes of memory for one package.

My guess, which I have not verified in the code: the Ubuntu advisories for the linux source package get loaded or expanded in full, possibly once per kernel flavour or per affected range. #2217 looked similar, but it concerned offline mode and was closed.

Environment

  • osv-scanner 2.6.0, linux/amd64
  • Reproduced on Ubuntu 26.04 (WSL2, 16 GB RAM) and on GitHub Actions ubuntu-24.04 (2 vCPU, 7 GB RAM)
  • Input: dpkg status from Ubuntu 24.04 (noble)

Workaround

Remove packages whose Source is linux from the status file before scanning, and track kernel CVEs separately (e.g. through kernel update policy). We also run the scanner under a cgroup memory limit, so a runaway scan kills only the scanner and not the CI runner.