svn commit: r340231 - head/sys/kern

Konstantin Belousov kostikbel at gmail.com
Thu Nov 8 23:24:32 UTC 2018


On Thu, Nov 08, 2018 at 02:35:50PM -0800, John Baldwin wrote:
> On 11/8/18 12:12 PM, Konstantin Belousov wrote:
> >> Regardless, for the purposes of this sysctl, is there any reason we can't
> >> just define it to 1 always now?  It is only honored if the architecture
> >> is using a shared page to hold the signal trampoline and only has an effect
> >> if the pmap honors VM_PROT_EXECUTE.  That would at least fix i386 with
> >> PAE to DTRT I think.
> > 
> > i386 PAE already handles it, see i386/initcpu.c:754.
> 
> I see.
> 
> > Unconditionally setting the vars to 1 would break any arch that
> > 1. does not allow to use shared page
> > 2. honors VM_PROT_EXEC in pmap
> > 3. not using local hacks for signal trampolines, like sparc64 does.
> > We might not have any such architecture now (ia64 certainly was such case).
> 
> 1. is not quite true.  We require both nxstack != 0 and sv_shared_obj != NULL
> before we honor PT_GNU_STACK.  So you'd have to have an arch that was using
> the shared page but insisted on not using the copy of the sigcode stored in
> the shared page and then 2) honors VM_PROT_EXECUTE.  This seems unlikely to
> be something we'd do in the future.

Still, the sysctl currently resembles the actual behaviour of the system.
If it is zero by default, it makes no sense to set it to one, because
system does not support nx stacks anyway.  Consider it not only as the
direction to operate, but also as the information to user.


More information about the svn-src-head mailing list