<div dir="ltr"><div dir="ltr">Hi all,<div><br></div><div>According to the man page of "ulimit", it is possible to limit the virtual address space of a user process: <a href="https://ss64.com/bash/ulimit.html">https://ss64.com/bash/ulimit.html</a></div><div>To limit the virtual address space to 2 GB:<br></div><div>$ ulimit -SH -v 1048576 </div><div><br></div><div>However, it seems that "stack" allocation ignores this limit (I tried with both kernel 4.4 and 4.15).</div><div><br></div><div>I found this article (patch) that seems to fix the problem:</div><div><a href="https://lwn.net/Articles/373701/">https://lwn.net/Articles/373701/</a><br></div><div><br></div><div>My questions are: </div><div>- Why is the stack allocation not placed within the "ulimit" limit? (is it a bug?)</div><div>- Is there a way, in user space, to force the stack to be allocated at a certain address? </div><div>- Will the patch above (or similar) ever be integrated into the Linux kernel?</div><div><br></div><div>Regards,</div><div>Mohamed</div><div><br></div></div></div>