]> git.baikalelectronics.ru Git - kernel.git/commit
usercopy: Handle vm_map_ram() areas
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sun, 12 Jun 2022 21:32:25 +0000 (22:32 +0100)
committerKees Cook <keescook@chromium.org>
Mon, 13 Jun 2022 16:54:52 +0000 (09:54 -0700)
commit0258dfb4243b2c6df07b9013d45ca5cd49c08da2
tree853081efc2b49076ac29148901f66752393130ae
parentf74337421d8132a17ae905a6109a1c4d9d62b035
usercopy: Handle vm_map_ram() areas

vmalloc does not allocate a vm_struct for vm_map_ram() areas.  That causes
us to deny usercopies from those areas.  This affects XFS which uses
vm_map_ram() for its directories.

Fix this by calling find_vmap_area() instead of find_vm_area().

Fixes: 8c5276ad8b23 ("mm/usercopy: Detect vmalloc overruns")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Tested-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220612213227.3881769-2-willy@infradead.org
include/linux/vmalloc.h
mm/usercopy.c
mm/vmalloc.c