From patchwork Tue Jul 18 22:33:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 9850021 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 2A46860392 for ; Tue, 18 Jul 2017 22:35:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14D5F1FF15 for ; Tue, 18 Jul 2017 22:35:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07F0D205F8; Tue, 18 Jul 2017 22:35:06 +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 128CE1FF15 for ; Tue, 18 Jul 2017 22:35:04 +0000 (UTC) Received: (qmail 25882 invoked by uid 550); 18 Jul 2017 22:34:25 -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 25738 invoked from network); 18 Jul 2017 22:34:24 -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=qfGEbYwMqFL7aIBdpS6vKb/VAnP9eMx8y12A55amh00=; b=V+ViCeUrVVji20+jg+C0JkbBWk+1jUzUJPO2GPHgYsOdc4J+x2f9jKffp3Yrr6PDL8 99LfECJm3/Gtoo0IH2mIuLF8x7yMs2Cz3oThUHIbzHLDTjmaQ0gicunIpZ2WBrZe8L0b /2VUqvmbrRUrnVdgKmwDJ3aoH7XbVy0BcUPSV13fJpEdht/y6ZCyzmqzQ9CKqwAUwFiB SP55DodB759ymw/8oVIs6bADRwlm0A5Eg8smGe97wvt5Bqq9cCqPH/FmgNjp3lopfUlt jxdoBm7JLWsaJk6hl0oKweRCZSsgBvlgDMzJrDex+ZqekGIz9Bz6FrNnx4ZWe+wHOUwf KiPQ== 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=qfGEbYwMqFL7aIBdpS6vKb/VAnP9eMx8y12A55amh00=; b=XTxxkDQipffZFhPg+QuITAvw5nIQQ7ujTiK/QQL+zkEQ94ZtP5CsGJLGhudI69zzBE /8VZDMkZssmf2bncr6P5oE0fbutbql2KZswRtYS4n0rjnTt6H9LYxYkFjhFHr8gb6skG O7iqZhJwMKqrrpEMvL3tH58GdFA+fOV4t2Wuc1ihImLSuOTkflelWJ5iDC203UKhevxZ G3PPfqDXDSPCCICxgpjL1RETZ2v5eN8e/O4CLvLWXTiJ9AkJXLff2v25D/cIOqZ3egEr HUpCmcCCX190LDTf5agHBsEDZIDlp0g5QlG5yLoRX6EPVimAGiV216UFw3BBbAornZU+ QoOw== X-Gm-Message-State: AIVw111LgAdC3nBodHynkTzKi/uaHyiSgHtfhVi4p5Y37AG28v8mhdAI 9QsjWwdYWR01YGXK X-Received: by 10.98.212.91 with SMTP id u27mr3910418pfl.157.1500417251726; Tue, 18 Jul 2017 15:34:11 -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:13 -0700 Message-Id: <20170718223333.110371-3-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 02/22] x86: Use symbol name on bug table for PIE support X-Virus-Scanned: ClamAV using ClamSMTP Replace the %c constraint with %P. The %c is incompatible with PIE because it implies an immediate value whereas %P reference a symbol. 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/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h index 39e702d90cdb..2307e2aceb00 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -37,7 +37,7 @@ do { \ asm volatile("1:\t" ins "\n" \ ".pushsection __bug_table,\"a\"\n" \ "2:\t" __BUG_REL(1b) "\t# bug_entry::bug_addr\n" \ - "\t" __BUG_REL(%c0) "\t# bug_entry::file\n" \ + "\t" __BUG_REL(%P0) "\t# bug_entry::file\n" \ "\t.word %c1" "\t# bug_entry::line\n" \ "\t.word %c2" "\t# bug_entry::flags\n" \ "\t.org 2b+%c3\n" \