From 2c181fb9befd81079e575a554b3d4a625378a876 Mon Sep 17 00:00:00 2001 From: Gustavo Moreira Date: Mon, 9 May 2022 19:38:25 +1000 Subject: [PATCH] Move path_root check up so path() and get_mnt_sb() can be avoided in the cases _do_get_path() fails. --- volatility3/framework/plugins/linux/mountinfo.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/volatility3/framework/plugins/linux/mountinfo.py b/volatility3/framework/plugins/linux/mountinfo.py index 6c0f8bcc3..3179eadd8 100644 --- a/volatility3/framework/plugins/linux/mountinfo.py +++ b/volatility3/framework/plugins/linux/mountinfo.py @@ -89,6 +89,10 @@ class MountInfo(plugins.PluginInterface): if not mnt_root: return None + path_root = cls._do_get_path(mnt, task.fs.root) + if path_root is None: + return None + mnt_root_path = mnt_root.path() superblock = mnt.get_mnt_sb() @@ -97,10 +101,6 @@ class MountInfo(plugins.PluginInterface): st_dev = f"{superblock.major}:{superblock.minor}" - path_root = cls._do_get_path(mnt, task.fs.root) - if path_root is None: - return None - mnt_opts: List[str] = [] mnt_opts.append(mnt.get_flags_access()) mnt_opts.extend(mnt.get_flags_opts())