Commit b07f636f authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'tpmdd-next-20200108' of git://git.infradead.org/users/jjs/linux-tpmdd

Pull more tpmd fixes from Jarkko Sakkinen:
 "One critical regression fix (the faulty commit got merged in rc3, but
  also marked for stable)"

* tag 'tpmdd-next-20200108' of git://git.infradead.org/users/jjs/linux-tpmdd:
  tpm: Handle negative priv->response_len in tpm_common_read()
parents ae608821 a430e67d
...@@ -130,7 +130,7 @@ ssize_t tpm_common_read(struct file *file, char __user *buf, ...@@ -130,7 +130,7 @@ ssize_t tpm_common_read(struct file *file, char __user *buf,
priv->response_read = true; priv->response_read = true;
ret_size = min_t(ssize_t, size, priv->response_length); ret_size = min_t(ssize_t, size, priv->response_length);
if (!ret_size) { if (ret_size <= 0) {
priv->response_length = 0; priv->response_length = 0;
goto out; goto out;
} }
......
...@@ -14,7 +14,7 @@ struct file_priv { ...@@ -14,7 +14,7 @@ struct file_priv {
struct work_struct timeout_work; struct work_struct timeout_work;
struct work_struct async_work; struct work_struct async_work;
wait_queue_head_t async_wait; wait_queue_head_t async_wait;
size_t response_length; ssize_t response_length;
bool response_read; bool response_read;
bool command_enqueued; bool command_enqueued;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment