lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 19 Feb 2018 23:41:11 +0100
From:   Enric Balletbo i Serra <enric.balletbo@...labora.com>
To:     Lee Jones <lee.jones@...aro.org>
Cc:     groeck@...omium.org, gwendal@...omium.org, bleung@...omium.org,
        linux-kernel@...r.kernel.org, kernel@...labora.com
Subject: [PATCH 5/6] mfd: cros_ec_dev: Check communication with ec at resume

From: Gwendal Grignou <gwendal@...omium.org>

Send dummy command to EC at resume time, wait for status.
If EC loses that command and return a status for the
pre-suspend command, we will not interpret that status as an
answer for an important command.

Signed-off-by: Gwendal Grignou <gwendal@...omium.org>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@...labora.com>
---
 drivers/mfd/cros_ec_dev.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
index fc98e0564061..c901839317ae 100644
--- a/drivers/mfd/cros_ec_dev.c
+++ b/drivers/mfd/cros_ec_dev.c
@@ -553,6 +553,16 @@ static __maybe_unused int ec_device_suspend(struct device *dev)
 static __maybe_unused int ec_device_resume(struct device *dev)
 {
 	struct cros_ec_dev *ec = dev_get_drvdata(dev);
+	char msg[sizeof(struct ec_response_get_version) +
+		 sizeof(CROS_EC_DEV_VERSION)];
+	int ret;
+
+	/* Be sure the communication with the EC is reestablished */
+	ret = ec_get_version(ec, msg, sizeof(msg));
+	if (ret < 0) {
+		dev_err(ec->ec_dev->dev, "No EC response at resume: %d\n", ret);
+		return 0;
+	}
 
 	lb_resume(ec);
 
-- 
2.16.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ