Skip to content

Commit 0b82f73

Browse files
committed
functools caching and doc.
1 parent bb6556d commit 0b82f73

File tree

1 file changed

+9
-0
lines changed
  • volatility3/framework/symbols/linux/utilities

1 file changed

+9
-0
lines changed

volatility3/framework/symbols/linux/utilities/tainting.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import functools
2+
13
from volatility3 import framework
24
from volatility3.framework import interfaces
35
from volatility3.framework.constants import linux as linux_constants
@@ -18,11 +20,18 @@ class Tainting(interfaces.configuration.VersionableInterface):
1820
framework.require_interface_version(*_required_framework_version)
1921

2022
@classmethod
23+
@functools.lru_cache
2124
def _get_kernel_taint_flags_list(
2225
cls,
2326
context: interfaces.context.ContextInterface,
2427
kernel_module_name: str,
2528
) -> Optional[List[interfaces.objects.ObjectInterface]]:
29+
"""Determine whether the kernel embeds taint flags definition
30+
in-memory or not.
31+
32+
Returns:
33+
A list of "taint_flag" kernel objects if taint_flags symbok exists
34+
"""
2635
kernel = context.modules[kernel_module_name]
2736
if kernel.has_symbol("taint_flags"):
2837
return list(kernel.object_from_symbol("taint_flags"))

0 commit comments

Comments
 (0)