Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp721813ybg; Fri, 12 Jun 2020 12:50:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJS5RJVp30JX9kyWZfYM3ab8rc+Jz9abABELAUdb8vsvTd8+m9Y7O4LRviVCaJofnIYAa7 X-Received: by 2002:a17:906:a2c2:: with SMTP id by2mr14537791ejb.454.1591991419312; Fri, 12 Jun 2020 12:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591991419; cv=none; d=google.com; s=arc-20160816; b=RAKPkSb9H5WoYAyDYNQUW1DLTs/yNk1DRjbdKPNvWoV/nGkunvq6SyR+W7KMfBXy04 40Sr+ptQePzFtWIAMEcU0O56GgYVlQ1GnHtTJ2qMySmbqBiHoIy5eJIIoJ7Ke3ebOHur peuLEv8NDVj3IH3xsMX5u8tcQKaed/9ViWpqWJiRQT7dQsV1lUlotB8y8LrPdy9SNmY+ K8brhqLBFvD2OChjGLTlHMOI4630AWM2Bh1Q80L7QpNMG/1w2ypBhpRxdHwQA8TCtyS7 oRbTDnP859I0lQiiLyI38Ivs7vg/v6aE66qG0/uCun1sIC5EyuUnCs/AjDqiI1Mua4P2 PIqg== 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=U0vIwTOm+bSy7bM15RwUhOkigup/iBvfB33kOPuQzrA=; b=N2ZjiGZwcXx00k6dutk3ljl/3w1mfJG6/++fPC0ekFgIxZHFr65m6ZsOJZ03Gm2+kG 3/lqnw3tl3fdYL2vyQMcA4QHng6T87bvRT0jXdF8/ogXlm0byHoJOGrc0ZvSgpnd+oSN i2yWm8z4k5l0TYmpD1199Mwna7XlrEwkKheXiaYEuwMwcR//zTDgOj60xOkby431sU2I /j00rTK7HrcflYC1Xkpis9ieHCTa0i+wQuC0jSINFADGobGXMEb6LzN0IznwnGnxuFDk pQxf5KJS/HePUErkzPc5QeJ7o4lLzArWvVtHwKGPhVlzlcvCMphdHi8V/Ay51tl6zfYa BsYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b="nCU/NKcl"; 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 bm19si4047807edb.59.2020.06.12.12.49.55; Fri, 12 Jun 2020 12:50:19 -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="nCU/NKcl"; 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 S1726347AbgFLTsB (ORCPT + 99 others); Fri, 12 Jun 2020 15:48:01 -0400 Received: from mail.skyhub.de ([5.9.137.197]:53226 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbgFLTsB (ORCPT ); Fri, 12 Jun 2020 15:48:01 -0400 Received: from zn.tnic (p200300ec2f0af400e40e5fe0afa6da82.dip0.t-ipconnect.de [IPv6:2003:ec:2f0a:f400:e40e:5fe0:afa6:da82]) (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 385071EC02A2; Fri, 12 Jun 2020 21:47:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1591991279; 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=U0vIwTOm+bSy7bM15RwUhOkigup/iBvfB33kOPuQzrA=; b=nCU/NKcldiHmw7ezHf+JEwrhpBg1G2V6IaQvSiQvj2lYmFvxmilvYclr/CMQ3IsSX9c7EA J8yxjLrhK3J0v31ecxjGAcFOyQjG0ujEHPV9jAv6m2afzWY/U5vslw4IJi5dfArF3SajYP sriKlP9P54k5OJQQ0WWEuCnEeTD+sao= Date: Fri, 12 Jun 2020 21:47:53 +0200 From: Borislav Petkov To: Linus Torvalds Cc: x86-ml , lkml Subject: Re: [RFC PATCH] x86/msr: Filter MSR writes Message-ID: <20200612194753.GG22660@zn.tnic> References: <20200612105026.GA22660@zn.tnic> <20200612174801.GE22660@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200612174801.GE22660@zn.tnic> 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 07:48:01PM +0200, Borislav Petkov wrote: > > So the first phase might be to introduce this, but have the default > > for non-recognized MSR's be "log", not "deny". > > Ok. How are we going to "learn" about those non-recognized MSRs? Ask > people to send us a note to lkml so that we can fix the list once they > see the logged message? We could do something noisy like this: [ 27.395795] msr: filter_write: Write to unrecognized MSR 0x10 [ 27.396865] msr: Please report to x86@kernel.org [ 27.397811] ------------[ cut here ]------------ [ 27.398630] WARNING: CPU: 10 PID: 4405 at arch/x86/kernel/msr.c:83 msr_write.cold+0x1f/0x26 [msr] [ 27.400123] Modules linked in: msr [ 27.400728] CPU: 10 PID: 4405 Comm: wrmsr Not tainted 5.7.0+ #2 [ 27.400838] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014 [ 27.400838] RIP: 0010:msr_write.cold+0x1f/0x26 [msr] [ 27.400838] Code: eb e0 49 c7 c4 ea ff ff ff eb d7 48 c7 c6 40 11 00 a0 48 c7 c7 c0 10 00 a0 e8 5f 83 0c e1 48 c7 c7 f0 10 00 a0 e8 53 83 0c e1 <0f> 0b e9 af fe ff ff 8b 3d 7c 20 00 00 be 01 00 00 00 e8 1e c7 06 [ 27.400838] RSP: 0018:ffffc900003d7e98 EFLAGS: 00010282 [ 27.400838] RAX: 0000000000000024 RBX: 0000000000000008 RCX: 0000000000000007 [ 27.400838] RDX: 0000000000000007 RSI: 0000000000000082 RDI: ffff88807dc98360 [ 27.400838] RBP: 00007fffffffe978 R08: 00000000000001ca R09: 0000000000000000 [ 27.400838] R10: ffffffff82549708 R11: ffffc900003d7d50 R12: 0000000000000008 [ 27.400838] R13: 0000000000000000 R14: 0000000000000010 R15: 0000000000000000 [ 27.400838] FS: 00007ffff7fb7540(0000) GS:ffff88807dc80000(0000) knlGS:0000000000000000 [ 27.400838] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 27.400838] CR2: 00007ffff7e672a0 CR3: 0000000078a4c000 CR4: 00000000003406e0 [ 27.400838] Call Trace: [ 27.400838] vfs_write+0xe4/0x1e0 [ 27.400838] ksys_pwrite64+0x7d/0xb0 [ 27.400838] do_syscall_64+0x48/0x140 [ 27.400838] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 27.400838] RIP: 0033:0x7ffff7edda37 [ 27.400838] Code: ff ff eb b6 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 8d 05 c9 7c 0d 00 49 89 ca 8b 00 85 c0 75 10 b8 12 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 59 c3 41 55 49 89 cd 41 54 49 89 d4 55 48 89 [ 27.400838] RSP: 002b:00007fffffffe968 EFLAGS: 00000246 ORIG_RAX: 0000000000000012 [ 27.400838] RAX: ffffffffffffffda RBX: 00007fffffffeb78 RCX: 00007ffff7edda37 [ 27.400838] RDX: 0000000000000008 RSI: 00007fffffffe978 RDI: 0000000000000003 [ 27.400838] RBP: 0000000000000003 R08: 00007fffffffedb6 R09: 0000000000000000 [ 27.400838] R10: 0000000000000010 R11: 0000000000000246 R12: 00007fffffffeb78 [ 27.400838] R13: 0000000000000010 R14: 0000000000000000 R15: 0000000000000010 [ 27.400838] ---[ end trace 3bd374c0e61187b1 ]--- -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette