Stackdb
Stackdb is a stackable, multi-target and -level source debugger and memory forensics library.
|
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <glib.h>
#include "common.h"
#include "glib_wrapper.h"
#include "arch.h"
#include "arch_x86.h"
#include "arch_x86_64.h"
#include "binfile.h"
#include "target.h"
#include "target_event.h"
#include "target_os.h"
#include "target_os_linux_generic.h"
Go to the source code of this file.
Data Structures | |
struct | os_linux_signame |
struct | old_linux_syscall_probe_state |
struct | match_pid_data |
struct | __update_module_data |
Macros | |
#define | LOCAL_TIF_SIGPENDING (1UL << 2) |
#define | SYSCALL_GLOBAL_ENTRY_PROBE "os_linux_syscall_entry_probe" |
#define | SYSCALL_GLOBAL_RET_PROBE "os_linux_syscall_ret_probe" |
#define | DCACHE_AUTOFS_PENDING 0x0001 |
#define | DCACHE_NFSFS_RENAMED 0x0002 |
#define | DCACHE_DISCONNECTED 0x0004 |
#define | DCACHE_REFERENCED 0x0008 |
#define | DCACHE_UNHASHED 0x0010 |
#define | DCACHE_INOTIFY_PARENT_WATCHED 0x0020 |
#define | _LINUX_MAX_ERRNO 4095 |
#define | _LINUX_IS_ERR(x) unlikely((x) >= (REGVAL)-_LINUX_MAX_ERRNO) |
Variables | |
struct probe_ops | os_linux_syscall_ret_probe_ops |
struct probe_ops | os_linux_global_syscall_ret_probe_ops |
struct target_personality_ops | os_linux_generic_personality_ops |
struct target_os_ops | os_linux_generic_os_ops |
#define _LINUX_IS_ERR | ( | x | ) | unlikely((x) >= (REGVAL)-_LINUX_MAX_ERRNO) |
Definition at line 7901 of file target_os_linux_generic.c.
#define _LINUX_MAX_ERRNO 4095 |
Definition at line 7900 of file target_os_linux_generic.c.
#define DCACHE_AUTOFS_PENDING 0x0001 |
Definition at line 3385 of file target_os_linux_generic.c.
#define DCACHE_DISCONNECTED 0x0004 |
Definition at line 3387 of file target_os_linux_generic.c.
#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 |
Definition at line 3390 of file target_os_linux_generic.c.
#define DCACHE_NFSFS_RENAMED 0x0002 |
Definition at line 3386 of file target_os_linux_generic.c.
#define DCACHE_REFERENCED 0x0008 |
Definition at line 3388 of file target_os_linux_generic.c.
#define DCACHE_UNHASHED 0x0010 |
Definition at line 3389 of file target_os_linux_generic.c.
#define LOCAL_TIF_SIGPENDING (1UL << 2) |
#define SYSCALL_GLOBAL_ENTRY_PROBE "os_linux_syscall_entry_probe" |
Definition at line 2544 of file target_os_linux_generic.c.
#define SYSCALL_GLOBAL_RET_PROBE "os_linux_syscall_ret_probe" |
Definition at line 2545 of file target_os_linux_generic.c.
result_t os_linux_active_memory_handler | ( | struct probe * | probe, |
tid_t | tid, | ||
void * | handler_data, | ||
struct probe * | trigger, | ||
struct probe * | base | ||
) |
Definition at line 7659 of file target_os_linux_generic.c.
result_t os_linux_active_thread_entry_handler | ( | struct probe * | probe, |
tid_t | tid, | ||
void * | handler_data, | ||
struct probe * | trigger, | ||
struct probe * | base | ||
) |
Definition at line 7903 of file target_os_linux_generic.c.
result_t os_linux_active_thread_exit_handler | ( | struct probe * | probe, |
tid_t | tid, | ||
void * | handler_data, | ||
struct probe * | trigger, | ||
struct probe * | base | ||
) |
Definition at line 8013 of file target_os_linux_generic.c.
int os_linux_attach | ( | struct target * | target | ) |
Definition at line 58 of file target_os_linux_generic.c.
Definition at line 3129 of file target_os_linux_generic.c.
char* os_linux_d_path | ( | struct target * | target, |
struct value * | dentry, | ||
struct value * | vfsmnt, | ||
struct value * | root_dentry, | ||
struct value * | root_vfsmnt, | ||
char * | buf, | ||
int | buflen | ||
) |
Definition at line 3396 of file target_os_linux_generic.c.
result_t os_linux_debug_handler | ( | struct probe * | probe, |
tid_t | tid, | ||
void * | handler_data, | ||
struct probe * | trigger, | ||
struct probe * | base | ||
) |
Definition at line 1576 of file target_os_linux_generic.c.
char* os_linux_file_get_path | ( | struct target * | target, |
struct value * | task, | ||
struct value * | file, | ||
char * | ibuf, | ||
int | buflen | ||
) |
Definition at line 3612 of file target_os_linux_generic.c.
int os_linux_fini | ( | struct target * | target | ) |
Definition at line 412 of file target_os_linux_generic.c.
int os_linux_flush_current_thread | ( | struct target * | target | ) |
WARNING: esp and ss may not be valid if the sleeping thread was interrupted while it was in the kernel, because the interrupt gate does not push ss and esp; see include/asm-i386/processor.h .
Definition at line 6149 of file target_os_linux_generic.c.
WARNING: esp and ss may not be valid if the sleeping thread was interrupted while it was in the kernel, because the interrupt gate does not push ss and esp; see include/asm-i386/processor.h .
XXX: what the heck?? memset(<state->context,0,sizeof(vcpu_guest_context_t)); ltstate->context.user_regs.eip = ltstate->eip; ltstate->context.user_regs.esp = ltstate->esp; ltstate->context.user_regs.fs = ltstate->fs; ltstate->context.user_regs.gs = ltstate->gs;
Definition at line 6422 of file target_os_linux_generic.c.
void os_linux_free_thread_state | ( | struct target * | target, |
void * | state | ||
) |
Definition at line 5061 of file target_os_linux_generic.c.
void os_linux_generic_register | ( | void | ) |
Globals.
Definition at line 9358 of file target_os_linux_generic.c.
Definition at line 3026 of file target_os_linux_generic.c.
Definition at line 3363 of file target_os_linux_generic.c.
Definition at line 3315 of file target_os_linux_generic.c.
Definition at line 3210 of file target_os_linux_generic.c.
Definition at line 3224 of file target_os_linux_generic.c.
int os_linux_handle_exception | ( | struct target * | target | ) |
Definition at line 1697 of file target_os_linux_generic.c.
result_t os_linux_int3_handler | ( | struct probe * | probe, |
tid_t | tid, | ||
void * | handler_data, | ||
struct probe * | trigger, | ||
struct probe * | base | ||
) |
Definition at line 1437 of file target_os_linux_generic.c.
int os_linux_invalidate_thread | ( | struct target * | target, |
struct target_thread * | tthread | ||
) |
Definition at line 6999 of file target_os_linux_generic.c.
struct array_list* os_linux_list_available_tids | ( | struct target * | target | ) |
Definition at line 3913 of file target_os_linux_generic.c.
int os_linux_list_for_each_entry | ( | struct target * | t, |
struct bsymbol * | btype, | ||
struct bsymbol * | list_head, | ||
char * | list_head_member_name, | ||
int | nofree, | ||
os_linux_list_iterator_t | iterator, | ||
void * | data | ||
) |
Definition at line 3802 of file target_os_linux_generic.c.
int os_linux_list_for_each_struct | ( | struct target * | t, |
struct bsymbol * | bsymbol, | ||
char * | list_head_member_name, | ||
int | nofree, | ||
os_linux_list_iterator_t | iterator, | ||
void * | data | ||
) |
Definition at line 3695 of file target_os_linux_generic.c.
int os_linux_load_available_threads | ( | struct target * | target, |
int | force | ||
) |
Definition at line 3975 of file target_os_linux_generic.c.
struct target_thread * os_linux_load_current_thread | ( | struct target * | target, |
int | force | ||
) |
WARNING: esp and ss may not be valid if the sleeping thread was interrupted while it was in the kernel, because the interrupt gate does not push ss and esp; see include/asm-i386/processor.h .
(SOFTIRQ_COUNT(preempt_count) || HARDIRQ_COUNT(preempt_count))) {
Definition at line 4216 of file target_os_linux_generic.c.
struct value* os_linux_load_current_thread_as_type | ( | struct target * | target, |
struct symbol * | datatype, | ||
REGVAL | kernel_esp | ||
) |
Definition at line 3297 of file target_os_linux_generic.c.
struct target_thread* os_linux_load_thread | ( | struct target * | target, |
tid_t | tid, | ||
int | force | ||
) |
Definition at line 4024 of file target_os_linux_generic.c.
struct target_thread * os_linux_load_thread_from_value | ( | struct target * | target, |
struct value * | taskv | ||
) |
Prototypes.
WARNING: esp and ss may not be valid if the sleeping thread was interrupted while it was in the kernel, because the interrupt gate does not push ss and esp; see include/asm-i386/processor.h .
Definition at line 5091 of file target_os_linux_generic.c.
int os_linux_postloadinit | ( | struct target * | target | ) |
Definition at line 481 of file target_os_linux_generic.c.
int os_linux_postopened | ( | struct target * | target | ) |
Definition at line 1154 of file target_os_linux_generic.c.
struct target_process* os_linux_process_load | ( | struct target * | target, |
struct target_thread * | tthread | ||
) |
Definition at line 8721 of file target_os_linux_generic.c.
GHashTable* os_linux_processes_load | ( | struct target * | target | ) |
Definition at line 8717 of file target_os_linux_generic.c.
int os_linux_set_active_probing | ( | struct target * | target, |
active_probe_flags_t | flags | ||
) |
Definition at line 8860 of file target_os_linux_generic.c.
int os_linux_signal_enqueue | ( | struct target * | target, |
struct target_thread * | tthread, | ||
int | signo, | ||
void * | data | ||
) |
Definition at line 1980 of file target_os_linux_generic.c.
int os_linux_signal_from_name | ( | struct target * | target, |
const char * | name | ||
) |
Definition at line 2146 of file target_os_linux_generic.c.
const char* os_linux_signal_to_name | ( | struct target * | target, |
int | signo | ||
) |
Definition at line 2134 of file target_os_linux_generic.c.
struct target_os_syscall* os_linux_syscall_lookup_addr | ( | struct target * | target, |
ADDR | addr | ||
) |
Definition at line 2404 of file target_os_linux_generic.c.
struct target_os_syscall* os_linux_syscall_lookup_name | ( | struct target * | target, |
char * | name | ||
) |
Definition at line 2371 of file target_os_linux_generic.c.
struct target_os_syscall* os_linux_syscall_lookup_num | ( | struct target * | target, |
int | num | ||
) |
Definition at line 2387 of file target_os_linux_generic.c.
struct probe* os_linux_syscall_probe | ( | struct target * | target, |
tid_t | tid, | ||
struct target_os_syscall * | syscall, | ||
probe_handler_t | pre_handler, | ||
probe_handler_t | post_handler, | ||
void * | handler_data | ||
) |
Definition at line 2952 of file target_os_linux_generic.c.
struct probe* os_linux_syscall_probe_all | ( | struct target * | target, |
tid_t | tid, | ||
probe_handler_t | pre_handler, | ||
probe_handler_t | post_handler, | ||
void * | handler_data | ||
) |
Definition at line 2998 of file target_os_linux_generic.c.
GHashTable* os_linux_syscall_table_get | ( | struct target * | target | ) |
Definition at line 2367 of file target_os_linux_generic.c.
int os_linux_syscall_table_load | ( | struct target * | target | ) |
Definition at line 2222 of file target_os_linux_generic.c.
int os_linux_syscall_table_unload | ( | struct target * | target | ) |
Definition at line 2325 of file target_os_linux_generic.c.
struct target_thread* os_linux_thread_get_leader | ( | struct target * | target, |
struct target_thread * | tthread | ||
) |
Definition at line 1914 of file target_os_linux_generic.c.
int os_linux_thread_get_pgd_phys | ( | struct target * | target, |
struct target_thread * | tthread, | ||
ADDR * | pgdp | ||
) |
Definition at line 1895 of file target_os_linux_generic.c.
int os_linux_thread_is_user | ( | struct target * | target, |
struct target_thread * | tthread | ||
) |
Definition at line 1903 of file target_os_linux_generic.c.
int os_linux_thread_singlestep | ( | struct target * | target, |
tid_t | tid, | ||
int | isbp, | ||
struct target * | overlay, | ||
int | force_emulate | ||
) |
Definition at line 9221 of file target_os_linux_generic.c.
int os_linux_thread_singlestep_end | ( | struct target * | target, |
tid_t | tid, | ||
struct target * | overlay, | ||
int | force_emulate | ||
) |
Definition at line 9259 of file target_os_linux_generic.c.
int os_linux_thread_snprintf | ( | struct target * | target, |
struct target_thread * | tthread, | ||
char * | buf, | ||
int | bufsiz, | ||
int | detail, | ||
char * | sep, | ||
char * | kvsep | ||
) |
Definition at line 7027 of file target_os_linux_generic.c.
target_os_type_t os_linux_type | ( | struct target * | target | ) |
Definition at line 1773 of file target_os_linux_generic.c.
uint64_t os_linux_version | ( | struct target * | target | ) |
Definition at line 1784 of file target_os_linux_generic.c.
int os_linux_version_cmp | ( | struct target * | target, |
uint64_t | vers | ||
) |
Definition at line 1877 of file target_os_linux_generic.c.
char* os_linux_version_string | ( | struct target * | target | ) |
Definition at line 1890 of file target_os_linux_generic.c.
struct target_os_ops os_linux_generic_os_ops |
Definition at line 9324 of file target_os_linux_generic.c.
struct target_personality_ops os_linux_generic_personality_ops |
Definition at line 9296 of file target_os_linux_generic.c.
struct probe_ops os_linux_global_syscall_ret_probe_ops |
Definition at line 2991 of file target_os_linux_generic.c.
struct probe_ops os_linux_syscall_ret_probe_ops |
Definition at line 2934 of file target_os_linux_generic.c.