From nobody Fri Apr 19 19:38: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=1556136781; cv=none; d=zoho.com; s=zohoarc; b=N6PSJXgbst4gAf4IanhTVd84C9jH8rDJN1rbpupog4H3TQlkUucE1fUqJM0HFddtlP1Bu6V7XqLEA7lIxwZBY/noBemmEYj+JEDWrQw6wvEOplNEGOlu9tBrbPc66VhpathE3lBhxQutW8zS9hpwVmts917XZ/0KAyFqfvtWoyA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556136781; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Subject:To:ARC-Authentication-Results; bh=T/4DzAG7YyZ97lmOgw7cPAY2dFLFlwYOCtFj2ZpwJUY=; b=RmUGeyYxGFSaTxt3H6zzv6W5ayads0Wk1ds3hEA4hIH1lyrbDxhdNKLayHgbbfkOnqT73a8xu64oaDgtV5I/+NEvHb5kcxZBnJzS69jrTJQlh8KaF2ggPVKRgCaqdxqhTysPp0271SuTLh8rEMkO/xyoi/YLZHxTll70+/jE1CU= 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 1556136781234273.28900737833135; Wed, 24 Apr 2019 13:13:01 -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 8379312E2E51; Wed, 24 Apr 2019 20:12:55 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by coreboot.org (Postfix) with ESMTP id EC83C12E2E4F for ; Wed, 24 Apr 2019 20:12:42 +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 x3ODsMDU035092; Wed, 24 Apr 2019 14:06:28 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 2rytut2kyw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Apr 2019 14:06:27 +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 x3OE4Qwo157330; Wed, 24 Apr 2019 14:04:26 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 2s0f0w3qfx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Apr 2019 14:04:26 +0000 Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x3OE4MqE007581; Wed, 24 Apr 2019 14:04:22 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 24 Apr 2019 07:04:21 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=bw776TYZ/Sfod4vDoo5fcyCy6PC1tLJeaCXvpgiko14=; b=z3ssC76QGMVyyawXuZGVBUi8Ps5KxqxFnUDUB6zOavPSrlPprYKxAtmrlqsCSqHQ8UF0 DQJKxww38/MAUNTDwytkpmZoWlnKCVQAolcwJT6kWEt988JYUzanD6N3hH/O6uaHyXTO g1rrRgm3/xiWNydxjDdZ1iR1gKzaH61kgzSVJby44LDZymNQ3WzuCxEL3HRcnoCoefas 8V+ueVoxnvqmNY/wz6Wa4JblclMs4V8SDJasaxTlD8FpEmpkOI2JHiaDYdT4LEZlOKFZ yXf8BxZkO1Mq0RWkL/cA0NiO8P6iNbXsAkF9uBFdekEJsXR3X8EIdqbTFI2ocBLt59CE NA== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Wed, 24 Apr 2019 17:04:09 +0300 Message-Id: <20190424140409.575-1-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9236 signatures=668685 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-1904240110 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9236 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 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-1904240110 X-MIME-Autoconverted: from 8bit to quoted-printable by userp2130.oracle.com id x3ODsMDU035092 Message-ID-Hash: TEUWX5ASB7SDQEQCDCEDKM4YRGUEKNHG X-Message-ID-Hash: TEUWX5ASB7SDQEQCDCEDKM4YRGUEKNHG 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: ross.philipson@oracle.com X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [SeaBIOS][PATCH] smbios: Add missing zero byte to Type 0 List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: ++++ X-Spam-Level: **** Authentication-Results: coreboot.org X-ZohoMail-DKIM: fail (Header signature does not verify) According to SMBIOS Specification, section 6.1.3 Text Strings: "Text strings associated with a given SMBIOS structure are returned in the dmiStructBuffer, appended directly after the formatted portion of the structure. This method of returning string information eliminates the need for application software to deal with pointers embedded in the SMBIOS structure. Each string is terminated with a null (00h) BYTE and the set of strings is terminated with an additional null (00h) BYTE=E2=80= =9D Furthermore: "If the formatted portion of the structure contains string-reference fields and all the string fields are set to 0 (no string references), the formatted section of the structure is followed by two null (00h) BYTES" From the above it can be seen that any SMBIOS type which contains string references should end with an additional zero byte. This is currently handled in all SMBIOS types which use load_str_field_with_default() besides type0. Therefore, add the missing zero byte to SMBIOS Type 0. Running QEMU with: -machine pc-i440fx-2.0 (for legacy smbios) -smbios type=3D0,vendor=3D,version=3D,date=3D (for zero str_index) Will cause SMBIOS type0 entry to overrun type1 entry. Reviewed-by: Ross Philipson Reviewed-By: Liran Alon Signed-off-by: Sam Eiderman Reviewed-by: Mark Kanda > --- src/fw/smbios.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fw/smbios.c b/src/fw/smbios.c index f3b5ad9d..62a563b2 100644 --- a/src/fw/smbios.c +++ b/src/fw/smbios.c @@ -205,6 +205,10 @@ smbios_init_type_0(void *start) =20 *end =3D 0; end++; + if (!str_index) { + *end =3D 0; + end++; + } =20 return end; } --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org