and footnote 114 says "Actions on objects so declared shall not be ‘‘optimized out’’ by an implementation or reordered except as permitted by the rules for evaluating expressions."
-
-
Replying to @tehjh @stephentyrone and
I think the intuition for this rule is that a "volatile variable" might actually be something like an IO port where reads cause the IO port to sequentially give you input bytes? so reading from it and ignoring the result is for dropping an input byte from the port's buffer?
1 reply 0 retweets 1 like -
Replying to @tehjh @stephentyrone and
see https://bennthomsen.wordpress.com/arduino/peripherals/serial-communications/ …: USART_Receive() reads serial data by reading `UDR0`, which expands through several macros into a dereference of a volatile MMIO pointer. so the volatile read from an MMIO region mutates state and must therefore not be removed.
2 replies 0 retweets 0 likes -
I completely agree, you cannot optimize out the reads. You could optimize away doing anything with the result of the read, however.
1 reply 0 retweets 3 likes -
Sigh
2 replies 0 retweets 0 likes -
Replying to @c_nich @stephentyrone and
I wonder how much side channel vulnerability that would leave you with? (That was the original inquiry, I'm guessing?)
1 reply 0 retweets 0 likes -
You'd be open to differential power attacks, but at least those are somewhat more difficult that basic timing attacks.
1 reply 0 retweets 0 likes -
if you branch off to a copy of the loop that only has volatile reads, you'd potentially have the following signals for a co-hosted attacker, I think: - instruction caches / combined caches (if the loop copy is in another cacheline) - branch target buffer - execution unit use
2 replies 0 retweets 3 likes -
You'll also still have a small timing signature because the consumer of the result won't depend on the reads after the first mismatch.
1 reply 0 retweets 1 like -
yeah, exactly, that's what i'm wondering: for modern side-channel timing attacks, what's the observable quantum? A single-cycle timing difference in a loop? (i have no idea and am genuinely curious)
1 reply 0 retweets 0 likes
I haven't actually played with that in practice; @lavados would probably be a better person to ask
-
-
Generally, any cycle difference can be observed...
1 reply 0 retweets 3 likes -
I guess you could mark "diff" as volatile as well, then every intermediate inner-loop |= write must also happen, not be optimized / combined / etc.
0 replies 0 retweets 0 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.