From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752769AbcGLXAC (ORCPT ); Tue, 12 Jul 2016 19:00:02 -0400 Received: from mga11.intel.com ([192.55.52.93]:51276 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750927AbcGLW7w (ORCPT ); Tue, 12 Jul 2016 18:59:52 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,354,1464678000"; d="scan'208";a="1015675181" Subject: Re: Minor PKRU bug? To: "H. Peter Anvin" , Andy Lutomirski , X86 ML , "linux-kernel@vger.kernel.org" References: <57850D8A.9090801@linux.intel.com> From: Dave Hansen Message-ID: <57857654.1000309@linux.intel.com> Date: Tue, 12 Jul 2016 15:59:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/12/2016 03:55 PM, H. Peter Anvin wrote: > On 07/12/16 08:32, Dave Hansen wrote: >> On 07/09/2016 02:27 PM, Andy Lutomirski wrote: >>> is_prefetch in arch/x86/mm/fault.c can be called on a user address >>> that's not readable due to PKRU. This could break it. You might need >>> to add a get_user_exec or similar. >> >> Thanks for the heads-up. I think I'll just need a version that does >> something along the lines of stac/clac, but with PKRU. >> >> I think I can do it with an "_exec" variant of probe_kernel_address(), >> but it's a bit messy. > > Can this particular codepath even be executed on a PKRU-equipped > machine? I thought it was a bug fix for a specific AMD CPU line. Yeah, I think we hit it unconditionally in the naughty paths of the page fault handler. I don't see any CPU model detection in the call path. I think we just assume that everybody has prefetch bugs.