From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 22621 invoked from network); 20 Apr 2020 02:10:10 -0000 Received-SPF: pass (mother.openwall.net: domain of lists.openwall.com designates 195.42.179.200 as permitted sender) receiver=inbox.vuxu.org; client-ip=195.42.179.200 envelope-from= Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with UTF8ESMTPZ; 20 Apr 2020 02:10:10 -0000 Received: (qmail 13878 invoked by uid 550); 20 Apr 2020 02:10:08 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 13860 invoked from network); 20 Apr 2020 02:10:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=0NpoVIV5BBpVC9+Ar43gGkMf3ia+u5987WDF4Vw/Yd4=; b=smwFGameKYkTS1UTy4KMVNxcA2U7RJMtBBfTD3bleuHOxl9VHbTIatabmqTqQDte/R sHxesVN7sZrWJ89xkLH37di+EdbZNsb2QBMY/BkxcPcgmb3zJp7cPJzKvafXxZx10F37 jVCATiwe7ukeTJ4ZEG4veo4WCbIv+ezIruaEQPs26kXix4HFutgk85guc+tbOYY0/qhk WDpUp2hUA7K0S/Mb08MAJheprbbdOn4fVGqkIRdo4e4tQFO6XNsAt2ThQk6RxjR0jQj4 FCmAWNqczvg7/XlBLP6nBaf2beEZVCFySnwPhXhWTtUPNlQ2AWp7I7LrQ9igvPTtfK0Z 4DcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=0NpoVIV5BBpVC9+Ar43gGkMf3ia+u5987WDF4Vw/Yd4=; b=PgwBuL5pkS5HwKG5zCQbRr2A0s4PmFDK/svWQysAdxawUwkXUF9kaTPBa0JcLEz/NJ mzdfFlZCN6s2WouUhMbqr7ilzdYELodLoek9rMtHnUpAGql+juoPwgSf5RBgB4tBTcU8 sZRqtD+KqIAcwzoyWx64cKDO+9Et4LtA5krBU0L9xl35b1eqib2OeSvq6hN9fPugduSW vlDvg1OB6C0WoG8966wNnY6ED4FVZ9/7nHNj9E9qhjsfx59IqqXjkQ4TCmLsF55v3KCz 9lGKoRXDHUSy0Ee2DbjUTwZc3blIiRPoDfPYzed4UzCCmTXwU8hOLXRxaphBrMej9oko f5kw== X-Gm-Message-State: AGi0PuYzCyY7Xj6xucuSkdacS83VBrkTGjNrbVs1CuyEgHvtqGw7BfSJ O40stDv+cNIUxLTt0E1lb0g= X-Google-Smtp-Source: APiQypLV9QIfOcoh2wLkCPSokDBB4f5ZROkcHlo59I/B+/M5nASv+P03Cn9b/A/a2GNhbL9E9iE/xg== X-Received: by 2002:a17:902:868d:: with SMTP id g13mr14171889plo.317.1587348595565; Sun, 19 Apr 2020 19:09:55 -0700 (PDT) Date: Mon, 20 Apr 2020 12:08:36 +1000 From: Nicholas Piggin To: Rich Felker Cc: Nicholas Piggin via Libc-alpha , libc-dev@lists.llvm.org, linuxppc-dev@lists.ozlabs.org, musl@lists.openwall.com, Szabolcs Nagy References: <1586931450.ub4c8cq8dj.astroid@bobo.none> <20200415225539.GL11469@brightrain.aerifal.cx> <1586994952.nnxigedbu2.astroid@bobo.none> <20200416095800.GC23945@port70.net> <1587341904.1r83vbudyf.astroid@bobo.none> <20200420012904.GY11469@brightrain.aerifal.cx> In-Reply-To: <20200420012904.GY11469@brightrain.aerifal.cx> MIME-Version: 1.0 Message-Id: <1587348046.pwnfbo52iq.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [musl] Powerpc Linux 'scv' system call ABI proposal take 2 Excerpts from Rich Felker's message of April 20, 2020 11:29 am: > On Mon, Apr 20, 2020 at 10:27:58AM +1000, Nicholas Piggin wrote: >> Excerpts from Szabolcs Nagy's message of April 16, 2020 7:58 pm: >> > * Nicholas Piggin via Libc-alpha [2020-04-= 16 10:16:54 +1000]: >> >> Well it would have to test HWCAP and patch in or branch to two=20 >> >> completely different sequences including register save/restores yes. >> >> You could have the same asm and matching clobbers to put the sequence >> >> inline and then you could patch the one sc/scv instruction I suppose. >> >=20 >> > how would that 'patch' work? >> >=20 >> > there are many reasons why you don't >> > want libc to write its .text >>=20 >> I guess I don't know what I'm talking about when it comes to libraries.=20 >> Shame if there is no good way to load-time patch libc. It's orthogonal >> to the scv selection though -- if you don't patch you have to=20 >> conditional or indirect branch however you implement it. >=20 > Patched pages cannot be shared. The whole design of PIC and shared > libraries is that the code("text")/rodata is immutable and shared and > that only a minimal amount of data, packed tightly together (the GOT) > has to exist per-instance. Yeah the pages which were patched couldn't be shared across exec, which is a significant downside, unless you could group all patch sites into their own section and similarly pack it together (which has issues of being out of line). >=20 > Also, allowing patching of executable pages is generally frowned upon > these days because W^X is a desirable hardening property. Right, it would want be write-protected after being patched. Thanks, Nick