From patchwork Fri Apr 10 10:55:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Righi X-Patchwork-Id: 1269015 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48zFKb6JS6z9sSx; Fri, 10 Apr 2020 20:55:31 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1jMrJo-0001cv-Bq; Fri, 10 Apr 2020 10:55:28 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jMrJm-0001bv-7M for kernel-team@lists.ubuntu.com; Fri, 10 Apr 2020 10:55:26 +0000 Received: from mail-wm1-f71.google.com ([209.85.128.71]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jMrJl-0006Ie-Vk for kernel-team@lists.ubuntu.com; Fri, 10 Apr 2020 10:55:26 +0000 Received: by mail-wm1-f71.google.com with SMTP id n127so514600wme.4 for ; Fri, 10 Apr 2020 03:55:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GH/G5CWkbNLrwuDeCkIzdzaB96S5uVzfyCCrwajf4GA=; b=RO502/trE1CW0c51r/kPaO/MXmgVuFN1zuzKROp5dFIXwJypEw9cnFjrnWYy2YJZJV Nub0xbsQ/ojqVkG4sf8AnNfS2U9AuqN6uyF2tEz7fjyB8kFJM6x2g0rzNizzPGVOoOmn Ilt27uz2Bpj3PgxDbZHEZQeLBbukVVzyZ7SqHbtXm5x3jqOq3CEdHsDlyCLXgwknyd4u Tj+IzZIltWfOHMhtFLfQ0Uewx2udHdQcLxmmszvAJzpt9oXBDEMX76A3GYNX4bNw6Z4B znwJvFY5CO8sgikqSMkOutdyNkUQ2fxC6NlTdLVebfrMW1C2K3as+/2lyTaT0AjUgRb/ KzGA== X-Gm-Message-State: AGi0PuZVCt2Wda7RCBhDq63LJXoWq1G2yZSObZbcgecl3tu6PYN7+29G zjV9pvsjDNILd7MM4ouKIufbqNT7dntMDp8iwaQi7Ncz5Q+h6CmSU5MsqMOUNDbIilwxoUv/kMH LQxn3yKq+gYX3Ae/4VZqEBN4odHt8V2jiPu/tc/A8rQ== X-Received: by 2002:adf:fc4f:: with SMTP id e15mr4062676wrs.415.1586516125440; Fri, 10 Apr 2020 03:55:25 -0700 (PDT) X-Google-Smtp-Source: APiQypKymtWnuJpwhaTC9gY84+23OO5Y9o4tJkDYsnvTXdnHx7C83QzOHGfYAbVgQar36p7GNWtbgg== X-Received: by 2002:adf:fc4f:: with SMTP id e15mr4062660wrs.415.1586516125193; Fri, 10 Apr 2020 03:55:25 -0700 (PDT) Received: from xps-13.homenet.telecomitalia.it (host123-127-dynamic.36-79-r.retail.telecomitalia.it. [79.36.127.123]) by smtp.gmail.com with ESMTPSA id j5sm2533787wrm.76.2020.04.10.03.55.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 03:55:24 -0700 (PDT) From: Andrea Righi To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/2] [E] UBUNTU: SAUCE: kselftest/runner: allow to properly deliver signals to tests Date: Fri, 10 Apr 2020 12:55:18 +0200 Message-Id: <20200410105518.521722-3-andrea.righi@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200410105518.521722-1-andrea.righi@canonical.com> References: <20200410105518.521722-1-andrea.righi@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" BugLink: https://bugs.launchpad.net/bugs/1872047 While running seccomp_bpf, kill_after_ptrace() gets stuck if we run it via /usr/bin/timeout (that is the default), until the timeout expires. This is because /usr/bin/timeout is preventing to properly deliver signals to ptrace'd children (SIGSYS in this case). This problem can be easily reproduced by running: $ sudo make TARGETS=seccomp kselftest ... # [ RUN ] TRACE_syscall.skip_a# not ok 1 selftests: seccomp: seccomp_bpf # TIMEOUT The test is hanging at this point until the timeout expires and then it reports the timeout error. Prevent this problem by passing --foreground to /usr/bin/timeout, allowing to properly deliver signals to children processes. Signed-off-by: Andrea Righi --- tools/testing/selftests/kselftest/runner.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/selftests/kselftest/runner.sh index 2cd3c8def0f6..c348ab34662d 100644 --- a/tools/testing/selftests/kselftest/runner.sh +++ b/tools/testing/selftests/kselftest/runner.sh @@ -33,7 +33,7 @@ tap_timeout() { # Make sure tests will time out if utility is available. if [ -x /usr/bin/timeout ] && [ $kselftest_timeout -gt 0 ] ; then - /usr/bin/timeout "$kselftest_timeout" "$1" + /usr/bin/timeout --foreground "$kselftest_timeout" "$1" else "$1" fi