#include <asm/uaccess.h>#include <rsbac/types.h>#include <rsbac/aci.h>#include <rsbac/aci_data_structures.h>#include <rsbac/debug.h>#include <rsbac/error.h>#include <rsbac/proc_fs.h>#include <rsbac/getname.h>#include <rsbac/net_getname.h>#include <rsbac/adf.h>#include <rsbac/rkmem.h>#include <linux/smp_lock.h>#include <linux/init.h>#include <linux/config.h>#include <linux/module.h>#include <linux/console.h>#include <linux/net.h>#include <linux/in.h>#include <linux/moduleparam.h>#include <linux/syscalls.h>Go to the source code of this file.
Functions | |
| void | rsbac_adf_log_switch (rsbac_adf_request_int_t request, enum rsbac_target_t target, rsbac_enum_t value) |
| int | rsbac_get_adf_log (rsbac_adf_request_int_t request, enum rsbac_target_t target, u_int *value_p) |
| static int R_INIT | no_defaults_setup (char *line) |
| __setup ("rsbac_no_defaults", no_defaults_setup) | |
| EXPORT_SYMBOL (rsbac_printk) | |
| int | rsbac_printk (const char *fmt,...) |
| static int | ll_conv (void *old_desc, void *old_data, void *new_desc, void *new_data) |
| rsbac_list_conv_function_t * | ll_get_conv (rsbac_version_t old_version) |
| void __init | rsbac_init_debug (void) |
Variables | |
| int | rsbac_debug_no_write = 0 |
| static rsbac_boolean_t | debug_initialized = FALSE |
| int | rsbac_no_defaults = 0 |
| static rsbac_list_handle_t | log_levels_handle = NULL |
| static u_int | log_seq = 0 |
| int | rsbac_debug_adf_default = 1 |
| rsbac_log_entry_t | rsbac_log_levels [R_NONE+1] |
| rsbac_boolean_t | rsbac_debug_adf_dirty = FALSE |
|
||||||||||||
|
|
|
|
|
|
||||||||||||||||||||
|
Definition at line 4828 of file debug.c. References LL_denied, and T_NONE. Referenced by ll_get_conv(). 04833 {
04834 rsbac_log_entry_t * new_aci = new_data;
04835 rsbac_old_log_entry_t * old_aci = old_data;
04836 int i;
04837
04838 memcpy(new_desc, old_desc, sizeof(rsbac_adf_request_int_t));
04839 for(i=0; i < T_NONE - 1; i++)
04840 (*new_aci)[i] = (*old_aci)[i];
04841 (*new_aci)[T_NONE - 1] = LL_denied;
04842 (*new_aci)[T_NONE] = (*old_aci)[T_NONE - 1];
04843 return 0;
04844 }
|
|
|
Definition at line 4846 of file debug.c. References ll_conv(), NULL, and RSBAC_LOG_LEVEL_OLD_VERSION. Referenced by rsbac_init_debug(). 04847 {
04848 switch(old_version)
04849 {
04850 case RSBAC_LOG_LEVEL_OLD_VERSION:
04851 return ll_conv;
04852 default:
04853 return NULL;
04854 }
04855 }
|
|
|
Definition at line 942 of file debug.c. References rsbac_no_defaults. 00943 {
00944 rsbac_no_defaults = 1;
00945 return 1;
00946 }
|
|
||||||||||||||||
|
Definition at line 276 of file debug.c. Referenced by sys_rsbac_adf_log_switch(). 00279 {
00280 if( (request < R_NONE)
00281 && (target <= T_NONE)
00282 && (value <= LL_full)
00283 )
00284 {
00285 rsbac_log_levels[request][target] = value;
00286 if(log_levels_handle)
00287 rsbac_list_add(log_levels_handle, &request, rsbac_log_levels[request]);
00288 }
00289 };
|
|
||||||||||||||||
|
Definition at line 291 of file debug.c. Referenced by sys_rsbac_get_adf_log(). 00294 {
00295 if( (request < R_NONE)
00296 && (target <= T_NONE)
00297 )
00298 {
00299 *value_p = rsbac_log_levels[request][target];
00300 return 0;
00301 }
00302 else
00303 return -RSBAC_EINVALIDVALUE;
00304 }
|
|
|
Definition at line 4865 of file debug.c. References debug_initialized, get_error_name(), LL_denied, ll_get_conv(), log_levels_handle, NULL, proc_rsbac_root_p, rsbac_daz_get_ttl(), rsbac_debug_adf_default, rsbac_debug_no_write, rsbac_kfree(), rsbac_kmalloc(), RSBAC_LIST_DEF_DATA, rsbac_list_get_data(), RSBAC_LIST_PERSIST, rsbac_list_register(), RSBAC_LIST_VERSION, RSBAC_LOG_LEVEL_KEY, RSBAC_LOG_LEVEL_LIST_NAME, RSBAC_LOG_LEVEL_VERSION, rsbac_log_levels, RSBAC_MAXNAMELEN, rsbac_no_defaults, rsbac_printk(), T_NONE, and TRUE. Referenced by rsbac_do_init(). 04867 {
04868 int i;
04869 #if defined(CONFIG_RSBAC_PROC) && defined(CONFIG_PROC_FS)
04870 struct proc_dir_entry * tmp_entry_p;
04871 #endif
04872
04873 if (!debug_initialized)
04874 {
04875 struct rsbac_list_info_t * info_p;
04876 int tmperr;
04877 rsbac_enum_t * def_data_p;
04878
04879 rsbac_printk(KERN_INFO "rsbac_init_debug(): Initializing\n");
04880 info_p = rsbac_kmalloc(sizeof(*info_p));
04881 if(!info_p)
04882 {
04883 memset(rsbac_log_levels, LL_denied, sizeof(rsbac_log_levels));
04884 return;
04885 }
04886 def_data_p = rsbac_kmalloc(sizeof(rsbac_log_entry_t));
04887 if(!def_data_p)
04888 {
04889 memset(rsbac_log_levels, LL_denied, sizeof(rsbac_log_levels));
04890 rsbac_kfree(info_p);
04891 return;
04892 }
04893 /* register log_levels list */
04894 for(i=0; i<=T_NONE; i++)
04895 def_data_p[i] = LL_denied;
04896 info_p->version = RSBAC_LOG_LEVEL_VERSION;
04897 info_p->key = RSBAC_LOG_LEVEL_KEY;
04898 info_p->desc_size = sizeof(rsbac_adf_request_int_t);
04899 info_p->data_size = sizeof(rsbac_log_entry_t);
04900 info_p->max_age = 0;
04901 tmperr = rsbac_list_register(RSBAC_LIST_VERSION,
04902 &log_levels_handle,
04903 info_p,
04904 RSBAC_LIST_PERSIST | RSBAC_LIST_DEF_DATA,
04905 NULL,
04906 ll_get_conv,
04907 def_data_p,
04908 RSBAC_LOG_LEVEL_LIST_NAME,
04909 RSBAC_AUTO_DEV);
04910 if(tmperr)
04911 {
04912 char * tmp;
04913
04914 tmp = rsbac_kmalloc(RSBAC_MAXNAMELEN);
04915 if(tmp)
04916 {
04917 rsbac_printk(KERN_WARNING
04918 "rsbac_init_debug(): registering log levels list ll failed with error %s!\n",
04919 get_error_name(tmp, tmperr));
04920 rsbac_kfree(tmp);
04921 }
04922 memset(rsbac_log_levels, LL_denied, sizeof(rsbac_log_levels));
04923 }
04924 else
04925 {
04926 rsbac_adf_request_int_t req;
04927
04928 for(req = 0; req < R_NONE; req++)
04929 rsbac_list_get_data(log_levels_handle, &req, rsbac_log_levels[req]);
04930 }
04931
04932 #if defined(CONFIG_RSBAC_PROC) && defined(CONFIG_PROC_FS)
04933 tmp_entry_p = create_proc_entry("log_levels",
04934 S_IFREG | S_IRUGO | S_IWUGO,
04935 proc_rsbac_root_p);
04936 if(tmp_entry_p)
04937 {
04938 tmp_entry_p->get_info = log_levels_proc_info;
04939 tmp_entry_p->write_proc = log_levels_proc_write;
04940 }
04941
04942 tmp_entry_p = create_proc_entry("debug",
04943 S_IFREG | S_IRUGO | S_IWUGO,
04944 proc_rsbac_root_p);
04945 if(tmp_entry_p)
04946 {
04947 tmp_entry_p->get_info = debug_proc_info;
04948 tmp_entry_p->write_proc = debug_proc_write;
04949 }
04950
04951 #if defined(CONFIG_RSBAC_RMSG)
04952 tmp_entry_p = create_proc_entry("rmsg",
04953 S_IFREG | S_IRUGO,
04954 proc_rsbac_root_p);
04955 if(tmp_entry_p)
04956 {
04957 tmp_entry_p->proc_fops = &proc_rmsg_operations;
04958 }
04959 #endif
04960 #endif
04961
04962 #if defined(CONFIG_RSBAC_LOG_REMOTE)
04963 /* Start rsbac logging thread for auto write */
04964 if(!rsbac_log_remote_port)
04965 rsbac_log_remote_port = htons(CONFIG_RSBAC_LOG_REMOTE_PORT);
04966 tmperr = rsbac_net_str_to_inet(rsbac_log_remote_addr_string,
04967 &rsbac_log_remote_addr);
04968 if(tmperr < 0)
04969 {
04970 char * tmp = rsbac_kmalloc(RSBAC_MAXNAMELEN);
04971
04972 if(tmp)
04973 {
04974 get_error_name(tmp, tmperr);
04975 rsbac_printk(KERN_WARNING
04976 "rsbac_init_debug(): converting remote socket address %s failed with error %s, exiting!\n",
04977 rsbac_log_remote_addr_string,
04978 tmp);
04979 rsbac_log_remote_addr = 0;
04980 rsbac_kfree(tmp);
04981 }
04982 }
04983 rsbaclogd_pid = kernel_thread(rsbaclogd, NULL, 0);
04984 rsbac_printk(KERN_INFO "rsbac_init_debug(): Started rsbaclogd thread with pid %u\n",
04985 rsbaclogd_pid);
04986 #endif
04987
04988 #ifdef CONFIG_RSBAC_SYSLOG_RATE
04989 init_timer(&rsbac_syslog_rate_timer);
04990 rsbac_syslog_rate_timer.function = syslog_rate_reset;
04991 rsbac_syslog_rate_timer.data = 0;
04992 rsbac_syslog_rate_timer.expires = jiffies + HZ;
04993 add_timer(&rsbac_syslog_rate_timer);
04994 #endif
04995
04996 debug_initialized = TRUE;
04997 }
04998
04999 #ifdef CONFIG_RSBAC_SOFTMODE
05000 if(rsbac_softmode)
05001 rsbac_printk(KERN_DEBUG "rsbac_softmode is set\n");
05002 if(rsbac_softmode_prohibit)
05003 rsbac_printk(KERN_DEBUG "rsbac_softmode_prohibit is set\n");
05004 #endif
05005 #ifdef CONFIG_RSBAC_FREEZE
05006 if(rsbac_freeze)
05007 rsbac_printk(KERN_DEBUG "rsbac_freeze is set\n");
05008 #endif
05009 #if defined(CONFIG_RSBAC_UM_EXCL)
05010 if(rsbac_um_no_excl)
05011 rsbac_printk(KERN_DEBUG "rsbac_um_no_excl is set\n");
05012 #endif
05013 #if defined(CONFIG_RSBAC_DAZ_CACHE)
05014 rsbac_printk(KERN_DEBUG "rsbac_daz_ttl is %u\n",
05015 rsbac_daz_get_ttl());
05016 #endif
05017 #if defined(CONFIG_RSBAC_AUTH_LEARN)
05018 if(rsbac_auth_learn)
05019 rsbac_printk(KERN_DEBUG "rsbac_auth_learn is set\n");
05020 #endif
05021 #if defined(CONFIG_RSBAC_ACL_LEARN)
05022 if(rsbac_acl_learn_fd)
05023 rsbac_printk(KERN_DEBUG "rsbac_acl_learn_fd is set\n");
05024 #endif
05025 #ifdef CONFIG_RSBAC_CAP_PROC_HIDE
05026 if(rsbac_cap_process_hiding)
05027 rsbac_printk(KERN_DEBUG "rsbac_cap_process_hiding is set\n");
05028 #endif
05029 #ifdef CONFIG_RSBAC_CAP_LOG_MISSING
05030 if(rsbac_cap_log_missing)
05031 rsbac_printk(KERN_DEBUG "rsbac_cap_log_missing is set\n");
05032 #endif
05033 #ifdef CONFIG_RSBAC_JAIL_LOG_MISSING
05034 if(rsbac_jail_log_missing)
05035 rsbac_printk(KERN_DEBUG "rsbac_jail_log_missing is set\n");
05036 #endif
05037 #ifdef CONFIG_RSBAC_ALLOW_DAC_DISABLE_FULL
05038 if(rsbac_dac_disable)
05039 rsbac_printk(KERN_DEBUG "rsbac_dac_disable is set\n");
05040 #endif
05041 #ifdef CONFIG_RSBAC_RMSG_NOSYSLOG
05042 if(rsbac_nosyslog)
05043 rsbac_printk(KERN_DEBUG "rsbac_nosyslog is set\n");
05044 #endif
05045 #ifdef CONFIG_RSBAC_SYSLOG_RATE
05046 if(rsbac_syslog_rate != CONFIG_RSBAC_SYSLOG_RATE_DEF)
05047 rsbac_printk(KERN_DEBUG "rsbac_syslog_rate is %u\n",
05048 rsbac_syslog_rate);
05049 #endif
05050 #ifdef CONFIG_RSBAC_INIT_DELAY
05051 if(rsbac_no_delay_init)
05052 rsbac_printk(KERN_DEBUG "rsbac_no_delay_init is set\n");
05053 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
05054 if(rsbac_delayed_root_str[0])
05055 rsbac_printk(KERN_DEBUG "rsbac_delayed_root is %s\n",
05056 rsbac_delayed_root_str);
05057 #else
05058 if(rsbac_delayed_root)
05059 rsbac_printk(KERN_DEBUG "rsbac_delayed_root is %02u:%02u\n",
05060 MAJOR(rsbac_delayed_root), MINOR(rsbac_delayed_root));
05061 #endif
05062 #endif
05063 if(rsbac_no_defaults)
05064 rsbac_printk(KERN_DEBUG "rsbac_no_defaults is set\n");
05065
05066 #if defined(CONFIG_RSBAC_DEBUG)
05067 if(rsbac_debug_ds)
05068 rsbac_printk(KERN_DEBUG "rsbac_debug_ds is set\n");
05069 if(rsbac_debug_write)
05070 rsbac_printk(KERN_DEBUG "rsbac_debug_write is set\n");
05071 if(rsbac_debug_no_write)
05072 rsbac_printk(KERN_DEBUG "rsbac_debug_no_write is set\n");
05073 if(rsbac_debug_stack)
05074 rsbac_printk(KERN_DEBUG "rsbac_debug_stack is set\n");
05075 if(rsbac_debug_lists)
05076 rsbac_printk(KERN_DEBUG "rsbac_debug_lists is set\n");
05077 if(rsbac_debug_aef)
05078 rsbac_printk(KERN_DEBUG "rsbac_debug_aef is set\n");
05079 if(rsbac_debug_adf_default != 1)
05080 rsbac_printk(KERN_DEBUG "rsbac_debug_adf_default is set to %i\n",
05081 rsbac_debug_adf_default);
05082
05083 #if defined(CONFIG_RSBAC_REG)
05084 if(rsbac_debug_reg)
05085 rsbac_printk(KERN_DEBUG "rsbac_debug_reg is set\n");
05086 #endif
05087
05088 #if defined(CONFIG_RSBAC_NET)
05089 if(rsbac_debug_ds_net)
05090 rsbac_printk(KERN_DEBUG "rsbac_debug_ds_net is set\n");
05091 if(rsbac_debug_aef_net)
05092 rsbac_printk(KERN_DEBUG "rsbac_debug_aef_net is set\n");
05093 if(rsbac_debug_adf_net)
05094 rsbac_printk(KERN_DEBUG "rsbac_debug_adf_net is set\n");
05095 #endif
05096
05097 #if defined(CONFIG_RSBAC_MAC)
05098 if(rsbac_debug_ds_mac)
05099 rsbac_printk(KERN_DEBUG "rsbac_debug_ds_mac is set\n");
05100 if(rsbac_debug_aef_mac)
05101 rsbac_printk(KERN_DEBUG "rsbac_debug_aef_mac is set\n");
05102 if(rsbac_debug_adf_mac)
05103 rsbac_printk(KERN_DEBUG "rsbac_debug_adf_mac is set\n");
05104 #endif
05105
05106 #if defined(CONFIG_RSBAC_PM)
05107 if(rsbac_debug_ds_pm)
05108 rsbac_printk(KERN_DEBUG "rsbac_debug_ds_pm is set\n");
05109 if(rsbac_debug_aef_pm)
05110 rsbac_printk(KERN_DEBUG "rsbac_debug_aef_pm is set\n");
05111 if(rsbac_debug_adf_pm)
05112 rsbac_printk(KERN_DEBUG "rsbac_debug_adf_pm is set\n");
05113 #endif
05114
05115 #if defined(CONFIG_RSBAC_DAZ)
05116 if(rsbac_debug_adf_daz)
05117 rsbac_printk(KERN_DEBUG "rsbac_debug_adf_daz is set\n");
05118 #endif
05119
05120 #if defined(CONFIG_RSBAC_RC)
05121 if(rsbac_debug_ds_rc)
05122 rsbac_printk(KERN_DEBUG "rsbac_debug_ds_rc is set\n");
05123 if(rsbac_debug_aef_rc)
05124 rsbac_printk(KERN_DEBUG "rsbac_debug_aef_rc is set\n");
05125 if(rsbac_debug_adf_rc)
05126 rsbac_printk(KERN_DEBUG "rsbac_debug_adf_rc is set\n");
05127 #endif
05128
05129 #if defined(CONFIG_RSBAC_AUTH)
05130 if(rsbac_debug_ds_auth)
05131 rsbac_printk(KERN_DEBUG "rsbac_debug_ds_auth is set\n");
05132 if(rsbac_debug_aef_auth)
05133 rsbac_printk(KERN_DEBUG "rsbac_debug_aef_auth is set\n");
05134 if(rsbac_debug_adf_auth)
05135 rsbac_printk(KERN_DEBUG "rsbac_debug_adf_auth is set\n");
05136 #endif
05137
05138 #if defined(CONFIG_RSBAC_ACL)
05139 if(rsbac_debug_ds_acl)
05140 rsbac_printk(KERN_DEBUG "rsbac_debug_ds_acl is set\n");
05141 if(rsbac_debug_aef_acl)
05142 rsbac_printk(KERN_DEBUG "rsbac_debug_aef_acl is set\n");
05143 if(rsbac_debug_adf_acl)
05144 rsbac_printk(KERN_DEBUG "rsbac_debug_adf_acl is set\n");
05145 #endif
05146
05147 #if defined(CONFIG_RSBAC_JAIL)
05148 if(rsbac_debug_aef_jail)
05149 rsbac_printk(KERN_DEBUG "rsbac_debug_aef_jail is set\n");
05150 if(rsbac_debug_adf_jail)
05151 rsbac_printk(KERN_DEBUG "rsbac_debug_adf_jail is set\n");
05152 #endif
05153
05154 #if defined(CONFIG_RSBAC_PAX)
05155 if(rsbac_debug_adf_pax)
05156 rsbac_printk(KERN_DEBUG "rsbac_debug_adf_pax is set\n");
05157 #endif
05158
05159 #if defined(CONFIG_RSBAC_UM)
05160 if(rsbac_debug_ds_um)
05161 rsbac_printk(KERN_DEBUG "rsbac_debug_ds_um is set\n");
05162 if(rsbac_debug_aef_um)
05163 rsbac_printk(KERN_DEBUG "rsbac_debug_aef_um is set\n");
05164 if(rsbac_debug_adf_um)
05165 rsbac_printk(KERN_DEBUG "rsbac_debug_adf_um is set\n");
05166 #endif
05167
05168 #if defined(CONFIG_RSBAC_AUTO_WRITE) && (CONFIG_RSBAC_AUTO_WRITE > 0)
05169 if(rsbac_debug_auto)
05170 rsbac_printk(KERN_DEBUG "rsbac_debug_auto is set\n");
05171 #endif
05172 #endif /* DEBUG */
05173
05174 }
|
|
||||||||||||
|
|
Definition at line 41 of file debug.c. Referenced by rsbac_init_debug(). |
|
|
Definition at line 167 of file debug.c. Referenced by rsbac_adf_log_switch(), and rsbac_init_debug(). |
|
|
Definition at line 213 of file debug.c. Referenced by rsbac_printk(). |
|
|
Definition at line 232 of file debug.c. Referenced by rsbac_init_debug(). |
|
|
|
|
|
Definition at line 39 of file debug.c. Referenced by rsbac_init_debug(), rsbac_mount(), rsbac_umount(), and writable(). |
|
|
Definition at line 233 of file debug.c. Referenced by rsbac_adf_log_switch(), rsbac_adf_request_int(), rsbac_adf_set_attr(), rsbac_get_adf_log(), and rsbac_init_debug(). |
|
|
Definition at line 165 of file debug.c. Referenced by no_defaults_setup(), register_user_lists(), rsbac_init_acl(), rsbac_init_debug(), and rsbac_init_rc(). |
1.4.2