diff --git a/volatility3/framework/symbols/linux/__init__.py b/volatility3/framework/symbols/linux/__init__.py index 8c2288c13..c443c37e1 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 @@ -767,8 +767,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 @@ -876,8 +879,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