Re: safer sigcode page filling

2021-03-08 Thread Theo de Raadt
Miod Vallat wrote: > > It would be better if it contained "trap" instructions. We still don't > > have an ideal way of doing that tho. > > That would work, but that would make the code a bit more complicated. > And I'm not sure it's worth doing anyway. Running into an unmapped page > will segfa

Re: safer sigcode page filling

2021-03-08 Thread Miod Vallat
> I guess the rest of the page contains 0? No, it contains a truncated copy of the sigcode. > It would be better if it contained "trap" instructions. We still don't > have an ideal way of doing that tho. That would work, but that would make the code a bit more complicated. And I'm not sure it's

Re: safer sigcode page filling

2021-03-08 Thread Theo de Raadt
I see I misunderstood, and this does what is desired. Miod Vallat wrote: > The code responsible for filling a page with repeated copies of the > signal trampoline code assumes that PAGE_SIZE % sigfillsz == 0. > > While this is true on all currently supported OpenBSD platforms, this > might not

Re: safer sigcode page filling

2021-03-08 Thread Theo de Raadt
I guess the rest of the page contains 0? It would be better if it contained "trap" instructions. We still don't have an ideal way of doing that tho. Miod Vallat wrote: > The code responsible for filling a page with repeated copies of the > signal trampoline code assumes that PAGE_SIZE % sigfil

safer sigcode page filling

2021-03-08 Thread Miod Vallat
The code responsible for filling a page with repeated copies of the signal trampoline code assumes that PAGE_SIZE % sigfillsz == 0. While this is true on all currently supported OpenBSD platforms, this might not be the case in the future (and isn't the case on some no-longer official platforms).