Skip to content

sentinel-stack/sentinel-vmi/src/task_walker.c

sentinel-stack/sentinel-vmi/src/task_walker.c

Section titled “sentinel-stack/sentinel-vmi/src/task_walker.c”
Name
structprivilege_baseline_entry
Name
intstring_in_list(const char * value, const char *const * list)
intparse_btf_member_line(const char * line, char * member, size_t member_sz, uint64_t * byte_offset)
inttry_load_offsets_from_btf(struct task_offsets * out)
const struct task_offsets *select_offsets_profile(const char * kernel_version)
inttask_walker_set_offsets_profile(const char * kernel_version)
const char *task_walker_get_offsets_profile(void )
voidensure_offsets_profile_selected(void )
intread_task_field(struct vmi_session * s, uint64_t task_gva, uint64_t offset, void * buf, size_t size)
intread_tasks_next(struct vmi_session * s, uint64_t task_gva, uint64_t * next_task_gva)
intsnapshot_processes(struct vmi_session * s, struct vmi_process * out, int max_tasks)
intpid_exists(const struct vmi_process * procs, int nr, uint32_t pid)
struct vmi_process *find_process_by_pid(struct vmi_process * procs, int nr, uint32_t pid)
struct privilege_baseline_entry *find_baseline(uint32_t pid)
struct privilege_baseline_entry *alloc_baseline(uint32_t pid)
intis_legitimate_priv_transition(const struct vmi_process * proc)
inttask_walker_read_process(struct vmi_session * s, uint64_t task_gva, struct vmi_process * out)
voidtask_walker_dump(struct vmi_session * s)
inttask_walker_find_pid(struct vmi_session * s, uint32_t pid, uint64_t * task_addr)
inttask_walker_detect_privilege_escalation(struct vmi_session * s)
inttask_walker_detect_orphans(struct vmi_session * s)
inttask_walker_detect_fork_bomb(struct vmi_session * s, uint32_t threshold)
inttask_walker_detect_suspicious_ancestry(struct vmi_session * s)
Name
const struct task_offsets *active_offsets
intoffsets_initialized
struct task_offsetsbtf_offsets
intbtf_offsets_valid
struct privilege_baseline_entry[8192]privilege_baseline
unsigned intprivilege_generation
const char *const[]legitimate_transition_names
const char *const[]web_tier_names
const char *const[]shell_names
Name
MAX_TASK_SNAPSHOT
MAX_PRIV_BASELINE
DEFAULT_FORK_BOMB_THRESHOLD
static int string_in_list(
const char * value,
const char *const * list
)
static int parse_btf_member_line(
const char * line,
char * member,
size_t member_sz,
uint64_t * byte_offset
)
static int try_load_offsets_from_btf(
struct task_offsets * out
)
static const struct task_offsets * select_offsets_profile(
const char * kernel_version
)
int task_walker_set_offsets_profile(
const char * kernel_version
)
const char * task_walker_get_offsets_profile(
void
)
static void ensure_offsets_profile_selected(
void
)
static int read_task_field(
struct vmi_session * s,
uint64_t task_gva,
uint64_t offset,
void * buf,
size_t size
)
static int read_tasks_next(
struct vmi_session * s,
uint64_t task_gva,
uint64_t * next_task_gva
)
static int snapshot_processes(
struct vmi_session * s,
struct vmi_process * out,
int max_tasks
)
static int pid_exists(
const struct vmi_process * procs,
int nr,
uint32_t pid
)
static struct vmi_process * find_process_by_pid(
struct vmi_process * procs,
int nr,
uint32_t pid
)
static struct privilege_baseline_entry * find_baseline(
uint32_t pid
)
static struct privilege_baseline_entry * alloc_baseline(
uint32_t pid
)
static int is_legitimate_priv_transition(
const struct vmi_process * proc
)
int task_walker_read_process(
struct vmi_session * s,
uint64_t task_gva,
struct vmi_process * out
)
void task_walker_dump(
struct vmi_session * s
)
int task_walker_find_pid(
struct vmi_session * s,
uint32_t pid,
uint64_t * task_addr
)

function task_walker_detect_privilege_escalation

Section titled “function task_walker_detect_privilege_escalation”
int task_walker_detect_privilege_escalation(
struct vmi_session * s
)
int task_walker_detect_orphans(
struct vmi_session * s
)
int task_walker_detect_fork_bomb(
struct vmi_session * s,
uint32_t threshold
)

function task_walker_detect_suspicious_ancestry

Section titled “function task_walker_detect_suspicious_ancestry”
int task_walker_detect_suspicious_ancestry(
struct vmi_session * s
)
const struct task_offsets * active_offsets = &OFFSETS_6_6;
static int offsets_initialized = 0;
static struct task_offsets btf_offsets;
static int btf_offsets_valid = 0;
static struct privilege_baseline_entry[8192] privilege_baseline;
static unsigned int privilege_generation = 0;
static const char *const[] legitimate_transition_names = {
"sudo",
"su",
"sshd",
"login",
"systemd",
NULL,
};
static const char *const[] web_tier_names = {
"nginx",
"apache2",
"httpd",
"php-fpm",
NULL,
};
static const char *const[] shell_names = {
"sh",
"bash",
"dash",
"zsh",
NULL,
};
#define MAX_TASK_SNAPSHOT 4096
#define MAX_PRIV_BASELINE 8192
#define DEFAULT_FORK_BOMB_THRESHOLD 256

Updated on 2026-05-26 at 13:25:29 +0000