Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2811074ybb; Fri, 27 Mar 2020 12:29:47 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv3HZ98QNdVeX2Geat3dLAV9jTFj6KWwetW0Sxe/8tRpArzkiZPm8NoTNSw/sgId5qU127c X-Received: by 2002:aca:f288:: with SMTP id q130mr329599oih.33.1585337386870; Fri, 27 Mar 2020 12:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585337386; cv=none; d=google.com; s=arc-20160816; b=ZoE+5neWFfAWUkK7x1s+we0kqN0kgwFeN0PNcTIGVMdo1RNd5bsFci5nEiYblk7+FJ y832g46l6dQlz+VrHd4J8E6zGkDtOfEbVqtRXKZL5C45zRPGv1zstTMYc/VIyGzCmy3Y f33WA1918s7yxMITzSlEe5Rz+qW6KCA6qnFSvLoVVBe7lXe5oa0BvM63+7pyVzS8iEmr +0xH51xkt/8r8SXQLK0HRdy5hh4sn9oUgHLcL0uGgQtwqH2DP7skeNdOCV5zzDYWGc+f VmfYRnV5vqK4e0UpscAUULZ7m9lN+MwTr6Y1ykerSqsVNJGJZsCXTMllLFQwm1Nc5OU3 eATg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=ciBC3j8wG4a8pHJA61Krk7wdzxQIPFblhY8Mnmnqr/E=; b=ppeYDeCmXj0hZNuuxjtfMjZU2Mq/XXfw6Nl91yPzRSA6fIQly6tO002Bob5NjlA0We hwgBvVeTu/dE1P1MEUbXcF+7yctCDIDTHeoxnBUXqS9gBOcv8BY2oRk9d3rIKoS4Xtf4 7+oITjCI8XnkRAHoXD4RHLlG3roghBdpCIYAy6BOlZzHNIlJYjtp5EiWTkGszOOv8kt0 ykwFZeZqfsAooDIbco0b/4G8TipNBIn10cIHsyqLWTBph8gbcQGsAL4cC9AfAd3B8yLX EfiWghaXTq4VCXl74ql1fwepi0kGosEIQGHyn0zi+TcT8/6AutXyKioLfPYhkZ5o7gOs /ObA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dZbWG7+W; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a18si1388640otq.286.2020.03.27.12.29.33; Fri, 27 Mar 2020 12:29:46 -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; dkim=pass header.i=@chromium.org header.s=google header.b=dZbWG7+W; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727733AbgC0T2L (ORCPT + 99 others); Fri, 27 Mar 2020 15:28:11 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:46982 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727585AbgC0T2J (ORCPT ); Fri, 27 Mar 2020 15:28:09 -0400 Received: by mail-pf1-f196.google.com with SMTP id q3so4941726pff.13 for ; Fri, 27 Mar 2020 12:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ciBC3j8wG4a8pHJA61Krk7wdzxQIPFblhY8Mnmnqr/E=; b=dZbWG7+WmyxKjt8o1CFjmawcgYb9EEMCzsYlcILxxPtiGer6uV+HnUYpVcY1RNBFRG RjwL4s2vQk6bvP8QSj2WiIANCPx4nfL86AVwKtE/T3vgBWCwO+W6gCzZsM50wBfPNP02 pVt3JhCwHQK0kEFTi5SLljHXMhHno/WK55SKM= 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:references :mime-version:content-disposition:in-reply-to; bh=ciBC3j8wG4a8pHJA61Krk7wdzxQIPFblhY8Mnmnqr/E=; b=dDt4NI7sISlnE2A1mAIGodpaudXqEObKVyMN3AAXjGDOt8HLzKyXgra24ycXvD8gDN LgqpKOlySLCWfbSTrToPQiQDZmfkIztIkyrlhBxv59GYlyymDdnMMcNw2wUhLJo5SH4h XsyVpjZAvf5NCUzZd+5tM9hydk4wk9BWNxegd+suXnNqjIXRL0+GXZI3oF4sNM0d00tP VeIAgu5yBIhKVhhpCWhYNkQ7Mm+s8cDXVJZ39MTkcqrrxTjRQxi75CHuC1f1I/W+l31s O6sNp6FNw/2fGL2lQPNroKk2c6LLhH5ROHGkOrjlrLlFZTe29kJRJgOrOGk52nrP+fv0 wVSw== X-Gm-Message-State: ANhLgQ16MVWNy8OvTZtQ5kuvCfdrjJB256d976J8tieTW0scDLCYY9NM FFCzOD8ElX5j90sOkwbgfD5btg== X-Received: by 2002:aa7:9a01:: with SMTP id w1mr759393pfj.256.1585337286979; Fri, 27 Mar 2020 12:28:06 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u21sm4342053pjy.8.2020.03.27.12.28.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Mar 2020 12:28:06 -0700 (PDT) Date: Fri, 27 Mar 2020 12:28:05 -0700 From: Kees Cook To: Andrea Righi Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] kselftest/runner: avoid using timeout when timeout is disabled Message-ID: <202003271208.0D9A3A48CC@keescook> References: <20200327093620.GB1223497@xps-13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200327093620.GB1223497@xps-13> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 27, 2020 at 10:36:20AM +0100, Andrea Righi wrote: > Avoid using /usr/bin/timeout unnecessarily if timeout is set to 0 > (disabled) in the "settings" file for a specific test. That seems to be a reasonable optimization, sure. > NOTE: without this change (and adding timeout=0 in the corresponding > settings file - tools/testing/selftests/seccomp/settings) the > seccomp_bpf selftest is always failing with a timeout event during the > syscall_restart step. This, however, is worrisome. I think there is something else wrong here. I will investigate why the output of seccomp_bpf is weird when running under the runner scripts. Hmmm. The output looks corrupted... -Kees > 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..2cd3c8def0f6 100644 > --- a/tools/testing/selftests/kselftest/runner.sh > +++ b/tools/testing/selftests/kselftest/runner.sh > @@ -32,7 +32,7 @@ tap_prefix() > tap_timeout() > { > # Make sure tests will time out if utility is available. > - if [ -x /usr/bin/timeout ] ; then > + if [ -x /usr/bin/timeout ] && [ $kselftest_timeout -gt 0 ] ; then > /usr/bin/timeout "$kselftest_timeout" "$1" > else > "$1" > -- > 2.25.1 > -- Kees Cook