Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
smack_lsm.c File Reference
#include <linux/xattr.h>
#include <linux/pagemap.h>
#include <linux/mount.h>
#include <linux/stat.h>
#include <linux/kd.h>
#include <asm/ioctls.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/udp.h>
#include <linux/slab.h>
#include <linux/mutex.h>
#include <linux/pipe_fs_i.h>
#include <net/cipso_ipv4.h>
#include <linux/audit.h>
#include <linux/magic.h>
#include <linux/dcache.h>
#include <linux/personality.h>
#include <linux/msg.h>
#include <linux/shm.h>
#include <linux/binfmts.h>
#include "smack.h"

Go to the source code of this file.

Macros

#define task_security(task)   (task_cred_xxx((task), security))
 
#define TRANS_TRUE   "TRUE"
 
#define TRANS_TRUE_SIZE   4
 

Functions

struct inode_smacknew_inode_smack (char *smack)
 
: where to put the attribute name

: where to put the attribute value : where to put the length of the attribute

Returns 0 if it all works out, -ENOMEM if there's no memory

: name of the attribute

smack_inode_removexattr - Smack check on removexattr : the object

Removing the Smack attribute requires CAP_MAC_ADMIN

Returns 0 if access is permitted, an error code otherwise

: attribute name

smack_inode_setsecurity - set smack xattrs : the object

: attribute value : size of the attribute : unused

Sets the named attribute in the appropriate blob

Returns 0 on success, or an error code

: unused

smack_inode_getxattr - Smack check on getxattr : the object

Returns 0 if access is permitted, an error code otherwise

: the name of the attribute in /proc/.../attr

smack_setprocattr - Smack process attribute setting : the object task

: the value to set : the size of the value

Sets the Smack value of the task. Only setting self is permitted and only with privilege

Returns the length of the smack label or an error code

struct security_operations smack_ops
 
 security_initcall (smack_init)
 

Macro Definition Documentation

#define task_security (   task)    (task_cred_xxx((task), security))

Definition at line 43 of file smack_lsm.c.

#define TRANS_TRUE   "TRUE"

Definition at line 45 of file smack_lsm.c.

#define TRANS_TRUE_SIZE   4

Definition at line 46 of file smack_lsm.c.

Function Documentation

struct inode_smack* new_inode_smack ( char smack)
read

new_inode_smack - allocate an inode security blob : a pointer to the Smack label to use in the blob

Returns the new blob or NULL if there's no memory available

Definition at line 84 of file smack_lsm.c.

security_initcall ( smack_init  )

Variable Documentation

struct security_operations smack_ops

Definition at line 3401 of file smack_lsm.c.