From: Ard Biesheuvel <ardb+git@google.com>
To: linux-efi@vger.kernel.org
Cc: Jonathan Marek <jonathan@marek.ca>, Ard Biesheuvel <ardb@kernel.org>
Subject: [PATCH 1/4] efi/libstub: Free correct pointer on failure
Date: Fri, 15 Nov 2024 10:28:39 +0100 [thread overview]
Message-ID: <20241115092838.3080857-5-ardb+git@google.com> (raw)
From: Ard Biesheuvel <ardb@kernel.org>
cmdline_ptr is an out parameter, which is not allocated by the function
itself, and likely points into the caller's stack.
cmdline refers to the pool allocation that should be freed when cleaning
up after a failure, so pass this instead to free_pool().
Fixes: 42c8ea3dca09 ("efi: libstub: Factor out EFI stub entrypoint ...")
Cc: <stable@vger.kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
drivers/firmware/efi/libstub/efi-stub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c
index f09e277ba210..fc71dcab43e0 100644
--- a/drivers/firmware/efi/libstub/efi-stub.c
+++ b/drivers/firmware/efi/libstub/efi-stub.c
@@ -148,7 +148,7 @@ efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr)
return EFI_SUCCESS;
fail_free_cmdline:
- efi_bs_call(free_pool, cmdline_ptr);
+ efi_bs_call(free_pool, cmdline);
return status;
}
--
2.47.0.338.g60cca15819-goog
next reply other threads:[~2024-11-15 9:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-15 9:28 Ard Biesheuvel [this message]
2024-11-15 9:28 ` [PATCH 2/4] efi/libstub: Parse builtin command line after bootloader provided one Ard Biesheuvel
2024-11-15 9:28 ` [PATCH 3/4] efi/libstub: Fix command line fallback handling when loading files Ard Biesheuvel
2024-11-15 9:28 ` [PATCH 4/4] efi/libstub: Take command line overrides into account for loaded files Ard Biesheuvel
-- strict thread matches above, loose matches on Subject: below --
2024-10-15 18:15 [PATCH 0/4] efi/libstub: Clean up command line handling Ard Biesheuvel
2024-10-15 18:15 ` [PATCH 1/4] efi/libstub: Free correct pointer on failure Ard Biesheuvel
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=20241115092838.3080857-5-ardb+git@google.com \
--to=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=jonathan@marek.ca \
--cc=linux-efi@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox