aboutsummaryrefslogtreecommitdiff
path: root/lib/test_kasan.c
diff options
context:
space:
mode:
authorGravatar Chen Wandun <chenwandun@huawei.com> 2021-09-02 14:57:26 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org> 2021-09-03 09:58:14 -0700
commitf181234a5a21fd0a86b793330016b92c7b3ed8ee (patch)
tree1def8209a7e0c8dbdc59fe4fb7c0d683720b8f7d /lib/test_kasan.c
parentlib/test_vmalloc.c: add a new 'nr_pages' parameter (diff)
downloadlinux-f181234a5a21fd0a86b793330016b92c7b3ed8ee.tar.gz
linux-f181234a5a21fd0a86b793330016b92c7b3ed8ee.tar.bz2
linux-f181234a5a21fd0a86b793330016b92c7b3ed8ee.zip
mm/vmalloc: fix wrong behavior in vread
commit f608788cd2d6 ("mm/vmalloc: use rb_tree instead of list for vread() lookups") use rb_tree instread of list to speed up lookup, but function __find_vmap_area is try to find a vmap_area that include target address, if target address is smaller than the leftmost node in vmap_area_root, it will return NULL, then vread will read nothing. This behavior is different from the primitive semantics. The correct way is find the first vmap_are that bigger than target addr, that is what function find_vmap_area_exceed_addr does. Link: https://lkml.kernel.org/r/20210714015959.3204871-1-chenwandun@huawei.com Fixes: f608788cd2d6 ("mm/vmalloc: use rb_tree instead of list for vread() lookups") Signed-off-by: Chen Wandun <chenwandun@huawei.com> Reported-by: Hulk Robot <hulkci@huawei.com> Cc: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com> Cc: Uladzislau Rezki (Sony) <urezki@gmail.com> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/test_kasan.c')
0 files changed, 0 insertions, 0 deletions