Don't WARN about expected W+X pages on Xen
authorBen Hutchings <ben@decadent.org.uk>
Thu, 16 Mar 2017 03:05:43 +0000 (03:05 +0000)
committerBastian Blank <waldi@debian.org>
Fri, 22 Jun 2018 09:50:22 +0000 (10:50 +0100)
Currently Xen PV domains (or at least dom0) on amd64 tend to have a
large number of low kernel pages with W+X permissions.  It's not
obvious how to fix this, and we're not going to get any new
information by WARNing about this, but we do still want to hear about
other W+X cases.  So add a condition to the WARN_ON.

Gbp-Pq: Topic debian
Gbp-Pq: Name amd64-don-t-warn-about-expected-w+x-pages-on-xen.patch

arch/x86/mm/dump_pagetables.c

index 2a4849e92831b0f9771a2742b01c5a6c9c806a42..17a5af2568e477a89c17684ceaab62840f361696 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/seq_file.h>
+#include <xen/xen.h>
 
 #include <asm/pgtable.h>
 
@@ -260,7 +261,7 @@ static void note_page(struct seq_file *m, struct pg_state *st,
                pgprotval_t pr = pgprot_val(st->current_prot);
 
                if (st->check_wx && (pr & _PAGE_RW) && !(pr & _PAGE_NX)) {
-                       WARN_ONCE(1,
+                       WARN_ONCE(!(IS_ENABLED(CONFIG_X86_64) && xen_pv_domain()),
                                  "x86/mm: Found insecure W+X mapping at address %p/%pS\n",
                                  (void *)st->start_address,
                                  (void *)st->start_address);