Skip to content

Support -mstack-protector-guard=sysreg for riscv #46685

Closed
@kees

Description

@kees
Bugzilla Link 47341
Version trunk
OS Linux
Blocks #4440
CC @efriedma-quic,@nickdesaulniers,@zygoloid,@stephenhines

Extended Description

The Linux kernel uses this for having a per-thread stack canary. Implementing this for both arm64 and riscv is desired.

For example, gcc's arm64 support is used like this in the kernel:

-mstack-protector-guard=sysreg
-mstack-protector-guard-reg=sp_el0
-mstack-protector-guard-offset=0

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=0a1213fa7432778b71a1c0166bf56660a3aab030

Here are discussions on the start of riscv support:

https://lore.kernel.org/lkml/CAJF2gTTr_ENhGRmjqNbGBhEc8y4D3YSqAResvwHuB1ykemKTUw@mail.gmail.com/

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:RISC-VbugzillaIssues migrated from bugzillaclang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions