title: ASLR limitations on Linux
body: <p>I tried for fun to "improve" ASLR on my own x86 32-bit machine by modifying arch_align_stack() in process.c by increasing the second argument to modulo in:</p>
  
  <pre><code>if (!(current-&gt;personality &amp; ADDR_NO_RANDOMIZE) &amp;&amp; randomize_va_space)
      sp -= get_random_int() % 8192;
  return sp &amp; ~0xf;
  </code></pre>
  
  <p>However I quickly discovered that tampering too much with this causes a kernel panic; and I suspect it makes the system unstable even just tampering somewhat with it (it survives on sheer luck for some time, most likely?).</p>
  
  <p>This prompted me to ask a question about why this happens (original question at <a href="https://stackoverflow.com/questions/11958092/why-does-the-stack-have-to-be-page-aligned">Why does the stack have to be page aligned?</a>). Apparently this is because (as user "mpe" stated) the default stack size if 8 kiB, which is 8192 byte. So by extension increasing the stack size in the kernel, this argument (8192) should be possible to increase? It was also mentioned the location of the stack itself could be randomized.</p>
  
  <p>Does Pax do this? If not, then why not?</p>
  
  <p>How/where is the stack size specified in the kernel? Does this differ for 32-bit and 64-bit?</p>
  
  <p>Is there any difference between 32-bit and 64-bit for this? Does 64-bit still use process.c for this stuff? I see that in process_64.c there is nothing that seems equivalent to this code.</p>