From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751603AbcFXUWT (ORCPT ); Fri, 24 Jun 2016 16:22:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21220 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751080AbcFXUWR (ORCPT ); Fri, 24 Jun 2016 16:22:17 -0400 Date: Fri, 24 Jun 2016 22:22:55 +0200 From: Oleg Nesterov To: Michal Hocko 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: <20160624202254.GA30695@redhat.com> References: <20160623143126.GA16664@redhat.com> <20160623170352.GA17372@redhat.com> <20160623185221.GA17983@redhat.com> <20160624140558.GA20208@dhcp22.suse.cz> <20160624150637.GD20203@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160624150637.GD20203@dhcp22.suse.cz> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 24 Jun 2016 20:22:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/24, Michal Hocko wrote: > > On Fri 24-06-16 16:05:58, Michal Hocko wrote: > > On Thu 23-06-16 20:52:21, Oleg Nesterov wrote: > > > > > > But I agree, this is fixable (and in fact I still hope TIF_MEMDIE will die, > > > at least in its current form). > > > > We can move the flag to the task_struct. Well, I actually meant that to me its usage doesn't look really right and we need to change this logic. But this is off-topic. > Here is the patch. Can't comment, but note that it was decided to move ti->flags into task_struct, so the patch is "off-topic" too ;) > @@ -1856,6 +1856,8 @@ struct task_struct { > unsigned long task_state_change; > #endif > int pagefault_disabled; > + /* oom victim - give it access to memory reserves */ > + atomic_t memdie; Yet another oom member. And these atomic_add_unless's look a bit strange, it seems that you could add "bool memdie" and use xchg() with the same effect? Oleg. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oleg Nesterov Subject: Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) Date: Fri, 24 Jun 2016 22:22:55 +0200 Message-ID: <20160624202254.GA30695@redhat.com> References: <20160623143126.GA16664@redhat.com> <20160623170352.GA17372@redhat.com> <20160623185221.GA17983@redhat.com> <20160624140558.GA20208@dhcp22.suse.cz> <20160624150637.GD20203@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mx1.redhat.com ([209.132.183.28]:21220 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751080AbcFXUWR (ORCPT ); Fri, 24 Jun 2016 16:22:17 -0400 Content-Disposition: inline In-Reply-To: <20160624150637.GD20203@dhcp22.suse.cz> Sender: linux-arch-owner@vger.kernel.org List-ID: To: Michal Hocko 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 06/24, Michal Hocko wrote: > > On Fri 24-06-16 16:05:58, Michal Hocko wrote: > > On Thu 23-06-16 20:52:21, Oleg Nesterov wrote: > > > > > > But I agree, this is fixable (and in fact I still hope TIF_MEMDIE will die, > > > at least in its current form). > > > > We can move the flag to the task_struct. Well, I actually meant that to me its usage doesn't look really right and we need to change this logic. But this is off-topic. > Here is the patch. Can't comment, but note that it was decided to move ti->flags into task_struct, so the patch is "off-topic" too ;) > @@ -1856,6 +1856,8 @@ struct task_struct { > unsigned long task_state_change; > #endif > int pagefault_disabled; > + /* oom victim - give it access to memory reserves */ > + atomic_t memdie; Yet another oom member. And these atomic_add_unless's look a bit strange, it seems that you could add "bool memdie" and use xchg() with the same effect? Oleg. From mboxrd@z Thu Jan 1 00:00:00 1970 Reply-To: kernel-hardening@lists.openwall.com Date: Fri, 24 Jun 2016 22:22:55 +0200 From: Oleg Nesterov Message-ID: <20160624202254.GA30695@redhat.com> References: <20160623143126.GA16664@redhat.com> <20160623170352.GA17372@redhat.com> <20160623185221.GA17983@redhat.com> <20160624140558.GA20208@dhcp22.suse.cz> <20160624150637.GD20203@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160624150637.GD20203@dhcp22.suse.cz> Subject: [kernel-hardening] Re: [PATCH v3 00/13] Virtually mapped stacks with guard pages (x86, core) To: Michal Hocko 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 06/24, Michal Hocko wrote: > > On Fri 24-06-16 16:05:58, Michal Hocko wrote: > > On Thu 23-06-16 20:52:21, Oleg Nesterov wrote: > > > > > > But I agree, this is fixable (and in fact I still hope TIF_MEMDIE will die, > > > at least in its current form). > > > > We can move the flag to the task_struct. Well, I actually meant that to me its usage doesn't look really right and we need to change this logic. But this is off-topic. > Here is the patch. Can't comment, but note that it was decided to move ti->flags into task_struct, so the patch is "off-topic" too ;) > @@ -1856,6 +1856,8 @@ struct task_struct { > unsigned long task_state_change; > #endif > int pagefault_disabled; > + /* oom victim - give it access to memory reserves */ > + atomic_t memdie; Yet another oom member. And these atomic_add_unless's look a bit strange, it seems that you could add "bool memdie" and use xchg() with the same effect? Oleg.