Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp609169ybg; Fri, 12 Jun 2020 09:49:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxq3q5QRF4ka6VeUJbRg6gkIjldmPrsAxLPf60xV159Iz2TsirDrv8xC3u2+OEZeLo2EjPT X-Received: by 2002:a05:6402:1604:: with SMTP id f4mr12893824edv.379.1591980566360; Fri, 12 Jun 2020 09:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591980566; cv=none; d=google.com; s=arc-20160816; b=EkRmxoPrQ2/lD+UEBPwggZqQP7eXVblPg6trLFM+AjjmAiyuA4GCUe5XDVuE3R9SJR ymhbdk71p4AEmEK2DdIVAFj1OYrj2oSpg339qzQQIjYwhS91BgdVr4bJdAlQhif2ikjA u4HecnzcJdS3N5+uYZfgkXRUjQvRRkhn/cfL66aNWoS1nBPBXS2P8E7wlGBWmFzlJEh9 KxEWMljl/voSzoU+j9ng1yZF54luxpuHmf/04dm8RwKjKC5GC/6Z3rpQHXO9Fz7aNN+M BOFYwuP+XJkcDatKubquTnjU1Dluqs4arREfDER8R0gJNEaJMyLDf5QrT9CVax8XSTSq w4Dg== 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=Q/esjC/DbCItduaN4TSGRGy7mlUQVmXoTWQVdQd1+6g=; b=0WoFxjR6tzaUkggzAYaxI0tA51PLskp1L9d2cVM3pVhfE/jS2GVDgzLgGtGXl4S51N iOYEPKsSHN/E7+ytflcq317wRgimT0szFpjj5ijp6XneUY1NgwJ0i0NfJd7PMFMiUJGs 505Xl1a3N1RPxFgMA9wBe6iETPbgQEBMZ1slN6+MfTcbaezT/Uc9086xwvPlnPWxqvK5 X016Wbo4l3VVyFdkTeRkIH0+AhSnj/PPajUhv/s2qlzYCBHUDs8Wc0ImLl0UqO12I0ER Rpe+rql7OgBQfiWtwbfS95smzfNlxsZ9JA+U7CyzcX6hJZwXAQoWULwY7x7VWThael8O qZiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=H7rqzMzU; 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 y16si4037541ejw.501.2020.06.12.09.49.03; Fri, 12 Jun 2020 09:49:26 -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=H7rqzMzU; 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 S1726304AbgFLQqJ (ORCPT + 99 others); Fri, 12 Jun 2020 12:46:09 -0400 Received: from mail.skyhub.de ([5.9.137.197]:55378 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbgFLQqI (ORCPT ); Fri, 12 Jun 2020 12:46:08 -0400 Received: from zn.tnic (p200300ec2f0af400350ce5827141df5b.dip0.t-ipconnect.de [IPv6:2003:ec:2f0a:f400:350c:e582:7141:df5b]) (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 AAD621EC02F2; Fri, 12 Jun 2020 18:46:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1591980367; 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=Q/esjC/DbCItduaN4TSGRGy7mlUQVmXoTWQVdQd1+6g=; b=H7rqzMzUvt21FsTQTvbU+SVTTi/pEbfIRCZLTjY6vAa6KD0xSYReMeniY0gonjqb52uWwo k/Q9SPeUFfAiBXlkvjmNwCW1zNkl5FiC1fi0+sdxtTW7uIqCc0Jfo72Zz37W0FGUUnNEJy 0hcYTnvF7kPChESXgmmmG49626AUu3g= Date: Fri, 12 Jun 2020 18:46:02 +0200 From: Borislav Petkov To: Sean Christopherson Cc: x86-ml , Linus Torvalds , lkml Subject: Re: [RFC PATCH] x86/msr: Filter MSR writes Message-ID: <20200612164602.GC22660@zn.tnic> References: <20200612105026.GA22660@zn.tnic> <20200612163406.GA1026@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200612163406.GA1026@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 09:34:06AM -0700, Sean Christopherson wrote: > The kernel should be tainted if the WRMSR is attempted, regardless of > whether it succeeds, and it should happen before the WRMSR. E.g. pointing > MSR_IA32_DS_AREA at a bad address will likely cause an OOPS on the #PF If the MSR write fails, MSR_IA32_DS_AREA won't have the bad address. If the writes fail, nothing has been changed. > This can be 0600, or maybe 0644, i.e. allow the user to enable/disable > writes after the module has been loaded. What for? crw------- 1 root root 202, 0 Jun 10 19:54 /dev/cpu/0/msr You need root to write to the chrdev. Also, the intent is *not* to open it more but to close it so that the incentive to design proper interfaces is there. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette