From nobody Mon Feb 9 23:03:56 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=trmm.net ARC-Seal: i=1; a=rsa-sha256; t=1600357311; cv=none; d=zohomail.com; s=zohoarc; b=nPcq6IodqmtGs3TwAiadPLxPztJd5rVmREzUvoiBn7UAl1dS95TIizKFGE/ta4pH5liVxniX8hvTOufx+2ymltgHuYzHxVN2/Kig3OjimT1mY8nIk5MxFi5bHBl8v7AEfkf7ppXahhUSH2kuQBZPollnB4yiMMXyngEzdQ6Abp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1600357311; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=KoorgS5vb4I78/o+/MRn2hjj3862/RPntR69nDG6Ybc=; b=gpctURjfgSbighf5hSznplBb2eV9F9N2hH3MnHJyaZ10IwCFTSGUZYI1TRw8BioB6G9LSxMlrvM/7ekiy+Ipg7f+D7h+5MtyPWGk+QG3lbmt9Mkx2tySCLKspF5wxBY/+gT4KRl7zQnYjj0WdCYv96g6G/iA8nao5/mg3ebN+W4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1600357310910970.0210529865121; Thu, 17 Sep 2020 08:41:50 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kIw2C-0003UI-Aa; Thu, 17 Sep 2020 15:41:20 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kIw2B-0003Ts-GZ for xen-devel@lists.xenproject.org; Thu, 17 Sep 2020 15:41:19 +0000 Received: from mx1a.swcp.com (unknown [216.184.2.64]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 982583e6-9090-45cd-a74f-9fe08c7fd87e; Thu, 17 Sep 2020 15:41:14 +0000 (UTC) Received: from ame7.swcp.com (ame7.swcp.com [216.184.2.70]) by mx1a.swcp.com (8.14.4/8.14.4/Debian-4) with ESMTP id 08HFfDlw024942 for ; Thu, 17 Sep 2020 09:41:13 -0600 Received: from diamond.fritz.box (62-251-112-184.ip.xs4all.nl [62.251.112.184]) by ame7.swcp.com (8.15.2/8.15.2) with ESMTP id 08HFesRM024558 for ; Thu, 17 Sep 2020 09:41:10 -0600 (MDT) (envelope-from hudson@trmm.net) X-Inumbo-ID: 982583e6-9090-45cd-a74f-9fe08c7fd87e Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: neutral (ame7.swcp.com: 62.251.112.184 is neither permitted nor denied by domain of hudson@trmm.net) receiver=ame7.swcp.com; client-ip=62.251.112.184; helo=diamond.fritz.box; envelope-from=hudson@trmm.net; x-software=spfmilter 2.001 http://www.acme.com/software/spfmilter/ with libspf2-1.2.10; X-Authentication-Warning: ame7.swcp.com: Host 62-251-112-184.ip.xs4all.nl [62.251.112.184] claimed to be diamond.fritz.box From: Trammell Hudson To: xen-devel@lists.xenproject.org Subject: [PATCH v5 1/5] efi/boot.c: Make file->ptr const void* Date: Thu, 17 Sep 2020 11:40:44 -0400 Message-Id: <20200917154048.1140580-2-hudson@trmm.net> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200917154048.1140580-1-hudson@trmm.net> References: <20200917154048.1140580-1-hudson@trmm.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.83 X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.6.2 (ame7.swcp.com [216.184.2.128]); Thu, 17 Sep 2020 09:41:11 -0600 (MDT) X-Virus-Scanned: clamav-milter 0.100.2 at ame7 X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ame7.swcp.com X-Spam-Status: No, hits=0.7 tests=NO_RECEIVED,NO_RELAYS,SPF_NEUTRAL version=3.4.2 X-Spam-Level: X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Content-Type: text/plain; charset="utf-8" Other than the config file parser that edits the image inplace, no other users of the file sections requires write access to the data. Signed-off-by: Trammell Hudson Reviewed-by: Jan Beulich --- xen/common/efi/boot.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 0ac80e47bb..157fe0e8c5 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -41,7 +41,7 @@ =20 typedef EFI_STATUS (/* _not_ EFIAPI */ *EFI_SHIM_LOCK_VERIFY) ( - IN VOID *Buffer, + IN const VOID *Buffer, IN UINT32 Size); =20 typedef struct { @@ -104,7 +104,8 @@ struct file { UINTN size; union { EFI_PHYSICAL_ADDRESS addr; - void *ptr; + char *str; + const void *ptr; }; }; =20 @@ -592,7 +593,7 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle= , CHAR16 *name, efi_arch_handle_module(file, name, options); } =20 - ret =3D FileHandle->Read(FileHandle, &file->size, file->ptr); + ret =3D FileHandle->Read(FileHandle, &file->size, file->str); if ( !EFI_ERROR(ret) && file->size !=3D size ) ret =3D EFI_ABORTED; if ( EFI_ERROR(ret) ) @@ -616,7 +617,7 @@ static bool __init read_file(EFI_FILE_HANDLE dir_handle= , CHAR16 *name, =20 static void __init pre_parse(const struct file *cfg) { - char *ptr =3D cfg->ptr, *end =3D ptr + cfg->size; + char *ptr =3D cfg->str, *end =3D ptr + cfg->size; bool start =3D true, comment =3D false; =20 for ( ; ptr < end; ++ptr ) @@ -645,7 +646,7 @@ static void __init pre_parse(const struct file *cfg) static char *__init get_value(const struct file *cfg, const char *section, const char *item) { - char *ptr =3D cfg->ptr, *end =3D ptr + cfg->size; + char *ptr =3D cfg->str, *end =3D ptr + cfg->size; size_t slen =3D section ? strlen(section) : 0, ilen =3D strlen(item); bool match =3D !slen; =20 --=20 2.25.1