Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4263303ybc; Fri, 15 Nov 2019 01:35:55 -0800 (PST) X-Google-Smtp-Source: APXvYqwx77S32UdQHyARQZr0qTmMbynBo8+cHjhwOXr+83ZGJ2CW8w/zt8bgpFCR994SMLHtgrEB X-Received: by 2002:a17:906:7251:: with SMTP id n17mr12625333ejk.329.1573810555382; Fri, 15 Nov 2019 01:35:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573810555; cv=none; d=google.com; s=arc-20160816; b=NL3vJhYgXtasARv4VKWhW1K0sP0qtHdXP2qhu8WqbvRHAlhtZE6PeeLxD7U8q3zEnB bfJ95TiXr2fwmW01o7JIkh1Va3/EUT4pnxIync60sRiocQHBKgPpA/cS/Hj93kmssP3t Ok8giey9bdTmiN0ZfQASGN7V9ApIrwPik8W/OtDq1pu4N+kQIaphscfwAjJBQmEjRpbW DJwB7dmSeTzNfDqt2vfTwG+UuI35yR04FxEWSyq67FBYkRh2N0r0KlS5mETXU2THa1+C H8lZ6t6qEQa1xRv4XrDXrm112yuwrdZjlqWr6VvhsMQlcE7WJv/QXa4zeW4ZPBTfZO3i 0rxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:user-agent:in-reply-to:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2lzawNQBmGA+jjj1+nr7/MFGmhoKRDvbgjKa9NHAufc=; b=HfdnJX7nzl/TUzaQ5DQExwcA/ZCkLH7PFtXxegHaIejKjRQB26YZka6gkzH757Jo14 Cju3vurS0ELnKx9ZzsnP0zSbfXxewBV7aGilYMgPmWOkwcXVypZ6fO949cME4UHu5bgG 51X7Wy8cS3VpsbVGGiVug3a1V7TtkH+HuC+rL1ZCINIuwM4/w9QdT7Zbw7Hp94oowJBT pa4pCveJh1QutZmlD+PtOtQb1E22v74dSLkVmvHt/orwFffwxvbWW2r5xBfVu6K+LtAS fuOoXxTXya3MYn5jd642UfV9r7zsokULolLE98gT5iLKbw2c4aubr5Qw+KUhvVpSrqLw 4rvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="gcZws/se"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si5335557ejd.165.2019.11.15.01.35.30; Fri, 15 Nov 2019 01:35:55 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b="gcZws/se"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727215AbfKOJea (ORCPT + 99 others); Fri, 15 Nov 2019 04:34:30 -0500 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:49659 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726901AbfKOJea (ORCPT ); Fri, 15 Nov 2019 04:34:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573810469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2lzawNQBmGA+jjj1+nr7/MFGmhoKRDvbgjKa9NHAufc=; b=gcZws/seIZAErAEEmS+m0XFSbvJOuf4lMqYZ3K7dMsgWeqgwdwZn38IN29rocgMXv69siL cKOclndh6l0K2LL1bQfKkjvrwNG/Ah9wJ73kb26F/daKrKmBRGMrz9N0+HsZWlspmzqL1J ZzTioAfPbNGS7LtUijLjUg90WqQBp2E= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-199-VKzwddh-P4W-IxqFdRfIlg-1; Fri, 15 Nov 2019 04:34:26 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2F5E6DB25; Fri, 15 Nov 2019 09:34:24 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.44]) by smtp.corp.redhat.com (Postfix) with SMTP id 662FE5ED32; Fri, 15 Nov 2019 09:34:21 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 15 Nov 2019 10:34:22 +0100 (CET) Date: Fri, 15 Nov 2019 10:34:20 +0100 From: Oleg Nesterov To: Andrei Vagin Cc: Adrian Reber , Christian Brauner , Eric Biederman , Pavel Emelyanov , Jann Horn , Dmitry Safonov <0x7f454c46@gmail.com>, Rasmus Villemoes , linux-kernel@vger.kernel.org, Mike Rapoport , Radostin Stoyanov Subject: Re: [PATCH v10 1/2] fork: extend clone3() to support setting a PID Message-ID: <20191115093419.GA25528@redhat.com> References: <20191114142707.1608679-1-areber@redhat.com> <20191114191538.GC171963@gmail.com> MIME-Version: 1.0 In-Reply-To: <20191114191538.GC171963@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: VKzwddh-P4W-IxqFdRfIlg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/14, Andrei Vagin wrote: > > On Thu, Nov 14, 2019 at 03:27:06PM +0100, Adrian Reber wrote: > ... > > diff --git a/include/uapi/linux/sched.h b/include/uapi/linux/sched.h > > index 1d500ed03c63..2e649cfa07f4 100644 > > --- a/include/uapi/linux/sched.h > > +++ b/include/uapi/linux/sched.h > ... > > @@ -174,24 +186,51 @@ struct pid *alloc_pid(struct pid_namespace *ns) > > =09pid->level =3D ns->level; > > > > =09for (i =3D ns->level; i >=3D 0; i--) { > > -=09=09int pid_min =3D 1; > > +=09=09int tid =3D 0; > > + > > +=09=09if (set_tid_size) { > > +=09=09=09tid =3D set_tid[ns->level - i]; > > +=09=09=09if (tid < 1 || tid >=3D pid_max) > > +=09=09=09=09return ERR_PTR(-EINVAL); > > do we need to release pids what have been allocated on previous levels? Heh ;) it is really amazing that nobody noticed this! Thanks Andrei. > nr =3D -EINVAL; retval =3D -EINVAL; > goto out_free; Oleg.