Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp518297ybb; Sat, 28 Mar 2020 04:32:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvlemi4FQ54GH6md6129YIgJxm7iwgj0LEOm2p7KUiFvJyX/P5YppprDofhLUAk7LrtlkF3 X-Received: by 2002:a9d:6b02:: with SMTP id g2mr2421675otp.340.1585395144488; Sat, 28 Mar 2020 04:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585395144; cv=none; d=google.com; s=arc-20160816; b=SudoIy81g1PiKhDQFwzGOmA3kDuM+86br4SkO0rw3+Zw7gQ1wh1+f9XAzAdPeOdNr/ 1Fp6p5wWC6zmRi1YiW3Ovtiv9sylBjVaY/YWWSPMpuhRkbfbZJ66NR2CwuKUOO205Kh0 iI+Ibw7CF7Z9QzmHj1bjf81BH+n+Yj978fwq8AwenAAjJrjQFWI8ZoQV6qSINVKaRETy e1Y+JMdSWtHFjxx5W3zgP7zk8gDumqX9JhS8PyrYi2HVd6AdyhYtwyHvYDJkDS5WS1Ox 3/Z96u5K9iz6Cm6S6iTOolSDbbXCMgll8G+nOQUSbzeJC9qMkGdUQVT1l0uLPM8IhEkI 0E0A== 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; bh=Qqy0+XOT8WqhQrltX5gCRS9oS4phxUfRkeGmoD35Mjs=; b=sI/2AykTWt6ecN2vEC0SgSlpimKCrc8QrG7ObuzwLgtvE1OpsowzrCwQSVaR24p+Fw 33IsO9qjzrYpliP6r22xRaxL+IxUF3jVf2KPQNSdA256VylgXTqYUzu4aTuQCSv8sIsI yQ7oWVUaDblUE9eWEh6N68MSogFkHg9xCiPX5kqJEZtHgcpT6Swxc1xLMdGsnbO3PDRn MqVa2cA6Ky/L0vF6+3fdDus78I1DHPrDAIyMgzbES/k+DlfJ3/+02vAqr1OAxLha4cFG 9cULMZZhteR//9T+l8cMF/k7xYtiblcKuzD/48M4N1KA3uM+KvYPLIO3+WqGN/c5F6QR vDyg== 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 o1si3858114oti.70.2020.03.28.04.32.11; Sat, 28 Mar 2020 04:32:24 -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 S1726269AbgC1Lbv (ORCPT + 99 others); Sat, 28 Mar 2020 07:31:51 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:59312 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725973AbgC1Lbv (ORCPT ); Sat, 28 Mar 2020 07:31:51 -0400 Received: from mail-wr1-f70.google.com ([209.85.221.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jI9gr-0003tF-C4 for linux-kernel@vger.kernel.org; Sat, 28 Mar 2020 11:31:49 +0000 Received: by mail-wr1-f70.google.com with SMTP id f8so6115042wrp.1 for ; Sat, 28 Mar 2020 04:31:49 -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:references :mime-version:content-disposition:in-reply-to; bh=Qqy0+XOT8WqhQrltX5gCRS9oS4phxUfRkeGmoD35Mjs=; b=jzs68STnmZ5Twzhm8RVBNRNkwAlP+1b7Szd8TLYDjERWRb+HL82dMHyLE/HNvAZjYh ytQ2pac8btyATdZdu+gTVaUVm4roEQJS8y1gtNzyW3ohpQTdp7WWMdtGppgTI291Fa8A w5IrJeyh+Cxk0L82lZP/A5PUwcJj3Kmv0hvjDCNrNAeeLadZKnPYcUtZNbgQmtxySuWt vEnaopzxQ4yOwIMi2Pfkx58aXaVcwem8ugxBMphmryiWb0/A+CiElLqOiADUU3pnVpXG rbDHj629Ih9AGDo0KPByilJupE+u0RyegLPKp+1gg3y0Ix4CVV+hhfn1p5dbaSzpKHDm 2mxg== X-Gm-Message-State: ANhLgQ3r1W+kGRyGB9utIPho86QWdBVGJhm21HI4n2tsTAZUDbP3wYXP IP1R29/6xmEThcVa0gQPlZ6VmwagPxd6oFx0fa2AMjEgd6qEReLr5xkFsqh49gZJNDYh4fVJC6Q 9Ux9W1gxl0JTcYBbwuEVrZJBxNSRVxH3wPnfmVqov8Q== X-Received: by 2002:a7b:ce81:: with SMTP id q1mr3551437wmj.156.1585395108831; Sat, 28 Mar 2020 04:31:48 -0700 (PDT) X-Received: by 2002:a7b:ce81:: with SMTP id q1mr3551418wmj.156.1585395108528; Sat, 28 Mar 2020 04:31:48 -0700 (PDT) Received: from localhost ([95.239.127.44]) by smtp.gmail.com with ESMTPSA id o14sm11692573wmh.22.2020.03.28.04.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Mar 2020 04:31:47 -0700 (PDT) Date: Sat, 28 Mar 2020 12:31:45 +0100 From: Andrea Righi To: Kees Cook 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: <20200328113145.GB1371917@xps-13> References: <20200327093620.GB1223497@xps-13> <202003271208.0D9A3A48CC@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202003271208.0D9A3A48CC@keescook> 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 12:28:05PM -0700, Kees Cook wrote: > 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... Running seccomp_bpf directly (without using runner.sh) shows this error: $ sudo ./tools/testing/selftests/seccomp/seccomp_bpf ... seccomp_bpf.c:2839:global.syscall_restart:Expected true (1) == WIFSTOPPED(status) (0) global.syscall_restart: Test terminated by assertion Instead, running it via /usr/bin/timeout (with timeout disabled): $ sudo /usr/bin/timeout 0 ./tools/testing/selftests/seccomp/seccomp_bpf ... [ RUN ] TSYNC.siblings_fail_prctl It gets stuck here forever, basically it's during the execution of syscall_restart(). I'll investigate more later. Thanks, -Andrea