diff options
author | Bjorn Andersson <bjorn.andersson@linaro.org> | 2017-02-15 14:00:41 -0800 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2017-02-22 02:07:13 -0800 |
commit | 01625cc5e65f420dbea57f7de6b9552a0f807a84 (patch) | |
tree | db133dd5046653862d136263a1238a185278d84a /drivers/soc/qcom | |
parent | 231c8dfd1a9ff530869e1327ba4168dbe592f3f9 (diff) | |
download | linux-stable-01625cc5e65f420dbea57f7de6b9552a0f807a84.tar.gz linux-stable-01625cc5e65f420dbea57f7de6b9552a0f807a84.tar.bz2 linux-stable-01625cc5e65f420dbea57f7de6b9552a0f807a84.zip |
remoteproc: qcom: mdt_loader: Use signed type for offset
In the transition from using rproc_da_to_va(), the type of the load
offset became unsigned. This causes the subsequent check to let negative
values less than p_memsz + mem_size through and we write outside of the
buffer.
Change the type back to a signed value to catch this.
Fixes: 7f0dd07a9b29 ("remoteproc: qcom: mdt_loader: Refactor MDT loader")
Fixes: e7fd25226295 ("remoteproc: qcom: q6v5: Decouple driver from MDT loader")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reported-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/soc/qcom')
-rw-r--r-- | drivers/soc/qcom/mdt_loader.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c index 98b2373c3a97..bd63df0d14e0 100644 --- a/drivers/soc/qcom/mdt_loader.c +++ b/drivers/soc/qcom/mdt_loader.c @@ -98,7 +98,7 @@ int qcom_mdt_load(struct device *dev, const struct firmware *fw, phys_addr_t min_addr = (phys_addr_t)ULLONG_MAX; phys_addr_t max_addr = 0; size_t fw_name_len; - size_t offset; + ssize_t offset; char *fw_name; bool relocate = false; void *ptr; |