Skip to content

Commit

Permalink
functools caching and doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Abyss-W4tcher committed Jan 18, 2025
1 parent bb6556d commit 0b82f73
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions volatility3/framework/symbols/linux/utilities/tainting.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import functools

from volatility3 import framework
from volatility3.framework import interfaces
from volatility3.framework.constants import linux as linux_constants
Expand All @@ -18,11 +20,18 @@ class Tainting(interfaces.configuration.VersionableInterface):
framework.require_interface_version(*_required_framework_version)

@classmethod
@functools.lru_cache
def _get_kernel_taint_flags_list(
cls,
context: interfaces.context.ContextInterface,
kernel_module_name: str,
) -> Optional[List[interfaces.objects.ObjectInterface]]:
"""Determine whether the kernel embeds taint flags definition
in-memory or not.
Returns:
A list of "taint_flag" kernel objects if taint_flags symbok exists
"""
kernel = context.modules[kernel_module_name]
if kernel.has_symbol("taint_flags"):
return list(kernel.object_from_symbol("taint_flags"))
Expand Down

0 comments on commit 0b82f73

Please sign in to comment.