Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1126319ybl; Thu, 12 Dec 2019 10:02:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwiRLRnsvXgVQDpxlbmxkFq4QukrAI+aud8Lz+BmIL5TIRwYGIPmsSipW06zlVqZRfQAB5A X-Received: by 2002:a9d:4d01:: with SMTP id n1mr8937969otf.245.1576173744357; Thu, 12 Dec 2019 10:02:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576173744; cv=none; d=google.com; s=arc-20160816; b=iWzvBCykCFElI6CH1/lJTeKQB4eSflMWdlPZbvYtQkz0zC7EhS9hYlgkQa/V8CXOKI veoJGDeV649uplSh1QWUHkuQUlJcWrd1PNCBwBgwbfC41fJCkZZGHzf2yULWBhJuXtb5 1xUFQIRX5jfooS6ldmWknpkTOqPwYDocqOkVR/RdopiyW3LmT3s4EP1iWWierDEcMj/K QXxq+HArft3RXMhs7dgjRUa7j8rf3tpBdv6yEearprk5DJAr/067mKtDvMB648yrnrNV tunZttyjgyK1hgO5RZsOGEaIhhqkiZa5EIe+Lbqz+yrkzVZ/JjIdfrwZDWp1IjDuQN5Q 5jDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject; bh=+AcBJUa/l+D06TMmfGLeyRfmhWQn9E5xFCVMFia2F0Q=; b=rePK62lPi3mDh79jjgLDVuqVfXzzSEi6ABYW804dbTNcnxBoMZZt9CE7bJUHFpKfBP PnH9F08GGVdIzd0h/k2+1bUsXX9k6bTxtixRJPDOsjG4k4oRieWqwaMN0n8nf1Da4iSw wzFulM1PZdxwZCes2So2fDc8xSlflLZR+S2RhxUp5PBsl2RbhuEtsRab2vxrrJYY0k6C 0N/T6R4dqbOxK4nllqquFKHK1AexGs5+NfRd43MSHdCF3t9prEG3UMfxfl9SvP0U92DH ABWds0ZFgEi++gOzM4U7pSFs7H24xKa9EAHGuv6mBWYSsQTQCm/tiDXoZjVP7vzeNEds SQEQ== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w29si4000132oth.313.2019.12.12.10.02.06; Thu, 12 Dec 2019 10:02:24 -0800 (PST) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730339AbfLLSAr (ORCPT + 99 others); Thu, 12 Dec 2019 13:00:47 -0500 Received: from mga14.intel.com ([192.55.52.115]:9975 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730169AbfLLSAr (ORCPT ); Thu, 12 Dec 2019 13:00:47 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2019 09:48:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,306,1571727600"; d="scan'208";a="414006063" Received: from tstruk-mobl1.jf.intel.com (HELO [127.0.1.1]) ([10.7.196.67]) by fmsmga005.fm.intel.com with ESMTP; 12 Dec 2019 09:48:55 -0800 Subject: [PATCH =v2 3/3] tpm: selftest: cleanup after unseal with wrong auth/policy test From: Tadeusz Struk To: jarkko.sakkinen@linux.intel.com Cc: tadeusz.struk@intel.com, peterz@infradead.org, linux-kernel@vger.kernel.org, jgg@ziepe.ca, mingo@redhat.com, jeffrin@rajagiritech.edu.in, linux-integrity@vger.kernel.org, will@kernel.org, peterhuewe@gmx.de Date: Thu, 12 Dec 2019 09:48:59 -0800 Message-ID: <157617293957.8172.1404790695313599409.stgit@tstruk-mobl1> In-Reply-To: <157617292787.8172.9586296287013438621.stgit@tstruk-mobl1> References: <157617292787.8172.9586296287013438621.stgit@tstruk-mobl1> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unseal with wrong auth or wrong policy test affects DA lockout and eventually causes the tests to fail with: "ProtocolError: TPM_RC_LOCKOUT: rc=0x00000921" when the tests run multiple times. Send tpm clear command after the test to reset the DA counters. Signed-off-by: Tadeusz Struk --- tools/testing/selftests/tpm2/test_smoke.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/tpm2/test_smoke.sh b/tools/testing/selftests/tpm2/test_smoke.sh index cb54ab637ea6..8155c2ea7ccb 100755 --- a/tools/testing/selftests/tpm2/test_smoke.sh +++ b/tools/testing/selftests/tpm2/test_smoke.sh @@ -3,3 +3,8 @@ python -m unittest -v tpm2_tests.SmokeTest python -m unittest -v tpm2_tests.AsyncTest + +CLEAR_CMD=$(which tpm2_clear) +if [ -n $CLEAR_CMD ]; then + tpm2_clear -T device +fi