Mark Kettenis <mark.kette...@xs4all.nl> wrote: > > 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!
That is not correct. Sometimes it prefetches a page which you will use. Sometimes it prefetches a page you won't use. Quite often you don't use it. Then the page has to eventually expire. A PTE is also loaded. It's a waste of time there are no pages to clash against. We do not have known objects to collide against. We have address space randomization. We don't have some "limited" form of it which puts other objects in those locations.