diff options
Diffstat (limited to 'meta/recipes-bsp/grub/files/CVE-2024-45781.patch')
| -rw-r--r-- | meta/recipes-bsp/grub/files/CVE-2024-45781.patch | 38 |
1 files changed, 38 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..fb91fa45c7 --- /dev/null +++ b/meta/recipes-bsp/grub/files/CVE-2024-45781.patch | |||
| @@ -0,0 +1,38 @@ | |||
| 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: Hitendra Prajapati <hprajapati@mvista.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 34a698b..4727266 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) | ||
| 36 | -- | ||
| 37 | 2.25.1 | ||
| 38 | |||
