--- sys/fs/cd9660/cd9660_vnops.c.orig +++ sys/fs/cd9660/cd9660_vnops.c @@ -758,6 +758,9 @@ /* NOTREACHED */ } +_Static_assert(sizeof(struct ifid) <= sizeof(struct fid), + "struct ifid must be no larger than struct fid"); + /* * Vnode pointer to File handle */ --- sys/fs/cd9660/iso.h.orig +++ sys/fs/cd9660/iso.h @@ -267,7 +267,7 @@ u_short ifid_pad; cd_ino_t ifid_ino; long ifid_start; -}; +} __packed; #define VFSTOISOFS(mp) ((struct iso_mnt *)((mp)->mnt_data)) --- sys/fs/ext2fs/ext2_vnops.c.orig +++ sys/fs/ext2fs/ext2_vnops.c @@ -1889,6 +1889,8 @@ { struct inode *ip; struct ufid *ufhp; + _Static_assert(sizeof(struct ufid) <= sizeof(struct fid), + "struct ufid cannot be larger than struct fid"); ip = VTOI(ap->a_vp); ufhp = (struct ufid *)ap->a_fhp; --- sys/fs/ext2fs/inode.h.orig +++ sys/fs/ext2fs/inode.h @@ -191,7 +191,7 @@ uint16_t ufid_pad; /* Force 32-bit alignment. */ ino_t ufid_ino; /* File number (ino). */ uint32_t ufid_gen; /* Generation number. */ -}; +} __packed; #endif /* _KERNEL */ #endif /* !_FS_EXT2FS_INODE_H_ */ --- sys/fs/tarfs/tarfs.h.orig +++ sys/fs/tarfs/tarfs.h @@ -165,7 +165,7 @@ u_short data0; /* force alignment */ ino_t ino; unsigned long gen; -}; +} __packed; #define TARFS_NODE_LOCK(tnp) \ mtx_lock(&(tnp)->lock) --- sys/fs/tarfs/tarfs_vnops.c.orig +++ sys/fs/tarfs/tarfs_vnops.c @@ -668,6 +668,8 @@ { struct tarfs_fid *tfp; struct tarfs_node *tnp; + _Static_assert(sizeof(struct tarfs_fid) <= sizeof(struct fid), + "struct tarfs_fid cannot be larger than struct fid"); tfp = (struct tarfs_fid *)ap->a_fhp; tnp = VP_TO_TARFS_NODE(ap->a_vp);