mollismerx / elfspy

C++ Testing using spies and fakes for isolation and simulation
GNU General Public License v2.0
59 stars 10 forks source link

mprotect with PROT_EXEC will failed with errno=1(Operation not permitted) in some arm64 kernel #5

Open LarryHuaLong opened 11 months ago

LarryHuaLong commented 11 months ago

https://github.com/mollismerx/elfspy/blob/61629ee4ff9b37c04f2eb475366d6cc0173d9811/ELFInfo.cpp#L207C61-L207C61

When I test elfspy on arm64 kernel, I got a failure on mprotect. Then I found out that PROT_EXEC is no needed here, so I tried to remove it, and it works well.

Hope this is useful for guys have the same problem!