Skip to content

Commit

Permalink
osi_linux: get flags from vm_area_struct
Browse files Browse the repository at this point in the history
  • Loading branch information
zestrada authored and AndrewFasano committed Aug 28, 2023
1 parent 39d8974 commit 661883f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions panda/plugins/osi/osi_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ typedef struct osi_module_struct {
char *file;
char *name;
target_ulong offset; // XXX only set by osi_linux for now
target_ulong flags; // XXX only set by osi_linux for now
} OsiModule;

/**
Expand Down
1 change: 1 addition & 0 deletions panda/plugins/osi_linux/osi_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ static bool fill_osimodule(CPUState *env, OsiModule *m, target_ptr_t vma_addr,
m->modd = vma_addr;
m->base = vma_start;
m->size = vma_end - vma_start;
m->flags = get_vma_flags(env, vma_addr);
}

return populated;
Expand Down
3 changes: 2 additions & 1 deletion panda/plugins/osi_linux/osi_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ IMPLEMENT_OFFSET_GET(get_vma_start, vma_struct, target_ulong, ki.vma.vm_start_of
IMPLEMENT_OFFSET_GET(get_vma_end, vma_struct, target_ulong, ki.vma.vm_end_offset, 0)

/**
* @todo Retrieves the address of the following vm_area_struct.
* @brief Retrieves the flags of the following vm_area_struct.
* https://elixir.bootlin.com/linux/v6.5/source/include/linux/mm.h#L260
*/
IMPLEMENT_OFFSET_GET(get_vma_flags, vma_struct, target_ulong, ki.vma.vm_flags_offset, 0)

Expand Down

0 comments on commit 661883f

Please sign in to comment.