From nobody Fri Apr 26 17:15:05 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=1558146295; cv=none; d=zoho.com; s=zohoarc; b=RzIHxdJfICbacguZKzB56KtzP3mWAg2ORSntp25WQltv+g+yOXn0SNxbbxUMRUVd49a85beCIXiYruY6I4h6x2Z4GmEXF+oxgI5CMavqrcjvBJvV0M5xkjJwO9W6w+C+iB6ptPLZHjw2ze+91BqABXjOaoIAm6CJpMMdCtNj6ZE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558146295; 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=vdKK2mMpT229cv8HKLeFj0xFZaUUuXYE8YI15OwsaMM=; b=EJc0MLm4LQ+NolOkGodUudexTv6CE4lcjL4Jzcrc93lFGtdZ+zQ9yQKFEui/C3a4icgu7HYKFeFPnyMj5xjInRHOxJK9G1qVKSEssux94GIizcOGPmXE4cHFR4GRyU797TG8DNB/TE3g8LPYyF2HFCeQjjemmNcREpbE3gFdAoM= 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 1558146295617693.71668184785; Fri, 17 May 2019 19:24:55 -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 E155D12E2E74; Sat, 18 May 2019 02:13:02 +0000 (UTC) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) by coreboot.org (Postfix) with ESMTP id 26DBF12E2E6E for ; Sat, 18 May 2019 02:12:48 +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 x4HKnGdx002384; Fri, 17 May 2019 20:57:50 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 2sdq1r3yxy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:50 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4HKuZxf033124; Fri, 17 May 2019 20:57:50 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 2sgkx4wcut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 May 2019 20:57:50 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4HKvn17011300; Fri, 17 May 2019 20:57:49 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:49 +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=ntCfU6jZ+YcTTuKHzv4PfXJj4ocKF0ZeLXzKvI6vfmU=; b=uWoM2tGPNltxGJoyAK8PmZyZWp+N97Ge0cx899eZBWv/4xkCbLWHtgM7o2CElmcHSBFC RcZsVI1AhQEahe3mZgXHxvaQpdBq52h3CX5RoLfHDRhaW6q/aQ20VOSFmvLQmkorqPbd xHF8vUB6AX9UddGM17OLJSk56ilE4l3tm9wZ4YUEnyTOSRPdMN2BlLThKRoN9NiQpYWH LLIAe0Vz/S6SMZ/zlDyw+7qaN4e3gv/NwtHn+W5SOVN+QpHBzpktyY5Ua3RblAXrIC8F imT4cLJHR0TOc2VIS+AQzMu6aqUWkJwNkqYWUFVZGTC1EkSmBZTPUtA1lWKqyoJPWL2L /g== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Fri, 17 May 2019 23:57:24 +0300 Message-Id: <20190517205726.34703-5-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=978 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: 4SQC5TNJ2LGMMYDUUYYRIDNQZ4WFHQVY X-Message-ID-Hash: 4SQC5TNJ2LGMMYDUUYYRIDNQZ4WFHQVY 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 4/6] bios_date: Add bios date 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 only one bios date appears in the final ROM. The check simulates nt!CmpGetBiosDate() in order to ensure that Windows sees the correct date. For reference implementation of nt!CmpGetBiosDate(), 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 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/checkrom.py b/scripts/checkrom.py index aced5e2c..98cdfa7f 100755 --- a/scripts/checkrom.py +++ b/scripts/checkrom.py @@ -17,6 +17,23 @@ def checksum(data, start, size, csum): sumbyte =3D buildrom.checksum(data[start:start+size]) return subst(data, start+csum, sumbyte) =20 +def check_windows_bios_date(rawdata): + dates =3D [] + for i in xrange(len(rawdata)): + if (rawdata[i+0:i+2].isdigit() and + rawdata[i+2] =3D=3D '/' and + rawdata[i+3:i+5].isdigit() and + rawdata[i+5] =3D=3D '/' and + rawdata[i+6:i+8].isdigit()): + dates.append(rawdata[i:i+8]) + if len(dates) > 1: + print("Warning! More than one date was detected in rom.") + print(" This may cause Windows OS to report incorrect date:") + print(" %s" % (dates, )) + if len(dates) =3D=3D 0: + print("Warning! No dates were detected in rom.") + print(" This may cause Windows OS to report incorrect date.") + def main(): # Get args objinfo, finalsize, rawfile, outfile =3D sys.argv[1:] @@ -46,6 +63,8 @@ def main(): sys.exit(1) =20 # Sanity checks + check_windows_bios_date(rawdata) + start =3D symbols['code32flat_start'].offset end =3D symbols['code32flat_end'].offset expend =3D layoutrom.BUILD_BIOS_ADDR + layoutrom.BUILD_BIOS_SIZE --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org