lkml.org 
[lkml]   [2022]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC/RFT] CFI: Add support for gcc CFI in aarch64
+ Cc: linux-hardening@vger.kernel.org
On 12/18, Dan Li wrote:
> Based on Sami's patch[1], this patch makes the corresponding kernel
> configuration of CFI available when compiling the kernel with the gcc[2].
>
> The code after enabling cfi is as follows:
>
> int (*p)(void);
> int func (int)
> {
> p();
> }
>
> __cfi_func:
> .4byte 0x439d3502
> func:
> ......
> adrp x0, p
> add x0, x0, :lo12:p
> mov w1, 23592
> movk w1, 0x4601, lsl 16
> cmp w0, w1
> beq .L2
> ......
> bl cfi_check_failed
> .L2:
> blr x19
> ret
>
> In the compiler part[4], there are some differences from Sami's
> implementation[3], mainly including:

\
 
 \ /
  Last update: 2022-12-19 07:39    [W:0.157 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site