summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbir Ghosh <abirg@codeaurora.org>2017-05-02 22:41:06 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-03 23:20:55 -0700
commit9f6e16f245bef78265c5a02b3cf0aae5b3d58a4d (patch)
treebc3e16c8a3a4511764f5cf7f122c6b8ab8db50ee
parent5d78c03af8ffb440d418cbc45ad0d68928354e48 (diff)
qbt1000: Validate FP app name before qseecom_start_app
Validate the name of the client app before passing it to qseecom_start_app. CRs-Fixed: 2006695 Change-Id: I9c6b16050d4f6fc94827021c7b0f2ab292452f60 Signed-off-by: Abir Ghosh <abirg@codeaurora.org>
-rw-r--r--drivers/soc/qcom/qbt1000.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/soc/qcom/qbt1000.c b/drivers/soc/qcom/qbt1000.c
index 4ba92436bd06..b50f90f70ea5 100644
--- a/drivers/soc/qcom/qbt1000.c
+++ b/drivers/soc/qcom/qbt1000.c
@@ -401,6 +401,13 @@ static long qbt1000_ioctl(struct file *file, unsigned cmd, unsigned long arg)
goto end;
}
+ if (strcmp(app.name, FP_APP_NAME)) {
+ dev_err(drvdata->dev, "%s: Invalid app name\n",
+ __func__);
+ rc = -EINVAL;
+ goto end;
+ }
+
if (drvdata->app_handle) {
dev_err(drvdata->dev, "%s: LOAD app already loaded, unloading first\n",
__func__);
@@ -447,9 +454,7 @@ static long qbt1000_ioctl(struct file *file, unsigned cmd, unsigned long arg)
pr_debug("app %s load after\n", app.name);
- if (!strcmp(app.name, FP_APP_NAME))
- drvdata->fp_app_handle = drvdata->app_handle;
-
+ drvdata->fp_app_handle = drvdata->app_handle;
break;
}
case QBT1000_UNLOAD_APP: