summaryrefslogtreecommitdiffstats
path: root/security/safesetid/lsm.h
blob: c1ea3c265fcf411a9821df3b5e0135f1dda1f63b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * SafeSetID Linux Security Module
 *
 * Author: Micah Morton <mortonm@chromium.org>
 *
 * Copyright (C) 2018 The Chromium OS Authors.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2, as
 * published by the Free Software Foundation.
 *
 */
#ifndef _SAFESETID_H
#define _SAFESETID_H

#include <linux/types.h>

/* Flag indicating whether initialization completed */
extern int safesetid_initialized;

/* Function type. */
enum safesetid_whitelist_file_write_type {
	SAFESETID_WHITELIST_ADD, /* Add whitelist policy. */
	SAFESETID_WHITELIST_FLUSH, /* Flush whitelist policies. */
};

/* Add entry to safesetid whitelist to allow 'parent' to setid to 'child'. */
int add_safesetid_whitelist_entry(kuid_t parent, kuid_t child);

void flush_safesetid_whitelist_entries(void);

#endif /* _SAFESETID_H */
OpenPOWER on IntegriCloud