]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Ensure that directory entry padding bytes are zeroed.
authorMark Johnston <markj@FreeBSD.org>
Fri, 23 Nov 2018 22:24:59 +0000 (22:24 +0000)
committerMark Johnston <markj@FreeBSD.org>
Fri, 23 Nov 2018 22:24:59 +0000 (22:24 +0000)
commit6d2e2df764199f0a15fd743e79599391959cc17d
tree94c64c4287d31c089acdf8d21713fdc093e76fe5
parent759436eb7cfdf0ec9de311e6d3dec58a7517faa6
Ensure that directory entry padding bytes are zeroed.

Directory entries must be padded to maintain alignment; in many
filesystems the padding was not initialized, resulting in stack
memory being copied out to userspace.  With the ino64 work there
are also some explicit pad fields in struct dirent.  Add a subroutine
to clear these bytes and use it in the in-tree filesystems.  The
NFS client is omitted for now as it was fixed separately in r340787.

Reported by: Thomas Barabosch, Fraunhofer FKIE
Reviewed by: kib
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
20 files changed:
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
sys/fs/autofs/autofs_vnops.c
sys/fs/cd9660/cd9660_vnops.c
sys/fs/devfs/devfs_devs.c
sys/fs/ext2fs/ext2_lookup.c
sys/fs/fdescfs/fdesc_vnops.c
sys/fs/fuse/fuse_internal.c
sys/fs/msdosfs/msdosfs_vnops.c
sys/fs/nandfs/nandfs_vnops.c
sys/fs/pseudofs/pseudofs_vnops.c
sys/fs/smbfs/smbfs_io.c
sys/fs/tmpfs/tmpfs_subr.c
sys/fs/tmpfs/tmpfs_vfsops.c
sys/fs/tmpfs/tmpfs_vnops.c
sys/fs/udf/udf_vnops.c
sys/kern/uipc_mqueue.c
sys/kern/vfs_export.c
sys/sys/dirent.h
sys/ufs/ufs/ufs_vnops.c