From patchwork Tue Mar 13 20:59:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 10280759 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 886BD602C2 for ; Tue, 13 Mar 2018 21:02:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78F2228492 for ; Tue, 13 Mar 2018 21:02:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C991284B3; Tue, 13 Mar 2018 21:02:07 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_MED 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 04AF828492 for ; Tue, 13 Mar 2018 21:02:04 +0000 (UTC) Received: (qmail 20008 invoked by uid 550); 13 Mar 2018 21:00:31 -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 19929 invoked from network); 13 Mar 2018 21:00:28 -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=ahWj7TFSzN26kCwJKtJajoqrxWswy2RHrVUiaeTyoDo=; b=a8mykL3JRiYeV7NaPCbIsprd8phY/iLxEeU/BJFnXFlHX9CrnbEA1OzTwnoPBPykmw t5hyCDJqQ+rHmGkZrGV5OPMz4uperx+TMrShNTdIZUAMR0mXWqem/yBgz+EKvKQkBd+7 0D5SaQovekRda/h08Lsu9L7NkpDkAJUcFROVNiqVyiSmLxYpDv9NTdHIL2uXysfoK4jy LhV3IbmCSM5AiEe/5Aa36Ps6xgEe2yCugYuWsALrK229jlYxtg//mT2LFJyErjB2NF2T o8bHWPBQjOlAUy4UUW1lRqYkFcmgfdWpDPS1Z35DYQZ8wUB/ErEAYTOrZr3/L1+78YkS g8oA== 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=ahWj7TFSzN26kCwJKtJajoqrxWswy2RHrVUiaeTyoDo=; b=i5juUW6I0BBakPQZ7yyIL7+7mDGK4204FR2pwtrozr958XIT7on6QBzHhEUpmCVluZ Z4JFWUTJqgqIym/NV7oWOqBUvGkMBbudFAHCGjGynDfhjjcwtF/w98G1eAm5rh6neeED mWAv2qvPyJCL5AiWG6ICN0jlakX/9v9Db3rzD+9Tp4gRGMOnIr8MHmhC1jI7oVzyZ6uW 9c6xFxgfORnfs3lWKahdREAa0vsED1y9a4AmVQuJgPt1FnhwI7IC4Hc9J0fWJxGU0gaC rkkFyYRggW++9BkonUFqFQ3GSfz6uwDjuUTqmGsHemS4LLGxDPM5jfTCwScJ8Y08yvjE e1AQ== X-Gm-Message-State: AElRT7FQmJLJUmyEXwscm7ejpbscvQo2IPL2zGM2G1W8Sj0EbOnLT1Gd 3NBWC6YxOws5OMLABvKP8U/OPw== X-Google-Smtp-Source: AG47ELvCA5rkIARERRKcHw8VNyxTncut5k0IBuEAzUqKJKEBZvq+YsJVJqpO+aW0hbOqxUzETRoUbw== X-Received: by 10.99.191.15 with SMTP id v15mr1590058pgf.396.1520974815577; Tue, 13 Mar 2018 14:00:15 -0700 (PDT) From: Thomas Garnier To: Herbert Xu , "David S . Miller" , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Greg Kroah-Hartman , Kate Stewart , Thomas Garnier , Arnd Bergmann , Philippe Ombredanne , Arnaldo Carvalho de Melo , Andrey Ryabinin , Matthias Kaehlcke , Kees Cook , Tom Lendacky , "Kirill A . Shutemov" , Andy Lutomirski , Dominik Brodowski , Borislav Petkov , Borislav Petkov , "Rafael J . Wysocki" , Len Brown , Pavel Machek , Juergen Gross , Alok Kataria , Steven Rostedt , Tejun Heo , Christoph Lameter , Dennis Zhou , Boris Ostrovsky , David Woodhouse , Alexey Dobriyan , "Paul E . McKenney" , Andrew Morton , Nicolas Pitre , Randy Dunlap , "Luis R . Rodriguez" , Christopher Li , Jason Baron , Ashish Kalra , Kyle McMartin , Dou Liyang , Lukas Wunner , Petr Mladek , Sergey Senozhatsky , Masahiro Yamada , Ingo Molnar , Nicholas Piggin , Cao jin , "H . J . Lu" , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Joerg Roedel , Dave Hansen , Rik van Riel , Jia Zhang , Jiri Slaby , Kyle Huey , Jonathan Corbet , Matthew Wilcox , Michal Hocko , Rob Landley , Baoquan He , Daniel Micay , =?UTF-8?q?Jan=20H=20=2E=20Sch=C3=B6nherr?= Cc: x86@kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, virtualization@lists.linux-foundation.org, xen-devel@lists.xenproject.org, linux-arch@vger.kernel.org, linux-sparse@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, kernel-hardening@lists.openwall.com Subject: [PATCH v2 02/27] x86: Use symbol name on bug table for PIE support Date: Tue, 13 Mar 2018 13:59:20 -0700 Message-Id: <20180313205945.245105-3-thgarnie@google.com> X-Mailer: git-send-email 2.16.2.660.g709887971b-goog In-Reply-To: <20180313205945.245105-1-thgarnie@google.com> References: <20180313205945.245105-1-thgarnie@google.com> 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 6804d6642767..3d690a4abf50 100644 --- a/arch/x86/include/asm/bug.h +++ b/arch/x86/include/asm/bug.h @@ -35,7 +35,7 @@ do { \ asm volatile("1:\t" ins "\n" \ ".pushsection __bug_table,\"aw\"\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" \