Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10878456ybi; Thu, 25 Jul 2019 06:27:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBNmRub6ENNEPka6qxkGUoQvOrBzET8VYFy6e8B2y2qdhDjw/tH4bWEdk0lpSeZQdH7+TC X-Received: by 2002:a62:78c2:: with SMTP id t185mr17129849pfc.142.1564061267556; Thu, 25 Jul 2019 06:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564061267; cv=none; d=google.com; s=arc-20160816; b=xc3sVaFvv1IgFJ8zVaSI0/pQo9DbeLl6zPEtWtYE6KF8h88/T1sACO+bbCVLQIGJoj HyOWBDQKhhr1DHAEDsVlXzLyUD93vZ5zwmrxy2AUuqzAcLFygnLziyVgY2Yyxuq2jnwp zHW6jTrO5ixQ5Wj68R5uRfVO2/Ygcovk+psePDw7OdAJECa9+9gCWDoyv4A0VMFJ4Tbz ZyaIeOAQMi76DsTZePkeB5jg6T8gCzR8w5+/lkDfSZI9jamYoGH7MiKffCF6vLZwIEWI Xp/4O4z1SwypbxHHu7ATcPG2Cl/n/wk9i9Qe4GDEPWOGWFAMFrw4iGXwinsb6zTMLs/I 2SAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=AQ5eu5T8bd0iWq+deSWzM6tglKfb1SWMy/MM2LiEz9k=; b=bGVfC60jCGeIzj+NeaHBYKLt1FFSQVuADACMt7iaR1HuITwuHfSwXk7yVPPVqFR49Y 0UFfcN+Hl0UUNOhliKgVDEKtuptNxYIff018OY9Y5NbIjCkU0n4XJRqi01uK8/gQNKsg K5lD5W+1nRPrHPgsplc5/3vEYdR5xqWuOKQK8a9nvpUDoyy26UeGMk0WtQ8BevxlBDa2 UmrLbuaiIZ/CESc2V4OdaGCx/p6bNh2cRhXzRnM28+XNjeA4Zy/johtH4RAuH3m1EYMI LnptKj/gP1vJQNZp36dpfdBheEXhjhRt0LZQ6n4bQ+EfBUT01TSeP8ynpLdE5D/bxQ3e PiUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=XBPmLfnV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si16595550pgq.240.2019.07.25.06.27.32; Thu, 25 Jul 2019 06:27:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@brauner.io header.s=google header.b=XBPmLfnV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728337AbfGYKgG (ORCPT + 99 others); Thu, 25 Jul 2019 06:36:06 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:36027 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbfGYKgF (ORCPT ); Thu, 25 Jul 2019 06:36:05 -0400 Received: by mail-ed1-f66.google.com with SMTP id k21so49799332edq.3 for ; Thu, 25 Jul 2019 03:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brauner.io; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=AQ5eu5T8bd0iWq+deSWzM6tglKfb1SWMy/MM2LiEz9k=; b=XBPmLfnVwr/7eur+UqagLpzPfTEI471X0hzeJK9kCbJAYEWipu0LJvkDzCeGw8ygdH N0LbUzRcwqwpW4PkvXZSNqJLEtdRryxKefvoOJ5/1nkdJ3ssKK4pMCF8ie3VP5EyIcvW qT4xEDSkaG0gpqe8ynZmtAGOqWGkzjET5sTPd1sePdTUWmeJCHW0c4q7XjeoTBxE1TCw FqZ/6uDuNTh84nBe/Go36ZbeTuRH49e4nuvpqWAq/qDhNrkgLecNKAPqZNG76sMs2gKd FriQ7L+r2ADxbF0J2tv2yD/7Q63e1VsLb23eVr8B4E4KNQTRqAUsagO+a12ethB1k81D BYSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=AQ5eu5T8bd0iWq+deSWzM6tglKfb1SWMy/MM2LiEz9k=; b=ZeSt0xoQ+ro2eN72me40pxpT7NTLHe91zfDGQ8GykNSsKE8X4URNXjatvyAqcrJhIa YZj9SGGXdrLl5+IIUdZnf+TmIRphlp/HEjkB9eRpR6hxEuCio06BegBmTDzHAUEKgQut FqweGu06582QJj6hcTP6UyXt2nrGNvHz4N7NDsybDAd/nvPV68z7VUks7ec8/v6TPQI6 R+ufJQ3Is8Q9eb6rL26287ZYUL0Hnfe31ThHGr26E0bZxSGnVkP76M3rBFdfgKh/Zgjz yiondpVrQMBXSGTS/Uk2rdje+xFYWZk1mZ5ygFReKBWaZcXNVHRuanx5WKuMoWUQtX1N 85mw== X-Gm-Message-State: APjAAAVIgdvbP32NneDsgZjlX8ejn3dkyX6YnLIfqve+gb7kxHc9jJXT sk4JIXCsVePmSW0jmB+K2sM= X-Received: by 2002:a50:f410:: with SMTP id r16mr76790306edm.120.1564050964343; Thu, 25 Jul 2019 03:36:04 -0700 (PDT) Received: from brauner.io (ip5b40f7ec.dynamic.kabel-deutschland.de. [91.64.247.236]) by smtp.gmail.com with ESMTPSA id p15sm7737732ejr.1.2019.07.25.03.36.03 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 25 Jul 2019 03:36:03 -0700 (PDT) Date: Thu, 25 Jul 2019 12:36:02 +0200 From: Christian Brauner To: Oleg Nesterov Cc: Jann Horn , kernel list , Arnd Bergmann , "Eric W. Biederman" , Kees Cook , "Joel Fernandes (Google)" , Thomas Gleixner , Tejun Heo , David Howells , Andy Lutomirski , Andrew Morton , Aleksa Sarai , Linus Torvalds , Al Viro , kernel-team , Ingo Molnar , Peter Zijlstra , Linux API Subject: Re: [PATCH 4/5] pidfd: add CLONE_WAIT_PID Message-ID: <20190725103601.4ck4bpsdsgcpdknt@brauner.io> References: <20190724144651.28272-1-christian@brauner.io> <20190724144651.28272-5-christian@brauner.io> <20190725103048.GE4707@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190725103048.GE4707@redhat.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 25, 2019 at 12:30:48PM +0200, Oleg Nesterov wrote: > On 07/24, Jann Horn wrote: > > > > --- a/kernel/fork.c > > +++ b/kernel/fork.c > > @@ -1902,6 +1902,10 @@ static __latent_entropy struct task_struct *copy_process( > > delayacct_tsk_init(p); /* Must remain after dup_task_struct() */ > > p->flags &= ~(PF_SUPERPRIV | PF_WQ_WORKER | PF_IDLE); > > p->flags |= PF_FORKNOEXEC; > > + if (!(clone_flags & CLONE_THREAD)) > > + p->flags &= ~PF_PF_WAIT_PID; > > + if (clone_flags & CLONE_WAIT_PID) > > + p->flags |= PF_PF_WAIT_PID; > > agreed, but then the "if (!thread_group_leader(tsk))" block in de_thread() > should also copy PF_PF_WAIT_PID. > > > An alternative would be to not use p->flags at all, but instead make > > this a property of the signal_struct - since the property is shared by > > all threads, that might make more sense? > > I tend to agree. Hm, ok. That's two people that prefer to make this a flag in signal_struct. Ok, let me adapt the patch. Thanks! Christian