Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2074516pxj; Sat, 19 Jun 2021 02:07:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQwW4lNsH77JpdZn/PxKss32csfgztm0bPM1IA9pZ73v4DNi6dAI6vFa+xMfluSutuNZOB X-Received: by 2002:a5e:930d:: with SMTP id k13mr11452462iom.61.1624093631121; Sat, 19 Jun 2021 02:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624093631; cv=none; d=google.com; s=arc-20160816; b=SJaaiwWlzJIceH0a01PMAZ4rB1qfL/tf0TPfN7NbWzp1jILfAr+CUwxepMIxI2eijY zZIYZC9yWojZoCiIgaw4uVCAziwbpHu96vD1vNqwzAWqFOXIVZ7sSHm6VrrghYYcNeui ONgkXtmnUyahBub70fwY5KqxG1LsDDin38O5MMwG17H6DCPPePEeUAzHrkD7S5Gd2Y3Q pzYgjmGyc/XCNJkCRpRQz5r/Hd39UeqcQrtiLXG73P6f/e5Bqvny9hKrTWWR61pysNxR FdRF0TGJPGChHnfNr5EiANdo9W5WD/0ZmVIZu9E+qW26MkbCUjCm/jNPcF5fqAQQiAgB l11A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=HbU9xu9H0S4Zp4/r0rFgl+fi72yv0penQhl6VWi1XNU=; b=dfv47yhr2ZGWmxuW19pBx6ph7deq55swj8gZZ0cdCmj02xTIjaD37jLjQNnrfCU51z ScYUH3W6AajAGW9gwh91PjDFX6WIGSWQ86soCk6VfO759/UKRVF9f1Dlm0nzEZZUCc2x qMkHkk31RHcHg3NOFwz//XBuOGUIAYaiAhkucIqa4n1Qjzt/DUg1x4euUu9Xj6HfVO+b /VmbYQvktccNIX6nJQY9WYPVDQf9K+cX2zbMpaDY3Z7l/Hucumhr3/+Ry3+4wPMv5Fxo 3Dlx4bf5Mf5IPT9aLNj67wm7AgE5lWIEVRBsq4ttPcqtg+NaKwy0jT52N9sTPEqUMKsW fVWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=k93wQuuB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id m1si4623267ilj.142.2021.06.19.02.06.58; Sat, 19 Jun 2021 02:07:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=k93wQuuB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S235590AbhFSDAs (ORCPT + 99 others); Fri, 18 Jun 2021 23:00:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235592AbhFSDAs (ORCPT ); Fri, 18 Jun 2021 23:00:48 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 464D3C061760 for ; Fri, 18 Jun 2021 19:58:37 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id t9so9381774pgn.4 for ; Fri, 18 Jun 2021 19:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HbU9xu9H0S4Zp4/r0rFgl+fi72yv0penQhl6VWi1XNU=; b=k93wQuuBxI/sMtxZrxrmp9tJ2kGwsdy4oLt5kcRif7GvZRi3rblvIkADOO+jtur7ph IfUajvTk9AGEzP30fz+vdlULuEk9gOdEBrQPYhhZtbnDAnkH2jNV6/rrG3HMgqpHqG8C +XVb7shFVf5/zHiMLtCYHAkosTvrZggLPRkYk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HbU9xu9H0S4Zp4/r0rFgl+fi72yv0penQhl6VWi1XNU=; b=bCYdfrdcoT9zGNQbUg6ttZyFl71PtRYkbNUG18pnJSJjFFR3nR7vgNu5sUBbYQpjM6 7oUo5IZp/7yTbxKXRatXuUWkxTKFYcnGYwB19qAduBkaXhfvsrE/GIlIY22yJMWl/5bz BbWPFrqkJEVU8ozqqY0+NFmWSI3BSPrTXMVn0Bb1gwMskb6DgJSCJt+pMKmSg2jzo/2n 2zTHbhS1o4Bq6GP9bRYYOZ9N+qnKQXOkHUtq/XuWh73KtWvPHww2fqMdBN/7b4cMlTIK cSYGBfme+72E8Ipm3LZ+DuvY32ZDL75Su5KAYxWd/CdGJpCV/ccEyFqM0goE1qie6S0h oKzw== X-Gm-Message-State: AOAM530w/ePQ4OLjWwbFao6XOPUN6XENlln9QvUJ5yrKxZAFAESLNIc4 OMbnfw0Tv1PGm5YqUs8MZF+YQA== X-Received: by 2002:a63:5a4b:: with SMTP id k11mr12899821pgm.289.1624071516653; Fri, 18 Jun 2021 19:58:36 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i6sm11282648pgg.50.2021.06.18.19.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 19:58:36 -0700 (PDT) From: Kees Cook To: Shuah Khan Cc: Kees Cook , Guillaume Tucker , stable@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] selftests/lkdtm: Use /bin/sh not $SHELL Date: Fri, 18 Jun 2021 19:58:34 -0700 Message-Id: <20210619025834.2505201-1-keescook@chromium.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Patch-Hashes: v=1; h=sha256; g=abaacaeb40d19df3f0123ca96cc8242ca6e3268c; i=lfnT3xbl3M4bSoo3fY1JvS2JIxARVoZVIzxV1pBNVzw=; m=cu0dPMI36VjT72aoOxoHuPRqB3LHPSjswDa6MCN+MZc=; p=qUkO+dFY9Yp/ywFt5TFJleapjrvJYshagfpYradjlMA= X-Patch-Sig: m=pgp; i=keescook@chromium.org; s=0x0x8972F4DFDC6DC026; b=iQIzBAABCgAdFiEEpcP2jyKd1g9yPm4TiXL039xtwCYFAmDNXVkACgkQiXL039xtwCbq4g//dCV QHTL1nxrCKGLO65q5B3wUQ4hi8m7xJAECFT7za5dDw2MvlhH6RTZCotulF0nW7g+78Wl1GqDMJh54 9tQhmyyI/WZH82ab6ck/eTB/TZaWQXLhxnp5h9Y/yv+lpKM26fr6OQzeORwb7FbRMKx9Szxw4MVkg 5SzE0iNSFV6pnMHZZCGuGpPO+CIfLaynmvLlYOhUboaWkCFb3tzmVF5HR557XqEeTWnJitzKK9T16 Soc/6JvKuLiwAhHeW1UgU9fyb5Vj2wnjGQAoP7olpYU0Ry7aRBeMEajhSarHaLOq397zW+SqeNBVU SE3jQLpfNbGykVNd2DeKDdrZBYFLwJY5Z8nc5iCTjR0t+unvyYzI+EGNlhR6tKiuVZbRMa01sOz/U rYgEp0W43irDWvlRDUe+Gx8teTo3eMDk6DkX6I34j9UCqnJcRT65+uXWLqsakdWDxAXr1pmvoh3M8 0RGcNnHogNPddCI6aO5O7BwWFtOmLRygepsKk9afxTxgKeOKhpIDFaPHuNuXidfzqehuYg3NqCBhR GhWXI2/xOlXMAYmIIXzN0RDTgzxsVLd8EFfJQ2UWGOHUAcXHNgcOdVXlRMYpoaPVPmt8oDLA1qss9 7czBiL8tB4Gp12mRjiKKDcBET7eqsCizJZsgJKhjMVcnHmF4GAOdoeDC6uUGFDjg= Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some environments do not set $SHELL when running tests. There's no need to use $SHELL here anyway, so just replace it with hard-coded path instead. Additionally avoid using bash-isms in the command, so that regular /bin/sh can be used. Suggested-by: Guillaume Tucker Fixes: 46d1a0f03d66 ("selftests/lkdtm: Add tests for LKDTM targets") Cc: stable@vger.kernel.org Signed-off-by: Kees Cook --- tools/testing/selftests/lkdtm/run.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/lkdtm/run.sh b/tools/testing/selftests/lkdtm/run.sh index bb7a1775307b..0f9f22ac004b 100755 --- a/tools/testing/selftests/lkdtm/run.sh +++ b/tools/testing/selftests/lkdtm/run.sh @@ -78,8 +78,9 @@ dmesg > "$DMESG" # Most shells yell about signals and we're expecting the "cat" process # to usually be killed by the kernel. So we have to run it in a sub-shell -# and silence errors. -($SHELL -c 'cat <(echo '"$test"') >'"$TRIGGER" 2>/dev/null) || true +# to avoid terminating this script. Leave stderr alone, just in case +# something _else_ happens. +(/bin/sh -c '(echo '"$test"') | cat >'"$TRIGGER") || true # Record and dump the results dmesg | comm --nocheck-order -13 "$DMESG" - > "$LOG" || true -- 2.25.1