]> git.hungrycats.org Git - linux/commit
remoteproc: qcom_q6v5_mss: Validate p_filesz in ELF loader
authorBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 12 Mar 2021 23:20:02 +0000 (15:20 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:29:37 +0000 (10:29 +0200)
commit4900d94f34f9dbc59caffb84f2cbbc099abf7bb1
treece721fca59b35704d627e59d52c086f67a25c07e
parentd5b9e8bed59093e551e8a6272ad949eee75ef390
remoteproc: qcom_q6v5_mss: Validate p_filesz in ELF loader

[ Upstream commit 3d2ee78906af5f08d499d6aa3aa504406fa38106 ]

Analog to the issue in the common mdt_loader code the MSS ELF loader
does not validate that p_filesz bytes will fit in the memory region and
that the loaded segments are not truncated. Fix this in the same way
as proposed for the mdt_loader.

Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Fixes: 135b9e8d1cd8 ("remoteproc: qcom_q6v5_mss: Validate modem blob firmware size before load")
Link: https://lore.kernel.org/r/20210312232002.3466791-1-bjorn.andersson@linaro.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/remoteproc/qcom_q6v5_mss.c