]> git.baikalelectronics.ru Git - kernel.git/commit
soc: qcom: mdt_loader: Validate that p_filesz < p_memsz
authorBjorn Andersson <bjorn.andersson@linaro.org>
Thu, 7 Jan 2021 23:31:19 +0000 (15:31 -0800)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Thu, 8 Apr 2021 15:28:55 +0000 (10:28 -0500)
commita04097151d282e7e88ceda624c285e28f1e20469
tree0df102a1f3f80dbd319b809bd73b7218c13291e1
parenteb2ec70fad48905fb52cafc763e8372740301840
soc: qcom: mdt_loader: Validate that p_filesz < p_memsz

The code validates that segments of p_memsz bytes of a segment will fit
in the provided memory region, but does not validate that p_filesz bytes
will, which means that an incorrectly crafted ELF header might write
beyond the provided memory region.

Fixes: ed73639ccaeb ("remoteproc: qcom: Driver for the self-authenticating Hexagon v5")
Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
Link: https://lore.kernel.org/r/20210107233119.717173-1-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/soc/qcom/mdt_loader.c