summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorJames Zhao <jamesz@nvidia.com>2013-09-25 14:10:00 -0700
committerAjay Nandakumar <anandakumarm@nvidia.com>2013-10-03 19:17:32 +0530
commite6a669078f2a8de8d7fa4a48077b304811f34abb (patch)
tree69bd1eb7a97c2f6f7294ad7c8dec5ab2379d00dc /security
parent8cd786e63be1dbb255c306c00bb518fd5139e232 (diff)
security: tlk_driver: serialize calls to tlk
Add mutex lock to serialize all ioctls that will result in a smc call to tlk. bug 1340442 bug 1340471 Change-Id: Ie2cc1e21dcff0a78c971aad0c230f71d1f2b1c49 Signed-off-by: James Zhao <jamesz@nvidia.com> (cherry picked from commit 2a9da9d1c1e717d7f44befb0ca84cbca413b9e3f) Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>
Diffstat (limited to 'security')
-rw-r--r--security/tlk_driver/ote_device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/security/tlk_driver/ote_device.c b/security/tlk_driver/ote_device.c
index 629243297bfb..9016a318c09f 100644
--- a/security/tlk_driver/ote_device.c
+++ b/security/tlk_driver/ote_device.c
@@ -38,6 +38,7 @@
#include <trace/events/nvsecurity.h>
struct tlk_device tlk_dev;
+static DEFINE_MUTEX(smc_lock);
u32 notrace tegra_read_cycle(void)
{
@@ -423,7 +424,9 @@ static long tlk_device_ioctl(struct file *file, unsigned int ioctl_num,
case TE_IOCTL_OPEN_CLIENT_SESSION:
case TE_IOCTL_CLOSE_CLIENT_SESSION:
case TE_IOCTL_LAUNCH_OPERATION:
+ mutex_lock(&smc_lock);
err = te_handle_trustedapp_ioctl(file, ioctl_num, ioctl_param);
+ mutex_unlock(&smc_lock);
break;
case TE_IOCTL_FILE_NEW_REQ: