net/efi/http: match Content-Length case-insensitively - #216
Open
jgrund wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
efihttp_request()matches response headers withgrub_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) emitcontent-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.