Daniel Micay Profile picture
Security researcher/engineer working on mobile privacy/security. Founder of @GrapheneOS.

Jun 10, 2020, 5 tweets

On x86_64, CONFIG_COMPAT_VDSO=Y disables the 32-bit vdso. Previously, (< 3.15) the option was used to disable vdso ASLR instead.

On arm64, CONFIG_COMPAT_VDSO=Y *enables* the 32-bit vdso.

Sometimes COMPAT means multiarch support. Other times, it means a compatibility workaround.

I never thought about it before, but the option has a totally reversed meaning on x86_64 and arm64. I realized how screwed up this is while trying to explain it to someone who got confused by it. The Linux kernel brainwashed me into thinking this stuff makes any sense at all.

32-bit multiarch support on x86_64 and arm64 is CONFIG_COMPAT. It's how most archs refer to this, although it's a really bad convention. Thanks to x32, CONFIG_COMPAT refers to multiarch rather than compat with legacy 32-bit code on x86_64. Maybe just say multiarch next time.

The legacy multiarch support for compatibility is CONFIG_IA32_EMULATION and x32 (horribly named Linux x86_64 ABI with 32-bit pointers) is CONFIG_X86_X32 (what?), with both depending on CONFIG_COMPAT. Just don't make the mistake of thinking COMPAT means multiarch consistently...

Instead of using a whole new kernel ABI for 32-bit pointers on x86_64, it could have easily been done entirely in userspace by using MAP_32BIT and zero extending 32-bit pointers to 64 pointers in system call wrappers. Why is this even a kernel feature? This was already used...

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling