Merge "qseecom: check invalid handle for app loaded query request"

This commit is contained in:
Linux Build Service Account 2019-09-03 14:02:17 -07:00 committed by Gerrit - the friendly Code Review server
commit 691b7ecff9

View file

@ -1,6 +1,6 @@
/*Qualcomm Secure Execution Environment Communicator (QSEECOM) driver /*Qualcomm Secure Execution Environment Communicator (QSEECOM) driver
* *
* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and
@ -7281,6 +7281,13 @@ long qseecom_ioctl(struct file *file, unsigned cmd, unsigned long arg)
break; break;
} }
case QSEECOM_IOCTL_APP_LOADED_QUERY_REQ: { case QSEECOM_IOCTL_APP_LOADED_QUERY_REQ: {
if ((data->type != QSEECOM_GENERIC) &&
(data->type != QSEECOM_CLIENT_APP)) {
pr_err("app loaded query req: invalid handle (%d)\n",
data->type);
ret = -EINVAL;
break;
}
data->type = QSEECOM_CLIENT_APP; data->type = QSEECOM_CLIENT_APP;
mutex_lock(&app_access_lock); mutex_lock(&app_access_lock);
atomic_inc(&data->ioctl_count); atomic_inc(&data->ioctl_count);