From patchwork Wed May 23 19:53:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 10422255 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 0531160224 for ; Wed, 23 May 2018 19:56:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5117291CF for ; Wed, 23 May 2018 19:56:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8048291D4; Wed, 23 May 2018 19:56:51 +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 E6CFA291CF for ; Wed, 23 May 2018 19:56:50 +0000 (UTC) Received: (qmail 22103 invoked by uid 550); 23 May 2018 19:55:18 -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 21903 invoked from network); 23 May 2018 19:55:14 -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=4pidGTuKjJnykmPThQ8mnbrxWd9M5yv6Jw8b+aT2J2I=; b=B04AozUJXblogmhoK7KTi5akCGxkaMgs8Mhm8fCYrSxm1ofUJv3rykHt4tmGq3EPUU +myQbIwtCOa9PvqjCzRRneTASJqeQYKPhpFoeJ5m1pdDBKJHqYe+LRx+wZd7kZO8sQfQ i9jwtns+a7T6WN8YieBkBmWlUTLE6W+Iq6EhaKsX7ZpDixD3jMTvx59Jost1tLE3tPdH 1ykPsLkWUrmNQbK7J8KExmnjyyOxHxTfIqLfRPRId4R906IRN1OyXMhP+F/jPAg/QN0V fQL5jodPkeAedweLWISjk5SrGMck0CjUxKItuDnOxaXAFmO7GT0jaeNVE/uDjDNYaYKY eSzg== 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=4pidGTuKjJnykmPThQ8mnbrxWd9M5yv6Jw8b+aT2J2I=; b=ZsdcoveYtifXqhjHff3QYgZs1k7BSWdKadBs3WjOfpGvpgT5QCeqPCzfbNHgXggRfj bGRIkzpbfREMHG6WMJTYSZDIw3NXlBHDPJkahV/BI5wlUkZYgzAw0EWHqtp9Cy1pMrWa ejJGOsUcEIDnjto36cSOI6ix+uFKpInq3qiah/FeQW+s1se9uRGJHuq/T5oghvs6wvXJ 9bv2r1sAif4iNdwVV0fkMmgdMOIn7FWuUGdKgCBAeQ+Doxb/39VElnMbGBi4ucsZKoD4 ze7G8jF38jIkVsuJpieM4xoptc/oDCAJpE6mRXRVALq7Tz6qLIH67GRL1L6pqE5Nx27D CUmg== X-Gm-Message-State: ALKqPweg//E6OXeZGm59YuVfW9JbGDtSUacCHGB8MWu1AjXysQE0EwM2 lr1xf44Ob8I75yqeGHzyA+fm4Q== X-Google-Smtp-Source: AB8JxZqAtDRMC1wRHAI6LYzBpRrGYJHNfnw13bmsmXFyHlxw8XkcV+ktNwja2BI/vTr8he3SfHlxPw== X-Received: by 2002:a63:7207:: with SMTP id n7-v6mr3288532pgc.195.1527105301677; Wed, 23 May 2018 12:55:01 -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 , Thomas Garnier , Philippe Ombredanne , Kate Stewart , Arnaldo Carvalho de Melo , Yonghong Song , Andrey Ryabinin , 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 , Jan Kiszka , Tejun Heo , Christoph Lameter , Dennis Zhou , Boris Ostrovsky , Alexey Dobriyan , Masami Hiramatsu , Cao jin , Francis Deslauriers , "Paul E . McKenney" , Nicolas Pitre , Andrew Morton , Randy Dunlap , "Luis R . Rodriguez" , Arnd Bergmann , Christopher Li , Jason Baron , Mika Westerberg , Lukas Wunner , Dou Liyang , Sergey Senozhatsky , Petr Mladek , Masahiro Yamada , Ingo Molnar , Nicholas Piggin , "H . J . Lu" , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Joerg Roedel , David Woodhouse , Dave Hansen , Rik van Riel , Jia Zhang , Ricardo Neri , Jonathan Corbet , Jan Beulich , Matthias Kaehlcke , Baoquan He , =?UTF-8?q?Jan=20H=20=2E=20Sch=C3=B6nherr?= , Daniel Micay 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 v3 02/27] x86: Use symbol name on bug table for PIE support Date: Wed, 23 May 2018 12:53:56 -0700 Message-Id: <20180523195421.180248-3-thgarnie@google.com> X-Mailer: git-send-email 2.17.0.441.gb46fe60e1d-goog In-Reply-To: <20180523195421.180248-1-thgarnie@google.com> References: <20180523195421.180248-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" \