From patchwork Tue Mar 13 20:59:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 10280765 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ED206603B5 for ; Tue, 13 Mar 2018 21:02:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D81B92656B for ; Tue, 13 Mar 2018 21:02:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA9AF266F3; Tue, 13 Mar 2018 21:02:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 812FE28492 for ; Tue, 13 Mar 2018 21:02:30 +0000 (UTC) Received: (qmail 20100 invoked by uid 550); 13 Mar 2018 21:00:33 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 20035 invoked from network); 13 Mar 2018 21:00:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YFAqguIZ1GKuBePauhrgbb6AlEObB6A1PFNFlK8E2A8=; b=aPPgba8mceL8Br/+cLItyniyfrGX2/9kjbdFVl7xzF3tMsL3+G4G1ShpmCzewHaCq+ P3+2gGTGNkmZbnTwqqsSrOtWCRryhK3SPBe7xiPXCTrnUyBUHJ7vtRdX0T7z7Bb+yhkl pGYQqrLeocQjNKxdSAtVpW40uxbZtJBabjjROCIMU82fdDaUNsFXFaB7bw1JGp4dCSmd OKE8ei1zVR4aleJdKWg715VO4WtsBuxyYngzz0EWNPjqFDXm+VA1se8LZF9FN2b4Imbx tVvJWvlKZHIoOC6fG5O+848qJyTzhiJpOIlwvQtEN7Top2L2urhcHaRUZaE6ATjCcH0f yoWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YFAqguIZ1GKuBePauhrgbb6AlEObB6A1PFNFlK8E2A8=; b=GWbL1Cy7voQtflLuETPBPeUg3bbldBdnuaxmgCBI4Iq+5b1kjTKAbL44wMBobRB+KA 7uDi702yeAM5ROjD8fjjcR7TvKDuvB8LLjaTFjZaGDrmYjBBxQT4jx+ZnK3esiHMA7HR airWhkJegBwFkYJjozXboqSOZmJmMFxYmO9K6CI0Zi+RCm/frd8Z5iMyhXrj1I8znP8n KuAmfnVnoJik+8TDxkVuhIyKeAJfyadCUhLzo8esmrREv/OV0FZYlaWPNiqCjD2TITR5 oD+ilha9wyjPL64IWytK7bjtweTm3C+AdangG8kznsTJwOtd/Sree1uNhMaq3wPjyhfZ Z/MQ== X-Gm-Message-State: AElRT7Fdbs9Y6qt+1AVIahxBcIPs9Cdz/nFz3pfYtVXngV7TzPpvMqS/ XtYHgRN7w/HG02w/pU2CoPyNJg== X-Google-Smtp-Source: AG47ELtDyiTtt4REoMK1E76o/7/VC8sxV/wKKqP/iU+fInpsRTXwqNsS3dRoqgvX7uMd7c9igxeFEg== X-Received: by 10.167.128.143 with SMTP id v15mr1931685pff.36.1520974819240; Tue, 13 Mar 2018 14:00:19 -0700 (PDT) From: Thomas Garnier To: Herbert Xu , "David S . Miller" , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Greg Kroah-Hartman , Kate Stewart , Thomas Garnier , Arnd Bergmann , Philippe Ombredanne , Arnaldo Carvalho de Melo , Andrey Ryabinin , Matthias Kaehlcke , Kees Cook , Tom Lendacky , "Kirill A . Shutemov" , Andy Lutomirski , Dominik Brodowski , Borislav Petkov , Borislav Petkov , "Rafael J . Wysocki" , Len Brown , Pavel Machek , Juergen Gross , Alok Kataria , Steven Rostedt , Tejun Heo , Christoph Lameter , Dennis Zhou , Boris Ostrovsky , David Woodhouse , Alexey Dobriyan , "Paul E . McKenney" , Andrew Morton , Nicolas Pitre , Randy Dunlap , "Luis R . Rodriguez" , Christopher Li , Jason Baron , Ashish Kalra , Kyle McMartin , Dou Liyang , Lukas Wunner , Petr Mladek , Sergey Senozhatsky , Masahiro Yamada , Ingo Molnar , Nicholas Piggin , Cao jin , "H . J . Lu" , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Joerg Roedel , Dave Hansen , Rik van Riel , Jia Zhang , Jiri Slaby , Kyle Huey , Jonathan Corbet , Matthew Wilcox , Michal Hocko , Rob Landley , Baoquan He , Daniel Micay , =?UTF-8?q?Jan=20H=20=2E=20Sch=C3=B6nherr?= Cc: x86@kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, linux-arch@vger.kernel.org, linux-sparse@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: [PATCH v2 04/27] x86: Add macro to get symbol address for PIE support Date: Tue, 13 Mar 2018 13:59:22 -0700 Message-Id: <20180313205945.245105-5-thgarnie@google.com> X-Mailer: git-send-email 2.16.2.660.g709887971b-goog In-Reply-To: <20180313205945.245105-1-thgarnie@google.com> References: <20180313205945.245105-1-thgarnie@google.com> X-Virus-Scanned: ClamAV using ClamSMTP Add a new _ASM_MOVABS macro to fetch a symbol address. It will be used to replace "_ASM_MOV $, %dst" code construct that are not compatible with PIE. Signed-off-by: Thomas Garnier --- arch/x86/include/asm/asm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/asm.h b/arch/x86/include/asm/asm.h index 386a6900e206..653d8b82f015 100644 --- a/arch/x86/include/asm/asm.h +++ b/arch/x86/include/asm/asm.h @@ -30,6 +30,7 @@ #define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8) #define _ASM_MOV __ASM_SIZE(mov) +#define _ASM_MOVABS __ASM_SEL(movl, movabsq) #define _ASM_INC __ASM_SIZE(inc) #define _ASM_DEC __ASM_SIZE(dec) #define _ASM_ADD __ASM_SIZE(add)