diff options
author | dg <dg@FreeBSD.org> | 1995-05-25 01:35:24 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-05-25 01:35:24 +0000 |
commit | a4ec59246f1ae1566f39b2ba1183f1f7d162cb46 (patch) | |
tree | d8e24731030c03fe1ed42d7824786e43f50fbeec /sys/fs/procfs/procfs_vnops.c | |
parent | e28ba9e18807abc8a6fc5b05e74a2be1b87ee5fe (diff) | |
download | FreeBSD-src-a4ec59246f1ae1566f39b2ba1183f1f7d162cb46.zip FreeBSD-src-a4ec59246f1ae1566f39b2ba1183f1f7d162cb46.tar.gz |
Fixed panic that resulted from mmaping files in kernfs and procfs. A
regular user could panic the machine with a simple "tail /proc/curproc/mem"
command. The problem was twofold: both kernfs and procfs didn't fill in
the mnt_stat statfs struct (which would later lead to an integer divide
fault in the vnode pager), and kernfs bogusly paniced if a bmap was
attempted.
Reviewed by: John Dyson
Diffstat (limited to 'sys/fs/procfs/procfs_vnops.c')
-rw-r--r-- | sys/fs/procfs/procfs_vnops.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/sys/fs/procfs/procfs_vnops.c b/sys/fs/procfs/procfs_vnops.c index 736b2fe..8decad4 100644 --- a/sys/fs/procfs/procfs_vnops.c +++ b/sys/fs/procfs/procfs_vnops.c @@ -36,7 +36,7 @@ * * @(#)procfs_vnops.c 8.6 (Berkeley) 2/7/94 * - * $Id: procfs_vnops.c,v 1.11 1995/04/15 03:20:31 davidg Exp $ + * $Id: procfs_vnops.c,v 1.12 1995/05/11 19:26:33 rgrimes Exp $ */ /* @@ -169,30 +169,6 @@ procfs_ioctl(ap) } /* - * do block mapping for pfsnode (vp). - * since we don't use the buffer cache - * for procfs this function should never - * be called. in any case, it's not clear - * what part of the kernel ever makes use - * of this function. for sanity, this is the - * usual no-op bmap, although returning - * (EIO) would be a reasonable alternative. - */ -int -procfs_bmap(ap) - struct vop_bmap_args *ap; -{ - - if (ap->a_vpp != NULL) - *ap->a_vpp = ap->a_vp; - if (ap->a_bnp != NULL) - *ap->a_bnp = ap->a_bn; - if (ap->a_runp != NULL) - *ap->a_runp = 0; - return (0); -} - -/* * _inactive is called when the pfsnode * is vrele'd and the reference count goes * to zero. (vp) will be on the vnode free @@ -428,10 +404,6 @@ procfs_getattr(ap) case Pmem: vap->va_nlink = 1; - vap->va_bytes = vap->va_size = - ctob(procp->p_vmspace->vm_tsize + - procp->p_vmspace->vm_dsize + - procp->p_vmspace->vm_ssize); /* * If we denied owner access earlier, then we have to * change the owner to root - otherwise 'ps' and friends |