#include <us_manager/probes/register_probes.h>
#include <uprobe/swap_uprobes.h>
-#include <us_manager/sspt/ip.h>
+#include <us_manager/sspt/sspt_ip.h>
#include <kprobe/swap_kprobes_deps.h>
#include <linux/module.h>
}
static int fbi_probe_get_data_from_direct_addr(const struct fbi_var_data *fbi_i,
- struct us_ip *ip,
+ struct sspt_ip *ip,
struct pt_regs *regs)
{
struct vm_area_struct *vma;
static int fbi_probe_handler(struct uprobe *p, struct pt_regs *regs)
{
- struct us_ip *ip = container_of(p, struct us_ip, uprobe);
+ struct sspt_ip *ip = container_of(p, struct sspt_ip, uprobe);
struct fbi_info *fbi_i = &ip->desc->info.fbi_i;
struct fbi_var_data *fbi_d = NULL;
uint8_t i;
fbi_i->vars = NULL;
}
-void fbi_probe_init(struct us_ip *ip)
+void fbi_probe_init(struct sspt_ip *ip)
{
ip->uprobe.pre_handler = (uprobe_pre_handler_t)fbi_probe_handler;
}
-void fbi_probe_uninit(struct us_ip *ip)
+void fbi_probe_uninit(struct sspt_ip *ip)
{
if (ip != NULL)
fbi_probe_cleanup(&ip->desc->info);
}
-static int fbi_probe_register_probe(struct us_ip *ip)
+static int fbi_probe_register_probe(struct sspt_ip *ip)
{
return swap_register_uprobe(&ip->uprobe);
}
-static void fbi_probe_unregister_probe(struct us_ip *ip, int disarm)
+static void fbi_probe_unregister_probe(struct sspt_ip *ip, int disarm)
{
__swap_unregister_uprobe(&ip->uprobe, disarm);
}
-static struct uprobe *fbi_probe_get_uprobe(struct us_ip *ip)
+static struct uprobe *fbi_probe_get_uprobe(struct sspt_ip *ip)
{
return &ip->uprobe;
}
main_h(&rp->up, regs);
if (get_quiet() == QT_OFF) {
- struct us_ip *ip;
+ struct sspt_ip *ip;
unsigned long func_addr;
- ip = container_of(rp, struct us_ip, retprobe);
+ ip = container_of(rp, struct sspt_ip, retprobe);
func_addr = (unsigned long)ip->orig_addr;
rp_msg_entry(regs, func_addr, "p");
}
struct uretprobe *rp = ri->rp;
if (rp && get_quiet() == QT_OFF) {
- struct us_ip *ip;
+ struct sspt_ip *ip;
unsigned long func_addr;
unsigned long ret_addr;
- ip = container_of(rp, struct us_ip, retprobe);
+ ip = container_of(rp, struct sspt_ip, retprobe);
func_addr = (unsigned long)ip->orig_addr;
ret_addr = (unsigned long)ri->ret_addr;
rp_msg_exit(regs, func_addr, 'n', ret_addr);
#include <linux/limits.h>
#include <linux/list.h>
-#include <us_manager/sspt/ip.h>
+#include <us_manager/sspt/sspt_ip.h>
#include "preload.h"
#include "preload_control.h"
}
-enum preload_call_type preload_control_call_type(struct us_ip *ip, void *caller)
+enum preload_call_type preload_control_call_type(struct sspt_ip *ip, void *caller)
{
if (__is_instrumented(caller))
return INTERNAL_CALL;
#ifndef __PRELOAD_CONTROL_H__
#define __PRELOAD_CONTROL_H__
-struct us_ip;
+struct sspt_ip;
enum preload_call_type {
NOT_INSTRUMENTED,
void preload_control_exit(void);
enum preload_call_type preload_control_call_type_always_inst(void *caller);
-enum preload_call_type preload_control_call_type(struct us_ip *ip, void *caller);
+enum preload_call_type preload_control_call_type(struct sspt_ip *ip, void *caller);
int preload_control_add_instrumented_binary(char *filename);
int preload_control_clean_instrumented_bins(void);
int preload_control_add_ignored_binary(char *filename);
#include <kprobe/swap_kprobes_deps.h>
#include <writer/kernel_operations.h>
#include <writer/swap_msg.h>
-#include <us_manager/sspt/ip.h>
+#include <us_manager/sspt/sspt_ip.h>
#include <us_manager/sspt/sspt_page.h>
#include <us_manager/sspt/sspt_file.h>
#include "preload.h"
#define page_to_proc(page) ((page)->file->proc)
#define ip_to_proc(ip) page_to_proc((ip)->page)
+#define urp_to_ip(rp) container_of(rp, struct sspt_ip, retprobe)
enum {
/* task preload flags */
static inline struct pd_t *__get_process_data(struct uretprobe *rp)
{
- struct us_ip *ip = to_us_ip(rp);
+ struct sspt_ip *ip = urp_to_ip(rp);
struct sspt_proc *proc = ip_to_proc(ip);
return preload_pd_get(proc);
return vma;
}
-static inline bool __is_probe_non_block(struct us_ip *ip)
+static inline bool __is_probe_non_block(struct sspt_ip *ip)
{
if (ip->desc->info.pl_i.flags & SWAP_PRELOAD_NON_BLOCK_PROBE)
return true;
return false;
}
-static inline bool __inverted(struct us_ip *ip)
+static inline bool __inverted(struct sspt_ip *ip)
{
unsigned long flags = ip->desc->info.pl_i.flags;
return false;
}
-static inline bool __check_flag_and_call_type(struct us_ip *ip,
+static inline bool __check_flag_and_call_type(struct sspt_ip *ip,
enum preload_call_type ct)
{
bool inverted = __inverted(ip);
return false;
}
-static inline bool __should_drop(struct us_ip *ip, enum preload_call_type ct)
+static inline bool __should_drop(struct sspt_ip *ip, enum preload_call_type ct)
{
if (ct == NOT_INSTRUMENTED)
return true;
struct pt_regs *regs,
struct hd_t *hd)
{
- struct us_ip *ip = container_of(ri->rp, struct us_ip, retprobe);
+ struct sspt_ip *ip = container_of(ri->rp, struct sspt_ip, retprobe);
unsigned long offset = ip->desc->info.pl_i.handler;
unsigned long vaddr = 0;
unsigned long base;
struct hd_t *hd;
unsigned long old_pc = swap_get_instr_ptr(regs);
unsigned long flags = get_preload_flags(current);
- struct us_ip *ip = container_of(ri->rp, struct us_ip, retprobe);
+ struct sspt_ip *ip = container_of(ri->rp, struct sspt_ip, retprobe);
unsigned long vaddr = 0;
if (handler_dentry == NULL)
static void __do_preload_ret(struct uretprobe_instance *ri, struct hd_t *hd)
{
- struct us_ip *ip = container_of(ri->rp, struct us_ip, retprobe);
+ struct sspt_ip *ip = container_of(ri->rp, struct sspt_ip, retprobe);
unsigned long flags = get_preload_flags(current);
unsigned long offset = ip->desc->info.pl_i.handler;
unsigned long vaddr = 0;
-int ph_get_caller_init(struct us_ip *ip)
+int ph_get_caller_init(struct sspt_ip *ip)
{
struct uprobe *up = &ip->uprobe;
return 0;
}
-void ph_get_caller_exit(struct us_ip *ip)
+void ph_get_caller_exit(struct sspt_ip *ip)
{
}
-int ph_get_call_type_init(struct us_ip *ip)
+int ph_get_call_type_init(struct sspt_ip *ip)
{
struct uprobe *up = &ip->uprobe;
return 0;
}
-void ph_get_call_type_exit(struct us_ip *ip)
+void ph_get_call_type_exit(struct sspt_ip *ip)
{
}
-int ph_write_msg_init(struct us_ip *ip)
+int ph_write_msg_init(struct sspt_ip *ip)
{
struct uprobe *up = &ip->uprobe;
return 0;
}
-void ph_write_msg_exit(struct us_ip *ip)
+void ph_write_msg_exit(struct sspt_ip *ip)
{
}
}
-int ph_uprobe_init(struct us_ip *ip)
+int ph_uprobe_init(struct sspt_ip *ip)
{
struct uretprobe *rp = &ip->retprobe;
return 0;
}
-void ph_uprobe_exit(struct us_ip *ip)
+void ph_uprobe_exit(struct sspt_ip *ip)
{
}
#ifndef __PRELOAD_HANDLERS_H__
#define __PRELOAD_HANDLERS_H__
-struct us_ip;
+struct sspt_ip;
struct dentry;
-int ph_uprobe_init(struct us_ip *ip);
-void ph_uprobe_exit(struct us_ip *ip);
+int ph_uprobe_init(struct sspt_ip *ip);
+void ph_uprobe_exit(struct sspt_ip *ip);
-int ph_get_caller_init(struct us_ip *ip);
-void ph_get_caller_exit(struct us_ip *ip);
-int ph_get_call_type_init(struct us_ip *ip);
-void ph_get_call_type_exit(struct us_ip *ip);
-int ph_write_msg_init(struct us_ip *ip);
-void ph_write_msg_exit(struct us_ip *ip);
+int ph_get_caller_init(struct sspt_ip *ip);
+void ph_get_caller_exit(struct sspt_ip *ip);
+int ph_get_call_type_init(struct sspt_ip *ip);
+void ph_get_call_type_exit(struct sspt_ip *ip);
+int ph_write_msg_init(struct sspt_ip *ip);
+void ph_write_msg_exit(struct sspt_ip *ip);
void ph_set_handler_dentry(struct dentry *dentry);
#endif /* __PRELOAD_HANDLERS_H__ */
#include <kprobe/swap_kprobes.h>
#include <kprobe/swap_kprobes_deps.h>
#include <us_manager/sspt/sspt_proc.h>
-#include <us_manager/sspt/ip.h>
+#include <us_manager/sspt/sspt_ip.h>
#include <us_manager/callbacks.h>
#include <writer/kernel_operations.h>
#include <master/swap_initializer.h>
#include <us_manager/probes/register_probes.h>
#include <us_manager/sspt/sspt_page.h>
#include <uprobe/swap_uprobes.h>
-#include <us_manager/sspt/ip.h>
+#include <us_manager/sspt/sspt_ip.h>
#include "preload_probe.h"
#include "preload.h"
#include "preload_module.h"
{
}
-static struct uprobe *preload_get_uprobe(struct us_ip *ip)
+static struct uprobe *preload_get_uprobe(struct sspt_ip *ip)
{
return &ip->retprobe.up;
}
/* Registers probe if preload is 'running' or 'ready'.
*/
-static int preload_register_probe(struct us_ip *ip)
+static int preload_register_probe(struct sspt_ip *ip)
{
if (preload_module_is_not_ready()) {
if (can_be_ready()) {
return swap_register_uretprobe(&ip->retprobe);
}
-static void preload_unregister_probe(struct us_ip *ip, int disarm)
+static void preload_unregister_probe(struct sspt_ip *ip, int disarm)
{
__swap_unregister_uretprobe(&ip->retprobe, disarm);
dec_probes();
}
-static void preload_init(struct us_ip *ip)
+static void preload_init(struct sspt_ip *ip)
{
ph_uprobe_init(ip);
}
-static void preload_uninit(struct us_ip *ip)
+static void preload_uninit(struct sspt_ip *ip)
{
ph_uprobe_exit(ip);
{
}
-static struct uprobe *get_caller_get_uprobe(struct us_ip *ip)
+static struct uprobe *get_caller_get_uprobe(struct sspt_ip *ip)
{
return &ip->uprobe;
}
-static int get_caller_register_probe(struct us_ip *ip)
+static int get_caller_register_probe(struct sspt_ip *ip)
{
return swap_register_uprobe(&ip->uprobe);
}
-static void get_caller_unregister_probe(struct us_ip *ip, int disarm)
+static void get_caller_unregister_probe(struct sspt_ip *ip, int disarm)
{
__swap_unregister_uprobe(&ip->uprobe, disarm);
}
-static void get_caller_init(struct us_ip *ip)
+static void get_caller_init(struct sspt_ip *ip)
{
ph_get_caller_init(ip);
}
-static void get_caller_uninit(struct us_ip *ip)
+static void get_caller_uninit(struct sspt_ip *ip)
{
ph_get_caller_exit(ip);
.cleanup = get_caller_info_cleanup
};
-static void get_call_type_init(struct us_ip *ip)
+static void get_call_type_init(struct sspt_ip *ip)
{
ph_get_call_type_init(ip);
}
-static void get_call_type_uninit(struct us_ip *ip)
+static void get_call_type_uninit(struct sspt_ip *ip)
{
ph_get_call_type_exit(ip);
.cleanup = get_caller_info_cleanup
};
-static void write_msg_init(struct us_ip *ip)
+static void write_msg_init(struct sspt_ip *ip)
{
ph_write_msg_init(ip);
}
-static int write_msg_reg(struct us_ip *ip)
+static int write_msg_reg(struct sspt_ip *ip)
{
return get_caller_register_probe(ip);
}
-static void write_msg_uninit(struct us_ip *ip)
+static void write_msg_uninit(struct sspt_ip *ip)
{
ph_write_msg_exit(ip);
#include "retprobe.h"
#include <us_manager/us_manager.h>
-#include <us_manager/sspt/ip.h>
+#include <us_manager/sspt/sspt_ip.h>
#include <us_manager/probes/register_probes.h>
#include <uprobe/swap_uprobes.h>
#include <linux/module.h>
-static struct uprobe *retprobe_get_uprobe(struct us_ip *ip)
+static struct uprobe *retprobe_get_uprobe(struct sspt_ip *ip)
{
return &ip->retprobe.up;
}
-static int retprobe_register_probe(struct us_ip *ip)
+static int retprobe_register_probe(struct sspt_ip *ip)
{
return swap_register_uretprobe(&ip->retprobe);
}
-static void retprobe_unregister_probe(struct us_ip *ip, int disarm)
+static void retprobe_unregister_probe(struct sspt_ip *ip, int disarm)
{
__swap_unregister_uretprobe(&ip->retprobe, disarm);
}
struct uretprobe *rp = ri->rp;
if (rp && get_quiet() == QT_OFF) {
- struct us_ip *ip = container_of(rp, struct us_ip, retprobe);
+ struct sspt_ip *ip = container_of(rp, struct sspt_ip, retprobe);
const char *fmt = ip->desc->info.rp_i.args;
const unsigned long func_addr = (unsigned long)ip->orig_addr;
struct uretprobe *rp = ri->rp;
if (rp && get_quiet() == QT_OFF) {
- struct us_ip *ip = container_of(rp, struct us_ip, retprobe);
+ struct sspt_ip *ip = container_of(rp, struct sspt_ip, retprobe);
const unsigned long func_addr = (unsigned long)ip->orig_addr;
const unsigned long ret_addr = (unsigned long)ri->ret_addr;
const char ret_type = ip->desc->info.rp_i.ret_type;
return 0;
}
-static void retprobe_init(struct us_ip *ip)
+static void retprobe_init(struct sspt_ip *ip)
{
ip->retprobe.entry_handler = retprobe_entry_handler;
ip->retprobe.handler = retprobe_ret_handler;
ip->retprobe.maxactive = 0;
}
-static void retprobe_uninit(struct us_ip *ip)
+static void retprobe_uninit(struct sspt_ip *ip)
{
retprobe_cleanup(&ip->desc->info);
}
$(src)/../uprobe/Module.symvers
obj-m := swap_us_manager.o
-swap_us_manager-y := us_manager.o us_slot_manager.o helper.o debugfs_us_manager.o \
- sspt/ip.o sspt/sspt_page.o sspt/sspt_file.o sspt/sspt_proc.o \
- sspt/sspt_feature.o sspt/sspt_filter.o \
- pf/proc_filters.o pf/pf_group.o \
- img/img_proc.o img/img_file.o img/img_ip.o \
- probes/probes.o \
- probes/probe_info_new.o \
- callbacks.o
+swap_us_manager-y := \
+ helper.o \
+ us_manager.o \
+ us_slot_manager.o \
+ debugfs_us_manager.o \
+ sspt/sspt_ip.o \
+ sspt/sspt_page.o \
+ sspt/sspt_file.o \
+ sspt/sspt_proc.o \
+ sspt/sspt_feature.o \
+ sspt/sspt_filter.o \
+ pf/pf_group.o \
+ pf/proc_filters.o \
+ img/img_ip.o \
+ img/img_file.o \
+ img/img_proc.o \
+ probes/probes.o \
+ probes/probe_info_new.o \
+ callbacks.o
* copy_process() *
******************************************************************************
*/
-static void func_uinst_creare(struct us_ip *ip, void *data)
+static void func_uinst_creare(struct sspt_ip *ip, void *data)
{
struct hlist_head *head = (struct hlist_head *)data;
struct uprobe *up;
#include "img_ip.h"
#include <us_manager/probes/use_probes.h>
-#include <us_manager/sspt/ip.h>
+#include <us_manager/sspt/sspt_ip.h>
#include <linux/slab.h>
/**
*/
void free_img_ip(struct img_ip *ip)
{
- struct us_ip *p, *n;
+ struct sspt_ip *p, *n;
list_for_each_entry_safe(p, n, &ip->ihead, img_list) {
list_del_init(&p->img_list);
- p->iip = NULL;
+ p->img_ip = NULL;
list_del(&p->list);
probe_info_unregister(p->desc->type, p, 1);
- free_ip(p);
+ sspt_ip_free(p);
}
kfree(ip);
#include <linux/module.h>
-#include <us_manager/sspt/ip.h>
+#include <us_manager/sspt/sspt_ip.h>
#include <us_manager/pf/pf_group.h>
#include <us_manager/sspt/sspt_proc.h>
#include "probes.h"
struct uretprobe *rp = ri->rp;
if (rp) {
- struct us_ip *ip = container_of(rp, struct us_ip, retprobe);
+ struct sspt_ip *ip = container_of(rp, struct sspt_ip, retprobe);
struct probe_desc *pd = NULL;
pd = ip->desc;
struct uretprobe *rp = ri->rp;
if (rp) {
- struct us_ip *ip = container_of(rp, struct us_ip, retprobe);
+ struct sspt_ip *ip = container_of(rp, struct sspt_ip, retprobe);
struct probe_desc *pd = NULL;
pd = ip->desc;
static int uprobe_handler(struct uprobe *p, struct pt_regs *regs)
{
- struct us_ip *ip = container_of(p, struct us_ip, uprobe);
+ struct sspt_ip *ip = container_of(p, struct sspt_ip, uprobe);
struct probe_desc *pd = NULL;
pd = ip->desc;
{
}
-static struct uprobe *up_get_uprobe(struct us_ip *ip)
+static struct uprobe *up_get_uprobe(struct sspt_ip *ip)
{
return &ip->uprobe;
}
-static int up_register_probe(struct us_ip *ip)
+static int up_register_probe(struct sspt_ip *ip)
{
return swap_register_uprobe(&ip->uprobe);
}
-static void up_unregister_probe(struct us_ip *ip, int disarm)
+static void up_unregister_probe(struct sspt_ip *ip, int disarm)
{
__swap_unregister_uprobe(&ip->uprobe, disarm);
}
-static void up_init(struct us_ip *ip)
+static void up_init(struct sspt_ip *ip)
{
ip->uprobe.pre_handler = uprobe_handler;
}
-static void up_uninit(struct us_ip *ip)
+static void up_uninit(struct sspt_ip *ip)
{
}
{
}
-static struct uprobe *urp_get_uprobe(struct us_ip *ip)
+static struct uprobe *urp_get_uprobe(struct sspt_ip *ip)
{
return &ip->retprobe.up;
}
-static int urp_register_probe(struct us_ip *ip)
+static int urp_register_probe(struct sspt_ip *ip)
{
return swap_register_uretprobe(&ip->retprobe);
}
-static void urp_unregister_probe(struct us_ip *ip, int disarm)
+static void urp_unregister_probe(struct sspt_ip *ip, int disarm)
{
__swap_unregister_uretprobe(&ip->retprobe, disarm);
}
-static void urp_init(struct us_ip *ip)
+static void urp_init(struct sspt_ip *ip)
{
ip->retprobe.entry_handler = urp_entry_handler;
ip->retprobe.handler = urp_ret_handler;
ip->retprobe.data_size = sizeof(void *);
}
-static void urp_uninit(struct us_ip *ip)
+static void urp_uninit(struct sspt_ip *ip)
{
}
* @param ip Pointer to the probe us_ip struct.
* @return Void.
*/
-void probe_info_init(enum probe_t type, struct us_ip *ip)
+void probe_info_init(enum probe_t type, struct sspt_ip *ip)
{
if (!methods_exist(type)) {
return;
* @param ip Pointer to the probe us_ip struct.
* @return Void.
*/
-void probe_info_uninit(enum probe_t type, struct us_ip *ip)
+void probe_info_uninit(enum probe_t type, struct sspt_ip *ip)
{
if (!methods_exist(type)) {
return;
* @param ip Pointer to the probe us_ip struct.
* @return -EINVAL on wrong probe type, method result otherwise.
*/
-int probe_info_register(enum probe_t type, struct us_ip *ip)
+int probe_info_register(enum probe_t type, struct sspt_ip *ip)
{
if (!methods_exist(type)) {
return -EINVAL;
* @param disarm Disarm flag.
* @return Void.
*/
-void probe_info_unregister(enum probe_t type, struct us_ip *ip, int disarm)
+void probe_info_unregister(enum probe_t type, struct sspt_ip *ip, int disarm)
{
if (!methods_exist(type)) {
return;
* @param ip Pointer to the probe us_ip struct.
* @return Pointer to the uprobe struct, NULL on error.
*/
-struct uprobe *probe_info_get_uprobe(enum probe_t type, struct us_ip *ip)
+struct uprobe *probe_info_get_uprobe(enum probe_t type, struct sspt_ip *ip)
{
if (!methods_exist(type)) {
return NULL;
#include "probes.h"
-struct us_ip;
+struct sspt_ip;
struct probe_iface {
- void (*init)(struct us_ip *);
- void (*uninit)(struct us_ip *);
- int (*reg)(struct us_ip *);
- void (*unreg)(struct us_ip *, int);
- struct uprobe *(*get_uprobe)(struct us_ip *);
+ void (*init)(struct sspt_ip *);
+ void (*uninit)(struct sspt_ip *);
+ int (*reg)(struct sspt_ip *);
+ void (*unreg)(struct sspt_ip *, int);
+ struct uprobe *(*get_uprobe)(struct sspt_ip *);
int (*copy)(struct probe_info *, const struct probe_info *);
void (*cleanup)(struct probe_info *);
};
#include "probes.h"
-struct us_ip;
+struct sspt_ip;
-void probe_info_init(enum probe_t type, struct us_ip *ip);
-void probe_info_uninit(enum probe_t type, struct us_ip *ip);
-int probe_info_register(enum probe_t type, struct us_ip *ip);
-void probe_info_unregister(enum probe_t type, struct us_ip *ip, int disarm);
-struct uprobe *probe_info_get_uprobe(enum probe_t type, struct us_ip *ip);
+void probe_info_init(enum probe_t type, struct sspt_ip *ip);
+void probe_info_uninit(enum probe_t type, struct sspt_ip *ip);
+int probe_info_register(enum probe_t type, struct sspt_ip *ip);
+void probe_info_unregister(enum probe_t type, struct sspt_ip *ip, int disarm);
+struct uprobe *probe_info_get_uprobe(enum probe_t type, struct sspt_ip *ip);
int probe_info_copy(const struct probe_info *pi, struct probe_info *dest);
void probe_info_cleanup(struct probe_info *pi);
*
*/
-#include "ip.h"
+#include "sspt_ip.h"
#include "sspt_page.h"
#include "sspt_file.h"
#include "sspt_proc.h"
!(vma->vm_flags & (VM_READ | VM_MAYREAD)));
}
-static inline int sspt_register_usprobe(struct us_ip *ip)
+static inline int sspt_register_usprobe(struct sspt_ip *ip)
{
int ret;
struct uprobe *up = NULL;
}
static inline int sspt_unregister_usprobe(struct task_struct *task,
- struct us_ip *ip,
+ struct sspt_ip *ip,
enum US_FLAGS flag)
{
struct uprobe *up = NULL;
(unsigned long)rp->handler);
}
-static inline void print_ip(struct us_ip *ip, int i)
+static inline void print_ip(struct sspt_ip *ip, int i)
{
if (ip->desc->type == SWAP_RETPROBE) {
struct uretprobe *rp = &ip->retprobe;
static inline void print_page_probes(const struct sspt_page *page)
{
int i = 0;
- struct us_ip *ip;
+ struct sspt_ip *ip;
printk(KERN_INFO "### offset=%lx\n", page->offset);
printk(KERN_INFO "### no install:\n");
- list_for_each_entry(ip, &page->ip_list_no_inst, list) {
+ list_for_each_entry(ip, &page->ip_list.not_inst, list) {
print_ip(ip, i);
++i;
}
printk(KERN_INFO "### install:\n");
- list_for_each_entry(ip, &page->ip_list_inst, list) {
+ list_for_each_entry(ip, &page->ip_list.inst, list) {
print_ip(ip, i);
++i;
}
return;
}
- table_size = (1 << file->page_probes_hash_bits);
+ table_size = (1 << file->htable.bits);
name = (file->dentry) ? file->dentry->d_iname : NA;
printk(KERN_INFO "### print_file_probes: path=%s, d_iname=%s, "
file->dentry->d_iname, name, table_size, file->vm_start);
for (i = 0; i < table_size; ++i) {
- head = &file->page_probes_table[i];
+ head = &file->htable.heads[i];
swap_hlist_for_each_entry_rcu(page, node, head, hlist) {
print_page_probes(page);
}
struct sspt_file *file;
printk(KERN_INFO "### print_proc_probes\n");
- list_for_each_entry(file, &proc->file_list, list) {
+ list_for_each_entry(file, &proc->file_head, list) {
print_file_probes(file);
}
printk(KERN_INFO "### print_proc_probes\n");
}
-/*
-static inline void print_inst_us_proc(const inst_us_proc_t *task_inst_info)
-{
- int i;
- int cnt = task_inst_info->libs_count;
- printk( "### BUNDLE PRINT START ###\n");
- printk(KERN_INFO "\n### BUNDLE PRINT START ###\n");
- printk(KERN_INFO "### task_inst_info.libs_count=%d\n", cnt);
-
- for (i = 0; i < cnt; ++i) {
- int j;
-
- us_proc_lib_t *lib = &task_inst_info->p_libs[i];
- int cnt_j = lib->ips_count;
- char *path = lib->path;
- printk(KERN_INFO "### path=%s, cnt_j=%d\n", path, cnt_j);
-
- for (j = 0; j < cnt_j; ++j) {
- us_proc_ip_t *ips = &lib->p_ips[j];
- unsigned long offset = ips->offset;
- printk(KERN_INFO "### offset=%lx\n", offset);
- }
- }
- printk(KERN_INFO "### BUNDLE PRINT END ###\n");
-}
-*/
#endif /* __SSPT_DEBUG__ */
return bits;
}
+static unsigned long htable_size(const struct sspt_file *file)
+{
+ return 1 << file->htable.bits;
+}
+
+static struct hlist_head *htable_head_by_key(const struct sspt_file *file,
+ unsigned long offset)
+{
+ return &file->htable.heads[hash_ptr((void *)offset, file->htable.bits)];
+}
+
+static struct hlist_head *htable_head_by_idx(const struct sspt_file *file,
+ unsigned long idx)
+{
+ return &file->htable.heads[idx];
+}
/**
* @brief Create sspt_file struct
*
struct sspt_file *sspt_file_create(struct dentry *dentry, int page_cnt)
{
int i, table_size;
+ struct hlist_head *heads;
struct sspt_file *obj = kmalloc(sizeof(*obj), GFP_ATOMIC);
if (obj == NULL)
obj->vm_start = 0;
obj->vm_end = 0;
- obj->page_probes_hash_bits = calculation_hash_bits(page_cnt);
- table_size = (1 << obj->page_probes_hash_bits);
-
- obj->page_probes_table =
- kmalloc(sizeof(*obj->page_probes_table)*table_size,
- GFP_ATOMIC);
+ obj->htable.bits = calculation_hash_bits(page_cnt);
+ table_size = htable_size(obj);
- if (obj->page_probes_table == NULL)
+ heads = kmalloc(sizeof(*obj->htable.heads) * table_size, GFP_ATOMIC);
+ if (heads == NULL)
goto err;
for (i = 0; i < table_size; ++i)
- INIT_HLIST_HEAD(&obj->page_probes_table[i]);
+ INIT_HLIST_HEAD(&heads[i]);
+ obj->htable.heads = heads;
return obj;
err:
{
struct hlist_head *head;
struct sspt_page *page;
- int i, table_size = (1 << file->page_probes_hash_bits);
+ int i, table_size = htable_size(file);
struct hlist_node *n;
DECLARE_NODE_PTR_FOR_HLIST(p);
for (i = 0; i < table_size; ++i) {
- head = &file->page_probes_table[i];
+ head = htable_head_by_idx(file, i);
swap_hlist_for_each_entry_safe(page, p, n, head, hlist) {
hlist_del(&page->hlist);
sspt_page_free(page);
}
}
- kfree(file->page_probes_table);
+ kfree(file->htable.heads);
kfree(file);
}
static void sspt_add_page(struct sspt_file *file, struct sspt_page *page)
{
page->file = file;
- hlist_add_head(&page->hlist,
- &file->page_probes_table[hash_ptr(
- (void *)page->offset,
- file->page_probes_hash_bits)]);
+ hlist_add_head(&page->hlist, htable_head_by_key(file, page->offset));
}
static struct sspt_page *sspt_find_page(struct sspt_file *file,
unsigned long offset)
{
- struct hlist_head *head;
+ struct hlist_head *head = htable_head_by_key(file, offset);
struct sspt_page *page;
DECLARE_NODE_PTR_FOR_HLIST(node);
- head = &file->page_probes_table[hash_ptr((void *)offset,
- file->page_probes_hash_bits)];
swap_hlist_for_each_entry(page, node, head, hlist) {
if (page->offset == offset)
return page;
{
unsigned long offset = 0;
struct sspt_page *page = NULL;
- struct us_ip *ip = NULL;
+ struct sspt_ip *ip = NULL;
offset = img_ip->addr & PAGE_MASK;
page = sspt_find_page_or_new(file, offset);
return;
/* FIXME: delete ip */
- ip = create_ip(img_ip);
+ ip = sspt_ip_create(img_ip);
if (!ip)
return;
}
void sspt_file_on_each_ip(struct sspt_file *file,
- void (*func)(struct us_ip *, void *), void *data)
+ void (*func)(struct sspt_ip *, void *), void *data)
{
int i;
- const int table_size = (1 << file->page_probes_hash_bits);
+ const int table_size = htable_size(file);
struct sspt_page *page;
struct hlist_head *head;
DECLARE_NODE_PTR_FOR_HLIST(node);
for (i = 0; i < table_size; ++i) {
- head = &file->page_probes_table[i];
+ head = htable_head_by_idx(file, i);
swap_hlist_for_each_entry(page, node, head, hlist)
sspt_page_on_each_ip(page, func, data);
}
}
/**
- * @brief Get sspt_page from sspt_file (look)
- *
- * @param file Pointer to the sspt_file struct
- * @param offset_addr File offset
- * @return Pointer to the sspt_page struct
- */
-struct sspt_page *sspt_get_page(struct sspt_file *file,
- unsigned long offset_addr)
-{
- unsigned long offset = offset_addr & PAGE_MASK;
- struct sspt_page *page = sspt_find_page_or_new(file, offset);
-
- spin_lock(&page->lock);
-
- return page;
-}
-
-/**
- * @brief Put sspt_page (unlook)
- *
- * @param file Pointer to the sspt_page struct
- * @return void
- */
-void sspt_put_page(struct sspt_page *page)
-{
- spin_unlock(&page->lock);
-}
-
-/**
* @brief Check install sspt_file (legacy code, it is need remove)
*
* @param file Pointer to the sspt_file struct
struct hlist_node *tmp;
DECLARE_NODE_PTR_FOR_HLIST(node);
- table_size = (1 << file->page_probes_hash_bits);
+ table_size = htable_size(file);
for (i = 0; i < table_size; ++i) {
- head = &file->page_probes_table[i];
+ head = htable_head_by_idx(file, i);
swap_hlist_for_each_entry_safe(page, node, tmp, head, hlist) {
if (sspt_page_is_installed(page))
return 1;
{
struct sspt_page *page = NULL;
struct hlist_head *head = NULL;
- int i, table_size = (1 << file->page_probes_hash_bits);
+ int i, table_size = htable_size(file);
unsigned long page_addr;
struct mm_struct *mm;
DECLARE_NODE_PTR_FOR_HLIST(node);
for (i = 0; i < table_size; ++i) {
- head = &file->page_probes_table[i];
+ head = htable_head_by_idx(file, i);
swap_hlist_for_each_entry_rcu(page, node, head, hlist) {
page_addr = file->vm_start + page->offset;
if (page_addr < file->vm_start ||
enum US_FLAGS flag)
{
int i, err = 0;
- int table_size = (1 << file->page_probes_hash_bits);
+ int table_size = htable_size(file);
struct sspt_page *page;
struct hlist_head *head;
struct hlist_node *tmp;
DECLARE_NODE_PTR_FOR_HLIST(node);
for (i = 0; i < table_size; ++i) {
- head = &file->page_probes_table[i];
+ head = htable_head_by_idx(file, i);
swap_hlist_for_each_entry_safe(page, node, tmp, head, hlist) {
err = sspt_unregister_page(page, flag, task);
if (err != 0) {
* Copyright (C) Samsung Electronics, 2013
*/
-#include "ip.h"
+#include "sspt_ip.h"
#include <linux/types.h>
enum US_FLAGS;
* @breaf Image of file for specified process
*/
struct sspt_file {
+ /* sspt_proc */
struct list_head list; /**< For sspt_proc */
struct sspt_proc *proc; /**< Pointer to the proc (parent) */
+
+ /* sspt_page */
+ struct {
+ unsigned long bits; /**< Hash-table size */
+ struct hlist_head *heads; /**< Heads for pages */
+ } htable;
+
struct dentry *dentry; /**< Dentry of file */
unsigned long vm_start; /**< VM start */
unsigned long vm_end; /**< VM end */
-
- unsigned long page_probes_hash_bits; /**< Hash-table size */
- struct hlist_head *page_probes_table; /**< Hash-table for pages */
-
- unsigned loaded:1; /**< Flag of loading */
+ unsigned loaded:1; /**< Flag of loading */
};
void sspt_file_add_ip(struct sspt_file *file, struct img_ip *img_ip);
void sspt_file_on_each_ip(struct sspt_file *file,
- void (*func)(struct us_ip *, void *), void *data);
-
-struct sspt_page *sspt_get_page(struct sspt_file *file,
- unsigned long offset_addr);
-void sspt_put_page(struct sspt_page *page);
+ void (*func)(struct sspt_ip *, void *), void *data);
int sspt_file_check_install_pages(struct sspt_file *file);
void sspt_file_install(struct sspt_file *file);
#include <linux/slab.h>
#include <linux/module.h>
-#include "ip.h"
+#include "sspt_ip.h"
#include "sspt_page.h"
#include "sspt_file.h"
#include <us_manager/probes/use_probes.h>
* @param page Pointer to the parent sspt_page struct
* @return Pointer to the created us_ip struct
*/
-struct us_ip *create_ip(struct img_ip *img_ip)
+struct sspt_ip *sspt_ip_create(struct img_ip *img_ip)
{
- struct us_ip *ip;
+ struct sspt_ip *ip;
ip = kmalloc(sizeof(*ip), GFP_ATOMIC);
if (!ip)
INIT_LIST_HEAD(&ip->img_list);
ip->offset = img_ip->addr;
ip->desc = img_ip->desc;
- ip->iip = img_ip;
+ ip->img_ip = img_ip;
list_add(&ip->img_list, &img_ip->ihead);
return ip;
* @param ip remove object
* @return Void
*/
-void free_ip(struct us_ip *ip)
+void sspt_ip_free(struct sspt_ip *ip)
{
if (!list_empty(&ip->img_list))
list_del(&ip->img_list);
-#ifndef __IP__
-#define __IP__
+#ifndef _SSPT_IP
+#define _SSPT_IP
/**
* @file us_manager/sspt/ip.h
struct sspt_page;
/**
- * @struct us_ip
+ * @struct sspt_ip
* @breaf Image of instrumentation pointer for specified process
*/
-struct us_ip {
+struct sspt_ip {
+ /* sspt_page */
struct list_head list; /**< For sspt_page */
struct sspt_page *page; /**< Pointer on the page (parent) */
- struct probe_desc *desc; /**< Probe's data */
- struct img_ip *iip;
- struct list_head img_list;
+
+ /* img_ip */
+ struct img_ip *img_ip; /**< Pointer on the img_ip (parent) */
+ struct list_head img_list; /**< For img_ip */
unsigned long orig_addr; /**< Function address */
unsigned long offset; /**< Page offset */
+ struct probe_desc *desc; /**< Probe's data */
+
union {
struct uretprobe retprobe;
struct uprobe uprobe;
};
};
-#define to_us_ip(rp) container_of(rp, struct us_ip, retprobe)
-struct us_ip *create_ip(struct img_ip *img_ip);
-void free_ip(struct us_ip *ip);
+struct sspt_ip *sspt_ip_create(struct img_ip *img_ip);
+void sspt_ip_free(struct sspt_ip *ip);
+
-#endif /* __IP__ */
+#endif /* _SSPT_IP */
#include "sspt.h"
#include "sspt_page.h"
#include "sspt_file.h"
-#include "ip.h"
+#include "sspt_ip.h"
#include <us_manager/probes/use_probes.h>
#include <linux/slab.h>
#include <linux/list.h>
{
struct sspt_page *obj = kmalloc(sizeof(*obj), GFP_ATOMIC);
if (obj) {
- INIT_LIST_HEAD(&obj->ip_list_inst);
- INIT_LIST_HEAD(&obj->ip_list_no_inst);
+ INIT_LIST_HEAD(&obj->ip_list.inst);
+ INIT_LIST_HEAD(&obj->ip_list.not_inst);
obj->offset = offset;
- spin_lock_init(&obj->lock);
+ spin_lock_init(&obj->ip_list.lock);
obj->file = NULL;
INIT_HLIST_NODE(&obj->hlist);
}
*/
void sspt_page_free(struct sspt_page *page)
{
- struct us_ip *ip, *n;
+ struct sspt_ip *ip, *n;
- list_for_each_entry_safe(ip, n, &page->ip_list_inst, list) {
+ list_for_each_entry_safe(ip, n, &page->ip_list.inst, list) {
list_del(&ip->list);
- free_ip(ip);
+ sspt_ip_free(ip);
}
- list_for_each_entry_safe(ip, n, &page->ip_list_no_inst, list) {
+ list_for_each_entry_safe(ip, n, &page->ip_list.not_inst, list) {
list_del(&ip->list);
- free_ip(ip);
+ sspt_ip_free(ip);
}
kfree(page);
}
-static void sspt_list_add_ip(struct sspt_page *page, struct us_ip *ip)
+static void sspt_list_add_ip(struct sspt_page *page, struct sspt_ip *ip)
{
- list_add(&ip->list, &page->ip_list_no_inst);
+ list_add(&ip->list, &page->ip_list.not_inst);
}
-static void sspt_list_del_ip(struct us_ip *ip)
+static void sspt_list_del_ip(struct sspt_ip *ip)
{
list_del(&ip->list);
}
* @param ip Pointer to the us_ip struct
* @return Void
*/
-void sspt_add_ip(struct sspt_page *page, struct us_ip *ip)
+void sspt_add_ip(struct sspt_page *page, struct sspt_ip *ip)
{
ip->offset &= ~PAGE_MASK;
ip->page = page;
* @param ip Pointer to the us_ip struct
* @return Void
*/
-void sspt_del_ip(struct us_ip *ip)
+void sspt_del_ip(struct sspt_ip *ip)
{
sspt_list_del_ip(ip);
- free_ip(ip);
+ sspt_ip_free(ip);
}
/**
{
int empty;
- spin_lock(&page->lock);
- empty = list_empty(&page->ip_list_inst);
- spin_unlock(&page->lock);
+ spin_lock(&page->ip_list.lock);
+ empty = list_empty(&page->ip_list.inst);
+ spin_unlock(&page->ip_list.lock);
return !empty;
}
int sspt_register_page(struct sspt_page *page, struct sspt_file *file)
{
int err = 0;
- struct us_ip *ip, *n;
+ struct sspt_ip *ip, *n;
struct list_head ip_list_tmp;
- spin_lock(&page->lock);
- if (list_empty(&page->ip_list_no_inst)) {
+ spin_lock(&page->ip_list.lock);
+ if (list_empty(&page->ip_list.not_inst)) {
struct task_struct *task = page->file->proc->task;
printk(KERN_INFO "page %lx in %s task[tgid=%u, pid=%u] "
}
INIT_LIST_HEAD(&ip_list_tmp);
- list_replace_init(&page->ip_list_no_inst, &ip_list_tmp);
- spin_unlock(&page->lock);
+ list_replace_init(&page->ip_list.not_inst, &ip_list_tmp);
+ spin_unlock(&page->ip_list.lock);
list_for_each_entry_safe(ip, n, &ip_list_tmp, list) {
/* set virtual address */
err = sspt_register_usprobe(ip);
if (err) {
list_del(&ip->list);
- free_ip(ip);
+ sspt_ip_free(ip);
continue;
}
}
- spin_lock(&page->lock);
- list_splice(&ip_list_tmp, &page->ip_list_inst);
+ spin_lock(&page->ip_list.lock);
+ list_splice(&ip_list_tmp, &page->ip_list.inst);
unlock:
- spin_unlock(&page->lock);
+ spin_unlock(&page->ip_list.lock);
return 0;
}
struct task_struct *task)
{
int err = 0;
- struct us_ip *ip;
+ struct sspt_ip *ip;
struct list_head ip_list_tmp, *head;
- spin_lock(&page->lock);
- if (list_empty(&page->ip_list_inst)) {
- spin_unlock(&page->lock);
+ spin_lock(&page->ip_list.lock);
+ if (list_empty(&page->ip_list.inst)) {
+ spin_unlock(&page->ip_list.lock);
return 0;
}
INIT_LIST_HEAD(&ip_list_tmp);
- list_replace_init(&page->ip_list_inst, &ip_list_tmp);
+ list_replace_init(&page->ip_list.inst, &ip_list_tmp);
- spin_unlock(&page->lock);
+ spin_unlock(&page->ip_list.lock);
list_for_each_entry(ip, &ip_list_tmp, list) {
err = sspt_unregister_usprobe(task, ip, flag);
}
head = (flag == US_DISARM) ?
- &page->ip_list_inst : &page->ip_list_no_inst;
+ &page->ip_list.inst : &page->ip_list.not_inst;
- spin_lock(&page->lock);
+ spin_lock(&page->ip_list.lock);
list_splice(&ip_list_tmp, head);
- spin_unlock(&page->lock);
+ spin_unlock(&page->ip_list.lock);
return err;
}
void sspt_page_on_each_ip(struct sspt_page *page,
- void (*func)(struct us_ip *, void *), void *data)
+ void (*func)(struct sspt_ip *, void *), void *data)
{
- struct us_ip *ip;
+ struct sspt_ip *ip;
- spin_lock(&page->lock);
- list_for_each_entry(ip, &page->ip_list_inst, list)
+ spin_lock(&page->ip_list.lock);
+ list_for_each_entry(ip, &page->ip_list.inst, list)
func(ip, data);
- spin_unlock(&page->lock);
+ spin_unlock(&page->ip_list.lock);
}
#include <linux/types.h>
#include <linux/spinlock.h>
-struct us_ip;
+struct sspt_ip;
struct sspt_file;
struct task_struct;
enum US_FLAGS;
* @breaf Image of page for specified process
*/
struct sspt_page {
- struct list_head ip_list_inst; /**< For installed ip */
- struct list_head ip_list_no_inst; /**< For don'tinstalled ip */
- unsigned long offset; /**< File offset */
- spinlock_t lock; /**< Lock page */
-
- struct sspt_file *file; /**< Ptr to the file(parent)=*/
+ /* sspt_file */
struct hlist_node hlist; /**< For sspt_file */
+ struct sspt_file *file; /**< Ptr to the file (parent) */
+
+ /* sspt_ip */
+ struct {
+ spinlock_t lock; /**< Lock page */
+ struct list_head inst; /**< For installed ip */
+ struct list_head not_inst; /**< For don'tinstalled ip */
+ } ip_list;
+
+ unsigned long offset; /**< File offset */
};
struct sspt_page *sspt_page_create(unsigned long offset);
void sspt_page_free(struct sspt_page *page);
-void sspt_add_ip(struct sspt_page *page, struct us_ip *ip);
-void sspt_del_ip(struct us_ip *ip);
+void sspt_add_ip(struct sspt_page *page, struct sspt_ip *ip);
+void sspt_del_ip(struct sspt_ip *ip);
int sspt_page_is_installed(struct sspt_page *page);
struct task_struct *task);
void sspt_page_on_each_ip(struct sspt_page *page,
- void (*func)(struct us_ip *, void *), void *data);
+ void (*func)(struct sspt_ip *, void *), void *data);
#endif /* __SSPT_PAGE__ */
proc->tgid = task->tgid;
proc->task = task->group_leader;
proc->sm = create_sm_us(task);
- INIT_LIST_HEAD(&proc->file_list);
+ INIT_LIST_HEAD(&proc->file_head);
rwlock_init(&proc->filter_lock);
INIT_LIST_HEAD(&proc->filter_list);
atomic_set(&proc->usage, 1);
sspt_proc_del_all_filters(proc);
- list_for_each_entry_safe(file, n, &proc->file_list, list) {
+ list_for_each_entry_safe(file, n, &proc->file_head, list) {
list_del(&file->list);
sspt_file_free(file);
}
static void sspt_proc_add_file(struct sspt_proc *proc, struct sspt_file *file)
{
- list_add(&file->list, &proc->file_list);
+ list_add(&file->list, &proc->file_head);
file->proc = proc;
}
{
struct sspt_file *file;
- list_for_each_entry(file, &proc->file_list, list) {
+ list_for_each_entry(file, &proc->file_head, list) {
if (dentry == file->dentry)
return file;
}
int err = 0;
struct sspt_file *file;
- list_for_each_entry_rcu(file, &proc->file_list, list) {
+ list_for_each_entry_rcu(file, &proc->file_head, list) {
err = sspt_file_uninstall(file, task, flag);
if (err != 0) {
printk(KERN_INFO "ERROR sspt_proc_uninstall: err=%d\n",
struct sspt_file *file, *n;
unsigned long end = start + len;
- list_for_each_entry_safe(file, n, &proc->file_list, list) {
+ list_for_each_entry_safe(file, n, &proc->file_head, list) {
if (intersection(file->vm_start, file->vm_end, start, end)) {
ret = 1;
list_move(&file->list, head);
*/
void sspt_proc_insert_files(struct sspt_proc *proc, struct list_head *head)
{
- list_splice(head, &proc->file_list);
+ list_splice(head, &proc->file_head);
}
/**
}
void sspt_proc_on_each_ip(struct sspt_proc *proc,
- void (*func)(struct us_ip *, void *), void *data)
+ void (*func)(struct sspt_ip *, void *), void *data)
{
struct sspt_file *file;
- list_for_each_entry(file, &proc->file_list, list)
+ list_for_each_entry(file, &proc->file_head, list)
sspt_file_on_each_ip(file, func, data);
}
struct task_struct;
struct pf_group;
struct sspt_filter;
-struct us_ip;
+struct sspt_ip;
/** Flags for sspt_*_uninstall() */
enum US_FLAGS {
*/
struct sspt_proc {
struct list_head list; /**< For global process list */
+
+ /* sspt_file */
+ struct list_head file_head; /**< For sspt_file */
+
pid_t tgid; /**< Thread group ID */
struct task_struct *task; /**< Ptr to the task */
struct mm_struct *__mm;
struct task_struct *__task;
- unsigned long r_state_addr; /**< address of r_state */
struct slot_manager *sm; /**< Ptr to the manager slot */
- struct list_head file_list; /**< For sspt_file */
+
rwlock_t filter_lock;
struct list_head filter_list; /**< Filter list */
+
unsigned first_install:1; /**< Install flag */
struct sspt_feature *feature; /**< Ptr to the feature */
atomic_t usage;
/* FIXME: for preload (remove those fields) */
+ unsigned long r_state_addr; /**< address of r_state */
void *private_data; /**< Process private data */
};
void *data);
void sspt_proc_on_each_ip(struct sspt_proc *proc,
- void (*func)(struct us_ip *, void *), void *data);
+ void (*func)(struct sspt_ip *, void *), void *data);
bool sspt_proc_is_send_event(struct sspt_proc *proc);
#include <us_manager/us_manager.h>
-#include <us_manager/sspt/ip.h>
+#include <us_manager/sspt/sspt_ip.h>
#include <us_manager/probes/register_probes.h>
#include <us_manager/sspt/sspt.h>
#include <uprobe/swap_uprobes.h>
{
}
-static struct uprobe *webprobe_get_uprobe(struct us_ip *ip)
+static struct uprobe *webprobe_get_uprobe(struct sspt_ip *ip)
{
return &ip->retprobe.up;
}
-static int webprobe_register_probe(struct us_ip *ip)
+static int webprobe_register_probe(struct sspt_ip *ip)
{
return swap_register_uretprobe(&ip->retprobe);
}
-static void webprobe_unregister_probe(struct us_ip *ip, int disarm)
+static void webprobe_unregister_probe(struct sspt_ip *ip, int disarm)
{
if (ip->orig_addr == inspserver_addr_local)
web_func_inst_remove(INSPSERVER_START);
struct pt_regs *regs)
{
struct uretprobe *rp = ri->rp;
- struct us_ip *ip;
+ struct sspt_ip *ip;
unsigned long vaddr, page_vaddr;
struct vm_area_struct *vma;
if (rp == NULL)
return 0;
- ip = container_of(rp, struct us_ip, retprobe);
+ ip = container_of(rp, struct sspt_ip, retprobe);
vaddr = (unsigned long)ip->orig_addr;
page_vaddr = vaddr & PAGE_MASK;
static int web_ret_handler(struct uretprobe_instance *ri, struct pt_regs *regs)
{
struct uretprobe *rp = ri->rp;
- struct us_ip *ip;
+ struct sspt_ip *ip;
unsigned long vaddr, page_vaddr;
struct vm_area_struct *vma;
if (rp == NULL)
return 0;
- ip = container_of(rp, struct us_ip, retprobe);
+ ip = container_of(rp, struct sspt_ip, retprobe);
vaddr = (unsigned long)ip->orig_addr;
page_vaddr = vaddr & PAGE_MASK;
return 0;
}
-static void webprobe_init(struct us_ip *ip)
+static void webprobe_init(struct sspt_ip *ip)
{
ip->retprobe.entry_handler = web_entry_handler;
ip->retprobe.handler = web_ret_handler;
ip->retprobe.maxactive = 0;
}
-static void webprobe_uninit(struct us_ip *ip)
+static void webprobe_uninit(struct sspt_ip *ip)
{
webprobe_cleanup(&ip->desc->info);
}