Thread: Problem: Cannot access some valid ranges in /proc/<pid>/mem
hey everyone,
having problem accessing /proc/<pid>/mem ranges after mprotect has made them readable.
- process ptrace attachs process b
- process cannot access of given range in process bs /proc/<pid>/mem due associated mapping (as visible in /proc/<pid>/maps) being non-readable
- process requests process b use mprotect mark given mapping readable (mprotect returns success)
- process should able read range (as visible in /proc/<pid>/mem) can read part of range...
example:
problem: std::ifstream can read first part of range /proc/<pid>/mem, cannot read remaining range data. (by cannot read mean !fin.good , errno = 5)code:mapping before request (step 3): 7f63671af000-7f63673ae000 ---p 0000c000 08:01 269062 /lib/x86_64-linux-gnu/libnss_files-2.13.so mapping after request (step 3): 7f63671af000-7f63673ae000 r--p 0000c000 08:01 269062 /lib/x86_64-linux-gnu/libnss_files-2.13.so
i not believe error related procfs because if rather reading /proc/<pid>/mem, attempt access data word word using ptrace_peektext, result still failure on same boundaries.code:mapping range: 7f63671af000-7f63673ae000 (2044 kbytes) read range: 7f63671af000-7f63671affff (4095 bytes, ~one page) unsuccessfully read range: 7f63671b0000-7f63673ae000 (2040 kbytes)
have tried calling mprotect again on trouble region no change.
ideas or hints on might doing wrong great! or- possibly bug? let me know if there further information can provide.
bump?![]()
Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk Problem: Cannot access some valid ranges in /proc/<pid>/mem
Ubuntu
Comments
Post a Comment