From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753184AbcG2Ru6 (ORCPT ); Fri, 29 Jul 2016 13:50:58 -0400 Received: from mga11.intel.com ([192.55.52.93]:13952 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753158AbcG2Rux (ORCPT ); Fri, 29 Jul 2016 13:50:53 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,440,1464678000"; d="scan'208";a="1005030431" Subject: Re: [PATCH 08/10] x86, pkeys: default to a restrictive init PKRU To: Andy Lutomirski References: <20160729163009.5EC1D38C@viggo.jf.intel.com> <20160729163021.F3C25D4A@viggo.jf.intel.com> Cc: "linux-kernel@vger.kernel.org" , X86 ML , Linux API , linux-arch , "linux-mm@kvack.org" , Linus Torvalds , Andrew Morton , Andrew Lutomirski , Mel Gorman , Dave Hansen , Arnd Bergmann From: Dave Hansen Message-ID: <579B977B.7090609@intel.com> Date: Fri, 29 Jul 2016 10:50:51 -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/29/2016 10:29 AM, Andy Lutomirski wrote: >> > In the end, this ensures that threads which do not know how to >> > manage their own pkey rights can not do damage to data which is >> > pkey-protected. > I think you missed the fpu__clear() caller in kernel/fpu/signal.c. > > ISTM it might be more comprehensible to change fpu__clear in general > and then special case things you want to behave differently. The code actually already patched the generic fpu__clear(): fpu__clear() -> copy_init_fpstate_to_fpregs() -> copy_init_pkru_to_fpregs() So I think it hit the case you are talking about.