Re: [PATCH v2] tpm: Actually fail on TPM errors during "get random"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux