diff options
| -rw-r--r-- | meta/recipes-bsp/grub/files/CVE-2024-45776.patch | 39 | ||||
| -rw-r--r-- | meta/recipes-bsp/grub/grub2.inc | 1 |
2 files changed, 40 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/CVE-2024-45776.patch b/meta/recipes-bsp/grub/files/CVE-2024-45776.patch new file mode 100644 index 0000000000..8deea958b8 --- /dev/null +++ b/meta/recipes-bsp/grub/files/CVE-2024-45776.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From 09bd6eb58b0f71ec273916070fa1e2de16897a91 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Lidong Chen <lidong.chen@oracle.com> | ||
| 3 | Date: Fri, 22 Nov 2024 06:27:56 +0000 | ||
| 4 | Subject: [PATCH] gettext: Integer overflow leads to heap OOB write or read | ||
| 5 | |||
| 6 | Calculation of ctx->grub_gettext_msg_list size in grub_mofile_open() may | ||
| 7 | overflow leading to subsequent OOB write or read. This patch fixes the | ||
| 8 | issue by replacing grub_zalloc() and explicit multiplication with | ||
| 9 | grub_calloc() which does the same thing in safe manner. | ||
| 10 | |||
| 11 | Fixes: CVE-2024-45776 | ||
| 12 | |||
| 13 | Reported-by: Nils Langius <nils@langius.de> | ||
| 14 | Signed-off-by: Lidong Chen <lidong.chen@oracle.com> | ||
| 15 | Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com> | ||
| 16 | Reviewed-by: Alec Brown <alec.r.brown@oracle.com> | ||
| 17 | |||
| 18 | CVE: CVE-2024-45776 | ||
| 19 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=09bd6eb58b0f71ec273916070fa1e2de16897a91] | ||
| 20 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 21 | --- | ||
| 22 | grub-core/gettext/gettext.c | 4 ++-- | ||
| 23 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c | ||
| 26 | index e4f4f8ee6..63bb1ab73 100644 | ||
| 27 | --- a/grub-core/gettext/gettext.c | ||
| 28 | +++ b/grub-core/gettext/gettext.c | ||
| 29 | @@ -323,8 +323,8 @@ grub_mofile_open (struct grub_gettext_context *ctx, | ||
| 30 | for (ctx->grub_gettext_max_log = 0; ctx->grub_gettext_max >> ctx->grub_gettext_max_log; | ||
| 31 | ctx->grub_gettext_max_log++); | ||
| 32 | |||
| 33 | - ctx->grub_gettext_msg_list = grub_zalloc (ctx->grub_gettext_max | ||
| 34 | - * sizeof (ctx->grub_gettext_msg_list[0])); | ||
| 35 | + ctx->grub_gettext_msg_list = grub_calloc (ctx->grub_gettext_max, | ||
| 36 | + sizeof (ctx->grub_gettext_msg_list[0])); | ||
| 37 | if (!ctx->grub_gettext_msg_list) | ||
| 38 | { | ||
| 39 | grub_file_close (fd); | ||
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index 7d463f8aeb..581855eb4b 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc | |||
| @@ -29,6 +29,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ | |||
| 29 | file://CVE-2025-0622-01.patch \ | 29 | file://CVE-2025-0622-01.patch \ |
| 30 | file://CVE-2025-0622-02.patch \ | 30 | file://CVE-2025-0622-02.patch \ |
| 31 | file://CVE-2025-0622-03.patch \ | 31 | file://CVE-2025-0622-03.patch \ |
| 32 | file://CVE-2024-45776.patch \ | ||
| 32 | " | 33 | " |
| 33 | 34 | ||
| 34 | SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" | 35 | SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" |
