From patchwork Thu Aug 10 17:26:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 9894337 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 3C10F603B4 for ; Thu, 10 Aug 2017 17:29:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23A591FF61 for ; Thu, 10 Aug 2017 17:29:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 17B872867D; Thu, 10 Aug 2017 17:29:17 +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 2DA7628746 for ; Thu, 10 Aug 2017 17:29:16 +0000 (UTC) Received: (qmail 32717 invoked by uid 550); 10 Aug 2017 17:27:12 -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 32563 invoked from network); 10 Aug 2017 17:27:08 -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=mBrgigOZ++Fz56c2isXtglsiWkpOhuRw2dTPklpkhmE=; b=i4SC78rVJxvjSyvor7RguGIdKFrbdO7UtzSYriLx2cS0Dhc4XOknh1J6YISH/5x1ox 6TnczgBXYDbGFBFJr3RkA5bhVB8rNWxaE5Zj3WfcK/PVF0QRID7N/xSvCLvNacpwJpNG 2mnVnNM0g7AGiSBOnojvy9EB2C2bkXBiUKR8C9iVd88q8qGcQjxYWGrciEu4PIMWzJ62 eQY3t4+fqn4gswelZXSXHyDfnoxVMMxRzgxu9jpaFXhVhHrn1rAfMHP3AivQrbaInXab lO6G7pvAveRukHwxeT8C9Grn6hxA50bz9v0KEIzhqnwlgZt+nHbU1qkB09av4oNHG7bq I+jw== 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=mBrgigOZ++Fz56c2isXtglsiWkpOhuRw2dTPklpkhmE=; b=TZ7nOSqs9W6aaCZWsMEhr1vyCGDeNm5Yai3Lpj2O+C+X6moBw2kT8HHtpu8uOnasVj Km4GGB7ulgNmoeQmfEaQlmyKH4gMYQmuFZgltHLSsFi6cb71oloHgQQIWi3t1HnvqVx1 2CLt0+nCttDvGDpxMMmxTTMC3Q24+45V6zdmjGfy7v6mJ9VDUaFHag6UUC9Nh3ZrZ+LH BobbXOshiRueufAd/i5/R9dlBUlRryQmgaxkqs9zBSgDqS1yhNTnRUR8eRspOwq1astD BqX9S6Q27RtGu7jkJZ6T7EaIFCrrfVVhrj8cefV4hBHyUAEwgQBxayF0jJ8ZeQkx2Vad d9hA== X-Gm-Message-State: AHYfb5gEytLU327qN+nb/dui/X31S05XO0VNarugAokHHRd9ZjHsjd56 3pw8H5h3zpRIO3rd X-Received: by 10.84.236.71 with SMTP id h7mr14213252pln.348.1502386016385; Thu, 10 Aug 2017 10:26:56 -0700 (PDT) From: Thomas Garnier To: Herbert Xu , "David S . Miller" , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Arnd Bergmann , Thomas Garnier , Matthias Kaehlcke , Boris Ostrovsky , Juergen Gross , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Joerg Roedel , Tom Lendacky , Andy Lutomirski , Borislav Petkov , Brian Gerst , "Kirill A . Shutemov" , "Rafael J . Wysocki" , Len Brown , Pavel Machek , Tejun Heo , Christoph Lameter , Paul Gortmaker , Chris Metcalf , Andrew Morton , "Paul E . McKenney" , Nicolas Pitre , Christopher Li , "Rafael J . Wysocki" , Lukas Wunner , Mika Westerberg , Dou Liyang , Daniel Borkmann , Alexei Starovoitov , Masahiro Yamada , Markus Trippelsdorf , Steven Rostedt , Kees Cook , Rik van Riel , David Howells , Waiman Long , Kyle Huey , Peter Foley , Tim Chen , Catalin Marinas , Ard Biesheuvel , Michal Hocko , Matthew Wilcox , "H . J . Lu" , Paul Bolle , Rob Landley , 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: Thu, 10 Aug 2017 10:26:01 -0700 Message-Id: <20170810172615.51965-10-thgarnie@google.com> X-Mailer: git-send-email 2.14.0.434.g98096fd7a8-goog In-Reply-To: <20170810172615.51965-1-thgarnie@google.com> References: <20170810172615.51965-1-thgarnie@google.com> Subject: [kernel-hardening] [RFC v2 09/23] 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" \