Re: RISC-V: Shadow Stack / Landing Pad Support

Kito Cheng via Gcc-help <[email protected]> Mon, 4 May 2026 20:50:04 +0800
Newsgroups gmane.comp.gcc.help
Message-ID <CA+yXCZAXE2q55tiZtwbAqXY+D6==crEJ-BYzjbEKoqiybT76CA@mail.gmail.com>
LLVM has implement software shadow stack  and use gp as shadow stack pointe=
r
https://clang.llvm.org/docs/ShadowCallStack.html

and there is -fsanitize=3Dkcfi -fsanitize=3Dcfi-icall and
-fsanitize=3Dfunction on LLVM side as well, that is software landing
pad, the complexity is depend on how safe you want, like HW landing
pad we have unlabeled and function signature based (this is not
upstream yet, because it's not get stable...).

Kees Cook is working on KCFI supporting for gcc:
https://patchwork.sourceware.org/project/gcc/list/?series=3D56147 but I
didn't take too much closer look yet.

Umesh Kalappa <[email protected]> =E6=96=BC 2026=E5=B9=B45=E6=9C=884=
=E6=97=A5=E9=80=B1=E4=B8=80 =E4=B8=8B=E5=8D=886:27=E5=AF=AB=E9=81=93=EF=BC=
=9A
>
> Hi Kito,
>
> Regarding the subject, we are working with a RISC-V hardware platform tha=
t does not provide native support for landing pad or shadow stack features.
>
> As a result, we are exploring implementing (emulating) these mechanisms a=
t the compiler (GCC) and runtime levels.
>
> Are you aware of any existing work, prior attempts, or ongoing efforts in=
 this direction?
>
> Thank you and Good Day
>
> ~U