News for hackers. Stuff that matters.
Re:One Byte to rule them all by twoodfin on Saturday August 01, 2020 @02:04PM (#24022575)
Seems like the high-level lesson is that tagged unions as traditionally implemented can be vulnerable in a manner that pointer/address-focused mitigations don’t affect?
Re:One Byte to rule them all by tlb on Saturday August 01, 2020 @02:22PM (#24022702)
Indeed, a small integer tag seems much more vulnerable than a C++ virtual table pointer.

On modern hardware, how much is the penalty for using magic numbers instead of small indices? (A magic number meaning a constant like 0x85adb9ad instead of 2). The compiler can't optimize switch(it->type) using a jump table, but I suspect that branch prediction and speculation makes this optimization barely relevant.

Re:One Byte to rule them all by kevincox on Saturday August 01, 2020 @03:59PM (#24023409)
A jump table isn't likely used for very small unions anyways. The biggest downside that I see is that comparing with zero is slightly cheaper if that is a common value.
Re:One Byte to rule them all by saagarjha on Saturday August 01, 2020 @09:15PM (#24025474)
At the very end, there is speculation that things like this might get manual inclusion in these mitigations grounded in parts of Ivan Krstić's Black Hat talk from last year.