From patchwork Mon Aug 31 15:59:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1354412 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BgFK062QKz9sRK for ; Tue, 1 Sep 2020 02:00:04 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 228043C554A for ; Mon, 31 Aug 2020 18:00:02 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id 0D65D3C2218 for ; Mon, 31 Aug 2020 17:59:59 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 9B7CC600648 for ; Mon, 31 Aug 2020 17:59:59 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 636DBB5D2; Mon, 31 Aug 2020 15:59:58 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 31 Aug 2020 17:59:53 +0200 Message-Id: <20200831155953.10899-1-pvorel@suse.cz> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH 1/1] ima_keys.sh: Fix umount on tmpfs X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mimi Zohar , Lakshmi Ramasubramanian Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" write policy.txt always to $TST_TMPDIR otherwise tst_umount will fail on /tmp being tmpfs, for which we mount loop device and cd into it: umount: /tmp/LTP_ima_keys.hPVaEbz34L/mntpoint: target is busy. ima_keys 1 TINFO: umount(/dev/loop0) failed, try 1 ... ima_keys 1 TINFO: Likely gvfsd-trash is probing newly mounted fs, kill it to speed up tests. umount: /tmp/LTP_ima_keys.hPVaEbz34L/mntpoint: target is busy. ... rm: cannot remove '/tmp/LTP_ima_keys.cNyaxGHAQI/mntpoint': Device or resource busy Fixes: a277498c0 ("IMA/ima_keys.sh: Enhance policy checks") Signed-off-by: Petr Vorel --- Hi, sorry for keeping regressions. It looks like only ima_keys.sh is affected, but maybe I'm wrong. Tested on tmpfs and btrfs. Kind regards, Petr testcases/kernel/security/integrity/ima/tests/ima_keys.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/security/integrity/ima/tests/ima_keys.sh b/testcases/kernel/security/integrity/ima/tests/ima_keys.sh index c5a6d2591..c9eef4b68 100755 --- a/testcases/kernel/security/integrity/ima/tests/ima_keys.sh +++ b/testcases/kernel/security/integrity/ima/tests/ima_keys.sh @@ -20,7 +20,7 @@ REQUIRED_POLICY="^measure.*($FUNC_KEYCHECK.*$TEMPLATE_BUF|$TEMPLATE_BUF.*$FUNC_K setup() { - require_ima_policy_content "$REQUIRED_POLICY" '-E' > policy.txt + require_ima_policy_content "$REQUIRED_POLICY" '-E' > $TST_TMPDIR/policy.txt } cleanup() @@ -32,7 +32,7 @@ check_keys_policy() { local pattern="$1" - if ! grep -E "$pattern" policy.txt; then + if ! grep -E "$pattern" $TST_TMPDIR/policy.txt; then tst_res TCONF "IMA policy must specify $pattern, $FUNC_KEYCHECK, $TEMPLATE_BUF" return 1 fi