Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2855132ybe; Sun, 8 Sep 2019 02:08:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwOOHjlRysfOtW47ruYRUYVrcOMBWuxFxb9gM7hyDeJEcSOzXjOw6QPrOfo0lkuRhTYwiM X-Received: by 2002:a63:5c7:: with SMTP id 190mr15799159pgf.67.1567933716666; Sun, 08 Sep 2019 02:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567933716; cv=none; d=google.com; s=arc-20160816; b=mKli8+mFpU1inQINyVyhoJgJyzojPFDOTGDP6tf37MFuYHZU0I/heLG7tPUl3LN2uS MlbocLbDVTCF5qs2VjBhe8Vkr65i2CN8WFVAttBzQXvfdkAwR8OPhl9gxwbyzSQ7U9iS 9TlOOLmWDgLUsacCBRN2cSidfDPXq8e0BWl3OW+jNqgp+ozMWVME69zg3b77HeeiUZqy ctY7g+pYGHSe4v2DhCfSQduNl8RJ862TClMiM75OlS8GDqjz9nLjhaC3qthpeHuQgQkb 69LQM8JxIP85UpWd5TJTevUl9dYzOehT5A4mLuLcGAxFyeEmEyCiGePoyKj3MfoZxaOH fIYg== 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=Eqinxltb4P+tBqyuO4WEtRUcfdT4qbszA3gfVj1CVng=; b=vrY158nv86nkhFCSBrXPW9Fx8v6vBv5GtJb3w2UmEjakLxzv/7FtDooKuK2uEavlRl Tk8hxjlx3q3X0zA10+70LHB26uXNA9QojrXAOfz7Llu8z86RjnQA2ZbhHmHDZFPB79Y7 cMva8dtr34KWrlDcj7tUshdExJQ9Nuooz0Q32BymwVBlde4RTPeeg4S+sgprKOkGP19S dXrRd0giUCrbSFqJ40rAZcTK2T5ib9xlylPXj3uZ+tNs5WDoyodhb81h5KsP7Md/J7Cx iVKhqild34sK4lrqUt8tC3+ttjzPWQnwYJq0Srf4F2H1NesDQcPDVCpO4+A0j+INfYf7 FriA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CfxhObTV; 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 c10si9752440plr.57.2019.09.08.02.08.09; Sun, 08 Sep 2019 02:08:36 -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=CfxhObTV; 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 S2392707AbfIFX3X (ORCPT + 99 others); Fri, 6 Sep 2019 19:29:23 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:34890 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391276AbfIFX3X (ORCPT ); Fri, 6 Sep 2019 19:29:23 -0400 Received: by mail-ed1-f66.google.com with SMTP id t50so8021584edd.2 for ; Fri, 06 Sep 2019 16:29:22 -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=Eqinxltb4P+tBqyuO4WEtRUcfdT4qbszA3gfVj1CVng=; b=CfxhObTVAmcNKpN/uttdeqMFFuot/dgQ8oBhunu1p3A2/KXMdnJc7eTmTJi6e2ocMn NDFZD/Qh8ub6N+V6n8nGKJNHUKm6leUg+lflNX9keuez69bvdXFvHkCOlVvCSi5FCwQp GqpsxbxIXF0lypQ9v5DbU9u4VRzHE/ky6Ttco= 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=Eqinxltb4P+tBqyuO4WEtRUcfdT4qbszA3gfVj1CVng=; b=SsJ3dApIRRFVLpsunw0/6zcHoiSd6SEP9pIaAmgWZQLdacKzNM2KypUuRXDGoYx52x 63IZZJRnKel1zVs/RC/Ubty7NEVGLR7oyemoMZSefbqWMXJ+ZQuLf3eiZ8BuvVpvpEa7 R/fjITaSp2UR94SdNI2SR4w06gHGxtLl+vFayLQaxqmeGgzcEx2eVgnfn9NB4FZNd8hw q8/LbvxL+/VM/2cyLxyWMjtopr5EznWNxFdkR1EpJnWTM88P5qbA6YqGJoeTQwzaAezo ZHLKfs0dCvM3o3X6itj3Jk8duYyeN+Oje/GErDUozJdgrW/K077+Fb9rGTOLqNSMpIjs ZYyA== X-Gm-Message-State: APjAAAVJDpAG/W19xIQ6aA4oj7+yHMQ17e4sGnN/NFQ96JR0CwoDKa+b PO+lTvkDOnydlZRyZ01XJxt+jtuL9Cs= X-Received: by 2002:aa7:d456:: with SMTP id q22mr4657857edr.262.1567812561825; Fri, 06 Sep 2019 16:29:21 -0700 (PDT) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com. [209.85.221.49]) by smtp.gmail.com with ESMTPSA id f36sm1111125ede.28.2019.09.06.16.29.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Sep 2019 16:29:21 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id w13so8143921wru.7 for ; Fri, 06 Sep 2019 16:29:21 -0700 (PDT) X-Received: by 2002:adf:de08:: with SMTP id b8mr8516944wrm.200.1567812179254; Fri, 06 Sep 2019 16:22:59 -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: From: Thomas Garnier Date: Fri, 6 Sep 2019 16:22:47 -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 Thu, Aug 29, 2019 at 12:55 PM Thomas Garnier wrote: > > 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. Following a discussion with Kees. I will explore objtool in the follow-up patchset as we still have more elaborate pie changes in the second set. I like the idea overall and I think it would be great if it works.