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:   Thu, 6 Dec 2018 18:58:01 +0100
From:   Alexander Steffen <Alexander.Steffen@...ineon.com>
To:     Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
        Tadeusz Struk <tadeusz.struk@...el.com>
CC:     <jgg@...pe.ca>, <linux-integrity@...r.kernel.org>,
        <linux-security-module@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>,
        Alexander Steffen <Alexander.Steffen@...ineon.com>
Subject: [PATCH] tpm-dev: Require response to be read only if there actually is a response

If the tpm_transmit call in tpm_common_write fails for any reason, there is
no response that could be read. Therefore, do not require the application
to issue a read call before sending further commands. This restores the
behavior from before support for partial reads was introduced.

Signed-off-by: Alexander Steffen <Alexander.Steffen@...ineon.com>
---
Feel free to merge this into Tadeusz' original commit.

 drivers/char/tpm/tpm-dev-common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c
index 344739223451..5eecad233ea1 100644
--- a/drivers/char/tpm/tpm-dev-common.c
+++ b/drivers/char/tpm/tpm-dev-common.c
@@ -140,7 +140,8 @@ ssize_t tpm_common_write(struct file *file, const char __user *buf,
 	 * tpm_read or a user_read_timer timeout. This also prevents split
 	 * buffered writes from blocking here.
 	 */
-	if (!priv->response_read || priv->command_enqueued) {
+	if ((!priv->response_read && priv->response_length) ||
+	    priv->command_enqueued) {
 		ret = -EBUSY;
 		goto out;
 	}
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ