Re: + mm-sanitize-page-mapping-for-tail-pages.patch added to -mm tree

From: Kirill A. Shutemov
Date: Thu Apr 02 2015 - 07:24:51 EST


On Fri, Mar 20, 2015 at 01:36:30PM -0700, akpm@xxxxxxxxxxxxxxxxxxxx wrote:
>
> The patch titled
> Subject: mm: sanitize page->mapping for tail pages
> has been added to the -mm tree. Its filename is
> mm-sanitize-page-mapping-for-tail-pages.patch
>
> This patch should soon appear at
> http://ozlabs.org/~akpm/mmots/broken-out/mm-sanitize-page-mapping-for-tail-pages.patch
> and later at
> http://ozlabs.org/~akpm/mmotm/broken-out/mm-sanitize-page-mapping-for-tail-pages.patch
>
> Before you just go and hit "reply", please:
> a) Consider who else should be cc'ed
> b) Prefer to cc a suitable mailing list as well
> c) Ideally: find the original patch on the mailing list and do a
> reply-to-all to that, adding suitable additional cc's
>
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
>
> The -mm tree is included into linux-next and is updated
> there every 3-4 working days
>
> ------------------------------------------------------
> From: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx>
> Subject: mm: sanitize page->mapping for tail pages
>
> We don't define meaning of page->mapping for tail pages. Currently it's
> always NULL, which can be inconsistent with head page and potentially lead
> to problems.
>
> Let's poison the pointer to catch all illigal uses.
>
> page_rmapping() and page_mapping() are changed to look on head page.


Could you replace the patch with the patch below. It also takes care about
page_anon_vma().