From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95442 invoked by alias); 15 Jul 2018 20:20:47 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 95420 invoked by uid 89); 15 Jul 2018 20:20:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=H*r:4.89 X-HELO: albireo.enyo.de From: Florian Weimer To: "H.J. Lu" Cc: "Carlos O'Donell" , GNU C Library Subject: Re: V2: [PATCH 02/24] x86: Support shadow stack pointer in setjmp/longjmp References: <20180613153207.57232-1-hjl.tools@gmail.com> <20180613153207.57232-3-hjl.tools@gmail.com> <20180713132252.GC2606@gmail.com> <87fu0lk2tf.fsf@mid.deneb.enyo.de> <87wotxifg7.fsf@mid.deneb.enyo.de> <87fu0kj50z.fsf@mid.deneb.enyo.de> Date: Sun, 15 Jul 2018 20:20:00 -0000 In-Reply-To: (H. J. Lu's message of "Sun, 15 Jul 2018 06:54:30 -0700") Message-ID: <87wotwgv7e.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-07/txt/msg00417.txt.bz2 * H. J. Lu: >> #undef. I think you can avoid that by using #if SHTSTK_ENABLED >> instead of #ifdef SHADOW_STACK_POINTER_OFFSET, which also expresses >> the intent more accurately. > > It is done on purpose. sysdeps/x86_64/__longjmp.S has > > /* Don't restore shadow stack register if > 1. Shadow stack isn't enabled. Or > 2. __longjmp is defined for __longjmp_cancel. > */ > #if !SHSTK_ENABLED || defined __longjmp > # undef SHADOW_STACK_POINTER_OFFSET > #endif It's a bit awkward. > Subject: [PATCH] x86_64: Undef SHADOW_STACK_POINTER_OFFSET last > > Since SHADOW_STACK_POINTER_OFFSET is defined in jmp_buf-ssp.h, we must > undef SHADOW_STACK_POINTER_OFFSET after including . > > * sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S: Undef > SHADOW_STACK_POINTER_OFFSET after including . This looks okay as a fix.