[lkml]   [2020]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v3] ARM: smp: add support for per-task stack canaries
On 3/11/20 10:21 AM, Kees Cook wrote:
> On Mon, Mar 09, 2020 at 09:49:31AM -0700, Guenter Roeck wrote:
>> On Thu, Dec 06, 2018 at 09:32:57AM +0100, Ard Biesheuvel wrote:
>>> On ARM, we currently only change the value of the stack canary when
>>> switching tasks if the kernel was built for UP. On SMP kernels, this
>>> is impossible since the stack canary value is obtained via a global
>>> symbol reference, which means
>>> a) all running tasks on all CPUs must use the same value
>>> b) we can only modify the value when no kernel stack frames are live
>>> on any CPU, which is effectively never.
>>> So instead, use a GCC plugin to add a RTL pass that replaces each
>>> reference to the address of the __stack_chk_guard symbol with an
>>> expression that produces the address of the 'stack_canary' field
>>> that is added to struct thread_info. This way, each task will use
>>> its own randomized value.
>>> Cc: Russell King <>
>>> Cc: Kees Cook <>
>>> Cc: Emese Revfy <>
>>> Cc: Arnd Bergmann <>
>>> Cc: Laura Abbott <>
>>> Cc:
>>> Acked-by: Nicolas Pitre <>
>>> Signed-off-by: Ard Biesheuvel <>
>> Since this patch is in the tree, cc-option no longer works on
>> the arm architecture if CONFIG_STACKPROTECTOR_PER_TASK is enabled.
>> Any idea how to fix that ?
> I thought Arnd sent a patch to fix it and it got picked up?

Yes, but the fix is not upstream (it is only in -next), and I missed it.


 \ /
  Last update: 2020-03-11 19:31    [W:0.110 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site