/proc/kcore reads 0's for vmap_block

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

The /proc/kcore interface uses vread() to read memory addresses which
are in the vmalloc region, and it seems that vread() doesn't support
vmap_areas which are associated with a vmap_block. As far as I can tell,
those have vmap_area.vm == NULL, and get skipped during vread()'s
iteration. So the end result is that the read simply returns 0's.

This impacts live debuggers like gdb and drgn, which is how I stumbled
upon it[1]. It looks like crash avoids the issue by doing a page table
walk and reading the physical address.

I'm wondering if there's any rationale for this omission from vread():
is it a simple oversight, or was it omitted due to the difficulty? Is
it possible for /proc/kcore to simply take the page faults when it reads
unmapped memory and handle them? (I'm sure that's already discussed or
is obviously infeasible for some reason beyond me.)

Ideally, I'm just looking for a way forward that allows the debugger to
*work* as expected, meaning either that /proc/kcore always reads the
correct data, or that the debugger can know ahead of time that it will
need to do some processing (like a page table walk) first. 

Thanks,
Stephen

[1]: https://github.com/osandov/drgn/issues/217




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux