diff options
author | Peter Marko <peter.marko@siemens.com> | 2025-03-11 19:14:10 +0100 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2025-03-15 06:44:47 -0700 |
commit | 01aac7e940410e64273643393613e4ee560ce9ca (patch) | |
tree | e1198eb1a0afb0a50f16c3c072892fa05a38096e /meta/recipes-bsp/grub | |
parent | 039f52ed9c3e3f7326eef84c3175677591d8b38a (diff) | |
download | poky-01aac7e940410e64273643393613e4ee560ce9ca.tar.gz |
grup: patch CVE-2024-45781
Cherry-pick patch mentioning this CVE.
(From OE-Core rev: ef41ef5730d08371d1eb03f94fa9357edf26889f)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-bsp/grub')
-rw-r--r-- | meta/recipes-bsp/grub/files/CVE-2024-45781.patch | 35 | ||||
-rw-r--r-- | meta/recipes-bsp/grub/grub2.inc | 1 |
2 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/CVE-2024-45781.patch b/meta/recipes-bsp/grub/files/CVE-2024-45781.patch new file mode 100644 index 0000000000..bd0b6aa04a --- /dev/null +++ b/meta/recipes-bsp/grub/files/CVE-2024-45781.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From c1a291b01f4f1dcd6a22b61f1c81a45a966d16ba Mon Sep 17 00:00:00 2001 | ||
2 | From: B Horn <b@horn.uk> | ||
3 | Date: Sun, 12 May 2024 02:03:33 +0100 | ||
4 | Subject: [PATCH 2/2] fs/ufs: Fix a heap OOB write | ||
5 | |||
6 | grub_strcpy() was used to copy a symlink name from the filesystem | ||
7 | image to a heap allocated buffer. This led to a OOB write to adjacent | ||
8 | heap allocations. Fix by using grub_strlcpy(). | ||
9 | |||
10 | Fixes: CVE-2024-45781 | ||
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-2024-45781 | ||
17 | Upstream-Status: Backport [https://git.savannah.gnu.org/cgit/grub.git/commit/?id=c1a291b01f4f1dcd6a22b61f1c81a45a966d16ba] | ||
18 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
19 | --- | ||
20 | grub-core/fs/ufs.c | 2 +- | ||
21 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
22 | |||
23 | diff --git a/grub-core/fs/ufs.c b/grub-core/fs/ufs.c | ||
24 | index a354c92d9..01235101b 100644 | ||
25 | --- a/grub-core/fs/ufs.c | ||
26 | +++ b/grub-core/fs/ufs.c | ||
27 | @@ -463,7 +463,7 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino) | ||
28 | /* Check against zero is paylindromic, no need to swap. */ | ||
29 | if (data->inode.nblocks == 0 | ||
30 | && INODE_SIZE (data) <= sizeof (data->inode.symlink)) | ||
31 | - grub_strcpy (symlink, (char *) data->inode.symlink); | ||
32 | + grub_strlcpy (symlink, (char *) data->inode.symlink, sz); | ||
33 | else | ||
34 | { | ||
35 | if (grub_ufs_read_file (data, 0, 0, 0, sz, symlink) < 0) | ||
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc index 43ba632ce2..58f4a6e181 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc | |||
@@ -19,6 +19,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ | |||
19 | file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ | 19 | file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ |
20 | file://0001-RISC-V-Restore-the-typcast-to-long.patch \ | 20 | file://0001-RISC-V-Restore-the-typcast-to-long.patch \ |
21 | file://0001-misc-Implement-grub_strlcpy.patch \ | 21 | file://0001-misc-Implement-grub_strlcpy.patch \ |
22 | file://CVE-2024-45781.patch \ | ||
22 | " | 23 | " |
23 | 24 | ||
24 | SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" | 25 | SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" |