Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions volatility3/framework/constants/linux/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,16 +487,18 @@ class TaintFlag:
"L": TaintFlag(shift=1 << 14, desc="SOFTLOCKUP", when_present=True, module=False),
"K": TaintFlag(shift=1 << 15, desc="LIVEPATCH", when_present=True, module=True),
"X": TaintFlag(shift=1 << 16, desc="AUX", when_present=True, module=True),
"T": TaintFlag(shift=1 << 17, desc="RANDSTRUCT", when_present=True, module=True),
"T": TaintFlag(shift=1 << 17, desc="RANDSTRUCT", when_present=True, module=False),
"N": TaintFlag(shift=1 << 18, desc="TEST", when_present=True, module=True),
"J": TaintFlag(shift=1 << 19, desc="FWCTL", when_present=True, module=False),
}
"""Flags used to taint kernel and modules, for debugging purposes.

Map based on 6.12-rc5.
Map based on 7.2.0-rc5.

Documentation :
- https://www.kernel.org/doc/Documentation/admin-guide/sysctl/kernel.rst#:~:text=guide/sysrq.rst.-,tainted,-%3D%3D%3D%3D%3D%3D%3D%0A%0ANon%2Dzero%20if
- https://www.kernel.org/doc/Documentation/admin-guide/tainted-kernels.rst#:~:text=More%20detailed%20explanation%20for%20tainting
- https://docs.kernel.org/admin-guide/tainted-kernels.html#table-for-decoding-tainted-state
- taint_flag kernel struct
- taint_flags kernel constant
"""
Expand Down
5 changes: 3 additions & 2 deletions volatility3/framework/symbols/linux/utilities/tainting.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Tainting(interfaces.configuration.VersionableInterface):
- kernel: print_tainted
"""

_version = (1, 0, 0)
_version = (1, 0, 1)
_required_framework_version = (2, 0, 0)

framework.require_interface_version(*_required_framework_version)
Expand Down Expand Up @@ -91,7 +91,8 @@ def _module_flags_taint_post_4_10_rc1(
for taint_bit, taint_flag in enumerate(
cls._get_kernel_taint_flags_list(context, kernel_module_name)
):
if is_module and not taint_flag.module:
# https://lore.kernel.org/all/20251022082938.26670-1-petr.pavlu@suse.com/T/#u: "taint/module: Remove unnecessary taint_flag.module field"
if is_module and taint_flag.has_member("module") and not taint_flag.module:

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.

Will this flag lots of false positives now, or was the taint_flag.module just a belt and braces check to reduce a few rare false positives?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In my limited understanding, and based on the lore message, no, it shouldn't produce false positives.

The commit message claims that the per-module flags are always those added to module.taints by calls to add_taint_module().

Cross-checking those calls, they (8) exist inside the following:

Along with a single direct set_bit() in inherit_taint()

The only flags that can reach mod->taints are P F O C E K N all of them already had the .module = true;

Actually, the error ran the other way around; the flags T and J were marked as per-module by mistake, which prompted the removal

continue

try:
Expand Down
Loading