[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5u4vb4wjqvc7zlcwtyeixfhb6qnx5vppgnscvt3ypft5olcnig@rmbscleivq3u>
Date: Mon, 16 Jun 2025 17:06:11 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Bjorn Andersson <bjorn.andersson@....qualcomm.com>
Cc: Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konradybcio@...nel.org>, linux-arm-msm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-remoteproc@...r.kernel.org,
Mukesh Ojha <mukesh.ojha@....qualcomm.com>,
Doug Anderson <dianders@...omium.org>, stable@...r.kernel.org
Subject: Re: [PATCH v2 1/3] soc: qcom: mdt_loader: Ensure we don't read past
the ELF header
On Tue, Jun 10, 2025 at 09:58:28PM -0500, Bjorn Andersson wrote:
> When the MDT loader is used in remoteproc, the ELF header is sanitized
> beforehand, but that's not necessary the case for other clients.
>
> Validate the size of the firmware buffer to ensure that we don't read
> past the end as we iterate over the header. e_phentsize and e_shentsize
> are validated as well, to ensure that the assumptions about step size in
> the traversal are valid.
>
> Fixes: 2aad40d911ee ("remoteproc: Move qcom_mdt_loader into drivers/soc/qcom")
> Cc: <stable@...r.kernel.org>
> Reported-by: Doug Anderson <dianders@...omium.org>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@....qualcomm.com>
> ---
> drivers/soc/qcom/mdt_loader.c | 43 +++++++++++++++++++++++++++++++++++++++++++
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
Nit: in theory we don't need to validate section headers since we don't
use them in the loader. However it's better be safe than sorry.
> 1 file changed, 43 insertions(+)
>
--
With best wishes
Dmitry
Powered by blists - more mailing lists