DivestOS/Patches/Linux_CVEs/CVE-2017-8281/4.4/0002.patch

35 lines
1.1 KiB
Diff
Raw Normal View History

2017-11-07 17:32:46 -05:00
From 9b209c4552779edb86221787fb8681dd212e3a0c Mon Sep 17 00:00:00 2001
From: Mohit Aggarwal <maggarwa@codeaurora.org>
Date: Sat, 22 Apr 2017 10:49:18 +0530
Subject: diag: dci: Add protection while querying event status
Currently, protection is missing when querying event
status due to which already removed dci client entry
might be accessed. This patch takes care of issue by
taking proper locking.
CRs-Fixed: 2015892
Change-Id: I4195c4c6198d85e96559f1728d74419527a76bc5
Signed-off-by: Mohit Aggarwal <maggarwa@codeaurora.org>
---
drivers/char/diag/diagchar_core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/char/diag/diagchar_core.c b/drivers/char/diag/diagchar_core.c
2017-11-07 17:32:46 -05:00
index 574a13d..9a5f196 100644
--- a/drivers/char/diag/diagchar_core.c
+++ b/drivers/char/diag/diagchar_core.c
2017-11-07 17:32:46 -05:00
@@ -2336,7 +2336,9 @@ long diagchar_ioctl(struct file *filp,
mutex_unlock(&driver->dci_mutex);
break;
case DIAG_IOCTL_DCI_EVENT_STATUS:
+ mutex_lock(&driver->dci_mutex);
result = diag_ioctl_dci_event_status(ioarg);
+ mutex_unlock(&driver->dci_mutex);
break;
case DIAG_IOCTL_DCI_CLEAR_LOGS:
2017-11-07 17:32:46 -05:00
mutex_lock(&driver->dci_mutex);
--
cgit v1.1