From 51db9305898496a24db12f1ea312e4558d4e5772 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Tue, 28 May 2019 10:55:59 +0000 Subject: [PATCH] The alignment is passed into contigmalloc_domainset in the 7th argument. KUBSAN was complaining the pointer contigmalloc_domainset returned was misaligned. Fix this by using the correct argument to find the alignment in the function signature. Reported by: KUBSAN MFC after: 2 weeks Sponsored by: DARPA, AFRL --- sys/sys/malloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index fe3b265406d..4d213c2f036 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -177,7 +177,7 @@ void *contigmalloc(unsigned long size, struct malloc_type *type, int flags, void *contigmalloc_domainset(unsigned long size, struct malloc_type *type, struct domainset *ds, int flags, vm_paddr_t low, vm_paddr_t high, unsigned long alignment, vm_paddr_t boundary) - __malloc_like __result_use_check __alloc_size(1) __alloc_align(6); + __malloc_like __result_use_check __alloc_size(1) __alloc_align(7); void free(void *addr, struct malloc_type *type); void free_domain(void *addr, struct malloc_type *type); void *malloc(size_t size, struct malloc_type *type, int flags) __malloc_like