1*11be35a1SLionel Sambuc /* $NetBSD: t_mprotect.c,v 1.3 2011/07/20 22:53:44 jym Exp $ */
2*11be35a1SLionel Sambuc
3*11be35a1SLionel Sambuc /*-
4*11be35a1SLionel Sambuc * Copyright (c) 2011 The NetBSD Foundation, Inc.
5*11be35a1SLionel Sambuc * All rights reserved.
6*11be35a1SLionel Sambuc *
7*11be35a1SLionel Sambuc * This code is derived from software contributed to The NetBSD Foundation
8*11be35a1SLionel Sambuc * by Jukka Ruohonen.
9*11be35a1SLionel Sambuc *
10*11be35a1SLionel Sambuc * Redistribution and use in source and binary forms, with or without
11*11be35a1SLionel Sambuc * modification, are permitted provided that the following conditions
12*11be35a1SLionel Sambuc * are met:
13*11be35a1SLionel Sambuc * 1. Redistributions of source code must retain the above copyright
14*11be35a1SLionel Sambuc * notice, this list of conditions and the following disclaimer.
15*11be35a1SLionel Sambuc * 2. Redistributions in binary form must reproduce the above copyright
16*11be35a1SLionel Sambuc * notice, this list of conditions and the following disclaimer in the
17*11be35a1SLionel Sambuc * documentation and/or other materials provided with the distribution.
18*11be35a1SLionel Sambuc *
19*11be35a1SLionel Sambuc * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20*11be35a1SLionel Sambuc * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21*11be35a1SLionel Sambuc * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22*11be35a1SLionel Sambuc * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23*11be35a1SLionel Sambuc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24*11be35a1SLionel Sambuc * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25*11be35a1SLionel Sambuc * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*11be35a1SLionel Sambuc * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27*11be35a1SLionel Sambuc * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28*11be35a1SLionel Sambuc * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29*11be35a1SLionel Sambuc * POSSIBILITY OF SUCH DAMAGE.
30*11be35a1SLionel Sambuc */
31*11be35a1SLionel Sambuc #include <sys/cdefs.h>
32*11be35a1SLionel Sambuc __RCSID("$NetBSD: t_mprotect.c,v 1.3 2011/07/20 22:53:44 jym Exp $");
33*11be35a1SLionel Sambuc
34*11be35a1SLionel Sambuc #include <sys/param.h>
35*11be35a1SLionel Sambuc #include <sys/mman.h>
36*11be35a1SLionel Sambuc #include <sys/sysctl.h>
37*11be35a1SLionel Sambuc #include <sys/wait.h>
38*11be35a1SLionel Sambuc
39*11be35a1SLionel Sambuc #include <errno.h>
40*11be35a1SLionel Sambuc #include <fcntl.h>
41*11be35a1SLionel Sambuc #include <stdlib.h>
42*11be35a1SLionel Sambuc #include <string.h>
43*11be35a1SLionel Sambuc #include <unistd.h>
44*11be35a1SLionel Sambuc
45*11be35a1SLionel Sambuc #include <atf-c.h>
46*11be35a1SLionel Sambuc
47*11be35a1SLionel Sambuc #include "../common/exec_prot.h"
48*11be35a1SLionel Sambuc
49*11be35a1SLionel Sambuc static long page = 0;
50*11be35a1SLionel Sambuc static int pax_global = -1;
51*11be35a1SLionel Sambuc static int pax_enabled = -1;
52*11be35a1SLionel Sambuc static char path[] = "mmap";
53*11be35a1SLionel Sambuc
54*11be35a1SLionel Sambuc static void sighandler(int);
55*11be35a1SLionel Sambuc static bool paxinit(void);
56*11be35a1SLionel Sambuc static bool paxset(int, int);
57*11be35a1SLionel Sambuc
58*11be35a1SLionel Sambuc static void
sighandler(int signo)59*11be35a1SLionel Sambuc sighandler(int signo)
60*11be35a1SLionel Sambuc {
61*11be35a1SLionel Sambuc _exit(signo);
62*11be35a1SLionel Sambuc }
63*11be35a1SLionel Sambuc
64*11be35a1SLionel Sambuc static bool
paxinit(void)65*11be35a1SLionel Sambuc paxinit(void)
66*11be35a1SLionel Sambuc {
67*11be35a1SLionel Sambuc size_t len = sizeof(int);
68*11be35a1SLionel Sambuc int rv;
69*11be35a1SLionel Sambuc
70*11be35a1SLionel Sambuc rv = sysctlbyname("security.pax.mprotect.global",
71*11be35a1SLionel Sambuc &pax_global, &len, NULL, 0);
72*11be35a1SLionel Sambuc
73*11be35a1SLionel Sambuc if (rv != 0)
74*11be35a1SLionel Sambuc return false;
75*11be35a1SLionel Sambuc
76*11be35a1SLionel Sambuc rv = sysctlbyname("security.pax.mprotect.enabled",
77*11be35a1SLionel Sambuc &pax_enabled, &len, NULL, 0);
78*11be35a1SLionel Sambuc
79*11be35a1SLionel Sambuc if (rv != 0)
80*11be35a1SLionel Sambuc return false;
81*11be35a1SLionel Sambuc
82*11be35a1SLionel Sambuc return paxset(1, 1);
83*11be35a1SLionel Sambuc }
84*11be35a1SLionel Sambuc
85*11be35a1SLionel Sambuc static bool
paxset(int global,int enabled)86*11be35a1SLionel Sambuc paxset(int global, int enabled)
87*11be35a1SLionel Sambuc {
88*11be35a1SLionel Sambuc size_t len = sizeof(int);
89*11be35a1SLionel Sambuc int rv;
90*11be35a1SLionel Sambuc
91*11be35a1SLionel Sambuc rv = sysctlbyname("security.pax.mprotect.global",
92*11be35a1SLionel Sambuc NULL, NULL, &global, len);
93*11be35a1SLionel Sambuc
94*11be35a1SLionel Sambuc if (rv != 0)
95*11be35a1SLionel Sambuc return false;
96*11be35a1SLionel Sambuc
97*11be35a1SLionel Sambuc rv = sysctlbyname("security.pax.mprotect.enabled",
98*11be35a1SLionel Sambuc NULL, NULL, &enabled, len);
99*11be35a1SLionel Sambuc
100*11be35a1SLionel Sambuc if (rv != 0)
101*11be35a1SLionel Sambuc return false;
102*11be35a1SLionel Sambuc
103*11be35a1SLionel Sambuc return true;
104*11be35a1SLionel Sambuc }
105*11be35a1SLionel Sambuc
106*11be35a1SLionel Sambuc
107*11be35a1SLionel Sambuc ATF_TC_WITH_CLEANUP(mprotect_access);
ATF_TC_HEAD(mprotect_access,tc)108*11be35a1SLionel Sambuc ATF_TC_HEAD(mprotect_access, tc)
109*11be35a1SLionel Sambuc {
110*11be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test for EACCES from mprotect(2)");
111*11be35a1SLionel Sambuc }
112*11be35a1SLionel Sambuc
ATF_TC_BODY(mprotect_access,tc)113*11be35a1SLionel Sambuc ATF_TC_BODY(mprotect_access, tc)
114*11be35a1SLionel Sambuc {
115*11be35a1SLionel Sambuc int prot[2] = { PROT_NONE, PROT_READ };
116*11be35a1SLionel Sambuc void *map;
117*11be35a1SLionel Sambuc size_t i;
118*11be35a1SLionel Sambuc int fd;
119*11be35a1SLionel Sambuc
120*11be35a1SLionel Sambuc fd = open(path, O_RDONLY | O_CREAT);
121*11be35a1SLionel Sambuc ATF_REQUIRE(fd >= 0);
122*11be35a1SLionel Sambuc
123*11be35a1SLionel Sambuc /*
124*11be35a1SLionel Sambuc * The call should fail with EACCES if we try to mark
125*11be35a1SLionel Sambuc * a PROT_NONE or PROT_READ file/section as PROT_WRITE.
126*11be35a1SLionel Sambuc */
127*11be35a1SLionel Sambuc for (i = 0; i < __arraycount(prot); i++) {
128*11be35a1SLionel Sambuc
129*11be35a1SLionel Sambuc map = mmap(NULL, page, prot[i], MAP_SHARED, fd, 0);
130*11be35a1SLionel Sambuc
131*11be35a1SLionel Sambuc if (map == MAP_FAILED)
132*11be35a1SLionel Sambuc continue;
133*11be35a1SLionel Sambuc
134*11be35a1SLionel Sambuc errno = 0;
135*11be35a1SLionel Sambuc
136*11be35a1SLionel Sambuc ATF_REQUIRE(mprotect(map, page, PROT_WRITE) != 0);
137*11be35a1SLionel Sambuc ATF_REQUIRE(errno == EACCES);
138*11be35a1SLionel Sambuc ATF_REQUIRE(munmap(map, page) == 0);
139*11be35a1SLionel Sambuc }
140*11be35a1SLionel Sambuc
141*11be35a1SLionel Sambuc ATF_REQUIRE(close(fd) == 0);
142*11be35a1SLionel Sambuc }
143*11be35a1SLionel Sambuc
ATF_TC_CLEANUP(mprotect_access,tc)144*11be35a1SLionel Sambuc ATF_TC_CLEANUP(mprotect_access, tc)
145*11be35a1SLionel Sambuc {
146*11be35a1SLionel Sambuc (void)unlink(path);
147*11be35a1SLionel Sambuc }
148*11be35a1SLionel Sambuc
149*11be35a1SLionel Sambuc ATF_TC(mprotect_err);
ATF_TC_HEAD(mprotect_err,tc)150*11be35a1SLionel Sambuc ATF_TC_HEAD(mprotect_err, tc)
151*11be35a1SLionel Sambuc {
152*11be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test error conditions of mprotect(2)");
153*11be35a1SLionel Sambuc }
154*11be35a1SLionel Sambuc
ATF_TC_BODY(mprotect_err,tc)155*11be35a1SLionel Sambuc ATF_TC_BODY(mprotect_err, tc)
156*11be35a1SLionel Sambuc {
157*11be35a1SLionel Sambuc errno = 0;
158*11be35a1SLionel Sambuc
159*11be35a1SLionel Sambuc ATF_REQUIRE(mprotect((char *)-1, 1, PROT_READ) != 0);
160*11be35a1SLionel Sambuc ATF_REQUIRE(errno == EINVAL);
161*11be35a1SLionel Sambuc }
162*11be35a1SLionel Sambuc
163*11be35a1SLionel Sambuc ATF_TC(mprotect_exec);
ATF_TC_HEAD(mprotect_exec,tc)164*11be35a1SLionel Sambuc ATF_TC_HEAD(mprotect_exec, tc)
165*11be35a1SLionel Sambuc {
166*11be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr",
167*11be35a1SLionel Sambuc "Test mprotect(2) executable space protections");
168*11be35a1SLionel Sambuc }
169*11be35a1SLionel Sambuc
170*11be35a1SLionel Sambuc /*
171*11be35a1SLionel Sambuc * Trivial function -- should fit into a page
172*11be35a1SLionel Sambuc */
ATF_TC_BODY(mprotect_exec,tc)173*11be35a1SLionel Sambuc ATF_TC_BODY(mprotect_exec, tc)
174*11be35a1SLionel Sambuc {
175*11be35a1SLionel Sambuc pid_t pid;
176*11be35a1SLionel Sambuc void *map;
177*11be35a1SLionel Sambuc int sta, xp_support;
178*11be35a1SLionel Sambuc
179*11be35a1SLionel Sambuc xp_support = exec_prot_support();
180*11be35a1SLionel Sambuc
181*11be35a1SLionel Sambuc switch (xp_support) {
182*11be35a1SLionel Sambuc case NOTIMPL:
183*11be35a1SLionel Sambuc atf_tc_skip(
184*11be35a1SLionel Sambuc "Execute protection callback check not implemented");
185*11be35a1SLionel Sambuc break;
186*11be35a1SLionel Sambuc case NO_XP:
187*11be35a1SLionel Sambuc atf_tc_skip(
188*11be35a1SLionel Sambuc "Host does not support executable space protection");
189*11be35a1SLionel Sambuc break;
190*11be35a1SLionel Sambuc case PARTIAL_XP: case PERPAGE_XP: default:
191*11be35a1SLionel Sambuc break;
192*11be35a1SLionel Sambuc }
193*11be35a1SLionel Sambuc
194*11be35a1SLionel Sambuc /*
195*11be35a1SLionel Sambuc * Map a page read/write and copy a trivial assembly function inside.
196*11be35a1SLionel Sambuc * We will then change the mapping rights:
197*11be35a1SLionel Sambuc * - first by setting the execution right, and check that we can
198*11be35a1SLionel Sambuc * call the code found in the allocated page.
199*11be35a1SLionel Sambuc * - second by removing the execution right. This should generate
200*11be35a1SLionel Sambuc * a SIGSEGV on architectures that can enforce --x permissions.
201*11be35a1SLionel Sambuc */
202*11be35a1SLionel Sambuc
203*11be35a1SLionel Sambuc map = mmap(NULL, page, PROT_WRITE|PROT_READ, MAP_ANON, -1, 0);
204*11be35a1SLionel Sambuc ATF_REQUIRE(map != MAP_FAILED);
205*11be35a1SLionel Sambuc
206*11be35a1SLionel Sambuc memcpy(map, (void *)return_one,
207*11be35a1SLionel Sambuc (uintptr_t)return_one_end - (uintptr_t)return_one);
208*11be35a1SLionel Sambuc
209*11be35a1SLionel Sambuc /* give r-x rights then call code in page */
210*11be35a1SLionel Sambuc ATF_REQUIRE(mprotect(map, page, PROT_EXEC|PROT_READ) == 0);
211*11be35a1SLionel Sambuc ATF_REQUIRE(((int (*)(void))map)() == 1);
212*11be35a1SLionel Sambuc
213*11be35a1SLionel Sambuc /* remove --x right */
214*11be35a1SLionel Sambuc ATF_REQUIRE(mprotect(map, page, PROT_READ) == 0);
215*11be35a1SLionel Sambuc
216*11be35a1SLionel Sambuc pid = fork();
217*11be35a1SLionel Sambuc ATF_REQUIRE(pid >= 0);
218*11be35a1SLionel Sambuc
219*11be35a1SLionel Sambuc if (pid == 0) {
220*11be35a1SLionel Sambuc ATF_REQUIRE(signal(SIGSEGV, sighandler) != SIG_ERR);
221*11be35a1SLionel Sambuc ATF_CHECK(((int (*)(void))map)() == 1);
222*11be35a1SLionel Sambuc _exit(0);
223*11be35a1SLionel Sambuc }
224*11be35a1SLionel Sambuc
225*11be35a1SLionel Sambuc (void)wait(&sta);
226*11be35a1SLionel Sambuc
227*11be35a1SLionel Sambuc ATF_REQUIRE(munmap(map, page) == 0);
228*11be35a1SLionel Sambuc
229*11be35a1SLionel Sambuc ATF_REQUIRE(WIFEXITED(sta) != 0);
230*11be35a1SLionel Sambuc
231*11be35a1SLionel Sambuc switch (xp_support) {
232*11be35a1SLionel Sambuc case PARTIAL_XP:
233*11be35a1SLionel Sambuc /* Partial protection might fail; skip the test when it does */
234*11be35a1SLionel Sambuc if (WEXITSTATUS(sta) != SIGSEGV) {
235*11be35a1SLionel Sambuc atf_tc_skip("Host only supports "
236*11be35a1SLionel Sambuc "partial executable space protection");
237*11be35a1SLionel Sambuc }
238*11be35a1SLionel Sambuc break;
239*11be35a1SLionel Sambuc case PERPAGE_XP: default:
240*11be35a1SLionel Sambuc /* Per-page --x protection should not fail */
241*11be35a1SLionel Sambuc ATF_REQUIRE(WEXITSTATUS(sta) == SIGSEGV);
242*11be35a1SLionel Sambuc break;
243*11be35a1SLionel Sambuc }
244*11be35a1SLionel Sambuc }
245*11be35a1SLionel Sambuc
246*11be35a1SLionel Sambuc ATF_TC(mprotect_pax);
ATF_TC_HEAD(mprotect_pax,tc)247*11be35a1SLionel Sambuc ATF_TC_HEAD(mprotect_pax, tc)
248*11be35a1SLionel Sambuc {
249*11be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "PaX restrictions and mprotect(2)");
250*11be35a1SLionel Sambuc atf_tc_set_md_var(tc, "require.user", "root");
251*11be35a1SLionel Sambuc }
252*11be35a1SLionel Sambuc
ATF_TC_BODY(mprotect_pax,tc)253*11be35a1SLionel Sambuc ATF_TC_BODY(mprotect_pax, tc)
254*11be35a1SLionel Sambuc {
255*11be35a1SLionel Sambuc const int prot[4] = { PROT_NONE, PROT_READ, PROT_WRITE };
256*11be35a1SLionel Sambuc const char *str = NULL;
257*11be35a1SLionel Sambuc void *map;
258*11be35a1SLionel Sambuc size_t i;
259*11be35a1SLionel Sambuc int rv;
260*11be35a1SLionel Sambuc
261*11be35a1SLionel Sambuc if (paxinit() != true)
262*11be35a1SLionel Sambuc return;
263*11be35a1SLionel Sambuc
264*11be35a1SLionel Sambuc /*
265*11be35a1SLionel Sambuc * As noted in the original PaX documentation [1],
266*11be35a1SLionel Sambuc * the following restrictions should apply:
267*11be35a1SLionel Sambuc *
268*11be35a1SLionel Sambuc * (1) creating executable anonymous mappings
269*11be35a1SLionel Sambuc *
270*11be35a1SLionel Sambuc * (2) creating executable/writable file mappings
271*11be35a1SLionel Sambuc *
272*11be35a1SLionel Sambuc * (3) making a non-executable mapping executable
273*11be35a1SLionel Sambuc *
274*11be35a1SLionel Sambuc * (4) making an executable/read-only file mapping
275*11be35a1SLionel Sambuc * writable except for performing relocations
276*11be35a1SLionel Sambuc * on an ET_DYN ELF file (non-PIC shared library)
277*11be35a1SLionel Sambuc *
278*11be35a1SLionel Sambuc * The following will test only the case (3).
279*11be35a1SLionel Sambuc *
280*11be35a1SLionel Sambuc * [1] http://pax.grsecurity.net/docs/mprotect.txt
281*11be35a1SLionel Sambuc *
282*11be35a1SLionel Sambuc * (Sun Apr 3 11:06:53 EEST 2011.)
283*11be35a1SLionel Sambuc */
284*11be35a1SLionel Sambuc for (i = 0; i < __arraycount(prot); i++) {
285*11be35a1SLionel Sambuc
286*11be35a1SLionel Sambuc map = mmap(NULL, page, prot[i], MAP_ANON, -1, 0);
287*11be35a1SLionel Sambuc
288*11be35a1SLionel Sambuc if (map == MAP_FAILED)
289*11be35a1SLionel Sambuc continue;
290*11be35a1SLionel Sambuc
291*11be35a1SLionel Sambuc rv = mprotect(map, 1, prot[i] | PROT_EXEC);
292*11be35a1SLionel Sambuc
293*11be35a1SLionel Sambuc (void)munmap(map, page);
294*11be35a1SLionel Sambuc
295*11be35a1SLionel Sambuc if (rv == 0) {
296*11be35a1SLionel Sambuc str = "non-executable mapping made executable";
297*11be35a1SLionel Sambuc goto out;
298*11be35a1SLionel Sambuc }
299*11be35a1SLionel Sambuc }
300*11be35a1SLionel Sambuc
301*11be35a1SLionel Sambuc out:
302*11be35a1SLionel Sambuc if (pax_global != -1 && pax_enabled != -1)
303*11be35a1SLionel Sambuc (void)paxset(pax_global, pax_enabled);
304*11be35a1SLionel Sambuc
305*11be35a1SLionel Sambuc if (str != NULL)
306*11be35a1SLionel Sambuc atf_tc_fail("%s", str);
307*11be35a1SLionel Sambuc }
308*11be35a1SLionel Sambuc
309*11be35a1SLionel Sambuc ATF_TC(mprotect_write);
ATF_TC_HEAD(mprotect_write,tc)310*11be35a1SLionel Sambuc ATF_TC_HEAD(mprotect_write, tc)
311*11be35a1SLionel Sambuc {
312*11be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test mprotect(2) write protections");
313*11be35a1SLionel Sambuc }
314*11be35a1SLionel Sambuc
ATF_TC_BODY(mprotect_write,tc)315*11be35a1SLionel Sambuc ATF_TC_BODY(mprotect_write, tc)
316*11be35a1SLionel Sambuc {
317*11be35a1SLionel Sambuc pid_t pid;
318*11be35a1SLionel Sambuc void *map;
319*11be35a1SLionel Sambuc int sta;
320*11be35a1SLionel Sambuc
321*11be35a1SLionel Sambuc /*
322*11be35a1SLionel Sambuc * Map a page read/write, change the protection
323*11be35a1SLionel Sambuc * to read-only with mprotect(2), and try to write
324*11be35a1SLionel Sambuc * to the page. This should generate a SIGSEGV.
325*11be35a1SLionel Sambuc */
326*11be35a1SLionel Sambuc map = mmap(NULL, page, PROT_WRITE|PROT_READ, MAP_ANON, -1, 0);
327*11be35a1SLionel Sambuc ATF_REQUIRE(map != MAP_FAILED);
328*11be35a1SLionel Sambuc
329*11be35a1SLionel Sambuc ATF_REQUIRE(strlcpy(map, "XXX", 3) == 3);
330*11be35a1SLionel Sambuc ATF_REQUIRE(mprotect(map, page, PROT_READ) == 0);
331*11be35a1SLionel Sambuc
332*11be35a1SLionel Sambuc pid = fork();
333*11be35a1SLionel Sambuc ATF_REQUIRE(pid >= 0);
334*11be35a1SLionel Sambuc
335*11be35a1SLionel Sambuc if (pid == 0) {
336*11be35a1SLionel Sambuc ATF_REQUIRE(signal(SIGSEGV, sighandler) != SIG_ERR);
337*11be35a1SLionel Sambuc ATF_REQUIRE(strlcpy(map, "XXX", 3) == 0);
338*11be35a1SLionel Sambuc }
339*11be35a1SLionel Sambuc
340*11be35a1SLionel Sambuc (void)wait(&sta);
341*11be35a1SLionel Sambuc
342*11be35a1SLionel Sambuc ATF_REQUIRE(WIFEXITED(sta) != 0);
343*11be35a1SLionel Sambuc ATF_REQUIRE(WEXITSTATUS(sta) == SIGSEGV);
344*11be35a1SLionel Sambuc ATF_REQUIRE(munmap(map, page) == 0);
345*11be35a1SLionel Sambuc }
346*11be35a1SLionel Sambuc
ATF_TP_ADD_TCS(tp)347*11be35a1SLionel Sambuc ATF_TP_ADD_TCS(tp)
348*11be35a1SLionel Sambuc {
349*11be35a1SLionel Sambuc page = sysconf(_SC_PAGESIZE);
350*11be35a1SLionel Sambuc ATF_REQUIRE(page >= 0);
351*11be35a1SLionel Sambuc
352*11be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, mprotect_access);
353*11be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, mprotect_err);
354*11be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, mprotect_exec);
355*11be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, mprotect_pax);
356*11be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, mprotect_write);
357*11be35a1SLionel Sambuc
358*11be35a1SLionel Sambuc return atf_no_error();
359*11be35a1SLionel Sambuc }
360