52#define AVC_NUM_SLOTS 512
53#define AVC_NUM_RECLAIM 16
54#define AVC_DEF_THRESHOLD 384
179 errmsg(
"SELinux: failed to get initial security label: %m")));
203 char *ncontext =
NULL;
248 if (
strcmp(scontext, ncontext) == 0)
312 cache->
tclass == tclass &&
414 errmsg(
"SELinux: security policy violation")));
496 "userspace access vector cache",
514 errmsg(
"SELinux: could not open selinux status : %m")));
517 (
errmsg(
"SELinux: kernel status page uses fallback mode")));
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define palloc0_object(type)
uint32 hash_bytes(const unsigned char *k, int keylen)
bool sepgsql_get_debug_audit(void)
void on_proc_exit(pg_on_exit_callback function, Datum arg)
char * sepgsql_get_client_label(void)
List * lcons(void *datum, List *list)
char * MemoryContextStrdup(MemoryContext context, const char *string)
void MemoryContextReset(MemoryContext context)
char * pstrdup(const char *in)
void pfree(void *pointer)
MemoryContext TopMemoryContext
#define AllocSetContextCreate
#define ALLOCSET_DEFAULT_SIZES
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
#define foreach_delete_current(lst, var_or_cell)
static unsigned hash(unsigned *uv, int n)
char * GetSecurityLabel(const ObjectAddress *object, const char *provider)
char * sepgsql_compute_create(const char *scontext, const char *tcontext, uint16 tclass, const char *objname)
int sepgsql_get_mode(void)
void sepgsql_compute_avd(const char *scontext, const char *tcontext, uint16 tclass, struct av_decision *avd)
void sepgsql_audit_log(bool denied, bool enforcing, const char *scontext, const char *tcontext, uint16 tclass, uint32 audited, const char *audit_name)
bool sepgsql_getenforce(void)
#define SEPGSQL_MODE_INTERNAL
#define SEPG_CLASS_DB_PROCEDURE
#define SEPGSQL_AVC_NOAUDIT
#define SEPGSQL_LABEL_TAG
#define SEPG_CLASS_PROCESS
static uint32 sepgsql_avc_hash(const char *scontext, const char *tcontext, uint16 tclass)
static void sepgsql_avc_reclaim(void)
char * sepgsql_avc_trusted_proc(Oid functionId)
bool sepgsql_avc_check_perms_label(const char *tcontext, uint16 tclass, uint32 required, const char *audit_name, bool abort_on_violation)
static MemoryContext avc_mem_cxt
static bool sepgsql_avc_check_valid(void)
static char * sepgsql_avc_unlabeled(void)
static void sepgsql_avc_reset(void)
static void sepgsql_avc_exit(int code, Datum arg)
static List * avc_slots[AVC_NUM_SLOTS]
static int avc_num_caches
static char * avc_unlabeled
#define AVC_DEF_THRESHOLD
static avc_cache * sepgsql_avc_lookup(const char *scontext, const char *tcontext, uint16 tclass)
static avc_cache * sepgsql_avc_compute(const char *scontext, const char *tcontext, uint16 tclass)
void sepgsql_avc_init(void)
bool sepgsql_avc_check_perms(const ObjectAddress *tobject, uint16 tclass, uint32 required, const char *audit_name, bool abort_on_violation)