Re: [PATCH] soc: qcom: mdt_loader: Deal with zero e_shentsize

From: Neil Armstrong
Date: Mon Aug 11 2025 - 05:23:53 EST


On 30/07/2025 22:51, Bjorn Andersson wrote:
Firmware that doesn't provide section headers leave both e_shentsize and
e_shnum 0, which obvious isn't compatible with the newly introduced
stricter checks.

Make the section-related checks conditional on either of these values
being non-zero.

Fixes: 9f9967fed9d0 ("soc: qcom: mdt_loader: Ensure we don't read past the ELF header")
Reported-by: Val Packett <val@xxxxxxxxxxxx>
Closes: https://lore.kernel.org/all/ece307c3-7d65-440f-babd-88cf9705b908@xxxxxxxxxxxx/
Reported-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx>
Closes: https://lore.kernel.org/all/aec9cd03-6fc2-4dc8-b937-8b7cf7bf4128@xxxxxxxxxx/
Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxxxxxxxx>
---
drivers/soc/qcom/mdt_loader.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)


The issue solved by this fix is still present on v6.17-rc1, even if we reported
a breakage over -next on the 22th of July.

Neil