Implement range of memory access validation instead of pointer and use

it. Export new validator to users.
Various small fixes
This commit is contained in:
2020-05-06 11:49:22 +04:00
parent f483155e07
commit 657ddf182b
8 changed files with 27 additions and 18 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ typedef struct {
unw_word_t lowpc; ///< offset to start of the function against base address
unw_word_t highpc; ///< offset to the next address after the end of the function against base address
unw_word_t sp; ///< SP register in function's frame
unw_word_t cfa; ///< CFA (Canonical Frame Address) of the function. !!! Don't use CFA provided by libunwind, it's not valid !!!
unw_word_t cfa; ///< CFA (Canonical Frame Address) of the function
pst_fun_flags flags; ///< flags of various function options
} pst_function_info;
+9 -2
View File
@@ -27,8 +27,8 @@ typedef struct pst_parameter pst_parameter;
/**
* @brief allocate libpst handler and initialize the library
* @param context context of process given to signal handler of a program. If NULL, then we are not in signal handler
* @param buff pointer to buffer by libpst custom allocator(i.e. no malloc() will beused). if NULL, then standard allocator will be used
* @param size of 'buff'
* @param buff pointer to buffer for libpst custom allocator(i.e. no malloc()/free() will be used). if NULL, then standard allocator will be used
* @param size of 'buff'. recommended size is not less than 4Kb
*
* @return pointer to handler to be used for all other operations. NULL in case of error
*/
@@ -83,6 +83,13 @@ const pst_function_info* pst_get_function_info(pst_function* function);
*/
int pst_get_register(pst_function* function, int regno, unw_word_t* val);
/**
* @brief Check memory range of process to validity (i.e. that process has access to this range)
* @param p pointer to start of range
* @param size size of range to check
*/
int pst_pointer_valid(void *p, uint32_t size);
/**
* @brief Get next parameter's handle in function
* @param function Function's handler obtained by pst_get_next_function()