[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] x86/EFI: fix padding of EDD strings
- To: Anandu Padinhare <Anandu.Padinhare@xxxxxxxxxxxxxx>
- From: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 9 Nov 2026 15:52:17 +0100
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm2 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Cc:Content-Type:Date:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To"; dkim=pass header.s=fm3 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Cc:Content-Type:Date:Feedback-ID:From:In-Reply-To:Message-ID:MIME-Version:References:Subject:To:X-ME-Proxy:X-ME-Sender"
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Teddy Astie <teddy.astie@xxxxxxxxxx>
- Delivery-date: Mon, 09 Nov 2026 14:52:33 +0000
- Dkim2-signature: i=1; m=1; t=1794235940; d=invisiblethingslab.com; mf=PG1hcm1hcmVrQGludmlzaWJsZXRoaW5nc2xhYi5jb20+; rt=PHhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZz4=; s=fm2:rsa-sha256:RMcr4mNZXyHQavKkX/vGZMSkJby+Pq5KdTUoM07nBNyIK54 g7EdAtWuOnJe3H/M+hVdPBhQ91UyTp8mIjoIzExf79vyrX1Bv46NaaxpKsFK069G ZF5UCeWaO8Ne5vuKH+cQBrqDGNPmpLee1Ovp8q0Bri1KELKvc0eVYJgjFubYay1y VPvJ+lekp0tEcEVS8Mi2oad1mNFSydT3jF3HpICFY3/lhGehGdhGOB+ty7D0rBPp dkZg5O5HjVXBEbq9hjZ1HFINsWUp+T5apamLokxgRcb+5Z4cwwkKUQWDm+FYqhUb 4iK9TOonXQwq9GanNYzr0WK3eOmEdthMMaGI1Fg==;
- Feedback-id: i1568416f:Fastmail
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Message-instance: m=1; h=sha256:e/4zs73J1X3pN1CbnbYjwURMR7hv9MVGZrblgOMhgic=:lRIo3dvOulfs0N7VdbozhmPgjeAtMiYS4GUpr1Mvax8=;
On Thu, Nov 05, 2026 at 09:10:28AM +0000, Anandu Padinhare wrote:
> edd_put_string() decrements n in its copy loop condition even when the
> loop terminates because the end of the source string was reached. The
> padding loop then writes one space too few, leaving the final byte of
> the field untouched (zero, as boot_edd_info[] lives in .bss). On an EFI
> boot this yields e.g. a host bus type of "PCI\0" and an interface type
> of "ATAPI \0", whereas BIOSes space-pad these fields (SeaBIOS reports
> "PCI " and "ATA ").
>
> Furthermore, if the string exactly filled the field, n would wrap to
> SIZE_MAX after the copy loop and the padding loop would write past the
> end of the field. No caller currently passes such a string.
>
> Only decrement n when a character was actually copied. While touching
> the function, also correct its indentation.
>
> Fixes: 51f03ec421fb ("x86-64/EFI: construct EDD data from device path
> protocol information")
> Assisted-by: Claude
> Signed-off-by: Anandu Padinhare <Anandu.Padinhare@xxxxxxxxxxxxxx>
Reviewed-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
Attachment:
signature.asc
Description: PGP signature
|