Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4014425ybl; Mon, 12 Aug 2019 09:58:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwikBhCzgk9i3sy5N0TfQZJZgpDvqreKQvAsWVXObscHthFB+HaCKFftpSg+zLGmS3+yJWI X-Received: by 2002:aa7:8602:: with SMTP id p2mr3789312pfn.138.1565629124278; Mon, 12 Aug 2019 09:58:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565629124; cv=none; d=google.com; s=arc-20160816; b=fpNbFWPiCvwwVW/CbaZZVJanR87VubVwzW6XXf1WkSuhe0r4osZvB7zDR+J/FvHANn BiVLOCRu6aHGnNh6nXaa92aSCNsZ4nbBcXdApcbhn/rfwnF/A2g8v7T6B59Lwl5mBaSo qqwpxQ12Q08yYCbmoa6NDdN3dNGdw8nfkuQzZOa1VWw6sEwHF15qNuFIAaoWUqw5e8Jr xzoP/o2n9d26Q02n+oSeAuBCn6ynq1Dp9UKEd3DSHkl8E9kq02z2gJw5BdTI7xP5ZX6B tZuyRt3onGzFqc+F0NyXZJaYRauhWKbRa+4yzAmRaTtqb9H5ihcB5rgW2r0FHWYUKar2 R85w== 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; bh=eAMUjVvObOzNbT2SD2K6UeFq5NqZNk7/ldaXjvHHUSw=; b=YoroutzyoJoX5fVcOMX83KLgy7kcLX+XjylQ2SMhacacyTyJusRM0TMHuGA+l6fTiX Fl1V+Hn58xV1VpaYcX5bdV8Y2cwCScPdg8mfEZKx8doG4t7Z3xTWuqfesj6cwO+JcqgH SQLAzrmcJw7fUXIaI8lWMsTI8ZNSiZKJLhZ94+fo/keQcY/+8dWrPJyT1vmTCGQBVRZK pdfoUeTEf2ncJJgtIEiTeKAc6q/FlWh88kwfHNoBGPv5z53fPkZK7IB9JEKXhNZ0istp h9XMKxrQkpzqmSTbYkLHqbv6bwoddCi3JD4b08uzX/M+MtBQ5xNYt+AvEE2E/h+ki8Zw FoYw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 h17si4645639pfo.210.2019.08.12.09.58.22; Mon, 12 Aug 2019 09:58:44 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726674AbfHLQ5h (ORCPT + 99 others); Mon, 12 Aug 2019 12:57:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55144 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbfHLQ5h (ORCPT ); Mon, 12 Aug 2019 12:57:37 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 522CF308FBB4; Mon, 12 Aug 2019 16:57:37 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.136]) by smtp.corp.redhat.com (Postfix) with SMTP id 6B0DE5C28C; Mon, 12 Aug 2019 16:57:35 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 12 Aug 2019 18:57:36 +0200 (CEST) Date: Mon, 12 Aug 2019 18:57:34 +0200 From: Oleg Nesterov To: Christian Brauner Cc: Adrian Reber , Eric Biederman , Pavel Emelianov , Jann Horn , Dmitry Safonov <0x7f454c46@gmail.com>, linux-kernel@vger.kernel.org, Andrei Vagin , Mike Rapoport , Radostin Stoyanov Subject: Re: [PATCH v5 1/2] fork: extend clone3() to support CLONE_SET_TID Message-ID: <20190812165733.GD31560@redhat.com> References: <20190811203327.5385-1-areber@redhat.com> <20190812163710.GC31560@redhat.com> <20190812165130.d3b5smm45dpxk6m4@wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190812165130.d3b5smm45dpxk6m4@wittgenstein> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Mon, 12 Aug 2019 16:57:37 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/12, Christian Brauner wrote: > On Mon, Aug 12, 2019 at 06:37:10PM +0200, Oleg Nesterov wrote: > > On 08/11, Adrian Reber wrote: > > > > > > include/linux/pid.h | 2 +- > > > include/linux/sched/task.h | 1 + > > > include/uapi/linux/sched.h | 1 + > > > kernel/fork.c | 22 ++++++++++++++++++++-- > > > kernel/pid.c | 36 +++++++++++++++++++++++++++++------- > > > 5 files changed, 52 insertions(+), 10 deletions(-) > > > > Looks good to me... > > > > A couple of nits below, but I won't insist, feel free to ignore. > > > > > +/* > > > + * Different sizes of struct clone_args > > > + */ > > > +#define CLONE3_ARGS_SIZE_V0 64 > > > > I don't really understand why do we want the "size < CLONE3_ARGS_SIZE_V0" > > check in copy_clone_args_from_user(), but I won't argue. > > To make sure a user can't give us a garbage sized struct that is smaller > than the initial version of the struct. But why do we want to detect this case? And why CLONE3_ARGS_SIZE_V0 is special? Oleg.