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]
Message-ID: <20210908133416.12408-1-fe@dev.tdt.de>
Date:   Wed,  8 Sep 2021 15:34:16 +0200
From:   Florian Eckert <fe@....tdt.de>
To:     peterhuewe@....de, jarkko@...nel.org, jgg@...pe.ca,
        Eckert.Florian@...glemail.com
Cc:     linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] tpm/tpm_i2c_infineon: Fix init endian vendor check

On my embedded system I use this tpm infineon chip via I2C.
My system is a MIPS architecture and therefore works in big endian mode.

The problem is that the chip type is not recognised, because the vendor ID
is incorrectly stored in memory.

By converting the vendor ID with ie32_to_cpus() to the correct format,
the TPM chip is recognised by the driver and works as expected.

Signed-off-by: Florian Eckert <fe@....tdt.de>
---
 drivers/char/tpm/tpm_i2c_infineon.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/char/tpm/tpm_i2c_infineon.c b/drivers/char/tpm/tpm_i2c_infineon.c
index a19d32cb4e94..111a8c34329a 100644
--- a/drivers/char/tpm/tpm_i2c_infineon.c
+++ b/drivers/char/tpm/tpm_i2c_infineon.c
@@ -638,6 +638,8 @@ static int tpm_tis_i2c_init(struct device *dev)
 		goto out_release;
 	}
 
+	le32_to_cpus(&vendor);
+
 	if (vendor == TPM_TIS_I2C_DID_VID_9645) {
 		tpm_dev.chip_type = SLB9645;
 	} else if (vendor == TPM_TIS_I2C_DID_VID_9635) {
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ