This is a note to let you know that I've just added the patch titled

    tpm/tpm_i2c_stm_st33: Fix potential bug in tpm_stm_i2c_send

to the 3.10-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tpm-tpm_i2c_stm_st33-fix-potential-bug-in-tpm_stm_i2c_send.patch
and it can be found in the queue-3.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 1ba3b0b6f218072afe8372d12f1b6bf26a26008e Mon Sep 17 00:00:00 2001
From: Christophe Ricard <[email protected]>
Date: Mon, 1 Dec 2014 19:32:46 +0100
Subject: tpm/tpm_i2c_stm_st33: Fix potential bug in tpm_stm_i2c_send

From: Christophe Ricard <[email protected]>

commit 1ba3b0b6f218072afe8372d12f1b6bf26a26008e upstream.

When sending data in tpm_stm_i2c_send, each loop iteration send buf.
Send buf + i instead as the goal of this for loop is to send a number
of byte from buf that fit in burstcnt. Once those byte are sent, we are
supposed to send the next ones.

The driver was working because the burstcount value returns always the maximum 
size for a TPM
command or response. (0x800 for a command and 0x400 for a response).

Reviewed-by: Jason Gunthorpe <[email protected]>
Signed-off-by: Christophe Ricard <[email protected]>
Signed-off-by: Peter Huewe <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/char/tpm/tpm_i2c_stm_st33.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/char/tpm/tpm_i2c_stm_st33.c
+++ b/drivers/char/tpm/tpm_i2c_stm_st33.c
@@ -488,7 +488,7 @@ static int tpm_stm_i2c_send(struct tpm_c
                if (burstcnt < 0)
                        return burstcnt;
                size = min_t(int, len - i - 1, burstcnt);
-               ret = I2C_WRITE_DATA(client, TPM_DATA_FIFO, buf, size);
+               ret = I2C_WRITE_DATA(client, TPM_DATA_FIFO, buf + i, size);
                if (ret < 0)
                        goto out_err;
 


Patches currently in stable-queue which might be from 
[email protected] are

queue-3.10/tpm-tpm_i2c_stm_st33-fix-potential-bug-in-tpm_stm_i2c_send.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to