Skip to content
Snippets Groups Projects
  • Daniele Buono's avatar
    9e62ba48
    configure,meson: support Control-Flow Integrity · 9e62ba48
    Daniele Buono authored
    
    This patch adds a flag to enable/disable control flow integrity checks
    on indirect function calls.
    This feature only allows indirect function calls at runtime to functions
    with compatible signatures.
    
    This feature is only provided by LLVM/Clang, and depends on link-time
    optimization which is currently supported only with LLVM/Clang >= 6.0
    
    We also add an option to enable a debugging version of cfi, with verbose
    output in case of a CFI violation.
    
    CFI on indirect function calls does not support calls to functions in
    shared libraries (since they were not known at compile time), and such
    calls are forbidden. QEMU relies on dlopen/dlsym when using modules,
    so we make modules incompatible with CFI.
    
    All the checks are performed in meson.build. configure is only used to
    forward the flags to meson
    
    Signed-off-by: default avatarDaniele Buono <dbuono@linux.vnet.ibm.com>
    Message-Id: <20201204230615.2392-5-dbuono@linux.vnet.ibm.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    9e62ba48
    History
    configure,meson: support Control-Flow Integrity
    Daniele Buono authored
    
    This patch adds a flag to enable/disable control flow integrity checks
    on indirect function calls.
    This feature only allows indirect function calls at runtime to functions
    with compatible signatures.
    
    This feature is only provided by LLVM/Clang, and depends on link-time
    optimization which is currently supported only with LLVM/Clang >= 6.0
    
    We also add an option to enable a debugging version of cfi, with verbose
    output in case of a CFI violation.
    
    CFI on indirect function calls does not support calls to functions in
    shared libraries (since they were not known at compile time), and such
    calls are forbidden. QEMU relies on dlopen/dlsym when using modules,
    so we make modules incompatible with CFI.
    
    All the checks are performed in meson.build. configure is only used to
    forward the flags to meson
    
    Signed-off-by: default avatarDaniele Buono <dbuono@linux.vnet.ibm.com>
    Message-Id: <20201204230615.2392-5-dbuono@linux.vnet.ibm.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>