Annotation of htdocs/docs/kernel/non-exec.xml, revision 1.2
1.1 dsieger 1: <?xml version="1.0"?>
2: <!DOCTYPE webpage
3: PUBLIC "-//NetBSD//DTD Website-based NetBSD Extension//EN"
4: "http://www.NetBSD.org/XML/htdocs/lang/share/xml/website-netbsd.dtd" [
5: ]>
6:
7: <webpage id="docs-kernel-non-exec">
8: <config param="desc" value="Non-executable stack and heap"/>
1.2 ! jnemeth 9: <config param="cvstag" value="$NetBSD: non-exec.xml,v 1.1 2007/06/09 11:33:44 dsieger Exp $"/>
! 10: <config param="rcsdate" value="$Date: 2007/06/09 11:33:44 $"/>
1.1 dsieger 11: <head>
12: <title>Non-executable stack and heap</title>
13: </head>
14:
15: <sect1 id="top">
16:
17: <para>
18: Starting with version 2.0, NetBSD supports non-executable mappings on
19: platforms where the hardware allows it. Process stack and heap mappings are
20: non-executable by default. This makes exploiting potential buffer overflows
21: harder. NetBSD supports PROT_EXEC permission via mmap() for all platforms
22: where the hardware differentiates execute access from data access, though
23: not necessarily with single-page granularity. When the hardware has a
24: larger granularity, the rule is that if any page in the larger unit is
25: executable, then the entire larger unit is executable, otherwise the entire
26: larger unit is not executable.
27: </para>
28:
29: <para>
30: No compile-time option is needed to enable this software support,
31: it's always available.
32: </para>
33:
34: <sect2 id="supported-platforms">
35: <title>Supported platforms</title>
36:
37: <para>
38: Here is a list of support levels based on hardware
39: limitations. In this list "the stack" refers to the traditional UNIX
40: process stack, not pthreads stacks.
41: </para>
42:
43: <itemizedlist>
44: <listitem>
45: <emphasis role="bold">amd64, sparc64, sparc (sun4m, sun4d), powerpc (ibm4xx),
46: alpha, hppa:</emphasis>
47: Full support, each page is independently executable or not.
48: </listitem>
49: <listitem>
50: <emphasis role="bold">powerpc (eg. macppc):</emphasis>
51: The hardware granularity is a segment (256MB) instead of a page.
52: By default, the segment containing the stack is not executable.
53: </listitem>
54: <listitem>
55: <emphasis role="bold">i386:</emphasis>
56: The hardware support is pretty limited, so the granularity is very coarse.
57: The current software implementation in NetBSD is that there are only two
58: regions of the application address space which may be independently
59: executable or not: the stack and everything else. By default,
60: the stack is not executable and everything else is executable
61: </listitem>
62: <listitem>
1.2 ! jnemeth 63: <emphasis role="bold">Everything else; arm, m68k, mips, sh3,
1.1 dsieger 64: sparc(sun, sun4c), vax:</emphasis>
65: No support, the hardware does not differentiate execute vs. data accesses,
66: so anything readable to a process as data is executable by the process
67: as code.
68: </listitem>
69: </itemizedlist>
70:
71: </sect2>
72: </sect1>
73:
74: </webpage>
CVSweb <webmaster@jp.NetBSD.org>