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 604E41F45A for ; Wed, 14 Aug 2019 12:29:32 +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=jXVW SEaEHMk1Ovy3hjFHx2GxYin2a/og5Qs2DL8+IO+83nZmc2fPEOY8Cd3CUkGw5cwB HZCWYSsLbcDQP8Yxy37Uhx1/WLZllGwWg2l/ptEFTpRS0vCKbXcx29V/2tws/zzk 6u8JiUgvJZCLtrj85ar6960110EAEc6BJWuYARQ= 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=YgEmdtfFwj rsr4z9DXssgWKNIjo=; b=DzrsvjLqIrgE4/vTVhXnUIMWnz3aAQPwQmvTa5qyOE 1RTALsBdaPDfoDM+u3HVlYlYRsYerUvffKZMk7eUCUT1vHVdc+lAUMQp2iMRDOg2 waDXVDQjFneF6HHmJcWyWpI+iTkOjbEqN61Tpxli9s1xEBufNLkUZIFlrRY8qEWj 4= Received: (qmail 17953 invoked by alias); 14 Aug 2019 12:29:29 -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 17895 invoked by uid 89); 14 Aug 2019 12:29:28 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.redhat.com Date: Wed, 14 Aug 2019 14:29:10 +0200 From: Oleg Nesterov To: christian.brauner@ubuntu.com 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: <20190814122909.GA11595@redhat.com> References: <20190814113822.9505-1-christian.brauner@ubuntu.com> <20190814113822.9505-2-christian.brauner@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190814113822.9505-2-christian.brauner@ubuntu.com> User-Agent: Mutt/1.5.24 (2015-08-30) 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)). Oleg.