linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* revisit arm64 per-task stack canaries
@ 2018-02-13 12:36 Ard Biesheuvel
  2018-02-13 12:52 ` Mark Rutland
  0 siblings, 1 reply; 13+ messages in thread
From: Ard Biesheuvel @ 2018-02-13 12:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hello all,

I guess my most recent emails kind of got lost in the avalanche of
Meltdown/Spectre related activities.

Now that the dust seems to have settled a bit, may I kindly bring this
topic to your attention again?

In summary, the default aarch64 way of using a single value for the
stack canary for all threads sharing an address space severely limits
the kernel's ability to implement stack canaries in a meaningful way.

Originally, we assumed that the only way to overcome this was to
implement per-CPU stack canaries, where each CPU loads the stack
canary of the task it executes at context switch. This is racy and
cumbersome in the presence of kernel support of VHE, which means the
per-CPU thread ID register is not fixed at compile time.

Instead, I have proposed a proof of concept [0] where the compiler
emits an instruction sequence that loads the canary directly from the
task struct, which is the per-thread data structure maintained by the
kernel. Accessing that can be done safely without any of the
limitations per-CPU variables have. The task struct pointer is kept in
system register sp_el0 while running in the kernel.

The purpose of this email to reach agreement between the various
stakeholders (mainly the arm64 linux maintainers and the ARM GCC
maintainers) on a way to proceed with implementing this in GCC.

So please, do share your opinions and questions on this matter, so
that we can settle this matter asap.

Kind regards,
Ard.


[0] http://www.workofard.com/2018/01/per-task-stack-canaries-for-arm64/

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-12-03 16:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-13 12:36 revisit arm64 per-task stack canaries Ard Biesheuvel
2018-02-13 12:52 ` Mark Rutland
2018-02-13 13:56   ` Ard Biesheuvel
2018-02-13 18:04     ` Will Deacon
2018-10-12 10:37       ` Ard Biesheuvel
2018-10-15 21:47         ` Kees Cook
2018-10-30 10:35         ` Will Deacon
2018-10-30 12:45           ` Ard Biesheuvel
2018-11-19 16:50             ` Ramana Radhakrishnan
2018-11-19 17:04               ` Ard Biesheuvel
2018-11-19 19:47                 ` Ard Biesheuvel
2018-12-03 10:16                   ` Ramana Radhakrishnan
2018-12-03 16:46                     ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).