Skip to content

Fix capabilities plugin on kernels before 6.3 - #2017

Merged
ikelos merged 1 commit into
volatilityfoundation:developfrom
mmadersbacher:fix/capabilities-pre-63-kernels
Aug 19, 2026
Merged

Fix capabilities plugin on kernels before 6.3#2017
ikelos merged 1 commit into
volatilityfoundation:developfrom
mmadersbacher:fix/capabilities-pre-63-kernels

Conversation

@mmadersbacher

Copy link
Copy Markdown
Contributor

linux.capabilities aborts on any image whose symbols carry kernel_cap_t in the pre-6.3 layout:

VolatilityException: Unsupported kernel capabilities implementation

kernel_cap_t was added for the 6.3 rework (#985), where the struct became { u64 val; }. Before 6.3 the same name exists as a typedef of kernel_cap_struct with a two-element __u32 cap[], and symbols/linux/__init__.py:61 maps that name to the subclass regardless. The subclass only handles val, so it raises even though kernel_cap_struct.get_capabilities() decodes the old layout correctly.

Falling back to the parent keeps the error path intact. It still raises the same exception when cap is missing or has an unexpected length (extensions/__init__.py:2310 and :2328).

All three Debian ISFs used by the test workflow carry the old layout:

kernel_cap_t  size=8  fields: ['cap: array[2] of unsigned int']

On linux-sample-1.bin the exit code goes from 1 to 0 and the plugin lists 133 tasks instead of none. test_linux_generic_capabilities no longer takes its early-return path for this image, so its assertions actually run now.

ruff check and ruff format --check clean. test/plugins/linux/linux.py 41 passed.

kernel_cap_t only handles the 6.3+ layout and raised for everything else.
Before 6.3 the same name exists as a typedef of kernel_cap_struct, whose
implementation already decodes the two-element cap array, so fall back to
it instead of raising.

@ikelos ikelos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable, if the tests pass we'll merge it, thanks! 5:)

@ikelos
ikelos merged commit 44f8222 into volatilityfoundation:develop Aug 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants