Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp231533ybt; Sat, 13 Jun 2020 02:41:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8kNbBhBkmU4angzBqorFdose+uhNweUXx7EHoc08Fc9j3gOrimKuimigVc+dtzLPYNGBB X-Received: by 2002:a17:906:6bc4:: with SMTP id t4mr4804696ejs.354.1592041298612; Sat, 13 Jun 2020 02:41:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592041298; cv=none; d=google.com; s=arc-20160816; b=xqup4NQEPfEQSNwDkdX1ut1Od2vrr3nC3pTRSEIPtlCTCfImoBEdRp8YzguGlztXw/ cbU3hJAyi+EioUJFPx1z75kCUD4RZWybB0Rmetkdwbg02J5eF4p/wN623kMmloDVNBJZ AERI3PI09qXsoz3N7mt7ofKLH6pbJQPD4eMwZJLcnRmi+Grq03EvQYRhDjoAYkzdLPG9 pt62vJ14PvdS/ZiONiLVYF63PRqDzWQO28MwEJ2rrIjwJQf1Yejjy7RGk8OoRalyV1ti 3xGdwqJz5NLxSQCFtBqLcM9sANWjwfHqeQ7dwSas6KrYABw0iSZ3WgnPtQWwzHwsTdq+ kU+g== 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=li2OEgSEHpw4CWS8i4pMIpqx0g8A/AZxtVhFiy4t2MY=; b=hk3KCFrY0YqRyPdDMO25e9w+MHRpbOBMV2nNAjGqGHW3+B1W6MUajZQmYtkGrIkdD1 MbyzTZtbOgy0mM+qRHSmTGqzc6W2fgAggYYyZL7H1DoYaqtgGslGau1idTRsxMukSEcN nWXJJ/zh+ZK5198zzZdE7Twz/ZjD6ZtCzFdr3Z693B6FVegOi4XKx3S5Af5hhPJCObHT Kaeplequy91n5z8uTwde6UJOVt/HGXW3u6xWyWoxULnCwG4v8YKTOSuf2yDtDKMh2+GJ cK3fweyl+jZSqRhTnyS2ZWLO6USGfap3tTRiq8gOG1AibdtMzMIs6CEGuZjYH7UncDBk wo8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=ZQnZS0C9; 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 b12si6446338edz.444.2020.06.13.02.41.15; Sat, 13 Jun 2020 02:41:38 -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=ZQnZS0C9; 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 S1726404AbgFMJj1 (ORCPT + 99 others); Sat, 13 Jun 2020 05:39:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726380AbgFMJj0 (ORCPT ); Sat, 13 Jun 2020 05:39:26 -0400 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF20BC03E96F for ; Sat, 13 Jun 2020 02:39:26 -0700 (PDT) Received: from zn.tnic (p200300ec2f205d007935628ee6b9317f.dip0.t-ipconnect.de [IPv6:2003:ec:2f20:5d00:7935:628e:e6b9:317f]) (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 D36A91EC0328; Sat, 13 Jun 2020 11:39:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1592041161; 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=li2OEgSEHpw4CWS8i4pMIpqx0g8A/AZxtVhFiy4t2MY=; b=ZQnZS0C9+eBjKxHikT8+zLwHpaiK7MgofMF6hgIOohlsH2eoog+2hdrlxhyI8PnkGUi1hJ ANa8Pi/iUnXM8ifiNI0CpqGmf2N07zKvMNike1Z1SbaxlN1wn08k6ZPpnUx6SBBg4kSvFn iHP61rQP9cK8P0IPy9uYTgrewnMEA38= Date: Sat, 13 Jun 2020 11:39:14 +0200 From: Borislav Petkov To: Peter Zijlstra , "Rafael J. Wysocki" Cc: Linus Torvalds , x86-ml , lkml Subject: Re: [RFC PATCH] x86/msr: Filter MSR writes Message-ID: <20200613093914.GA584@zn.tnic> References: <20200612105026.GA22660@zn.tnic> <20200612174801.GE22660@zn.tnic> <20200612203935.GH2497@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200612203935.GH2497@hirez.programming.kicks-ass.net> 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:39:35PM +0200, Peter Zijlstra wrote: > On Fri, Jun 12, 2020 at 07:48:01PM +0200, Borislav Petkov wrote: > > On Fri, Jun 12, 2020 at 10:20:03AM -0700, Linus Torvalds wrote: > > > Since you already added the filtering, this looks fairly sane. > > > > > > IOW, what MSR's do we expect people to maybe write to normally? You > > > added MSR_IA32_ENERGY_PERF_BIAS as an allowed MST, maybe there are > > > others? > > > > Right, this MSR is being written by cpupower in tools/. My search was > > confined within the kernel source only so there very likely are others. > > So that tool writing to /dev/msr has already caused pain; the direct > result is that the intel pstate driver doesn't want to use an MSR shadow > variable to avoid RDMSR because that'd loose input. > > https://lkml.org/lkml/2019/3/25/310 > > (sorry, that's what google found me) > > So ideally we'd just disallow it too. It already has a sysfs file (per > those patches): > > Documentation/admin-guide/pm/intel_epb.rst Damn, that has fallen off my radar completely and the reason for me requesting the sysfs interface is the *same* - kill the direct MSR access. Rafael, how about I refresh those patches and teach cpupower to access the sysfs interface too and we drop that MSR from the whitelist too? Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette