Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1694232ybs; Tue, 26 May 2020 01:02:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWf6YlmSnud6rxdTzDx/0+EWFHA3fmikBxwTiNujrv96U7e+CAIbOfydKJlJREIj6K4DqV X-Received: by 2002:a17:906:350c:: with SMTP id r12mr66537eja.516.1590480129494; Tue, 26 May 2020 01:02:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590480129; cv=none; d=google.com; s=arc-20160816; b=QfAJbqnaXIB0/Q7ZrUCjy/EcJqkMMPot2olcKDYMMSaf85kIlAsu6/3meT+XoG9Nfl Kky4Vr2atQU2uAcqzFD0tbpD4dTHNjPLMSLtD+vOOdVNWNbTVY0Rh7w68GXXvTNKQDpM 5V5yOtd/roZcFVfjtBeT+EJ5BdTN1hERJNOG89DVSl0I3poggbmPMkQyYdJWcKR14MiM 3MKyVVyJL1tYgcxSGH2OWT3A77743hLVi/3HvMGIGwqbSp/wxpYla0lYyf5M8oLSKz6Z gXhaf2z0CRMn6S+Gru57Rag5L4tRDbJzN6nr7bBCZ84MbH8TI7e8XOjFAmvudDdtDkPs EbkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=R5qQvczynsAgfGpBqLmrdkhBv7EbYOge1iugVDT5SBA=; b=dzPRT9JIeksIgXFvUZ83BGbvW66fMJfaMm9dsGvEgb1gdTj2QroSVc+2goNO/A10gX sE84MgrpJHfWH9QDuvpP5zW3ymWno/YSKPyCnTQvAPbqGJtchGNkG1rreo3DdVoiMPGW YVYn2rolEfnLKzwocMbpMZH8SwiOlFpkhScgTBjLOIJy5E+4xgS1CfrmqITtdPUZlyXR psMX2E2c856+45pSlg9HaYH/mrFGZIixD7fYQSsBiZq3AbAv8ZG9/2LhKDYZz6RxVXkR mD8EufcTOXNMos+wGz5bSEPqc6nBpDJ3JKAmtSTIoi5kENshA13r229/BvkS+dTCvU7J +McA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="TE//yoNU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o25si10630149edq.345.2020.05.26.01.01.47; Tue, 26 May 2020 01:02:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="TE//yoNU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731698AbgEZH5s (ORCPT + 99 others); Tue, 26 May 2020 03:57:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731406AbgEZH5s (ORCPT ); Tue, 26 May 2020 03:57:48 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6922CC08C5C0; Tue, 26 May 2020 00:57:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=R5qQvczynsAgfGpBqLmrdkhBv7EbYOge1iugVDT5SBA=; b=TE//yoNU7+3UOMY3O60qcivn8i sZ3MnaWQtU9hZ2Qo3MhIJmOUtCiv6O3ZcG1Tsi8Hz1VMx9j1zQ0TxV/YT2FhskgmFKR2xjU6B9OdW bpis4SfDnCWwt1BhW0SYlcgQnsrzPaaTVISdrJjCzTZkaKlZBkdUCBCa60+cDdl11SFiJavhylT1t rjUm4J6lqpyylhU5qBeAt42mB6HNTXXyOcGp6iSDuQwpcIBSobd8LnuwvOzebFrrc04h8AkYOVZ2H HfYk7eu/QFgf+v8NhYuLShFW9xsYjvitpuMY59+eqpNnj5ylqeiXH2WbSL/kuLwgcNzvLy+AWmzbi RODjFOFg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jdUSx-0008AQ-TD; Tue, 26 May 2020 07:57:40 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 1000930280E; Tue, 26 May 2020 09:57:37 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id F277320BE0DF0; Tue, 26 May 2020 09:57:36 +0200 (CEST) Date: Tue, 26 May 2020 09:57:36 +0200 From: Peter Zijlstra To: Greg KH Cc: Andi Kleen , x86@kernel.org, keescook@chromium.org, linux-kernel@vger.kernel.org, sashal@kernel.org, Andi Kleen , stable@vger.kernel.org Subject: Re: [PATCH v1] x86: Pin cr4 FSGSBASE Message-ID: <20200526075736.GH317569@hirez.programming.kicks-ass.net> References: <20200526052848.605423-1-andi@firstfloor.org> <20200526065618.GC2580410@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200526065618.GC2580410@kroah.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 26, 2020 at 08:56:18AM +0200, Greg KH wrote: > On Mon, May 25, 2020 at 10:28:48PM -0700, Andi Kleen wrote: > > From: Andi Kleen > > > > Since there seem to be kernel modules floating around that set > > FSGSBASE incorrectly, prevent this in the CR4 pinning. Currently > > CR4 pinning just checks that bits are set, this also checks > > that the FSGSBASE bit is not set, and if it is clears it again. > > So we are trying to "protect" ourselves from broken out-of-tree kernel > modules now? Why stop with this type of check, why not just forbid them > entirely if we don't trust them? :) Oh, I have a bunch of patches pending for that :-) It will basically decode the module text and refuse to load the module for most CPL0 instruction.