The patch titled Subject: mm/vmalloc: fix size check for remap_vmalloc_range_partial() has been added to the -mm tree. Its filename is mm-vmalloc-fix-size-check-for-remap_vmalloc_range_partial.patch
This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-vmalloc-fix-size-check-for-remap... and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-vmalloc-fix-size-check-for-remap...
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: Roman Penyaev rpenyaev@suse.de Subject: mm/vmalloc: fix size check for remap_vmalloc_range_partial()
area->size can include adjacent guard page but get_vm_area_size() returns actual size of the area.
This fixes possible kernel crash when userspace tries to map area on 1 page bigger: size check passes but the following vmalloc_to_page() returns NULL on last guard (non-existing) page.
Link: http://lkml.kernel.org/r/20190103145954.16942-2-rpenyaev@suse.de Signed-off-by: Roman Penyaev rpenyaev@suse.de Cc: Michal Hocko mhocko@suse.com Cc: Andrey Ryabinin aryabinin@virtuozzo.com Cc: Joe Perches joe@perches.com Cc: "Luis R. Rodriguez" mcgrof@kernel.org Cc: stable@vger.kernel.org Signed-off-by: Andrew Morton akpm@linux-foundation.org ---
mm/vmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/mm/vmalloc.c~mm-vmalloc-fix-size-check-for-remap_vmalloc_range_partial +++ a/mm/vmalloc.c @@ -2248,7 +2248,7 @@ int remap_vmalloc_range_partial(struct v if (!(area->flags & VM_USERMAP)) return -EINVAL;
- if (kaddr + size > area->addr + area->size) + if (kaddr + size > area->addr + get_vm_area_size(area)) return -EINVAL;
do { _
Patches currently in -mm which might be from rpenyaev@suse.de are
epoll-make-sure-all-elements-in-ready-list-are-in-fifo-order.patch epoll-loosen-irq-safety-in-ep_poll_callback.patch epoll-unify-awaking-of-wakeup-source-on-ep_poll_callback-path.patch epoll-use-rwlock-in-order-to-reduce-ep_poll_callback-contention.patch mm-vmalloc-fix-size-check-for-remap_vmalloc_range_partial.patch mm-vmalloc-do-not-call-kmemleak_free-on-not-yet-accounted-memory.patch mm-vmalloc-pass-vm_usermap-flags-directly-to-__vmalloc_node_range.patch