From nobody Fri Apr 26 11:58:59 2024 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=1558143827; cv=none; d=zoho.com; s=zohoarc; b=buj6SCxY2n6krHzrnATBFV6YhN7AU6tEc/6JyOGMM6oGCEgCzpWQwu3qqBqwnB8BsvE3yVRaZQWZGEeuUmuvK2Q6VbAFUNszfTPnRWUG2bZzr150bGxd7kPOF5IplFsMJa8TQOJcxSRoPz831XPUXbnZP6n65lHBU/KIcnFRa14= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558143827; 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=icw0s2vgXdGLt9qAOZKcUMMj9wjLC2KCp+7vbggOMssH1Nu3/SsAU1gBcadx/KVR2Gi/5a/LNCxUghqp7BmrKXnwlrp+XnAUt8Il8/4apWPbhOHZFIS/E7KKHvdR/yLJEDEEG5ETmbYI6kGp4CAjtsg35uosrb6LFifjFtpWxXo= 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 1558143827100418.9326963107545; Fri, 17 May 2019 18:43:47 -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 308E112E2E70; Sat, 18 May 2019 01:24:49 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by coreboot.org (Postfix) with ESMTP id 1962B12E2E6E for ; Sat, 18 May 2019 01:24:35 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4HKnIYU183164; Fri, 17 May 2019 20:57:55 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2sdntuc2qj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:55 +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 x4HKvSuk087632; Fri, 17 May 2019 20:57:55 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2sggeugp6s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:55 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4HKvrAp027183; Fri, 17 May 2019 20:57:54 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 17 May 2019 20:57:53 +0000 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=J1ZNiVe8/DBLpl9xI8GJVH2fNC711gCVttULWkk90yP5Z587dapdb6yzVpu998PhojSV C0D0hl1PZjy/dI7CfLwekmwg9FRTJVEQMwOf+AFVH0nKmRTWo24kBpYd2IxUd4zmuSjJ 0ROB6oiH0khYc11sF4tmGLYd3ToRw8kgKNO9YZmaErJJEsQCbGosWohSmM12dt06KGgW euzLHWjOhilGqZnKWxyMEZ0Kli3JDhWC7LPsXDunjMSj/Nf8nQneCJohf1tznXazbcqN 6/cKAIClTGdbfyNTCJwKxuO5uzQB6lQou6pdCGpMntDA2zVhetWElCoQ7oQt0KyAHcdG AQ== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Fri, 17 May 2019 23:57:26 +0300 Message-Id: <20190517205726.34703-7-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190517205726.34703-1-shmuel.eiderman@oracle.com> References: <20190517205726.34703-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9260 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-1905170124 Message-ID-Hash: KKTEGEVASVNECACAHAEK357NHQT44E2P X-Message-ID-Hash: KKTEGEVASVNECACAHAEK357NHQT44E2P 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 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