reg_sample3.c File Reference

#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/sched.h>
#include <linux/smp.h>
#include <linux/smp_lock.h>
#include <linux/fs.h>
#include <asm/uaccess.h>
#include <rsbac/types.h>
#include <rsbac/reg.h>
#include <rsbac/adf.h>
#include <rsbac/aci.h>
#include <rsbac/lists.h>
#include <rsbac/getname.h>
#include <rsbac/error.h>
#include <rsbac/proc_fs.h>

Go to the source code of this file.

Defines

#define ORD_request   1
#define ORD_set_attr   2
#define ORD_overwrite   3
#define ORD_write   4
#define ORD_syscall   5
#define FILENAME   "regsmp3"
#define LIST_VERSION   1

Functions

 MODULE_AUTHOR ("Amon Ott")
 MODULE_DESCRIPTION ("RSBAC REG sample decision module 3")
 MODULE_LICENSE ("GPL")
 MODULE_PARM (name,"s")
 MODULE_PARM (syscall_name,"s")
 MODULE_PARM (listkey,"l")
 MODULE_PARM (handle,"l")
 MODULE_PARM (syscall_registration_handle,"l")
 MODULE_PARM (syscall_dispatcher_handle,"l")
static int compare (void *desc1, void *desc2)
static int request_func (enum rsbac_adf_request_t request, rsbac_pid_t owner_pid, enum rsbac_target_t target, union rsbac_target_id_t tid, enum rsbac_attribute_t attr, union rsbac_attribute_value_t attr_val, rsbac_uid_t owner)
static int set_attr_func (enum rsbac_adf_request_t request, rsbac_pid_t owner_pid, enum rsbac_target_t target, union rsbac_target_id_t tid, enum rsbac_target_t new_target, union rsbac_target_id_t new_tid, enum rsbac_attribute_t attr, union rsbac_attribute_value_t attr_val, rsbac_uid_t owner)
static rsbac_boolean_t need_overwrite_func (struct dentry *dentry_p)
static int write_func (rsbac_boolean_t need_lock)
static int syscall_func (void *arg)
int init_module (void)
void cleanup_module (void)

Variables

static u_long nr_request_calls = 0
static u_long nr_set_attr_calls = 0
static u_long nr_need_overwrite_calls = 0
static u_long nr_write_calls = 0
static u_long nr_system_calls = 0
static void * system_call_arg = 0
static char * name = NULL
static char dummy_buf [70] = "To protect against wrong insmod params"
static char * syscall_name = NULL
static char dummy_buf2 [70] = "To protect against wrong insmod params"
static u_int listkey = 133457
static long handle = 133457
static long syscall_registration_handle = 754331
static long syscall_dispatcher_handle = 3
static rsbac_list_handle_t list_handle


Define Documentation

#define FILENAME   "regsmp3"
 

Definition at line 66 of file reg_sample3.c.

#define LIST_VERSION   1
 

Definition at line 69 of file reg_sample3.c.

Referenced by init_module().

#define ORD_overwrite   3
 

Definition at line 35 of file reg_sample3.c.

Referenced by init_module(), and need_overwrite_func().

#define ORD_request   1
 

Definition at line 31 of file reg_sample3.c.

Referenced by init_module(), and request_func().

#define ORD_set_attr   2
 

Definition at line 33 of file reg_sample3.c.

Referenced by init_module(), and set_attr_func().

#define ORD_syscall   5
 

Definition at line 39 of file reg_sample3.c.

Referenced by init_module(), and syscall_func().

#define ORD_write   4
 

Definition at line 37 of file reg_sample3.c.

Referenced by init_module(), and write_func().


Function Documentation

void cleanup_module void   ) 
 

Definition at line 424 of file reg_sample3.c.

References handle, list_handle, listkey, proc_rsbac_root_p, rsbac_list_detach(), rsbac_reg_unregister(), rsbac_reg_unregister_syscall(), and syscall_registration_handle.

static int compare void *  desc1,
void *  desc2
[static]
 

Definition at line 193 of file reg_sample3.c.

Referenced by init_module(), lookup_lol_subitem_compare(), and lookup_lol_subitem_user_compare().

int init_module void   ) 
 

Definition at line 277 of file reg_sample3.c.

References compare(), rsbac_list_info_t::data_size, rsbac_list_info_t::desc_size, dummy_buf, dummy_buf2, FILENAME, handle, rsbac_list_info_t::key, list_handle, LIST_VERSION, listkey, rsbac_list_info_t::max_age, name, need_overwrite_func(), nr_need_overwrite_calls, nr_request_calls, nr_set_attr_calls, nr_system_calls, nr_write_calls, NULL, ORD_overwrite, ORD_request, ORD_set_attr, ORD_syscall, ORD_write, proc_rsbac_root_p, request_func(), RSBAC_LIST_BACKUP, rsbac_list_detach(), rsbac_list_exist(), rsbac_list_get_data(), RSBAC_LIST_PERSIST, rsbac_list_register(), RSBAC_LIST_VERSION, RSBAC_REG_NAME_LEN, rsbac_reg_register(), rsbac_reg_register_syscall(), rsbac_reg_unregister(), rsbac_reg_unregister_syscall(), RSBAC_REG_VERSION, set_attr_func(), syscall_dispatcher_handle, syscall_func(), syscall_name, syscall_registration_handle, TRUE, rsbac_list_info_t::version, and write_func().

MODULE_AUTHOR "Amon Ott"   ) 
 

MODULE_DESCRIPTION "RSBAC REG sample decision module 3"   ) 
 

MODULE_LICENSE "GPL"   ) 
 

MODULE_PARM syscall_dispatcher_handle  ,
"l" 
 

MODULE_PARM syscall_registration_handle  ,
"l" 
 

MODULE_PARM handle  ,
"l" 
 

MODULE_PARM listkey  ,
"l" 
 

MODULE_PARM syscall_name  ,
"s" 
 

MODULE_PARM name  ,
"s" 
 

static rsbac_boolean_t need_overwrite_func struct dentry *  dentry_p  )  [static]
 

Definition at line 247 of file reg_sample3.c.

References FALSE, list_handle, nr_need_overwrite_calls, ORD_overwrite, and rsbac_list_add().

static int request_func enum rsbac_adf_request_t  request,
rsbac_pid_t  owner_pid,
enum rsbac_target_t  target,
union rsbac_target_id_t  tid,
enum rsbac_attribute_t  attr,
union rsbac_attribute_value_t  attr_val,
rsbac_uid_t  owner
[static]
 

Definition at line 207 of file reg_sample3.c.

References GRANTED, list_handle, nr_request_calls, ORD_request, R_SEARCH, and rsbac_list_add().

static int set_attr_func enum rsbac_adf_request_t  request,
rsbac_pid_t  owner_pid,
enum rsbac_target_t  target,
union rsbac_target_id_t  tid,
enum rsbac_target_t  new_target,
union rsbac_target_id_t  new_tid,
enum rsbac_attribute_t  attr,
union rsbac_attribute_value_t  attr_val,
rsbac_uid_t  owner
[static]
 

Definition at line 226 of file reg_sample3.c.

References list_handle, nr_set_attr_calls, ORD_set_attr, R_SEARCH, and rsbac_list_add().

static int syscall_func void *  arg  )  [static]
 

Definition at line 265 of file reg_sample3.c.

References list_handle, nr_system_calls, ORD_syscall, rsbac_list_add(), and system_call_arg.

static int write_func rsbac_boolean_t  need_lock  )  [static]
 

Definition at line 256 of file reg_sample3.c.

References list_handle, nr_write_calls, ORD_write, and rsbac_list_add().


Variable Documentation

char dummy_buf[70] = "To protect against wrong insmod params" [static]
 

Definition at line 48 of file reg_sample3.c.

char dummy_buf2[70] = "To protect against wrong insmod params" [static]
 

Definition at line 52 of file reg_sample3.c.

long handle = 133457 [static]
 

Definition at line 58 of file reg_sample3.c.

rsbac_list_handle_t list_handle [static]
 

Definition at line 71 of file reg_sample3.c.

Referenced by cleanup_module(), init_module(), need_overwrite_func(), request_func(), set_attr_func(), syscall_func(), and write_func().

u_int listkey = 133457 [static]
 

Definition at line 55 of file reg_sample3.c.

Referenced by cleanup_module(), and init_module().

char* name = NULL [static]
 

Definition at line 47 of file reg_sample3.c.

u_long nr_need_overwrite_calls = 0 [static]
 

Definition at line 34 of file reg_sample3.c.

u_long nr_request_calls = 0 [static]
 

Definition at line 30 of file reg_sample3.c.

u_long nr_set_attr_calls = 0 [static]
 

Definition at line 32 of file reg_sample3.c.

u_long nr_system_calls = 0 [static]
 

Definition at line 38 of file reg_sample3.c.

u_long nr_write_calls = 0 [static]
 

Definition at line 36 of file reg_sample3.c.

Referenced by init_module(), and write_func().

long syscall_dispatcher_handle = 3 [static]
 

Definition at line 63 of file reg_sample3.c.

char* syscall_name = NULL [static]
 

Definition at line 51 of file reg_sample3.c.

long syscall_registration_handle = 754331 [static]
 

Definition at line 61 of file reg_sample3.c.

void* system_call_arg = 0 [static]
 

Definition at line 40 of file reg_sample3.c.


Generated on Fri Jun 17 09:45:30 2005 for RSBAC by  doxygen 1.4.2