Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4701970ybb; Tue, 7 Apr 2020 12:40:37 -0700 (PDT) X-Google-Smtp-Source: APiQypJdVYM954/FQLLOP/sTM0VK12lIouKuhO5gES+loSKJUJwYcInZqht93Xtuf51krEeY4V6Q X-Received: by 2002:aca:5712:: with SMTP id l18mr381526oib.178.1586288437300; Tue, 07 Apr 2020 12:40:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586288437; cv=none; d=google.com; s=arc-20160816; b=DmxJZHW8tFsS0RmhSEhIFGdUIz/PM2189TAFqPxwYFSO6Dzmwp5HQQcze7m7sD8ETk +9Tqv5dM3cs4obH5agcPtUNj2ePCgIkkhKBiamTmNQxUpcGtkTXZSjJ2wyVrB1wmnMMX 397EJc83N46mcYH5YpzrhrrKijnYO7K6kvpOIoGlzUVszdxI6XKqXRQ3duHhB8V7f2be zZYQUtO24hOVSjjpR+RJOiPyWMwmpbZnB+F5569wXf+mvKs8dsqeh4Tlnk12A1WCCqa8 etHMkKedSMDo7KTeYU+loI3e6vRg4bWHxjpDh0o9MZwpkUjHdd4LD3mQK730atFkHTqJ ZnXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=L57MpBBnVLVuDtoKaJgc+4+22T0mnh8u8fyo+UeNRq8=; b=ZLcdDipAQKf35bZHhFo57yMLxDOLBZRCMRIJJvIWAyIBjgfPK9sYQkzsF+YEQvX/aW OcuTnJbGE0IdwYTGnXOS4Bjsp6MBjqOGS1AQe/tfvpa8t2HmteRrA50g3c0ju6vm7jhQ ghD3rmZsvJIzE03fBZP7ae94b1YCBiCtqOme9/xiUdb9hGszrTTZYtmbfZDGjjU/DiNb UZvL3s2+O2w8jZG33TCyr4g2WnJd10uqWO2HLC/1ZiQdYPSHh2PFZiUzqW06AGQnuMXb /sKYV4DR1xDbSlWg8N5NYXtWra6cOiEjzFTyrfjvqdJFBBjui6Kl3zgX4BP6qTDHzIVB j/+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=J76qXVdf; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2si1626521oof.17.2020.04.07.12.40.23; Tue, 07 Apr 2020 12:40:37 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=J76qXVdf; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726825AbgDGTje (ORCPT + 99 others); Tue, 7 Apr 2020 15:39:34 -0400 Received: from merlin.infradead.org ([205.233.59.134]:56888 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726339AbgDGTje (ORCPT ); Tue, 7 Apr 2020 15:39:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=L57MpBBnVLVuDtoKaJgc+4+22T0mnh8u8fyo+UeNRq8=; b=J76qXVdf64rbNhDMoTdWaIzY2A XuqAHOLk3Nl6ZyEJcxSsvo7M+OSGCvJqYemPGD22PUYoRtTcjhweRBzfNx9OI33++tZ6ruqMLrJwc ThwCpZqEbO2bejgMGCqZy4vZoitLj0RXgq7i+uTw3L99BjUylAsnyNITuGA/GCSJ1KfE+NPj+iGp9 WWr1cfK05CT703qkXg1gJKD3rZmSSmJKeE3tsYJuz+VCBYC1FUxgrkfVQuv6XfC5GfvFeCRTrDtJ9 FdoJVAUM5BCLn4KvfML5dqHOZMr9M6V6kfHhKX31xxC/y0ai/1rk0Jt0e7Qqbt9nWIh2S0LBsf+y9 ebGAnxXQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jLu3k-0000tH-JA; Tue, 07 Apr 2020 19:38:56 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 3DB7F983507; Tue, 7 Apr 2020 21:38:53 +0200 (CEST) Date: Tue, 7 Apr 2020 21:38:53 +0200 From: Peter Zijlstra To: Nadav Amit 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 Subject: Re: [PATCH 4/4] x86,module: Detect CRn and DRn manipulation Message-ID: <20200407193853.GP2452@worktop.programming.kicks-ass.net> References: <20200407110236.930134290@infradead.org> <20200407111007.429362016@infradead.org> <10ABBCEE-A74D-4100-99D9-05B4C1758FF6@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <10ABBCEE-A74D-4100-99D9-05B4C1758FF6@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 07, 2020 at 11:55:21AM -0700, Nadav Amit wrote: > > On Apr 7, 2020, at 4:02 AM, Peter Zijlstra wrote: > > > > 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’s say CR2? Most of them there is no real justification for ever writing to. CR2 I suppose we can have an exception for given a sane rationale for why you'd need to rewrite the fault address.