On Wed, 21 Oct 2020 18:28:44 +0300
Konstantin Belousov <kostik...@gmail.com> wrote:


> > 
> > kdump with MAP_STACK.
> > 
> >  87183 polyimport CALL  
> > mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1402<MAP_PRIVATE|MAP_STACK|MAP_ANON>,0xffffffff,0,0)
> >  87183 polyimport RET   mmap -1 errno 22 Invalid argument  
> So it is anything but 'insufficient memory' (I suspected ENOMEM).
> EINVAL there is because sysctl security.bsd.stack_guard_page default value
> is 1, which means that at least one page of the stack is reserved as guard.
> Kernel does not allow to map stack that would have no data pages (all pages
> are guard).
> 
> Your mapping request is for one page, and one page is due to guard, so
> you get EINVAL.  Generally MAP_STACK is magic and requires caller to know
> what it does.

Thanks!
_______________________________________________
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to