From cffad872bbae6fda31eb415de230e445603c451c Mon Sep 17 00:00:00 2001 From: Gustavo Moreira Date: Fri, 4 Oct 2024 12:22:53 +1000 Subject: [PATCH] Linux: sockstat. Fix #1271 which unnecessarily extends the interface of the list_sockets() class method --- volatility3/framework/plugins/linux/sockstat.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/volatility3/framework/plugins/linux/sockstat.py b/volatility3/framework/plugins/linux/sockstat.py index bb9c46fad..0ddd3e26d 100644 --- a/volatility3/framework/plugins/linux/sockstat.py +++ b/volatility3/framework/plugins/linux/sockstat.py @@ -22,7 +22,7 @@ class SockHandlers(interfaces.configuration.VersionableInterface): _required_framework_version = (2, 0, 0) - _version = (2, 0, 0) + _version = (3, 0, 0) def __init__(self, vmlinux, task, *args, **kwargs): super().__init__(*args, **kwargs) @@ -439,7 +439,7 @@ class Sockstat(plugins.PluginInterface): _required_framework_version = (2, 0, 0) - _version = (2, 0, 0) + _version = (3, 0, 0) @classmethod def get_requirements(cls): @@ -450,7 +450,7 @@ class Sockstat(plugins.PluginInterface): architectures=["Intel32", "Intel64"], ), requirements.VersionRequirement( - name="SockHandlers", component=SockHandlers, version=(2, 0, 0) + name="SockHandlers", component=SockHandlers, version=(3, 0, 0) ), requirements.PluginRequirement( name="lsof", plugin=lsof.Lsof, version=(2, 0, 0) @@ -550,7 +550,7 @@ class Sockstat(plugins.PluginInterface): except AttributeError: netns_id = NotAvailableValue() - yield task_comm, task, netns_id, fd_num, family, sock_type, protocol, sock_fields + yield task, netns_id, fd_num, family, sock_type, protocol, sock_fields def _format_fields(self, sock_stat, protocol): """Prepare the socket fields to be rendered @@ -597,7 +597,6 @@ class Sockstat(plugins.PluginInterface): ) for ( - task_comm, task, netns_id, fd_num, @@ -618,6 +617,8 @@ class Sockstat(plugins.PluginInterface): else NotAvailableValue() ) + task_comm = utility.array_to_string(task.comm) + fields = ( netns_id, task_comm,