The patch titled Subject: mm/memory.c: prevent mapping typed pages to userspace has been added to the -mm tree. Its filename is mm-prevent-mapping-typed-pages-to-userspace.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-prevent-mapping-typed-pages-to-userspace.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-prevent-mapping-typed-pages-to-userspace.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/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Matthew Wilcox <willy@xxxxxxxxxxxxx> Subject: mm/memory.c: prevent mapping typed pages to userspace Pages which use page_type must never be mapped to userspace as it would destroy their page type. Add an explicit check for this instead of assuming that kernel drivers always get this right. Link: http://lkml.kernel.org/r/20190129053830.3749-1-willy@xxxxxxxxxxxxx Signed-off-by: Matthew Wilcox <willy@xxxxxxxxxxxxx> Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Cc: Will Deacon <will.deacon@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/memory.c~mm-prevent-mapping-typed-pages-to-userspace +++ a/mm/memory.c @@ -1452,7 +1452,7 @@ static int insert_page(struct vm_area_st spinlock_t *ptl; retval = -EINVAL; - if (PageAnon(page) || PageSlab(page)) + if (PageAnon(page) || PageSlab(page) || page_has_type(page)) goto out; retval = -ENOMEM; flush_dcache_page(page); _ Patches currently in -mm which might be from willy@xxxxxxxxxxxxx are mm-remove-sysctl_extfrag_handler.patch mm-remove-redundant-test-from-find_get_pages_contig.patch mm-prevent-mapping-slab-pages-to-userspace.patch mm-prevent-mapping-typed-pages-to-userspace.patch