Skip to main content

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.

  1. process ptrace attachs process b
  2. process cannot access of given range in process bs /proc/<pid>/mem due associated mapping (as visible in /proc/<pid>/maps) being non-readable
  3. process requests process b use mprotect mark given mapping readable (mprotect returns success)
  4. process should able read range (as visible in /proc/<pid>/mem) can read part of range...


example:

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
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 range:             7f63671af000-7f63673ae000 (2044 kbytes)  read range:   7f63671af000-7f63671affff (4095 bytes, ~one page)  unsuccessfully read range: 7f63671b0000-7f63673ae000 (2040 kbytes)
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.

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

Popular posts from this blog

502 Bad Gateway nginx/1.10.0 (Ubuntu) - Joomla! Forum - community, help and support

Fatal error during instalation - Joomla! Forum - community, help and support

Joomla update reporting error - Joomla! Forum - community, help and support