mirror of
https://github.com/frida/frida-core.git
synced 2026-11-08 08:05:58 -10:00
linux: Avoid risky code swaps with memfd regions
As they may not be writable, and unlike regular regions, ptrace() won't help us in case of a missing writable bit.
This commit is contained in:
1 parent
b6577afe81
commit
72a96226ce
1 file changed
+3
@@ -2290,6 +2290,9 @@ namespace Frida {
|
||||
this.session = session;
|
||||
|
||||
Gum.Linux.enumerate_ranges ((Posix.pid_t) session.pid, READ | EXECUTE, d => {
|
||||
unowned Gum.FileMapping? file = d.file;
|
||||
if (file != null && file.path.has_prefix ("memfd:"))
|
||||
return true;
|
||||
if (d.range.size >= code.length) {
|
||||
code_start = d.range.base_address + d.range.size - round_size_to_page_size (code.length);
|
||||
code_end = code_start + code.length;
|
||||
|
||||
Reference in new issue
Block a user