/daten/src/linux-2.4.27-rsbac-v1.2.3/rsbac/adf/daz/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 <asm/uaccess.h>
#include <linux/random.h>
#include <rsbac/types.h>
#include <rsbac/reg.h>
#include <rsbac/adf.h>
#include <rsbac/aci.h>
#include <rsbac/getname.h>
#include <rsbac/error.h>
#include <rsbac/proc_fs.h>
#include <rsbac/debug.h>

Go to the source code of this file.

Defines

#define __wait_event_interruptible(wq, condition, ret)
#define wait_event_interruptible(wq, condition)
#define wait_event(wq, condition)
#define RSBAC_REG_REGISTER_RETRIES   1024

Functions

int linux_dazuko_device_read (struct file *file, char *buffer, size_t length, loff_t *pos)
int 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)
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_file_struct_check (struct dazuko_file_struct *dfs)
int xp_file_struct_check_cleanup (struct dazuko_file_struct *dfs)
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 dazuko_rsbac_process (enum rsbac_adf_request_t request, enum rsbac_target_t target, union rsbac_target_id_t tid, int is_pre)
int dazuko_rsbac_pre (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)
int dazuko_rsbac_post (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)
int xp_sys_hook ()
int xp_sys_unhook ()
int xp_print (const char *fmt,...)
int __init linux_dazuko_init (void)
void linux_dazuko_exit (void)
 module_init (linux_dazuko_init)
 module_exit (linux_dazuko_exit)

Variables

xp_atomic active
int dev_major = -1
rsbac_reg_handle_t handle = -1
file_operations fops


Define Documentation

#define __wait_event_interruptible wq,
condition,
ret   ) 
 

Value:

do { \ struct wait_queue __wait; \ \ __wait.task = current; \ add_wait_queue(&wq, &__wait); \ for (;;) { \ current->state = TASK_INTERRUPTIBLE; \ mb(); \ if (condition) \ break; \ if (!signal_pending(current)) { \ schedule(); \ continue; \ } \ ret = -ERESTARTSYS; \ break; \ } \ current->state = TASK_RUNNING; \ remove_wait_queue(&wq, &__wait); \ } while (0)
Definition at line 79 of file dazuko_rsbac.c.

#define RSBAC_REG_REGISTER_RETRIES   1024
 

Referenced by xp_sys_hook().

#define wait_event wq,
condition   ) 
 

Value:

({ \ int __ret = 0; \ if (!(condition)) \ __wait_event_interruptible(wq, condition, __ret);\ __ret; \ })
Definition at line 110 of file dazuko_rsbac.c.

Referenced by xp_wait_until_condition().

#define wait_event_interruptible wq,
condition   ) 
 

Value:

({ \ int __ret = 0; \ if (!(condition)) \ __wait_event_interruptible(wq, condition, __ret);\ __ret; \ })
Definition at line 103 of file dazuko_rsbac.c.

Referenced by xp_wait_until_condition().


Function Documentation

int dazuko_file_struct_cleanup struct dazuko_file_struct **  dfs  )  [static]
 

Definition at line 403 of file dazuko_rsbac.c.

References NULL, xp_file_struct_check_cleanup(), and xp_free().

Referenced by dazuko_rsbac_process(), rsbac_adf_request_daz(), and rsbac_adf_set_attr_daz().

int dazuko_rsbac_post 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 623 of file dazuko_rsbac.c.

References dazuko_rsbac_process(), rsbac_pid_t, and rsbac_uid_t.

Referenced by xp_sys_hook().

int dazuko_rsbac_pre 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
[inline, static]
 

Definition at line 611 of file dazuko_rsbac.c.

References dazuko_rsbac_process(), rsbac_pid_t, and rsbac_uid_t.

Referenced by xp_sys_hook().

int dazuko_rsbac_process enum rsbac_adf_request_t  request,
enum rsbac_target_t  target,
union rsbac_target_id_t  tid,
int  is_pre
[inline, static]
 

Definition at line 475 of file dazuko_rsbac.c.

References 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(), dazuko_sys_pre(), DO_NOT_CARE, xp_daemon_id::file, GRANTED, NOT_GRANTED, NULL, xp_daemon_id::pid, R_APPEND_OPEN, R_CLOSE, R_DELETE, R_EXECUTE, R_READ_OPEN, R_READ_WRITE_OPEN, R_WRITE_OPEN, T_DIR, T_FILE, xp_free(), and xp_malloc().

Referenced by dazuko_rsbac_post(), and dazuko_rsbac_pre().

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_read struct file *  file,
char *  buffer,
size_t  length,
loff_t *  pos
 

int linux_dazuko_device_release struct inode *  inode,
struct file *  file
 

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

void linux_dazuko_exit void   ) 
 

Definition at line 922 of file dazuko_rsbac.c.

References dazuko_exit().

int __init linux_dazuko_init void   ) 
 

Definition at line 914 of file dazuko_rsbac.c.

References dazuko_init().

module_exit linux_dazuko_exit   ) 
 

module_init linux_dazuko_init   ) 
 

int xp_atomic_dec struct xp_atomic atomic  )  [inline]
 

Definition at line 307 of file dazuko_rsbac.c.

References active, and xp_atomic::atomic.

Referenced by call_xp_atomic_dec().

int xp_atomic_inc struct xp_atomic atomic  )  [inline]
 

Definition at line 294 of file dazuko_rsbac.c.

References active, and xp_atomic::atomic.

Referenced by call_xp_atomic_inc().

int xp_atomic_read struct xp_atomic atomic  )  [inline]
 

Definition at line 320 of file dazuko_rsbac.c.

References xp_atomic::atomic.

Referenced by call_xp_atomic_read().

int xp_atomic_set struct xp_atomic atomic,
int  value
[inline]
 

Definition at line 288 of file dazuko_rsbac.c.

References xp_atomic::atomic.

Referenced by call_xp_atomic_set().

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

Definition at line 333 of file dazuko_rsbac.c.

Referenced by call_xp_compare_file().

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

Definition at line 328 of file dazuko_rsbac.c.

Referenced by call_xp_copy_file().

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

Definition at line 249 of file dazuko_rsbac.c.

Referenced by call_xp_copyin(), and linux_dazuko_device_write().

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

Definition at line 254 of file dazuko_rsbac.c.

Referenced by call_xp_copyout(), and linux_dazuko_device_read().

int xp_destroy_mutex struct xp_mutex mutex  )  [inline]
 

Definition at line 147 of file dazuko_rsbac.c.

Referenced by call_xp_destroy_mutex().

int xp_destroy_queue struct xp_queue queue  )  [inline]
 

Definition at line 230 of file dazuko_rsbac.c.

Referenced by call_xp_destroy_queue().

int xp_destroy_rwlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 189 of file dazuko_rsbac.c.

Referenced by call_xp_destroy_rwlock().

int xp_down struct xp_mutex mutex  )  [inline]
 

Definition at line 135 of file dazuko_rsbac.c.

References xp_mutex::mutex.

Referenced by call_xp_down().

int xp_file_struct_check struct dazuko_file_struct dfs  )  [inline]
 

Definition at line 338 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().

Referenced by call_xp_file_struct_check().

int xp_file_struct_check_cleanup struct dazuko_file_struct dfs  ) 
 

Definition at line 398 of file dazuko_rsbac.c.

Referenced by call_xp_file_struct_check_cleanup(), and dazuko_file_struct_cleanup().

int xp_free void *  ptr  )  [inline]
 

Definition at line 243 of file dazuko_rsbac.c.

Referenced by call_xp_free(), dazuko_file_struct_cleanup(), dazuko_rsbac_process(), linux_dazuko_device_write(), rsbac_adf_request_daz(), rsbac_adf_set_attr_daz(), xp_id_free(), and xp_print().

int xp_id_compare struct xp_daemon_id id1,
struct xp_daemon_id id2
 

Definition at line 431 of file dazuko_rsbac.c.

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

Referenced by call_xp_id_compare().

struct xp_daemon_id* xp_id_copy struct xp_daemon_id id  ) 
 

Definition at line 454 of file dazuko_rsbac.c.

References NULL, and xp_malloc().

Referenced by call_xp_id_copy().

int xp_id_free struct xp_daemon_id id  ) 
 

Definition at line 447 of file dazuko_rsbac.c.

References xp_free().

Referenced by call_xp_id_free().

int xp_init_mutex struct xp_mutex mutex  )  [inline]
 

Definition at line 124 of file dazuko_rsbac.c.

References xp_mutex::mutex.

Referenced by call_xp_init_mutex().

int xp_init_queue struct xp_queue queue  )  [inline]
 

Definition at line 197 of file dazuko_rsbac.c.

References NULL, and xp_queue::queue.

Referenced by call_xp_init_queue().

int xp_init_rwlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 155 of file dazuko_rsbac.c.

References xp_rwlock::rwlock.

Referenced by call_xp_init_rwlock().

int xp_is_absolute_path const char *  path  )  [inline]
 

Definition at line 280 of file dazuko_rsbac.c.

Referenced by call_xp_is_absolute_path().

void* xp_malloc size_t  size  )  [inline]
 

Definition at line 238 of file dazuko_rsbac.c.

Referenced by call_xp_malloc(), dazuko_rsbac_process(), rsbac_adf_request_daz(), rsbac_adf_set_attr_daz(), xp_file_struct_check(), xp_id_copy(), and xp_print().

int xp_notify struct xp_queue queue  )  [inline]
 

Definition at line 224 of file dazuko_rsbac.c.

References xp_queue::queue.

Referenced by call_xp_notify().

int xp_print const char *  fmt,
  ...
 

Definition at line 732 of file dazuko_rsbac.c.

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

Referenced by call_xp_atomic_dec(), call_xp_atomic_inc(), call_xp_atomic_read(), call_xp_atomic_set(), call_xp_compare_file(), call_xp_copy_file(), call_xp_copyin(), call_xp_copyout(), call_xp_destroy_mutex(), call_xp_destroy_queue(), call_xp_destroy_rwlock(), call_xp_down(), call_xp_file_struct_check(), call_xp_file_struct_check_cleanup(), call_xp_free(), call_xp_id_compare(), call_xp_id_copy(), call_xp_id_free(), call_xp_init_mutex(), call_xp_init_queue(), call_xp_init_rwlock(), call_xp_is_absolute_path(), call_xp_malloc(), call_xp_notify(), call_xp_read_lock(), call_xp_read_unlock(), call_xp_up(), call_xp_verify_user_readable(), call_xp_verify_user_writable(), call_xp_wait_until_condition(), call_xp_write_lock(), call_xp_write_unlock(), linux_dazuko_device_ioctl(), linux_dazuko_device_read(), linux_dazuko_device_write(), xp_sys_hook(), and xp_sys_unhook().

int xp_read_lock struct xp_rwlock rlock  )  [inline]
 

Definition at line 177 of file dazuko_rsbac.c.

References xp_rwlock::rwlock.

Referenced by call_xp_read_lock().

int xp_read_unlock struct xp_rwlock rlock  )  [inline]
 

Definition at line 183 of file dazuko_rsbac.c.

References xp_rwlock::rwlock.

Referenced by call_xp_read_unlock().

int xp_sys_hook void   )  [inline]
 

Definition at line 639 of file dazuko_rsbac.c.

References dazuko_rsbac_post(), dazuko_rsbac_pre(), dev_major, DEVICE_NAME, fops, handle, NULL, RSBAC_EEXISTS, rsbac_reg_register(), RSBAC_REG_REGISTER_RETRIES, RSBAC_REG_VERSION, TRUE, and xp_print().

int xp_sys_unhook void   )  [inline]
 

Definition at line 704 of file dazuko_rsbac.c.

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

int xp_up struct xp_mutex mutex  )  [inline]
 

Definition at line 141 of file dazuko_rsbac.c.

References xp_mutex::mutex.

Referenced by call_xp_up().

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

Definition at line 268 of file dazuko_rsbac.c.

Referenced by call_xp_verify_user_readable().

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

Definition at line 259 of file dazuko_rsbac.c.

Referenced by call_xp_verify_user_writable().

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

Definition at line 208 of file dazuko_rsbac.c.

References xp_queue::queue, wait_event, and wait_event_interruptible.

Referenced by call_xp_wait_until_condition().

int xp_write_lock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 165 of file dazuko_rsbac.c.

References xp_rwlock::rwlock.

Referenced by call_xp_write_lock().

int xp_write_unlock struct xp_rwlock rwlock  )  [inline]
 

Definition at line 171 of file dazuko_rsbac.c.

References xp_rwlock::rwlock.

Referenced by call_xp_write_unlock().


Variable Documentation

struct xp_atomic active
 

int dev_major = -1 [static]
 

Definition at line 62 of file dazuko_rsbac.c.

Referenced by xp_sys_hook(), and xp_sys_unhook().

struct file_operations fops [static]
 

Initial value:

Definition at line 65 of file dazuko_rsbac.c.

Referenced by xp_sys_hook().

rsbac_reg_handle_t handle = -1 [static]
 

Definition at line 63 of file dazuko_rsbac.c.

Referenced by xp_sys_hook(), and xp_sys_unhook().


Generated on Tue Aug 31 10:05:27 2004 for RSBAC by doxygen 1.3.8