linux/security/selinux/ss/sidtab.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Implementation of the SID table type.
 *
 * Original author: Stephen Smalley, <[email protected]>
 * Author: Ondrej Mosnacek, <[email protected]>
 *
 * Copyright (C) 2018 Red Hat, Inc.
 */

#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/rcupdate.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <asm/barrier.h>
#include "flask.h"
#include "security.h"
#include "sidtab.h"
#include "services.h"

struct sidtab_str_cache {};

#define index_to_sid(index)
#define sid_to_index(sid)

int sidtab_init(struct sidtab *s)
{}

static u32 context_to_sid(struct sidtab *s, struct context *context, u32 hash)
{}

int sidtab_set_initial(struct sidtab *s, u32 sid, struct context *context)
{}

int sidtab_hash_stats(struct sidtab *sidtab, char *page)
{}

static u32 sidtab_level_from_count(u32 count)
{}

static int sidtab_alloc_roots(struct sidtab *s, u32 level)
{}

static struct sidtab_entry *sidtab_do_lookup(struct sidtab *s, u32 index,
					     int alloc)
{}

static struct sidtab_entry *sidtab_lookup(struct sidtab *s, u32 index)
{}

static struct sidtab_entry *sidtab_lookup_initial(struct sidtab *s, u32 sid)
{}

static struct sidtab_entry *sidtab_search_core(struct sidtab *s, u32 sid,
					       int force)
{}

struct sidtab_entry *sidtab_search_entry(struct sidtab *s, u32 sid)
{}

struct sidtab_entry *sidtab_search_entry_force(struct sidtab *s, u32 sid)
{}

int sidtab_context_to_sid(struct sidtab *s, struct context *context, u32 *sid)
{}

static void sidtab_convert_hashtable(struct sidtab *s, u32 count)
{}

static int sidtab_convert_tree(union sidtab_entry_inner *edst,
			       union sidtab_entry_inner *esrc, u32 *pos,
			       u32 count, u32 level,
			       struct sidtab_convert_params *convert)
{}

int sidtab_convert(struct sidtab *s, struct sidtab_convert_params *params)
{}

void sidtab_cancel_convert(struct sidtab *s)
{}

void sidtab_freeze_begin(struct sidtab *s, unsigned long *flags)
	__acquires(&s->lock)
{}
void sidtab_freeze_end(struct sidtab *s, unsigned long *flags)
	__releases(&s->lock)
{}

static void sidtab_destroy_entry(struct sidtab_entry *entry)
{}

static void sidtab_destroy_tree(union sidtab_entry_inner entry, u32 level)
{}

void sidtab_destroy(struct sidtab *s)
{}

#if CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE > 0

void sidtab_sid2str_put(struct sidtab *s, struct sidtab_entry *entry,
			const char *str, u32 str_len)
{}

int sidtab_sid2str_get(struct sidtab *s, struct sidtab_entry *entry, char **out,
		       u32 *out_len)
{}

#endif /* CONFIG_SECURITY_SELINUX_SID2STR_CACHE_SIZE > 0 */