diff options
author | Peter Marko <peter.marko@siemens.com> | 2025-03-11 19:09:53 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-13 11:00:36 +0000 |
commit | 1ab99590d7f38255b090ee2c01fe7e1ca03466f5 (patch) | |
tree | a339459c0abdf07992dfb98d393d9d4e690badff /meta/recipes-bsp | |
parent | 30d4e5ed9a05aec10257f76baad0075f5cadefbc (diff) | |
download | poky-1ab99590d7f38255b090ee2c01fe7e1ca03466f5.tar.gz |
grub: patch CVE-2025-0622
Cherry-pick patch mentioning this CVE.
(From OE-Core rev: 13fafdaa6958bd4cf1ff350caf355c8c41a80e47)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp')
-rw-r--r-- | meta/recipes-bsp/grub/files/CVE-2025-0622-01.patch | 35 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/files/CVE-2025-0622-02.patch | 41 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/files/CVE-2025-0622-03.patch | 38 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/grub2.inc | 3 |
4 files changed, 117 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-0622-01.patch b/meta/recipes-bsp/grub/files/CVE-2025-0622-01.patch new file mode 100644 index 0000000000..09dbfce5f8 --- /dev/null +++ b/meta/recipes-bsp/grub/files/CVE-2025-0622-01.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 2123c5bca7e21fbeb0263df4597ddd7054700726 Mon Sep 17 00:00:00 2001 | ||
2 | From: B Horn <b@horn.uk> | ||
3 | Date: Fri, 1 Nov 2024 19:24:29 +0000 | ||
4 | Subject: [PATCH 1/3] commands/pgp: Unregister the "check_signatures" hooks on | ||
5 | module unload | ||
6 | |||
7 | If the hooks are not removed they can be called after the module has | ||
8 | been unloaded leading to an use-after-free. | ||
9 | |||
10 | Fixes: CVE-2025-0622 | ||
11 | |||
12 | Reported-by: B Horn <b@horn.uk> | ||
13 | Signed-off-by: B Horn <b@horn.uk> | ||
14 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
15 | |||
16 | CVE: CVE-2025-0622 | ||
17 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=2123c5bca7e21fbeb0263df4597ddd7054700726] | ||
18 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
19 | --- | ||
20 | grub-core/commands/pgp.c | 2 ++ | ||
21 | 1 file changed, 2 insertions(+) | ||
22 | |||
23 | diff --git a/grub-core/commands/pgp.c b/grub-core/commands/pgp.c | ||
24 | index c6766f044..5fadc33c4 100644 | ||
25 | --- a/grub-core/commands/pgp.c | ||
26 | +++ b/grub-core/commands/pgp.c | ||
27 | @@ -1010,6 +1010,8 @@ GRUB_MOD_INIT(pgp) | ||
28 | |||
29 | GRUB_MOD_FINI(pgp) | ||
30 | { | ||
31 | + grub_register_variable_hook ("check_signatures", NULL, NULL); | ||
32 | + grub_env_unset ("check_signatures"); | ||
33 | grub_verifier_unregister (&grub_pubkey_verifier); | ||
34 | grub_unregister_extcmd (cmd); | ||
35 | grub_unregister_extcmd (cmd_trust); | ||
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-0622-02.patch b/meta/recipes-bsp/grub/files/CVE-2025-0622-02.patch new file mode 100644 index 0000000000..be01da3355 --- /dev/null +++ b/meta/recipes-bsp/grub/files/CVE-2025-0622-02.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | From 9c16197734ada8d0838407eebe081117799bfe67 Mon Sep 17 00:00:00 2001 | ||
2 | From: B Horn <b@horn.uk> | ||
3 | Date: Fri, 1 Nov 2024 23:46:55 +0000 | ||
4 | Subject: [PATCH 2/3] normal: Remove variables hooks on module unload | ||
5 | |||
6 | The normal module does not entirely cleanup after itself in | ||
7 | its GRUB_MOD_FINI() leaving a few variables hooks in place. | ||
8 | It is not possible to unload normal module now but fix the | ||
9 | issues for completeness. | ||
10 | |||
11 | On the occasion replace 0s with NULLs for "pager" variable | ||
12 | hooks unregister. | ||
13 | |||
14 | Fixes: CVE-2025-0622 | ||
15 | |||
16 | Reported-by: B Horn <b@horn.uk> | ||
17 | Signed-off-by: B Horn <b@horn.uk> | ||
18 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
19 | |||
20 | CVE: CVE-2025-0622 | ||
21 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=9c16197734ada8d0838407eebe081117799bfe67] | ||
22 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
23 | --- | ||
24 | grub-core/normal/main.c | 4 +++- | ||
25 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c | ||
28 | index 838f57fa5..04d058f55 100644 | ||
29 | --- a/grub-core/normal/main.c | ||
30 | +++ b/grub-core/normal/main.c | ||
31 | @@ -582,7 +582,9 @@ GRUB_MOD_FINI(normal) | ||
32 | grub_xputs = grub_xputs_saved; | ||
33 | |||
34 | grub_set_history (0); | ||
35 | - grub_register_variable_hook ("pager", 0, 0); | ||
36 | + grub_register_variable_hook ("pager", NULL, NULL); | ||
37 | + grub_register_variable_hook ("color_normal", NULL, NULL); | ||
38 | + grub_register_variable_hook ("color_highlight", NULL, NULL); | ||
39 | grub_fs_autoload_hook = 0; | ||
40 | grub_unregister_command (cmd_clear); | ||
41 | } | ||
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-0622-03.patch b/meta/recipes-bsp/grub/files/CVE-2025-0622-03.patch new file mode 100644 index 0000000000..79078a4350 --- /dev/null +++ b/meta/recipes-bsp/grub/files/CVE-2025-0622-03.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 7580addfc8c94cedb0cdfd7a1fd65b539215e637 Mon Sep 17 00:00:00 2001 | ||
2 | From: B Horn <b@horn.uk> | ||
3 | Date: Fri, 1 Nov 2024 23:52:06 +0000 | ||
4 | Subject: [PATCH 3/3] gettext: Remove variables hooks on module unload | ||
5 | |||
6 | The gettext module does not entirely cleanup after itself in | ||
7 | its GRUB_MOD_FINI() leaving a few variables hooks in place. | ||
8 | It is not possible to unload gettext module because normal | ||
9 | module depends on it. Though fix the issues for completeness. | ||
10 | |||
11 | Fixes: CVE-2025-0622 | ||
12 | |||
13 | Reported-by: B Horn <b@horn.uk> | ||
14 | Signed-off-by: B Horn <b@horn.uk> | ||
15 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
16 | |||
17 | CVE: CVE-2025-0622 | ||
18 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=7580addfc8c94cedb0cdfd7a1fd65b539215e637] | ||
19 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
20 | --- | ||
21 | grub-core/gettext/gettext.c | 4 ++++ | ||
22 | 1 file changed, 4 insertions(+) | ||
23 | |||
24 | diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c | ||
25 | index 7a1c14e4f..e4f4f8ee6 100644 | ||
26 | --- a/grub-core/gettext/gettext.c | ||
27 | +++ b/grub-core/gettext/gettext.c | ||
28 | @@ -535,6 +535,10 @@ GRUB_MOD_INIT (gettext) | ||
29 | |||
30 | GRUB_MOD_FINI (gettext) | ||
31 | { | ||
32 | + grub_register_variable_hook ("locale_dir", NULL, NULL); | ||
33 | + grub_register_variable_hook ("secondary_locale_dir", NULL, NULL); | ||
34 | + grub_register_variable_hook ("lang", NULL, NULL); | ||
35 | + | ||
36 | grub_gettext_delete_list (&main_context); | ||
37 | grub_gettext_delete_list (&secondary_context); | ||
38 | |||
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index 0ad5ba7fc0..99174a4f33 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc | |||
@@ -26,6 +26,9 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ | |||
26 | file://CVE-2025-0624.patch \ | 26 | file://CVE-2025-0624.patch \ |
27 | file://CVE-2024-45774.patch \ | 27 | file://CVE-2024-45774.patch \ |
28 | file://CVE-2024-45775.patch \ | 28 | file://CVE-2024-45775.patch \ |
29 | file://CVE-2025-0622-01.patch \ | ||
30 | file://CVE-2025-0622-02.patch \ | ||
31 | file://CVE-2025-0622-03.patch \ | ||
29 | " | 32 | " |
30 | 33 | ||
31 | SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" | 34 | SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" |