Author: jhb
Date: Fri Oct 13 21:58:44 2017
New Revision: 324611
URL: https://svnweb.freebsd.org/changeset/base/324611

Log:
  MFC 324073: Use UMA_ALIGNOF() for name cache UMA zones.
  
  This fixes kernel crashes due to misaligned accesses to the 64-bit
  time_t embedded in struct namecache_ts in MIPS n32 kernels.

Modified:
  stable/11/sys/kern/vfs_cache.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/sys/kern/vfs_cache.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/sys/kern/vfs_cache.c
==============================================================================
--- stable/11/sys/kern/vfs_cache.c      Fri Oct 13 21:54:34 2017        
(r324610)
+++ stable/11/sys/kern/vfs_cache.c      Fri Oct 13 21:58:44 2017        
(r324611)
@@ -1760,16 +1760,20 @@ nchinit(void *dummy __unused)
 
        cache_zone_small = uma_zcreate("S VFS Cache",
            sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1,
-           NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+           NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache),
+           UMA_ZONE_ZINIT);
        cache_zone_small_ts = uma_zcreate("STS VFS Cache",
            sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1,
-           NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+           NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts),
+           UMA_ZONE_ZINIT);
        cache_zone_large = uma_zcreate("L VFS Cache",
            sizeof(struct namecache) + NAME_MAX + 1,
-           NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+           NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache),
+           UMA_ZONE_ZINIT);
        cache_zone_large_ts = uma_zcreate("LTS VFS Cache",
            sizeof(struct namecache_ts) + NAME_MAX + 1,
-           NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
+           NULL, NULL, NULL, NULL, UMA_ALIGNOF(struct namecache_ts),
+           UMA_ZONE_ZINIT);
 
        nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash);
        ncbuckethash = cache_roundup_2(mp_ncpus * 64) - 1;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to