Skip to content
  • Vincenzo Frascino's avatar
    arm64: kasan: Enable in-kernel MTE · 174c0734
    Vincenzo Frascino authored
    
    
    Hardware tag-based KASAN relies on Memory Tagging Extension (MTE)
    feature and requires it to be enabled.
    
    The Tag Checking operation causes a synchronous data abort as
    a consequence of a tag check fault when MTE is configured in
    synchronous mode.
    
    Enable MTE in Synchronous mode in EL1 to provide a more immediate
    way of tag check failure detection in the kernel.
    
    As part of this change enable match-all tag for EL1 to allow the
    kernel to access user pages without faulting. This is required because
    the kernel does not have knowledge of the tags set by the user in a
    page.
    
    Note: For MTE, the TCF bit field in SCTLR_EL1 affects only EL1 in a
    similar way as TCF0 affects EL0.
    MTE that is built on top of the Top Byte Ignore (TBI) feature hence we
    enable it as part of this patch as well.
    
    Signed-off-by: default avatarVincenzo Frascino <vincenzo.frascino@arm.com>
    Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
    Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    ---
    Change-Id: I4d67497268bb7f0c2fc5dcacefa1e273df4af71d
    174c0734