Resolves: CVE-2024-45781 CVE-2024-45783 CVE-2024-45778 Resolves: CVE-2024-45775 CVE-2024-45780 CVE-2024-45774 Resolves: CVE-2025-0690 CVE-2025-1118 CVE-2024-45782 Resolves: CVE-2025-0624 CVE-2024-45779 CVE-2024-45776 Resolves: CVE-2025-0622 CVE-2025-0677 Resolves: #RHEL-80691 Resolves: #RHEL-80690 Resolves: #RHEL-80689 Resolves: #RHEL-80687 Resolves: #RHEL-80686 Signed-off-by: Leo Sandoval <lsandova@redhat.com> Signed-off-by: Nicolas Frayer <nfrayer@redhat.com>
		
			
				
	
	
		
			33 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
 | |
| From: Alec Brown <alec.r.brown@oracle.com>
 | |
| Date: Tue, 28 Jan 2025 05:15:50 +0000
 | |
| Subject: [PATCH] fs/sfs: Check if allocated memory is NULL
 | |
| 
 | |
| When using grub_zalloc(), if we are out of memory, this function can fail.
 | |
| After allocating memory, we should check if grub_zalloc() returns NULL.
 | |
| If so, we should handle this error.
 | |
| 
 | |
| Fixes: CID 473856
 | |
| 
 | |
| Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
 | |
| Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
 | |
| Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
 | |
| ---
 | |
|  grub-core/fs/sfs.c | 3 +++
 | |
|  1 file changed, 3 insertions(+)
 | |
| 
 | |
| diff --git a/grub-core/fs/sfs.c b/grub-core/fs/sfs.c
 | |
| index 88705b3a2..bad4ae8d1 100644
 | |
| --- a/grub-core/fs/sfs.c
 | |
| +++ b/grub-core/fs/sfs.c
 | |
| @@ -429,6 +429,9 @@ grub_sfs_mount (grub_disk_t disk)
 | |
|  	     - 24    /* offsetof (struct grub_sfs_objc, objects) */
 | |
|  	     - 25);  /* offsetof (struct grub_sfs_obj, filename) */
 | |
|    data->label = grub_zalloc (max_len + 1);
 | |
| +  if (data->label == NULL)
 | |
| +    goto fail;
 | |
| +
 | |
|    grub_strncpy (data->label, (char *) rootobjc->objects[0].filename, max_len);
 | |
|  
 | |
|    grub_free (rootobjc_data);
 |