personality.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef _LINUX_PERSONALITY_H
  2. #define _LINUX_PERSONALITY_H
  3. /*
  4. * Flags for bug emulation.
  5. *
  6. * These occupy the top three bytes.
  7. */
  8. enum {
  9. UNAME26 = 0x0020000,
  10. ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */
  11. FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors
  12. * (signal handling)
  13. */
  14. MMAP_PAGE_ZERO = 0x0100000,
  15. ADDR_COMPAT_LAYOUT = 0x0200000,
  16. READ_IMPLIES_EXEC = 0x0400000,
  17. ADDR_LIMIT_32BIT = 0x0800000,
  18. SHORT_INODE = 0x1000000,
  19. WHOLE_SECONDS = 0x2000000,
  20. STICKY_TIMEOUTS = 0x4000000,
  21. ADDR_LIMIT_3GB = 0x8000000,
  22. };
  23. /*
  24. * Security-relevant compatibility flags that must be
  25. * cleared upon setuid or setgid exec:
  26. */
  27. #define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \
  28. ADDR_NO_RANDOMIZE | \
  29. ADDR_COMPAT_LAYOUT | \
  30. MMAP_PAGE_ZERO)
  31. /*
  32. * Personality types.
  33. *
  34. * These go in the low byte. Avoid using the top bit, it will
  35. * conflict with error returns.
  36. */
  37. enum {
  38. PER_LINUX = 0x0000,
  39. PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
  40. PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
  41. PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
  42. PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
  43. PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
  44. WHOLE_SECONDS | SHORT_INODE,
  45. PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
  46. PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
  47. PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
  48. PER_BSD = 0x0006,
  49. PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
  50. PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
  51. PER_LINUX32 = 0x0008,
  52. PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
  53. PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
  54. PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
  55. PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */
  56. PER_RISCOS = 0x000c,
  57. PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
  58. PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
  59. PER_OSF4 = 0x000f, /* OSF/1 v4 */
  60. PER_HPUX = 0x0010,
  61. PER_MASK = 0x00ff,
  62. };
  63. #endif /* _LINUX_PERSONALITY_H */