Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2793309ybl; Thu, 29 Aug 2019 13:01:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQrnYnaQFnpaUSU6jPX3EP7z0P3H4qHnHvIPqTWaPb76NxWpFuBq3CrxsdXE71pRI5LtJa X-Received: by 2002:a65:684a:: with SMTP id q10mr9966969pgt.417.1567108894466; Thu, 29 Aug 2019 13:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567108894; cv=none; d=google.com; s=arc-20160816; b=mjU3YbVO3q8a7LSizKjJwcYjXRz6DiioODSN6cz0BM6GYiPL6BKhx+7INXLOQdrJHZ dmzGZREmMZtre99mrBzgMmyRAmoVtBA0+3zuQcKJDOtjWK88/Nh+c4HkdOFNkgbF0lCc 5OkRqwPc+fi/bETB0RcFWD9WQ3vzpyGe3drZKP9kiXt21bIsJasTkVZSPH50ehlQ0+RW peMAlShqpqckkiPli9xL2mGiBD2UMfGyjn3YZCMSP6uO06OhK/7LvZRAP0DyU3EObyeq ySnb1M3pucbYQY9P0NkSfRaKO6xrIb8nP+K46K6IBgfOxUnPPaj3IMQ5g7BRSFxmFzpm hKYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=aYf/lCZC1gwMIR9/lhwT5M/JPgKzeUqjFNgwUcFRWFg=; b=Z38OC7oKtDEk0aoFflaXNIxEtYISMZyz1sd5UNEp9o+ZtLUtyQdOdZImq391uZD3pQ 2+bhT5NO0UY087b5opbTSkjs871dNVUl3Xfvfdx7wnIPB5b8dT5mg61566JdsHA+4zcu NljdtP8SJtna+x0P1C5LXlouLOEWfFJuZ7ILiQ3puPes8/phJOhWyeGUeFksApxFlhNj CIpSVucd1QusNQFdRToPNlVe6HNCZGjTuPLMHfdoVGu2zNaRMnTYdVxl1mIYQck9Rp/5 rX3tLWr5ZAnviXW656pksUrKmJvogEwTDH5LDx8JmsylUrjxgPItIxX+2+DcpzCwoXGm CBTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=U75GJORV; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k73si2752817pge.353.2019.08.29.13.01.11; Thu, 29 Aug 2019 13:01:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=U75GJORV; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728132AbfH2UAU (ORCPT + 99 others); Thu, 29 Aug 2019 16:00:20 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:46821 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbfH2UAT (ORCPT ); Thu, 29 Aug 2019 16:00:19 -0400 Received: by mail-ed1-f66.google.com with SMTP id z51so5324046edz.13 for ; Thu, 29 Aug 2019 13:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aYf/lCZC1gwMIR9/lhwT5M/JPgKzeUqjFNgwUcFRWFg=; b=U75GJORVMHIr0iUVnntJaP5CkG0L6J04X+1V/ZPN5uW3dQqnBj8pdaROlXs8b4Z1SG DR1yBHet2NvJnJhuzP0i5c/qQ5sBWpaG0KlB9URDDEL2UqurL8fMaEild5hR6irruZ3I WwlNUWnUuDyL8bRkDmAo8qYqSmnG/ayXfekSo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aYf/lCZC1gwMIR9/lhwT5M/JPgKzeUqjFNgwUcFRWFg=; b=DBun3p7SX2tn4H4k4fKd8Q9wblOhAT5/mOkfOE8eHGBt30BnaI3EPVu30UU2gCq46+ GtyaYV9S+K4RybDmbFZj7N5jtS2bvwuApWdtVIcdK5xdvE9sSTAiB+iMOH8TS3979hk0 QREl8TmMkA5PwPUg0bTxeGkJR8szvU7/HxFJLQEUqv+WNjQgiRWuuarq/pl+3sODkg1P 6UbPGdclmwFiGoKmvWVA6tzPODrUEamlGqui9EzRI0BYZHK5lmING38LAEp8isQNmrnH yhgqsEJ4oQ+ROUDltuV+E12TeasXnAzRUHR8JN9jBOQUGRbTFWT0pdSRcOwy5OrTQrig Exwg== X-Gm-Message-State: APjAAAVclk3UowlC+PcKsOuNnK4hMplkQ0DrnQsh/AJBopMNnS8DwYnV KLKPiKSCoHWjy6h/YsIpttRoNmkwp/U= X-Received: by 2002:a50:f592:: with SMTP id u18mr11689146edm.296.1567108817644; Thu, 29 Aug 2019 13:00:17 -0700 (PDT) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com. [209.85.221.42]) by smtp.gmail.com with ESMTPSA id j2sm507760ejj.34.2019.08.29.13.00.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Aug 2019 13:00:17 -0700 (PDT) Received: by mail-wr1-f42.google.com with SMTP id b16so4646722wrq.9 for ; Thu, 29 Aug 2019 13:00:17 -0700 (PDT) X-Received: by 2002:a5d:4a4e:: with SMTP id v14mr13235010wrs.200.1567108513590; Thu, 29 Aug 2019 12:55:13 -0700 (PDT) MIME-Version: 1.0 References: <20190730191303.206365-1-thgarnie@chromium.org> <20190806154347.GD25897@zn.tnic> <20190806155034.GP2349@hirez.programming.kicks-ass.net> In-Reply-To: <20190806155034.GP2349@hirez.programming.kicks-ass.net> From: Thomas Garnier Date: Thu, 29 Aug 2019 12:55:00 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v9 00/11] x86: PIE support to extend KASLR randomization To: Peter Zijlstra Cc: Borislav Petkov , Kernel Hardening , Kristen Carlson Accardi , Kees Cook , Herbert Xu , "David S. Miller" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "the arch/x86 maintainers" , Andy Lutomirski , Juergen Gross , Thomas Hellstrom , "VMware, Inc." , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Nadav Amit , Jann Horn , Feng Tang , Maran Wilson , Enrico Weigelt , Allison Randal , Alexios Zavras , Linux Crypto Mailing List , LKML , virtualization@lists.linux-foundation.org, Linux PM list Content-Type: text/plain; charset="UTF-8" Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Aug 6, 2019 at 8:51 AM Peter Zijlstra wrote: > > On Tue, Aug 06, 2019 at 05:43:47PM +0200, Borislav Petkov wrote: > > On Tue, Jul 30, 2019 at 12:12:44PM -0700, Thomas Garnier wrote: > > > These patches make some of the changes necessary to build the kernel as > > > Position Independent Executable (PIE) on x86_64. Another patchset will > > > add the PIE option and larger architecture changes. > > > > Yeah, about this: do we have a longer writeup about the actual benefits > > of all this and why we should take this all? After all, after looking > > at the first couple of asm patches, it is posing restrictions to how > > we deal with virtual addresses in asm (only RIP-relative addressing in > > 64-bit mode, MOVs with 64-bit immediates, etc, for example) and I'm > > willing to bet money that some future unrelated change will break PIE > > sooner or later. The goal is being able to extend the range of addresses where the kernel can be placed with KASLR. I will look at clarifying that in the future. > > Possibly objtool can help here; it should be possible to teach it about > these rules, and then it will yell when violated. That should avoid > regressions. > I will look into that as well.