]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
soc: qcom: mdt_loader: Enhance split binary detection
authorGokul krishna Krishnakumar <quic_gokukris@quicinc.com>
Fri, 22 Aug 2025 17:20:04 +0000 (13:20 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Aug 2025 14:26:15 +0000 (16:26 +0200)
commit321896eee38f272def3f77fd89a9820777dc650d
treebb5ce1eb474441906375de56aeaf5e1438b21457
parent4e79eed9949e10b74169d9e18d5a6e5eb39417c1
soc: qcom: mdt_loader: Enhance split binary detection

[ Upstream commit 210d12c8197a551caa2979be421aa42381156aec ]

It may be that the offset of the first program header lies inside the mdt's
filesize, in this case the loader would incorrectly assume that the bins
were not split and in this scenario the firmware authentication fails.
This change updates the logic used by the mdt loader to understand whether
the firmware images are split or not. It figures this out by checking if
each programs header's segment lies within the file or not.

Co-developed-by: Melody Olvera <quic_molvera@quicinc.com>
Signed-off-by: Melody Olvera <quic_molvera@quicinc.com>
Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/20230509001821.24010-1-quic_gokukris@quicinc.com
Stable-dep-of: 9f9967fed9d0 ("soc: qcom: mdt_loader: Ensure we don't read past the ELF header")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/soc/qcom/mdt_loader.c