Thread (9 messages) 9 messages, 3 authors, 2017-05-24

[PATCH] tpm: fix byte order related arithmetic inconsistency in tpm_getcap()

From: Luc Van Oostenryck <hidden>
Date: 2017-05-10 23:41:18
Also in: lkml

On Wed, May 10, 2017 at 2:34 PM, Jarkko Sakkinen
[off-list ref] wrote:
Arithmetic should work but it's not a good practice to do additions,
substractions or multiplications in any other byte order than the CPU
byte order.

sparse also complains about this.

/Jarkko
Arithmetic should work?
let's try with 0x0080:
in native order: 0x0080 + 0x0080 = 0x0100
in reverse order: 0x8000 + 0x8000 = 0x0000 != swap16(0x0100)

Or do I misunderstand what you mean by "arithmetic should work"?

-- Luc Van Oostenryck
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help