diff options
author | Matthew Dillon <dillon@FreeBSD.org> | 2000-05-14 17:15:58 +0000 |
---|---|---|
committer | Matthew Dillon <dillon@FreeBSD.org> | 2000-05-14 17:15:58 +0000 |
commit | 3d27b606b72111b5ed2d758b61390783067b3a56 (patch) | |
tree | a3ce6e68f75d1477770931fc5988ebe165fa19a2 /sys/dev/vn | |
parent | dd90ae7a872da23d70f28f944b9daa09be1bea7e (diff) | |
download | src-3d27b606b72111b5ed2d758b61390783067b3a56.tar.gz src-3d27b606b72111b5ed2d758b61390783067b3a56.zip |
Zero out the uio structure prior to initializing it. A garbage (uninitialized)
proc pointer is believed to have been the cause of panics related to vnconfig
on top of intr-optioned NFS mounts.
Reported by: "Sean O'Connell" <sean@stat.Duke.EDU>
Notes
Notes:
svn path=/head/; revision=60547
Diffstat (limited to 'sys/dev/vn')
-rw-r--r-- | sys/dev/vn/vn.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/vn/vn.c b/sys/dev/vn/vn.c index b59e317a338d..29f4e7a54453 100644 --- a/sys/dev/vn/vn.c +++ b/sys/dev/vn/vn.c @@ -277,8 +277,6 @@ vnstrategy(struct bio *bp) struct vn_softc *vn; int error; int isvplocked = 0; - struct uio auio; - struct iovec aiov; unit = dkunit(bp->bio_dev); vn = bp->bio_dev->si_drv1; @@ -360,6 +358,11 @@ vnstrategy(struct bio *bp) * B_INVAL because (for a write anyway), the buffer is * still valid. */ + struct uio auio; + struct iovec aiov; + + bzero(&auio, sizeof(auio)); + aiov.iov_base = bp->bio_data; aiov.iov_len = bp->bio_bcount; auio.uio_iov = &aiov; @@ -672,8 +675,6 @@ vniocattach_swap(vn, vio, dev, flag, p) int vnsetcred(struct vn_softc *vn, struct ucred *cred) { - struct uio auio; - struct iovec aiov; char *tmpbuf; int error = 0; @@ -690,7 +691,11 @@ vnsetcred(struct vn_softc *vn, struct ucred *cred) */ if (vn->sc_vp) { + struct uio auio; + struct iovec aiov; + tmpbuf = malloc(vn->sc_secsize, M_TEMP, M_WAITOK); + bzero(&auio, sizeof(auio)); aiov.iov_base = tmpbuf; aiov.iov_len = vn->sc_secsize; |