Re: stack pointer checking

2018-01-15 Thread Theo de Raadt
So go will need to be taught to use MAP_STACK when allocating stacks. Yes, this change is disruptive. That's the whole point. > On Thu, Jan 11, 2018 at 08:39:25PM -0700, Theo de Raadt wrote: > > I'm asking for some feedback to discover what ports this breaks, we'd > > The go package immediately

Re: stack pointer checking

2018-01-15 Thread Alexander Bluhm
On Thu, Jan 11, 2018 at 08:39:25PM -0700, Theo de Raadt wrote: > I'm asking for some feedback to discover what ports this breaks, we'd The go package immediately core dumps. Signature: go-1.9.2,1,c.92.2,pthread.25.1 root@ot6:.../~# go Abort trap (core dumped) Core was generated by

Re: stack pointer checking

2018-01-15 Thread Theo de Raadt
> On Thu, Jan 11, 2018 at 08:39:25PM -0700, Theo de Raadt wrote: > > At every trap and system call, it checks if the stack-pointer is on a > > page that is marked MAP_STACK. > > On amd64 3 regression tests fail with this diff. > > src/regress/lib/libpthread > src/regress/lib/libc > src/regress/sy

Re: stack pointer checking

2018-01-15 Thread Alexander Bluhm
On Thu, Jan 11, 2018 at 08:39:25PM -0700, Theo de Raadt wrote: > At every trap and system call, it checks if the stack-pointer is on a > page that is marked MAP_STACK. On amd64 3 regression tests fail with this diff. src/regress/lib/libpthread src/regress/lib/libc src/regress/sys/kern/stackjmp b

Re: stack pointer checking

2018-01-15 Thread Josh Elsasser
It unmaps for each thread when it is destroyed, but never for the initial thread. On Sat, Jan 13, 2018 at 03:45:52PM -0700, Theo de Raadt wrote: > Does it not free it somewhere eventually? How is that handled. > > > > lang/sbcl will need a small patch: > > > > $OpenBSD$ > > > > Index: src/run

Re: stack pointer checking

2018-01-14 Thread Matthias Kilian
Hi, On Thu, Jan 11, 2018 at 08:39:25PM -0700, Theo de Raadt wrote: > I'm asking for some feedback to discover what ports this breaks, we'd > like to know. Those would be ports which try to (unconvenionally) > create their stacks in malloc()'d memory or inside another > datastructure. Most of the

Re: stack pointer checking

2018-01-13 Thread Theo de Raadt
Does it not free it somewhere eventually? How is that handled. > lang/sbcl will need a small patch: > > $OpenBSD$ > > Index: src/runtime/thread.c > --- src/runtime/thread.c.orig > +++ src/runtime/thread.c > @@ -636,9 +636,16 @@ create_thread_struct(lispobj initial_function) { > * on the

Re: stack pointer checking

2018-01-13 Thread Josh Elsasser
On Thu, Jan 11, 2018 at 08:39:25PM -0700, Theo de Raadt wrote: > Stefan (stefan@) and I have been working for a few months on this > diff, with help from a few others. > > At every trap and system call, it checks if the stack-pointer is on a > page that is marked MAP_STACK. execve() is changed to

Re: stack pointer checking

2018-01-12 Thread Juan Francisco Cantero Hurtado
On Thu, Jan 11, 2018 at 08:39:25PM -0700, Theo de Raadt wrote: > Stefan (stefan@) and I have been working for a few months on this > diff, with help from a few others. > > At every trap and system call, it checks if the stack-pointer is on a > page that is marked MAP_STACK. execve() is changed to

stack pointer checking

2018-01-11 Thread Theo de Raadt
Stefan (stefan@) and I have been working for a few months on this diff, with help from a few others. At every trap and system call, it checks if the stack-pointer is on a page that is marked MAP_STACK. execve() is changed to create such mappings for the process stack. Also, libpthread is taught