2 * sys_mprotect(unsigned long start, size_t len, unsigned long prot)
5 #include "trinity.h" // page_size
11 static void sanitise_mprotect(int childno
)
15 shm
->a1
[childno
] &= PAGE_MASK
;
18 end
= shm
->a1
[childno
] + shm
->a2
[childno
];
19 /* Length must not be zero. */
20 if (shm
->a2
[childno
] == 0) {
21 shm
->a2
[childno
] = rand64();
25 /* End must be after start */
26 if (end
<= shm
->a1
[childno
]) {
27 shm
->a2
[childno
] = rand64();
32 struct syscall syscall_mprotect
= {
43 .values
= { PROT_READ
, PROT_WRITE
, PROT_EXEC
, PROT_SEM
, PROT_GROWSDOWN
, PROT_GROWSUP
},
45 .sanitise
= sanitise_mprotect
,
48 .flags
= AVOID_SYSCALL
, // hopefully temporary.