non-x86 per-task stack canaries

From: Kees Cook
Date: Mon Jun 26 2017 - 17:04:13 EST


Hi,

The stack protector functionality on x86_64 uses %gs:0x28 (%gs is the
percpu area) for __stack_chk_guard, and all other architectures use a
global variable instead. This means we never change the stack canary
on non-x86 architectures which allows for a leak in one task to expose
the canary in another task.

I'm curious what thoughts people may have about how to get this
correctly implemented. Teaching the compiler about per-cpu data sounds
exciting. :)

-Kees

--
Kees Cook
Pixel Security