On Fri, Jan 13, 2017 at 09:36:34PM -0500, Stefan Berger wrote:
> header = cmd;
> + if (len < be32_to_cpu(header->length) ||
> + be32_to_cpu(header->length) < min_rx_length)
> + return -EFAULT;
> err = be32_to_cpu(header->return_code);
> if (err != 0 && desc)
Your earlier message points out the problem with this order, it seems
like we want a valid TPM error code to take precedence over a short
message. Isn't this better than hacking up things that check for
POSTINIT?
if (len < be32_to_cpu(header->length))
return -EFAULT;
err = be32_to_cpu(header->return_code);
if (err != 0)
[..]
if (be32_to_cpu(header->length) < min_rx_length)
return -EFAULT;
?
Jason
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
tpmdd-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tpmdd-devel