Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4428205imm; Mon, 25 Jun 2018 15:49:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKofn9f1DGwBAz36f+DpzU5/aeNB11BMenNzY4FXLGLOYWR/QLnLX0NFAophWtvBWwz9NSn X-Received: by 2002:a17:902:e101:: with SMTP id cc1-v6mr2100438plb.96.1529966990912; Mon, 25 Jun 2018 15:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529966990; cv=none; d=google.com; s=arc-20160816; b=jID/5zbEJEHwqqHeDrJkQ8nxKKVYfDE69jrUjUoUq4PM8vsBV3gqEEYEl1AWLYvPrM 5oRmYtfHxDD9G1puzaUqUn0Q9NOXG5D7ocy3YYgbkWQ7XPbQrygA+sG1v5numY++05aM YhD/kXxRSVTyX4vzmKKJDZS3kKs+Rgww+hZJiuKpibJ4e1QyLelAdwZVgWB191TWhMX7 e0VF8HGBlaWFpSjbT/d8UiJXkhbLSp1hajkqFzDqSJVIwtXVFPT/DCgl1WbYEgZs4l21 YBFaRaHbM1Hf0nyj0b1u0P7pfdU8ebCYM8QqF6LHBcl3xMGt1wXgs8njef9K2LEizZm/ sClA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references:message-id :in-reply-to:date:mime-version:dkim-signature :arc-authentication-results; bh=vk4hdGJcBF9byvX9Poax+QR39SxzTgmO3KuPWRuR0HY=; b=NT7yfZRbNFcLtzqSImVCqpsVfs72H3+LyLd1ppPVDsKgcBW7xZGnpQmEXfYUlO0wcw SJ4zJ/KPcxjXljZX/ecnDuxeUSQoZBCkT+B7AczrDbTmHJe7QuyRpr9oNUsx3X1Peck+ 9YyEV99zAXTQ10xUICM59kWQ8fT+Afbl3teBMrzMe79WCz6eTDA0UUx+f4AxZlxUC+vY pxe6uR5nGloaDZHWemfFih6Jfx+bpX+pzSZoMiFMkoMtPiZ52lYXgJ/079JkJwo2m5Gf Mt6M9VX3sYQJmneRVft6qdqHyqjpqO5hXCdFpj8nL1sy02r1YpsC7+4NX3UlX8iibsae ajsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="DCQ/4bhH"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s6-v6si74556pfj.338.2018.06.25.15.49.36; Mon, 25 Jun 2018 15:49:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="DCQ/4bhH"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933065AbeFYWlL (ORCPT + 99 others); Mon, 25 Jun 2018 18:41:11 -0400 Received: from mail-it0-f73.google.com ([209.85.214.73]:35345 "EHLO mail-it0-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932200AbeFYWlG (ORCPT ); Mon, 25 Jun 2018 18:41:06 -0400 Received: by mail-it0-f73.google.com with SMTP id 7-v6so9233916ita.0 for ; Mon, 25 Jun 2018 15:41:05 -0700 (PDT) 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=O9k3HUyEyzMWmw9Zpheih2q2hRhSMKAcfeLJMWwRZpAtYG3MawsiZ7GusBjwPz+meB OY2WVjLlzBzf1NtEFK565N6sleXzu1PiuVgEjtKYUI35l+TICjo57g4encYefvI7maP7 mulCsvpWYiwaEzJuSQWlETev0hHAwFk3sgzI9oo2BNih2GCMPAO2qamRReojgMhFe4Fq 6W2i6VXubYP1WJp3S8H9vQTP3p1YMbWWPoXgF/SK67HyOhqIZ8y3FLRW1al1hwYJf4tI dlhPdYzgHwEI3xorsC1hClzu/L8j2tAJfZkPOvrhKvH9QINP5ins+6UGbwaAJywEd8rp QKPw== X-Gm-Message-State: APt69E39xphTkAU8FcXoGe9vsOmaBSHNPIfkeBX1PJG01FfgYvF7uIOc WdTFhXcIPXbyWV3OmXUMZlh8Xu7/Z1/c0Q== 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) -- 2.18.0.rc2.346.g013aa6912e-goog