mac_data_structures.c File Reference

#include <linux/types.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/init.h>
#include <linux/ext2_fs.h>
#include <asm/uaccess.h>
#include <rsbac/types.h>
#include <rsbac/aci_data_structures.h>
#include <rsbac/mac_data_structures.h>
#include <rsbac/error.h>
#include <rsbac/helpers.h>
#include <rsbac/adf.h>
#include <rsbac/aci.h>
#include <rsbac/lists.h>
#include <rsbac/proc_fs.h>
#include <rsbac/rkmem.h>
#include <rsbac/getname.h>
#include <linux/string.h>
#include <linux/smp_lock.h>

Go to the source code of this file.

Functions

rsbac_boolean_t writable (struct super_block *sb_p)
static int fd_hash (rsbac_inode_nr_t inode)
static int mac_register_fd_lists (struct rsbac_mac_device_list_item_t *device_p, kdev_t kdev)
static int mac_detach_fd_lists (struct rsbac_mac_device_list_item_t *device_p)
static struct rsbac_mac_device_list_item_tlookup_device (kdev_t kdev)
static struct rsbac_mac_device_list_item_tcreate_device_item (kdev_t kdev)
static struct rsbac_mac_device_list_item_tadd_device_item (struct rsbac_mac_device_list_item_t *device_p)
static void clear_device_item (struct rsbac_mac_device_list_item_t *item_p)
static void remove_device_item (kdev_t kdev)
static int copy_fp_tru_set_item (struct rsbac_mac_device_list_item_t *device_p, rsbac_mac_file_t file, rsbac_pid_t pid)
static int copy_pp_tru_set_item_handle (rsbac_list_handle_t handle, rsbac_pid_t old_pid, rsbac_pid_t new_pid)
static int copy_pp_tru_set_item (rsbac_pid_t old_pid, rsbac_pid_t new_pid)
int __init rsbac_init_mac (void)
int rsbac_mount_mac (kdev_t kdev)
int rsbac_umount_mac (kdev_t kdev)
int rsbac_stats_mac (void)
int rsbac_check_mac (int correct, int check_inode)
int rsbac_mac_add_to_p_truset (rsbac_list_ta_number_t ta_number, rsbac_pid_t pid, rsbac_uid_t member, rsbac_time_t ttl)
int rsbac_mac_add_to_f_truset (rsbac_list_ta_number_t ta_number, rsbac_mac_file_t file, rsbac_uid_t member, rsbac_time_t ttl)
int rsbac_mac_remove_from_p_truset (rsbac_list_ta_number_t ta_number, rsbac_pid_t pid, rsbac_uid_t member)
int rsbac_mac_remove_from_f_truset (rsbac_list_ta_number_t ta_number, rsbac_mac_file_t file, rsbac_uid_t member)
int rsbac_mac_clear_p_truset (rsbac_list_ta_number_t ta_number, rsbac_pid_t pid)
int rsbac_mac_clear_f_truset (rsbac_list_ta_number_t ta_number, rsbac_mac_file_t file)
rsbac_boolean_t rsbac_mac_p_truset_member (rsbac_pid_t pid, rsbac_uid_t member)
int rsbac_mac_remove_p_trusets (rsbac_pid_t pid)
int rsbac_mac_remove_f_trusets (rsbac_mac_file_t file)
int rsbac_mac_copy_fp_truset (rsbac_mac_file_t file, rsbac_pid_t p_tru_set_id)
int rsbac_mac_copy_pp_truset (rsbac_pid_t old_p_set_id, rsbac_pid_t new_p_set_id)
int rsbac_mac_get_f_trulist (rsbac_list_ta_number_t ta_number, rsbac_mac_file_t file, rsbac_uid_t **trulist_p, rsbac_time_t **ttllist_p)
int rsbac_mac_get_p_trulist (rsbac_list_ta_number_t ta_number, rsbac_pid_t pid, rsbac_uid_t **trulist_p, rsbac_time_t **ttllist_p)

Variables

static struct rsbac_mac_device_list_head_t device_list_head
static rsbac_list_handle_t process_handle = NULL


Function Documentation

static struct rsbac_mac_device_list_item_t* add_device_item struct rsbac_mac_device_list_item_t device_p  )  [static]
 

Definition at line 232 of file mac_data_structures.c.

References rsbac_mac_device_list_head_t::count, rsbac_mac_device_list_head_t::curr, rsbac_mac_device_list_head_t::head, rsbac_mac_device_list_item_t::next, NULL, and rsbac_mac_device_list_head_t::tail.

static void clear_device_item struct rsbac_mac_device_list_item_t item_p  )  [static]
 

Definition at line 266 of file mac_data_structures.c.

References mac_detach_fd_lists(), and rsbac_kfree().

static int copy_fp_tru_set_item struct rsbac_mac_device_list_item_t device_p,
rsbac_mac_file_t  file,
rsbac_pid_t  pid
[static]
 

Definition at line 327 of file mac_data_structures.c.

References fd_hash(), rsbac_mac_device_list_item_t::handles, NULL, process_handle, RSBAC_ENOTFOUND, rsbac_get_parent(), rsbac_list_lol_get_all_subdesc_ttl(), rsbac_list_lol_remove(), rsbac_list_lol_subadd_ttl(), rsbac_vfree, and T_FILE.

Referenced by rsbac_mac_copy_fp_truset().

static int copy_pp_tru_set_item rsbac_pid_t  old_pid,
rsbac_pid_t  new_pid
[static]
 

Definition at line 416 of file mac_data_structures.c.

References copy_pp_tru_set_item_handle(), and process_handle.

Referenced by rsbac_mac_copy_pp_truset().

static int copy_pp_tru_set_item_handle rsbac_list_handle_t  handle,
rsbac_pid_t  old_pid,
rsbac_pid_t  new_pid
[static]
 

Definition at line 381 of file mac_data_structures.c.

References NULL, rsbac_list_lol_get_all_subdesc_ttl(), rsbac_list_lol_remove(), rsbac_list_lol_subadd_ttl(), and rsbac_vfree.

Referenced by copy_pp_tru_set_item().

static struct rsbac_mac_device_list_item_t* create_device_item kdev_t  kdev  )  [static]
 

Definition at line 211 of file mac_data_structures.c.

References NULL, rsbac_kmalloc(), and RSBAC_MAC_NR_TRU_FD_LISTS.

static int fd_hash rsbac_inode_nr_t  inode  )  [inline, static]
 

Definition at line 51 of file mac_data_structures.c.

References RSBAC_MAC_NR_TRU_FD_LISTS.

static struct rsbac_mac_device_list_item_t* lookup_device kdev_t  kdev  )  [static]
 

Definition at line 174 of file mac_data_structures.c.

References rsbac_mac_device_list_head_t::curr, rsbac_mac_device_list_head_t::head, rsbac_mac_device_list_item_t::id, and rsbac_mac_device_list_item_t::next.

static int mac_detach_fd_lists struct rsbac_mac_device_list_item_t device_p  )  [static]
 

Definition at line 125 of file mac_data_structures.c.

References get_error_name(), rsbac_mac_device_list_item_t::handles, rsbac_mac_device_list_item_t::id, inttostr(), name, RSBAC_EINVALIDPOINTER, RSBAC_ENOMEM, rsbac_kfree(), rsbac_kmalloc(), rsbac_list_lol_detach(), RSBAC_MAC_FD_FILENAME, RSBAC_MAC_LIST_KEY, RSBAC_MAC_NR_TRU_FD_LISTS, and RSBAC_MAXNAMELEN.

Referenced by clear_device_item().

static int mac_register_fd_lists struct rsbac_mac_device_list_item_t device_p,
kdev_t  kdev
[static]
 

Definition at line 59 of file mac_data_structures.c.

References rsbac_list_lol_info_t::data_size, rsbac_list_lol_info_t::desc_size, get_error_name(), rsbac_mac_device_list_item_t::handles, inttostr(), rsbac_list_lol_info_t::key, rsbac_list_lol_info_t::max_age, name, NULL, RSBAC_EINVALIDPOINTER, RSBAC_ENOMEM, rsbac_kfree(), rsbac_kmalloc(), rsbac_list_compare_u32(), RSBAC_LIST_DEF_DATA, rsbac_list_lol_register(), RSBAC_LIST_PERSIST, RSBAC_LIST_VERSION, RSBAC_MAC_FD_FILENAME, RSBAC_MAC_FD_LIST_VERSION, RSBAC_MAC_LIST_KEY, RSBAC_MAC_NR_TRU_FD_LISTS, RSBAC_MAXNAMELEN, rsbac_list_lol_info_t::subdata_size, rsbac_list_lol_info_t::subdesc_size, and rsbac_list_lol_info_t::version.

Referenced by rsbac_init_mac(), and rsbac_mount_mac().

static void remove_device_item kdev_t  kdev  )  [static]
 

Definition at line 277 of file mac_data_structures.c.

References clear_device_item(), rsbac_mac_device_list_head_t::count, rsbac_mac_device_list_head_t::curr, rsbac_mac_device_list_head_t::head, lookup_device(), rsbac_mac_device_list_item_t::next, NULL, rsbac_mac_device_list_item_t::prev, and rsbac_mac_device_list_head_t::tail.

int rsbac_check_mac int  correct,
int  check_inode
 

Definition at line 1245 of file mac_data_structures.c.

References rsbac_mac_device_list_head_t::count, rsbac_mac_device_list_item_t::handles, rsbac_mac_device_list_head_t::head, rsbac_mac_device_list_item_t::id, rsbac_mac_device_list_head_t::lock, rsbac_mac_device_list_item_t::next, NULL, RSBAC_ENOTINITIALIZED, rsbac_get_super_block(), rsbac_is_initialized(), rsbac_list_lol_get_all_desc(), rsbac_list_lol_remove(), and rsbac_vfree.

Referenced by sys_rsbac_check().

int __init rsbac_init_mac void   ) 
 

Definition at line 807 of file mac_data_structures.c.

References add_device_item(), rsbac_mac_device_list_head_t::count, create_device_item(), rsbac_mac_device_list_head_t::curr, rsbac_list_lol_info_t::data_size, rsbac_list_lol_info_t::desc_size, get_error_name(), rsbac_mac_device_list_head_t::head, rsbac_list_lol_info_t::key, rsbac_mac_device_list_head_t::lock, mac_register_fd_lists(), rsbac_list_lol_info_t::max_age, NULL, proc_rsbac_root_p, RSBAC_ECOULDNOTADDDEVICE, RSBAC_EREINIT, rsbac_is_initialized(), rsbac_kfree(), rsbac_kmalloc(), RSBAC_LIST_DEF_DATA, rsbac_list_lol_register(), RSBAC_LIST_VERSION, RSBAC_MAC_LIST_KEY, RSBAC_MAC_P_LIST_NAME, RSBAC_MAC_P_LIST_VERSION, RSBAC_MAXNAMELEN, rsbac_root_dev, rsbac_list_lol_info_t::subdata_size, rsbac_list_lol_info_t::subdesc_size, rsbac_mac_device_list_head_t::tail, and rsbac_list_lol_info_t::version.

Referenced by rsbac_do_init().

int rsbac_mac_add_to_f_truset rsbac_list_ta_number_t  ta_number,
rsbac_mac_file_t  file,
rsbac_uid_t  member,
rsbac_time_t  ttl
 

Definition at line 1550 of file mac_data_structures.c.

References fd_hash(), rsbac_mac_device_list_item_t::handles, rsbac_mac_device_list_head_t::lock, lookup_device(), NULL, RSBAC_EINVALIDDEV, RSBAC_ENOTINITIALIZED, rsbac_get_super_block(), rsbac_is_initialized(), and rsbac_ta_list_lol_subadd_ttl().

Referenced by rsbac_mac_add_f_tru().

int rsbac_mac_add_to_p_truset rsbac_list_ta_number_t  ta_number,
rsbac_pid_t  pid,
rsbac_uid_t  member,
rsbac_time_t  ttl
 

Definition at line 1532 of file mac_data_structures.c.

References NULL, RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), and rsbac_ta_list_lol_subadd_ttl().

Referenced by rsbac_mac_add_p_tru().

int rsbac_mac_clear_f_truset rsbac_list_ta_number_t  ta_number,
rsbac_mac_file_t  file
 

Definition at line 1698 of file mac_data_structures.c.

References fd_hash(), rsbac_mac_device_list_item_t::handles, rsbac_mac_device_list_head_t::lock, lookup_device(), RSBAC_EINVALIDDEV, RSBAC_ENOTINITIALIZED, rsbac_get_super_block(), rsbac_is_initialized(), and rsbac_ta_list_lol_remove().

Referenced by rsbac_mac_remove_f_trusets().

int rsbac_mac_clear_p_truset rsbac_list_ta_number_t  ta_number,
rsbac_pid_t  pid
 

Definition at line 1682 of file mac_data_structures.c.

References RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), and rsbac_ta_list_lol_remove().

Referenced by rsbac_mac_remove_p_trusets().

int rsbac_mac_copy_fp_truset rsbac_mac_file_t  file,
rsbac_pid_t  p_tru_set_id
 

Definition at line 1782 of file mac_data_structures.c.

References copy_fp_tru_set_item(), rsbac_mac_device_list_head_t::lock, lookup_device(), RSBAC_EINVALIDDEV, RSBAC_ENOTINITIALIZED, rsbac_get_super_block(), and rsbac_is_initialized().

Referenced by rsbac_adf_set_attr_mac().

int rsbac_mac_copy_pp_truset rsbac_pid_t  old_p_set_id,
rsbac_pid_t  new_p_set_id
 

Definition at line 1837 of file mac_data_structures.c.

References copy_pp_tru_set_item(), RSBAC_ENOTINITIALIZED, and rsbac_is_initialized().

Referenced by rsbac_adf_set_attr_mac().

int rsbac_mac_get_f_trulist rsbac_list_ta_number_t  ta_number,
rsbac_mac_file_t  file,
rsbac_uid_t **  trulist_p,
rsbac_time_t **  ttllist_p
 

Definition at line 1860 of file mac_data_structures.c.

Referenced by sys_rsbac_mac_get_f_trulist().

int rsbac_mac_get_p_trulist rsbac_list_ta_number_t  ta_number,
rsbac_pid_t  pid,
rsbac_uid_t **  trulist_p,
rsbac_time_t **  ttllist_p
 

Definition at line 1921 of file mac_data_structures.c.

Referenced by sys_rsbac_mac_get_p_trulist().

rsbac_boolean_t rsbac_mac_p_truset_member rsbac_pid_t  pid,
rsbac_uid_t  member
 

Definition at line 1749 of file mac_data_structures.c.

References FALSE, RSBAC_ALL_USERS, rsbac_is_initialized(), rsbac_list_lol_subexist(), and TRUE.

Referenced by rsbac_adf_set_attr_mac().

int rsbac_mac_remove_f_trusets rsbac_mac_file_t  file  ) 
 

Definition at line 1777 of file mac_data_structures.c.

References FALSE, and rsbac_mac_clear_f_truset().

Referenced by rsbac_ta_remove_target().

int rsbac_mac_remove_from_f_truset rsbac_list_ta_number_t  ta_number,
rsbac_mac_file_t  file,
rsbac_uid_t  member
 

Definition at line 1625 of file mac_data_structures.c.

References fd_hash(), rsbac_mac_device_list_item_t::handles, rsbac_mac_device_list_head_t::lock, lookup_device(), RSBAC_EINVALIDDEV, RSBAC_ENOTINITIALIZED, rsbac_get_super_block(), rsbac_is_initialized(), and rsbac_ta_list_lol_subremove().

Referenced by rsbac_mac_remove_f_tru().

int rsbac_mac_remove_from_p_truset rsbac_list_ta_number_t  ta_number,
rsbac_pid_t  pid,
rsbac_uid_t  member
 

Definition at line 1608 of file mac_data_structures.c.

References RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), and rsbac_ta_list_lol_subremove().

Referenced by rsbac_mac_remove_p_tru().

int rsbac_mac_remove_p_trusets rsbac_pid_t  pid  ) 
 

Definition at line 1772 of file mac_data_structures.c.

References FALSE, and rsbac_mac_clear_p_truset().

Referenced by rsbac_ta_remove_target().

int rsbac_mount_mac kdev_t  kdev  ) 
 

Definition at line 975 of file mac_data_structures.c.

References add_device_item(), clear_device_item(), create_device_item(), get_error_name(), rsbac_mac_device_list_head_t::lock, lookup_device(), mac_register_fd_lists(), rsbac_mac_device_list_item_t::mount_count, RSBAC_ECOULDNOTADDDEVICE, RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), and RSBAC_MAXNAMELEN.

Referenced by rsbac_mount().

int rsbac_stats_mac void   ) 
 

Definition at line 1166 of file mac_data_structures.c.

References A_none, rsbac_attribute_value_t::dummy, rsbac_mac_device_list_item_t::handles, rsbac_mac_device_list_head_t::head, rsbac_mac_device_list_item_t::id, rsbac_mac_device_list_head_t::lock, rsbac_mac_device_list_item_t::next, R_GET_STATUS_DATA, rsbac_adf_request(), RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), rsbac_list_lol_all_subcount(), rsbac_list_lol_count(), rsbac_target_id_t::scd, ST_rsbac, and T_SCD.

int rsbac_umount_mac kdev_t  kdev  ) 
 

Definition at line 1097 of file mac_data_structures.c.

References rsbac_mac_device_list_head_t::lock, lookup_device(), rsbac_mac_device_list_item_t::mount_count, remove_device_item(), RSBAC_ENOTINITIALIZED, and rsbac_is_initialized().

Referenced by rsbac_umount().

rsbac_boolean_t writable struct super_block *  sb_p  ) 
 

Definition at line 323 of file aci_data_structures.c.

References FALSE, KERNEL_VERSION, rsbac_debug_no_write, SOCKFS_MAGIC, SYSFS_MAGIC, and TRUE.

Referenced by lookup_aci_path_dentry(), and rsbac_write_open().


Variable Documentation

struct rsbac_mac_device_list_head_t device_list_head [static]
 

Definition at line 33 of file mac_data_structures.c.

rsbac_list_handle_t process_handle = NULL [static]
 

Definition at line 35 of file mac_data_structures.c.


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