From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752015AbcFWTLr (ORCPT ); Thu, 23 Jun 2016 15:11:47 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:56737 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbcFWTLm (ORCPT ); Thu, 23 Jun 2016 15:11:42 -0400 Date: Thu, 23 Jun 2016 21:11:23 +0200 From: Peter Zijlstra To: Oleg Nesterov Cc: Linus Torvalds , Andy Lutomirski , Andy Lutomirski , the arch/x86 maintainers , Linux Kernel Mailing List , "linux-arch@vger.kernel.org" , Borislav Petkov , Nadav Amit , Kees Cook , Brian Gerst , "kernel-hardening@lists.openwall.com" , Josh Poimboeuf , Jann Horn , Heiko Carstens Subject: Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Message-ID: <20160623191123.GE30935@twins.programming.kicks-ass.net> References: <20160623143126.GA16664@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160623143126.GA16664@redhat.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 23, 2016 at 04:31:26PM +0200, Oleg Nesterov wrote: > On 06/22, Linus Torvalds wrote: > > > > Oleg, what do you think? Would it be reasonable to free the stack and > > thread_info synchronously at exit time, clear the pointer (to catch > > any odd use), and only RCU-delay the task_struct itself? > > I didn't see the patches yet, quite possibly I misunderstood... But no, > I don't this we can do this (if we are not going to move ti->flags to > task_struct at least). Didn't we talk about using SLAB_DESTROY_BY_RCU for task_struct before? If that is possible, a reuse in per-cpu cache is equally possible. All we really want to guarantee is that the memory remains a task_struct, it need not remain the same task, right? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Date: Thu, 23 Jun 2016 21:11:23 +0200 Message-ID: <20160623191123.GE30935@twins.programming.kicks-ass.net> References: <20160623143126.GA16664@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from bombadil.infradead.org ([198.137.202.9]:56737 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950AbcFWTLm (ORCPT ); Thu, 23 Jun 2016 15:11:42 -0400 Content-Disposition: inline In-Reply-To: <20160623143126.GA16664@redhat.com> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Oleg Nesterov Cc: Linus Torvalds , Andy Lutomirski , Andy Lutomirski , the arch/x86 maintainers , Linux Kernel Mailing List , "linux-arch@vger.kernel.org" , Borislav Petkov , Nadav Amit , Kees Cook , Brian Gerst , "kernel-hardening@lists.openwall.com" , Josh Poimboeuf , Jann Horn , Heiko Carstens On Thu, Jun 23, 2016 at 04:31:26PM +0200, Oleg Nesterov wrote: > On 06/22, Linus Torvalds wrote: > > > > Oleg, what do you think? Would it be reasonable to free the stack and > > thread_info synchronously at exit time, clear the pointer (to catch > > any odd use), and only RCU-delay the task_struct itself? > > I didn't see the patches yet, quite possibly I misunderstood... But no, > I don't this we can do this (if we are not going to move ti->flags to > task_struct at least). Didn't we talk about using SLAB_DESTROY_BY_RCU for task_struct before? If that is possible, a reuse in per-cpu cache is equally possible. All we really want to guarantee is that the memory remains a task_struct, it need not remain the same task, right? From mboxrd@z Thu Jan 1 00:00:00 1970 Reply-To: kernel-hardening@lists.openwall.com Date: Thu, 23 Jun 2016 21:11:23 +0200 From: Peter Zijlstra Message-ID: <20160623191123.GE30935@twins.programming.kicks-ass.net> References: <20160623143126.GA16664@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160623143126.GA16664@redhat.com> Subject: [kernel-hardening] Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) To: Oleg Nesterov Cc: Linus Torvalds , Andy Lutomirski , Andy Lutomirski , the arch/x86 maintainers , Linux Kernel Mailing List , "linux-arch@vger.kernel.org" , Borislav Petkov , Nadav Amit , Kees Cook , Brian Gerst , "kernel-hardening@lists.openwall.com" , Josh Poimboeuf , Jann Horn , Heiko Carstens List-ID: On Thu, Jun 23, 2016 at 04:31:26PM +0200, Oleg Nesterov wrote: > On 06/22, Linus Torvalds wrote: > > > > Oleg, what do you think? Would it be reasonable to free the stack and > > thread_info synchronously at exit time, clear the pointer (to catch > > any odd use), and only RCU-delay the task_struct itself? > > I didn't see the patches yet, quite possibly I misunderstood... But no, > I don't this we can do this (if we are not going to move ti->flags to > task_struct at least). Didn't we talk about using SLAB_DESTROY_BY_RCU for task_struct before? If that is possible, a reuse in per-cpu cache is equally possible. All we really want to guarantee is that the memory remains a task_struct, it need not remain the same task, right?