]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Round up aligned_alloc() allocations
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 16 Nov 2020 23:06:43 +0000 (18:06 -0500)
committerKent Overstreet <kent.overstreet@gmail.com>
Mon, 16 Nov 2020 23:23:47 +0000 (18:23 -0500)
this fixes an address sanitizer splat

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
include/linux/vmalloc.h

index efcc1912765f8c81115ab4a0ade75ca8fe3bc2ac..c674d9a2c05737da3e94d21234dd366f59ecbab9 100644 (file)
@@ -16,6 +16,8 @@ static inline void *__vmalloc(unsigned long size, gfp_t gfp_mask)
 {
        void *p;
 
+       size = round_up(size, PAGE_SIZE);
+
        run_shrinkers();
 
        p = aligned_alloc(PAGE_SIZE, size);