/daten/src/linux-2.4.27-rsbac-v1.2.3/rsbac/data_structures/auth_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/auth_data_structures.h>
#include <rsbac/error.h>
#include <rsbac/helpers.h>
#include <rsbac/adf.h>
#include <rsbac/aci.h>
#include <rsbac/auth.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

boolean writable (struct super_block *sb_p)
int fd_hash (rsbac_inode_nr_t inode)
int cap_compare (void *desc1, void *desc2)
int single_cap_compare (void *desc1, void *desc2)
int auth_register_fd_lists (struct rsbac_auth_device_list_item_t *device_p, kdev_t kdev)
int auth_detach_fd_lists (struct rsbac_auth_device_list_item_t *device_p)
rsbac_auth_device_list_item_tlookup_device (kdev_t kdev)
rsbac_auth_device_list_item_tcreate_device_item (kdev_t kdev)
rsbac_auth_device_list_item_tadd_device_item (struct rsbac_auth_device_list_item_t *device_p)
void clear_device_item (struct rsbac_auth_device_list_item_t *item_p)
void remove_device_item (kdev_t kdev)
int copy_fp_cap_set_item (struct rsbac_auth_device_list_item_t *device_p, rsbac_auth_file_t file, rsbac_pid_t pid)
int copy_pp_cap_set_item_handle (rsbac_list_handle_t handle, rsbac_pid_t old_pid, rsbac_pid_t new_pid)
int copy_pp_cap_set_item (rsbac_pid_t old_pid, rsbac_pid_t new_pid)
int __init rsbac_init_auth (void)
int rsbac_mount_auth (kdev_t kdev)
int rsbac_umount_auth (kdev_t kdev)
int rsbac_stats_auth (void)
int rsbac_check_auth (int correct, int check_inode)
int rsbac_auth_add_to_p_capset (rsbac_pid_t pid, enum rsbac_auth_cap_type_t cap_type, struct rsbac_auth_cap_range_t cap_range, rsbac_time_t ttl)
int rsbac_auth_add_to_f_capset (rsbac_auth_file_t file, enum rsbac_auth_cap_type_t cap_type, struct rsbac_auth_cap_range_t cap_range, rsbac_time_t ttl)
int rsbac_auth_remove_from_p_capset (rsbac_pid_t pid, enum rsbac_auth_cap_type_t cap_type, struct rsbac_auth_cap_range_t cap_range)
int rsbac_auth_remove_from_f_capset (rsbac_auth_file_t file, enum rsbac_auth_cap_type_t cap_type, struct rsbac_auth_cap_range_t cap_range)
int rsbac_auth_clear_p_capset (rsbac_pid_t pid, enum rsbac_auth_cap_type_t cap_type)
int rsbac_auth_clear_f_capset (rsbac_auth_file_t file, enum rsbac_auth_cap_type_t cap_type)
boolean rsbac_auth_p_capset_member (rsbac_pid_t pid, enum rsbac_auth_cap_type_t cap_type, rsbac_uid_t member)
int rsbac_auth_remove_p_capsets (rsbac_pid_t pid)
int rsbac_auth_remove_f_capsets (rsbac_auth_file_t file)
int rsbac_auth_copy_fp_capset (rsbac_auth_file_t file, rsbac_pid_t p_cap_set_id)
int rsbac_auth_copy_pp_capset (rsbac_pid_t old_p_set_id, rsbac_pid_t new_p_set_id)
int rsbac_auth_get_f_caplist (rsbac_auth_file_t file, enum rsbac_auth_cap_type_t cap_type, struct rsbac_auth_cap_range_t **caplist_p, rsbac_time_t **ttllist_p)
int rsbac_auth_get_p_caplist (rsbac_pid_t pid, enum rsbac_auth_cap_type_t cap_type, struct rsbac_auth_cap_range_t **caplist_p, rsbac_time_t **ttllist_p)

Variables

rsbac_auth_device_list_head_t device_list_head
rsbac_list_handle_t process_handle = NULL


Function Documentation

struct rsbac_auth_device_list_item_t* add_device_item struct rsbac_auth_device_list_item_t device_p  )  [static]
 

Definition at line 432 of file auth_data_structures.c.

References rsbac_auth_device_list_head_t::count, rsbac_auth_device_list_head_t::curr, device_list_head, rsbac_auth_device_list_head_t::head, rsbac_auth_device_list_item_t::next, NULL, rsbac_auth_device_list_item_t::prev, and rsbac_auth_device_list_head_t::tail.

int auth_detach_fd_lists struct rsbac_auth_device_list_item_t device_p  )  [static]
 

Definition at line 264 of file auth_data_structures.c.

References get_error_name(), rsbac_auth_device_list_item_t::handles, rsbac_auth_device_list_item_t::id, inttostr(), RSBAC_AUTH_FD_EFF_FILENAME, RSBAC_AUTH_FD_FILENAME, RSBAC_AUTH_FD_FS_FILENAME, RSBAC_AUTH_LIST_KEY, RSBAC_AUTH_NR_CAP_EFF_FD_LISTS, RSBAC_AUTH_NR_CAP_FD_LISTS, RSBAC_AUTH_NR_CAP_FS_FD_LISTS, RSBAC_EINVALIDPOINTER, RSBAC_ENOMEM, rsbac_kfree(), rsbac_kmalloc(), rsbac_list_lol_detach(), and RSBAC_MAXNAMELEN.

Referenced by clear_device_item().

int auth_register_fd_lists struct rsbac_auth_device_list_item_t device_p,
kdev_t  kdev
[static]
 

Definition at line 109 of file auth_data_structures.c.

References cap_compare(), rsbac_list_lol_info_t::data_size, rsbac_list_lol_info_t::desc_size, get_error_name(), rsbac_auth_device_list_item_t::handles, inttostr(), rsbac_list_lol_info_t::key, rsbac_list_lol_info_t::max_age, NULL, RSBAC_AUTH_FD_EFF_FILENAME, RSBAC_AUTH_FD_EFF_LIST_VERSION, RSBAC_AUTH_FD_FILENAME, RSBAC_AUTH_FD_FS_FILENAME, RSBAC_AUTH_FD_FS_LIST_VERSION, RSBAC_AUTH_FD_LIST_VERSION, RSBAC_AUTH_LIST_KEY, RSBAC_AUTH_NR_CAP_EFF_FD_LISTS, RSBAC_AUTH_NR_CAP_FD_LISTS, RSBAC_AUTH_NR_CAP_FS_FD_LISTS, RSBAC_EINVALIDPOINTER, RSBAC_ENOMEM, rsbac_inode_nr_t, rsbac_kfree(), rsbac_kmalloc(), rsbac_list_compare_u32(), RSBAC_LIST_DEF_DATA, rsbac_list_lol_register(), RSBAC_LIST_PERSIST, RSBAC_LIST_VERSION, 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_auth(), and rsbac_mount_auth().

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

Definition at line 73 of file auth_data_structures.c.

Referenced by auth_register_fd_lists(), and rsbac_init_auth().

void clear_device_item struct rsbac_auth_device_list_item_t item_p  )  [static]
 

Definition at line 466 of file auth_data_structures.c.

References auth_detach_fd_lists(), and rsbac_kfree().

int copy_fp_cap_set_item struct rsbac_auth_device_list_item_t device_p,
rsbac_auth_file_t  file,
rsbac_pid_t  pid
[static]
 

Definition at line 527 of file auth_data_structures.c.

References fd_hash(), rsbac_auth_device_list_item_t::handles, NULL, process_handle, rsbac_auth_file_t, RSBAC_ENOTFOUND, rsbac_get_parent(), rsbac_list_lol_get_all_subdesc_ttl(), rsbac_list_lol_remove(), rsbac_list_lol_subadd_ttl(), rsbac_pid_t, rsbac_target_t, rsbac_time_t, rsbac_vfree, and T_FILE.

Referenced by rsbac_auth_copy_fp_capset().

int copy_pp_cap_set_item rsbac_pid_t  old_pid,
rsbac_pid_t  new_pid
[static]
 

Definition at line 691 of file auth_data_structures.c.

References copy_pp_cap_set_item_handle(), process_handle, and rsbac_pid_t.

Referenced by rsbac_auth_copy_pp_capset().

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

Definition at line 656 of file auth_data_structures.c.

References NULL, rsbac_list_handle_t, rsbac_list_lol_get_all_subdesc_ttl(), rsbac_list_lol_remove(), rsbac_list_lol_subadd_ttl(), rsbac_pid_t, rsbac_time_t, and rsbac_vfree.

Referenced by copy_pp_cap_set_item().

struct rsbac_auth_device_list_item_t* create_device_item kdev_t  kdev  )  [static]
 

Definition at line 405 of file auth_data_structures.c.

References rsbac_mac_device_list_item_t::id, NULL, RSBAC_AUTH_NR_CAP_EFF_FD_LISTS, RSBAC_AUTH_NR_CAP_FD_LISTS, RSBAC_AUTH_NR_CAP_FS_FD_LISTS, and rsbac_kmalloc().

int fd_hash rsbac_inode_nr_t  inode  )  [inline, static]
 

Definition at line 58 of file auth_data_structures.c.

References RSBAC_AUTH_NR_CAP_FD_LISTS, and rsbac_inode_nr_t.

Referenced by copy_fp_cap_set_item(), rsbac_auth_add_to_f_capset(), rsbac_auth_clear_f_capset(), rsbac_auth_get_f_caplist(), rsbac_auth_p_capset_member(), and rsbac_auth_remove_from_f_capset().

struct rsbac_auth_device_list_item_t* lookup_device kdev_t  kdev  )  [static]
 

Definition at line 368 of file auth_data_structures.c.

References rsbac_auth_device_list_head_t::curr, device_list_head, rsbac_auth_device_list_head_t::head, and rsbac_auth_device_list_item_t::next.

void remove_device_item kdev_t  kdev  )  [static]
 

Definition at line 477 of file auth_data_structures.c.

References clear_device_item(), rsbac_auth_device_list_head_t::count, rsbac_auth_device_list_head_t::curr, device_list_head, rsbac_auth_device_list_head_t::head, lookup_device(), rsbac_auth_device_list_item_t::next, NULL, rsbac_auth_device_list_item_t::prev, and rsbac_auth_device_list_head_t::tail.

int rsbac_auth_add_to_f_capset rsbac_auth_file_t  file,
enum rsbac_auth_cap_type_t  cap_type,
struct rsbac_auth_cap_range_t  cap_range,
rsbac_time_t  ttl
 

Definition at line 2297 of file auth_data_structures.c.

References ACT_eff, ACT_fs, ACT_real, device_list_head, fd_hash(), rsbac_auth_cap_range_t::first, rsbac_auth_cap_range_t::last, rsbac_auth_device_list_head_t::lock, lookup_device(), NULL, rsbac_auth_file_t, RSBAC_EINVALIDDEV, RSBAC_EINVALIDTARGET, RSBAC_EINVALIDVALUE, RSBAC_ENOTINITIALIZED, rsbac_get_super_block(), rsbac_is_initialized(), rsbac_list_lol_subadd_ttl(), and rsbac_time_t.

Referenced by rsbac_auth_add_f_cap().

int rsbac_auth_add_to_p_capset rsbac_pid_t  pid,
enum rsbac_auth_cap_type_t  cap_type,
struct rsbac_auth_cap_range_t  cap_range,
rsbac_time_t  ttl
 

Definition at line 2266 of file auth_data_structures.c.

References ACT_eff, ACT_fs, ACT_real, rsbac_auth_cap_range_t::first, rsbac_auth_cap_range_t::last, NULL, process_handle, RSBAC_EINVALIDTARGET, RSBAC_EINVALIDVALUE, RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), rsbac_list_lol_subadd_ttl(), rsbac_pid_t, and rsbac_time_t.

Referenced by rsbac_auth_add_p_cap(), and rsbac_replace_auth_cap().

int rsbac_auth_clear_f_capset rsbac_auth_file_t  file,
enum rsbac_auth_cap_type_t  cap_type
 

Definition at line 2499 of file auth_data_structures.c.

References ACT_eff, ACT_fs, ACT_real, device_list_head, fd_hash(), rsbac_auth_device_list_head_t::lock, lookup_device(), rsbac_auth_file_t, RSBAC_EINVALIDDEV, RSBAC_EINVALIDTARGET, RSBAC_ENOTINITIALIZED, rsbac_get_super_block(), rsbac_is_initialized(), and rsbac_list_lol_remove().

Referenced by rsbac_auth_remove_f_capsets().

int rsbac_auth_clear_p_capset rsbac_pid_t  pid,
enum rsbac_auth_cap_type_t  cap_type
 

Definition at line 2472 of file auth_data_structures.c.

References ACT_eff, ACT_fs, ACT_real, process_handle, RSBAC_EINVALIDTARGET, RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), rsbac_list_lol_remove(), and rsbac_pid_t.

Referenced by rsbac_auth_remove_p_capsets().

int rsbac_auth_copy_fp_capset rsbac_auth_file_t  file,
rsbac_pid_t  p_cap_set_id
 

Definition at line 2936 of file auth_data_structures.c.

References copy_fp_cap_set_item(), device_list_head, rsbac_auth_device_list_head_t::lock, lookup_device(), rsbac_auth_file_t, RSBAC_EINVALIDDEV, RSBAC_ENOTINITIALIZED, rsbac_get_super_block(), rsbac_is_initialized(), and rsbac_pid_t.

Referenced by rsbac_adf_set_attr_auth().

int rsbac_auth_copy_pp_capset rsbac_pid_t  old_p_set_id,
rsbac_pid_t  new_p_set_id
 

Definition at line 2991 of file auth_data_structures.c.

References copy_pp_cap_set_item(), RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), and rsbac_pid_t.

Referenced by rsbac_adf_set_attr_auth().

int rsbac_auth_get_f_caplist rsbac_auth_file_t  file,
enum rsbac_auth_cap_type_t  cap_type,
struct rsbac_auth_cap_range_t **  caplist_p,
rsbac_time_t **  ttllist_p
 

Definition at line 3014 of file auth_data_structures.c.

int rsbac_auth_get_p_caplist rsbac_pid_t  pid,
enum rsbac_auth_cap_type_t  cap_type,
struct rsbac_auth_cap_range_t **  caplist_p,
rsbac_time_t **  ttllist_p
 

Definition at line 3094 of file auth_data_structures.c.

boolean rsbac_auth_p_capset_member rsbac_pid_t  pid,
enum rsbac_auth_cap_type_t  cap_type,
rsbac_uid_t  member
 

Definition at line 2564 of file auth_data_structures.c.

References A_auth_learn, ACT_eff, ACT_fs, ACT_real, AUTH, rsbac_attribute_value_t::auth_learn, device_list_head, FALSE, fd_hash(), rsbac_auth_cap_range_t::first, rsbac_auth_cap_range_t::last, rsbac_auth_device_list_head_t::lock, lookup_device(), NULL, rsbac_target_id_t::process, process_handle, RSBAC_AUTH_MAX_RANGE_UID, RSBAC_AUTH_OWNER_F_CAP, rsbac_get_attr(), rsbac_is_initialized(), rsbac_list_lol_subadd(), rsbac_list_lol_subexist_compare(), rsbac_pid_t, rsbac_uid_t, single_cap_compare(), T_PROCESS, and TRUE.

Referenced by rsbac_adf_request_auth(), and rsbac_replace_auth_cap().

int rsbac_auth_remove_f_capsets rsbac_auth_file_t  file  ) 
 

Definition at line 2922 of file auth_data_structures.c.

References ACT_eff, ACT_fs, ACT_real, rsbac_auth_clear_f_capset(), and rsbac_auth_file_t.

Referenced by rsbac_adf_set_attr_auth(), and rsbac_remove_target().

int rsbac_auth_remove_from_f_capset rsbac_auth_file_t  file,
enum rsbac_auth_cap_type_t  cap_type,
struct rsbac_auth_cap_range_t  cap_range
 

Definition at line 2402 of file auth_data_structures.c.

References ACT_eff, ACT_fs, ACT_real, device_list_head, fd_hash(), rsbac_auth_cap_range_t::first, rsbac_auth_cap_range_t::last, rsbac_auth_device_list_head_t::lock, lookup_device(), rsbac_auth_file_t, RSBAC_EINVALIDDEV, RSBAC_EINVALIDTARGET, RSBAC_EINVALIDVALUE, RSBAC_ENOTINITIALIZED, rsbac_get_super_block(), rsbac_is_initialized(), and rsbac_list_lol_subremove().

Referenced by rsbac_auth_remove_f_cap().

int rsbac_auth_remove_from_p_capset rsbac_pid_t  pid,
enum rsbac_auth_cap_type_t  cap_type,
struct rsbac_auth_cap_range_t  cap_range
 

Definition at line 2372 of file auth_data_structures.c.

References ACT_eff, ACT_fs, ACT_real, rsbac_auth_cap_range_t::first, rsbac_auth_cap_range_t::last, process_handle, RSBAC_EINVALIDTARGET, RSBAC_EINVALIDVALUE, RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), rsbac_list_lol_subremove(), and rsbac_pid_t.

Referenced by rsbac_auth_remove_p_cap(), and rsbac_replace_auth_cap().

int rsbac_auth_remove_p_capsets rsbac_pid_t  pid  ) 
 

Definition at line 2910 of file auth_data_structures.c.

References ACT_eff, ACT_fs, ACT_real, rsbac_auth_clear_p_capset(), and rsbac_pid_t.

Referenced by rsbac_remove_target().

int rsbac_check_auth int  correct,
int  check_inode
 

Definition at line 1979 of file auth_data_structures.c.

References rsbac_auth_device_list_head_t::count, device_list_head, rsbac_auth_device_list_head_t::head, rsbac_auth_device_list_head_t::lock, NULL, RSBAC_AUTH_NR_CAP_FD_LISTS, RSBAC_ENOTINITIALIZED, rsbac_get_super_block(), rsbac_inode_nr_t, rsbac_is_initialized(), rsbac_list_lol_get_all_desc(), rsbac_list_lol_remove(), and rsbac_vfree.

Referenced by rsbac_do_init(), and sys_rsbac_check().

int __init rsbac_init_auth void   ) 
 

Definition at line 1461 of file auth_data_structures.c.

References add_device_item(), auth_register_fd_lists(), cap_compare(), rsbac_auth_device_list_head_t::count, create_device_item(), rsbac_auth_device_list_head_t::curr, rsbac_list_lol_info_t::data_size, rsbac_list_lol_info_t::desc_size, device_list_head, get_error_name(), rsbac_auth_device_list_head_t::head, rsbac_list_lol_info_t::key, rsbac_auth_device_list_head_t::lock, rsbac_list_lol_info_t::max_age, NULL, proc_rsbac_root_p, process_handle, RSBAC_AUTH_LIST_KEY, RSBAC_AUTH_P_EFF_LIST_NAME, RSBAC_AUTH_P_FS_LIST_NAME, RSBAC_AUTH_P_LIST_NAME, RSBAC_AUTH_P_LIST_VERSION, RSBAC_ECOULDNOTADDDEVICE, RSBAC_EREINIT, rsbac_is_initialized(), rsbac_kfree(), rsbac_kmalloc(), RSBAC_LIST_DEF_DATA, rsbac_list_lol_register(), RSBAC_LIST_VERSION, RSBAC_MAXNAMELEN, rsbac_pid_t, rsbac_root_dev, rsbac_list_lol_info_t::subdata_size, rsbac_list_lol_info_t::subdesc_size, rsbac_auth_device_list_head_t::tail, and rsbac_list_lol_info_t::version.

Referenced by rsbac_do_init().

int rsbac_mount_auth kdev_t  kdev  ) 
 

Definition at line 1709 of file auth_data_structures.c.

References add_device_item(), auth_register_fd_lists(), clear_device_item(), create_device_item(), device_list_head, get_error_name(), rsbac_auth_device_list_head_t::lock, lookup_device(), RSBAC_ECOULDNOTADDDEVICE, RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), and RSBAC_MAXNAMELEN.

Referenced by rsbac_mount().

int rsbac_stats_auth void   ) 
 

Definition at line 1900 of file auth_data_structures.c.

References A_none, device_list_head, rsbac_attribute_value_t::dummy, rsbac_auth_device_list_head_t::head, rsbac_auth_device_list_head_t::lock, process_handle, R_GET_STATUS_DATA, rsbac_adf_request(), RSBAC_AUTH_NR_CAP_FD_LISTS, RSBAC_ENOTINITIALIZED, rsbac_is_initialized(), rsbac_list_lol_all_subcount(), rsbac_list_lol_count(), rsbac_target_id_t::scd, ST_rsbac, and T_SCD.

Referenced by rsbac_stats().

int rsbac_umount_auth kdev_t  kdev  ) 
 

Definition at line 1831 of file auth_data_structures.c.

References device_list_head, rsbac_auth_device_list_head_t::lock, lookup_device(), remove_device_item(), RSBAC_ENOTINITIALIZED, and rsbac_is_initialized().

Referenced by rsbac_umount().

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

Definition at line 91 of file auth_data_structures.c.

References rsbac_uid_t.

Referenced by rsbac_auth_p_capset_member().

boolean writable struct super_block *  sb_p  ) 
 

Definition at line 297 of file aci_data_structures.c.


Variable Documentation

struct rsbac_auth_device_list_head_t device_list_head [static]
 

Definition at line 36 of file auth_data_structures.c.

Referenced by add_device_item(), lookup_device(), remove_device_item(), rsbac_auth_add_to_f_capset(), rsbac_auth_clear_f_capset(), rsbac_auth_copy_fp_capset(), rsbac_auth_get_f_caplist(), rsbac_auth_p_capset_member(), rsbac_auth_remove_from_f_capset(), rsbac_check_auth(), rsbac_init_auth(), rsbac_mount_auth(), rsbac_stats_auth(), and rsbac_umount_auth().

rsbac_list_handle_t process_handle = NULL [static]
 

Definition at line 38 of file auth_data_structures.c.

Referenced by copy_fp_cap_set_item(), copy_pp_cap_set_item(), rsbac_auth_add_to_p_capset(), rsbac_auth_clear_p_capset(), rsbac_auth_get_p_caplist(), rsbac_auth_p_capset_member(), rsbac_auth_remove_from_p_capset(), rsbac_init_auth(), and rsbac_stats_auth().


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