-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"efivar --import" is broken in v38: # efivar -i /8be4df61-93ca-11d2-aa0d-00e098032b8c-Timeout free(): invalid pointer Aborted Backport upstream patch to fix it. Upstream issue: rhboot/efivar#173 Signed-off-by: Grygorii Tertychnyi <grygorii.tertychnyi@leica-geosystems.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 27f263a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From 085f027e9e9f1478f68ddda705f83b244ee3bd88 Mon Sep 17 00:00:00 2001 | ||
From: Robbie Harwood <rharwood@redhat.com> | ||
Date: Mon, 18 Apr 2022 13:08:18 -0400 | ||
Subject: [PATCH] Fix invalid free in main() | ||
|
||
data is allocated by mmap() in prepare_data(). | ||
|
||
Resolves: #173 | ||
Signed-off-by: Robbie Harwood <rharwood@redhat.com> | ||
Upstream-Status: Backport | ||
Link: https://github.com/rhboot/efivar/commit/6be2cb1c0139ac177e754b0767abf1ca1533847f | ||
Signed-off-by: Grygorii Tertychnyi <grygorii.tertychnyi@leica-geosystems.com> | ||
|
||
--- | ||
src/efivar.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/src/efivar.c b/src/efivar.c | ||
index 5cd1eb2bc73c..09f85edd0a38 100644 | ||
--- a/src/efivar.c | ||
+++ b/src/efivar.c | ||
@@ -633,7 +633,7 @@ int main(int argc, char *argv[]) | ||
if (sz < 0) | ||
err(1, "Could not import data from \"%s\"", infile); | ||
|
||
- free(data); | ||
+ munmap(data, data_size); | ||
data = NULL; | ||
data_size = 0; | ||
|
This file contains 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