linux/kernel/ucount.c

// SPDX-License-Identifier: GPL-2.0-only

#include <linux/stat.h>
#include <linux/sysctl.h>
#include <linux/slab.h>
#include <linux/cred.h>
#include <linux/hash.h>
#include <linux/kmemleak.h>
#include <linux/user_namespace.h>

struct ucounts init_ucounts =;

#define UCOUNTS_HASHTABLE_BITS
static struct hlist_head ucounts_hashtable[(1 << UCOUNTS_HASHTABLE_BITS)];
static DEFINE_SPINLOCK(ucounts_lock);

#define ucounts_hashfn(ns, uid)
#define ucounts_hashentry(ns, uid)


#ifdef CONFIG_SYSCTL
static struct ctl_table_set *
set_lookup(struct ctl_table_root *root)
{}

static int set_is_seen(struct ctl_table_set *set)
{}

static int set_permissions(struct ctl_table_header *head,
			   const struct ctl_table *table)
{}

static struct ctl_table_root set_root =;

static long ue_zero =;
static long ue_int_max =;

#define UCOUNT_ENTRY(name)
static struct ctl_table user_table[] =;
#endif /* CONFIG_SYSCTL */

bool setup_userns_sysctls(struct user_namespace *ns)
{}

void retire_userns_sysctls(struct user_namespace *ns)
{}

static struct ucounts *find_ucounts(struct user_namespace *ns, kuid_t uid, struct hlist_head *hashent)
{}

static void hlist_add_ucounts(struct ucounts *ucounts)
{}

static inline bool get_ucounts_or_wrap(struct ucounts *ucounts)
{}

struct ucounts *get_ucounts(struct ucounts *ucounts)
{}

struct ucounts *alloc_ucounts(struct user_namespace *ns, kuid_t uid)
{}

void put_ucounts(struct ucounts *ucounts)
{}

static inline bool atomic_long_inc_below(atomic_long_t *v, int u)
{}

struct ucounts *inc_ucount(struct user_namespace *ns, kuid_t uid,
			   enum ucount_type type)
{}

void dec_ucount(struct ucounts *ucounts, enum ucount_type type)
{}

long inc_rlimit_ucounts(struct ucounts *ucounts, enum rlimit_type type, long v)
{}

bool dec_rlimit_ucounts(struct ucounts *ucounts, enum rlimit_type type, long v)
{}

static void do_dec_rlimit_put_ucounts(struct ucounts *ucounts,
				struct ucounts *last, enum rlimit_type type)
{}

void dec_rlimit_put_ucounts(struct ucounts *ucounts, enum rlimit_type type)
{}

long inc_rlimit_get_ucounts(struct ucounts *ucounts, enum rlimit_type type)
{}

bool is_rlimit_overlimit(struct ucounts *ucounts, enum rlimit_type type, unsigned long rlimit)
{}

static __init int user_namespace_sysctl_init(void)
{}
subsys_initcall(user_namespace_sysctl_init);