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