Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2559244pxa; Mon, 17 Aug 2020 12:44:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9PjVlkREFOQCheXSjhSmB+CqHBtQeUhvaIpI7W7T/glYwgXZP2g63COKnmtiejJgqAda4 X-Received: by 2002:a05:6402:1ac8:: with SMTP id ba8mr15969847edb.316.1597693461928; Mon, 17 Aug 2020 12:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597693461; cv=none; d=google.com; s=arc-20160816; b=SotwZCTBGTVsUzJMw7oOABtHcloiRoWXYBKuM6DERoi9epdzl/y0VVSws5jKPoRzv8 WYuvyAj532hiFPg7DfKPAJnYW9CkraDGqXDXBikvpoQA0mfCaV7sw1npUJOluiNac9Dr P8/6RidTnSL2XT9Wlii9w0FEi88pa3KMyPWQ1//YCaMP6ccNAT3FGnm1LPioe4H3G0ig 6trNG8EQTEb/66hocUabQyJYvAWXiLhwgFMer1/iO+EKeRyu8+ZqhEFa0U4woP5ldJxm Cw1k+MD474oug7frmGeOomOAFAKbDN+gqe4Rfes2I1M96o+3bzmHiUUMGh6Z7s64Ep1Z rT8A== 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=wpjFdhMNWCz1OoEOw1sNOB2ATr37xxpA0VcQ/rpzNt8=; b=ocT3ogAoENrkx/29goSYIHR3N0aAwFzkK1cy0au1QUVTK2EW9ZKheT+o7Fw81KtQ5J SITvOyMt2eV381Eko/tto623bNIrwQoSFxH9U4/ktKVNBhmhcliI+6mbSjWo6VH61z8G 63XsyTSbQvn3sQJk1UG/vU7kcPSBezyWuvKkedzco3yZoNkec8LtFzx/waRsE+UlPtkX t/fb1Sa7aUVXh2awvQeRVwyY8rxNEGkVFvsgJJwctF/vIS9WW+uXRTxsYyh7Um+J+rt+ qVwTDsETgr0v5ob9brFMsiqh+FV1jg9PEgJbJgl/FEcGuXX7BqvUYFUaa0koh46q53iW 5fWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chrisdown.name header.s=google header.b="wjS/YEdd"; 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 oy1si11487272ejb.733.2020.08.17.12.43.58; Mon, 17 Aug 2020 12:44:21 -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="wjS/YEdd"; 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 S1732439AbgHQTmV (ORCPT + 99 others); Mon, 17 Aug 2020 15:42:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729298AbgHQPYW (ORCPT ); Mon, 17 Aug 2020 11:24:22 -0400 Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 700F8C061389 for ; Mon, 17 Aug 2020 08:24:22 -0700 (PDT) Received: by mail-qt1-x842.google.com with SMTP id o22so12632405qtt.13 for ; Mon, 17 Aug 2020 08:24:22 -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=wpjFdhMNWCz1OoEOw1sNOB2ATr37xxpA0VcQ/rpzNt8=; b=wjS/YEddcrTt0TwUl4STi3hdSDfKMwHDJPmkG2duqqroVErfzpgY9a6M9JQrj0fUcz DvNR5qx5szPuyrB3gvn5LmcLiLCLuQFZaGvnDx6hpJ70ppgRqX71P8K/RCLcTroKaAxY pyJ/0rnC/yMvdOiQwxA38L54so/duzrQyLns0= 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=wpjFdhMNWCz1OoEOw1sNOB2ATr37xxpA0VcQ/rpzNt8=; b=H1HxihPRq34AQnKOmY4Xbgg+JS+MZJ/pKi5zEK3NqtDa2zmPID6A8cN4/sWeI0+hvC Dvd1AVlogNEQ/N4uUtts7mXuMxmZZph3zT/6GWYFgBRVBUJDfRUnPVoMxG0FZxI2RD7Q Mrgb7r1aVtv+DfTwfacTtz2ViQ8tMAf/d3gL7bpylq8SMKTUtWoI0SJaobbC6uFevU8/ cpxRrXuqv/uhM7/8bq7c97UTG73sHvjgBb0/uf88arxya8kfiBP1TTd7WYneCOtfDBHb yFjCTjQj4Sg5KSo7ss55k6mbIx489mXwi9GDXju5Yi9TnZv2cVWWIZO8FmAL52YvaLWw RYNQ== X-Gm-Message-State: AOAM533LfD/G/rc8XbYC0SHgSFe6q6gnMkNTth5iR1XwY1omsM62vKWj C9UasFe5XM+dlL8bsMH5Ne7HnSVFOhbEvdalgPU= X-Received: by 2002:ac8:614b:: with SMTP id d11mr13837585qtm.271.1597677860987; Mon, 17 Aug 2020 08:24:20 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:47cc]) by smtp.gmail.com with ESMTPSA id 15sm17368296qkm.112.2020.08.17.08.24.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2020 08:24:20 -0700 (PDT) Date: Mon, 17 Aug 2020 16:24:18 +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 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. 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 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) -- 2.28.0