From patchwork Mon Jun 25 22:38:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 10488255 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 AD2AE60386 for ; Tue, 26 Jun 2018 08:38:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83A4327B2F for ; Tue, 26 Jun 2018 08:38:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77BF327F17; Tue, 26 Jun 2018 08:38:49 +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 87C2327B2F for ; Tue, 26 Jun 2018 08:38:48 +0000 (UTC) Received: (qmail 20182 invoked by uid 550); 26 Jun 2018 08:38:26 -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 Delivered-To: moderator for kernel-hardening@lists.openwall.com Received: (qmail 9961 invoked from network); 25 Jun 2018 22:41:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:date:in-reply-to:message-id:references:subject:from:to :cc; bh=smiMhu+/BeT5Pxdg509a30E1ghstaHTxE6n7qixOWlc=; b=U6JkeUShAN/4xy5Y0SstOVpLWKTCw19NJLX38E2AREFR2ACgKd58omFusy5Etlwy8R 0XHCzp7jRmPO5UKgm78o4K9wqZKbRD8CnZ9/gFj1xjypBVh+O1NIIU20ZyGdGzfXLws8 AYo/yDIdt366QqR219PkWtFoe/UZoM+KqkYKCaR02sREVOS+0RZBQ1u1BdGzZYxTPQ8D pOkvFvWWew0Ns4WZOwusHa+LUQobFWij47y4gnjm7uTW3wZEkoMtRTocRulmnzogm9+D cjGrib9HhmXhmbhwRLc+fnyarF46fZPeHmHg22LplU3Bl4n51bbwrGIidqHhL6XcA4P9 fpEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:in-reply-to:message-id :references:subject:from:to:cc; bh=smiMhu+/BeT5Pxdg509a30E1ghstaHTxE6n7qixOWlc=; b=RvQD8t84G1No4iAQFJaVFHuKl2uVR5K0Jzo/QC7M+HwuYkFtUOt5pk6jjSQBrvVRev pxCEsz7kBd52ORkMI3Iuee9mPJgg+RzP+n/buoSE03uXIcDEZHhXU4CQcqalDlzl2itO lsDuT6X2nZb8rEAuMCQPxv9JL8lvzTx3JCFUQ3xyR/zK0runQSabXK4oadJxlXwFuTUT 8DLIMt9U3bPlSR8DhW6wJnA4JoHfe9NqnGV8JNZgUEBhNQndimikvzuG361F6s/QP3f4 S7JNabF2XscoDkoKE1rUwuf4AAJY5P+AURWwoGgP0mqau+DgM+gtfPvIn+lP5I8rDCwU ItLQ== X-Gm-Message-State: APt69E2sLUqfoewl9R9I75IR5lbEs3ERJGKDcmdjTeA+6o9pQFbc2z+I 0tCyI7cgIZdPzuNfuyYJPE04GAyqyzbp1PskSbJpS7d6mf47NW7ySKaMUgQLJJHq0oGHqMgPG3R lL52+Qzl52ApE/rBxxvTjYu31KXs2T2A8HOgJyBng1EBYmOPe/X076clKtW2q9dW9zYp4c9nS/n 6lLM/KIWCO X-Google-Smtp-Source: ADUXVKLwYmw/x5AjuGui7CGCkokkURkHf1n9bi8BHM6yCyuL/w2MGgbAiRtG5eOKFdXI7exKF94HhCT8RUksxw== MIME-Version: 1.0 X-Received: by 2002:a24:b602:: with SMTP id g2-v6mr1171076itf.16.1529966457671; Mon, 25 Jun 2018 15:40:57 -0700 (PDT) Date: Mon, 25 Jun 2018 15:38:50 -0700 In-Reply-To: <20180625224014.134829-1-thgarnie@google.com> Message-Id: <20180625224014.134829-3-thgarnie@google.com> References: <20180625224014.134829-1-thgarnie@google.com> X-Mailer: git-send-email 2.18.0.rc2.346.g013aa6912e-goog Subject: [PATCH v5 02/27] x86: Use symbol name on bug table for PIE support 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 , Kate Stewart , Greg Kroah-Hartman , linux-kernel@vger.kernel.org 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" \