Linux-ARM-MSM Archive on
 help / color / Atom feed
From: Sibi Sankar <>
	Sibi Sankar <>,
Subject: [PATCH v3 1/3] remoteproc: qcom_q6v5_mss: Validate MBA firmware size before load
Date: Thu, 23 Jul 2020 01:40:45 +0530
Message-ID: <> (raw)
In-Reply-To: <>

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

Err Logs:
Unable to handle kernel paging request at virtual address
Mem abort info:
Call trace:

Fixes: 051fb70fd4ea4 ("remoteproc: qcom: Driver for the self-authenticating Hexagon v5")
Signed-off-by: Sibi Sankar <>
 drivers/remoteproc/qcom_q6v5_mss.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 718acebae777f..4e72c9e30426c 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -412,6 +412,12 @@ static int q6v5_load(struct rproc *rproc, const struct firmware *fw)
 	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;
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22 20:10 [PATCH v3 0/3] Add modem debug features Sibi Sankar
2020-07-22 20:10 ` Sibi Sankar [this message]
2020-07-28  5:45   ` [PATCH v3 1/3] remoteproc: qcom_q6v5_mss: Validate MBA firmware size before load Bjorn Andersson
2020-07-22 20:10 ` [PATCH v3 2/3] remoteproc: qcom_q6v5_mss: Validate modem blob " Sibi Sankar
2020-07-28  6:04   ` Bjorn Andersson
2020-07-22 20:10 ` [PATCH v3 3/3] remoteproc: qcom_q6v5_mss: Add modem debug policy support Sibi Sankar
2020-07-28  5:48   ` Bjorn Andersson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-ARM-MSM Archive on

Archives are clonable:
	git clone --mirror linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ \
	public-inbox-index linux-arm-msm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone