From: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>
To: Anandu Padinhare <Anandu.Padinhare@electrifex.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
"Jan Beulich" <jbeulich@suse.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger@xenproject.org>,
"Daniel P. Smith" <dpsmith@apertussolutions.com>,
"Teddy Astie" <teddy.astie@vates.tech>
Subject: Re: [PATCH] x86/EFI: fix padding of EDD strings
Date: Mon, 9 Nov 2026 15:52:17 +0100 [thread overview]
Message-ID: <avHeITupUgK01tiT@mail-itl> (raw)
In-Reply-To: <MA5PR01MB11455822E04DAC972F77A25A7FD772@MA5PR01MB11455.INDPRD01.PROD.OUTLOOK.COM>
[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]
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@electrifex.com>
Reviewed-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
prev parent reply other threads:[~2026-11-09 14:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-05 9:10 [PATCH] x86/EFI: fix padding of EDD strings Anandu Padinhare
2026-11-09 14:52 ` Marek Marczykowski-Górecki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avHeITupUgK01tiT@mail-itl \
--to=marmarek@invisiblethingslab.com \
--cc=Anandu.Padinhare@electrifex.com \
--cc=andrew.cooper3@citrix.com \
--cc=dpsmith@apertussolutions.com \
--cc=jbeulich@suse.com \
--cc=roger@xenproject.org \
--cc=teddy.astie@vates.tech \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.