From patchwork Tue Jul 18 22:33:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 9850035 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 0CA3360392 for ; Tue, 18 Jul 2017 22:36:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA0F2285B7 for ; Tue, 18 Jul 2017 22:36:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD6D5285CD; Tue, 18 Jul 2017 22:36:01 +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.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 1FDE7285B7 for ; Tue, 18 Jul 2017 22:36:00 +0000 (UTC) Received: (qmail 26557 invoked by uid 550); 18 Jul 2017 22:34:37 -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 26454 invoked from network); 18 Jul 2017 22:34:35 -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=x7CBXa1CxcCHcainbvTTKr6TQjiJ2Gva4vtnCnlTeO4=; b=TYSHTw8rJX+WyTRbHwCZMSJugImr7JeUQEXe4nmcbjud8SAFRv/EWEGP1tqH8/rWZn DgjgDdirtF2CPdSxOL5db19SGLz6+KtwDHX4onAIxxNtKYC5nbScycsy00Xe4zKRs6B6 qb69dD/mPlnQT8ECysi3GFFRXxRpTQB12U3TED7ddtiIIkYI8WGwxis+RKMItFFhfBuv R+mJ73Fws1SEuqt5UkWJwBqQC3zLuTGkGunb7erarY6/LFHUMDrjUcjh/oi2wr+CW2To w5WJlCHelbCYqP263qqgYYRKSuJuZn3q4DKq+5iatUq6rfqu4qJqsKS0IYzp4zW6KRuw 27YA== 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=x7CBXa1CxcCHcainbvTTKr6TQjiJ2Gva4vtnCnlTeO4=; b=fVFmGoC3x8/EHIJn7tuEEhekNxLH21trFn/0bU+ff3Q8kITm4Zxvk6E/mmVw3gm0DE S0QGWPbI2kcQ23zFKqb+l2lIhnfDXyAj6lp8IEABPfu4mjS/0xSiE1JDmjkuLvqIRUfH us1f37poy4FFkU1sHdP/eDHolZGx/2kuWUYMRDkg5ntUmllh2IO8QwMpz/pl/EtE+WWm jWzULB+glnRbDeRb9kyCuYzpjJBjgO/Us7U85jXrvL2Y8ccjSOUC3gC65bmWtrXVTCjY gJGBLedwUgpRNlW1Y458JD+cF5aFV6CLfv8oBiwYnX5MFWyWEPxPqYJhBavKJL/kfHUR lEQw== X-Gm-Message-State: AIVw110AYplW6nJ6zIBtLXc0RjQLmuBpGS5ph2qxf7cPY4I+IVCCuyLS SlxFpCR949zjnCBD X-Received: by 10.98.101.4 with SMTP id z4mr3852610pfb.163.1500417263704; Tue, 18 Jul 2017 15:34:23 -0700 (PDT) From: Thomas Garnier To: Herbert Xu , "David S . Miller" , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Thomas Garnier , Arnd Bergmann , Matthias Kaehlcke , Boris Ostrovsky , Juergen Gross , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Joerg Roedel , Andy Lutomirski , Borislav Petkov , "Kirill A . Shutemov" , Brian Gerst , Borislav Petkov , Christian Borntraeger , "Rafael J . Wysocki" , Len Brown , Pavel Machek , Tejun Heo , Christoph Lameter , Kees Cook , Paul Gortmaker , Chris Metcalf , "Paul E . McKenney" , Andrew Morton , Christopher Li , Dou Liyang , Masahiro Yamada , Daniel Borkmann , Markus Trippelsdorf , Peter Foley , Steven Rostedt , Tim Chen , Ard Biesheuvel , Catalin Marinas , Matthew Wilcox , Michal Hocko , Rob Landley , Jiri Kosina , "H . J . Lu" , Paul Bolle , Baoquan He , Daniel Micay Cc: x86@kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-arch@vger.kernel.org, linux-sparse@vger.kernel.org, kernel-hardening@lists.openwall.com Date: Tue, 18 Jul 2017 15:33:20 -0700 Message-Id: <20170718223333.110371-10-thgarnie@google.com> X-Mailer: git-send-email 2.13.2.932.g7449e964c-goog In-Reply-To: <20170718223333.110371-1-thgarnie@google.com> References: <20170718223333.110371-1-thgarnie@google.com> Subject: [kernel-hardening] [RFC 09/22] x86: pm-trace - Adapt assembly for PIE support X-Virus-Scanned: ClamAV using ClamSMTP Change assembly to use the new _ASM_GET_PTR macro instead of _ASM_MOV for the assembly to be PIE compatible. Position Independent Executable (PIE) support will allow to extended the KASLR randomization range below the -2G memory limit. Signed-off-by: Thomas Garnier --- arch/x86/include/asm/pm-trace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/pm-trace.h b/arch/x86/include/asm/pm-trace.h index 7b7ac42c3661..a3801261f0dd 100644 --- a/arch/x86/include/asm/pm-trace.h +++ b/arch/x86/include/asm/pm-trace.h @@ -7,7 +7,7 @@ do { \ if (pm_trace_enabled) { \ const void *tracedata; \ - asm volatile(_ASM_MOV " $1f,%0\n" \ + asm volatile(_ASM_GET_PTR(1f, %0) "\n" \ ".section .tracedata,\"a\"\n" \ "1:\t.word %c1\n\t" \ _ASM_PTR " %c2\n" \