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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190328171926.4luwqofh67uwgt5e@dumbo>
Date:   Thu, 28 Mar 2019 18:19:26 +0100
From:   Domenico Andreoli <domenico.andreoli@...ux.com>
To:     Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
Cc:     linux-integrity@...r.kernel.org,
        linux-security-module@...r.kernel.org, pauldzim@...il.com,
        Peter Huewe <peterhuewe@....de>,
        Jason Gunthorpe <jgg@...pe.ca>, Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] tpm: turn on TPM on suspend for TPM 1.x

On Fri, Mar 22, 2019 at 12:51:20PM +0200, Jarkko Sakkinen wrote:
> tpm_chip_start/stop() should be also called for TPM 1.x devices on
> suspend. Add that functionality back. Do not lock the chip because
> it is unnecessary as there are no multiple threads using it when
> doing the suspend.
> 
> Fixes: a3fbfae82b4c ("tpm: take TPM chip power gating out of tpm_transmit()")
> Reported-by: Paul Zimmerman <pauldzim@...il.com>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
> ---
>  drivers/char/tpm/tpm-interface.c | 14 ++++++--------
>  1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> index 83ece5639f86..ae1030c9b086 100644
> --- a/drivers/char/tpm/tpm-interface.c
> +++ b/drivers/char/tpm/tpm-interface.c
> @@ -402,15 +402,13 @@ int tpm_pm_suspend(struct device *dev)
>  	if (chip->flags & TPM_CHIP_FLAG_ALWAYS_POWERED)
>  		return 0;
>  
> -	if (chip->flags & TPM_CHIP_FLAG_TPM2) {
> -		mutex_lock(&chip->tpm_mutex);
> -		if (!tpm_chip_start(chip)) {
> +	if (!tpm_chip_start(chip)) {
> +		if (chip->flags & TPM_CHIP_FLAG_TPM2)
>  			tpm2_shutdown(chip, TPM2_SU_STATE);
> -			tpm_chip_stop(chip);
> -		}
> -		mutex_unlock(&chip->tpm_mutex);
> -	} else {
> -		rc = tpm1_pm_suspend(chip, tpm_suspend_pcr);
> +		else
> +			rc = tpm1_pm_suspend(chip, tpm_suspend_pcr);
> +
> +		tpm_chip_stop(chip);
>  	}
>  
>  	return rc;

Tested-by: Domenico Andreoli <domenico.andreoli@...ux.com>

-- 
3B10 0CA1 8674 ACBA B4FE  FCD2 CE5B CF17 9960 DE13

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ