Patch "efi/capsule-loader: fix incorrect allocation size" has been added to the 6.7-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    efi/capsule-loader: fix incorrect allocation size

to the 6.7-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     efi-capsule-loader-fix-incorrect-allocation-size.patch
and it can be found in the queue-6.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9e35afa49051c9e41195cf71d7fa0522d20b56a5
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date:   Mon Feb 12 12:24:40 2024 +0100

    efi/capsule-loader: fix incorrect allocation size
    
    [ Upstream commit fccfa646ef3628097d59f7d9c1a3e84d4b6bb45e ]
    
    gcc-14 notices that the allocation with sizeof(void) on 32-bit architectures
    is not enough for a 64-bit phys_addr_t:
    
    drivers/firmware/efi/capsule-loader.c: In function 'efi_capsule_open':
    drivers/firmware/efi/capsule-loader.c:295:24: error: allocation of insufficient size '4' for type 'phys_addr_t' {aka 'long long unsigned int'} with size '8' [-Werror=alloc-size]
      295 |         cap_info->phys = kzalloc(sizeof(void *), GFP_KERNEL);
          |                        ^
    
    Use the correct type instead here.
    
    Fixes: f24c4d478013 ("efi/capsule-loader: Reinstate virtual capsule mapping")
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Signed-off-by: Ard Biesheuvel <ardb@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c
index 3e8d4b51a8140..97bafb5f70389 100644
--- a/drivers/firmware/efi/capsule-loader.c
+++ b/drivers/firmware/efi/capsule-loader.c
@@ -292,7 +292,7 @@ static int efi_capsule_open(struct inode *inode, struct file *file)
 		return -ENOMEM;
 	}
 
-	cap_info->phys = kzalloc(sizeof(void *), GFP_KERNEL);
+	cap_info->phys = kzalloc(sizeof(phys_addr_t), GFP_KERNEL);
 	if (!cap_info->phys) {
 		kfree(cap_info->pages);
 		kfree(cap_info);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux