From patchwork Mon Jun 25 22:38:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 10488259 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 C09B7602B3 for ; Tue, 26 Jun 2018 08:39:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADDCE287E1 for ; Tue, 26 Jun 2018 08:39:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A298F287E7; Tue, 26 Jun 2018 08:39:50 +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=-12.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, USER_IN_DEF_DKIM_WL 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 87DF3287E1 for ; Tue, 26 Jun 2018 08:39:49 +0000 (UTC) Received: (qmail 21736 invoked by uid 550); 26 Jun 2018 08:38:34 -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 Delivered-To: moderator for kernel-hardening@lists.openwall.com Received: (qmail 10039 invoked from network); 25 Jun 2018 22:41:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:in-reply-to:message-id:references:subject:from:to :cc; bh=vk4hdGJcBF9byvX9Poax+QR39SxzTgmO3KuPWRuR0HY=; b=DCQ/4bhHOw/muiK7kspbA0sjJJTN0BcN+Ji9r9aZtfGBSYGGcI1mbTDxDgl/Cx6QtD lf5enph+X71paArPqPPrOyRpfEgIthqBxrd21PXx5MKPeFdUXwYVQ/yQMIWmtCEv7XTR yoOeRS2XZW1btZohEAwyX5vl1ns/X1NQZ07I9LcvrJxpJcpffiEpvVKpU1cDvhrfUsZV llTX878+DjeJnZ2j/t9cevfJmDyJymQnuMyOXjrW4okB3ydI1j17+RXzPM2Oc6PnS/8b je12fxFEbIIYn3SOTaT0DZlOI/cQSX74ve5IboargmNkLhAuv5t38zgUciDB58hW/RrO p75Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc; bh=vk4hdGJcBF9byvX9Poax+QR39SxzTgmO3KuPWRuR0HY=; b=sn4FZItoWgiLvBTCU4OcNl1TyaUBkjHZfp1iA16rWvwx0+5ThrEeyExXzDRQ+4OBch YJG/kd6FJNZu3Cuj2Qmbr/G473f1JH4bXrbgJrDh1CRkrNYABXAodn3W2s9LlqbV6b03 gQ/iPa1PGJ8wAagpCm11i061fgS/Pa9yaKCpVJmeZ5oNbRELVS91y2qToD6rCRZst7Ny J06zrPoFkeukRD85C5+pbMBOktqkl54v2H/j0kBilfJ6XCMJsA35Q9LRSO1uENUyzbZe nHDNu5qAXUqI9LH7w6WwvrTMPgjbNRledipjxyhEmI+p6fF/6UmVPAtGgD/lG4Evc0o5 DeSw== X-Gm-Message-State: APt69E0JsQCur3QZf3oyAotaO3az4+7nJkhDL/y6B8ScSXCJkZGyLRhU HCn36slFXhk2303UYiUleFJEeek8YyI47wkQpjHQmHymxEBYtDXg01j1/F6+50GWNbxUcx70Rbf 0ZZ93YOjYj/hPUZ/FSd4dLFwEjdgIDedChj6mNTwXdFiNvcFPUalClOyVjdCghlRzSXXmjZ1QRq oJ4dDXKHzT X-Google-Smtp-Source: AAOMgpftgvjv7WHYbA3wCjtq0TO5TmXCVDqm9p3dREhuzh7oQ62XXf43leUEZZ/ZAo5YX0it3xz9VrMXxranaA== MIME-Version: 1.0 X-Received: by 2002:a24:424e:: with SMTP id i75-v6mr1205659itb.29.1529966465124; Mon, 25 Jun 2018 15:41:05 -0700 (PDT) Date: Mon, 25 Jun 2018 15:38:52 -0700 In-Reply-To: <20180625224014.134829-1-thgarnie@google.com> Message-Id: <20180625224014.134829-5-thgarnie@google.com> References: <20180625224014.134829-1-thgarnie@google.com> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog Subject: [PATCH v5 04/27] x86: Add macro to get symbol address for PIE support From: Thomas Garnier To: kernel-hardening@lists.openwall.com Cc: Thomas Garnier , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Josh Poimboeuf , Arnaldo Carvalho de Melo , Philippe Ombredanne , Kees Cook , Andrey Ryabinin , Greg Kroah-Hartman , linux-kernel@vger.kernel.org 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 219faaec51df..4492a35fad69 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)