From patchwork Thu Mar 9 09:00:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ivanhu X-Patchwork-Id: 1754549 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=uTard2+O; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PXNSq58xDz2469 for ; Thu, 9 Mar 2023 20:00:59 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1paC8s-0005vX-9z; Thu, 09 Mar 2023 09:00:54 +0000 Received: from smtp-relay-canonical-1.internal ([10.131.114.174] helo=smtp-relay-canonical-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1paC8r-0005vH-N4 for fwts-devel@lists.ubuntu.com; Thu, 09 Mar 2023 09:00:53 +0000 Received: from canonical.com (unknown [106.104.136.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 312D03FFF7 for ; Thu, 9 Mar 2023 09:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1678352453; bh=fNoGsW3z7c4BhVGEkbM3IBaLLQfBqhjxulYc1rv7GHw=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uTard2+OgKsXVkcB1LAOewRLh68xBYaw+IwpEniJL24Yde4sUum5bqsCXWGLFb9pT ga9jitii1w1iMF+yXi/iQU1EVP4ShGCrgMkg8yBEKfjl6B/u+T/46fg0eV4vnhamJa vok6yrIyyc0ivGwVFKmAV+9J7yagUpp4aeALMZNRjx42lbpzSTj4YkzMni93GsBeCq Em2YroqSuaUOts6uuG/Fbp45345iW9K33wbW2qy6qaKTYeMqc6xEqrj/4N5GK4QiSe NBCW5Q2NDaaoofJeKYeuLLMpoVFH4tbCF1cQU7BM2JiUjPr3NaANGctrrW8RvPV3vn MwCMOdALMc0WA== From: Ivan Hu To: fwts-devel@lists.ubuntu.com Subject: [PATCH 06/10] dmicheck: add some bit 0 reserved checks for type 17 Date: Thu, 9 Mar 2023 17:00:14 +0800 Message-Id: <20230309090018.32029-6-ivan.hu@canonical.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230309090018.32029-1-ivan.hu@canonical.com> References: <20230309090018.32029-1-ivan.hu@canonical.com> MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" Signed-off-by: Ivan Hu --- src/dmi/dmicheck/dmicheck.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c index 836f7cdb..f2f8cb55 100644 --- a/src/dmi/dmicheck/dmicheck.c +++ b/src/dmi/dmicheck/dmicheck.c @@ -1653,6 +1653,7 @@ static void dmicheck_entry(fwts_framework *fw, dmi_str_check(fw, table, addr, "Bank Locator", hdr, 0x11); fwts_dmi_value_range t17_ranges[] = {{0x1, 0x14}, {0x18, 0x23}}; dmi_ranges_uint8_check(fw, table, addr, "Memory Type", hdr, 0x12, t17_ranges); + dmi_reserved_bits_check(fw, table, addr, "Type Detail", hdr, sizeof(uint16_t), 0x13, 0, 0); if (hdr->length < 0x1b) break; dmi_str_check(fw, table, addr, "Manufacturer", hdr, 0x17); @@ -1662,12 +1663,13 @@ static void dmicheck_entry(fwts_framework *fw, if (hdr->length < 0x1c) break; dmi_reserved_bits_check(fw, table, addr, "Attributes", hdr, sizeof(uint8_t), 0x1b, 4, 7); - if (hdr->length < 0x20) + if (hdr->length < 0x22) break; dmi_reserved_bits_check(fw, table, addr, "Extended Size", hdr, sizeof(uint32_t), 0x1c, 31, 31); if (hdr->length < 0x4c) break; dmi_min_max_uint8_check(fw, table, addr, "Memory Technology", hdr, 0x28, 0x1, 0x7); + dmi_reserved_bits_check(fw, table, addr, "Memory Operating Mode Cap", hdr, sizeof(uint16_t), 0x29, 0, 0); dmi_reserved_bits_check(fw, table, addr, "Memory Operating Mode Cap", hdr, sizeof(uint16_t), 0x29, 6, 15); dmi_str_check(fw, table, addr, "Firmware Version", hdr, 0x2b); if (hdr->length < 0x54)