Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Sep 2019 14:25:52 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r352397 - stable/12/sys/sys
Message-ID:  <201909161425.x8GEPqsa023976@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Mon Sep 16 14:25:51 2019
New Revision: 352397
URL: https://svnweb.freebsd.org/changeset/base/352397

Log:
  MFC r348323:
  
  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
  Sponsored by:	DARPA, AFRL

Modified:
  stable/12/sys/sys/malloc.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/sys/malloc.h
==============================================================================
--- stable/12/sys/sys/malloc.h	Mon Sep 16 14:07:30 2019	(r352396)
+++ stable/12/sys/sys/malloc.h	Mon Sep 16 14:25:51 2019	(r352397)
@@ -177,7 +177,7 @@ void	*contigmalloc(unsigned long size, struct malloc_t
 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909161425.x8GEPqsa023976>