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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180405101210.GA21636@linux.intel.com>
Date:   Thu, 5 Apr 2018 13:12:10 +0300
From:   Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To:     Nayna Jain <nayna@...ux.vnet.ibm.com>
Cc:     linux-integrity@...r.kernel.org, zohar@...ux.vnet.ibm.com,
        linux-security-module@...r.kernel.org,
        linux-kernel@...r.kernel.org, peterhuewe@....de,
        tpmdd@...horst.net, jgunthorpe@...idianresearch.com
Subject: Re: [PATCH] tpm: moves the delay_msec increment after sleep in
 tpm_transmit()

On Mon, Apr 02, 2018 at 09:50:06PM +0530, Nayna Jain wrote:
> Commit e2fb992d82c6 ("tpm: add retry logic") introduced a new loop to
> handle the TPM2_RC_RETRY error. The loop retries the command after
> sleeping for the specified time, which is incremented exponentially in
> every iteration. This patch fixes the initial sleep to be the default
> sleep time.

I think I understand the code change but do not understand what the
long description.

> 
> Fixes: commit e2fb992d82c6 ("tpm: add retry logic")
> Signed-off-by: Nayna Jain <nayna@...ux.vnet.ibm.com>
> Reviewed-by: Mimi Zohar <zohar@...ux.vnet.ibm.com>
> ---
>  drivers/char/tpm/tpm-interface.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> index c43a9e28995e..6201aab374e6 100644
> --- a/drivers/char/tpm/tpm-interface.c
> +++ b/drivers/char/tpm/tpm-interface.c
> @@ -587,7 +587,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
>  		 */
>  		if (rc == TPM2_RC_TESTING && cc == TPM2_CC_SELF_TEST)
>  			break;
> -		delay_msec *= 2;
> +

Extra whitespace

>  		if (delay_msec > TPM2_DURATION_LONG) {
>  			if (rc == TPM2_RC_RETRY)
>  				dev_err(&chip->dev, "in retry loop\n");
> @@ -597,6 +597,7 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
>  			break;
>  		}
>  		tpm_msleep(delay_msec);
> +		delay_msec *= 2;
>  		memcpy(buf, save, save_size);
>  	}
>  	return ret;
> -- 
> 2.13.6
> 

/Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ