Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
context.h File Reference
#include <linux/cred.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include "policy.h"

Go to the source code of this file.

Data Structures

struct  aa_file_cxt
 
struct  aa_task_cxt
 

Functions

struct aa_task_cxtaa_alloc_task_context (gfp_t flags)
 
void aa_free_task_context (struct aa_task_cxt *cxt)
 
void aa_dup_task_context (struct aa_task_cxt *new, const struct aa_task_cxt *old)
 
int aa_replace_current_profile (struct aa_profile *profile)
 
int aa_set_current_onexec (struct aa_profile *profile)
 
int aa_set_current_hat (struct aa_profile *profile, u64 token)
 
int aa_restore_previous_profile (u64 cookie)
 

Function Documentation

struct aa_task_cxt* aa_alloc_task_context ( gfp_t  flags)
read

aa_alloc_task_context - allocate a new task_cxt : gfp flags for allocation

Returns: allocated buffer or NULL on failure

Definition at line 38 of file context.c.

void aa_dup_task_context ( struct aa_task_cxt new,
const struct aa_task_cxt old 
)

aa_dup_task_context - duplicate a task context, incrementing reference counts : a blank task context (NOT NULL) : the task context to copy (NOT NULL)

Definition at line 63 of file context.c.

void aa_free_task_context ( struct aa_task_cxt cxt)

aa_free_task_context - free a task_cxt : task_cxt to free (MAYBE NULL)

Definition at line 47 of file context.c.

int aa_replace_current_profile ( struct aa_profile profile)

aa_replace_current_profile - replace the current tasks profiles : new profile (NOT NULL)

Returns: 0 or error on failure

Definition at line 77 of file context.c.

int aa_restore_previous_profile ( u64  token)

aa_restore_previous_profile - exit from hat context restoring the profile : the token that must be matched to exit hat context

Attempt to return out of a hat to the previous profile. The token must match the stored token value.

Returns: 0 or error of failure

Definition at line 183 of file context.c.

int aa_set_current_hat ( struct aa_profile profile,
u64  token 
)

aa_set_current_hat - set the current tasks hat : profile to set as the current hat (NOT NULL) : token value that must be specified to change from the hat

Do switch of tasks hat. If the task is currently in a hat validate the token to match.

Returns: 0 or error on failure

Definition at line 145 of file context.c.

int aa_set_current_onexec ( struct aa_profile profile)

aa_set_current_onexec - set the tasks change_profile to happen onexec : system profile to set at exec (MAYBE NULL to clear value)

Returns: 0 or error on failure

Definition at line 119 of file context.c.