diff options
author | dillon <dillon@FreeBSD.org> | 2000-05-14 17:15:58 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2000-05-14 17:15:58 +0000 |
commit | 47d5b4051e7bac0ff16c116df992756c7ab288f3 (patch) | |
tree | 79d3d226ba0ec465c3b465e715bf3615f086b4e0 | |
parent | 923e94d40087c109f98d50d5eead16bc73ed8879 (diff) | |
download | FreeBSD-src-47d5b4051e7bac0ff16c116df992756c7ab288f3.zip FreeBSD-src-47d5b4051e7bac0ff16c116df992756c7ab288f3.tar.gz |
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>
-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 b59e317..29f4e7a 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; |