Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBF7DC433F5 for ; Wed, 1 Dec 2021 09:51:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348401AbhLAJyf convert rfc822-to-8bit (ORCPT ); Wed, 1 Dec 2021 04:54:35 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]:25796 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348355AbhLAJyZ (ORCPT ); Wed, 1 Dec 2021 04:54:25 -0500 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-198-iJW5aXLlMaKceM3orNHR2w-1; Wed, 01 Dec 2021 09:50:58 +0000 X-MC-Unique: iJW5aXLlMaKceM3orNHR2w-1 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) by AcuMS.aculab.com (fd9f:af1c:a25b:0:994c:f5c2:35d6:9b65) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Wed, 1 Dec 2021 09:50:57 +0000 Received: from AcuMS.Aculab.com ([fe80::994c:f5c2:35d6:9b65]) by AcuMS.aculab.com ([fe80::994c:f5c2:35d6:9b65%12]) with mapi id 15.00.1497.026; Wed, 1 Dec 2021 09:50:57 +0000 From: David Laight To: 'Brian Gerst' , "linux-kernel@vger.kernel.org" , "x86@kernel.org" CC: Andy Lutomirski , Borislav Petkov , "Thomas Gleixner" , "H . Peter Anvin" , "Peter Zijlstra" Subject: RE: [PATCH v2 2/6] x86-64: Convert stack protector to normal percpu variable Thread-Topic: [PATCH v2 2/6] x86-64: Convert stack protector to normal percpu variable Thread-Index: AQHX5i01pws/jQEaYE+x2M5p3Mzw46wdZTkg Date: Wed, 1 Dec 2021 09:50:57 +0000 Message-ID: <2c23335e98bc4a66b1fd779a78ddd821@AcuMS.aculab.com> References: <20211130205549.116673-1-brgerst@gmail.com> <20211130205549.116673-3-brgerst@gmail.com> In-Reply-To: <20211130205549.116673-3-brgerst@gmail.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C51A453 smtp.mailfrom=david.laight@aculab.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Brian Gerst > Sent: 30 November 2021 20:56 > > Older versions of GCC fixed the location of the stack protector canary > at %gs:40. This constraint forced the percpu section to be linked at > virtual address 0 so that the canary could be the first data object in > the percpu section. Supporting the zero-based percpu section requires > additional code to handle relocations for RIP-relative references to > percpu data, extra complexity to kallsyms, and workarounds for linker > bugs due to the use of absolute symbols. > > Since version 8.1, GCC has options to configure the location of the > canary value. This allows the canary to be turned into a normal > percpu variable and removes the constraint that the percpu section > be zero-based. I didn't think the minimum gcc version has been raised as far as 8.1? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)