XenevaOS
Loading...
Searching...
No Matches
security.h
Go to the documentation of this file.
1#ifndef __LINUX_SECURITY_H__
2#define __LINUX_SECURITY_H__
3
4/* mainline's <linux/security.h> includes this, and serial_core.c relies on
5 * the chain: it calls capable(CAP_SYS_ADMIN) at :349, :938, :1136 and :1995
6 * without including <linux/capability.h> itself. DCL's capable() is a
7 * `static inline`, so an implicit declaration of it would not have resolved
8 * at link time either -- this include is what makes those four call sites
9 * real rather than merely compiling. */
10#include <linux/capability.h>
11
12/*
13 * DCL <linux/security.h> -- lockdown hooks only. mainline mem.c gates
14 * open_port() on security_locked_down(LOCKDOWN_DEV_MEM); with no LSM in
15 * Xeneva the hook always clears. Provided by DCL/linux_mm_shim.c.
16 */
17
18#define LOCKDOWN_NONE 0
19#define LOCKDOWN_INTEGRITY_MAX 1
20#define LOCKDOWN_DEV_MEM 2
21
22int security_locked_down(int reason);
23
24
25/*
26 * LOCKDOWN_TIOCSSERIAL -- the reason serial_core.c:954 passes to
27 * security_locked_down() before it will accept a TIOCSSERIAL ioctl.
28 *
29 * Not in mainline's uapi/linux/lockdown.h order (upstream runs
30 * NONE, INTEGRITY_MAX, CONFIDENTIALITY_MAX, DEV_MEM, ...), because DCL's
31 * header already numbers its three reasons its own way and every caller
32 * treats them as "nonzero means refused" rather than as a sequence. Appended
33 * so it does not disturb the values mem.c already passes. The answer behind
34 * it is unchanged: DCL/linux_mm_shim.c's security_locked_down() returns 0 for
35 * every reason, so this one and LOCKDOWN_DEV_MEM both mean "allowed" --
36 * correct for a single-user system with no LSM, which is what this is.
37 */
38#define LOCKDOWN_TIOCSSERIAL 3
39#endif /* __LINUX_SECURITY_H__ */
int security_locked_down(int reason)