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-prev] [day] [month] [year] [list]
Message-ID: <Z98nMDH5Anhwuwox@kernel.org>
Date: Sat, 22 Mar 2025 23:10:08 +0200
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Jonathan McDowell <noodles@...th.li>
Cc: Peter Huewe <peterhuewe@....de>, Jason Gunthorpe <jgg@...pe.ca>,
	James Bottomley <James.Bottomley@...senpartnership.com>,
	Stefan Berger <stefanb@...ux.ibm.com>,
	linux-integrity@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] tpm, tpm_tis: Workaround failed command reception on
 Infineon devices

On Fri, Mar 21, 2025 at 04:49:15PM +0000, Jonathan McDowell wrote:
> Jarkko, I've realised I've somehow introduced a typo in the patch below that
> means it doesn't fire correctly; I'm not sure how this happened as my local
> copy I was testing on is definitely correct. Would you like a one line fix
> up patch, or can you manually fix it up in your tree?
> 
> This hunk:
> 
> > @@ -545,9 +551,11 @@ static int tpm_tis_send_main(struct tpm_chip *chip, const u8 *buf, size_t len)
> > 		if (rc >= 0)
> > 			/* Data transfer done successfully */
> > 			break;
> > -		else if (rc != -EIO)
> > +		else if (rc != EAGAIN && rc != -EIO)
> > 			/* Data transfer failed, not recoverable */
> > 			return rc;
> > +
> > +		usleep_range(priv->timeout_min, priv->timeout_max);
> > 	}
> > 	/* go and do it */
> 
> should be "rc != -EAGAIN" - the "-" sign has somehow been lost.
> 
> Apologies for this, let me know what's easiest for you in terms of resolving
> it.

NP, I missed it too so we're in the same boat ;-)

I did:

$ git -P diff
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 4ab69c3e103c..ed0d3d8449b3 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -551,7 +551,7 @@ static int tpm_tis_send_main(struct tpm_chip *chip, const u8 *buf, size_t len)
 		if (rc >= 0)
 			/* Data transfer done successfully */
 			break;
-		else if (rc != EAGAIN && rc != -EIO)
+		else if (rc != -EAGAIN && rc != -EIO)
 			/* Data transfer failed, not recoverable */
 			return rc;

Ping, if anything else.

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ