lkml.org 
[lkml]   [2022]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC PATCH v2 07/21] cfi: Add type helper macros
    On Fri, May 13, 2022 at 01:21:45PM -0700, Sami Tolvanen wrote:
    > With CONFIG_CFI_CLANG, assembly functions called indirectly
    > from C code must be annotated with type identifiers to pass CFI
    > checking. The compiler emits a __kcfi_typeid_<function> symbol for
    > each address-taken function declaration in C, which contains the
    > expected type identifier. Add typed versions of SYM_FUNC_START and
    > SYM_FUNC_START_ALIAS, which emit the type identifier before the
    > function.
    >
    > Signed-off-by: Sami Tolvanen <samitolvanen@google.com>

    And the reason to not make this change universally (i.e. directly in
    SYM_FUNC_START) is to minimize how many of these symbol annotations get
    emitted? (And to more directly indicate which asm is called indirectly?)

    What happens if an asm function is called indirectly and it doesn't have
    this annotation? (Is this case detectable at compile-time?)

    Regardless:

    Reviewed-by: Kees Cook <keescook@chromium.org>

    --
    Kees Cook

    \
     
     \ /
      Last update: 2022-05-14 23:50    [W:4.026 / U:0.256 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site