soc: qcom: mdt_loader: Enhance split binary detection
authorGokul krishna Krishnakumar <quic_gokukris@quicinc.com>
Tue, 9 May 2023 00:18:21 +0000 (17:18 -0700)
committerBjorn Andersson <andersson@kernel.org>
Thu, 25 May 2023 02:28:57 +0000 (19:28 -0700)
commit210d12c8197a551caa2979be421aa42381156aec
tree4724237ad4eeb1610c4cf790b7d2d703d287f0e8
parent4b11fa4f0737aae1a3fc3cdf367acd4ebb5bc941
soc: qcom: mdt_loader: Enhance split binary detection

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
drivers/soc/qcom/mdt_loader.c