From 56d7398fe50c3a0d4eca99fb24bbb530c1f66168 Mon Sep 17 00:00:00 2001 From: Andrew Case Date: Wed, 5 Mar 2025 23:25:52 +0000 Subject: [PATCH] Prevent backtraces when the node head is smeared --- volatility3/framework/symbols/linux/__init__.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/volatility3/framework/symbols/linux/__init__.py b/volatility3/framework/symbols/linux/__init__.py index 5f6a66860..6e8a44db1 100644 --- a/volatility3/framework/symbols/linux/__init__.py +++ b/volatility3/framework/symbols/linux/__init__.py @@ -669,7 +669,7 @@ class IDStorage(ABC): raise NotImplementedError @abstractmethod - def get_head_node(self, tree) -> int: + def get_head_node(self, tree) -> Optional[int]: """Returns a pointer to the tree's head""" raise NotImplementedError @@ -763,8 +763,11 @@ class XArray(IDStorage): node = self.nodep_to_node(nodep) return (node.shift // self.CHUNK_SHIFT) + 1 - def get_head_node(self, tree) -> int: - return tree.xa_head + def get_head_node(self, tree) -> Optional[int]: + try: + return tree.xa_head + except exceptions.InvalidAddressException: + return None def node_is_internal(self, nodep) -> bool: return (nodep & self.XARRAY_TAG_MASK) == self.XARRAY_TAG_INTERNAL @@ -872,8 +875,11 @@ class RadixTree(IDStorage): return height - def get_head_node(self, tree) -> int: - return tree.rnode + def get_head_node(self, tree) -> Optional[int]: + try: + return tree.rnode + except exceptions.InvalidAddressException: + return None def node_is_internal(self, nodep) -> bool: return (nodep & self.RADIX_TREE_INTERNAL_NODE) != 0