From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78501606A322 for ; Thu, 3 Dec 2026 05:03:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.u-boot-project.org header.i=@lists.u-boot-project.org header.a=rsa-sha256 header.s=default header.b=aLv9W/Bz; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=R4aX5YFF Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E3457856DF; Thu, 3 Dec 2026 05:03:49 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id cGl4NMKr0DAt; Thu, 3 Dec 2026 05:03:49 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org 075F4855D8 Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip=140.211.166.142 ARC-Seal: i=1; d=osuosl.org; s=arc; a=rsa-sha256; cv=none; t=1796274229; b=qEk3FASEezo8dDlxBmXBgpCk8LJWRcdpGLm81a62CIKv05muNO2VEqyT4XJCr99ULNtb cJa6Wcg5ORQTkNp1tapKKZqGJxWFf7u7owR6p7Nj8qCDIYfnmqUfJ8JH2GAnNyLgLh9po KAJbGPfLLavcPOv/l1p3zCJy9jppmT0YnmJE8Tud5UFyyZ1l3q7RembJ8CwFFx4UYFZdq L32XW+sZdQx220Aug6BV0RqeQEVKaP5c4xkuHE1m5c7z/QfvmIivM4lh2NYdPCNIIUTXO TtWd9WBxRrgoj5fqrO4eGbfL9Yc1Zyw06cbFoDXGOLo3bLHj3+chBL4cYEi/KFd4UFA== ARC-Message-Signature: i=1; d=osuosl.org; s=arc; a=rsa-sha256; c=relaxed/relaxed; t=1796274229; h=X-Comment:DKIM-Signature:X-Original-To:Delivered-To:Received: Received:X-Virus-Scanned:X-Spam-Flag:X-Spam-Score:X-Spam-Level: X-Spam-Status:Received:ARC-Filter:Received-SPF:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Gm-Message-State:X-Received: Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:To: Cc:Content-Type:X-Mailman-Approved-At:X-BeenThere:X-Mailman-Version: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:Errors-To; bh=DaVU6c62BOzpC432rz3G31fNBf34Sp+xqFmgZ901ld8=; b=fJVSE9lOIO6KolDoLnTOEPXdRNx/QB57MxEdouIyrYvCBCD49tLrJcWzrLKjCUgaYuF1 jBLLKQtrEuqqMBlKwpt2K0qJB+aYrb4B5XVRZeHZVZuudnKvoGoEmpdoQB8wzRwptKtxN K6LGeINW4hvj41ixiuW86dPDZvepdPt3iTO1U2rw6VtfFgSkYY92GtwcWVhl2MP/EtznL BHG1+ah5+HwzYkq4V8ftPRIwO0mOnpDbHDNlbdnuYz6s7jShjG8R3wxb8ohOrW/jeVh7E RRyzZ3q5SAj1vghvW1ZsbHsoq4f9jtxdy+Mqon8LqvbNSdNPY8WzIHY8COUeand6vQA== ARC-Authentication-Results: i=1; smtp1.osuosl.org; dmarc=pass header.from=google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=R4aX5YFF; arc=none smtp.remote-ip=140.211.166.142 X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org; s=default; t=1796274229; bh=DaVU6c62BOzpC432rz3G31fNBf34Sp+xqFmgZ901ld8=; h=Date:In-Reply-To:References:Subject:From:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aLv9W/BzidCZ1rK2KLejEfrKunfmaYYU7yy4pKjjkXHnpl1S5bbqFVbS/9YB8JlsW b0JnmmMqbQwh9tYUNkYgSbXGu1Akm7pzTHQ6W3jNaWSqkZe8WxXgHGwptlK4G8Eery ryh9PW2pNShrPYS108qX2IXujja5T9reglDVc94BHl1uGGJs8YQuwXJPJYG9PbCN2F xRVC7b7rbY7pL1Xd2d7td7lzwMbWbYWsSozYPmRC9WFUFEKu1LA3n6zIQrRvZZ4OF9 unYyH4fKtAD9cEcl4SelwhFv3+FwoKIL/DTRy0eqB46CNwZlWEP1dnN7X9e+SmP7R/ xcq8quh+xN0Dg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp1.osuosl.org (Postfix) with ESMTP id 075F4855D8; Thu, 3 Dec 2026 05:03:49 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists1.osuosl.org (Postfix) with ESMTP id D73B9158 for ; Thu, 3 Dec 2026 02:22:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id BD17C87184 for ; Thu, 3 Dec 2026 02:22:04 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id fjBIP2ijpHYm for ; Thu, 3 Dec 2026 02:22:03 +0000 (UTC) ARC-Filter: OpenARC Filter v1.3.2 smtp1.osuosl.org 6CDFB87187 Authentication-Results: smtp1.osuosl.org; arc=none smtp.remote-ip="2607:f8b0:4864:20::1248" Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::1248; helo=mail-dl1-x1248.google.com; envelope-from=3r9iqawgkbo4vz634wa4y66y3w.u64c-t66b30aba.c-t66b-7961wub.69y@flex--dholmesm.bounces.google.com; receiver= Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=R4aX5YFF Received: from mail-dl1-x1248.google.com (mail-dl1-x1248.google.com [IPv6:2607:f8b0:4864:20::1248]) by smtp1.osuosl.org (Postfix) with ESMTPS id 6CDFB87187 for ; Thu, 3 Dec 2026 02:22:02 +0000 (UTC) Received: by mail-dl1-x1248.google.com with SMTP id a92af1059eb24-1b592e9841bso15571189c88.1 for ; Wed, 02 Dec 2026 18:22:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796264522; x=1796869322; darn=lists.u-boot-project.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=DaVU6c62BOzpC432rz3G31fNBf34Sp+xqFmgZ901ld8=; b=R4aX5YFFX4g/dSqwPsS35A3KeFKpzvC0gbZjjwb/Sx6+FN9OI7GGjrQmqj6v+Og6iM 3wxYDui/gq4HPVmA22EjFXbtq9q1KGopSXAEDWPPiuc4LbLVmRFbKovRfB8/391mrTXz rdzDLF6AsNG0iETxVlR3mtgT9497IpU4dSroCb22zt0hWcWC12UN1KBJrGub6k9RfSxk oUM0HezaUPP4gRUViUuHzI8pFkKLR7m8s0+dYpVNeRHInK0GcMWkAbhhtopei32FsMRY OjtZkWc3pHDUw0cDey3lVvcePTrpAlNB3HXrXrMPz9N8NMbXFUMw444AC14sZw+qOCaF SR/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796264522; x=1796869322; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=DaVU6c62BOzpC432rz3G31fNBf34Sp+xqFmgZ901ld8=; b=aPFUPZgkwQDyn1COreImSvgVE2+I/QWcNpG6Erj0IpUWYIL8WCvPcdSBgriKQdXti5 DzDq8okIhgsL5j7ZHFHLey2od9O0J9j0kHF5v57UYR8hhDO5I19vBaZuDtNjHIVS67Ks azo3nJy05mpg9Ev8LOfWaPohawYwdMNyjSATsW3MdkzMppbhxeeP+PiA65+xnbAkAdRs j1gCSANwoACZLld8mKFqwgCExP1bjBKDR0tZYGM+eFa36Vnixc3m2nLA2lxx6kDzl075 ypTSwFOejTMv480GzkzfPcL8SFAMHs6gt/WeKu8zQs2+mrgb78YztixWNUKya1+Pplrd WmOg== X-Gm-Message-State: APuU4Z/G+Rv35oW7ezkIMxkVpOKBG237vJ8k5xzESlMMdh3ZI8Ah1eEp +KvZMxS2nr8dPlDMuMw2MNWnYUtYdD6yA/mRw+InV41ACzZPSZH7fe48w6qKvijnKMm2sfCTAVj wRZBodfGvW6uWpH92oWcZjF+GSjkqD9tKlM9CWTJEbOQxcsut98yx9k3AJIGJF90B8GKNcA1iZt 6crg/MrTzMPYSFNAtZuH8c4vAad0qGG5F14NtPVaenwOQEQeFXhf0Lx02XohI= X-Received: from dlbpv6.prod.google.com ([2002:a05:7023:906:b0:195:d59a:94bc]) (user=dholmesm job=prod-delivery.src-stubby-dispatcher) by 2002:a05:701b:240f:b0:1b5:c305:2f6d with SMTP id a92af1059eb24-1b5c3053068mr5262789c88.7.1796264519988; Wed, 02 Dec 2026 18:21:59 -0800 (PST) Date: Thu, 03 Dec 2026 02:20:40 GMT In-Reply-To: <20261203022028.01-00-dholmesm@google.com> X-Archived-By: Mime-Version: 1.0 References: <20261203022028.01-00-dholmesm@google.com> Message-ID: <20261203022028.01-02-dholmesm@google.com> Subject: [PATCH 2/2] tpm: tpm2_tis_core: Reject 0xff TPM_ACCESS and invalid DID/VID From: Dan Holmes-Mitra To: u-boot@lists.u-boot-project.org Cc: Ilias Apalodimas , Tom Rini Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Thu, 03 Dec 2026 05:03:38 +0000 X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-23.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_PASS,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 When an MMIO TIS TPM is absent, unpopulated reads return 0xff, which has bit 7 (TPM_ACCESS_VALID) set and caused tpm_tis_wait_init() to falsely report success. Requiring status != 0xff in tpm_tis_wait_init() avoids false positives on floating MMIO buses while still polling cold-boot SPI TPMs until ready. Also reject all-ones or all-zeroes TPM_DID_VID readings in tpm_tis_init() with -ENODEV after releasing the locality. Signed-off-by: Dan Holmes-Mitra --- drivers/tpm/tpm2_tis_core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/tpm/tpm2_tis_core.c b/drivers/tpm/tpm2_tis_core.c index 1fdf8cfa31..f37ed0cdee 100644 --- a/drivers/tpm/tpm2_tis_core.c +++ b/drivers/tpm/tpm2_tis_core.c @@ -434,7 +434,7 @@ static int tpm_tis_wait_init(struct udevice *dev, int loc) if (ret) break; - if (status & TPM_ACCESS_VALID) + if (status != 0xff && (status & TPM_ACCESS_VALID)) return 0; } while (get_timer(start) < stop); @@ -477,6 +477,10 @@ int tpm_tis_init(struct udevice *dev) phy_ops->read_bytes(dev, TPM_RID(chip->locality), 1, &chip->rid); phy_ops->read32(dev, TPM_DID_VID(chip->locality), &chip->vend_dev); + if (chip->vend_dev == 0xffffffffU || chip->vend_dev == 0x00000000U) { + tpm_tis_release_locality(dev, chip->locality); + return -ENODEV; + } return tpm_tis_release_locality(dev, chip->locality); } -- 2.56.1.911.g883d8bcb20-goog