linux kernel - vm_area_struct - find MAP_ANONYMOUS mapping -
how can detect area represented vm_are_struct
mapped anonymous? assume vm_flags
field contains vm_xxx
flags doesn't contain map_xx
flags. besides vm_page_prot
field contains unexpected.
by checking anon_vma
pointer (which should set non-null) , vm_file
(which should null, if mapping related file):
if(vma->anon_vma != null && vma->vm_file == null) { // map_anon }
but anon_vma
seem lazily allocated (not initialized after mmap()
called).
Comments
Post a Comment