Skip to content

net/efi/http: match Content-Length case-insensitively - #216

Open
jgrund wants to merge 1 commit into
rhboot:fedora-44from
jgrund:efi-http-content-length-case
Open

net/efi/http: match Content-Length case-insensitively#216
jgrund wants to merge 1 commit into
rhboot:fedora-44from
jgrund:efi-http-content-length-case

Conversation

@jgrund

@jgrund jgrund commented Aug 10, 2026

Copy link
Copy Markdown

efihttp_request() matches response headers with grub_strcmp(field_name, "Content-Length"). RFC 9110 §5.1 makes field names case-insensitive, and modern servers (any hyper/Rust-based stack, h2-normalized proxies) emit content-length. When the match fails the transfer size stays 0 and every fetch over UEFI HTTP(S) boot silently returns a zero-length file — grub.cfg reads as empty, kernel/initrd load as empty, no error reported anywhere, which makes this very hard to diagnose in the field.

Observed on real hardware: Rocky Linux 10 shim+grub under UEFI HTTPS Boot against a hyper-based HTTP server. Forcing title-case headers server-side makes the same boot succeed, confirming the diagnosis.

Fix: grub_strcasecmp. One line.

RFC 9110 section 5.1 makes HTTP field names case-insensitive, and
modern servers (any hyper/Rust stack, h2-normalized proxies) emit
lower-case names. efihttp_request() matches the response header with
grub_strcmp, so "content-length" never matches: the transfer size
stays 0 and every fetch over UEFI HTTP(S) boot silently returns a
zero-length file. grub.cfg reads as empty and kernel/initrd load as
empty with no error reported.

Observed on Rocky Linux 10 shim+grub under UEFI HTTPS Boot against a
hyper-based server; forcing title-case headers server-side confirms
the diagnosis.

Signed-off-by: Joe Grund <grundjoseph@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant