]> git.baikalelectronics.ru Git - kernel.git/commit
mm/usercopy: Detect vmalloc overruns
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 10 Jan 2022 23:15:28 +0000 (23:15 +0000)
committerKees Cook <keescook@chromium.org>
Wed, 13 Apr 2022 19:15:51 +0000 (12:15 -0700)
commit60ad8ce182230f31d79b080e7f81069f29b59f1f
tree5e358ea58cd25805b0b588bdbe198fb9d28e6733
parent9ee3f3422fb7546209ddd5c1421a882d44599922
mm/usercopy: Detect vmalloc overruns

If you have a vmalloc() allocation, or an address from calling vmap(),
you cannot overrun the vm_area which describes it, regardless of the
size of the underlying allocation.  This probably doesn't do much for
security because vmalloc comes with guard pages these days, but it
prevents usercopy aborts when copying to a vmap() of smaller pages.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220110231530.665970-3-willy@infradead.org
mm/usercopy.c