lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <01a23900329e605fcd41ad8962cfd8f2d9b1fa44.camel@intel.com>
Date:   Wed, 22 May 2019 19:26:47 +0000
From:   "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To:     "davem@...emloft.net" <davem@...emloft.net>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "mroos@...ux.ee" <mroos@...ux.ee>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "namit@...are.com" <namit@...are.com>,
        "luto@...nel.org" <luto@...nel.org>, "bp@...en8.de" <bp@...en8.de>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "Hansen, Dave" <dave.hansen@...el.com>,
        "sparclinux@...r.kernel.org" <sparclinux@...r.kernel.org>
Subject: Re: [PATCH v2] vmalloc: Fix issues with flush flag

On Wed, 2019-05-22 at 10:40 -0700, David Miller wrote:
> From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
> Date: Tue, 21 May 2019 01:59:54 +0000
> 
> > On Mon, 2019-05-20 at 18:43 -0700, David Miller wrote:
> > > From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
> > > Date: Tue, 21 May 2019 01:20:33 +0000
> > > 
> > > > Should it handle executing an unmapped page gracefully? Because
> > > > this
> > > > change is causing that to happen much earlier. If something was
> > > > relying
> > > > on a cached translation to execute something it could find the
> > > > mapping
> > > > disappear.
> > > 
> > > Does this work by not mapping any kernel mappings at the
> > > beginning,
> > > and then filling in the BPF mappings in response to faults?
> > No, nothing too fancy. It just flushes the vm mapping immediatly in
> > vfree for execute (and RO) mappings. The only thing that happens
> > around
> > allocation time is setting of a new flag to tell vmalloc to do the
> > flush.
> > 
> > The problem before was that the pages would be freed before the
> > execute
> > mapping was flushed. So then when the pages got recycled, random,
> > sometimes coming from userspace, data would be mapped as executable
> > in
> > the kernel by the un-flushed tlb entries.
> 
> If I am to understand things correctly, there was a case where 'end'
> could be smaller than 'start' when doing a range flush.  That would
> definitely kill some of the sparc64 TLB flush routines.

Ok, thanks.

The patch at the beginning of this thread doesn't have that behavior
though and it apparently still hung. I asked if Meelis could test with
this feature disabled and DEBUG_PAGEALLOC on, since it flushes on every
vfree and is not new logic, and also with a patch that logs exact TLB
flush ranges and fault addresses on top of the kernel having this
issue. Hopefully that will shed some light.

Sorry for all the noise and speculation on this. It has been difficult
to debug remotely with a tester and developer in different time zones.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ