From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72394 invoked by alias); 14 Jul 2018 23:07:59 -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 72381 invoked by uid 89); 14 Jul 2018 23:07:58 -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> Date: Sat, 14 Jul 2018 23:07:00 -0000 In-Reply-To: (H. J. Lu's message of "Sat, 14 Jul 2018 14:03:10 -0700") Message-ID: <87wotxifg7.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-07/txt/msg00411.txt.bz2 * H. J. Lu: > On Sat, Jul 14, 2018 at 12:57 PM, Florian Weimer wrote: >> * H. J. Lu: >> >>> + /* Get the current ssp. */ >>> + rdsspd %edx >> >> This moves the required binutils version past current Debian's 2.28. >> >> I know we recently increased the minimum make version recently, but >> binutils 2.28 is still quite new, I think. >> >> Could we list the bytes for the instruction explicitly instead? > > The next patch: > > https://sourceware.org/ml/libc-alpha/2018-07/msg00266.html > > has sysdeps/x86/configure.ac: We currently have this (as of commit faaee1f07ed25b2779bfd935ffb29f431b80d6d3): ==> sysdeps/unix/sysv/linux/x86/jmp_buf-ssp.sym <== #include #undef __saved_mask -- SHADOW_STACK_POINTER_OFFSET offsetof(struct __jmp_buf_tag, __saved_mask.__saved.__shadow_stack_pointer) ==> sysdeps/x86/jmp_buf-ssp.sym <== -- FIXME: Define SHADOW_STACK_POINTER_OFFSET to support shadow stack. So SHADOW_STACK_POINTER_OFFSET is defined unconditionally. I don't see how the quoted patch changes that. Making sure that rdssp is only assembled with --enable-cet looks like the right solution, but you need something like #if ENABLE_CET, and not depend on SHADOW_STACK_POINTER_OFFSET being defined.