Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'qcom-drivers-fixes-for-6.17' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes

Qualcomm driver fixes for v6.17-rc1

The recently extended sanity checks for the Qualcomm firmware files
turned out to be too restrictive, preventing a variety of firmware
images from being loaded. Adjust the checks to allow section header
sizes of 0 when sections aren't used.

* tag 'qcom-drivers-fixes-for-6.17' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux:
soc: qcom: mdt_loader: Deal with zero e_shentsize

Link: https://lore.kernel.org/r/20250811145613.120917-1-andersson@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+7 -5
+7 -5
drivers/soc/qcom/mdt_loader.c
··· 39 39 if (phend > fw->size) 40 40 return false; 41 41 42 - if (ehdr->e_shentsize != sizeof(struct elf32_shdr)) 43 - return false; 42 + if (ehdr->e_shentsize || ehdr->e_shnum) { 43 + if (ehdr->e_shentsize != sizeof(struct elf32_shdr)) 44 + return false; 44 45 45 - shend = size_add(size_mul(sizeof(struct elf32_shdr), ehdr->e_shnum), ehdr->e_shoff); 46 - if (shend > fw->size) 47 - return false; 46 + shend = size_add(size_mul(sizeof(struct elf32_shdr), ehdr->e_shnum), ehdr->e_shoff); 47 + if (shend > fw->size) 48 + return false; 49 + } 48 50 49 51 return true; 50 52 }