Merge pull request #962 from gcmoreira/fix_dentry_mem_smear_issue_961

Fix issue #961: Prevent potential dentry pointer memory smear
This commit is contained in:
ikelos
2023-05-30 17:51:05 +01:00
committed by GitHub
@@ -200,8 +200,11 @@ class LinuxUtilities(interfaces.configuration.VersionableInterface):
Returns:
str: A file (or sock pipe) pathname relative to the task's root directory.
"""
# Memory smear protection: Check that both the file and dentry pointers are valid.
try:
dentry = filp.get_dentry()
dentry.is_root()
except exceptions.InvalidAddressException:
return ""