Date: Fri, 9 Nov 2018 01:24:19 +0200 From: Konstantin Belousov <kostikbel@gmail.com> To: John Baldwin <jhb@FreeBSD.org> Cc: Ed Schouten <ed@nuxi.nl>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r340231 - head/sys/kern Message-ID: <20181108232419.GC2378@kib.kiev.ua> In-Reply-To: <d900cf86-5c4f-02a3-275e-c2edf5fd1597@FreeBSD.org> References: <201811071832.wA7IW3VI045865@repo.freebsd.org> <CABh_MKm_g%2BZ6m2LQWjEDcQZdki6JeVLJ%2BZ-q3Y=EaxaJm7DHjQ@mail.gmail.com> <081a4dfe-c95e-f8f1-ffc6-04ed5173999d@FreeBSD.org> <20181107230832.GZ5335@kib.kiev.ua> <60a839f8-9830-7d6e-98a2-a7aa596e68e9@FreeBSD.org> <20181108201231.GA5335@kib.kiev.ua> <d900cf86-5c4f-02a3-275e-c2edf5fd1597@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181108232419.GC2378>