Finding Spectre vulnerabilities with smatch
Finding Spectre vulnerabilities with smatch
Posted Apr 23, 2018 23:34 UTC (Mon) by excors (subscriber, #95769)In reply to: Finding Spectre vulnerabilities with smatch by mchehab
Parent article: Finding Spectre vulnerabilities with smatch
I don't see why that would be the case. An attacker could set e.g. f->index = 0x80000000. The CPU may (incorrectly) speculatively predict the bounds check will pass, then speculatively read format[f->index].name (which is about 32GB after 'format'), then speculatively execute the strlcpy and read characters from that name string. Any read can leak information about the address that was accessed (via its effect on the caches), and in this case the address is the value at an attacker-controlled location in a ~64GB region after 'format', so the attacker could use it to leak the contents of potentially sensitive memory.
Posted Apr 28, 2018 23:25 UTC (Sat)
by dvdeug (guest, #10998)
[Link] (1 responses)
Posted Apr 29, 2018 14:06 UTC (Sun)
by excors (subscriber, #95769)
[Link]
(In practice you'd need slightly more complicated code to avoid simply being optimised by the cache prefetcher etc, but presumably that kind of code comes up enough in benchmarks and/or real applications to be a worthwhile optimisation, given that Intel has been doing it for two decades.)
Finding Spectre vulnerabilities with smatch
Finding Spectre vulnerabilities with smatch