From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B930C3A59F for ; Thu, 29 Aug 2019 20:03:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 66E4821726 for ; Thu, 29 Aug 2019 20:03:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="U75GJORV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726661AbfH2UD2 (ORCPT ); Thu, 29 Aug 2019 16:03:28 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:37483 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbfH2UD2 (ORCPT ); Thu, 29 Aug 2019 16:03:28 -0400 Received: by mail-ed1-f67.google.com with SMTP id f22so5396600edt.4 for ; Thu, 29 Aug 2019 13:03:27 -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=cfv5vMJWhzZzQ4/gjQiR8vfn+AFQkdiCwl+vBrJYxh8KC+kp6mLU/QUimYhCG8t85P 0IBr0dKtuUBcoHKdKXYFpQUhNc7aUjyznToVAAOLXzvtGxQPTBwN/iDZLj6Z8zSESjqK KFRrJNmPiaM1PdwMt/MW8MTLTv9FD3fYJSQUdNObCRim7C+CH0Xj4iU+bc0QtPzaAmXk wsNhdwnR/mOWgKLbId/2MbLKL1F0x1LKVQv5JPkOEfG0K6vlmXA4IDTupcJIa96hkuN3 m1RlbRsvu4+DvCB+BYsflrLv8f2K7zlwkXiynDGjDCxWfbjZS2PcN10q01bmof5aV4nl +4HA== X-Gm-Message-State: APjAAAVvEeAUbcYyx0q7XqUGH2MgGPT8k0fSHk+lDGjYBT0r63GsB201 d6/zLmgNuT5X+lcl9bhL9SZMLaRFqdA= X-Google-Smtp-Source: APXvYqzED6xAReLD2Cg+XBOJXY907fr+ZS3UcmITkV4ZbPyFR4w2IheUdPqwR/jBc2RSfrpMBeauew== X-Received: by 2002:a50:9724:: with SMTP id c33mr12091047edb.193.1567109006668; Thu, 29 Aug 2019 13:03:26 -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 w19sm615876edt.41.2019.08.29.13.03.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Aug 2019 13:03:26 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id z11so4686864wrt.4 for ; Thu, 29 Aug 2019 13:03:26 -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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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.