I wanted to know whether an instruction is from the application itself or from the library code.
I observed some application code/data are located at about 0x000055xxxx
while libraries and mmap
ed regions are by default located at 0x00007fcxxxx
. Can I use for example, 0x00007f00...00
as a boundary to tell instruction is from the application itself or from the library?
How can I configure this boundary in Linux kernel?
Updated.
Can I prevent (or detect) a syscall
instruction being issued from application code (only allow it to go through libc
). Maybe we can do a binary scan, but due to the variable length of instruction, it's hard to prevent unintended syscall
instruction.