reg_sample2.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/aci_data_structures.h>
#include <rsbac/getname.h>
#include <rsbac/error.h>
#include <rsbac/proc_fs.h>

Go to the source code of this file.

Defines

#define FILENAME   "regsmp2"
#define FILE_VERSION   1

Functions

 MODULE_AUTHOR ("Amon Ott")
 MODULE_DESCRIPTION ("RSBAC REG sample decision module 2")
 MODULE_PARM (name,"s")
 MODULE_PARM (syscall_name,"s")
 MODULE_PARM (handle,"l")
 MODULE_PARM (syscall_registration_handle,"l")
 MODULE_PARM (syscall_dispatcher_handle,"l")
static int read_info (void)
static int write_info (void)
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 rsbac_boolean_t no_write = FALSE
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 long handle = 123457
static long syscall_registration_handle = 754321
static long syscall_dispatcher_handle = 2


Define Documentation

#define FILE_VERSION   1
 

Definition at line 61 of file reg_sample2.c.

Referenced by read_info(), and write_info().

#define FILENAME   "regsmp2"
 

Definition at line 58 of file reg_sample2.c.

Referenced by init_module(), read_info(), and write_info().


Function Documentation

void cleanup_module void   ) 
 

Definition at line 544 of file reg_sample2.c.

References handle, proc_rsbac_root_p, rsbac_reg_unregister(), rsbac_reg_unregister_syscall(), syscall_registration_handle, and write_info().

int init_module void   ) 
 

Definition at line 440 of file reg_sample2.c.

References dummy_buf, dummy_buf2, handle, name, need_overwrite_func(), proc_rsbac_root_p, read_info(), request_func(), 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, and write_func().

MODULE_AUTHOR "Amon Ott"   ) 
 

MODULE_DESCRIPTION "RSBAC REG sample decision module 2"   ) 
 

MODULE_PARM syscall_dispatcher_handle  ,
"l" 
 

MODULE_PARM syscall_registration_handle  ,
"l" 
 

MODULE_PARM handle  ,
"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 409 of file reg_sample2.c.

References FALSE, and nr_need_overwrite_calls.

static int read_info void   )  [static]
 

Definition at line 170 of file reg_sample2.c.

References FILE_VERSION, FILENAME, name, no_write, nr_need_overwrite_calls, nr_request_calls, nr_set_attr_calls, RSBAC_EREADFAILED, RSBAC_MAXNAMELEN, rsbac_read_close(), rsbac_read_open(), rsbac_root_dev, and TRUE.

Referenced by init_module().

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 379 of file reg_sample2.c.

References GRANTED, nr_request_calls, and R_SEARCH.

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 393 of file reg_sample2.c.

References nr_set_attr_calls, and R_SEARCH.

static int syscall_func void *  arg  )  [static]
 

Definition at line 431 of file reg_sample2.c.

References nr_system_calls, and system_call_arg.

static int write_func rsbac_boolean_t  need_lock  )  [static]
 

Definition at line 415 of file reg_sample2.c.

References write_info().

Referenced by init_module().

static int write_info void   )  [static]
 

Definition at line 279 of file reg_sample2.c.

References FILE_VERSION, FILENAME, name, nr_need_overwrite_calls, nr_request_calls, nr_set_attr_calls, RSBAC_EWRITEFAILED, RSBAC_MAXNAMELEN, rsbac_root_dev, rsbac_write_close(), rsbac_write_open(), and rsbac_write_sem.

Referenced by cleanup_module(), and write_func().


Variable Documentation

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

Definition at line 43 of file reg_sample2.c.

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

Definition at line 47 of file reg_sample2.c.

long handle = 123457 [static]
 

Definition at line 50 of file reg_sample2.c.

char* name = NULL [static]
 

Definition at line 42 of file reg_sample2.c.

rsbac_boolean_t no_write = FALSE [static]
 

Definition at line 34 of file reg_sample2.c.

Referenced by read_info().

u_long nr_need_overwrite_calls = 0 [static]
 

Definition at line 33 of file reg_sample2.c.

u_long nr_request_calls = 0 [static]
 

Definition at line 31 of file reg_sample2.c.

u_long nr_set_attr_calls = 0 [static]
 

Definition at line 32 of file reg_sample2.c.

u_long nr_system_calls = 0 [static]
 

Definition at line 35 of file reg_sample2.c.

long syscall_dispatcher_handle = 2 [static]
 

Definition at line 55 of file reg_sample2.c.

char* syscall_name = NULL [static]
 

Definition at line 46 of file reg_sample2.c.

long syscall_registration_handle = 754321 [static]
 

Definition at line 53 of file reg_sample2.c.

void* system_call_arg = 0 [static]
 

Definition at line 36 of file reg_sample2.c.


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