Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions | Variables
common.c File Reference
#include <linux/uaccess.h>
#include <linux/slab.h>
#include <linux/security.h>
#include "common.h"
#include "builtin-policy.h"

Go to the source code of this file.

Data Structures

struct  tomoyo_query
 

Functions

const chartomoyo_yesno (const unsigned int value)
 
 LIST_HEAD (tomoyo_namespace_list)
 
void tomoyo_init_policy_namespace (struct tomoyo_policy_namespace *ns)
 
struct tomoyo_profiletomoyo_profile (const struct tomoyo_policy_namespace *ns, const u8 profile)
 

Variables

const char *const tomoyo_mode [TOMOYO_CONFIG_MAX_MODE]
 
const char *const tomoyo_mac_keywords [TOMOYO_MAX_MAC_INDEX+TOMOYO_MAX_MAC_CATEGORY_INDEX]
 
const char *const tomoyo_condition_keyword [TOMOYO_MAX_CONDITION_KEYWORD]
 
const char *const tomoyo_path_keyword [TOMOYO_MAX_PATH_OPERATION]
 
const char *const tomoyo_socket_keyword [TOMOYO_MAX_NETWORK_OPERATION]
 

.

: Pointer to "struct tomoyo_profile".

Returns 0 on success, negative value otherwise.

const char *const tomoyo_dif [TOMOYO_MAX_DOMAIN_INFO_FLAGS]
 
int tomoyo_supervisor (struct tomoyo_request_info *r, const char *fmt,...)
 
void tomoyo_update_stat (const u8 index)
 
int tomoyo_open_control (const u8 type, struct file *file)
 
unsigned int tomoyo_poll_control (struct file *file, poll_table *wait)
 
ssize_t tomoyo_read_control (struct tomoyo_io_buffer *head, char __user *buffer, const int buffer_len)
 
ssize_t tomoyo_write_control (struct tomoyo_io_buffer *head, const char __user *buffer, const int buffer_len)
 
int tomoyo_close_control (struct tomoyo_io_buffer *head)
 
void tomoyo_check_profile (void)
 
void __init tomoyo_load_builtin_policy (void)
 

Function Documentation

LIST_HEAD ( tomoyo_namespace_list  )
void tomoyo_check_profile ( void  )

tomoyo_check_profile - Check all profiles currently assigned to domains are defined.

Definition at line 2703 of file common.c.

int tomoyo_close_control ( struct tomoyo_io_buffer head)

tomoyo_close_control - close() for /sys/kernel/security/tomoyo/ interface.

: Pointer to "struct tomoyo_io_buffer".

Returns 0.

Definition at line 2687 of file common.c.

void tomoyo_init_policy_namespace ( struct tomoyo_policy_namespace ns)

tomoyo_init_policy_namespace - Initialize namespace.

: Pointer to "struct tomoyo_policy_namespace".

Returns nothing.

Definition at line 343 of file common.c.

void __init tomoyo_load_builtin_policy ( void  )

tomoyo_load_builtin_policy - Load built-in policy.

Returns nothing.

Definition at line 2738 of file common.c.

int tomoyo_open_control ( const u8  type,
struct file file 
)

Definition at line 2347 of file common.c.

unsigned int tomoyo_poll_control ( struct file file,
poll_table wait 
)

Definition at line 2457 of file common.c.

tomoyo_profile - Find a profile.

: Pointer to "struct tomoyo_policy_namespace". : Profile number to find.

Returns pointer to "struct tomoyo_profile".

Definition at line 527 of file common.c.

ssize_t tomoyo_read_control ( struct tomoyo_io_buffer head,
char __user buffer,
const int  buffer_len 
)

tomoyo_read_control - read() for /sys/kernel/security/tomoyo/ interface.

: Pointer to "struct tomoyo_io_buffer". : Poiner to buffer to write to. : Size of .

Returns bytes read on success, negative value otherwise.

Definition at line 2513 of file common.c.

int tomoyo_supervisor ( struct tomoyo_request_info r,
const char fmt,
  ... 
)

tomoyo_supervisor - Ask for the supervisor's decision.

: Pointer to "struct tomoyo_request_info". : The printf()'s format string, followed by parameters.

Returns 0 if the supervisor decided to permit the access request which violated the policy in enforcing mode, TOMOYO_RETRY_REQUEST if the supervisor decided to retry the access request which violated the policy in enforcing mode, 0 if it is not in enforcing mode, -EPERM otherwise.

Definition at line 1995 of file common.c.

void tomoyo_update_stat ( const u8  index)

tomoyo_update_stat - Update statistic counters.

: Index for policy type.

Returns nothing.

Definition at line 2268 of file common.c.

ssize_t tomoyo_write_control ( struct tomoyo_io_buffer head,
const char __user buffer,
const int  buffer_len 
)

tomoyo_write_control - write() for /sys/kernel/security/tomoyo/ interface.

: Pointer to "struct tomoyo_io_buffer". : Pointer to buffer to read from. : Size of .

Returns on success, negative value otherwise.

Definition at line 2585 of file common.c.

const char* tomoyo_yesno ( const unsigned int  value)

tomoyo_yesno - Return "yes" or "no".

: Bool value.

Definition at line 181 of file common.c.

Variable Documentation

const char* const tomoyo_condition_keyword[TOMOYO_MAX_CONDITION_KEYWORD]

Definition at line 72 of file common.c.

Initial value:
= {
[TOMOYO_DIF_QUOTA_WARNED] = "quota_exceeded\n",
[TOMOYO_DIF_TRANSITION_FAILED] = "transition_failed\n",
}

Definition at line 1132 of file common.c.

Definition at line 22 of file common.c.

Initial value:
= {
[TOMOYO_CONFIG_DISABLED] = "disabled",
[TOMOYO_CONFIG_LEARNING] = "learning",
[TOMOYO_CONFIG_PERMISSIVE] = "permissive",
[TOMOYO_CONFIG_ENFORCING] = "enforcing"
}

Definition at line 13 of file common.c.

const char* const tomoyo_path_keyword[TOMOYO_MAX_PATH_OPERATION]
Initial value:
= {
[TOMOYO_TYPE_EXECUTE] = "execute",
[TOMOYO_TYPE_READ] = "read",
[TOMOYO_TYPE_WRITE] = "write",
[TOMOYO_TYPE_APPEND] = "append",
[TOMOYO_TYPE_UNLINK] = "unlink",
[TOMOYO_TYPE_GETATTR] = "getattr",
[TOMOYO_TYPE_RMDIR] = "rmdir",
[TOMOYO_TYPE_TRUNCATE] = "truncate",
[TOMOYO_TYPE_SYMLINK] = "symlink",
[TOMOYO_TYPE_CHROOT] = "chroot",
[TOMOYO_TYPE_UMOUNT] = "unmount",
}

Definition at line 141 of file common.c.

const char* const tomoyo_socket_keyword[TOMOYO_MAX_NETWORK_OPERATION]
Initial value:
= {
[TOMOYO_NETWORK_BIND] = "bind",
[TOMOYO_NETWORK_LISTEN] = "listen",
[TOMOYO_NETWORK_CONNECT] = "connect",
[TOMOYO_NETWORK_SEND] = "send",
}

Definition at line 156 of file common.c.