Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp672438ybb; Fri, 3 Apr 2020 09:42:25 -0700 (PDT) X-Google-Smtp-Source: APiQypIqNugYpfaNBTgnaH0uY50/rJJnjSkzIs4D5WEccZUuROLznPC8l+Akel898AaKsuUMiWui X-Received: by 2002:a4a:aece:: with SMTP id v14mr7300303oon.48.1585932145171; Fri, 03 Apr 2020 09:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585932145; cv=none; d=google.com; s=arc-20160816; b=u1XE8+NwLnP//ZS3kU2cu1v+W8je9Dm77NQFNF5/yP+dKbIPFFRdP/CPRYMunmYQ/J JnnD4LzKgodAe6RZAFtqdCFCpq6q3W68V9R2cwcHmcbjyi0NCy0lbnkU1S6FiYaYRxXk Uz9aiM4OPlx+ZcW9i7kmVtqQJqAQAs14W5wnqdrVb7wZHUfT5fmcrXTd5X2IgOWNi1Ad bRNFQN3oDSyfCcX6wofeUwcd8oFQ4J8w9q69kQIyFgDJoA+w2/gBGG+uQ2JttJFs3cw4 QKyl3CQHJaqxeTLix52wnt9iJbYNnnULLlYVN+nULso0csQWEU6Cm5FjB8UHDMAPgHLQ 4fXg== 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=4dF2QsJUGR4Xl/636zq9DlSyKEjw2qbunG9s4a650M8=; b=JI+xafdvWD4TqbafTNFFVFimylYY2DdjD/ANVWq5i4yocEXb+GYaH1i8Gx8YZrvyjp MtzK+kTSpzE5+GvooTXV554wqr93aBFLj/p/8Wz48oOyQRJh7HCivRNfpyWYE1YtoSsd +EIRN6AABrrKIq3irEHrfoxKuFh3RW6uTwWu0pwwbOn+ug74iaGzXHkmox7s/4M7s7/F zqMe5aeb15snerZl+2WX3w7m+FCjEWI2TTKSvhowuWhMBysUPJnTWEr5h7VR39klZJl2 8kHrr1oTmvJo7a4GIRS76Y6TiP8ojvHk4kiq59HjSTtV0ND0xRZVsxTCNRjx5nxkqgpP 9NAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=HTEn98TA; 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 z22si3916776oto.237.2020.04.03.09.42.10; Fri, 03 Apr 2020 09:42:25 -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=HTEn98TA; 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 S2390946AbgDCQkG (ORCPT + 99 others); Fri, 3 Apr 2020 12:40:06 -0400 Received: from merlin.infradead.org ([205.233.59.134]:47212 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728381AbgDCQkG (ORCPT ); Fri, 3 Apr 2020 12:40:06 -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-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=4dF2QsJUGR4Xl/636zq9DlSyKEjw2qbunG9s4a650M8=; b=HTEn98TABr1GK/mBH+hQpcrz4+ u5DXndV2SMsCbsNk5LXFX7fSXOUltRHU6cVPzTkVBaWaMPfWofUJMjpnd2f9P7O5PIK3IHbv+nCLd lFAEoi7NYYnOuwsk6V06cjXSXR9Q97+JOpWBBNpsIXAeovSQE9Ks1+UrDPQxsjP3AxMhRr5oNmUZe u+tj1nllTMYRpB3CK8B7GnYq2naLslUIwXUwKI97FnNmIPnQPpHSURBwfbqvNuhwKo2iT/jDw3qy1 y5DMuTykVqNACNbXNwXtygbHbI66o4FRPf445FOBrKA2MRKwJhgYHb3jNmDU55FITJy/ykzrQHc1E q7AvaIBA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jKPM6-0003G4-FJ; Fri, 03 Apr 2020 16:39:42 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 1FC0F3010BC; Fri, 3 Apr 2020 18:39:41 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 09F542B124BEE; Fri, 3 Apr 2020 18:39:41 +0200 (CEST) Date: Fri, 3 Apr 2020 18:39:41 +0200 From: Peter Zijlstra To: David Laight Cc: Sean Christopherson , Jessica Yu , Rasmus Villemoes , Thomas Gleixner , LKML , "x86@kernel.org" , "Kenneth R. Crudup" , Paolo Bonzini , Fenghua Yu , Xiaoyao Li , Nadav Amit , Thomas Hellstrom , Tony Luck , Steven Rostedt , Greg Kroah-Hartman , "jannh@google.com" , "keescook@chromium.org" Subject: Re: [patch 1/2] x86,module: Detect VMX modules and disable Split-Lock-Detect Message-ID: <20200403163941.GW20730@hirez.programming.kicks-ass.net> References: <20200402123258.895628824@linutronix.de> <20200402124205.242674296@linutronix.de> <20200403143459.GA30424@linux-8ccs> <20200403152158.GR20730@hirez.programming.kicks-ass.net> <20200403160156.GA2701@linux.intel.com> <20200403161205.GT20730@hirez.programming.kicks-ass.net> <7b83b632e41c48698ab892b07673f42d@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7b83b632e41c48698ab892b07673f42d@AcuMS.aculab.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 03, 2020 at 04:16:38PM +0000, David Laight wrote: > From: Peter Zijlstra > > Sent: 03 April 2020 17:12 > > On Fri, Apr 03, 2020 at 09:01:56AM -0700, Sean Christopherson wrote: > > > On Fri, Apr 03, 2020 at 05:21:58PM +0200, Peter Zijlstra wrote: > > > > On Fri, Apr 03, 2020 at 04:35:00PM +0200, Jessica Yu wrote: > > > > > > > I wonder if it would make sense then to limit the text scans to just > > > > > out-of-tree modules (i.e., missing the intree modinfo flag)? > > > > > > > > It would; didn't know there was one. > > > > > > Rather than scanning modules at all, what about hooking native_write_cr4() > > > to kill SLD if CR4.VMXE is toggled on and the caller didn't increment a > > > "sld safe" counter? > > > > And then you're hoping that the module uses that and not: > > > > asm volatile ("mov %0, cr4" :: "r" (val)); > > > > I think I feel safer with the scanning to be fair. Also with the intree > > hint on, we can extend the scanning for out-of-tree modules for more > > dodgy crap we really don't want modules to do, like for example the > > above. > > Could you do the scanning in the last phase of the module build > that has to be done against the target kernel headers and with the > target kernel build infrastructure? You think the binary module people care to respect our module build warnings?