Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1374852 > unrolled thread

[PATCH 4.5 086/238] mei: bus: check if the device is enabled before data transfer

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2016-04-10 20:50 +0200
Last post2016-04-10 20:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.5 086/238] mei: bus: check if the device is enabled before data transfer Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-04-10 20:50 +0200

#1374852 — [PATCH 4.5 086/238] mei: bus: check if the device is enabled before data transfer

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-04-10 20:50 +0200
Subject[PATCH 4.5 086/238] mei: bus: check if the device is enabled before data transfer
Message-ID<rmsAO-Sh-33@gated-at.bofh.it>
4.5-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Alexander Usyskin <alexander.usyskin@intel.com>

commit 15c13dfcad883a1e76b714480fb27be96247fd82 upstream.

The bus data transfer interface was missing the check if the device is
in enabled state, this may lead to stack corruption during link reset.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/misc/mei/bus.c |    9 +++++++++
 1 file changed, 9 insertions(+)

--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -53,6 +53,11 @@ ssize_t __mei_cl_send(struct mei_cl *cl,
 	bus = cl->dev;
 
 	mutex_lock(&bus->device_lock);
+	if (bus->dev_state != MEI_DEV_ENABLED) {
+		rets = -ENODEV;
+		goto out;
+	}
+
 	if (!mei_cl_is_connected(cl)) {
 		rets = -ENODEV;
 		goto out;
@@ -109,6 +114,10 @@ ssize_t __mei_cl_recv(struct mei_cl *cl,
 	bus = cl->dev;
 
 	mutex_lock(&bus->device_lock);
+	if (bus->dev_state != MEI_DEV_ENABLED) {
+		rets = -ENODEV;
+		goto out;
+	}
 
 	cb = mei_cl_read_cb(cl, NULL);
 	if (cb)

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web