mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-27 17:49:23 +00:00
fs/ufs: Fix a heap OOB write
grub_strcpy() was used to copy a symlink name from the filesystem image to a heap allocated buffer. This led to a OOB write to adjacent heap allocations. Fix by using grub_strlcpy(). Fixes: CVE-2024-45781 Reported-by: B Horn <b@horn.uk> Signed-off-by: B Horn <b@horn.uk> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
1 parent
ea703528a8
commit
c1a291b01f
1 file changed
+1
-1
+1
-1
@@ -463,7 +463,7 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino)
|
|||||||
/* Check against zero is paylindromic, no need to swap. */
|
/* Check against zero is paylindromic, no need to swap. */
|
||||||
if (data->inode.nblocks == 0
|
if (data->inode.nblocks == 0
|
||||||
&& INODE_SIZE (data) <= sizeof (data->inode.symlink))
|
&& INODE_SIZE (data) <= sizeof (data->inode.symlink))
|
||||||
grub_strcpy (symlink, (char *) data->inode.symlink);
|
grub_strlcpy (symlink, (char *) data->inode.symlink, sz);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (grub_ufs_read_file (data, 0, 0, 0, sz, symlink) < 0)
|
if (grub_ufs_read_file (data, 0, 0, 0, sz, symlink) < 0)
|
||||||
|
|||||||
Reference in new issue
Block a user