Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5105279ybc; Fri, 15 Nov 2019 14:58:02 -0800 (PST) X-Google-Smtp-Source: APXvYqx1FXX1crZG/Db8ytaPJTlpLOaHlK0up9ATbAguLpRemHFuWeBA82i86rkWdMTxKoxBoebx X-Received: by 2002:a17:906:af5a:: with SMTP id ly26mr4730278ejb.252.1573858682150; Fri, 15 Nov 2019 14:58:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573858682; cv=none; d=google.com; s=arc-20160816; b=HQQ8Pd+Y7qodlm8ICTKOdjy7YkNlwtczeQYEu6WjElaXJq3mU7tAccyrf8hNKWTqJP JLtXN5aF9JGYgcQ8htckkEwk0q5L5rU4zERwP+yQ7MPFqo/YUnbE70IvV+P3gq+JT/EV PVjpd2WoToMSgm01YvWxQyQiFc2QSUHYrUwvGr4J66KJpOWqvF2KBN9FmCFhK7wsKw/Q wmm4j2k2KlYrssdqcVG0bGmDyRGkI2PZqda8Yylzp41ZjTJJ+LZWDNyxMuKw9PjJErNB JTJ+TxLomZa7AuQeeEzWsWROHv9NxAAUcSnmgUKhqZL1Vprb5+jYZzVJmEc+W2lzUv69 x8jg== 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=gmydfw2+/3xuhjz6MjkiNV4Shdh3MzDcqacqu9biRX0=; b=m2n9E4ON0IOLmQr9OhJGx5fEBexSY0Hjpyx+/ZYKH8V/yMxfwCF6wmOxVBXCC69vc1 biuRsaRQn9Wv2SVR+F8L7VJTUMO8O8pzUffauH122Nk4Iq7mPYooDsMwYCm3dkmOzHj+ edMBw7fq7MkBGakjC42XDVWvchCIpm/O+kIclUsPRRTk/ef2J8LVBNoRe7mPNnCH+HK8 Woy3z6lhTxGDChqCkosCLXvd7mIU0NUiZDQkIDhHWvStZd7ivnjJfuGW+Vtyi9mCXIMT ipN2/ZuWEhnMZAa+LhW3KuNWWqpMs7WQuYMMM8GI8Y2QB8dxiZgwnemYkLcvAP2jpje9 drAg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16si5419746ejc.277.2019.11.15.14.57.37; Fri, 15 Nov 2019 14:58:02 -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; 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 S1727199AbfKOWxw (ORCPT + 99 others); Fri, 15 Nov 2019 17:53:52 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:56188 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbfKOWxv (ORCPT ); Fri, 15 Nov 2019 17:53:51 -0500 Received: from [213.220.153.21] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iVkTJ-0005aa-9t; Fri, 15 Nov 2019 22:53:45 +0000 Date: Fri, 15 Nov 2019 23:53:44 +0100 From: Christian Brauner To: Andrei Vagin Cc: Adrian Reber , Eric Biederman , Pavel Emelyanov , Jann Horn , Oleg Nesterov , Dmitry Safonov <0x7f454c46@gmail.com>, Rasmus Villemoes , linux-kernel@vger.kernel.org, Mike Rapoport , Radostin Stoyanov Subject: Re: [PATCH v11 2/2] selftests: add tests for clone3() with *set_tid Message-ID: <20191115225343.v6x6vltvxgv54ewl@wittgenstein> References: <20191115123621.142252-1-areber@redhat.com> <20191115123621.142252-2-areber@redhat.com> <20191115222018.GB353836@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191115222018.GB353836@gmail.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 Fri, Nov 15, 2019 at 02:20:18PM -0800, Andrei Vagin wrote: > On Fri, Nov 15, 2019 at 01:36:21PM +0100, Adrian Reber wrote: > > This tests clone3() with *set_tid to see if all desired PIDs are working > > as expected. The tests are trying multiple invalid input parameters as > > well as creating processes while specifying a certain PID in multiple > > PID namespaces at the same time. > > > > Additionally this moves common clone3() test code into clone3_selftests.h. > > > > Signed-off-by: Adrian Reber > > --- > > v9: > > - applied all changes from Christian's review (except using the > > NSpid: parsing code from selftests/pidfd/pidfd_fdinfo_test.c) > > > > v10: > > - added even more '\n' and include file fixes (Christian) > > > > v11: > > - added more return code checking at multiple places (Andrei) > > - also add set_tid/set_tid_size to internal struct (Andrei) > > I think we can add a test case to trigger the issue what I found in the > previous version of the kernel patch. You can find my version of this > test case in the attached patch. > > nit: we need to flush stdout and stderr buffers before calling the raw > clone3 syscall and _exit(). Otherwise, some log messages can be lost and > some of them can be printed twice. > > To trigger this issue, you can run the test and redirect its output to > file or pipe: > > $ ./clone3_set_tid | cat > > I have attached the patch to address both these problems. It is a draft > version and may require some work. > > Adrian and Christian, it is up to you to decide whether we want to > update the current patch or to fix this on top by a separate patch. If you give me a proper commit with a commit message I'll put it on top as another patch. :) Christian