Skip to content

Commit aecd31f

Browse files
committed
Add missing pointer verification
1 parent 867c8e3 commit aecd31f

File tree

1 file changed

+3
-3
lines changed
  • volatility3/framework/symbols/linux/extensions

1 file changed

+3
-3
lines changed

volatility3/framework/symbols/linux/extensions/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ def get_inode(self) -> interfaces.objects.ObjectInterface:
847847
"""Returns the inode associated with this dentry"""
848848

849849
inode_ptr = self.d_inode
850-
if not (inode_ptr and inode_ptr.is_valid()):
850+
if not (inode_ptr and inode_ptr.is_readable() and inode_ptr.is_valid()):
851851
return None
852852

853853
return inode_ptr.dereference()
@@ -880,14 +880,14 @@ def get_inode(self) -> interfaces.objects.ObjectInterface:
880880
# Try first the cached value, kernels +3.9
881881
inode_ptr = self.f_inode
882882

883-
if not (inode_ptr and inode_ptr.is_valid()):
883+
if not (inode_ptr and inode_ptr.is_readable() and inode_ptr.is_valid()):
884884
dentry_ptr = self.get_dentry()
885885
if not (dentry_ptr and dentry_ptr.is_readable()):
886886
return None
887887

888888
inode_ptr = dentry_ptr.d_inode
889889

890-
if not (inode_ptr and inode_ptr.is_valid()):
890+
if not (inode_ptr and inode_ptr.is_readable() and inode_ptr.is_valid()):
891891
return None
892892

893893
return inode_ptr.dereference()

0 commit comments

Comments
 (0)