Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp651695ybg; Fri, 12 Jun 2020 10:55:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwy7rJoMhBJ/IbsT4nkDZSOtycgmk+1t17sN7exTqzKsy8vD3LuVhC3TWHbztpYPKtwZ3J X-Received: by 2002:a17:906:81d7:: with SMTP id e23mr14631843ejx.462.1591984517316; Fri, 12 Jun 2020 10:55:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591984517; cv=none; d=google.com; s=arc-20160816; b=OGH9+DWX3/acQBPRqxgvoYBJxkxz5KTxsozSagM6dIdWmaVy5IGvLsyko/PLp2KgV3 YBtbJ2x/UB9KFXp1KRPsRl6L/23TnpAzf2Y1iGtKNoQ3W/lNnrT+sqlh6DfjUvmBVzMJ xWhzen22iwrLDEUYsd4Wvytdp1VvGQ1hQAfYwZBgobEvMVqBocYJXZ19y0B8HIxCeNR4 bTlC6mxcCUq1UXWUeOEa9Sa65ZseKzO53lM7JSJEwl2Aa+M4s5Pp9eQEXShSGf+50nY5 HsgegmjdPkRyVKeUQ3lvqqO4yFraKouZ/M1jOgeB9BPjQRaCK22J76YHE1+RxMvYQW6b n0hA== 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=kG6EUCeSj6POYagjaW4AM51ET/bvqa7j1f4YuWkH9TU=; b=LaM3Mc7yFcl50IHQKsdkzWaMTYF0PEZRavX+xSe2zJN90rJ4XTjI/c5NUMn33Np6gp vRpuS1Ti7CJ+2Z0rmqw3nagPjcGUbq5uEF0/yBkMcmrOYvTe9EDHXnJLJN/Il9SiYKL1 crNgqBrGs4BS58K9BxGEyIgkUG7kk7ngnEjCD2mvD8Cucll0ywb1bhmC54pLavFE5BTp y87yNE9u463D5NOafemFA4B2Spt3zGAec8u7zUxBfecXxCDju/IUKRIQ0Z4kTu3L0peR zLbAFErsMUBNhCJhH5DQ1kwBjfvaQUKarVDl8Iv8Y91/3xjuxa1qE8a2y0dek1w04ef7 8w7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=aNrTtBaI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r2si4051932ejj.550.2020.06.12.10.54.54; Fri, 12 Jun 2020 10:55:17 -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=pass header.i=@alien8.de header.s=dkim header.b=aNrTtBaI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726397AbgFLRwz (ORCPT + 99 others); Fri, 12 Jun 2020 13:52:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbgFLRwz (ORCPT ); Fri, 12 Jun 2020 13:52:55 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80861C03E96F for ; Fri, 12 Jun 2020 10:52:54 -0700 (PDT) Received: from zn.tnic (p200300ec2f0af40048a70bbbe71adfd0.dip0.t-ipconnect.de [IPv6:2003:ec:2f0a:f400:48a7:bbb:e71a:dfd0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 64B6E1EC01B7; Fri, 12 Jun 2020 19:52:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1591984371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=kG6EUCeSj6POYagjaW4AM51ET/bvqa7j1f4YuWkH9TU=; b=aNrTtBaI8u0TmoVNJs+mzmra4hfeUaZqJIRMOVqa8ELSJC3uDFlSROrYPiPxwjVmEjBZk/ ccD3ZROHnKBW7hyPSv1+tWmZ8IhLTm8e6w/a0Jg7Ta3VhU9p1Rt/PNcHKj4uj2ZoKufmBG NBvdarm7WpxirdaXVP9uWyLoV/Ll+EY= Date: Fri, 12 Jun 2020 19:52:51 +0200 From: Borislav Petkov To: Sean Christopherson Cc: x86-ml , Linus Torvalds , lkml Subject: Re: [RFC PATCH] x86/msr: Filter MSR writes Message-ID: <20200612175251.GF22660@zn.tnic> References: <20200612105026.GA22660@zn.tnic> <20200612163406.GA1026@linux.intel.com> <20200612164602.GC22660@zn.tnic> <20200612165709.GB1026@linux.intel.com> <20200612170303.GD22660@zn.tnic> <20200612174307.GD1026@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200612174307.GD1026@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 12, 2020 at 10:43:07AM -0700, Sean Christopherson wrote: > The problem is a fault on WRMSR doesn't mean the MSR doesn't exist, it only > means WRMSR faulted. WRMSR can for all intents and purpose trigger completely > arbitrary microcode flows, e.g. WRMSR 0x79 can fundamentally change the > behavior of the CPU. Yes, that case is in the commit message. > And it's not like the WRMSR->taint is atomic, e.g. changing a platform scoped > MSR that affects voltage settings or something of that nature could easily > tank the system on a successful WRMSR before the kernel can be marked tainted. Yes, yes, I'll taint before the WRMSR. > 0400 only allows a privelged user to read the parameter, e.g. for parameters > that are snapshotted at module load time and/or changing the param while the > module is running would cause breakage. > > 0600 allows a priveleged user to read and write the parameter, which AFAICT > is safe here. Ok, we can do that. > 0644 allows a priveleged user to read and write the parameter, and allows an > unpriveleged user to read the param. Not so sure about that. Why would the unprivileged user need to read it? -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette