From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 781321F45A for ; Wed, 14 Aug 2019 12:53:22 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; q=dns; s=default; b=THTQ k1drFP3cyEXSVtW53aVb6iOxJ6t4GVeBKeLjtwYD0Do5Jy+aSXwp+Z/Ar9ON+9bN jCQrVAN1NHGKS+47BcKwQmUb8axMvg1Komd1eEno9OAfUqsDlXMFd+SxkrRjP/pY D3c6LNod0BCzbH5ay7HPh2pKYfhb7TpPVg0TZUM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:in-reply-to; s=default; bh=eWEo3GzirB imrxfHP6Q6Np2YSOM=; b=SluvTO+p6tjXbzmxofalyf9pMft455zGAM0JxOJazW Aj3RTeMz8oHmQHh1Rb4WI0/5VypniL+P9I3g/jStwKaR00Qa9WN5WZ90I3jnbWdA rAw6so6/2YJIeakpRkhyXHGDnx3NaacTZ7xwx+cOrwAThS50Nb8Y/tgc5GjM60iO o= Received: (qmail 48916 invoked by alias); 14 Aug 2019 12:53:19 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 48906 invoked by uid 89); 14 Aug 2019 12:53:17 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: youngberry.canonical.com Date: Wed, 14 Aug 2019 14:53:02 +0200 From: Christian Brauner To: Oleg Nesterov Cc: linux-kernel@vger.kernel.org, libc-alpha@sourceware.org, alistair23@gmail.com, ebiederm@xmission.com, arnd@arndb.de, dalias@libc.org, torvalds@linux-foundation.org, adhemerval.zanella@linaro.org, fweimer@redhat.com, palmer@sifive.com, macro@wdc.com, zongbox@gmail.com, akpm@linux-foundation.org, viro@zeniv.linux.org.uk, hpa@zytor.com Subject: Re: [PATCH v1 1/1] waitid: Add support for waiting for the current process group Message-ID: <20190814125301.4aed3cm747hjyzy5@wittgenstein> References: <20190814113822.9505-1-christian.brauner@ubuntu.com> <20190814113822.9505-2-christian.brauner@ubuntu.com> <20190814122909.GA11595@redhat.com> <20190814124551.hnt363g3blhuf2pv@wittgenstein> <20190814125012.GB11595@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190814125012.GB11595@redhat.com> User-Agent: NeoMutt/20180716 On Wed, Aug 14, 2019 at 02:50:12PM +0200, Oleg Nesterov wrote: > On 08/14, Christian Brauner wrote: > > > > On Wed, Aug 14, 2019 at 02:29:10PM +0200, Oleg Nesterov wrote: > > > On 08/14, christian.brauner@ubuntu.com wrote: > > > > > > > > case P_PGID: > > > > type = PIDTYPE_PGID; > > > > - if (upid <= 0) > > > > + if (upid < 0) > > > > return -EINVAL; > > > > + > > > > + if (upid == 0) > > > > + pid = get_pid(task_pgrp(current)); > > > > > > this needs rcu lock or tasklist_lock, this can race with another thread > > > doing sys_setpgid/setsid (see change_pid(PIDTYPE_PGID)). > > > > Oh, I naively assumed task_pgrp() would take an rcu lock... > > but it would not help ;) Yeah, it doesn't do a get. :)