xref: /freebsd/sys/compat/linux/linux_persona.h (revision b71a5db306ab1ad1e23c7f9e3c949c6218f43455)
1 /*
2  * $FreeBSD$
3  */
4 
5 #ifndef LINUX_PERSONALITY_H
6 #define LINUX_PERSONALITY_H
7 
8 /*
9  * Flags for bug emulation.
10  *
11  * These occupy the top three bytes.
12  */
13 enum {
14 	LINUX_UNAME26 =			0x0020000,
15 	LINUX_ADDR_NO_RANDOMIZE =	0x0040000,	/* disable randomization
16 							 * of VA space
17 							 */
18 	LINUX_FDPIC_FUNCPTRS =		0x0080000,	/* userspace function
19 							 * ptrs point to descriptors
20 							 * (signal handling)
21 							 */
22 	LINUX_MMAP_PAGE_ZERO =		0x0100000,
23 	LINUX_ADDR_COMPAT_LAYOUT =	0x0200000,
24 	LINUX_READ_IMPLIES_EXEC =	0x0400000,
25 	LINUX_ADDR_LIMIT_32BIT =	0x0800000,
26 	LINUX_SHORT_INODE =		0x1000000,
27 	LINUX_WHOLE_SECONDS =		0x2000000,
28 	LINUX_STICKY_TIMEOUTS =		0x4000000,
29 	LINUX_ADDR_LIMIT_3GB =		0x8000000,
30 };
31 
32 /*
33  * Security-relevant compatibility flags that must be
34  * cleared upon setuid or setgid exec:
35  */
36 #define LINUX_PER_CLEAR_ON_SETID	(LINUX_READ_IMPLIES_EXEC  | \
37 					LINUX_ADDR_NO_RANDOMIZE  | \
38 					LINUX_ADDR_COMPAT_LAYOUT | \
39 					LINUX_MMAP_PAGE_ZERO)
40 
41 /*
42  * Personality types.
43  *
44  * These go in the low byte.  Avoid using the top bit, it will
45  * conflict with error returns.
46  */
47 enum {
48 	LINUX_PER_LINUX =	0x0000,
49 	LINUX_PER_LINUX_32BIT =	0x0000 | LINUX_ADDR_LIMIT_32BIT,
50 	LINUX_PER_LINUX_FDPIC =	0x0000 | LINUX_FDPIC_FUNCPTRS,
51 	LINUX_PER_LINUX32 =	0x0008,
52 	LINUX_PER_LINUX32_3GB =	0x0008 | LINUX_ADDR_LIMIT_3GB,
53 	LINUX_PER_MASK =	0x00ff,
54 };
55 
56 #endif /* LINUX_PERSONALITY_H */
57