> From: Theo de Raadt <dera...@cvs.openbsd.org> > Date: Thu, 14 Sep 2023 01:02:14 -0600 (MDT) > > I do not think this should be enabled. > Our stacks work differently. > We don't put shit near the bottom of the main stack, because we > reserve the space. > For pthread stacks, we allocate them randomly also so you cannot > determistically trash a specific object. > This change also make very small stacks (meaning pthreads) potentially > reach beyond the bottom in a weird new way. > We simply don't need to cpu and pte's for this.
But if the stack space is used we'll have to spend the CPU time to fault the pages in and allocate the PTEs anyway. Only stupid code allocates large amounts of stack space and doesn't use it! Now with -fstack-clash-protection, there will be a few additional loads and the access pattern will be slightly different and there will be slightly different. But if firefox enables this the performance impact must be really, really small. As far as I understand, the proposed change would only make the option available, but it would still be turned off by default. So only ports that explicitly turn this option on would be affected.