Skip to content

Commit

Permalink
The alignment is passed into contigmalloc_domainset in the 7th argument.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
zxombie committed May 28, 2019
1 parent 7c1bc5f commit 81515d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/sys/malloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 81515d0

Please sign in to comment.