Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Bringing Stack Clash Protection to Clang / x86 (llvm.org)
45 points by fcambus on Jan 31, 2021 | hide | past | favorite | 6 comments


This is a surprisingly deep look at what went into a fairly simple feature.


> Support for this flag landed in Clang in 2020 only for X86, SystemZ and PowerPC.

How relevant is x86 code in terms of security? Genuine question. I thought Firefox defaults to x86_64 now even Windows. And in open source land, wouldn’t any OS components that could be compiled with Clang be x86_64 as well?


I do believe x86 in this case encompasses x86_64 (I checked this on the llvm phabricator to be sure).


Oh? That’s great then. Not the kind of sloppiness I’d have expected in a compiler blog though. Especially since it deep dives into calling conventions, which differ quite a bit between the two.


In the LLVM project, x86_64 is handled inside the x86 namespace. To a compiler, there’s quite a lot of overlap between x86 and the 64-bit extensions that it makes sense to keep them together.

In the source, where the difference matters, you’ll see the prefix X86_32 and X86_64.


MSVC had this for as long as I can remember. I was a little surprised the major Linux compilers didn't have code to trigger guard pages on large allocations. It's not totally unreasonable to access a large buffer from the top down.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: