Skip to content

Commit 81515d0

Browse files
committed
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
1 parent 7c1bc5f commit 81515d0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sys/sys/malloc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ void *contigmalloc(unsigned long size, struct malloc_type *type, int flags,
177177
void *contigmalloc_domainset(unsigned long size, struct malloc_type *type,
178178
struct domainset *ds, int flags, vm_paddr_t low, vm_paddr_t high,
179179
unsigned long alignment, vm_paddr_t boundary)
180-
__malloc_like __result_use_check __alloc_size(1) __alloc_align(6);
180+
__malloc_like __result_use_check __alloc_size(1) __alloc_align(7);
181181
void free(void *addr, struct malloc_type *type);
182182
void free_domain(void *addr, struct malloc_type *type);
183183
void *malloc(size_t size, struct malloc_type *type, int flags) __malloc_like

0 commit comments

Comments
 (0)