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: <20170525223535.y4v4mf35gdgfs5bu@intel.com>
Date:   Thu, 25 May 2017 15:35:35 -0700
From:   Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To:     Stefan Berger <stefanb@...ux.vnet.ibm.com>
Cc:     tpmdd-devel@...ts.sourceforge.net,
        linux-security-module@...r.kernel.org,
        linux-kernel@...r.kernel.org, jgunthorpe@...idianresearch.com
Subject: Re: [PATCH v2] tpm: vtpm_proxy: Suppresse error logging when in
 closed state

On Thu, May 25, 2017 at 05:39:20PM -0400, Stefan Berger wrote:
> Suppress the error logging when the core TPM driver sends commands
> to the VTPM proxy driver and -EPIPE is returned in case the VTPM
> proxy driver is 'closed' (closed anonymous file descriptor).  This
> error code is only returned by the send function and by tpm_transmit
> when the VTPM proxy driver is being used.
> 
> Signed-off-by: Stefan Berger <stefanb@...ux.vnet.ibm.com>

This have to hold up until some time next week as I have to make sure
that I understand that this is the right choice, which requirest to
study vtpm implementation.

I'm travelling right now.

/Jarkko

> ---
>  drivers/char/tpm/tpm-interface.c | 4 ++--
>  drivers/char/tpm/tpm2-cmd.c      | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
> index d711186..4826fcf 100644
> --- a/drivers/char/tpm/tpm-interface.c
> +++ b/drivers/char/tpm/tpm-interface.c
> @@ -429,11 +429,11 @@ ssize_t tpm_transmit(struct tpm_chip *chip, struct tpm_space *space,
>  		goto out;
>  
>  	rc = chip->ops->send(chip, (u8 *) buf, count);
> -	if (rc < 0) {
> +	if (rc < 0 && rc != -EPIPE)
>  		dev_err(&chip->dev,
>  			"tpm_transmit: tpm_send: error %d\n", rc);
> +	if (rc < 0)
>  		goto out;
> -	}
>  
>  	if (chip->flags & TPM_CHIP_FLAG_IRQ)
>  		goto out_recv;
> diff --git a/drivers/char/tpm/tpm2-cmd.c b/drivers/char/tpm/tpm2-cmd.c
> index 3ee6883..3a99643 100644
> --- a/drivers/char/tpm/tpm2-cmd.c
> +++ b/drivers/char/tpm/tpm2-cmd.c
> @@ -840,7 +840,7 @@ void tpm2_shutdown(struct tpm_chip *chip, u16 shutdown_type)
>  	/* In places where shutdown command is sent there's no much we can do
>  	 * except print the error code on a system failure.
>  	 */
> -	if (rc < 0)
> +	if (rc < 0 && rc != -EPIPE)
>  		dev_warn(&chip->dev, "transmit returned %d while stopping the TPM",
>  			 rc);
>  }
> -- 
> 2.4.3
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ