This is a note to let you know that I've just added the patch titled remoteproc: qcom_q6v5_mss: Validate MBA firmware size before load to the 5.8-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: remoteproc-qcom_q6v5_mss-validate-mba-firmware-size-before-load.patch and it can be found in the queue-5.8 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From e013f455d95add874f310dc47c608e8c70692ae5 Mon Sep 17 00:00:00 2001 From: Sibi Sankar <sibis@xxxxxxxxxxxxxx> Date: Thu, 23 Jul 2020 01:40:45 +0530 Subject: remoteproc: qcom_q6v5_mss: Validate MBA firmware size before load From: Sibi Sankar <sibis@xxxxxxxxxxxxxx> commit e013f455d95add874f310dc47c608e8c70692ae5 upstream. The following mem abort is observed when the mba firmware size exceeds the allocated mba region. MBA firmware size is restricted to a maximum size of 1M and remaining memory region is used by modem debug policy firmware when available. Hence verify whether the MBA firmware size lies within the allocated memory region and is not greater than 1M before loading. Err Logs: Unable to handle kernel paging request at virtual address Mem abort info: ... Call trace: __memcpy+0x110/0x180 rproc_start+0x40/0x218 rproc_boot+0x5b4/0x608 state_store+0x54/0xf8 dev_attr_store+0x44/0x60 sysfs_kf_write+0x58/0x80 kernfs_fop_write+0x140/0x230 vfs_write+0xc4/0x208 ksys_write+0x74/0xf8 __arm64_sys_write+0x24/0x30 ... Reviewed-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx> Fixes: 051fb70fd4ea4 ("remoteproc: qcom: Driver for the self-authenticating Hexagon v5") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Sibi Sankar <sibis@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20200722201047.12975-2-sibis@xxxxxxxxxxxxxx Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/remoteproc/qcom_q6v5_mss.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -407,6 +407,12 @@ static int q6v5_load(struct rproc *rproc { struct q6v5 *qproc = rproc->priv; + /* MBA is restricted to a maximum size of 1M */ + if (fw->size > qproc->mba_size || fw->size > SZ_1M) { + dev_err(qproc->dev, "MBA firmware load failed\n"); + return -EINVAL; + } + memcpy(qproc->mba_region, fw->data, fw->size); return 0; Patches currently in stable-queue which might be from sibis@xxxxxxxxxxxxxx are queue-5.8/arm64-dts-qcom-sc7180-drop-the-unused-non-msa-sid.patch queue-5.8/remoteproc-qcom_q6v5_mss-validate-modem-blob-firmware-size-before-load.patch queue-5.8/remoteproc-qcom_q6v5_mss-validate-mba-firmware-size-before-load.patch queue-5.8/remoteproc-qcom-q6v5-update-running-state-before-requesting-stop.patch