Skip to content

x86/mm: Ease W^X enforcement back to just a warning

Ani Sinha requested to merge anisinha/kernel-centos-stream-9:bz-2228318 into main

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2228318

Signed-off-by: Ani Sinha anisinha@redhat.com

    Currently, the "change_page_attr" (CPA) code refuses to create
    W+X mappings on 64-bit kernels.  There have been reports both
    from 32-bit[1] and from BPF[2] users where this change kept the
    system from booting.
    
    These reports are showing up even after about a month of soak
    time in -next.
    
    To avoid breaking anything, never enforce W^X.  Always warn
    and return the requested permissions even if a problem is
    detected.
    
    1. https://lore.kernel.org/all/CAMj1kXHcF_iK_g0OZSkSv56Wmr=eQGQwNstcNjLEfS=mm7a06w@mail.gmail.com/
    2. https://lore.kernel.org/bpf/c84cc27c1a5031a003039748c3c099732a718aec.camel@kernel.org/T/#u
    
    Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: x86@kernel.org
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Kees Cook <keescook@chromium.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    (cherry picked from commit c5129ecc12a3101555d8922b1e0aa90f91247ab6)
    Signed-off-by: Ani Sinha <anisinha@redhat.com>
    
Edited by Ani Sinha

Merge request reports