Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp201974pxa; Fri, 21 Aug 2020 05:13:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlAhyu7cpxFiLz1qBMRyFqYKOeE9F59m1RFs4IoM93dwAxLN8/sd/BDatschFufuQa6+Lh X-Received: by 2002:aa7:d387:: with SMTP id x7mr2430845edq.219.1598012009815; Fri, 21 Aug 2020 05:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598012009; cv=none; d=google.com; s=arc-20160816; b=SHvMxQImqcfYMqO5M21y1gcy9m7rZnYbgxwInWoPtEQ9r/17aYGgeZLEO1aVf4T8ov AD76sNPNKf/bCU1RGA2J+1cdXKtpUAdA/KqfLVd4JGmn6SgO+oKepM24+FGtc+aYs6ed XAvQLH4bS0RzOsldK2GzvqCeRYSv0J4YEYxZstR93Op5cW0XiZaW7ZFNwMxFmos4ocy/ wJ0KvVoAsEZfiFR33njHbLPwEz2hmh4gzLQDyttvM7FjlrTGuxRoBhKvIhXMX5QNjun9 fZDxm8kNraYA2rHIjQpSGmTouF/mJmw8GBxd8YRxK1zVifyb2CIo7LdR7y3TiJcw+zbB d09w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=x2zyWzSDJHBz/coWO6uLAm79U5a8FMGQOT/SueKdJ+Y=; b=pIC/EVhL6FmeFQUBJy6pQJn7i1eEjTb5wfrDw2WE2KqxxSUXxCQIwkOhKukL3McUuM /XUxwPmhldd09JRBkaglv4EzIKfOdn9thBo13FRh8X+MawMJaxbRkO2EXTrnDEhfR7s3 wDtTGkNhdj4ELfcOVgaC1fJea2QoKGiLQb6c1LkobtGL3mmT4GMPQRjCJKN7i/TmbBaV K+8nrwSfXJciUr3A1JAij5ePIds3TUWA5ej6jlmEIYKKDXHvNGlHY/LlTjKBJ7h1ihOV 1HB0gOuLLpoE8XcTYFkdZ0cw9iGebcGS7Ct+w3Tln9x8VCvvPZwYnShdVE86v4fQ74zR vYZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b=ea9naKqr; 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=chrisdown.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bc16si1050410edb.161.2020.08.21.05.13.06; Fri, 21 Aug 2020 05:13:29 -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=@chrisdown.name header.s=google header.b=ea9naKqr; 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=chrisdown.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727833AbgHUMKR (ORCPT + 99 others); Fri, 21 Aug 2020 08:10:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727029AbgHUMKH (ORCPT ); Fri, 21 Aug 2020 08:10:07 -0400 Received: from mail-qk1-x741.google.com (mail-qk1-x741.google.com [IPv6:2607:f8b0:4864:20::741]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12D89C061385 for ; Fri, 21 Aug 2020 05:10:06 -0700 (PDT) Received: by mail-qk1-x741.google.com with SMTP id i20so1108784qkk.8 for ; Fri, 21 Aug 2020 05:10:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=x2zyWzSDJHBz/coWO6uLAm79U5a8FMGQOT/SueKdJ+Y=; b=ea9naKqr8k6EBi1A3g9ObPls+dIpoC6yWY0O5ZhiNNQKvgAEq+BFO0jgMfVfok0Zp1 dAfmV1ssdGlcRKHJWqrcwLRi4vS9IXcNpinOEIImI38Uz8VskffrqkXknzbZLIiRukJB Shwp7ebnq5cXh2dmzt9WCrQZOcXM7lTmVjZds= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=x2zyWzSDJHBz/coWO6uLAm79U5a8FMGQOT/SueKdJ+Y=; b=Dpoz2IXDJUdi01EPBvXJMVhlvFQRth5BUVfFO7PNKjJUycxHreMHSQdyySuR3s4gpk v04KGqEOzOubh63c5TyEVs4k2zetCdi2IfoDX7I7uOCKu7DAE+wX0XU45C45BEfkYcVI zkB6ID8SiHtIM+yxI9vlbVwOzX0orQj87kCw84vgKRZXlPqAasqaFYtrCqa4AEzVeBMQ jVTeeI0hMZIlm9Qp1mk2ta/uXC+7s4h+t4Uj6SYFD0XnF0mQ2seEPeOYZanDFSb/J5kq bJFBslrllKKTDRd8ddinpvHe4HvDs+Aouy6HKFGzmW+fI0fwMZS8/uk+13giBhA2GJM7 rrWQ== X-Gm-Message-State: AOAM532W+UFvwDeJmAajZ1VtzmvzPf/yOBgV3k1c3MI1RX5Agzg5o6AM SFvSsgY97c4867313cjOEk7HSSXU5cm6sEum X-Received: by 2002:a37:a797:: with SMTP id q145mr2232672qke.13.1598011805610; Fri, 21 Aug 2020 05:10:05 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:23fc]) by smtp.gmail.com with ESMTPSA id q4sm1527378qkm.78.2020.08.21.05.10.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 05:10:05 -0700 (PDT) Date: Fri, 21 Aug 2020 13:10:03 +0100 From: Chris Down To: linux-kernel@vger.kernel.org Cc: Borislav Petkov , Jakub Kicinski , Andrew Morton , kernel-team@fb.com, sean.j.christopherson@intel.com, tony.luck@intel.com, torvalds@linux-foundation.org, x86@kernel.org Subject: [PATCH v2 0/2] a couple of userspace MSR filtering improvements Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.14.6 (2020-07-11) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As discussed in Message-ID <20200714165621.GA3622@nazgul.tnic>. We all agree that userspace MSR twiddling is non-ideal, but we should be a bit cautious of taking up too much kmsg buffer if applications do repeated writes. `allow_writes=1` is possible, but is non-ideal (see patch 1 changelog). Also added pid information to the message, since it makes identification of the source (more or less) unambiguous. Changes in v2: - Fixed mostly aesthetic suggestions from Boris. Thanks! :-) Chris Down (2): x86: Prevent userspace MSR access from dominating the console x86: Make source of unrecognised MSR writes unambiguous arch/x86/kernel/msr.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) -- 2.28.0