Skip to content

Make process name parsing more robust in linux_mode#241

Merged
0vercl0k merged 4 commits into0vercl0k:mainfrom
shadowpagetable:main
Oct 23, 2025
Merged

Make process name parsing more robust in linux_mode#241
0vercl0k merged 4 commits into0vercl0k:mainfrom
shadowpagetable:main

Conversation

@shadowpagetable
Copy link
Copy Markdown
Contributor

Process identification fails with newer versions of the Debian kernel. This causes is_program to return false and the snapshot is not taken. This patch fixes the process name parsing by just taking the comm member of the tasks struct instead of looking up the address and casting it and dereferencing it. Hopefully this way is more stable for future versions since it doesn't rely on casting a pointer.

@0vercl0k
Copy link
Copy Markdown
Owner

0vercl0k commented Oct 12, 2025 via email

@shadowpagetable
Copy link
Copy Markdown
Contributor Author

enjoy vacation, cheers

@0vercl0k
Copy link
Copy Markdown
Owner

Thank you! I am back now so will take a look at this this week :)

Cheers

@0vercl0k 0vercl0k changed the title Fixed Process name parsing in linux_mode Make process name parsing more robust in linux_mode Oct 23, 2025
@0vercl0k 0vercl0k merged commit d2cad9d into 0vercl0k:main Oct 23, 2025
4 checks passed
@0vercl0k
Copy link
Copy Markdown
Owner

Oh crap, I wanted to ask what was the [1:] about before merging 😅?

Cheers

@shadowpagetable
Copy link
Copy Markdown
Contributor Author

It's to remove a starting double quote but let me double check if it's actually needed.

@0vercl0k
Copy link
Copy Markdown
Owner

Thank you!

@shadowpagetable
Copy link
Copy Markdown
Contributor Author

shadowpagetable commented Oct 23, 2025

Yeah so you don't actually need to remove the leading " since in line 386 of gdb_fuzzbkpt.py. It just checks if curr_program_name is in self.program_name. Which also means you don't need to strip it on the 252. Up to you what you want to do. You could make it a strict comparison or just leave as is.

@shadowpagetable
Copy link
Copy Markdown
Contributor Author

In practice I haven't seen another process identified besides the target one

@shadowpagetable
Copy link
Copy Markdown
Contributor Author

shadowpagetable commented Oct 23, 2025

could be shortened to

return  str(kernel.parse_and_eval("$lx_current().comm"))

if you want to keep the fuzzy check

@0vercl0k
Copy link
Copy Markdown
Owner

Thanks for taking another look at this @shadowpagetable and letting me know :) I think it's fine for now, I might try to clean this whenever I get to #244.

Cheers

@shadowpagetable
Copy link
Copy Markdown
Contributor Author

Gotcha, Yeah I work with k0ss and Jason so happy to look into #244

@0vercl0k
Copy link
Copy Markdown
Owner

Oh awesome! I actually ran into those issues while trying to test this PR 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants