From nobody Fri Jul 10 04:18:41 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gxJVT32rKz6kRQN for ; Fri, 10 Jul 2026 04:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gxJVT2Pynz3bf3 for ; Fri, 10 Jul 2026 04:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783657121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WXD4K6SiJiORUzHXIs/tUr2KH58M3+Kz/xpNfDrrvJE=; b=qbaaK3U83hHIT30BrK2lbcI0YbwLFLzpJ4CFGdG+eXKYprOnH3FnwhRE+tYy8ds/6xjUXp MmECIAsd9ac0aFO2AaiBPfTfYfii87U2f2YQ/ZjSKKjxKlZqVml+mfaA+pVfCjSBYszSkR PakBDtV5Q9yKGaY8WJNolrmGVkkQ03gF8VLO9SdzZGdldWwiBkvLV384qtIwFZuQkBZVlp e6a1jYFGiUjrySdvbDrT/LjSFrqVaOXkkPK0xZP51LkbVc6lE7wMZ3jSLx+Jor6FQ3LhDe fmU12mtRruaXXqQXhKul3Zhz8Kj6QFHeQtyjOgg3HZWx217LzqIn6fcqfCDjuw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1783657121; a=rsa-sha256; cv=none; b=lMc1mHOmPXyMimYETyVLyexrqeO8wH+zw5zYF5yKeXF3QjPLdd733VgFS6QTytcPUcXReo /0NzUwCbsE987NEJ8VwRFqCHJYlw5ypteTQsdTGqxWX9Lb3m7h9aew8WIum5RV135msTR3 ZhGYK+4nRXGrfyWkN4KWtQPN95KUNgjCU+yyS3umhjvlEI3qYOo9iK0bxJA+XxeYzcypCD hh+KY4l+JKcfau7rYqQ3pGnc/u0D/EsYq8rcOU67pMdKg4AceBjQmoYdATGYgu6aEAnD4O 9qcjsgYJ4lAVAISEY2CqGV/BMth6KSBlME+KF8ITF6LzE06DOOyWe+ermJJP6Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1783657121; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WXD4K6SiJiORUzHXIs/tUr2KH58M3+Kz/xpNfDrrvJE=; b=KqRejANBd2EpdgWQYKlhexUDAjkvHpioUBbHlAKI52epS/Nr+sqVht0hOsupkA8WbGbSkY Z3HdMGUJqlFnHiPK6NC/F8dBW6yCRL8rpHkKPpsuy3XDzf/EnF4QnknWmd6iOeiaduc37g AVEmqxebU+AmSfZb2sHg37JH/3bX+OPbb4dZxqN+GQ5IPQIragcsoHAsQ8Yh/EGjoXLK8j Wh5vvQLaUPPfqBc4Awiuh0IuRGvVqd9gRDw0ySN1I9bNecos6sDroBqpXT2mis8XieTzAl skilYwSkU4bIEGL4BdG6mSC6pCbzXkRFwH/05PQUfP8za3QIziwpqvysHTIA6Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gxJVT1BTZzg79 for ; Fri, 10 Jul 2026 04:18:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33aa2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 10 Jul 2026 04:18:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a22fa5ec74e0 - main - laoder.efi: Fix error in download protcol List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a22fa5ec74e084c5786745e56939e78f7159007b Auto-Submitted: auto-generated Date: Fri, 10 Jul 2026 04:18:41 +0000 Message-Id: <6a5072a1.33aa2.2f8c0dfb@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a22fa5ec74e084c5786745e56939e78f7159007b commit a22fa5ec74e084c5786745e56939e78f7159007b Author: Warner Losh AuthorDate: 2026-07-10 04:04:20 +0000 Commit: Warner Losh CommitDate: 2026-07-10 04:09:41 +0000 laoder.efi: Fix error in download protcol The download protocol calls download_data with FileOffset and BufferLength of 0 first to start the download (no data yet available). Calls it again with BufferLength == 0 and FileOffset the size of the download (again, no data). It then starts calling with BufferLength != 0 and FileOffset == 0 to start the download. The heuristic I used to detect the start was wrong, so we'd allocate the buffer twice. Fix that by being more explicit and not using the heuristic that was bogus. Fixes: afee781523e4 ("loader.efi: Recognize new memdisk= and memcd= options") Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D58068 --- stand/efi/loader/memdisk.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stand/efi/loader/memdisk.c b/stand/efi/loader/memdisk.c index 8d34d3ceae42..aa843916c799 100644 --- a/stand/efi/loader/memdisk.c +++ b/stand/efi/loader/memdisk.c @@ -50,11 +50,15 @@ download_data(IN VOID *Context, IN VOID *Buffer, IN UINTN BufferLength, IN UINTN dl_state *ctx = Context; decomp_state *dctx = ctx->dctx; + if (FileOffset == 0 && BufferLength == 0) { + printf("Staritng the download\n"); + return (EFI_SUCCESS); + } + /* - * Make a note of the size when we're hinted about it. But once - * we start the download, ignore the hints. + * Make a note of the size when we're hinted about it. */ - if (ctx->size == 0 && BufferLength == 0) { + if (BufferLength == 0) { printf("We know we will download %llu bytes\n", ULL(FileOffset)); ctx->size = FileOffset; ctx->status = EFI_SUCCESS;