From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:55361 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752537AbcJENRD (ORCPT ); Wed, 5 Oct 2016 09:17:03 -0400 Subject: Patch "tpm: fix byte-order for the value read by tpm2_get_tpm_pt" has been added to the 4.7-stable tree To: apronin@chromium.org, gregkh@linuxfoundation.org, jarkko.sakkinen@linux.intel.com, jgunthorpe@obsidianresearch.com Cc: , From: Date: Wed, 05 Oct 2016 15:10:23 +0200 Message-ID: <14756730238638@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled tpm: fix byte-order for the value read by tpm2_get_tpm_pt to the 4.7-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-fix-byte-order-for-the-value-read-by-tpm2_get_tpm_pt.patch and it can be found in the queue-4.7 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 1b0612b04090e416828c0dd5ed197b0913d834a0 Mon Sep 17 00:00:00 2001 From: "apronin@chromium.org" Date: Thu, 14 Jul 2016 18:07:18 -0700 Subject: tpm: fix byte-order for the value read by tpm2_get_tpm_pt From: apronin@chromium.org commit 1b0612b04090e416828c0dd5ed197b0913d834a0 upstream. The result must be converted from BE byte order, which is used by the TPM2 protocol. This has not popped out because tpm2_get_tpm_pt() has been only used for probing. Fixes: 7a1d7e6dd76a ("tpm: TPM 2.0 baseline support") Change-Id: I7d71cd379b1a3b7659d20a1b6008216762596590 Signed-off-by: Andrey Pronin Reviewed-by: Jason Gunthorpe Reviewed-by: Jarkko Sakkinen Signed-off-by: Jarkko Sakkinen Signed-off-by: Greg Kroah-Hartman --- drivers/char/tpm/tpm2-cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/char/tpm/tpm2-cmd.c +++ b/drivers/char/tpm/tpm2-cmd.c @@ -703,7 +703,7 @@ ssize_t tpm2_get_tpm_pt(struct tpm_chip rc = tpm_transmit_cmd(chip, &cmd, sizeof(cmd), desc); if (!rc) - *value = cmd.params.get_tpm_pt_out.value; + *value = be32_to_cpu(cmd.params.get_tpm_pt_out.value); return rc; } Patches currently in stable-queue which might be from apronin@chromium.org are queue-4.7/tpm-fix-byte-order-for-the-value-read-by-tpm2_get_tpm_pt.patch