Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
kprobes.c File Reference
#include <linux/kprobes.h>
#include <linux/ptrace.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/hardirq.h>
#include <linux/preempt.h>
#include <linux/module.h>
#include <linux/kdebug.h>
#include <linux/kallsyms.h>
#include <linux/ftrace.h>
#include <asm/cacheflush.h>
#include <asm/desc.h>
#include <asm/pgtable.h>
#include <asm/uaccess.h>
#include <asm/alternative.h>
#include <asm/insn.h>
#include <asm/debugreg.h>
#include "kprobes-common.h"

Go to the source code of this file.

Macros

#define stack_addr(regs)   ((unsigned long *)kernel_stack_pointer(regs))
 
#define W(row, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf)
 

Functions

void jprobe_return_end (void)
 
 DEFINE_PER_CPU (struct kprobe *, current_kprobe)
 
 DEFINE_PER_CPU (struct kprobe_ctlblk, kprobe_ctlblk)
 
void __kprobes synthesize_reljump (void *from, void *to)
 
void __kprobes synthesize_relcall (void *from, void *to)
 
int __kprobes can_boost (kprobe_opcode_t *opcodes)
 
unsigned long recover_probed_instruction (kprobe_opcode_t *buf, unsigned long addr)
 
int __kprobes __copy_instruction (u8 *dest, u8 *src)
 
int __kprobes arch_prepare_kprobe (struct kprobe *p)
 
void __kprobes arch_arm_kprobe (struct kprobe *p)
 
void __kprobes arch_disarm_kprobe (struct kprobe *p)
 
void __kprobes arch_remove_kprobe (struct kprobe *p)
 
void __kprobes arch_prepare_kretprobe (struct kretprobe_instance *ri, struct pt_regs *regs)
 
int __kprobes kprobe_fault_handler (struct pt_regs *regs, int trapnr)
 
int __kprobes kprobe_exceptions_notify (struct notifier_block *self, unsigned long val, void *data)
 
int __kprobes setjmp_pre_handler (struct kprobe *p, struct pt_regs *regs)
 
void __kprobes jprobe_return (void)
 
int __kprobes longjmp_break_handler (struct kprobe *p, struct pt_regs *regs)
 
int __init arch_init_kprobes (void)
 
int __kprobes arch_trampoline_kprobe (struct kprobe *p)
 

Variables

struct kretprobe_blackpoint kretprobe_blacklist []
 
const int kretprobe_blacklist_size = ARRAY_SIZE(kretprobe_blacklist)
 

Macro Definition Documentation

#define stack_addr (   regs)    ((unsigned long *)kernel_stack_pointer(regs))

Definition at line 68 of file kprobes.c.

#define W (   row,
  b0,
  b1,
  b2,
  b3,
  b4,
  b5,
  b6,
  b7,
  b8,
  b9,
  ba,
  bb,
  bc,
  bd,
  be,
  bf 
)
Value:
(((b0##UL << 0x0)|(b1##UL << 0x1)|(b2##UL << 0x2)|(b3##UL << 0x3) | \
(b4##UL << 0x4)|(b5##UL << 0x5)|(b6##UL << 0x6)|(b7##UL << 0x7) | \
(b8##UL << 0x8)|(b9##UL << 0x9)|(ba##UL << 0xa)|(bb##UL << 0xb) | \
(bc##UL << 0xc)|(bd##UL << 0xd)|(be##UL << 0xe)|(bf##UL << 0xf)) \
<< (row % 32))

Definition at line 70 of file kprobes.c.

Function Documentation

int __kprobes __copy_instruction ( u8 dest,
u8 src 
)

Definition at line 325 of file kprobes.c.

void __kprobes arch_arm_kprobe ( struct kprobe p)

Definition at line 397 of file kprobes.c.

void __kprobes arch_disarm_kprobe ( struct kprobe p)

Definition at line 402 of file kprobes.c.

int __init arch_init_kprobes ( void  )

Definition at line 1122 of file kprobes.c.

int __kprobes arch_prepare_kprobe ( struct kprobe p)

Definition at line 382 of file kprobes.c.

void __kprobes arch_prepare_kretprobe ( struct kretprobe_instance ri,
struct pt_regs regs 
)

Definition at line 462 of file kprobes.c.

void __kprobes arch_remove_kprobe ( struct kprobe p)

Definition at line 407 of file kprobes.c.

int __kprobes arch_trampoline_kprobe ( struct kprobe p)

Definition at line 1127 of file kprobes.c.

int __kprobes can_boost ( kprobe_opcode_t opcodes)

Definition at line 162 of file kprobes.c.

DEFINE_PER_CPU ( struct kprobe ,
current_kprobe   
)
DEFINE_PER_CPU ( struct kprobe_ctlblk  ,
kprobe_ctlblk   
)
void __kprobes jprobe_return ( void  )

Definition at line 1032 of file kprobes.c.

void jprobe_return_end ( void  )
int __kprobes kprobe_exceptions_notify ( struct notifier_block self,
unsigned long  val,
void data 
)

Definition at line 968 of file kprobes.c.

int __kprobes kprobe_fault_handler ( struct pt_regs regs,
int  trapnr 
)

Definition at line 904 of file kprobes.c.

int __kprobes longjmp_break_handler ( struct kprobe p,
struct pt_regs regs 
)

Definition at line 1049 of file kprobes.c.

unsigned long recover_probed_instruction ( kprobe_opcode_t buf,
unsigned long  addr 
)

Definition at line 251 of file kprobes.c.

int __kprobes setjmp_pre_handler ( struct kprobe p,
struct pt_regs regs 
)

Definition at line 1007 of file kprobes.c.

void __kprobes synthesize_relcall ( void from,
void to 
)

Definition at line 134 of file kprobes.c.

void __kprobes synthesize_reljump ( void from,
void to 
)

Definition at line 128 of file kprobes.c.

Variable Documentation

struct kretprobe_blackpoint kretprobe_blacklist[]
Initial value:
= {
{"__switch_to", },
{NULL, NULL}
}

Definition at line 107 of file kprobes.c.

const int kretprobe_blacklist_size = ARRAY_SIZE(kretprobe_blacklist)

Definition at line 113 of file kprobes.c.