Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4667439ybb; Tue, 7 Apr 2020 11:57:55 -0700 (PDT) X-Google-Smtp-Source: APiQypKgWw7+SLFUsJxgIt6vEab6s2yXNig79rwgSYZAVjGCAV62UI+7/8FAi/5epw4nm+oA6vUq X-Received: by 2002:a9d:6e8f:: with SMTP id a15mr2962841otr.188.1586285874870; Tue, 07 Apr 2020 11:57:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586285874; cv=none; d=google.com; s=arc-20160816; b=HeLaltEwdJlvl8JA491Xu4tfGBYtxf0V0alJYv9IYI9uFDn99kLoR4GxyQGiTT333s pEIx17V5+ph0cefcJX+Lm90zn5YsAkvGec8MCMBcsuhrnvcJgUHgvgrFM3eO70Gvjcgr GUTs40Cl+VZxPDR09I5iyWZsfBDOqwau8ILYKjVDiON2mjMA1vwdxBlpsGr7Ar8+TkfW gTfDJaP7xtPHEPUPU5awYCccEJjAlXTzA+r+NisjYthS1bFn7jA4axM9yNH7ZR6WEQoy SENHFeKs+ig5p++StU+l9TKgdicUDglXhGczEi2vjMffVxU9OhGdiwgLYN9hEBJnz6lc UmAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=/tslLXuxoyVjSOLI35ip3I2Cd88F7bzLCM3Xyu1bIgM=; b=gjN8IC5rg2Y+bvTYSZkyu0oHAjvY53sM58M49bV8AzrnVM/lQvkSx8fKJKMLBXwExX T74x3BC67xNd5quSFk1rPbukw5wXsjVTkUlIPR6JBcoRyrvV7JxO8FdHNVojrNopalQs CZJeexNtFBCh7yHsbQOLvRme5+6+16HBLFa3KkPibQRYo7apUmLUyfUzsQxdGNcAj9uD h+jtrbpxRwY5xXC4P6PC2L9RyX4zjcrnvV1dIMYTNrY8rJttJXSVYOYdz21d4DIrYyVY sG8v0WsRUDVT0mNhC4nDMQnAdBxqmbmMr8VXLY5GDlQqiqNFTIv7f6HTbljELWVxyJ5W c6xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WMOAgM9D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8si1404289otq.313.2020.04.07.11.57.40; Tue, 07 Apr 2020 11:57:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WMOAgM9D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726776AbgDGSz3 (ORCPT + 99 others); Tue, 7 Apr 2020 14:55:29 -0400 Received: from mail-il1-f196.google.com ([209.85.166.196]:42789 "EHLO mail-il1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbgDGSz3 (ORCPT ); Tue, 7 Apr 2020 14:55:29 -0400 Received: by mail-il1-f196.google.com with SMTP id f16so4283006ilj.9 for ; Tue, 07 Apr 2020 11:55:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/tslLXuxoyVjSOLI35ip3I2Cd88F7bzLCM3Xyu1bIgM=; b=WMOAgM9DrLI4UXG0tvW08mYqzl77Gk7Xb0oSU1n8sL1ius69d9XwTvx0OUV8qBYAqL SvUPKPH6SQ6mY9EXYJuX2zhxE9TOJ46+yakaNtEpBkwaxKsape35cHBAeLeS6z68+9mw TcPIsxqO9PEpOkEzb2/Ji/WtxrG93oiM9mpk5mmNxq8AHl0Kn7hQE7npRo8Q4o2zTdAn LHhh0XIZCRmBp2qtirzd99BwrSeFd8ZI9q+ID5u1gvnkjiUumiCIh42HS12eXoE+7NJU CB9hrzTlr1cHWYR2lHSSMIQOYhtoIazsjcDEIaX7/PseveInY1o3oWdd10ZaSakarfuq Hz1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/tslLXuxoyVjSOLI35ip3I2Cd88F7bzLCM3Xyu1bIgM=; b=f1k8pkNvI/pdatnVZNPmHWxvFXH2UqdlAqR3RMepguNBqZQtyw8K33X2yDbQewE4+Z 1P498jYPLXyFGRAnfuhRw0eLwZGkfpwvVf/2y2FY5CZk/l9rt1xo9ZZU7ZmqERY0y/Pd madc3ewqo920EVdsCQskyCRRlthJ0B7l4xLWC5Cl7lQ6IQi8uah4x1TXK5PbMylEeGr7 Nc4fzyeN54PLCyJ/YPWPyJk9HW6Kg8o39PIcX57ikfqqV/KL+6iej/OFLguXQAlaKkoS 9d61kt6hXA4dlPP5FtC17X9TQD61nSVLbeAbqme8UPivXvy6g0Q5IYeEOac5lWZ8+bOz R/AQ== X-Gm-Message-State: AGi0PuaprF7WN79eS2y6gXHrw2+xO6gqKbJEBGT7T3OJopfyYB1Su6AP eGS/EmdhrsCyjNYGRPFW1Nc= X-Received: by 2002:a92:1581:: with SMTP id 1mr3983101ilv.144.1586285727755; Tue, 07 Apr 2020 11:55:27 -0700 (PDT) Received: from ?IPv6:2601:647:4700:9b2:1d50:a6a4:b3be:b3e4? ([2601:647:4700:9b2:1d50:a6a4:b3be:b3e4]) by smtp.gmail.com with ESMTPSA id x10sm7509021ili.88.2020.04.07.11.55.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Apr 2020 11:55:26 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH 4/4] x86,module: Detect CRn and DRn manipulation From: Nadav Amit In-Reply-To: <20200407111007.429362016@infradead.org> Date: Tue, 7 Apr 2020 11:55:21 -0700 Cc: Thomas Gleixner , LKML , hch@infradead.org, Sean Christopherson , mingo , bp , hpa@zytor.com, x86 , "Kenneth R. Crudup" , Jessica Yu , Rasmus Villemoes , Paolo Bonzini , Fenghua Yu , Xiaoyao Li , Thomas Hellstrom , Tony Luck , Steven Rostedt , Greg Kroah-Hartman , jannh@google.com, keescook@chromium.org, David.Laight@aculab.com, Doug Covelli , mhiramat@kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: <10ABBCEE-A74D-4100-99D9-05B4C1758FF6@gmail.com> References: <20200407110236.930134290@infradead.org> <20200407111007.429362016@infradead.org> To: Peter Zijlstra X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Apr 7, 2020, at 4:02 AM, Peter Zijlstra = wrote: >=20 > Since we now have infrastructure to analyze module text, disallow > modules that write to CRn and DRn registers. Assuming the kernel is built without CONFIG_PARAVIRT, what is the right = way for out-of-tree modules to write to CRs? Let=E2=80=99s say CR2?