Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osi_linux: get flags from vm_area_struct #1343

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading