From patchwork Tue May 29 22:15:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 10437265 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 AA395601C7 for ; Tue, 29 May 2018 22:18:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92BEA288EF for ; Tue, 29 May 2018 22:18:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86B952890F; Tue, 29 May 2018 22:18:26 +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=-12.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, USER_IN_DEF_DKIM_WL 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 9B112288EF for ; Tue, 29 May 2018 22:18:25 +0000 (UTC) Received: (qmail 16175 invoked by uid 550); 29 May 2018 22:16:57 -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 16076 invoked from network); 29 May 2018 22:16:54 -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=V9fFBJQznCDHKv/sJSLw6Zhl3q7C56zxKfVQ/ahpr80=; b=VpzqpT84FM28rnPrOFxdUGsEb3tG5c3cuuLmyoODYfpG6oTHS28RNKb6Dt9p4ylyxd 6JdncndpjsWOlr99c+qLAQdyejzBe2bI0uc+tWp7OIYwQtOL+OR91CO/YthnLQeudHd+ s5D35BV9GyavjZoj6gkbGFxSqkz4E/0pS6xxJoMdNnkgMceDgqRLZbsMZ9l7PTjYtJaq pRIvH42u3OrvYYJVDFB5H8Pj0UmSDOB9hz4npmlh4591tgsF/aclUA/qOwOx/TjGp60k bhg7I8XWrFk/kzerzxdRpIZ6g/m4kGDbCdA/6H6kM6YV6JABRR8ii2HM5XRr/rxW7ZJ4 SJbQ== 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=V9fFBJQznCDHKv/sJSLw6Zhl3q7C56zxKfVQ/ahpr80=; b=KScJMV11k0ZpN98ZvGIQNONFwSxL3vSBcY+SKQp3q5zEamjLAaCo1wYEh/YAHaMYbK rDnNbuR6Ohmv8kZRtSmSwVuUnad29XoNQmpzUpd/LfoN/sXiJyuK6KOAjffcsyQM/7Ig JIuzayU7WRFal75+NOw7LOcn7nnpYYZwMXQvTkiCRi30Ms9hFta+TkfWhdYT8GpmWg1F MdsKja0oDlx6+b1SjevEg0XNxwYAVpPIi3HFkN6/9+StTxXTKIw/CyRxVpakMKTbi0xJ TVVHNpkA9vWlwgI1QSagJEoRmAKOywvxzl7Po7JCO/jMZr2YiUNUqz/BsAutI7RhwK2w bWAA== X-Gm-Message-State: ALKqPwdggnWQYwwg6RexrVNaZVkmg1ENLnyGSusGaewRUKd84Tdyoim3 7u9lTRjd21H8/XBjRNyObjrSkRioBDg= X-Google-Smtp-Source: ADUXVKL34RpEedao1HkBLjkEi/QXiAx7670a2kB8yU0+lQlqt9EEszzrl7zdiULNUxsA0u2f+FpN5g== X-Received: by 2002:a63:6ec6:: with SMTP id j189-v6mr163001pgc.71.1527632201756; Tue, 29 May 2018 15:16:41 -0700 (PDT) From: Thomas Garnier To: kernel-hardening@lists.openwall.com Cc: Thomas Garnier , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Peter Zijlstra , Josh Poimboeuf , Philippe Ombredanne , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH v4 02/27] x86: Use symbol name on bug table for PIE support Date: Tue, 29 May 2018 15:15:03 -0700 Message-Id: <20180529221625.33541-3-thgarnie@google.com> X-Mailer: git-send-email 2.17.0.921.gf22659ad46-goog In-Reply-To: <20180529221625.33541-1-thgarnie@google.com> References: <20180529221625.33541-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 extend the KASLR randomization range 0xffffffff80000000. 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" \