#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/audit.h>
#include "security.h"
#include "policydb.h"
#include "conditional.h"
#include "mls.h"
#include "services.h"
#ifdef CONFIG_SECURITY_SELINUX_DEBUG
static const char *const symtab_name[SYM_NUM] = …;
#endif
struct policydb_compat_info { … };
static const struct policydb_compat_info policydb_compat[] = …;
static const struct policydb_compat_info *
policydb_lookup_compat(unsigned int version)
{ … }
static int perm_destroy(void *key, void *datum, void *p)
{ … }
static int common_destroy(void *key, void *datum, void *p)
{ … }
static void constraint_expr_destroy(struct constraint_expr *expr)
{ … }
static int cls_destroy(void *key, void *datum, void *p)
{ … }
static int role_destroy(void *key, void *datum, void *p)
{ … }
static int type_destroy(void *key, void *datum, void *p)
{ … }
static int user_destroy(void *key, void *datum, void *p)
{ … }
static int sens_destroy(void *key, void *datum, void *p)
{ … }
static int cat_destroy(void *key, void *datum, void *p)
{ … }
static int (*const destroy_f[SYM_NUM])(void *key, void *datum, void *datap) = …;
static int filenametr_destroy(void *key, void *datum, void *p)
{ … }
static int range_tr_destroy(void *key, void *datum, void *p)
{ … }
static int role_tr_destroy(void *key, void *datum, void *p)
{ … }
static void ocontext_destroy(struct ocontext *c, unsigned int i)
{ … }
static int roles_init(struct policydb *p)
{ … }
static u32 filenametr_hash(const void *k)
{ … }
static int filenametr_cmp(const void *k1, const void *k2)
{ … }
static const struct hashtab_key_params filenametr_key_params = …;
struct filename_trans_datum *
policydb_filenametr_search(struct policydb *p, struct filename_trans_key *key)
{ … }
static u32 rangetr_hash(const void *k)
{ … }
static int rangetr_cmp(const void *k1, const void *k2)
{ … }
static const struct hashtab_key_params rangetr_key_params = …;
struct mls_range *policydb_rangetr_search(struct policydb *p,
struct range_trans *key)
{ … }
static u32 role_trans_hash(const void *k)
{ … }
static int role_trans_cmp(const void *k1, const void *k2)
{ … }
static const struct hashtab_key_params roletr_key_params = …;
struct role_trans_datum *policydb_roletr_search(struct policydb *p,
struct role_trans_key *key)
{ … }
static void policydb_init(struct policydb *p)
{ … }
static int common_index(void *key, void *datum, void *datap)
{ … }
static int class_index(void *key, void *datum, void *datap)
{ … }
static int role_index(void *key, void *datum, void *datap)
{ … }
static int type_index(void *key, void *datum, void *datap)
{ … }
static int user_index(void *key, void *datum, void *datap)
{ … }
static int sens_index(void *key, void *datum, void *datap)
{ … }
static int cat_index(void *key, void *datum, void *datap)
{ … }
static int (*const index_f[SYM_NUM])(void *key, void *datum, void *datap) = …;
#ifdef CONFIG_SECURITY_SELINUX_DEBUG
static void hash_eval(struct hashtab *h, const char *hash_name,
const char *hash_details)
{ … }
static void symtab_hash_eval(struct symtab *s)
{ … }
#else
static inline void hash_eval(struct hashtab *h, const char *hash_name,
const char *hash_details)
{
}
static inline void symtab_hash_eval(struct symtab *s)
{
}
#endif
static int policydb_index(struct policydb *p)
{ … }
void policydb_destroy(struct policydb *p)
{ … }
int policydb_load_isids(struct policydb *p, struct sidtab *s)
{ … }
int policydb_class_isvalid(struct policydb *p, unsigned int class)
{ … }
int policydb_role_isvalid(struct policydb *p, unsigned int role)
{ … }
int policydb_type_isvalid(struct policydb *p, unsigned int type)
{ … }
int policydb_context_isvalid(struct policydb *p, struct context *c)
{ … }
static int mls_read_range_helper(struct mls_range *r, void *fp)
{ … }
static int context_read_and_validate(struct context *c, struct policydb *p,
void *fp)
{ … }
static int str_read(char **strp, gfp_t flags, void *fp, u32 len)
{ … }
static int perm_read(struct policydb *p, struct symtab *s, void *fp)
{ … }
static int common_read(struct policydb *p, struct symtab *s, void *fp)
{ … }
static void type_set_init(struct type_set *t)
{ … }
static int type_set_read(struct type_set *t, void *fp)
{ … }
static int read_cons_helper(struct policydb *p, struct constraint_node **nodep,
u32 ncons, int allowxtarget, void *fp)
{ … }
static int class_read(struct policydb *p, struct symtab *s, void *fp)
{ … }
static int role_read(struct policydb *p, struct symtab *s, void *fp)
{ … }
static int type_read(struct policydb *p, struct symtab *s, void *fp)
{ … }
static int mls_read_level(struct mls_level *lp, void *fp)
{ … }
static int user_read(struct policydb *p, struct symtab *s, void *fp)
{ … }
static int sens_read(struct policydb *p, struct symtab *s, void *fp)
{ … }
static int cat_read(struct policydb *p, struct symtab *s, void *fp)
{ … }
static int (*const read_f[SYM_NUM])(struct policydb *p, struct symtab *s,
void *fp) = …;
static int user_bounds_sanity_check(void *key, void *datum, void *datap)
{ … }
static int role_bounds_sanity_check(void *key, void *datum, void *datap)
{ … }
static int type_bounds_sanity_check(void *key, void *datum, void *datap)
{ … }
static int policydb_bounds_sanity_check(struct policydb *p)
{ … }
u16 string_to_security_class(struct policydb *p, const char *name)
{ … }
u32 string_to_av_perm(struct policydb *p, u16 tclass, const char *name)
{ … }
static int range_read(struct policydb *p, void *fp)
{ … }
static int filename_trans_read_helper_compat(struct policydb *p, void *fp)
{ … }
static int filename_trans_read_helper(struct policydb *p, void *fp)
{ … }
static int filename_trans_read(struct policydb *p, void *fp)
{ … }
static int genfs_read(struct policydb *p, void *fp)
{ … }
static int ocontext_read(struct policydb *p,
const struct policydb_compat_info *info, void *fp)
{ … }
int policydb_read(struct policydb *p, void *fp)
{ … }
static int mls_write_level(struct mls_level *l, void *fp)
{ … }
static int mls_write_range_helper(struct mls_range *r, void *fp)
{ … }
static int sens_write(void *vkey, void *datum, void *ptr)
{ … }
static int cat_write(void *vkey, void *datum, void *ptr)
{ … }
static int role_trans_write_one(void *key, void *datum, void *ptr)
{ … }
static int role_trans_write(struct policydb *p, void *fp)
{ … }
static int role_allow_write(struct role_allow *r, void *fp)
{ … }
static int context_write(struct policydb *p, struct context *c, void *fp)
{ … }
static int perm_write(void *vkey, void *datum, void *fp)
{ … }
static int common_write(void *vkey, void *datum, void *ptr)
{ … }
static int type_set_write(struct type_set *t, void *fp)
{ … }
static int write_cons_helper(struct policydb *p, struct constraint_node *node,
void *fp)
{ … }
static int class_write(void *vkey, void *datum, void *ptr)
{ … }
static int role_write(void *vkey, void *datum, void *ptr)
{ … }
static int type_write(void *vkey, void *datum, void *ptr)
{ … }
static int user_write(void *vkey, void *datum, void *ptr)
{ … }
static int (*const write_f[SYM_NUM])(void *key, void *datum, void *datap) = …;
static int ocontext_write(struct policydb *p,
const struct policydb_compat_info *info, void *fp)
{ … }
static int genfs_write(struct policydb *p, void *fp)
{ … }
static int range_write_helper(void *key, void *data, void *ptr)
{ … }
static int range_write(struct policydb *p, void *fp)
{ … }
static int filename_write_helper_compat(void *key, void *data, void *ptr)
{ … }
static int filename_write_helper(void *key, void *data, void *ptr)
{ … }
static int filename_trans_write(struct policydb *p, void *fp)
{ … }
int policydb_write(struct policydb *p, void *fp)
{ … }