Skip to content

Commit

Permalink
Add proper exception handling in file descriptor enumeration
Browse files Browse the repository at this point in the history
  • Loading branch information
atcuno committed Jan 31, 2025
1 parent b51acfd commit e6f9ddb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions volatility3/framework/symbols/linux/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,23 @@ def files_descriptors_for_process(
symbol_table: str,
task: interfaces.objects.ObjectInterface,
):
# task.files can be null
if not (task.files and task.files.is_readable()):
try:
files = task.files
except exceptions.InvalidAddressException:
return None

if not files.is_readable():
return None

try:
fd_table = files.get_fds()
except exceptions.InvalidAddressException:
return None

fd_table = task.files.get_fds()
if fd_table == 0:
return None

max_fds = task.files.get_max_fds()
max_fds = files.get_max_fds()

# corruption check
if max_fds > 500000:
Expand Down

0 comments on commit e6f9ddb

Please sign in to comment.