From owner-svn-src-all@freebsd.org Thu Nov 8 23:24:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CD5F110B537; Thu, 8 Nov 2018 23:24:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7D2973905; Thu, 8 Nov 2018 23:24:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id wA8NOJRc033563 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 9 Nov 2018 01:24:23 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua wA8NOJRc033563 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id wA8NOJGQ033562; Fri, 9 Nov 2018 01:24:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 9 Nov 2018 01:24:19 +0200 From: Konstantin Belousov To: John Baldwin Cc: Ed Schouten , src-committers , 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> References: <201811071832.wA7IW3VI045865@repo.freebsd.org> <081a4dfe-c95e-f8f1-ffc6-04ed5173999d@FreeBSD.org> <20181107230832.GZ5335@kib.kiev.ua> <60a839f8-9830-7d6e-98a2-a7aa596e68e9@FreeBSD.org> <20181108201231.GA5335@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-Rspamd-Queue-Id: B7D2973905 X-Spamd-Result: default: False [-4.98 / 200.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; R_SPF_SOFTFAIL(0.00)[~all]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; IP_SCORE(-1.98)[ip: (-1.83), ipnet: 2001:470::/32(-4.45), asn: 6939(-3.52), country: US(-0.09)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; RCVD_TLS_LAST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2018 23:24:32 -0000 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.