Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964820AbbLRSm7 (ORCPT ); Fri, 18 Dec 2015 13:42:59 -0500 Received: from mga09.intel.com ([134.134.136.24]:48094 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932584AbbLRSm6 (ORCPT ); Fri, 18 Dec 2015 13:42:58 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,447,1444719600"; d="scan'208";a="710567430" Subject: Re: Rethinking sigcontext's xfeatures slightly for PKRU's benefit? To: Andy Lutomirski , "H. Peter Anvin" References: <56736BD1.5080700@linux.intel.com> <5673750B.606@linux.intel.com> Cc: Oleg Nesterov , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Brian Gerst , "linux-kernel@vger.kernel.org" , Linus Torvalds , Christoph Hellwig From: Dave Hansen Message-ID: <567453AF.5060808@linux.intel.com> Date: Fri, 18 Dec 2015 10:42:55 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.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 Content-Length: 1025 Lines: 20 On 12/18/2015 08:04 AM, Andy Lutomirski wrote: > 1b. If the app malfunctions such that RSP points to pmem, the kernel > MUST NOT clobber the pmem space. I think that this basically mandates > that PKRU needs to have some safe state (i.e. definitely not the init > state) on signal delivery: the kernel is going to write a signal frame > at the address identified by RSP, and that address is in pmem, so > those writes need to fail. The kernel is writing the signal frame using normal old copy_to_user(). Those are writing through mappings with _PAGE_USER set and should be subject to the PKRU state of the thread before the signal started to be delivered. We don't do the fpu__clear() until after this copy, so I think pkeys enforcement is being done properly for this today. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/