[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <HK0P153MB0322EB3EE51073CC021D4AEABF9C0@HK0P153MB0322.APCP153.PROD.OUTLOOK.COM>
Date: Mon, 15 Jun 2020 19:49:41 +0000
From: Dexuan Cui <decui@...rosoft.com>
To: vkuznets <vkuznets@...hat.com>, Christoph Hellwig <hch@....de>
CC: Stephen Hemminger <stephen@...workplumber.org>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...capital.net>,
Michael Kelley <mikelley@...rosoft.com>,
Ju-Hyoung Lee <juhlee@...rosoft.com>,
"x86@...nel.org" <x86@...nel.org>,
"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
KY Srinivasan <kys@...rosoft.com>
Subject: RE: hv_hypercall_pg page permissios
> From: linux-hyperv-owner@...r.kernel.org
> <linux-hyperv-owner@...r.kernel.org> On Behalf Of Dexuan Cui
> Sent: Monday, June 15, 2020 10:42 AM
> > >
> > > Hi hch,
> > > The patch is merged into the mainine recently, but unluckily we noticed
> > > a warning with CONFIG_DEBUG_WX=y
> > >
> > > Should we revert this patch, or figure out a way to ask the DEBUG_WX
> > > code to ignore this page?
> >
> > Are you sure it is hv_hypercall_pg?
> Yes, 100% sure. I printed the value of hv_hypercall_pg and and it matched the
> address in the warning line " x86/mm: Found insecure W+X mapping at
> address".
I did this experiment:
1. export vmalloc_exec and ptdump_walk_pgd_level_checkwx.
2. write a test module that calls them.
3. It turns out that every call of vmalloc_exec() triggers such a warning.
vmalloc_exec() uses PAGE_KERNEL_EXEC, which is defined as
(__PP|__RW| 0|___A| 0|___D| 0|___G)
It looks the logic in note_page() is: for_each_RW_page, if the NX bit is unset,
then report the page as an insecure W+X mapping. IMO this explains the
warning?
Thanks,
-- Dexuan
Powered by blists - more mailing lists