diff options
author | gr embeter <grembeter@gmail.com> | 2022-07-21 17:30:46 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-07-23 13:55:26 +0100 |
commit | 54ba1dbbe9a535898283777775d5a6681a62b14f (patch) | |
tree | a6fea95e7961c9d53e5dbaf74c117bfb1e5410b5 /meta/recipes-bsp/efivar | |
parent | b890bca84d75231ca4c2fe866ad6f5558d5e320a (diff) | |
download | poky-54ba1dbbe9a535898283777775d5a6681a62b14f.tar.gz |
efivar: fix import functionality
"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:
https://github.com/rhboot/efivar/issues/173
(From OE-Core rev: 27f263a9c69b711f39287c0dc8970ad41758fbb9)
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>
Diffstat (limited to 'meta/recipes-bsp/efivar')
-rw-r--r-- | meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch | 30 | ||||
-rw-r--r-- | meta/recipes-bsp/efivar/efivar_38.bb | 1 |
2 files changed, 31 insertions, 0 deletions
diff --git a/meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch b/meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch new file mode 100644 index 0000000000..7e63df578e --- /dev/null +++ b/meta/recipes-bsp/efivar/efivar/0001-Fix-invalid-free-in-main.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 085f027e9e9f1478f68ddda705f83b244ee3bd88 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robbie Harwood <rharwood@redhat.com> | ||
3 | Date: Mon, 18 Apr 2022 13:08:18 -0400 | ||
4 | Subject: [PATCH] Fix invalid free in main() | ||
5 | |||
6 | data is allocated by mmap() in prepare_data(). | ||
7 | |||
8 | Resolves: #173 | ||
9 | Signed-off-by: Robbie Harwood <rharwood@redhat.com> | ||
10 | Upstream-Status: Backport | ||
11 | Link: https://github.com/rhboot/efivar/commit/6be2cb1c0139ac177e754b0767abf1ca1533847f | ||
12 | Signed-off-by: Grygorii Tertychnyi <grygorii.tertychnyi@leica-geosystems.com> | ||
13 | |||
14 | --- | ||
15 | src/efivar.c | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/src/efivar.c b/src/efivar.c | ||
19 | index 5cd1eb2bc73c..09f85edd0a38 100644 | ||
20 | --- a/src/efivar.c | ||
21 | +++ b/src/efivar.c | ||
22 | @@ -633,7 +633,7 @@ int main(int argc, char *argv[]) | ||
23 | if (sz < 0) | ||
24 | err(1, "Could not import data from \"%s\"", infile); | ||
25 | |||
26 | - free(data); | ||
27 | + munmap(data, data_size); | ||
28 | data = NULL; | ||
29 | data_size = 0; | ||
30 | |||
diff --git a/meta/recipes-bsp/efivar/efivar_38.bb b/meta/recipes-bsp/efivar/efivar_38.bb index 53fe20a95b..42625fa041 100644 --- a/meta/recipes-bsp/efivar/efivar_38.bb +++ b/meta/recipes-bsp/efivar/efivar_38.bb | |||
@@ -11,6 +11,7 @@ SRC_URI = "git://github.com/rhinstaller/efivar.git;branch=main;protocol=https \ | |||
11 | file://0001-docs-do-not-build-efisecdb-manpage.patch \ | 11 | file://0001-docs-do-not-build-efisecdb-manpage.patch \ |
12 | file://0001-src-Makefile-build-util.c-separately-for-makeguids.patch \ | 12 | file://0001-src-Makefile-build-util.c-separately-for-makeguids.patch \ |
13 | file://efisecdb-fix-build-with-musl-libc.patch \ | 13 | file://efisecdb-fix-build-with-musl-libc.patch \ |
14 | file://0001-Fix-invalid-free-in-main.patch \ | ||
14 | " | 15 | " |
15 | SRCREV = "1753149d4176ebfb2b135ac0aaf79340bf0e7a93" | 16 | SRCREV = "1753149d4176ebfb2b135ac0aaf79340bf0e7a93" |
16 | 17 | ||