From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23278 invoked from network); 7 Dec 2021 18:39:48 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 7 Dec 2021 18:39:48 -0000 Received: (qmail 15605 invoked by uid 550); 7 Dec 2021 18:39:46 -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 15579 invoked from network); 7 Dec 2021 18:39:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1638902373; bh=9E86zTd6AEdJa8gUArhaEDqJVMv2Uzx+HR+gYKe9XPE=; h=X-UI-Sender-Class:Date:From:To:Subject:References:In-Reply-To; b=f/uEC6qWwcV9Df5WgE60wHV/uqKIfcam9MwQfbMVreMFRRsyjVFGCMGEYgRyfA9Xf kTr7btv/RujSqU4pGGKaIwxBI2PZgg/B7eQclRktkwgA1QCq9ZliroheCAodOCnb+0 5J9/aTa0YqzeckenUUVHGnDJL6t82ZXpF0axzrcI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Date: Tue, 7 Dec 2021 19:39:33 +0100 From: Markus Wichmann To: musl@lists.openwall.com Message-ID: <20211207183933.GA8506@voyager> References: <20211206234358.2174444-1-stijn@linux-ipv6.be> <87tufljlmv.fsf@oldenburg.str.redhat.com> <20211207005940.GK7074@brightrain.aerifal.cx> <20211207013930.GM7074@brightrain.aerifal.cx> <20211207132509.GO7074@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211207132509.GO7074@brightrain.aerifal.cx> User-Agent: Mutt/1.9.4 (2018-02-28) X-Provags-ID: V03:K1:5MWAZpP0xvKJfSsf0Wb7yCqirbwbIBJEEdtC+ifw4/LZaB5O6mN tFvaP71MOHZsP+V7MFPRfSz6xP6zqc9pL571heYq2tIZKgshISU9S3dqhlU02rCshmjv89d 4ucW/tF8g0Kg5huU7kMoyZHh01dZrDuUk+yBPtSBXD93KU7iipj+KStXXvO4UAcaqlJyCfL wW1rPJh5Q9xfNuJ3BgpAw== X-UI-Out-Filterresults: notjunk:1;V03:K0:RIV+DIZ1XU4=:fHVv0M4i3cyqhIt5PbksGS wy1QkOR+CcwaOwuVpswksCoymSEvrtV3ggrjL6Mtn7JqW10iA/+xKO8mffhz0+z9AkAhZOvLk N2Z1FaP09VXFEHyMbb0F0+0LC6oYtWk0/7DF4RZtTfo4tgpDB+mMPneOm/Qf/mgcNnTGASKo8 mZrG71fndPwQXU4Mlf5boY6Dqa56fJhpskO05hMxtxXKRQGLThN8lwiw08tPub+fpef8M9TJ3 bU0HEPtehb8brzK/JyvI3RM9zVIvjd8ZbSEVVzw88d3EIzSpw9sNBhsrXeIpsOpw7qVWWW8Or xOM1je6tKfLzrx8fIXRRwFiffs4Vic4xGLVeUgFtz8XyxzWW+GHf4NXkuY58+pvP3kkBdRe2X VjBXJ/FscWeE4WGeevpUXALOUVaeaIsC+hQ8aH3NcM2yzijcdLfrYCrIWejLezUGKUE0cAep9 euVWZINrhR8M5uZRdfRIn5ATZK+AnbxMcDNDZQ7TMqEe+1RwdKKt9+CMaaCqFlCgVswne0sEz Wul5reXs3dHiX7QOnu2NdkKgl9EKGKFUuAp8utZxf7rinEHdpNUKPobCHRaz7WKIscySJTAGb iIhhsLN5Xf8q6vdZWnbdZ6k4mQ20EFz2tzF5a6FHOYGOm8w0cx1HZjS64yW4UX1C6zbMy+e1p qEEfsHIgVbevNSNwe5VreE2zHRqo1IHtTUF+FuyhEK3n21bSHBbqEaSMqBrQPCjuKFn5t9usd oN04r2+VRFo1GWMW7BMv38hvG4FSlrNezoxwdeAFKoouKnwIAwysIiLlkEE9muW/PJLOurbh+ lkcKFVBbdOrM7E0ZhXJgGT8yeZ9ZsEYtK6aYFnjHpCNXzt59+hrTUC+9FS28wNC7QT+CB7bWG KWzJJFYA+jHeBkoT1eyOf+SqJrwxSWxzQTEyd786JmsfWOs8s5RAIWhNWVT77TnFpCEB7viAq VvIUHqkF15dzzGengPCdjUXP2b5EU7347akCgBUCaBMEaM+AZJ9TLdIVNGrXkY6sVOZLBGORM obXt9prP6GTros1IZhlQNtDRhlLY90rjvcIiXUrqu08ruL61fklQ8tJ28HpAFystn0Fgc9kT6 tGkC7zglNIwZWY= Content-Transfer-Encoding: quoted-printable Subject: Re: [musl] [PATCH] ppc64: check for AltiVec in setjmp/longjmp On Tue, Dec 07, 2021 at 08:25:09AM -0500, Rich Felker wrote: > On Mon, Dec 06, 2021 at 08:44:47PM -0500, David Edelsohn wrote: > > It should work, but it's slightly preferred to use $+4 because one > > explicitly wants the address of the next instruction and labels of the > > In this case we don't want the address of the next instruction. We > want the address of the constant __hwcap-. > > Rich According to at least one source I found at some point (and can't seem to find right away), "bcl 20,31,+4" is the one special form of the instruction that is most likely to circumvent the shadow stack. I have seen "bcl 20,31,label" in the wild, even in cases where the label didn't directly follow the instruction, so maybe it works, maybe it doesn't. That said, architecturally it will work either way. We are only talking about an implementation detail, and both IBM's and Freescale's/NXP's documentation is very cagey about revealing any of those. The instruction is specified to exist and do the right thing (namely to branch with linking unconditionally) all the way back to the first PowerPC implementations from the early nineties, but whether such a thing as a branch predictor even exists, or if it uses shadow stacks to predict the "blr" target, is entirely unspecified. So yeah, you might want to restructure the code to move the hwcap offset somewhere else. Ciao, Markus