diff options
author | dillon <dillon@FreeBSD.org> | 1999-11-18 08:14:20 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 1999-11-18 08:14:20 +0000 |
commit | 13bf2dbc72bd9fa67cee228bb71599f28fa5deb4 (patch) | |
tree | 1e9f6177099f5830d031c29fd80bc1676466fbaf /sys/kern/vfs_vnops.c | |
parent | 52bb19a82f43badcc0e3eeed21c552fc0a012de6 (diff) | |
download | FreeBSD-src-13bf2dbc72bd9fa67cee228bb71599f28fa5deb4.zip FreeBSD-src-13bf2dbc72bd9fa67cee228bb71599f28fa5deb4.tar.gz |
Ensure that garbage from the kernel stack does not wind up being
returned to user mode in the spare fields of the stat structure.
PR: kern/14966
Reviewed by: dillon@freebsd.org
Submitted by: Kelly Yancey kbyanc@posi.net
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r-- | sys/kern/vfs_vnops.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 663897f..ebe3497 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -398,6 +398,14 @@ vn_stat(vp, sb, p) error = VOP_GETATTR(vp, vap, p->p_ucred, p); if (error) return (error); + + /* + * Zero the spare stat fields + */ + sb->st_lspare = 0; + sb->st_qspare[0] = 0; + sb->st_qspare[1] = 0; + /* * Copy from vattr table */ |