Skip to content
  • Kristina Martsenko's avatar
    arm64: enable ptrauth earlier · 50f60943
    Kristina Martsenko authored and Amit Kachhap's avatar Amit Kachhap committed
    
    
    When the kernel is compiled with pointer auth instructions, the boot CPU
    needs to start using address auth very early, so change the cpucap to
    account for this.
    
    Pointer auth must be enabled before we call C functions, because it is
    not possible to enter a function with pointer auth disabled and exit it
    with pointer auth enabled. Note, mismatches between architected and
    IMPDEF algorithms will still be caught by the cpufeature framework (the
    separate *_ARCH and *_IMP_DEF cpucaps).
    
    Note the change in behavior: if the boot CPU has address auth and a
    late CPU does not, then the late CPU is parked by the cpufeature
    framework. Also, if the boot CPU does not have address auth and the late
    CPU has then the late cpu will still boot but with ptrauth feature
    disabled.
    
    Leave generic authentication as a "system scope" cpucap for now, since
    initially the kernel will only use address authentication.
    
    Reviewed-by: default avatarKees Cook <keescook@chromium.org>
    Reviewed-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
    Signed-off-by: default avatarKristina Martsenko <kristina.martsenko@arm.com>
    [Amit: Re-worked ptrauth setup logic, comments]
    Signed-off-by: default avatarAmit Daniel Kachhap <amit.kachhap@arm.com>
    50f60943