Skip to content
  • Peter Zijlstra's avatar
    x86/uaccess, kasan: Fix KASAN vs SMAP · 57b78a62
    Peter Zijlstra authored
    KASAN inserts extra code for every LOAD/STORE emitted by te compiler.
    Much of this code is simple and safe to run with AC=1, however the
    kasan_report() function, called on error, is most certainly not safe
    to call with AC=1.
    Therefore wrap kasan_report() in user_access_{save,restore}; which for
    x86 SMAP, saves/restores EFLAGS and clears AC before calling the real
    Also ensure all the functions are without __fentry__ hook. The
    function tracer is also not safe.
    Signed-off-by: default avatarPeter Zijlstra (Intel) <>
    Cc: Borislav Petkov <>
    Cc: Dmitry Vyukov <>
    Cc: Josh Poimboeuf <>
    Cc: Linus Torvalds <>
    Cc: Peter Zijlstra <>
    Cc: Thomas Gleixner <>
    Signed-off-by: default avatarIngo Molnar <>