You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(vm): root partitions named cloudimg-rootfs and root are skipped #11692
trivy vm reads only partitions whose names are in requiredDiskName in pkg/fanal/walker/vm.go. go-disk uses the entry index as the name of a GPT partition without a name, and the list contains 0 to 3. So the root partition of Ubuntu 24.04 and older images passes the check only because it has no name and is the first entry. Since Ubuntu 26.04, Canonical names the root partition cloudimg-rootfs in its cloud images and AMIs. AlmaLinux names it root in its GenericCloud images and AMIs. These names are not in the list, so Trivy skips the root partition and returns an empty result with exit code 0. Nothing in the output shows that a partition was skipped, even with --debug.
Reported in #11691. The empty scans of AlmaLinux AMIs in #8627 and #5722 likely have the same cause.
$ trivy vm --scanners vuln --pkg-types os --list-all-pkgs --format json ubuntu-26.04.raw | jq -c '{os: .Metadata.OS, packages: ([.Results[]?.Packages[]?] | length)}'{"os":null,"packages":0}
The same steps with the Ubuntu 24.04 image detect ubuntu 24.04 and 664 packages, because its root partition has no name.
Expected behavior
Trivy detects the OS and lists the packages of Ubuntu 26.04 and AlmaLinux images. When Trivy skips a partition, the debug log shows the partition name.
I'll take this one — working on a fix that adds cloudimg-rootfs and root to the allowed partition names in pkg/fanal/walker/vm.go, plus a debug log when a partition is skipped.
I'd like to suggest dropping the name check instead of adding more names.
The name list fails silently: an unknown name gives an empty result with exit code 0. This has already happened in #5722, #8627 and #11691, and each new name will cause it again.
shouldSkip already skips partitions by type (Bootable()). I suggest removing requiredDiskName and also skipping Linux swap (GPT, MBR 0x82) and MBR extended partitions (0x05, 0x0F, 0x85). Partitions without ext4 or xfs are still not read, because filesystem detection fails for them. The root partitions in #11691 are then read regardless of their names, because their types are not skipped: Linux root (x86-64) in Ubuntu 26.04, and Linux filesystem data in the AlmaLinux 8, 9 and 10 GenericCloud images. This also reads the other ext4/xfs partitions on the disk, such as the volumes asked for in #5450.
Activity
bharathvemula commentedon Nov 20, 2026
I'll take this one — working on a fix that adds
cloudimg-rootfsandrootto the allowed partition names inpkg/fanal/walker/vm.go, plus a debug log when a partition is skipped.yusuke-koyoshi commentedon Nov 21, 2026
I'd like to suggest dropping the name check instead of adding more names.
The name list fails silently: an unknown name gives an empty result with exit code 0. This has already happened in #5722, #8627 and #11691, and each new name will cause it again.
shouldSkipalready skips partitions by type (Bootable()). I suggest removingrequiredDiskNameand also skipping Linux swap (GPT, MBR0x82) and MBR extended partitions (0x05,0x0F,0x85). Partitions without ext4 or xfs are still not read, because filesystem detection fails for them. The root partitions in #11691 are then read regardless of their names, because their types are not skipped: Linux root (x86-64) in Ubuntu 26.04, and Linux filesystem data in the AlmaLinux 8, 9 and 10 GenericCloud images. This also reads the other ext4/xfs partitions on the disk, such as the volumes asked for in #5450.For reference, here is an implementation: yusuke-koyoshi@3a86146