diff options
| -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 f3279f7d2b..bace594ac4 100644 --- a/meta/recipes-bsp/grub/grub2.inc +++ b/meta/recipes-bsp/grub/grub2.inc | |||
| @@ -20,6 +20,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \ | |||
| 20 | file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ | 20 | file://0001-grub.d-10_linux.in-add-oe-s-kernel-name.patch \ |
| 21 | file://0001-RISC-V-Restore-the-typcast-to-long.patch \ | 21 | file://0001-RISC-V-Restore-the-typcast-to-long.patch \ |
| 22 | file://0001-misc-Implement-grub_strlcpy.patch \ | 22 | file://0001-misc-Implement-grub_strlcpy.patch \ |
| 23 | file://CVE-2024-45781.patch \ | ||
| 23 | " | 24 | " |
| 24 | 25 | ||
| 25 | SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" | 26 | SRC_URI[sha256sum] = "b30919fa5be280417c17ac561bb1650f60cfb80cc6237fa1e2b6f56154cb9c91" |
