[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170804081240.GF26029@dhcp22.suse.cz>
Date: Fri, 4 Aug 2017 10:12:40 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Igor Stoppa <igor.stoppa@...wei.com>
Cc: Jerome Glisse <jglisse@...hat.com>, Linux-MM <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-security-module@...r.kernel.org,
"kernel-hardening@...ts.openwall.com"
<kernel-hardening@...ts.openwall.com>,
Kees Cook <keescook@...gle.com>
Subject: Re: [RFC] Tagging of vmalloc pages for supporting the pmalloc
allocator
On Fri 04-08-17 11:02:46, Igor Stoppa wrote:
>
>
> On 03/08/17 18:15, Michal Hocko wrote:
>
> > I would check the one where we have mapping. It is rather unlikely
> > vmalloc users would touch this one.
>
> That was also the initial recommendation from Jerome Glisse, but it
> seemed unusable, because of the related comment.
>
> I should have asked for clarifications back then :-(
>
> But it's never too late ...
>
>
> struct page {
> /* First double word block */
> unsigned long flags; /* Atomic flags, some possibly
> * updated asynchronously */
> union {
> struct address_space *mapping; /* If low bit clear, points to
> * inode address_space, or NULL.
> * If page mapped as anonymous
> * memory, low bit is set, and
> * it points to anon_vma object:
> * see PAGE_MAPPING_ANON below.
> */
> ...
> }
>
> mapping seems to be used exclusively in 2 ways, based on the value of
> its lower bit.
Not really. The above applies to LRU pages. Please note that Slab pages
use s_mem and huge pages use compound_mapcount. If vmalloc pages are
using none of those already you can add a new field there.
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists