Annotation of htdocs/docs/kernel/non-exec.html, revision 1.2

1.1       dsieger     1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
                      2: <html>
                      3: <head>
                      4: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
                      5: <meta name="generator" content="Website XSL Stylesheet V2.6.0">
                      6: <link rel="home" href="../../." title="Welcome to The NetBSD Project: Of course it runs NetBSD.">
                      7: <link rel="up" href="../../docs/kernel/." title="NetBSD Documentation: Kernel">
                      8: <link rel="previous" href="../../docs/kernel/lazyfpu.html" title="NetBSD Documentation: How lazy FPU context switch works">
                      9: <link rel="next" href="../../docs/kernel/ddwg.html" title="NetBSD Device Driver Writing Guide">
                     10: <link rel="first" href="../../docs/kernel/lazyfpu.html" title="NetBSD Documentation: How lazy FPU context switch works">
                     11: <link rel="last" href="../../docs/kernel/elf-notes.html" title="NetBSD Documentation: Vendor-specific ELF Note Elements">
                     12: <link rel="stylesheet" href="/NetBSD.css" type="text/css">
                     13: <title>Non-executable stack and heap</title>
                     14: </head>
                     15: <body class="website"><div class="webpage">
                     16: <a name="docs-kernel-non-exec"></a><h1>Non-executable stack and heap</h1>
                     17: <div class="sect1" lang="en">
                     18: <div class="titlepage"></div>
                     19: 
                     20: <p>
                     21: Starting with version 2.0, NetBSD supports non-executable mappings on
                     22: platforms where the hardware allows it. Process stack and heap mappings are
                     23: non-executable by default. This makes exploiting potential buffer overflows
                     24: harder. NetBSD supports PROT_EXEC permission via mmap() for all platforms
                     25: where the hardware differentiates execute access from data access, though
                     26: not necessarily with single-page granularity. When the hardware has a
                     27: larger granularity, the rule is that if any page in the larger unit is
                     28: executable, then the entire larger unit is executable, otherwise the entire
                     29: larger unit is not executable.
                     30: </p>
                     31: 
                     32: <p>
                     33: No compile-time option is needed to enable this software support,
                     34: it's always available. 
                     35: </p>
                     36: 
                     37: <div class="sect2" lang="en">
                     38: <div class="titlepage"><div><div><h3 class="title">
                     39: <a name="supported-platforms"></a>Supported platforms</h3></div></div></div>
                     40: 
                     41: 
                     42: <p>
                     43: Here is a list of support levels based on hardware
                     44: limitations. In this list "the stack" refers to the traditional UNIX
                     45: process stack, not pthreads stacks.
                     46: </p>
                     47: 
                     48: <div class="itemizedlist"><ul type="disc">
                     49: <li>
                     50: <span class="bold"><strong>amd64, sparc64, sparc (sun4m, sun4d), powerpc (ibm4xx), 
                     51: alpha, hppa:</strong></span>
                     52: Full support, each page is independently executable or not.
                     53: </li>
                     54: <li>
                     55: <span class="bold"><strong>powerpc (eg. macppc):</strong></span>
                     56: The hardware granularity is a segment (256MB) instead of a page.
                     57: By default, the segment containing the stack is not executable.
                     58: </li>
                     59: <li>
                     60: <span class="bold"><strong>i386:</strong></span>
                     61: The hardware support is pretty limited, so the granularity is very coarse.
                     62: The current software implementation in NetBSD is that there are only two
                     63: regions of the application address space which may be independently
                     64: executable or not: the stack and everything else.  By default,
                     65: the stack is not executable and everything else is executable
                     66: </li>
                     67: <li>
                     68: <span class="bold"><strong>Everything else; arm, m68k, mips, pc532, sh3, 
                     69: sparc(sun, sun4c), vax:</strong></span>
                     70: No support, the hardware does not differentiate execute vs. data accesses,
                     71: so anything readable to a process as data is executable by the process
                     72: as code.
                     73: </li>
                     74: </ul></div>
                     75: 
                     76: </div>
                     77: </div>
                     78: <div class="navfoot">
                     79: <hr>
                     80: <table border="0" summary="Footer navigation"><tr>
                     81: <td class="foothome"><span class="foothome"><a href="../../."><img src="/images/NetBSD-flag.png" alt="[NetBSD flag]" border="0" width="90" height="90"></a></span></td>
                     82: <td class="foothome">
                     83: <span class="foothome"><a href="../../.">Home page</a></span><br>
                     84: </td>
                     85: </tr></table>
                     86: <hr>
                     87: </div>
                     88: <p></p>
                     89: <span class="footfeed"><a href="http://www.NetBSD.org/cgi-bin/feedback.cgi">(contact us)</a></span>
                     90: 
                     91:    
1.2     ! dsieger    92:   <span class="foottag">Generated from <em>%NetBSD: non-exec.xml,v 1.1 2007/06/09 11:33:44 dsieger Exp %</em></span><br><span class="footcopy"><a href="/Misc/disclaimer.html"><span class="copyright">Copyright © 1994-2007 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>®</sup> is a registered trademark of The NetBSD
1.1       dsieger    93:        Foundation, Inc.</a></span>
                     94: </div></body>
                     95: </html>

CVSweb <webmaster@jp.NetBSD.org>