qbt1000: Terminate fingerprint TA name with null

Terminate the string, coming from userspace and containing the name
of fingerprint trusted app, with null character, to make sure kernel
memory does not leak into logs

Change-Id: I1668a64fcb6747ce3ef3b1ee6321fa5fa4a1798a
CRs-Fixed: 2029409
Signed-off-by: Abir Ghosh <abirg@codeaurora.org>
This commit is contained in:
Abir Ghosh 2017-04-11 10:01:15 +05:30 committed by Gerrit - the friendly Code Review server
parent 5d78c03af8
commit 07f699a324

View file

@ -414,6 +414,7 @@ static long qbt1000_ioctl(struct file *file, unsigned cmd, unsigned long arg)
}
pr_debug("app %s load before\n", app.name);
app.name[MAX_NAME_SIZE - 1] = '\0';
/* start the TZ app */
rc = qseecom_start_app(
@ -427,7 +428,8 @@ static long qbt1000_ioctl(struct file *file, unsigned cmd, unsigned long arg)
pr_err("App %s failed to set bw\n", app.name);
}
} else {
pr_err("app %s failed to load\n", app.name);
dev_err(drvdata->dev, "%s: Fingerprint Trusted App failed to load\n",
__func__);
goto end;
}