[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/5] EFI: avoid OOB config file reads


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 24 Mar 2026 17:13:06 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qhMGwzGJ/7+t3uvmLVEJQqUphjtVXBWb4pG9lzmuOJI=; b=ub18UPvjetQC7LSylOtcL9VDaN/H8PWo+91K1dMKZV85kHTk0WO5i2lozi9EPx02I4EIozywcaYm5ODoEEA1fDOhCzY1jO+dbsD4qiEw1pX93KO+uLV0VxiEBGvjaRmU/ZSufp8TnkFOhsr+RhnrBv4CAu8hUCBd2Dd/zig0Sp27kYeD4vLxW4+GxMo6PN7vlphAMG2pL/d+ORHlOqlz+0n8FqYYNyZm05jErpLU5ZShL2zs6xaQyKZYkNSwH8i+sWFVyKbrT8FEbMX5L9zDxa7UyafxHrdrtR2v1FhrF0FrSJGtzEWNaLSDC1p4rep0Y+RJecpuzQVKcyUKEwFWZg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=odkKdcaaSitncP5QxgGaT51LiU0AZo+ox6n+KrVwBWVN8OdiqFaM3l37/oRoXtd+KzQaP9iB88/fykZNiSa6Yn2MdycNLrGsLctmOVg8qv//EXRMH6MVLHuV8yLu9HxkULA01MuNDdB/A6SZ5TGrmoSHYqRde8ko/sqpelm27GwWLDeGyGzzzmNQLfqij653DrnVqME5ZpqIiQConygB7bbgG0myuEx1VIGnIcpedZcy0hwRdQCuUv+3oirc2KY0SvuIR8scbrFX4b95AWleQWSvBn/IjMulFCvVFloD8o0FKGJ1od0GqgKjpzfKQK+sqbtR7jEeHtSufpi6XrZiMg==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Marek Marczykowski <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Daniel Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Kamil Frankowicz <kamil.frankowicz@xxxxxxx>
  • Delivery-date: Tue, 24 Mar 2026 17:13:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24/03/2026 4:36 pm, Jan Beulich wrote:
> The message emitted by pre_parse() pretty clearly states the intention.
> Make sure we actually do so.
>
> Fixes: bf6501a62e80 ("x86-64: EFI boot code")
> Reported-by: Kamil Frankowicz <kamil.frankowicz@xxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>
> --- a/xen/common/efi/boot.c
> +++ b/xen/common/efi/boot.c
> @@ -907,8 +907,13 @@ static void __init pre_parse(const struc
>              start = 0;
>      }
>      if ( file->size && end[-1] )
> +    {
>           PrintStr(L"No newline at end of config file,"
>                     " last line will be ignored.\r\n");
> +
> +         for ( UINTN pos = file->size; pos-- && *--end; )
> +             *end = 0;
> +    }

I agree this is what the the function intended.

But, ignoring the final line is rude and there's no viable editor in a
UEFI shell to fix it.  Can't we just copy the file into a
one-byte-bigger buffer and terminate it properly?

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.