File: paxctl.h

package info (click to toggle)
paxctl 0.9-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 108 kB
  • ctags: 84
  • sloc: ansic: 551; makefile: 37
file content (71 lines) | stat: -rw-r--r-- 1,601 bytes parent folder | download
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef __PAXCTL_H
#define __PAXCTL_H

#include <elf.h>

#define PAXCTL_VERSION "0.9"

struct pax_state;

struct elf_ops {
  int (* const modify_phdr)(struct pax_state * const);
  union {
    Elf32_Phdr * _32;
    Elf64_Phdr * _64;
  } phdr;
  union {
    Elf32_Half _32;
    Elf64_Half _64;
  } phnum;
  union {
    Elf32_Shdr * _32;
    Elf64_Shdr * _64;
  } shdr;
  union {
    Elf32_Half _32;
    Elf64_Half _64;
  } shnum;
};

struct pax_state {
  char ** argv;
  unsigned int flags_on;
  unsigned int flags_off;
  unsigned int files;
  unsigned int quiet:1;
  unsigned int shortonly:1;
  unsigned int view:1;
  unsigned int convert:1;
  unsigned int create:1;
  struct elf_ops * ops;
  int fd;
  unsigned char * map;
  size_t size;
};

#ifndef PT_GNU_STACK
#define PT_GNU_STACK	0x6474e551	/* Indicates vanilla stack executability */
#endif

#ifndef PT_PAX_FLAGS

#define PT_PAX_FLAGS	0x65041580

#define PF_PAGEEXEC	(1U << 4)	/* Enable  PAGEEXEC */
#define PF_NOPAGEEXEC	(1U << 5)	/* Disable PAGEEXEC */
#define PF_SEGMEXEC	(1U << 6)	/* Enable  SEGMEXEC */
#define PF_NOSEGMEXEC	(1U << 7)	/* Disable SEGMEXEC */
#define PF_MPROTECT	(1U << 8)	/* Enable  MPROTECT */
#define PF_NOMPROTECT	(1U << 9)	/* Disable MPROTECT */
#define PF_RANDEXEC	(1U << 10)	/* Enable  RANDEXEC */
#define PF_NORANDEXEC	(1U << 11)	/* Disable RANDEXEC */
#define PF_EMUTRAMP	(1U << 12)	/* Enable  EMUTRAMP */
#define PF_NOEMUTRAMP	(1U << 13)	/* Disable EMUTRAMP */
#define PF_RANDMMAP	(1U << 14)	/* Enable  RANDMMAP */
#define PF_NORANDMMAP	(1U << 15)	/* Disable RANDMMAP */

#endif

#define PF_PAX_MASK	0xFFF0U

#endif