dazuko_rsbac.c File Reference

#include "dazuko_rsbac.h"
#include "dazuko_xp.h"
#include "dazukoio.h"
#include <linux/init.h>
#include <linux/unistd.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/random.h>
#include <linux/string.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/version.h>
#include <asm/uaccess.h>
#include <rsbac/types.h>
#include <rsbac/aci.h>
#include <rsbac/adf.h>
#include <rsbac/adf_main.h>
#include <rsbac/debug.h>
#include <rsbac/error.h>
#include <rsbac/helpers.h>
#include <rsbac/getname.h>
#include <rsbac/net_getname.h>
#include <rsbac/rkmem.h>
#include <rsbac/proc_fs.h>

Go to the source code of this file.

Functions

ssize_t linux_dazuko_device_read (struct file *file, char *buffer, size_t length, loff_t *pos)
ssize_t linux_dazuko_device_write (struct file *file, const char *buffer, size_t length, loff_t *pos)
int linux_dazuko_device_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long param)
int linux_dazuko_device_open (struct inode *inode, struct file *file)
int linux_dazuko_device_release (struct inode *inode, struct file *file)
static int reset_scanned (struct rsbac_fs_file_t file)
int xp_init_mutex (struct xp_mutex *mutex)
int xp_down (struct xp_mutex *mutex)
int xp_up (struct xp_mutex *mutex)
int xp_destroy_mutex (struct xp_mutex *mutex)
int xp_init_rwlock (struct xp_rwlock *rwlock)
int xp_write_lock (struct xp_rwlock *rwlock)
int xp_write_unlock (struct xp_rwlock *rwlock)
int xp_read_lock (struct xp_rwlock *rlock)
int xp_read_unlock (struct xp_rwlock *rlock)
int xp_destroy_rwlock (struct xp_rwlock *rwlock)
int xp_init_queue (struct xp_queue *queue)
int xp_wait_until_condition (struct xp_queue *queue, int(*cfunction)(void *), void *cparam, int allow_interrupt)
int xp_notify (struct xp_queue *queue)
int xp_destroy_queue (struct xp_queue *queue)
void * xp_malloc (size_t size)
int xp_free (void *ptr)
int xp_copyin (const void *user_src, void *kernel_dest, size_t size)
int xp_copyout (const void *kernel_src, void *user_dest, size_t size)
int xp_verify_user_writable (const void *user_ptr, size_t size)
int xp_verify_user_readable (const void *user_ptr, size_t size)
int xp_is_absolute_path (const char *path)
int xp_atomic_set (struct xp_atomic *atomic, int value)
int xp_atomic_inc (struct xp_atomic *atomic)
int xp_atomic_dec (struct xp_atomic *atomic)
int xp_atomic_read (struct xp_atomic *atomic)
int xp_copy_file (struct xp_file *dest, struct xp_file *src)
int xp_compare_file (struct xp_file *file1, struct xp_file *file2)
int xp_fill_file_struct (struct dazuko_file_struct *dfs)
static int dazuko_file_struct_cleanup (struct dazuko_file_struct **dfs)
int xp_id_compare (struct xp_daemon_id *id1, struct xp_daemon_id *id2)
int xp_id_free (struct xp_daemon_id *id)
xp_daemon_idxp_id_copy (struct xp_daemon_id *id)
int xp_sys_hook ()
int xp_sys_unhook ()
int xp_print (const char *fmt,...)
int __init rsbac_init_daz (void)
enum rsbac_adf_req_ret_t rsbac_adf_request_daz (enum rsbac_adf_request_t request, rsbac_pid_t caller_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)
int rsbac_adf_set_attr_daz (enum rsbac_adf_request_t request, rsbac_pid_t caller_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)

Variables

xp_atomic active
static int dev_major = -1
static struct file_operations fops


Function Documentation

static int dazuko_file_struct_cleanup struct dazuko_file_struct **  dfs  )  [static]
 

Definition at line 393 of file dazuko_rsbac.c.

References NULL, and xp_free().

int linux_dazuko_device_ioctl struct inode *  inode,
struct file *  file,
unsigned int  cmd,
unsigned long  param
 

int linux_dazuko_device_open struct inode *  inode,
struct file *  file
 

ssize_t linux_dazuko_device_read struct file *  file,
char *  buffer,
size_t  length,
loff_t *  pos
 

int linux_dazuko_device_release struct inode *  inode,
struct file *  file
 

ssize_t linux_dazuko_device_write struct file *  file,
const char *  buffer,
size_t  length,
loff_t *  pos
 

static int reset_scanned struct rsbac_fs_file_t  file  )  [inline, static]
 

Definition at line 127 of file dazuko_rsbac.c.

enum rsbac_adf_req_ret_t rsbac_adf_request_daz enum rsbac_adf_request_t  request,
rsbac_pid_t  caller_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
 

Definition at line 714 of file dazuko_rsbac.c.

References A_daz_role, A_daz_scanned, A_daz_scanner, A_none, A_system_role, D_char, DAZ, DAZ_clean, DAZ_infected, rsbac_attribute_value_t::daz_scanned, rsbac_attribute_value_t::daz_scanner, dazuko_bzero(), dazuko_file_struct_cleanup(), DAZUKO_ON_CLOSE, DAZUKO_ON_EXEC, DAZUKO_ON_OPEN, DAZUKO_ON_RMDIR, DAZUKO_ON_UNLINK, dazuko_sys_check(), dazuko_sys_pre(), DO_NOT_CARE, xp_daemon_id::file, FREEZE, GRANTED, NOT_GRANTED, NULL, xp_daemon_id::pid, rsbac_target_id_t::process, R_APPEND_OPEN, R_CLOSE, R_DELETE, R_EXECUTE, R_MODIFY_ATTRIBUTE, R_READ_ATTRIBUTE, R_READ_OPEN, R_READ_WRITE_OPEN, R_SWITCH_MODULE, R_WRITE_OPEN, RSBAC_EREADFAILED, rsbac_get_attr, rsbac_set_attr, SOFTMODE, SR_security_officer, rsbac_attribute_value_t::system_role, T_DEV, T_DIR, T_FILE, T_NONE, T_PROCESS, T_USER, TRUE, UNDEFINED, rsbac_target_id_t::user, xp_free(), and xp_malloc().

int rsbac_adf_set_attr_daz enum rsbac_adf_request_t  request,
rsbac_pid_t  caller_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
 

Definition at line 1061 of file dazuko_rsbac.c.

References A_daz_scanned, A_daz_scanner, DAZ, DAZ_clean, rsbac_attribute_value_t::daz_scanned, rsbac_attribute_value_t::daz_scanner, dazuko_bzero(), dazuko_file_struct_cleanup(), DAZUKO_ON_CLOSE, DAZUKO_ON_EXEC, DAZUKO_ON_OPEN, DAZUKO_ON_RMDIR, DAZUKO_ON_UNLINK, dazuko_sys_check(), dazuko_sys_post(), FALSE, xp_daemon_id::file, NULL, xp_daemon_id::pid, rsbac_target_id_t::process, R_APPEND_OPEN, R_CLONE, R_CLOSE, R_DELETE, R_EXECUTE, R_READ_OPEN, R_READ_WRITE_OPEN, R_WRITE_OPEN, reset_scanned(), RSBAC_EREADFAILED, RSBAC_EWRITEFAILED, rsbac_get_attr, rsbac_set_attr, T_DIR, T_FILE, T_PROCESS, TRUE, xp_free(), and xp_malloc().

int __init rsbac_init_daz void   ) 
 

Definition at line 685 of file dazuko_rsbac.c.

References dazuko_init(), RSBAC_EREINIT, and rsbac_is_initialized().

int xp_atomic_dec struct xp_atomic atomic  )  [inline]
 

Definition at line 302 of file dazuko_rsbac.c.

References xp_atomic::atomic.

int xp_atomic_inc struct xp_atomic atomic  )  [inline]
 

Definition at line 289 of file dazuko_rsbac.c.

References xp_atomic::atomic.

int xp_atomic_read struct xp_atomic atomic  )  [inline]
 

Definition at line 315 of file dazuko_rsbac.c.

References xp_atomic::atomic.

int xp_atomic_set struct xp_atomic atomic,
int  value
[inline]
 

Definition at line 283 of file dazuko_rsbac.c.

References xp_atomic::atomic.

int xp_compare_file struct xp_file file1,
struct xp_file file2
[inline]
 

Definition at line 328 of file dazuko_rsbac.c.

int xp_copy_file struct xp_file dest,
struct xp_file src
[inline]
 

Definition at line 323 of file dazuko_rsbac.c.

int xp_copyin const void *  user_src,
void *  kernel_dest,
size_t  size
[inline]
 

Definition at line 252 of file dazuko_rsbac.c.

int xp_copyout const void *  kernel_src,
void *  user_dest,
size_t  size
[inline]
 

Definition at line 257 of file dazuko_rsbac.c.

int xp_destroy_mutex struct xp_mutex mutex  )  [inline]
 

Definition at line 159 of file dazuko_rsbac.c.

int xp_destroy_queue struct xp_queue queue  )  [inline]
 

Definition at line 233 of file dazuko_rsbac.c.

int xp_destroy_rwlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 197 of file dazuko_rsbac.c.

int xp_down struct xp_mutex mutex  )  [inline]
 

Definition at line 147 of file dazuko_rsbac.c.

References xp_mutex::mutex.

int xp_fill_file_struct struct dazuko_file_struct dfs  )  [inline]
 

Definition at line 333 of file dazuko_rsbac.c.

References dazuko_get_filename_length(), xp_file_struct::dentry, file_properties::device_type, dazuko_file_struct::extra_data, dazuko_file_struct::file_p, dazuko_file_struct::filename, dazuko_file_struct::filename_length, xp_file_struct::free_full_filename, xp_file_struct::full_filename, xp_file_struct::full_filename_length, file_properties::gid, file_properties::mode, NULL, rsbac_get_full_path(), rsbac_get_full_path_length(), file_properties::set_device_type, file_properties::set_gid, file_properties::set_mode, file_properties::set_size, file_properties::set_uid, file_properties::size, file_properties::uid, and xp_malloc().

int xp_free void *  ptr  )  [inline]
 

Definition at line 246 of file dazuko_rsbac.c.

int xp_id_compare struct xp_daemon_id id1,
struct xp_daemon_id id2
 

Definition at line 419 of file dazuko_rsbac.c.

References xp_daemon_id::file, NULL, and xp_daemon_id::pid.

struct xp_daemon_id* xp_id_copy struct xp_daemon_id id  ) 
 

Definition at line 442 of file dazuko_rsbac.c.

References xp_daemon_id::file, NULL, xp_daemon_id::pid, and xp_malloc().

int xp_id_free struct xp_daemon_id id  ) 
 

Definition at line 435 of file dazuko_rsbac.c.

References xp_free().

int xp_init_mutex struct xp_mutex mutex  )  [inline]
 

Definition at line 136 of file dazuko_rsbac.c.

References xp_mutex::mutex.

int xp_init_queue struct xp_queue queue  )  [inline]
 

Definition at line 205 of file dazuko_rsbac.c.

References xp_queue::queue.

int xp_init_rwlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 167 of file dazuko_rsbac.c.

References xp_rwlock::rwlock.

int xp_is_absolute_path const char *  path  )  [inline]
 

Definition at line 275 of file dazuko_rsbac.c.

void* xp_malloc size_t  size  )  [inline]
 

Definition at line 241 of file dazuko_rsbac.c.

References rsbac_kmalloc().

int xp_notify struct xp_queue queue  )  [inline]
 

Definition at line 227 of file dazuko_rsbac.c.

References xp_queue::queue.

int xp_print const char *  fmt,
  ...
 

Definition at line 522 of file dazuko_rsbac.c.

References dazuko_vsnprintf(), xp_free(), and xp_malloc().

int xp_read_lock struct xp_rwlock rlock  )  [inline]
 

Definition at line 185 of file dazuko_rsbac.c.

References xp_rwlock::rwlock.

int xp_read_unlock struct xp_rwlock rlock  )  [inline]
 

Definition at line 191 of file dazuko_rsbac.c.

References xp_rwlock::rwlock.

int xp_sys_hook void   )  [inline]
 

Definition at line 463 of file dazuko_rsbac.c.

References dev_major, DEVICE_NAME, fops, NULL, and xp_print().

int xp_sys_unhook void   )  [inline]
 

Definition at line 493 of file dazuko_rsbac.c.

References dev_major, DEVICE_NAME, NULL, and xp_print().

int xp_up struct xp_mutex mutex  )  [inline]
 

Definition at line 153 of file dazuko_rsbac.c.

References xp_mutex::mutex.

int xp_verify_user_readable const void *  user_ptr,
size_t  size
[inline]
 

Definition at line 267 of file dazuko_rsbac.c.

int xp_verify_user_writable const void *  user_ptr,
size_t  size
[inline]
 

Definition at line 262 of file dazuko_rsbac.c.

int xp_wait_until_condition struct xp_queue queue,
int(*)(void *)  cfunction,
void *  cparam,
int  allow_interrupt
[inline]
 

Definition at line 211 of file dazuko_rsbac.c.

References xp_queue::queue.

int xp_write_lock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 173 of file dazuko_rsbac.c.

References xp_rwlock::rwlock.

int xp_write_unlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 179 of file dazuko_rsbac.c.

References xp_rwlock::rwlock.


Variable Documentation

struct xp_atomic active
 

int dev_major = -1 [static]
 

Definition at line 81 of file dazuko_rsbac.c.

struct file_operations fops [static]
 

Initial value:

Definition at line 83 of file dazuko_rsbac.c.


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