Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4436180pxb; Mon, 21 Feb 2022 21:33:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwMzUKdPGw9cpSVQxz96tTP/UoRX6x66Sz0t+drqof1JMAI1xEU6c7G1Vem4Bc/sjdXe/Jp X-Received: by 2002:a63:e4e:0:b0:372:f055:5e12 with SMTP id 14-20020a630e4e000000b00372f0555e12mr18663165pgo.485.1645508013774; Mon, 21 Feb 2022 21:33:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645508013; cv=none; d=google.com; s=arc-20160816; b=pMeYjry5S0wnYaG7BZG9kJ5tJccKm/agPUcbRo1+gjlS2SA8KeLwyoVX2PMz5ivads 3dwU+5fwqSx2I/kPWCN4tzV/9v5kSfBJMaVdd6ixTziGlhZl7fc4uolBGB99XVJs74xQ 26t9sRiuxEcONh0czdonAvIrhHHP3KYUbLzMPjow+E67EzICAVDXO4xVoXli6Qz9/l6r I5BQX9BPPxZAgB6VIxPbBpjhVYfcXYdCT/c7ib3HZ6kRVy+sYwbGLIhZwNV/CLQ8KzG4 nrGmia23+HFftdOlxjIzKPjtvwdaRNSkOVZ1md2TCq1IeEvG4OzB5PZGMIP38d19VMH+ NdjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BY50qvbr2cdPi8liUhF1+Uk1z6aeT99T+3MzUdjFqcQ=; b=KcNiBVRFXGqLCRYJe/wrCjuv0f1xjUoQdrcb5crXwoPifkHecDMNXTeM/vcxDGdtpZ kwUD5xaXiBmGsWihCbYn6W5Adrq1d9j5mSpaYqUGSTdPm9TDwOQIwOd+X7OMkH/TivXp 7bSL2Q5OMyXy0bhIBEcB3XBZtUC/u9vpv4qNneMFy80UQWDbBFD+LzwPDZkOSqptOngM 9Qw7sHTgZESWA1Iv2d+hq06ZGBtrqwNKpyHVDEj9BSZU3YZpS4NBuxf9N886FzgqZmIv zLxNdFcQ/1kQ9StV7+dJzG2yhYS90JVbFn7EcQK8UnDH8dS8DLhVwBRB6pbwurXuDj0e DL1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b5YCGOQ+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h188si18807116pgc.819.2022.02.21.21.33.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Feb 2022 21:33:33 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=b5YCGOQ+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 577B5119869; Mon, 21 Feb 2022 21:01:29 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350111AbiBUJah (ORCPT + 99 others); Mon, 21 Feb 2022 04:30:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349335AbiBUJVR (ORCPT ); Mon, 21 Feb 2022 04:21:17 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E2EF17A9F; Mon, 21 Feb 2022 01:08:09 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 17343CE0E77; Mon, 21 Feb 2022 09:08:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BE57C340E9; Mon, 21 Feb 2022 09:08:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434486; bh=qpKXmq3SY6mhExkKTzKyH2WV4QpU0WkZoSqvrwQR5fc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b5YCGOQ+KxlegLxNmq42jr2uhpSynYrztMjgzjsuxxk1HnBBZ8K2cgNOpeRM4LP6M kcOB48M3uct5lBG0WhPXVbJU1bzKoDPMTh1O6wv1Vd4ACxU3arX6msDMQEca1HyrUW H6Zy83uDRjlmfLk9B9rsD3YdK/sYO52eAOdM7b38= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, yang xu , Li Zhijian , Christian Brauner , Shuah Khan , Sasha Levin Subject: [PATCH 5.15 025/196] kselftest: signal all child processes Date: Mon, 21 Feb 2022 09:47:37 +0100 Message-Id: <20220221084931.740963893@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084930.872957717@linuxfoundation.org> References: <20220221084930.872957717@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Li Zhijian [ Upstream commit 92d25637a3a45904292c93f1863c6bbda4e3e38f ] We have some many cases that will create child process as well, such as pidfd_wait. Previously, we will signal/kill the parent process when it is time out, but this signal will not be sent to its child process. In such case, if child process doesn't terminate itself, ksefltest framework will hang forever. Here we group all its child processes so that kill() can signal all of them in timeout. Fixed change log: Shuah Khan Suggested-by: yang xu Signed-off-by: Li Zhijian Acked-by: Christian Brauner Signed-off-by: Shuah Khan Signed-off-by: Sasha Levin --- tools/testing/selftests/kselftest_harness.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index 79a182cfa43ad..78e59620d28de 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -875,7 +875,8 @@ static void __timeout_handler(int sig, siginfo_t *info, void *ucontext) } t->timed_out = true; - kill(t->pid, SIGKILL); + // signal process group + kill(-(t->pid), SIGKILL); } void __wait_for_test(struct __test_metadata *t) @@ -985,6 +986,7 @@ void __run_test(struct __fixture_metadata *f, ksft_print_msg("ERROR SPAWNING TEST CHILD\n"); t->passed = 0; } else if (t->pid == 0) { + setpgrp(); t->fn(t, variant); if (t->skip) _exit(255); -- 2.34.1