From nobody Thu Mar 12 18:36:39 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1558196246; cv=none; d=zoho.com; s=zohoarc; b=OqzI1V2Y/Eib61Kz00F5c3PzsqFfE6cftqSc7Qhf/C2tlhqABvR5DfzwkN+pIsjMaoOTG3Ua+ojVDyHmx5kkzRCNtgZhc7Hm5ra5XVGoRfemoXbSTzE14EPGSpvWNXKmcnfMNhvns/QM27S1Fa/+vZoCLMFqVrvbNDfuovylfE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558196246; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=+ln+GHjCzYg0leOj/YIhnBFyhWD29Pm1rx/Q3Q5Q2rs=; b=HPRbJ7zJtREEf5S72VUUJR/ybelPIXv5ewx8UUDn6TvWWfr0At94h5nFdQKSYhHDXljF5CyKhzwl2SX+K/DawxfT1UMq6Qm7okoHqE0yLZv5BaQD9ptFAA1ngMzJ5emNrcWB/UCdi/2VoVEYXMlgYXSscCFaZidp20lv0M2eGgU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1558196246066309.5202719389828; Sat, 18 May 2019 09:17:26 -0700 (PDT) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id 3643712E2E80; Sat, 18 May 2019 16:17:20 +0000 (UTC) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by coreboot.org (Postfix) with ESMTP id 28CF312E2E80 for ; Sat, 18 May 2019 16:17:12 +0000 (UTC) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IG9Qal116796; Sat, 18 May 2019 16:17:05 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2120.oracle.com with ESMTP id 2sjapq16y0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:17:05 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IGFSpr072980; Sat, 18 May 2019 16:17:04 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3030.oracle.com with ESMTP id 2sj839wstg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:17:04 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4IGH3B6025633; Sat, 18 May 2019 16:17:03 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 18 May 2019 09:17:03 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=ffAmlkj9XaHTgZkkcYNt2WwffpBDXX6mzvsO+qaQx44=; b=TqOaM1uvTtpmZgG4S54sOkJL1p33tMvRuF193EoKWw6nvJrjMUbkkff5mUMfXcyKqL/f wE6BzHSdkRiYFGAxufsKRiGD2S9vyOfCk2bVCXYYA4dUXWHmHSm2igdga0THSzBHFRmF vygaEdUMHdBA/dyTI8zsm6N7XEu3InFgciunq1/+dfspMPubOHWnuwmzle7Yr3iZ51/k mO+3yq3Eg3wyeT8/I39+LO8YvRtUmrQKK5cxUVomYFPoQnVD2hN1w1cA7TfxML7w6X63 uuBDtzyhpVb5OcOoy9W65CbQ+7+67qcHOoNwdCpn+zNVXl6uaTOS0sZqXvYC3bSxyRpd KQ== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Sat, 18 May 2019 19:15:42 +0300 Message-Id: <20190518161542.12662-7-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190518161542.12662-1-shmuel.eiderman@oracle.com> References: <20190518161542.12662-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 Message-ID-Hash: O2WOGLR4BDSWH2S6DZ44YV7IXFFA3E6U X-Message-ID-Hash: O2WOGLR4BDSWH2S6DZ44YV7IXFFA3E6U X-MailFrom: shmuel.eiderman@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: arbel.moshe@oracle.com, konrad.wilk@oracle.com X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [PATCH v2 6/6] bios_version: Add bios version checks in checkrom.py List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: +++++ X-Spam-Level: ***** Authentication-Results: coreboot.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Check that no version string appear in the final ROM. The check simulates nt!CmpGetBiosVersion() in order to ensure that Windows sees the correct versions. For reference implementation of nt!CmpGetBiosVersion(), see ReactOS: https://doxygen.reactos.org/d5/dd2/i386_2cmhardwr_8c.html Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- scripts/checkrom.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/checkrom.py b/scripts/checkrom.py index 98cdfa7f..a09203fe 100755 --- a/scripts/checkrom.py +++ b/scripts/checkrom.py @@ -34,6 +34,31 @@ def check_windows_bios_date(rawdata): print("Warning! No dates were detected in rom.") print(" This may cause Windows OS to report incorrect date.") =20 +def check_windows_bios_version(rawdata): + versions =3D [] + for i in xrange(len(rawdata)): + if (rawdata[i+0].isdigit() and + rawdata[i+1] =3D=3D '.' and + rawdata[i+2].isdigit()): + p =3D i-1 + while ((p >=3D 0) and (p > i+2-127) + and ord(rawdata[p]) >=3D ord(' ') + and rawdata[p] !=3D '$'): + p -=3D 1 + version =3D rawdata[p+1:i+3] + for s in ["Ver", "Rev", "Rel", + "v0", "v1", "v2", "v3", "v4", + "v5", "v6", "v7", "v8", "v9", + "v 0", "v 1", "v 2", "v 3", "v 4", + "v 5", "v 6", "v 7", "v 8", "v 9"]: + if s in version: + versions.append((rawdata[p+1:i+3], i)) + break + if len(versions) > 0: + print("Warning! Version strings were detected in rom.") + print(" This may cause Windows OS to report incorrect version:") + print(" %s" % (versions, )) + def main(): # Get args objinfo, finalsize, rawfile, outfile =3D sys.argv[1:] @@ -64,6 +89,7 @@ def main(): =20 # Sanity checks check_windows_bios_date(rawdata) + check_windows_bios_version(rawdata) =20 start =3D symbols['code32flat_start'].offset end =3D symbols['code32flat_end'].offset --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org