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: <1554144883.3029.20.camel@HansenPartnership.com>
Date:   Mon, 01 Apr 2019 11:54:43 -0700
From:   James Bottomley <James.Bottomley@...senPartnership.com>
To:     Kees Cook <keescook@...omium.org>,
        Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
Cc:     Jason Gunthorpe <jgg@...pe.ca>, Phil Baker <baker1tex@...il.com>,
        Craig Robson <craig@...tt.com>,
        Laura Abbott <labbott@...hat.com>,
        Tomas Winkler <tomas.winkler@...el.com>,
        Nayna Jain <nayna@...ux.vnet.ibm.com>,
        linux-kernel@...r.kernel.org, Peter Huewe <peterhuewe@....de>,
        Arnd Bergmann <arnd@...db.de>, linux-integrity@...r.kernel.org
Subject: Re: [PATCH v2] tpm: Actually fail on TPM errors during "get random"

On Mon, 2019-04-01 at 11:52 -0700, Kees Cook wrote:
> @@ -559,6 +559,9 @@ int tpm1_get_random(struct tpm_chip *chip, u8
> *dest, size_t max)
>  	rc = total ? (int)total : -EIO;
>  out:
>  	tpm_buf_destroy(&buf);
> +fail:
> +	if (rc > 0)
> +		rc = -EIO;
>  	return rc;
>  }

No: same problem.  If we're successful rc is set to total (a positive
integer) so as it falls through to fail: it's converted to -EIO which
means we never return success.

James

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ