diff options
| author | Jiaying Song <jiaying.song.cn@windriver.com> | 2025-12-24 16:46:13 +0800 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2026-01-02 07:21:42 -0800 |
| commit | 5e7ac0aa433f8f34a1440100b4d49a94216b1038 (patch) | |
| tree | ae74b9fabe1eca4bcb432d51fdd66e484fdefd83 | |
| parent | 37dc9a476ae92cf41dc5c70ed56cbbefd21ce086 (diff) | |
| download | poky-5e7ac0aa433f8f34a1440100b4d49a94216b1038.tar.gz | |
grub: fix CVE-2025-61661 CVE-2025-61662 CVE-2025-61663 CVE-2025-61664
References:
https://nvd.nist.gov/vuln/detail/CVE-2025-61661
https://nvd.nist.gov/vuln/detail/CVE-2025-61662
https://nvd.nist.gov/vuln/detail/CVE-2025-61663
https://nvd.nist.gov/vuln/detail/CVE-2025-61664
(From OE-Core rev: f2031f39e423b764ccf4003bdee05f30d66fb7ce)
Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/recipes-bsp/grub/files/CVE-2025-61661.patch | 40 | ||||
| -rw-r--r-- | meta/recipes-bsp/grub/files/CVE-2025-61662.patch | 72 | ||||
| -rw-r--r-- | meta/recipes-bsp/grub/files/CVE-2025-61663_61664.patch | 64 | ||||
| -rw-r--r-- | meta/recipes-bsp/grub/grub2.inc | 3 |
4 files changed, 179 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-61661.patch b/meta/recipes-bsp/grub/files/CVE-2025-61661.patch new file mode 100644 index 0000000000..9ae4f3b307 --- /dev/null +++ b/meta/recipes-bsp/grub/files/CVE-2025-61661.patch | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | From 9c2ae73b549a653f5f1bd5d4edebc50a764bad06 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jamie <volticks@gmail.com> | ||
| 3 | Date: Mon, 14 Jul 2025 09:52:59 +0100 | ||
| 4 | Subject: [PATCH 1/3] commands/usbtest: Use correct string length field | ||
| 5 | |||
| 6 | An incorrect length field is used for buffer allocation. This leads to | ||
| 7 | grub_utf16_to_utf8() receiving an incorrect/different length and possibly | ||
| 8 | causing OOB write. This makes sure to use the correct length. | ||
| 9 | |||
| 10 | Fixes: CVE-2025-61661 | ||
| 11 | |||
| 12 | CVE: CVE-2025-61661 | ||
| 13 | |||
| 14 | Upstream-Status: Backport | ||
| 15 | [https://gitweb.git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=549a9cc372fd0b96a4ccdfad0e12140476cc62a3] | ||
| 16 | |||
| 17 | Reported-by: Jamie <volticks@gmail.com> | ||
| 18 | Signed-off-by: Jamie <volticks@gmail.com> | ||
| 19 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
| 20 | Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com> | ||
| 21 | --- | ||
| 22 | grub-core/commands/usbtest.c | 2 +- | ||
| 23 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 24 | |||
| 25 | diff --git a/grub-core/commands/usbtest.c b/grub-core/commands/usbtest.c | ||
| 26 | index 2c6d93fe6..8ef187a9a 100644 | ||
| 27 | --- a/grub-core/commands/usbtest.c | ||
| 28 | +++ b/grub-core/commands/usbtest.c | ||
| 29 | @@ -99,7 +99,7 @@ grub_usb_get_string (grub_usb_device_t dev, grub_uint8_t index, int langid, | ||
| 30 | return GRUB_USB_ERR_NONE; | ||
| 31 | } | ||
| 32 | |||
| 33 | - *string = grub_malloc (descstr.length * 2 + 1); | ||
| 34 | + *string = grub_malloc (descstrp->length * 2 + 1); | ||
| 35 | if (! *string) | ||
| 36 | { | ||
| 37 | grub_free (descstrp); | ||
| 38 | -- | ||
| 39 | 2.34.1 | ||
| 40 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-61662.patch b/meta/recipes-bsp/grub/files/CVE-2025-61662.patch new file mode 100644 index 0000000000..1614b00d53 --- /dev/null +++ b/meta/recipes-bsp/grub/files/CVE-2025-61662.patch | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | From c47760a907c91283bac9a8400d6975574b1d3986 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alec Brown <alec.r.brown@oracle.com> | ||
| 3 | Date: Thu, 21 Aug 2025 21:14:06 +0000 | ||
| 4 | Subject: [PATCH 2/3] gettext/gettext: Unregister gettext command on module | ||
| 5 | unload | ||
| 6 | |||
| 7 | When the gettext module is loaded, the gettext command is registered but | ||
| 8 | isn't unregistered when the module is unloaded. We need to add a call to | ||
| 9 | grub_unregister_command() when unloading the module. | ||
| 10 | |||
| 11 | Fixes: CVE-2025-61662 | ||
| 12 | |||
| 13 | CVE: CVE-2025-61662 | ||
| 14 | |||
| 15 | Upstream-Status: Backport | ||
| 16 | [https://gitweb.git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=8ed78fd9f0852ab218cc1f991c38e5a229e43807] | ||
| 17 | |||
| 18 | Reported-by: Alec Brown <alec.r.brown@oracle.com> | ||
| 19 | Signed-off-by: Alec Brown <alec.r.brown@oracle.com> | ||
| 20 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
| 21 | Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com> | ||
| 22 | --- | ||
| 23 | grub-core/gettext/gettext.c | 19 ++++++++++++------- | ||
| 24 | 1 file changed, 12 insertions(+), 7 deletions(-) | ||
| 25 | |||
| 26 | diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c | ||
| 27 | index 7a25c9d67..ef1258ee0 100644 | ||
| 28 | --- a/grub-core/gettext/gettext.c | ||
| 29 | +++ b/grub-core/gettext/gettext.c | ||
| 30 | @@ -502,6 +502,8 @@ grub_cmd_translate (grub_command_t cmd __attribute__ ((unused)), | ||
| 31 | return 0; | ||
| 32 | } | ||
| 33 | |||
| 34 | +static grub_command_t cmd; | ||
| 35 | + | ||
| 36 | GRUB_MOD_INIT (gettext) | ||
| 37 | { | ||
| 38 | const char *lang; | ||
| 39 | @@ -521,13 +523,14 @@ GRUB_MOD_INIT (gettext) | ||
| 40 | grub_register_variable_hook ("locale_dir", NULL, read_main); | ||
| 41 | grub_register_variable_hook ("secondary_locale_dir", NULL, read_secondary); | ||
| 42 | |||
| 43 | - grub_register_command_p1 ("gettext", grub_cmd_translate, | ||
| 44 | - N_("STRING"), | ||
| 45 | - /* TRANSLATORS: It refers to passing the string through gettext. | ||
| 46 | - So it's "translate" in the same meaning as in what you're | ||
| 47 | - doing now. | ||
| 48 | - */ | ||
| 49 | - N_("Translates the string with the current settings.")); | ||
| 50 | + cmd = grub_register_command_p1 ("gettext", grub_cmd_translate, | ||
| 51 | + N_("STRING"), | ||
| 52 | + /* | ||
| 53 | + * TRANSLATORS: It refers to passing the string through gettext. | ||
| 54 | + * So it's "translate" in the same meaning as in what you're | ||
| 55 | + * doing now. | ||
| 56 | + */ | ||
| 57 | + N_("Translates the string with the current settings.")); | ||
| 58 | |||
| 59 | /* Reload .mo file information if lang changes. */ | ||
| 60 | grub_register_variable_hook ("lang", NULL, grub_gettext_env_write_lang); | ||
| 61 | @@ -544,6 +547,8 @@ GRUB_MOD_FINI (gettext) | ||
| 62 | grub_register_variable_hook ("secondary_locale_dir", NULL, NULL); | ||
| 63 | grub_register_variable_hook ("lang", NULL, NULL); | ||
| 64 | |||
| 65 | + grub_unregister_command (cmd); | ||
| 66 | + | ||
| 67 | grub_gettext_delete_list (&main_context); | ||
| 68 | grub_gettext_delete_list (&secondary_context); | ||
| 69 | |||
| 70 | -- | ||
| 71 | 2.34.1 | ||
| 72 | |||
diff --git a/meta/recipes-bsp/grub/files/CVE-2025-61663_61664.patch b/meta/recipes-bsp/grub/files/CVE-2025-61663_61664.patch new file mode 100644 index 0000000000..cdf1e4ca36 --- /dev/null +++ b/meta/recipes-bsp/grub/files/CVE-2025-61663_61664.patch | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | From a182bd873e4aa93205ecbb7845ef7f0eda99dcf5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alec Brown <alec.r.brown@oracle.com> | ||
| 3 | Date: Thu, 21 Aug 2025 21:14:07 +0000 | ||
| 4 | Subject: [PATCH 3/3] normal/main: Unregister commands on module unload | ||
| 5 | |||
| 6 | When the normal module is loaded, the normal and normal_exit commands | ||
| 7 | are registered but aren't unregistered when the module is unloaded. We | ||
| 8 | need to add calls to grub_unregister_command() when unloading the module | ||
| 9 | for these commands. | ||
| 10 | |||
| 11 | Fixes: CVE-2025-61663 | ||
| 12 | Fixes: CVE-2025-61664 | ||
| 13 | |||
| 14 | CVE: CVE-2025-61663 CVE-2025-61664 | ||
| 15 | |||
| 16 | Upstream-Status: Backport | ||
| 17 | [https://gitweb.git.savannah.gnu.org/gitweb/?p=grub.git;a=commit;h=05d3698b8b03eccc49e53491bbd75dba15f40917] | ||
| 18 | |||
| 19 | Reported-by: Alec Brown <alec.r.brown@oracle.com> | ||
| 20 | Signed-off-by: Alec Brown <alec.r.brown@oracle.com> | ||
| 21 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
| 22 | Signed-off-by: Jiaying Song <jiaying.song.cn@windriver.com> | ||
| 23 | --- | ||
| 24 | grub-core/normal/main.c | 12 +++++++----- | ||
| 25 | 1 file changed, 7 insertions(+), 5 deletions(-) | ||
| 26 | |||
| 27 | diff --git a/grub-core/normal/main.c b/grub-core/normal/main.c | ||
| 28 | index a95c25e5f..9d576de7a 100644 | ||
| 29 | --- a/grub-core/normal/main.c | ||
| 30 | +++ b/grub-core/normal/main.c | ||
| 31 | @@ -499,7 +499,7 @@ grub_mini_cmd_clear (struct grub_command *cmd __attribute__ ((unused)), | ||
| 32 | return 0; | ||
| 33 | } | ||
| 34 | |||
| 35 | -static grub_command_t cmd_clear; | ||
| 36 | +static grub_command_t cmd_clear, cmd_normal, cmd_normal_exit; | ||
| 37 | |||
| 38 | static void (*grub_xputs_saved) (const char *str); | ||
| 39 | static const char *features[] = { | ||
| 40 | @@ -541,10 +541,10 @@ GRUB_MOD_INIT(normal) | ||
| 41 | grub_env_export ("pager"); | ||
| 42 | |||
| 43 | /* Register a command "normal" for the rescue mode. */ | ||
| 44 | - grub_register_command ("normal", grub_cmd_normal, | ||
| 45 | - 0, N_("Enter normal mode.")); | ||
| 46 | - grub_register_command ("normal_exit", grub_cmd_normal_exit, | ||
| 47 | - 0, N_("Exit from normal mode.")); | ||
| 48 | + cmd_normal = grub_register_command ("normal", grub_cmd_normal, | ||
| 49 | + 0, N_("Enter normal mode.")); | ||
| 50 | + cmd_normal_exit = grub_register_command ("normal_exit", grub_cmd_normal_exit, | ||
| 51 | + 0, N_("Exit from normal mode.")); | ||
| 52 | |||
| 53 | /* Reload terminal colors when these variables are written to. */ | ||
| 54 | grub_register_variable_hook ("color_normal", NULL, grub_env_write_color_normal); | ||
| 55 | @@ -586,4 +586,6 @@ GRUB_MOD_FINI(normal) | ||
| 56 | grub_register_variable_hook ("color_highlight", NULL, NULL); | ||
| 57 | grub_fs_autoload_hook = 0; | ||
| 58 | grub_unregister_command (cmd_clear); | ||
| 59 | + grub_unregister_command (cmd_normal); | ||
| 60 | + grub_unregister_command (cmd_normal_exit); | ||
| 61 | } | ||
| 62 | -- | ||
| 63 | 2.34.1 | ||
| 64 | |||
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index 94eeadfb99..4744e26693 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc | |||
| @@ -60,6 +60,9 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ | |||
| 60 | file://CVE-2025-0690.patch \ | 60 | file://CVE-2025-0690.patch \ |
| 61 | file://CVE-2025-1118.patch \ | 61 | file://CVE-2025-1118.patch \ |
| 62 | file://CVE-2024-56738.patch \ | 62 | file://CVE-2024-56738.patch \ |
| 63 | file://CVE-2025-61661.patch \ | ||
| 64 | file://CVE-2025-61662.patch \ | ||
| 65 | file://CVE-2025-61663_61664.patch \ | ||
| 63 | " | 66 | " |
| 64 | 67 | ||
| 65 | SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" | 68 | SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" |
