Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp433161ybb; Fri, 10 Apr 2020 03:05:37 -0700 (PDT) X-Google-Smtp-Source: APiQypI89yYrV4qO87mKgHEmfQNQ75sNwrmw2elobydqlT1iOzvW5pIwLoOVBC7wllah9Wf+pPxT X-Received: by 2002:ac8:444d:: with SMTP id m13mr3542458qtn.91.1586513137362; Fri, 10 Apr 2020 03:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586513137; cv=none; d=google.com; s=arc-20160816; b=p6U1VG5qaXGfNr26+tsb70nflcN3d2nCWSIBBfSJ0Na6tGKcMpZi5BTKU24/W6Esk9 t2a0gKTEFUBgFx1DaihlLJs8ieLF7uIARxdC9xHFIwx3z3eqqx/VmFKhw/28wUaLazpJ Rg6uZ28syp5dyRod38diHDYCCX0M15n/UuJZqmgPQQO9X1QtM6ZRBxH11lyUFZ+FxvPH XTacKKmt/7e480biUXwWWCoSozV4N8rdj5AuQm0OH0Hz6jWd5BsIjx3EbO8AGFn+a6Rq EsON2cAAiUOVMaUdQyGEZxXtsTz+Z+Je+qRK9OHPVg5ICxyK1yf7yXzUQnH2nF8o4FJW qgFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:cc:to:from:date; bh=Z3P5ra7nIgSjErTUHVmG2gVsvgQADuW5sfZ4PtTp618=; b=He/TvNVPi+ir5yzqpDNAKIQQUS4SYmx3teqSHS8E8wS8+fD48YAQjtXdR+guZwkkl4 Gh3lPENcHoXLEupgK06qwujV+Np9yNFgLSvCBvjyh0udhWCoVMo2wDuFgUpBpFsPf1Vs 9HkbmJw4ij+GI8MG4e9P1Wk5OA+odZhFZgK48GteTjbixPWar3EmFnK7HQwcMQg4El5J EXM7He7Qye1NCUwr3KMh5+AbNve5aD1I93ZJy0e8FU4ylTAckJHHyWzZkgSanKduNc63 JGoKVYIT/Ggafm4z9/dtjmRmISvMX02r1EXF5v5hDRUB25FcKRETZpPp585KeaaOwBgs HxEQ== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f40si862082qta.336.2020.04.10.03.05.20; Fri, 10 Apr 2020 03:05:37 -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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725993AbgDJKDD (ORCPT + 99 others); Fri, 10 Apr 2020 06:03:03 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:60105 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbgDJKDD (ORCPT ); Fri, 10 Apr 2020 06:03:03 -0400 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 1jMqV4-0003SV-Aq for linux-kernel@vger.kernel.org; Fri, 10 Apr 2020 10:03:02 +0000 Received: by mail-wm1-f71.google.com with SMTP id f8so640841wmh.4 for ; Fri, 10 Apr 2020 03:03:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=Z3P5ra7nIgSjErTUHVmG2gVsvgQADuW5sfZ4PtTp618=; b=GxWkhB7Wy3Igiw72UkP/nkR3jq7za2kszsrQbmj7XiWYv+0Ks8cQrhS1ovGSbs9iq8 NQAuP8vwlPzU2OXvBNH6qihzfUc0msP+FxRulgWSwTfVOvKMfwvkdYCmZx4OzZlWbyjc 7aDwOlk/l1XtsE6UE1b+WoNQGegT3ccHqroiKLwfMln6EmJjqjmttuTkpmh9ss7n3Yck rZyBn1nUS6Aw+g9a4W239JaYFZhl7yC24HWnGJcRYE9v3AKu66G/kkESdBmZ4aDnVOcN KhztPdwtKSizOYkXy7mn3gwdzqgcX5GwH5mEwpwUNwF8a2GDYjk9+fymcnX9xqqcuOZC GsyA== X-Gm-Message-State: AGi0PubGlsb8qfDZoVoJcYaWDbf18FfMomsW8ZkqOJyMhaApca+3hYFZ XjRs4uPJ3N4HYS9lv3YNFL9uDSWYBnZlf/PL6ELuWO9bH6iIT4lNbJNSJPviDYABVnd07KreDt0 mjC2DlM4tq3j2JAkfJHdH2U9XSKC6bZ60tnKeDltmRQ== X-Received: by 2002:a1c:6787:: with SMTP id b129mr4574991wmc.165.1586512981979; Fri, 10 Apr 2020 03:03:01 -0700 (PDT) X-Received: by 2002:a1c:6787:: with SMTP id b129mr4574957wmc.165.1586512981640; Fri, 10 Apr 2020 03:03:01 -0700 (PDT) Received: from localhost (host123-127-dynamic.36-79-r.retail.telecomitalia.it. [79.36.127.123]) by smtp.gmail.com with ESMTPSA id k84sm2243972wmk.2.2020.04.10.03.03.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Apr 2020 03:03:01 -0700 (PDT) Date: Fri, 10 Apr 2020 12:02:59 +0200 From: Andrea Righi To: Shuah Khan Cc: Kees Cook , Andy Lutomirski , Will Drewry , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] kselftest/runner: allow to properly deliver signals to tests Message-ID: <20200410100259.GA457752@xps-13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 e84d901f8567..676b3a8b114d 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 ] ; then - /usr/bin/timeout "$kselftest_timeout" "$1" + /usr/bin/timeout --foreground "$kselftest_timeout" "$1" else "$1" fi -- 2.25.1