From 388a3e64587478b0a07121a41f2b05a684c4292e Mon Sep 17 00:00:00 2001 From: David McDonald Date: Thu, 24 Oct 2024 14:39:22 -0500 Subject: [PATCH 1/2] Linux: Adds missing abc.Iterable implementation `hlist_head` is missing an implementation for `collections.abc.Iterable`, resulting in a crash at runtime. This fixes the issue by providing the required `__iter__` implementation for `hlist_head`. --- volatility3/framework/symbols/linux/extensions/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/volatility3/framework/symbols/linux/extensions/__init__.py b/volatility3/framework/symbols/linux/extensions/__init__.py index 14be5ec0a..9bd401db2 100644 --- a/volatility3/framework/symbols/linux/extensions/__init__.py +++ b/volatility3/framework/symbols/linux/extensions/__init__.py @@ -1037,6 +1037,9 @@ def to_list( current = current.next + def __iter__(self) -> Iterator[interfaces.objects.ObjectInterface]: + return self.to_list(self.vol.parent.vol.type_name, self.vol.member_name) + class files_struct(objects.StructType): def get_fds(self) -> interfaces.objects.ObjectInterface: From 4c2d2f98da5c6fcbfe8e8aa2efa590438cdf1444 Mon Sep 17 00:00:00 2001 From: David McDonald Date: Thu, 24 Oct 2024 15:39:15 -0500 Subject: [PATCH 2/2] Removes collections.abc.Iterable superclass Per @gcmoreira this is the correct fix vs the one previously proposed, since self.vol.member_name cannot be used as the member name to iterate this type. --- volatility3/framework/symbols/linux/extensions/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/volatility3/framework/symbols/linux/extensions/__init__.py b/volatility3/framework/symbols/linux/extensions/__init__.py index 9bd401db2..eba775714 100644 --- a/volatility3/framework/symbols/linux/extensions/__init__.py +++ b/volatility3/framework/symbols/linux/extensions/__init__.py @@ -1004,7 +1004,7 @@ def __iter__(self) -> Iterator[interfaces.objects.ObjectInterface]: return self.to_list(self.vol.parent.vol.type_name, self.vol.member_name) -class hlist_head(objects.StructType, collections.abc.Iterable): +class hlist_head(objects.StructType): def to_list( self, symbol_type: str, @@ -1037,9 +1037,6 @@ def to_list( current = current.next - def __iter__(self) -> Iterator[interfaces.objects.ObjectInterface]: - return self.to_list(self.vol.parent.vol.type_name, self.vol.member_name) - class files_struct(objects.StructType): def get_fds(self) -> interfaces.objects.ObjectInterface: